content
stringlengths
1
15.9M
\section{Introduction} \label{sec:intro} Observations of the Universe suggest that it is mostly composed of a mysterious dark matter, in addition to galaxies, and that the expansion is currently being accelerated by the mysterious dark energy. Understanding the nature of dark matter and dark energy is crucial for us to comprehend the evolution of the Universe. This is also one of the key science goals of next-generation surveys, such as the Dark Energy Spectroscopic Instrument (DESI) \citep{DESI2016}, Euclid \citep{Percival2019}, the Widefield ASKAP L-band Legacy All-sky Blind Survey (WALLABY) \citep{Koribalski2020}, the Square Kilometre Array (SKA) \citep{2020PASA...37....7S}, and the Legacy Survey of Space and Time (LSST) \citep{Ivezi2008}. However, observations of the Universe only provide us with information about galaxies, as non-luminous baryonic matter and dark matter are not directly detectable by telescopes. A commonly used method for leveraging this information to improve our understanding of the total matter in the Universe is the reconstruction of the matter density and velocity fields using galaxy surveys, in which galaxies trace the underlying matter distribution of the Universe. Peculiar velocities, which arise from the gravitational effects of matter density fluctuations, are good indicators of the matter density field in the nearby Universe. In linear perturbation theory, the relation between the peculiar velocity field of matter and galaxy contrast field is given by \citep{Strauss1995,Springob2014,Springob2016,Carrick2015 Boruah2020} \begin{equation} \label{betadef} {\bf V}({\bf r}) = \frac{ \beta}{4\pi}\int \frac{{\bf r'}-{\bf r}}{|{\bf r'}-{\bf r}|} \delta_{\rm g}({\bf r'}) {\rm d}{\bf r'}, \end{equation} with the velocity-density coupling parameter $\beta$ predicted to be \begin{equation} \beta = \frac{f}{b}\,. \end{equation} Here, $b\equiv\delta_{\rm g}/\delta$ is the biasing parameter, defined as the ratio between the galaxy contrast field $\delta_{\rm g}$ and matter density contrast field $\delta$. $f(\Omega_{\rm m})$ is the growth rate of the large scale structure, $f={\rm d} \ln \delta/ {\rm d}\ln a$, which is related to the matter density in standard Einstein gravity through the standard relation \begin{equation} f = \Omega_{\rm m} (z)^{0.545}\,. \end{equation} The parameter $\beta$ can be estimated using the so-called velocity-velocity comparison method, i.e. comparing the measured peculiar velocities to the (peculiar) velocity field reconstructed from the real-space density field, while this density field is reconstructed from the redshift-space galaxy catalogues \citep{Strauss1995,Ma2012,Springob2014,Erdogdu2006a, Springob2014,Carrick2015,Springob2016 Boruah2020,Lilow2021}. The measurement of $\beta$ parameter enables us to constrain the cosmological models. Comparing to the galaxy correlation function and power spectrum measurements, the velocity-velocity comparison is a much more accurate method to derive $\beta$ since it is almost free from cosmic variance \citep{Carrick2015,Qin2019b,Said2020,Lilow2021}. Particularly, if the peculiar velocities measured from the Type Ia supernovae samples are used to compare to the reconstructions \citep{Carrick2015 Boruah2020}, this method will give an extraordinary accurate estimation of $\beta$, especially when the supernovae are too sparse to calculate the correlation functions and power spectrum very precisely. In previous works \citep{Nusser1991,Zaroubi1995,Croft1997,Branchini1999,Kudlicki2000,Branchini2002,Erdogdu2006,Bilicki2008,Kitaura2012,Wang2012,Carrick2015}, the reconstruction of the velocity field from the density field is based on their relationship described by linear theory. However, this method does not well predict the velocity field around very dense regions, mainly due to complex nonlinear effects \citep{Wu2021}. Recently, artificial intelligence (AI) technology has been introduced into cosmology \citep[\& references therein]{Ravanbakhsh2017,Lucie-Smith2018,Merten2019,Carleo2019,Ntampaka2019}. Particularly, the utilization of the convolutional neural networks (CNN) for the density and velocity fields reconstruction \citep{Modi2018,He2019,Zhang2019,Mao2021,Pan2020,Wu2021,Hong2021,Ganeshaiah2022} becomes a promising toolkit in the study of the large-scale-structure (LSS) of the Universe. In this paper, we will use simulations to test a novel CNN architecture, the V-net \citep{Milletari2016}, for reconstructing the real-space density fields from the galaxy catalogues of redshift-space, and reconstructing the velocity fields from the density fields. We will also estimate the $\beta$ parameter by comparing the reconstructed velocity fields to the (simulated) galaxy peculiar velocity catalogues, in order to explore whether a reasonable cosmological constraint can be obtained from the A -predicted density and velocity fields. The paper is structured as follows. In Section~\ref{sec:datasim}, we introduce the simulation and the training data set, as well as the testing data set. In Section~\ref{sec:Unet}, we introduce the architecture of V-net. In Section~\ref{sec:recons}, we explore the density and velocity fields reconstruction. In Section~\ref{sec:beta}, we measure the $\beta$ parameter. A conclusion is presented in Section~\ref{sec:conc}. \section{Creating the mock data}\label{sec:datasim} \subsection{Particle simulations} We generated our mock catalogues and density and velocity fields using \textsc{pinocchio} (the PINpointing Orbit Crossing Collapsed Hierarchical Objects code, \citep{2002MNRAS.331..587M,2002ApJ...564....8M,2002MNRAS.333..623T,2013MNRAS.433.2389M,2015MNRAS.452..686C,2017MNRAS.465.4658M,2017JCAP...01..008R,2016Galax...4...53M}). \textsc{pinocchio} is a semi-analytical algorithm that simulates structure formation through Lagrangian perturbation theory and ellipsoidal collapse, rather than a full $N$-body particle evolution approach used in codes such as \textsc{Gadget} \citep{SpringelVolker2001,SpringelVolker2005}. This approach does not track the full evolution of particles on an individual basis, but rather traces perturbations on different scales through a grid approach and identifies haloes from ellipsoidal collapse. This approach provides a massive speed-up in CPU time, allowing us to generate a large number of training sets very quickly. To run the simulations, we chose values of the cosmological parameters given in Tab.~\ref{tab:cosmoparams}, which are taken from the maximum likelihood values estimated by the 9-year Wilkinson Microwave Anisotropy Probe (WMAP9) from \cite{2013ApJS..208...19H}. We assume a geometrically flat ($\Omega_k=0$) $\Lambda$CDM cosmology with the dark energy equation of state fixed to the cosmological constant value $w=-1$ and standard cold dark matter. \begin{table} \centering \begin{tabular}{ l c c } \hline Parameter & Symbol & Value \\ \hline Matter density & $\Omega_{\rm m}$ & 0.25 \\ Cosmological constant density & $\Omega_\Lambda$ & 0.75 \\ Baryon density & $\Omega_{\rm b}$ & 0.044\\ Hubble parameter & $H_0$ & 70 km/s/Mpc \\ Amplitude of fluctuations on scales of 8$h^{-1}$Mpc & $\sigma_8$ & 0.8 \\ Spectral index of perturbation & $n_{\rm s}$ & 0.96 \\ \hline \end{tabular} \caption{\label{tab:cosmoparams}The values of the cosmological parameters used for the \textsc{pinocchio} simulations.} \end{table} The initial simulations are run with a cubic periodic box of side $L=500 h^{-1} \mathrm{Mpc}$, each containing $512^3$ dark matter particles. This gives a particle mass of $6.4\times 10^{10} h^{-1} {\rm M}_\odot$. We set a minimum halo member particle number of 10, meaning the minimum halo mass is $6.4\times 10^{11} h^{-1} {\rm M}_\odot$. We generated a set of 42 simulations, each with a different initial condition defined by a change in the random seed. This change in initial condition was the only difference between the boxes, as we generated simulations for only a single set of cosmological parameters for this training and test set. The real space power spectra for all of these 42 simulations is shown in Figure~\ref{fig00}. \begin{figure*} \centering \includegraphics[width=80mm]{fig1.pdf} \caption{The density power spectrum of the simulations, measured in real space. The magenta curve is the average of the density power spectra of the dark matter of 42 simulation boxes. The pink area indicates the standard deviation of the 42 measurements. The green curve is the average of the density power spectra of the galaxies of the 42 simulation boxes. The grey area indicates the the standard deviation of the 42 measurements. } \label{fig00} \end{figure*} The output of each simulation is the position and velocity of the particles, and a halo catalogue with position and velocity of each halo. All simulation outputs are at redshift $z=0$, and we do not consider higher redshift matter distributions or construct a light cone that would include the effect of redshift evolution of the density field. The halo catalogue is an automatic output of the \textsc{pinocchio} code through the \textit{fragmentation} algorithm, which mimics the hierarchical process of accretion of matter and merging of haloes \cite{2002MNRAS.331..587M}. In this work, we use the haloes as proxies for the galaxies that will be observed, but with no selection based on observability or mass. Each simulation contains roughly 540,000 haloes, giving an average number density of $4.3\times 10^{-3} h^3 \mathrm{Mpc}^{-3}$, which is fairly close to the number density of the Two Micron All-Sky Survey (2MASS) Redshift survey \cite{1983ApJS...52...89H} (estimated to be $5.4\times 10^{-3} h^3 \mathrm{Mpc}^{-3}$). In Fig.~\ref{fig00}, the amplitude of the galaxy (halo) power spectrum is below that of the dark matter because the mean halo mass is small ($\sim 4.7\times 10^{12}h^{-1} {\rm M}_\odot$), leading to a galaxy bias less than unity \citep{Tinker2005,Basilakos2008,Qin2022}. \subsection{Training and testing data sets}\label{traintest} To generate a large number of training cubes, each of the 42 large simulation boxes has been divided into $4^3$ sub-cubes. The density and velocity field of each sub-cube is pixelised with $32^3$ pixels. This pixel size is $\sim4~h^{-1}{\rm Mpc}$, chosen as the best compromise to predict velocities from the smooth density fields which are compared to measured peculiar velocities \cite{Berlind2000,Carrick2015 Boruah2020,Springob2016}. We finally have 2,688 sub-cubes, each with side length of $125~h^{-1}{\rm Mpc}$. Around 20\% of these, i.e., 538 sub-cubes are randomly chosen as the testing data set. \begin{figure*} \centering \includegraphics[width=60mm]{fig2.pdf} \caption{The data augmentation used in this work. We randomly choose 6850 sub-cubes (blue squares) which have overlap areas to the unattached 2,150 sub-cubes (white squares).} \label{figdaug} \end{figure*} We applied data augmentation to the remaining 80\% of the sub-cubes to obtain 9,000 cubes as the training and validation data set. As illustrated in Fig.~\ref{figdaug}, we randomly choose 6,850 sub-cubes which have overlap areas to the unattached 2,150 sub-cubes. The minimum stride to both the unattached sub-cubes and other augmented sub-cubes is 8 pixels to avoid complete overlaps. Among these 9,000 sub-cubes, 20\% are used to validate CNN. The number of each type and at each stage of preprocessing is given in Table \ref{tab:numsubcubes}. \begin{table} \centering \begin{tabular}{l r } \hline Dataset & Number \\ \hline All sub-cubes & 2,688 \\ Testing set (no augmentation) & 538 \\ Sub-cubes (for training \& validation) before augmentation & 2,150 \\ Sub-cubes (for training \& validation) after augmentation & 9,000 \\ Training set (augmented) & 7,200 \\ Validation set (augmented) & 1,800 \\ \hline \end{tabular} \caption{Number of sub-cubes of size 125 $h^{-1}$ Mpc used in each stage of CNN training, validation and testing. } \label{tab:numsubcubes} \end{table} The density (contrast) field is defined as: \begin{equation} \delta({\bf r})=\frac{\rho({\bf r}) - \bar{\rho}}{ \bar\rho} \end{equation} where $\rho({\bf r})$ is the mass density at real-space position ${\bf r}$, $\bar\rho$ is the average mass density of the Universe. The cloud-in-cell (CIC) algorithm\footnote{We use the \textsc{python} package \textsc{Nbodykit} \url{https://github.com/bccp/nbodykit-cookbook/blob/master/recipes/painting.ipynb }.} is adopted to the dark matter particles to obtain the density field cubes. The density values vary over three orders of magnitude, and so we renormalize the density field using \begin{equation} \hat{\delta}= \ln(1+\rho/ \bar\rho) \end{equation} to reduce the variance. For the velocity field cubes, the velocities of each pixel is simply calculated by averaging over the velocities of the particles in each pixel. We renormalize the velocity field using \begin{equation} \label{normvel} {\bf u }({\bf r}) = \frac{{\bf V({\bf r})}}{\sigma_v} \end{equation} so that the velocities will have the similar order of magnitude as the density values. $\sigma_v=250$ km s$^{-1}$ is the velocity dispersion (the standard deviation of the velocities) of our simulations. Fig.~\ref{fig1} shows the probability distributions of $\hat{\delta}$ and $V \equiv \left| \bf{V} \right|$ in our simulations. \begin{figure*} \centering \includegraphics[width=73mm]{fig3a.pdf} \includegraphics[width=77mm]{fig3b.pdf} \caption{Probability distributions of normalized density $\hat{\delta}$ (left) and the velocity magnitude $V$ (right) in our simulation.} \label{fig1} \end{figure*} The galaxy contrast field cubes are obtained using the same method as above, but this time using the halo catalogue instead of the dark matter particles. However, before this is done, 20\% of the galaxies are separated out to create the peculiar velocity catalogue, which will be used only for estimating the $\beta$ parameter in the final stage. To obtain the redshift-space galaxy contrast field, the redshift-space distortions (RSDs) have been added into the Z-direction using\begin{equation} Z_{\rm rsd} = Z_{\rm real}+\frac{1+z_{\rm h}}{H(z_{\rm h})}V_{\rm Z} ~, \end{equation} where $Z_{\rm rsd}$ and $Z_{\rm real}$ are the Z-direction coordinates of galaxies in redshift and real space, respectively. $V_{\rm Z}$ is the Z-direction component of the galaxy velocity. $z_{\rm h}$ is the cosmological redshift of our simulation snapshot\footnote{If using a simulation of lightcone, $z_{\rm h}$ is the redshift of each galaxy.} and $H(z_{\rm h})$ is the Hubble parameter. \subsection{Galaxy peculiar velocity catalogues} Once we obtain the reconstructed {\it real-space} density and velocity fields from the redshift-space galaxy contrast field, we can compare the reconstructions to the measured peculiar velocities to estimate the cosmological parameter $\beta$. In observations, the measured peculiar velocity values are mainly obtained from galaxies using the Tully-Fisher relation \citep{Tully1977,Hong2019} or Fundamental Plane \citep{Djorgovski1987,Howlett2022}. Therefore, it is necessary to generate mock galaxy peculiar velocity catalogues in order to estimate $\beta$ in this paper. The estimation of $\beta$ is a separate task regardless of the RSDs and cosmological redshift of the galaxy mock catalogues mentioned in Section~\ref{traintest}. Therefore, to build the mock galaxy peculiar velocity catalogues, we can assign cosmological redshifts $z_{\rm h}$ to the galaxies based on their real-space distances $r$, although these galaxies are sub-sampled from the galaxy catalogues of the snapshots corresponding to cosmological redshift zero. The line-of-sight peculiar velocity of a galaxy is calculated using \begin{equation} s_{\rm g} ={\bf V}_{\rm g} \cdot \hat{{\bf r}} ~, \end{equation} where ${\bf V}_{\rm g}$ is the velocity of galaxies known from the simulations. $\hat{{\bf r}}$ is the unit vector corresponding to the real-space position ${\bf r}$, rather than setting the Z-direction as the line-of-sight. Then, the observed redshift of a galaxy is given by \cite{Colless2001,Hui2006,Davis2014,Scrimgeour2016,Qin2021a,Qin2021b} \begin{equation} \label{travp} 1+z_{\rm obs} = (1+z_{\rm h})\left(1+\frac{s_{\rm g}}{c}\right)~, \end{equation} where $c$ is the speed of light. The $z_{\rm obs}$ values will be used to estimate $\beta$ in Section~\ref{sec:beta}. \section{Machine learning architecture: V-net}\label{sec:Unet} The machine learning U-net architecture was initially proposed by \cite{Unet2015}. Overall, this method has a similar architecture to the convolutional autoencoder (CAE). Both U-net and CAE consist of two stages --- first, the encoding stage extracts features from the original image by increasing the number of channels and decreasing the image size of each channel. Then follows the decoding stage, which reconstructs the new image by decreasing the number of channels and increasing the image size of each channel. In addition to CAE, U-net uses concatenating both the outputs from the encoding stage and inputs from the decoding stage to convolve the outputs at the decoding stage, which prevents the loss of small-scale features in the CAE. \begin{figure*}[bt] \centering \includegraphics[width=\columnwidth]{fig4.png} \caption{The V-net architecture used to reconstruct the density and velocity fields in this work .} \label{fig1unet} \end{figure*} Recently, a three-dimensional extension of U-net, referred to as V-net, was proposed by \cite{Milletari2016}. The implementation of V-net has been utilized in the reconstruction of LSS in various studies, including \cite{Zhang2019,Hong2021,Wu2021}. The present study employs a CNN architecture, as depicted in Fig.~\ref{fig1unet}, which is based on the original V-net framework with modifications inspired by the works of \cite{Hong2021,Wu2021}. Regarding the density field reconstruction, the redshift-space galaxy contrast fields are set to be the inputs of the CNN architecture. The real-space density fields are set to be the outputs of the architecture. Each input galaxy contrast field has spatial dimension $32^3$ and one channel, i.e., it has a shape of $(32,~32,~32,~1)$. \begin{enumerate} \item First, they are fed into two convolution layers. Each convolution layer is designed to have 128 convolution kernels with a shape of $3^3$ and a scanning stride of 1. Also, the reflect padding, which adds the padding pixels to the boundaries by mirror-reflecting the inner pixels, is applied to ensure that the outputs have the same dimension as the inputs, as well as to minimize the loss of information around the boundaries. A batch normalization \cite{Ioffe2015} and a rectified linear unit (ReLU, \cite{Glorot2011}) activation function are used following each convolution layer. The final outputs of this step are a set of feature fields, and each feature field has a shape of $(32,~32,~32,~128)$. \item Then, these feature fields are fed into a max-pooling layer with a shape of $2^3$ and 2-stride. Only the maximum values from nearby $2^3$ pixels pass through the max-pooling layer, and the dimension of each feature field has been reduced to $(16,~16,~16,~128)$ in this step. \item For further feature extraction and compression, the outputs of the above step are processed by the same operations as steps~1--2 three more times. However, the number of convolution kernels used in each operation are changed to 256, 512, and 1024, and there is no max-pooling used in the third operation, as shown in the Fig.~\ref{fig1unet}. The final output of this step has a shape of $(4,~4,~4,~1024)$. \item Then, they are fed into a de-convolution (or transpose convolution) layer. This layer is designed to have a padding and 512 de-convolution kernels. Each de-convolution kernel has a shape of $3^3$ and the scanning stride is 2. A batch normalization and a ReLu activation function are applied. The final output has a shape of $(8,~8,~8,~512)$. \item The outputs of the above `decoding' step will be concatenated with the feature fields of the equivalent (with a size of (8,~8,~8,~512)) `encoding' stage. Then they will be fed into two convolution layers which are the same as Step~1, but using 512 convolution kernels. \item The outputs of the above step are processed using the same operations as Steps~4--5 twice, but using 256 and 128 kernels, respectively. There is no convolution layer used in the last operation. The final output of this step has a shape of $(32,32,32,256)$. \item To obtain the reconstructed density field, the feature fields are further processed by two convolution layers of 128 kernels. The kernel has a shape of $3^3$ and 1-stride. The padding, batch normalization and ReLU activation function are applied to the outputs of each convolution layer too. The final convolution layer has only one kernel and followed by a ReLU activation function. The shape of the convolution kernel is $3^3$ and the stride is 1. \item Finally, we obtain the density field reconstructed from the galaxy catalogues. To reconstruct the velocity field, the reconstructed density fields (rather than the galaxy contrast fields) are set to be the inputs of the CNN architecture. Each density field has a shape of $(32,~32,~32,~1)$ too. Correspondingly, the outputs of Step~6 will be processed by six convolution layers. The numbers of kernels used in the layers are listed in Fig.~\ref{fig1unet}. The final convolution layer has three kernels and followed by a linear activation function. The shape of each convolution kernel is $3^3$ and the stride is 1. \end{enumerate} We implement the \textsc{TensorFlow}\footnote{\textsc{TensorFlow}: \url{https://www.tensorflow.org/}} package to build the above architecture. The optimization method is the Adam algorithm \cite{Kingma2014}. The mini-batch size is 32. We stop training if the validation loss reaches its minimum and tend to be flat. \section{Reconstructing the density and velocity fields}\label{sec:recons} \subsection{Reconstructing the density field from the galaxy catalogue} \label{sec:recons_dens} We use the 9,000 training/validation galaxy cubes in redshift space and the density field cubes in real space as the inputs and output , respectively, in order to train the CNN. The trained V-net, corresponding to the minimum validation loss, is then applied to the 538 testing galaxy cubes to obtain the reconstructed density fields of the real space. We define the loss function as \begin{equation} \mathcal{L}_{\hat{\delta}} =\frac{1}{N_{\rm pix}}\sum^{N_{\rm pix}}_{i=1} \left( w_{{\rm \hat{\delta}},i} \left|\hat{\delta}_{{\rm p},i}-\hat{\delta}_{{\rm t},i} \right| \right) ~, \end{equation} where $\hat{\delta}_{{\rm p},i}$, $\hat{\delta}_{{\rm t},i}$, and $w_{\hat{\delta},i}$ are the prediction and true values of the normalize density, and the weight factor for the $i$-th pixel, respectively. \begin{figure*} \centering \includegraphics[width=\columnwidth]{fig5.pdf} \caption{ The decomposition of the density field. The top left panel shows an example slice of the true density field, the other panels show the decomposition of the slice. From top-middle to the bottom-right: void centers $\rho \leq 0.1 \bar{\rho}$), void boundaries $0.1 < \rho / \bar{\rho} \leq 0.5$), filaments $0.5 < \rho /\bar{\rho} \leq 1.7$), cluster outskirts $1.7 < \rho / \bar{\rho} \leq 5$), and cluster centers $\rho > 5 \bar{\rho}$). } \label{figdensweigh2} \end{figure*} \begin{figure*} \centering \includegraphics[width=51mm]{fig6a.pdf} \includegraphics[width=48mm]{fig6c.pdf} \includegraphics[width=51mm]{fig6b.pdf} \caption{ Left: Weights for reconstructing the density field, $w_{\hat{\delta}}$ as a function of true density field. Middle: Evolution of loss function as a function of learning rate (blue curve) and the learning rate we have adopted (orange line). Right: Loss function of density field reconstruction as a function of training epoch. } \label{figdensweightloss} \end{figure*} The lack of a weight factor $w_{\hat{\delta},i}$ results in an inability for the V-net to accurately reproduce the density field in both high and low density regions. This is likely caused by the imbalanced training data, where the model may overfit to the most frequently occurring class with $\hat{\delta} \sim 0.3$ ($\rho \sim \bar{\rho}$), leading to poor performance on under-represented classes in both extremely dense and underdense regions (see the left panel of Fig.~\ref{fig1}). Therefore, the inclusion of weight factors is crucial for improving predictions in both high and low density regions by adjusting for the imbalance in the training data. For matching the distribution of the reconstructed density values ${\delta}_{\rm p}$ to the true density values ${\delta}_{\rm t}$, we first decompose the density field into five regions as shown in Fig.~\ref{figdensweigh2}: void centers ($\hat{\delta}_{\rm t} \leq 0.1; \rho \leq 0.1 \bar{\rho}$; top-middle), void boundaries ($0.1 < \hat{\delta}_{\rm t} \leq 0.4; 0.1 < \rho / \bar{\rho} \leq 0.5$; top-right), filaments ($0.4 < \hat{\delta}_{\rm t} \leq 1; 0.5 < \rho /\bar{\rho} \leq 1.7$; bottom-left), cluster outskirts ($1 < \hat{\delta}_{\rm t} \leq 1.8; 1.7 < \rho / \bar{\rho} \leq 5$; bottom-middle), and cluster centers ($\hat{\delta}_{\rm t} > 1.8; \rho > 5 \bar{\rho}$; bottom-right). Then we find the optimal choice of the weight function at each of aformentioned five regions, \begin{equation}\label{field} w_{\hat{\delta},i}=\left\{ \begin{aligned} &1.3, &0< &\hat{\delta}_{{\rm t},i}\leq 0.1\\ &0.7, &0.1< &\hat{\delta}_{{\rm t},i}\leq 0.4 \\ &1.2\hat{\delta}_{{\rm t},i}+0.5, &0.4<&\hat{\delta}_{{\rm t},i}\leq1 \\ &2.3, &1<&\hat{\delta}_{{\rm t},i}\leq1.8 \\ &0.8\hat{\delta}_{{\rm t},i}^3-2.3656, &&\hat{\delta}_{{\rm t},i}>1.8 \\ \end{aligned} \right. , \end{equation} as shown in the left-side panel of Fig.~\ref{figdensweightloss}. The blue curve in the middle panel of Fig.~\ref{figdensweightloss} shows the evolution of loss function as a function of learning rate of the Adam optimizer. If the learning rate is lower than $10^{-6}$, the update of the parameters is too slow, which is presented as a flat slope of the blue curve. On the contrary, a too high learning rate ($>2\times10^{-3}$) prevents finding a solution. Therefore, we choose the learning rate $6\times10^{-5}$ for density field reconstruction. The right panel of Fig.~\ref{figdensweightloss} shows the training loss (blue curve) and validation loss (orange curve) with the learning rate $6 \times 10^{-5}$. Beyond epoch equal to 90, the validation loss tends to be flat, therefore, we stop training at epoch equal to 160. \begin{figure*} \centering \includegraphics[width=\columnwidth]{fig7.pdf} \caption{Comparison between the reconstructed density fields (top) and the true density fields (bottom) in XY-, XZ- and YZ-planes, respectively. The thickness of each slice is 4 $h^{-1}$ Mpc (one pixel size). } \label{fig5denrecon} \end{figure*} Fig.~\ref{fig5denrecon} shows the comparison between the reconstructed density field images (top panels) and the true density field images (bottom panels) in the XY-, XZ- and YZ-planes. The V-net predictions of tiny and large filaments, as well as the voids, match the true fields with high fidelity. Also, the V-net gives reasonable predictions of the density fields with less contamination from the RSDs (applied to the Z-direction) of the galaxy catalogues. Note that, however, the reconstructed filamentary structure is smoother and less complex than the true field, overall. Also, for some very massive clusters, our reconstruction exhibits somewhat different substructures than the true field (e.g., see YZ-plane with $(Y, Z) = (40~h^{-1}{\rm Mpc}$, $120~h^{-1}{\rm Mpc})$). We suspect this may be partially due to the limitation of our halo sample, which has a similar number density to the 2MASS Redshift survey. Structures associated with much smaller scales than the scales allowed by our halo sample may not be reconstructed well even with our CNN method. Therefore, to marginalize such problems, one may need to try either adopting galaxy/halo samples with higher number density or making the spatial resolution of the density cube lower. We leave both possibilities as future works. \begin{figure*} \centering \includegraphics[width=76mm]{fig8a.pdf}\includegraphics[width=74mm]{fig8b.pdf} \includegraphics[width=79mm]{fig8c.pdf} \includegraphics[width=71mm]{fig8d.pdf} \caption{ Top-left: Probability distributions of the reconstructed density values $\hat{\delta}_{\rm p}$ (green solid curve) and true density values $\hat{\delta}_{\rm t}$ (pink dashed curve) for 538 testing cubes, respectively. Top-right: Probability distribution of residual between the reconstructed and true density values for these cubes. Bottom-left: The reconstructed density values against the true values, with the white colored contours indicating the 68\%, 95\%, and 99.7\% confidence levels. Bottom-right: Two-point correlation functions of the reconstructed (blue) and true (orange) density fields for the averaging of 538 testing cubes, respectively. The unit of $r$ is $h^{-1} {\rm Mpc}$.} \label{figdenscomp} \end{figure*} In the top-left panel of Fig.~\ref{figdenscomp}, the distributions of the reconstructed density values $\hat{\delta}_{\rm p}$ of the 538 testing cubes is shown in green bars, while the corresponding true density values $\hat{\delta}_{\rm t}$ is shown in pink bars. The fractional residual between $\hat{\delta}_{\rm p}$ and $\hat{\delta}_{\rm t}$ is mostly smaller than 1, as displayed in the top-right panel. Note that, however, our V-net reconstruction does not reconstruct the probability distribution of density in highly underdense regions $\hat{\delta} < 0.1$ (i.e., $\rho < 0.1 \bar{\rho}$) well. While our changes of the weight factors could not remove such biases at the underdense pixels, these regions will not dominate the clustering and correlation function measurements, and therefore, the biases are negligible to constrain cosmology. The bottom-left panel shows $\hat{\delta}_{\rm p}$ against $\hat{\delta}_{\rm t}$, with the white colored contours indicating the 68\%, 95\%, and 99.7\% confidence levels. The reconstructed density values largely agree with the true density values. Note that there exist a small population with very high true density value and relatively low reconstructed value ($\hat{\delta}_{\rm p} \lesssim 3-4 \lesssim \hat{\delta}_{\rm t}; \rho_{\rm p} \lesssim 10^{3-4} \bar{\rho} \lesssim \rho_{\rm t}$), while there is no such population with very high reconstructed density value and relatively low true value ($\rho_{\rm t} \lesssim 10^{3-4} \bar{\rho} \lesssim \rho_{\rm p}$). This matches well with our observation in Fig.~\ref{figdenscomp} that the reconstructed density field is somewhat smoother than the true density field. In the bottom-right panel, the orange curve and the error bars are the average and the standard deviation of the two-point correlation function of the 538 true density fields, respectively, while the blue curve and the error bars are the average and the standard deviation of the correlation function of the 538 reconstructed density fields, respectively. As expected from the above analyses, both two-point correlation functions match well with each other within the error bar. The error bars of the orange colored curve represent the variance between the sub-cubes and the whole simulation box. i.e. cosmic variance. The error bars of the blue colored curve represent the cosmic variance combined with the errors caused by the CNN reconstruction. \subsection{Reconstructing the velocity field from the reconstructed density field} \label{sec:recons_vel} To reconstruct the velocity fields from the density fields, we first need to apply the V-net model trained from the above density field reconstruction to the 9,000 training galaxy contrast cubes to obtain 9,000 reconstructed density cubes. After that, we use these reconstructed density fields as the inputs to train the V-net. The V-net architecture for velocity reconstruction, which is slightly different from density field reconstruction, is presented in Section~\ref{sec:Unet} and Fig.~\ref{fig1unet}. The corresponding 9,000 true velocity field cubes, normalized using Eq.~\ref{normvel}, are set to be the outputs of the V-net for training. Then, the trained V-net with the minimum validation loss is applied to the 538 reconstructed test density fields to obtain the reconstructed test velocity fields. We define the loss function as: \begin{equation} \mathcal{L}_{u,\theta} = \mathcal{L}_u + \mathcal{L_\theta} =\frac{1}{N_{\rm pix}}\sum^{N_{\rm pix}}_{i=1} \left( w_{u,i} \left| u_{{\rm p},i}-u_{{\rm t},i} \right| + w_{\theta,i} \left|\cos\theta_{i}-1 \right| \right) ~ , \end{equation} where $u=|{\bf u}|$ denotes the amplitude of the normalized velocity, $\cos\theta$ is the angle between the predicted velocity and true velocity, and $w_{\theta}$ and $w_{u}$ are the weight factors for $\theta$ and $u$, respectively. \begin{figure*} \centering \includegraphics[width=66mm]{fig9b.pdf} \includegraphics[width=82.6mm]{fig9a.pdf} \caption{ The left panel shows the decomposition of an example slice of the true velocity field. The blue colored pixels shows the velocities in the interval $V_{\rm t} \leq 175~{\rm km~s^{-1}}$, the green colored pixels shows the velocities in the interval $175~{\rm km~s^{-1}} < V_{\rm t} \leq 500~{\rm km~s^{-1}} , the orange colored pixels shows the velocities in the interval $500~{\rm km~s^{-1}} < V_{\rm t} \leq 750~{\rm km~s^{-1}} , and the red colored pixels shows the velocities in the interval $V_{\rm t} > 750~{\rm km~s^{-1}} . The right panel shows the corresponding density field. } \label{figdenswei3} \end{figure*} \begin{figure*} \centering \includegraphics[width=50mm]{fig10a.pdf} \includegraphics[width=50mm]{fig10c.pdf} \includegraphics[width=50mm]{fig10b.pdf} \caption{Left: Weights for reconstructing the velocity field, $w_\theta$ and $w_u$ as functions of true density field. Middle: Evolution of loss function as a function of learning rate (blue curve) and the learning rate we have adopted (orange line). Right: Loss function of velocity field reconstruction as a function of training epoch. } \label{figvelweightloss} \end{figure*} Similar to what we have found in Section~\ref{sec:recons_dens}, without introducing any specific weight factors $w_\theta$ and $w_u$, the machine learning would try to match only the most common population, which have $V \sim 400~{\rm km~s^{-1}}$. As a result, we find that our method underestimates the velocities of both the larger and smaller amplitudes. Also, the directions of the velocities of larger amplitudes are not well predicted either. Therefore, similar to Section~\ref{sec:recons_dens}, the weight factors are required to reconstruct velocity fields with both large and small amplitudes well. Similar to what we have done in the previous subsection, we decompose the true velocity field into four regions as shown in Fig.~\ref{figdenswei3}: low-velocity region around void centers ($u_{\rm t} \leq 0.7; V_{\rm t} \leq 175~{\rm km~s^{-1}}$; blue), mid-velocity region ($0.7 < u_{\rm t} \leq 2; 175~{\rm km~s^{-1}} < V_{\rm t} \leq 500~{\rm km~s^{-1}}$; green), high-velocity region around void boundaries and filaments ($2 < u_{\rm t} \leq 3; 500~{\rm km~s^{-1}} < V_{\rm t} \leq 750~{\rm km~s^{-1}}$; orange), and very-high-velocity region around cluster outskirts ($u_{\rm t}>3; V_{\rm t} > 750~{\rm km~s^{-1}}$; red). We then find the optimal choice of the weight function for the velocity magnitude $w_{u}$ to match the distribution of the reconstructed velocities $V_{\rm p}$ to the true $V_{\rm t}$ for each of the aformentioned four regions. In case of the weight function for the velocity angle $w_\theta$, on the other hand, we do not apply the results of the velocity decomposition, mainly because the angular term in the loss function $\mathcal{L}_\theta \sim w_\theta \left| \cos \theta - 1 \right|$ has little dependency on the velocity magnitude. Instead, we find the optimal choice of $w_\theta$ at the entire range of $u_{\rm t}$, only assuming that the directional accuracy of velocity field is less important for velocities with lower magnitude. By matching the distribution of the reconstructed velocities ${\bf V}_{\rm p}$ to the true ${\bf V}_{\rm t}$ from the 538 testing data sets, we find the optimal weighting schedule is: \begin{equation} w_{\theta,i}= u_{{\rm t},i}^2+1~~,~~~~ w_{u,i}=\left\{ \begin{aligned} &-3.8u_{{\rm t},i}+3.66, &0< & u_{{\rm t},i} \leq0.7\\ &1, &0.7< & u_{{\rm t},i}\leq2 \\ &u_{{\rm t},i}^2-3, &2< &u_{{\rm t},i}\leq3 \\ &5.5u_{{\rm t},i}^2-43.5, & &u_{{\rm t},i}>3 \\ \end{aligned} \right. \end{equation} see left panel of Fig.~\ref{figvelweightloss}. The middle panel of Fig.~\ref{figvelweightloss} shows the evolution of the loss function as a function of the learning rate of the Adam optimizer. Similar to Fig.~\ref{figdensweightloss}, if the learning rate is lower than $10^{-6}$, the update of the parameters is too slow, while a too high learning rate ($>2\times10^{-3}$) prevents finding a solution. Therefore, we choose the learning rate $6\times10^{-5}$ for velocity field reconstruction. The right panel shows the training loss (blue curve) and validation loss (orange curve) by adopting the above learning rate. The validation loss tends to be flat beyond epoch 30, and therefore, we stop training at epoch 70. \begin{figure*} \centering \includegraphics[width=\columnwidth]{fig11a.pdf} \includegraphics[width=\columnwidth]{fig11b.pdf} \caption{Comparison between the reconstructed velocity fields (top) and the true velocity fields (middle) in XY-, XZ- and YZ-planes, respectively. The thickness of each slice is 4 $h^{-1}$~Mpc (one pixel size). The bottom panels show the corresponding true density fields. } \label{fig8velrecon} \end{figure*} Fig.~\ref{fig8velrecon} shows the comparison between the reconstructed velocity field images (top panels) and true velocity field images (bottom panels) in the XY-, XZ-, and YZ-planes. Overall, both the amplitudes and directions of the V-net predicted velocity excellently match the true velocity, as well as the large-scale-structure features. Also, as seen from the velocity fields in the XZ- and YZ-planes (the middle and right panels), there is no significant RSD contamination in the reconstructed real-space velocity fields. Note that, however, there is a significant difference on the velocity fields, both in terms of magnitude and direction, at the interface between filaments and massive clusters (XZ-plane with $(X,Z) = (30~h^{-1} {\rm Mpc}, 60~h^{-1}{\rm Mpc})$. Even with the dark matter-only semi-analytic simulations, such regions might be highly nonlinear and associated with energetic infall shock waves \cite{Hong2014b, Hong2015}. However, we expect that such local disagreement in nonlinear regions may not significantly affect our goal to estimate the $\beta$ parameter, and we leave it as future works. \begin{figure*} \centering \includegraphics[width=54mm]{fig12a.pdf} \includegraphics[width=48mm]{fig12b.pdf} \includegraphics[width=48mm]{fig12c.pdf} \includegraphics[width=\columnwidth]{fig12d.pdf} \caption{ Top-left: Distributions of the true velocity amplitudes $V_{\rm t}$ (pink dashed curve) and the reconstructed velocity amplitudes $V_{\rm p}$ (green solid curve). Top-middle: Distribution of the fractional residuals between $V_{\rm t}$ and $V_{\rm p}$. Top-right: The distribution of $\cos \theta$. Bottom: Comparisons between the three components of reconstructed velocities to their true velocity counterparts. The white colored contours indicate the 68\%, 95\%, and 99.7\% confidence levels.} \label{fig6histcompv} \end{figure*} In the top-left panel of Fig.~\ref{fig6histcompv}, the pink bars show the distribution of the true velocity amplitudes $V_{\rm t}$, while the green bars shows the distribution of the reconstructed velocity amplitudes $V_{\rm p}$, while the top-middle panel displays the fractional residuals between $V_{\rm t}$ and $V_{\rm p}$, most of which are smaller than 1. The top-right panel shows the distribution of $\cos\theta$. In an ideal reconstruction, $\cos \theta$ should be one , and most of our reconstructions have the value close to one. Note that a small fraction of the population have even negative value of $\cos \theta$, and we suspect that most of them would have very small velocity amplitude (see the bottom panel, for example). In the bottom panel, we plot the three components of the reconstructed velocities against the true velocities. The white colored contours indicate the 68\%, 95\%, and 99.7\% confidence levels, and the reconstructed velocity fields are largely agree with the true velocity fields. Interestingly, the distribution of true and reconstructed $V_Z$ is similar to those of $V_X$ and $V_Y$, indicating that our reconstruction does not suffer much of the RSD contamination. \section{Estimating the $\beta$ parameter}\label{sec:beta} Once we obtain the reconstructed real-space density and velocity fields, we can compare the reconstructions to the measured peculiar velocities to estimate the cosmological parameter $\beta$. Eq.~\ref{betadef} shows how the velocity field is coupled to the density field through the value of this parameter, which acts as a coupling coefficient. The reconstructed velocity $V_{\rm p}$ scales with the fiducial $\beta_{\rm fid}=0.52$ of the simulations, while the amplitudes of the measured peculiar velocities of galaxies $V_{\rm g}$ should scale with the measured $\beta$. Thus \citep{Springob2014,Springob2016}, \begin{equation} \frac{V_{\rm g}}{\beta} = \frac{V_{\rm p}}{\beta_{\rm fid}}~, \end{equation} and therefore, to measure $\beta$, the reconstructed velocity fields should be divided by the fiducial $\beta_{\rm fid}$. In observations, the measurement errors of galaxy peculiar velocities are very large (typically around 20--25\% error on distance estimates for Fundamental Plane and Tully-Fisher galaxies). To obtain a more accurate estimation of $\beta$, the measurement needs to be performed in terms of redshift \citep{Springob2014,Springob2016,Carrick2015,Boruah2020}. Therefore, to simulate the measurement procedure in real observations, we need to project the reconstructed velocity to the line-of-sight and re-scale to $\beta=1$ using \begin{equation} s =\frac{1}{\beta_{\rm fid}}{\bf V}_{\rm p}\cdot\hat{\bf r}~. \end{equation} Then we can calculate the observed redshift $z_{\rm p}$ (of a galaxy at real-space position ${\bf r}$) predicted from our reconstructions using \citep{Carrick2015,Boruah2020} \begin{equation} 1+z_{\rm p}=(1+z_{\rm h})\left[ 1+\frac{1}{c}(\beta s + {\bf V}_{\rm ext} \cdot\hat{\bf r}) \right] ~. \end{equation} The reconstruction is usually performed within a limited survey volume $D$, therefore a extra nuisance term ${\bf V}_{\rm ext}$, namely the residual bulk flow, is introduced to encapsulate contributions from beyond the reconstruction volume $D$, and we treat it as a free parameter in our analysis. The Hubble recessional redshift $z_{\rm h}$ is given by \citep{peebles1993,Carrick2015,Boruah2020}: \begin{equation} z_{\rm h}=\frac{1}{1+q_0}\left( 1-\sqrt{1-\frac{2H_0 r}{c}(1+q_0)} \right) ~, \end{equation} where the deceleration factor is given by $q_0={\Omega_{\rm m}}/{2}-\Omega_{\Lambda}$. In observations, to accurately estimate the $\beta$ parameter using the velocity-velocity comparison method, both the homogeneous and inhomogeneous Malmquist biases are required to be removed. The homogeneous Malmquist bias is a consequence of selection effects, while the inhomogeneous Malmquist bias arises from local density variations due to large-scale structure along the line of sight \citep{Strauss1995, Springob2016}. A commonly used method to remove these Malmquist biases is the Forward Likelihood estimation \citep{Pike2005}. However, in this paper, we use simulations with the exact positions of the mock galaxies, and the Malmquist biases are negligible. Therefore, we use the simple $\chi^2$ minimization to estimate $\beta$. The $\chi^2$ between the predicted redshift and the observed redshift of galaxies is given by \citep{Carrick2015,Boruah2020}: \begin{equation} \chi^2(\beta, {\bf V}_{\rm ext}) = \sum^{N_{\rm gal}}_{i=1}\frac{(cz_{{\rm obs},i}-cz_{{\rm p},i})^2}{\sigma_v^2} ~, \end{equation} where $z_{\rm obs}$ is given by Eq.~\ref{travp}. The true galaxy peculiar velocities are used to compute $z_{\rm obs}$, the measurement errors are zeros. Therefore, only the velocity dispersion $\sigma_v$ appears in the above $\chi^2$. The parameters $\beta$ and ${\bf V}_{\rm ext}$ are estimated by minimizing the above $\chi^2$. \begin{figure*} \centering \includegraphics[width=79mm]{fig13.pdf} \caption{Comparison between the $\beta$ measurements from the reconstructed velocity fields ($\beta_{\rm p}$) and those from the true velocity fields ($\beta_{\rm t}$) from the 538 testing sub-cubes. Top panel shows the probability distribution of $\beta_{\rm t}$. Right side panel shows the probability distribution of $\beta_{\rm p}$, the shade shows the 68\% certainty (1$\sigma$) level. Black dashes indicate the fiducial value $\beta_{\rm fid} = 0.52$. The 2D contours are the 68\%, 95\%, and 99.7\% certainty levels. Solid line indicates the diagonal ($\beta_{\rm p} = \beta_{\rm t}$). } \label{fig9betas} \end{figure*} In Fig.~\ref{fig9betas}, we plot the estimations using the reconstructed velocity field, $\beta_{\rm p}$, against the estimations from the true velocity field, $\beta_{\rm t}$, from the 538 testing sub-cubes. The estimated $\beta_{\rm p}$ value ($\beta_{\rm p} = 0.491^{+0.055}_{-0.060}$) agrees with the fiducial value $0.52$ (dashed-lines) within the 68\% confidence level, as shown in the shaded area in the right panel. However, the $\beta_{\rm p}$ estimated using the reconstructed velocity fields shows a systematic shift compared to the $\beta_{\rm t}$, which is estimated from the true fields ($\beta_{\rm t} = 0.526^{+0.042}_{-0.056}$). The scatters of $\beta_{\rm p}$ are result of the variance between the sub-cubes and the whole simulation box, as well as the variance between the V-net reconstructed fields and the true fields. \section{Conclusion}\label{sec:conc} The peculiar velocities of galaxies serve as a valuable tool for studying the gravitational potential field, allowing for a more direct measurement of the large-scale distribution of matter than positions of galaxies alone. However, effectively utilizing these velocities requires a precise prediction of the density and velocity fields. In this study, we evaluate the effectiveness of a Convolutional Neural Network (CNN) architecture, the V-net, in reconstructing these fields and making inferences about the growth rate of cosmological structure. In this work, the real-space density fields are reconstructed from input galaxy redshift catalogs using an initial V-net. Results indicate that tuning the loss function with density-dependent weights enhances the V-net's accuracy in predicting density values across both low- and high-density regions. Additionally, the reconstructed density fields exhibit minimal contamination from redshift-space distortions in the input galaxy catalogs. The velocity fields are then reconstructed from the density fields using another V-net. The results demonstrate that tuning the loss function with velocity-dependent weights enhances the accuracy of the V-net in predicting pixels with large velocity amplitudes. As with the reconstructed density fields, the velocity fields also exhibit reduced contamination from redshift-space distortions in the input galaxy catalogs. The estimation of the cosmological parameter $\beta$ through comparison of the reconstructed and true velocity fields yields results consistent with the fiducial value. While the $\beta$ values estimated using the reconstructed velocity fields exhibit a systematic offset relative to the true fields, they still agree with the fiducial value within $1\sigma$. This suggests that the density and velocity fields reconstructed using AI provide reasonably accurate constraints. This study successfully illustrates the concept of reconstructing large-scale density and velocity fields through the use of a CNN architecture. However, its scope is limited, as it only considers a cubic geometry without observational selection effects, simplistic peculiar velocity errors, and only a single cosmological model. To address these complexities, additional simulations and training would be necessary, and such efforts are left for future studies. \acknowledgments FQ, DP, and SEH are supported by the project \begin{CJK}{UTF8}{mj}우주거대구조를 이용한 암흑우주 연구\end{CJK} (``Understanding Dark Universe Using Large Scale Structure of the Universe''), funded by the Ministry of Science. CGS acknowledges support via the Basic Science Research Program from the National Research Foundation of South Korea (NRF) funded by the Ministry of Education (2018R1A6A1A06024977 and 2020R1I1A1A01073494). This work was supported by the high performance computing cluster Seondeok at the Korea Astronomy and Space Science Institute. \section{Introduction} \label{sec:intro} Observations of the Universe suggest that it is mostly composed of a mysterious dark matter, in addition to galaxies, and that the expansion is currently being accelerated by the mysterious dark energy. Understanding the nature of dark matter and dark energy is crucial for us to comprehend the evolution of the Universe. This is also one of the key science goals of next-generation surveys, such as the Dark Energy Spectroscopic Instrument (DESI) \citep{DESI2016}, Euclid \citep{Percival2019}, the Widefield ASKAP L-band Legacy All-sky Blind Survey (WALLABY) \citep{Koribalski2020}, the Square Kilometre Array (SKA) \citep{2020PASA...37....7S}, and the Legacy Survey of Space and Time (LSST) \citep{Ivezi2008}. However, observations of the Universe only provide us with information about galaxies, as non-luminous baryonic matter and dark matter are not directly detectable by telescopes. A commonly used method for leveraging this information to improve our understanding of the total matter in the Universe is the reconstruction of the matter density and velocity fields using galaxy surveys, in which galaxies trace the underlying matter distribution of the Universe. Peculiar velocities, which arise from the gravitational effects of matter density fluctuations, are good indicators of the matter density field in the nearby Universe. In linear perturbation theory, the relation between the peculiar velocity field of matter and galaxy contrast field is given by \citep{Strauss1995,Springob2014,Springob2016,Carrick2015 Boruah2020} \begin{equation} \label{betadef} {\bf V}({\bf r}) = \frac{ \beta}{4\pi}\int \frac{{\bf r'}-{\bf r}}{|{\bf r'}-{\bf r}|} \delta_{\rm g}({\bf r'}) {\rm d}{\bf r'}, \end{equation} with the velocity-density coupling parameter $\beta$ predicted to be \begin{equation} \beta = \frac{f}{b}\,. \end{equation} Here, $b\equiv\delta_{\rm g}/\delta$ is the biasing parameter, defined as the ratio between the galaxy contrast field $\delta_{\rm g}$ and matter density contrast field $\delta$. $f(\Omega_{\rm m})$ is the growth rate of the large scale structure, $f={\rm d} \ln \delta/ {\rm d}\ln a$, which is related to the matter density in standard Einstein gravity through the standard relation \begin{equation} f = \Omega_{\rm m} (z)^{0.545}\,. \end{equation} The parameter $\beta$ can be estimated using the so-called velocity-velocity comparison method, i.e. comparing the measured peculiar velocities to the (peculiar) velocity field reconstructed from the real-space density field, while this density field is reconstructed from the redshift-space galaxy catalogues \citep{Strauss1995,Ma2012,Springob2014,Erdogdu2006a, Springob2014,Carrick2015,Springob2016 Boruah2020,Lilow2021}. The measurement of $\beta$ parameter enables us to constrain the cosmological models. Comparing to the galaxy correlation function and power spectrum measurements, the velocity-velocity comparison is a much more accurate method to derive $\beta$ since it is almost free from cosmic variance \citep{Carrick2015,Qin2019b,Said2020,Lilow2021}. Particularly, if the peculiar velocities measured from the Type Ia supernovae samples are used to compare to the reconstructions \citep{Carrick2015 Boruah2020}, this method will give an extraordinary accurate estimation of $\beta$, especially when the supernovae are too sparse to calculate the correlation functions and power spectrum very precisely. In previous works \citep{Nusser1991,Zaroubi1995,Croft1997,Branchini1999,Kudlicki2000,Branchini2002,Erdogdu2006,Bilicki2008,Kitaura2012,Wang2012,Carrick2015}, the reconstruction of the velocity field from the density field is based on their relationship described by linear theory. However, this method does not well predict the velocity field around very dense regions, mainly due to complex nonlinear effects \citep{Wu2021}. Recently, artificial intelligence (AI) technology has been introduced into cosmology \citep[\& references therein]{Ravanbakhsh2017,Lucie-Smith2018,Merten2019,Carleo2019,Ntampaka2019}. Particularly, the utilization of the convolutional neural networks (CNN) for the density and velocity fields reconstruction \citep{Modi2018,He2019,Zhang2019,Mao2021,Pan2020,Wu2021,Hong2021,Ganeshaiah2022} becomes a promising toolkit in the study of the large-scale-structure (LSS) of the Universe. In this paper, we will use simulations to test a novel CNN architecture, the V-net \citep{Milletari2016}, for reconstructing the real-space density fields from the galaxy catalogues of redshift-space, and reconstructing the velocity fields from the density fields. We will also estimate the $\beta$ parameter by comparing the reconstructed velocity fields to the (simulated) galaxy peculiar velocity catalogues, in order to explore whether a reasonable cosmological constraint can be obtained from the A -predicted density and velocity fields. The paper is structured as follows. In Section~\ref{sec:datasim}, we introduce the simulation and the training data set, as well as the testing data set. In Section~\ref{sec:Unet}, we introduce the architecture of V-net. In Section~\ref{sec:recons}, we explore the density and velocity fields reconstruction. In Section~\ref{sec:beta}, we measure the $\beta$ parameter. A conclusion is presented in Section~\ref{sec:conc}. \section{Creating the mock data}\label{sec:datasim} \subsection{Particle simulations} We generated our mock catalogues and density and velocity fields using \textsc{pinocchio} (the PINpointing Orbit Crossing Collapsed Hierarchical Objects code, \citep{2002MNRAS.331..587M,2002ApJ...564....8M,2002MNRAS.333..623T,2013MNRAS.433.2389M,2015MNRAS.452..686C,2017MNRAS.465.4658M,2017JCAP...01..008R,2016Galax...4...53M}). \textsc{pinocchio} is a semi-analytical algorithm that simulates structure formation through Lagrangian perturbation theory and ellipsoidal collapse, rather than a full $N$-body particle evolution approach used in codes such as \textsc{Gadget} \citep{SpringelVolker2001,SpringelVolker2005}. This approach does not track the full evolution of particles on an individual basis, but rather traces perturbations on different scales through a grid approach and identifies haloes from ellipsoidal collapse. This approach provides a massive speed-up in CPU time, allowing us to generate a large number of training sets very quickly. To run the simulations, we chose values of the cosmological parameters given in Tab.~\ref{tab:cosmoparams}, which are taken from the maximum likelihood values estimated by the 9-year Wilkinson Microwave Anisotropy Probe (WMAP9) from \cite{2013ApJS..208...19H}. We assume a geometrically flat ($\Omega_k=0$) $\Lambda$CDM cosmology with the dark energy equation of state fixed to the cosmological constant value $w=-1$ and standard cold dark matter. \begin{table} \centering \begin{tabular}{ l c c } \hline Parameter & Symbol & Value \\ \hline Matter density & $\Omega_{\rm m}$ & 0.25 \\ Cosmological constant density & $\Omega_\Lambda$ & 0.75 \\ Baryon density & $\Omega_{\rm b}$ & 0.044\\ Hubble parameter & $H_0$ & 70 km/s/Mpc \\ Amplitude of fluctuations on scales of 8$h^{-1}$Mpc & $\sigma_8$ & 0.8 \\ Spectral index of perturbation & $n_{\rm s}$ & 0.96 \\ \hline \end{tabular} \caption{\label{tab:cosmoparams}The values of the cosmological parameters used for the \textsc{pinocchio} simulations.} \end{table} The initial simulations are run with a cubic periodic box of side $L=500 h^{-1} \mathrm{Mpc}$, each containing $512^3$ dark matter particles. This gives a particle mass of $6.4\times 10^{10} h^{-1} {\rm M}_\odot$. We set a minimum halo member particle number of 10, meaning the minimum halo mass is $6.4\times 10^{11} h^{-1} {\rm M}_\odot$. We generated a set of 42 simulations, each with a different initial condition defined by a change in the random seed. This change in initial condition was the only difference between the boxes, as we generated simulations for only a single set of cosmological parameters for this training and test set. The real space power spectra for all of these 42 simulations is shown in Figure~\ref{fig00}. \begin{figure*} \centering \includegraphics[width=80mm]{fig1.pdf} \caption{The density power spectrum of the simulations, measured in real space. The magenta curve is the average of the density power spectra of the dark matter of 42 simulation boxes. The pink area indicates the standard deviation of the 42 measurements. The green curve is the average of the density power spectra of the galaxies of the 42 simulation boxes. The grey area indicates the the standard deviation of the 42 measurements. } \label{fig00} \end{figure*} The output of each simulation is the position and velocity of the particles, and a halo catalogue with position and velocity of each halo. All simulation outputs are at redshift $z=0$, and we do not consider higher redshift matter distributions or construct a light cone that would include the effect of redshift evolution of the density field. The halo catalogue is an automatic output of the \textsc{pinocchio} code through the \textit{fragmentation} algorithm, which mimics the hierarchical process of accretion of matter and merging of haloes \cite{2002MNRAS.331..587M}. In this work, we use the haloes as proxies for the galaxies that will be observed, but with no selection based on observability or mass. Each simulation contains roughly 540,000 haloes, giving an average number density of $4.3\times 10^{-3} h^3 \mathrm{Mpc}^{-3}$, which is fairly close to the number density of the Two Micron All-Sky Survey (2MASS) Redshift survey \cite{1983ApJS...52...89H} (estimated to be $5.4\times 10^{-3} h^3 \mathrm{Mpc}^{-3}$). In Fig.~\ref{fig00}, the amplitude of the galaxy (halo) power spectrum is below that of the dark matter because the mean halo mass is small ($\sim 4.7\times 10^{12}h^{-1} {\rm M}_\odot$), leading to a galaxy bias less than unity \citep{Tinker2005,Basilakos2008,Qin2022}. \subsection{Training and testing data sets}\label{traintest} To generate a large number of training cubes, each of the 42 large simulation boxes has been divided into $4^3$ sub-cubes. The density and velocity field of each sub-cube is pixelised with $32^3$ pixels. This pixel size is $\sim4~h^{-1}{\rm Mpc}$, chosen as the best compromise to predict velocities from the smooth density fields which are compared to measured peculiar velocities \cite{Berlind2000,Carrick2015 Boruah2020,Springob2016}. We finally have 2,688 sub-cubes, each with side length of $125~h^{-1}{\rm Mpc}$. Around 20\% of these, i.e., 538 sub-cubes are randomly chosen as the testing data set. \begin{figure*} \centering \includegraphics[width=60mm]{fig2.pdf} \caption{The data augmentation used in this work. We randomly choose 6850 sub-cubes (blue squares) which have overlap areas to the unattached 2,150 sub-cubes (white squares).} \label{figdaug} \end{figure*} We applied data augmentation to the remaining 80\% of the sub-cubes to obtain 9,000 cubes as the training and validation data set. As illustrated in Fig.~\ref{figdaug}, we randomly choose 6,850 sub-cubes which have overlap areas to the unattached 2,150 sub-cubes. The minimum stride to both the unattached sub-cubes and other augmented sub-cubes is 8 pixels to avoid complete overlaps. Among these 9,000 sub-cubes, 20\% are used to validate CNN. The number of each type and at each stage of preprocessing is given in Table \ref{tab:numsubcubes}. \begin{table} \centering \begin{tabular}{l r } \hline Dataset & Number \\ \hline All sub-cubes & 2,688 \\ Testing set (no augmentation) & 538 \\ Sub-cubes (for training \& validation) before augmentation & 2,150 \\ Sub-cubes (for training \& validation) after augmentation & 9,000 \\ Training set (augmented) & 7,200 \\ Validation set (augmented) & 1,800 \\ \hline \end{tabular} \caption{Number of sub-cubes of size 125 $h^{-1}$ Mpc used in each stage of CNN training, validation and testing. } \label{tab:numsubcubes} \end{table} The density (contrast) field is defined as: \begin{equation} \delta({\bf r})=\frac{\rho({\bf r}) - \bar{\rho}}{ \bar\rho} \end{equation} where $\rho({\bf r})$ is the mass density at real-space position ${\bf r}$, $\bar\rho$ is the average mass density of the Universe. The cloud-in-cell (CIC) algorithm\footnote{We use the \textsc{python} package \textsc{Nbodykit} \url{https://github.com/bccp/nbodykit-cookbook/blob/master/recipes/painting.ipynb }.} is adopted to the dark matter particles to obtain the density field cubes. The density values vary over three orders of magnitude, and so we renormalize the density field using \begin{equation} \hat{\delta}= \ln(1+\rho/ \bar\rho) \end{equation} to reduce the variance. For the velocity field cubes, the velocities of each pixel is simply calculated by averaging over the velocities of the particles in each pixel. We renormalize the velocity field using \begin{equation} \label{normvel} {\bf u }({\bf r}) = \frac{{\bf V({\bf r})}}{\sigma_v} \end{equation} so that the velocities will have the similar order of magnitude as the density values. $\sigma_v=250$ km s$^{-1}$ is the velocity dispersion (the standard deviation of the velocities) of our simulations. Fig.~\ref{fig1} shows the probability distributions of $\hat{\delta}$ and $V \equiv \left| \bf{V} \right|$ in our simulations. \begin{figure*} \centering \includegraphics[width=73mm]{fig3a.pdf} \includegraphics[width=77mm]{fig3b.pdf} \caption{Probability distributions of normalized density $\hat{\delta}$ (left) and the velocity magnitude $V$ (right) in our simulation.} \label{fig1} \end{figure*} The galaxy contrast field cubes are obtained using the same method as above, but this time using the halo catalogue instead of the dark matter particles. However, before this is done, 20\% of the galaxies are separated out to create the peculiar velocity catalogue, which will be used only for estimating the $\beta$ parameter in the final stage. To obtain the redshift-space galaxy contrast field, the redshift-space distortions (RSDs) have been added into the Z-direction using\begin{equation} Z_{\rm rsd} = Z_{\rm real}+\frac{1+z_{\rm h}}{H(z_{\rm h})}V_{\rm Z} ~, \end{equation} where $Z_{\rm rsd}$ and $Z_{\rm real}$ are the Z-direction coordinates of galaxies in redshift and real space, respectively. $V_{\rm Z}$ is the Z-direction component of the galaxy velocity. $z_{\rm h}$ is the cosmological redshift of our simulation snapshot\footnote{If using a simulation of lightcone, $z_{\rm h}$ is the redshift of each galaxy.} and $H(z_{\rm h})$ is the Hubble parameter. \subsection{Galaxy peculiar velocity catalogues} Once we obtain the reconstructed {\it real-space} density and velocity fields from the redshift-space galaxy contrast field, we can compare the reconstructions to the measured peculiar velocities to estimate the cosmological parameter $\beta$. In observations, the measured peculiar velocity values are mainly obtained from galaxies using the Tully-Fisher relation \citep{Tully1977,Hong2019} or Fundamental Plane \citep{Djorgovski1987,Howlett2022}. Therefore, it is necessary to generate mock galaxy peculiar velocity catalogues in order to estimate $\beta$ in this paper. The estimation of $\beta$ is a separate task regardless of the RSDs and cosmological redshift of the galaxy mock catalogues mentioned in Section~\ref{traintest}. Therefore, to build the mock galaxy peculiar velocity catalogues, we can assign cosmological redshifts $z_{\rm h}$ to the galaxies based on their real-space distances $r$, although these galaxies are sub-sampled from the galaxy catalogues of the snapshots corresponding to cosmological redshift zero. The line-of-sight peculiar velocity of a galaxy is calculated using \begin{equation} s_{\rm g} ={\bf V}_{\rm g} \cdot \hat{{\bf r}} ~, \end{equation} where ${\bf V}_{\rm g}$ is the velocity of galaxies known from the simulations. $\hat{{\bf r}}$ is the unit vector corresponding to the real-space position ${\bf r}$, rather than setting the Z-direction as the line-of-sight. Then, the observed redshift of a galaxy is given by \cite{Colless2001,Hui2006,Davis2014,Scrimgeour2016,Qin2021a,Qin2021b} \begin{equation} \label{travp} 1+z_{\rm obs} = (1+z_{\rm h})\left(1+\frac{s_{\rm g}}{c}\right)~, \end{equation} where $c$ is the speed of light. The $z_{\rm obs}$ values will be used to estimate $\beta$ in Section~\ref{sec:beta}. \section{Machine learning architecture: V-net}\label{sec:Unet} The machine learning U-net architecture was initially proposed by \cite{Unet2015}. Overall, this method has a similar architecture to the convolutional autoencoder (CAE). Both U-net and CAE consist of two stages --- first, the encoding stage extracts features from the original image by increasing the number of channels and decreasing the image size of each channel. Then follows the decoding stage, which reconstructs the new image by decreasing the number of channels and increasing the image size of each channel. In addition to CAE, U-net uses concatenating both the outputs from the encoding stage and inputs from the decoding stage to convolve the outputs at the decoding stage, which prevents the loss of small-scale features in the CAE. \begin{figure*}[bt] \centering \includegraphics[width=\columnwidth]{fig4.png} \caption{The V-net architecture used to reconstruct the density and velocity fields in this work .} \label{fig1unet} \end{figure*} Recently, a three-dimensional extension of U-net, referred to as V-net, was proposed by \cite{Milletari2016}. The implementation of V-net has been utilized in the reconstruction of LSS in various studies, including \cite{Zhang2019,Hong2021,Wu2021}. The present study employs a CNN architecture, as depicted in Fig.~\ref{fig1unet}, which is based on the original V-net framework with modifications inspired by the works of \cite{Hong2021,Wu2021}. Regarding the density field reconstruction, the redshift-space galaxy contrast fields are set to be the inputs of the CNN architecture. The real-space density fields are set to be the outputs of the architecture. Each input galaxy contrast field has spatial dimension $32^3$ and one channel, i.e., it has a shape of $(32,~32,~32,~1)$. \begin{enumerate} \item First, they are fed into two convolution layers. Each convolution layer is designed to have 128 convolution kernels with a shape of $3^3$ and a scanning stride of 1. Also, the reflect padding, which adds the padding pixels to the boundaries by mirror-reflecting the inner pixels, is applied to ensure that the outputs have the same dimension as the inputs, as well as to minimize the loss of information around the boundaries. A batch normalization \cite{Ioffe2015} and a rectified linear unit (ReLU, \cite{Glorot2011}) activation function are used following each convolution layer. The final outputs of this step are a set of feature fields, and each feature field has a shape of $(32,~32,~32,~128)$. \item Then, these feature fields are fed into a max-pooling layer with a shape of $2^3$ and 2-stride. Only the maximum values from nearby $2^3$ pixels pass through the max-pooling layer, and the dimension of each feature field has been reduced to $(16,~16,~16,~128)$ in this step. \item For further feature extraction and compression, the outputs of the above step are processed by the same operations as steps~1--2 three more times. However, the number of convolution kernels used in each operation are changed to 256, 512, and 1024, and there is no max-pooling used in the third operation, as shown in the Fig.~\ref{fig1unet}. The final output of this step has a shape of $(4,~4,~4,~1024)$. \item Then, they are fed into a de-convolution (or transpose convolution) layer. This layer is designed to have a padding and 512 de-convolution kernels. Each de-convolution kernel has a shape of $3^3$ and the scanning stride is 2. A batch normalization and a ReLu activation function are applied. The final output has a shape of $(8,~8,~8,~512)$. \item The outputs of the above `decoding' step will be concatenated with the feature fields of the equivalent (with a size of (8,~8,~8,~512)) `encoding' stage. Then they will be fed into two convolution layers which are the same as Step~1, but using 512 convolution kernels. \item The outputs of the above step are processed using the same operations as Steps~4--5 twice, but using 256 and 128 kernels, respectively. There is no convolution layer used in the last operation. The final output of this step has a shape of $(32,32,32,256)$. \item To obtain the reconstructed density field, the feature fields are further processed by two convolution layers of 128 kernels. The kernel has a shape of $3^3$ and 1-stride. The padding, batch normalization and ReLU activation function are applied to the outputs of each convolution layer too. The final convolution layer has only one kernel and followed by a ReLU activation function. The shape of the convolution kernel is $3^3$ and the stride is 1. \item Finally, we obtain the density field reconstructed from the galaxy catalogues. To reconstruct the velocity field, the reconstructed density fields (rather than the galaxy contrast fields) are set to be the inputs of the CNN architecture. Each density field has a shape of $(32,~32,~32,~1)$ too. Correspondingly, the outputs of Step~6 will be processed by six convolution layers. The numbers of kernels used in the layers are listed in Fig.~\ref{fig1unet}. The final convolution layer has three kernels and followed by a linear activation function. The shape of each convolution kernel is $3^3$ and the stride is 1. \end{enumerate} We implement the \textsc{TensorFlow}\footnote{\textsc{TensorFlow}: \url{https://www.tensorflow.org/}} package to build the above architecture. The optimization method is the Adam algorithm \cite{Kingma2014}. The mini-batch size is 32. We stop training if the validation loss reaches its minimum and tend to be flat. \section{Reconstructing the density and velocity fields}\label{sec:recons} \subsection{Reconstructing the density field from the galaxy catalogue} \label{sec:recons_dens} We use the 9,000 training/validation galaxy cubes in redshift space and the density field cubes in real space as the inputs and output , respectively, in order to train the CNN. The trained V-net, corresponding to the minimum validation loss, is then applied to the 538 testing galaxy cubes to obtain the reconstructed density fields of the real space. We define the loss function as \begin{equation} \mathcal{L}_{\hat{\delta}} =\frac{1}{N_{\rm pix}}\sum^{N_{\rm pix}}_{i=1} \left( w_{{\rm \hat{\delta}},i} \left|\hat{\delta}_{{\rm p},i}-\hat{\delta}_{{\rm t},i} \right| \right) ~, \end{equation} where $\hat{\delta}_{{\rm p},i}$, $\hat{\delta}_{{\rm t},i}$, and $w_{\hat{\delta},i}$ are the prediction and true values of the normalize density, and the weight factor for the $i$-th pixel, respectively. \begin{figure*} \centering \includegraphics[width=\columnwidth]{fig5.pdf} \caption{ The decomposition of the density field. The top left panel shows an example slice of the true density field, the other panels show the decomposition of the slice. From top-middle to the bottom-right: void centers $\rho \leq 0.1 \bar{\rho}$), void boundaries $0.1 < \rho / \bar{\rho} \leq 0.5$), filaments $0.5 < \rho /\bar{\rho} \leq 1.7$), cluster outskirts $1.7 < \rho / \bar{\rho} \leq 5$), and cluster centers $\rho > 5 \bar{\rho}$). } \label{figdensweigh2} \end{figure*} \begin{figure*} \centering \includegraphics[width=51mm]{fig6a.pdf} \includegraphics[width=48mm]{fig6c.pdf} \includegraphics[width=51mm]{fig6b.pdf} \caption{ Left: Weights for reconstructing the density field, $w_{\hat{\delta}}$ as a function of true density field. Middle: Evolution of loss function as a function of learning rate (blue curve) and the learning rate we have adopted (orange line). Right: Loss function of density field reconstruction as a function of training epoch. } \label{figdensweightloss} \end{figure*} The lack of a weight factor $w_{\hat{\delta},i}$ results in an inability for the V-net to accurately reproduce the density field in both high and low density regions. This is likely caused by the imbalanced training data, where the model may overfit to the most frequently occurring class with $\hat{\delta} \sim 0.3$ ($\rho \sim \bar{\rho}$), leading to poor performance on under-represented classes in both extremely dense and underdense regions (see the left panel of Fig.~\ref{fig1}). Therefore, the inclusion of weight factors is crucial for improving predictions in both high and low density regions by adjusting for the imbalance in the training data. For matching the distribution of the reconstructed density values ${\delta}_{\rm p}$ to the true density values ${\delta}_{\rm t}$, we first decompose the density field into five regions as shown in Fig.~\ref{figdensweigh2}: void centers ($\hat{\delta}_{\rm t} \leq 0.1; \rho \leq 0.1 \bar{\rho}$; top-middle), void boundaries ($0.1 < \hat{\delta}_{\rm t} \leq 0.4; 0.1 < \rho / \bar{\rho} \leq 0.5$; top-right), filaments ($0.4 < \hat{\delta}_{\rm t} \leq 1; 0.5 < \rho /\bar{\rho} \leq 1.7$; bottom-left), cluster outskirts ($1 < \hat{\delta}_{\rm t} \leq 1.8; 1.7 < \rho / \bar{\rho} \leq 5$; bottom-middle), and cluster centers ($\hat{\delta}_{\rm t} > 1.8; \rho > 5 \bar{\rho}$; bottom-right). Then we find the optimal choice of the weight function at each of aformentioned five regions, \begin{equation}\label{field} w_{\hat{\delta},i}=\left\{ \begin{aligned} &1.3, &0< &\hat{\delta}_{{\rm t},i}\leq 0.1\\ &0.7, &0.1< &\hat{\delta}_{{\rm t},i}\leq 0.4 \\ &1.2\hat{\delta}_{{\rm t},i}+0.5, &0.4<&\hat{\delta}_{{\rm t},i}\leq1 \\ &2.3, &1<&\hat{\delta}_{{\rm t},i}\leq1.8 \\ &0.8\hat{\delta}_{{\rm t},i}^3-2.3656, &&\hat{\delta}_{{\rm t},i}>1.8 \\ \end{aligned} \right. , \end{equation} as shown in the left-side panel of Fig.~\ref{figdensweightloss}. The blue curve in the middle panel of Fig.~\ref{figdensweightloss} shows the evolution of loss function as a function of learning rate of the Adam optimizer. If the learning rate is lower than $10^{-6}$, the update of the parameters is too slow, which is presented as a flat slope of the blue curve. On the contrary, a too high learning rate ($>2\times10^{-3}$) prevents finding a solution. Therefore, we choose the learning rate $6\times10^{-5}$ for density field reconstruction. The right panel of Fig.~\ref{figdensweightloss} shows the training loss (blue curve) and validation loss (orange curve) with the learning rate $6 \times 10^{-5}$. Beyond epoch equal to 90, the validation loss tends to be flat, therefore, we stop training at epoch equal to 160. \begin{figure*} \centering \includegraphics[width=\columnwidth]{fig7.pdf} \caption{Comparison between the reconstructed density fields (top) and the true density fields (bottom) in XY-, XZ- and YZ-planes, respectively. The thickness of each slice is 4 $h^{-1}$ Mpc (one pixel size). } \label{fig5denrecon} \end{figure*} Fig.~\ref{fig5denrecon} shows the comparison between the reconstructed density field images (top panels) and the true density field images (bottom panels) in the XY-, XZ- and YZ-planes. The V-net predictions of tiny and large filaments, as well as the voids, match the true fields with high fidelity. Also, the V-net gives reasonable predictions of the density fields with less contamination from the RSDs (applied to the Z-direction) of the galaxy catalogues. Note that, however, the reconstructed filamentary structure is smoother and less complex than the true field, overall. Also, for some very massive clusters, our reconstruction exhibits somewhat different substructures than the true field (e.g., see YZ-plane with $(Y, Z) = (40~h^{-1}{\rm Mpc}$, $120~h^{-1}{\rm Mpc})$). We suspect this may be partially due to the limitation of our halo sample, which has a similar number density to the 2MASS Redshift survey. Structures associated with much smaller scales than the scales allowed by our halo sample may not be reconstructed well even with our CNN method. Therefore, to marginalize such problems, one may need to try either adopting galaxy/halo samples with higher number density or making the spatial resolution of the density cube lower. We leave both possibilities as future works. \begin{figure*} \centering \includegraphics[width=76mm]{fig8a.pdf}\includegraphics[width=74mm]{fig8b.pdf} \includegraphics[width=79mm]{fig8c.pdf} \includegraphics[width=71mm]{fig8d.pdf} \caption{ Top-left: Probability distributions of the reconstructed density values $\hat{\delta}_{\rm p}$ (green solid curve) and true density values $\hat{\delta}_{\rm t}$ (pink dashed curve) for 538 testing cubes, respectively. Top-right: Probability distribution of residual between the reconstructed and true density values for these cubes. Bottom-left: The reconstructed density values against the true values, with the white colored contours indicating the 68\%, 95\%, and 99.7\% confidence levels. Bottom-right: Two-point correlation functions of the reconstructed (blue) and true (orange) density fields for the averaging of 538 testing cubes, respectively. The unit of $r$ is $h^{-1} {\rm Mpc}$.} \label{figdenscomp} \end{figure*} In the top-left panel of Fig.~\ref{figdenscomp}, the distributions of the reconstructed density values $\hat{\delta}_{\rm p}$ of the 538 testing cubes is shown in green bars, while the corresponding true density values $\hat{\delta}_{\rm t}$ is shown in pink bars. The fractional residual between $\hat{\delta}_{\rm p}$ and $\hat{\delta}_{\rm t}$ is mostly smaller than 1, as displayed in the top-right panel. Note that, however, our V-net reconstruction does not reconstruct the probability distribution of density in highly underdense regions $\hat{\delta} < 0.1$ (i.e., $\rho < 0.1 \bar{\rho}$) well. While our changes of the weight factors could not remove such biases at the underdense pixels, these regions will not dominate the clustering and correlation function measurements, and therefore, the biases are negligible to constrain cosmology. The bottom-left panel shows $\hat{\delta}_{\rm p}$ against $\hat{\delta}_{\rm t}$, with the white colored contours indicating the 68\%, 95\%, and 99.7\% confidence levels. The reconstructed density values largely agree with the true density values. Note that there exist a small population with very high true density value and relatively low reconstructed value ($\hat{\delta}_{\rm p} \lesssim 3-4 \lesssim \hat{\delta}_{\rm t}; \rho_{\rm p} \lesssim 10^{3-4} \bar{\rho} \lesssim \rho_{\rm t}$), while there is no such population with very high reconstructed density value and relatively low true value ($\rho_{\rm t} \lesssim 10^{3-4} \bar{\rho} \lesssim \rho_{\rm p}$). This matches well with our observation in Fig.~\ref{figdenscomp} that the reconstructed density field is somewhat smoother than the true density field. In the bottom-right panel, the orange curve and the error bars are the average and the standard deviation of the two-point correlation function of the 538 true density fields, respectively, while the blue curve and the error bars are the average and the standard deviation of the correlation function of the 538 reconstructed density fields, respectively. As expected from the above analyses, both two-point correlation functions match well with each other within the error bar. The error bars of the orange colored curve represent the variance between the sub-cubes and the whole simulation box. i.e. cosmic variance. The error bars of the blue colored curve represent the cosmic variance combined with the errors caused by the CNN reconstruction. \subsection{Reconstructing the velocity field from the reconstructed density field} \label{sec:recons_vel} To reconstruct the velocity fields from the density fields, we first need to apply the V-net model trained from the above density field reconstruction to the 9,000 training galaxy contrast cubes to obtain 9,000 reconstructed density cubes. After that, we use these reconstructed density fields as the inputs to train the V-net. The V-net architecture for velocity reconstruction, which is slightly different from density field reconstruction, is presented in Section~\ref{sec:Unet} and Fig.~\ref{fig1unet}. The corresponding 9,000 true velocity field cubes, normalized using Eq.~\ref{normvel}, are set to be the outputs of the V-net for training. Then, the trained V-net with the minimum validation loss is applied to the 538 reconstructed test density fields to obtain the reconstructed test velocity fields. We define the loss function as: \begin{equation} \mathcal{L}_{u,\theta} = \mathcal{L}_u + \mathcal{L_\theta} =\frac{1}{N_{\rm pix}}\sum^{N_{\rm pix}}_{i=1} \left( w_{u,i} \left| u_{{\rm p},i}-u_{{\rm t},i} \right| + w_{\theta,i} \left|\cos\theta_{i}-1 \right| \right) ~ , \end{equation} where $u=|{\bf u}|$ denotes the amplitude of the normalized velocity, $\cos\theta$ is the angle between the predicted velocity and true velocity, and $w_{\theta}$ and $w_{u}$ are the weight factors for $\theta$ and $u$, respectively. \begin{figure*} \centering \includegraphics[width=66mm]{fig9b.pdf} \includegraphics[width=82.6mm]{fig9a.pdf} \caption{ The left panel shows the decomposition of an example slice of the true velocity field. The blue colored pixels shows the velocities in the interval $V_{\rm t} \leq 175~{\rm km~s^{-1}}$, the green colored pixels shows the velocities in the interval $175~{\rm km~s^{-1}} < V_{\rm t} \leq 500~{\rm km~s^{-1}} , the orange colored pixels shows the velocities in the interval $500~{\rm km~s^{-1}} < V_{\rm t} \leq 750~{\rm km~s^{-1}} , and the red colored pixels shows the velocities in the interval $V_{\rm t} > 750~{\rm km~s^{-1}} . The right panel shows the corresponding density field. } \label{figdenswei3} \end{figure*} \begin{figure*} \centering \includegraphics[width=50mm]{fig10a.pdf} \includegraphics[width=50mm]{fig10c.pdf} \includegraphics[width=50mm]{fig10b.pdf} \caption{Left: Weights for reconstructing the velocity field, $w_\theta$ and $w_u$ as functions of true density field. Middle: Evolution of loss function as a function of learning rate (blue curve) and the learning rate we have adopted (orange line). Right: Loss function of velocity field reconstruction as a function of training epoch. } \label{figvelweightloss} \end{figure*} Similar to what we have found in Section~\ref{sec:recons_dens}, without introducing any specific weight factors $w_\theta$ and $w_u$, the machine learning would try to match only the most common population, which have $V \sim 400~{\rm km~s^{-1}}$. As a result, we find that our method underestimates the velocities of both the larger and smaller amplitudes. Also, the directions of the velocities of larger amplitudes are not well predicted either. Therefore, similar to Section~\ref{sec:recons_dens}, the weight factors are required to reconstruct velocity fields with both large and small amplitudes well. Similar to what we have done in the previous subsection, we decompose the true velocity field into four regions as shown in Fig.~\ref{figdenswei3}: low-velocity region around void centers ($u_{\rm t} \leq 0.7; V_{\rm t} \leq 175~{\rm km~s^{-1}}$; blue), mid-velocity region ($0.7 < u_{\rm t} \leq 2; 175~{\rm km~s^{-1}} < V_{\rm t} \leq 500~{\rm km~s^{-1}}$; green), high-velocity region around void boundaries and filaments ($2 < u_{\rm t} \leq 3; 500~{\rm km~s^{-1}} < V_{\rm t} \leq 750~{\rm km~s^{-1}}$; orange), and very-high-velocity region around cluster outskirts ($u_{\rm t}>3; V_{\rm t} > 750~{\rm km~s^{-1}}$; red). We then find the optimal choice of the weight function for the velocity magnitude $w_{u}$ to match the distribution of the reconstructed velocities $V_{\rm p}$ to the true $V_{\rm t}$ for each of the aformentioned four regions. In case of the weight function for the velocity angle $w_\theta$, on the other hand, we do not apply the results of the velocity decomposition, mainly because the angular term in the loss function $\mathcal{L}_\theta \sim w_\theta \left| \cos \theta - 1 \right|$ has little dependency on the velocity magnitude. Instead, we find the optimal choice of $w_\theta$ at the entire range of $u_{\rm t}$, only assuming that the directional accuracy of velocity field is less important for velocities with lower magnitude. By matching the distribution of the reconstructed velocities ${\bf V}_{\rm p}$ to the true ${\bf V}_{\rm t}$ from the 538 testing data sets, we find the optimal weighting schedule is: \begin{equation} w_{\theta,i}= u_{{\rm t},i}^2+1~~,~~~~ w_{u,i}=\left\{ \begin{aligned} &-3.8u_{{\rm t},i}+3.66, &0< & u_{{\rm t},i} \leq0.7\\ &1, &0.7< & u_{{\rm t},i}\leq2 \\ &u_{{\rm t},i}^2-3, &2< &u_{{\rm t},i}\leq3 \\ &5.5u_{{\rm t},i}^2-43.5, & &u_{{\rm t},i}>3 \\ \end{aligned} \right. \end{equation} see left panel of Fig.~\ref{figvelweightloss}. The middle panel of Fig.~\ref{figvelweightloss} shows the evolution of the loss function as a function of the learning rate of the Adam optimizer. Similar to Fig.~\ref{figdensweightloss}, if the learning rate is lower than $10^{-6}$, the update of the parameters is too slow, while a too high learning rate ($>2\times10^{-3}$) prevents finding a solution. Therefore, we choose the learning rate $6\times10^{-5}$ for velocity field reconstruction. The right panel shows the training loss (blue curve) and validation loss (orange curve) by adopting the above learning rate. The validation loss tends to be flat beyond epoch 30, and therefore, we stop training at epoch 70. \begin{figure*} \centering \includegraphics[width=\columnwidth]{fig11a.pdf} \includegraphics[width=\columnwidth]{fig11b.pdf} \caption{Comparison between the reconstructed velocity fields (top) and the true velocity fields (middle) in XY-, XZ- and YZ-planes, respectively. The thickness of each slice is 4 $h^{-1}$~Mpc (one pixel size). The bottom panels show the corresponding true density fields. } \label{fig8velrecon} \end{figure*} Fig.~\ref{fig8velrecon} shows the comparison between the reconstructed velocity field images (top panels) and true velocity field images (bottom panels) in the XY-, XZ-, and YZ-planes. Overall, both the amplitudes and directions of the V-net predicted velocity excellently match the true velocity, as well as the large-scale-structure features. Also, as seen from the velocity fields in the XZ- and YZ-planes (the middle and right panels), there is no significant RSD contamination in the reconstructed real-space velocity fields. Note that, however, there is a significant difference on the velocity fields, both in terms of magnitude and direction, at the interface between filaments and massive clusters (XZ-plane with $(X,Z) = (30~h^{-1} {\rm Mpc}, 60~h^{-1}{\rm Mpc})$. Even with the dark matter-only semi-analytic simulations, such regions might be highly nonlinear and associated with energetic infall shock waves \cite{Hong2014b, Hong2015}. However, we expect that such local disagreement in nonlinear regions may not significantly affect our goal to estimate the $\beta$ parameter, and we leave it as future works. \begin{figure*} \centering \includegraphics[width=54mm]{fig12a.pdf} \includegraphics[width=48mm]{fig12b.pdf} \includegraphics[width=48mm]{fig12c.pdf} \includegraphics[width=\columnwidth]{fig12d.pdf} \caption{ Top-left: Distributions of the true velocity amplitudes $V_{\rm t}$ (pink dashed curve) and the reconstructed velocity amplitudes $V_{\rm p}$ (green solid curve). Top-middle: Distribution of the fractional residuals between $V_{\rm t}$ and $V_{\rm p}$. Top-right: The distribution of $\cos \theta$. Bottom: Comparisons between the three components of reconstructed velocities to their true velocity counterparts. The white colored contours indicate the 68\%, 95\%, and 99.7\% confidence levels.} \label{fig6histcompv} \end{figure*} In the top-left panel of Fig.~\ref{fig6histcompv}, the pink bars show the distribution of the true velocity amplitudes $V_{\rm t}$, while the green bars shows the distribution of the reconstructed velocity amplitudes $V_{\rm p}$, while the top-middle panel displays the fractional residuals between $V_{\rm t}$ and $V_{\rm p}$, most of which are smaller than 1. The top-right panel shows the distribution of $\cos\theta$. In an ideal reconstruction, $\cos \theta$ should be one , and most of our reconstructions have the value close to one. Note that a small fraction of the population have even negative value of $\cos \theta$, and we suspect that most of them would have very small velocity amplitude (see the bottom panel, for example). In the bottom panel, we plot the three components of the reconstructed velocities against the true velocities. The white colored contours indicate the 68\%, 95\%, and 99.7\% confidence levels, and the reconstructed velocity fields are largely agree with the true velocity fields. Interestingly, the distribution of true and reconstructed $V_Z$ is similar to those of $V_X$ and $V_Y$, indicating that our reconstruction does not suffer much of the RSD contamination. \section{Estimating the $\beta$ parameter}\label{sec:beta} Once we obtain the reconstructed real-space density and velocity fields, we can compare the reconstructions to the measured peculiar velocities to estimate the cosmological parameter $\beta$. Eq.~\ref{betadef} shows how the velocity field is coupled to the density field through the value of this parameter, which acts as a coupling coefficient. The reconstructed velocity $V_{\rm p}$ scales with the fiducial $\beta_{\rm fid}=0.52$ of the simulations, while the amplitudes of the measured peculiar velocities of galaxies $V_{\rm g}$ should scale with the measured $\beta$. Thus \citep{Springob2014,Springob2016}, \begin{equation} \frac{V_{\rm g}}{\beta} = \frac{V_{\rm p}}{\beta_{\rm fid}}~, \end{equation} and therefore, to measure $\beta$, the reconstructed velocity fields should be divided by the fiducial $\beta_{\rm fid}$. In observations, the measurement errors of galaxy peculiar velocities are very large (typically around 20--25\% error on distance estimates for Fundamental Plane and Tully-Fisher galaxies). To obtain a more accurate estimation of $\beta$, the measurement needs to be performed in terms of redshift \citep{Springob2014,Springob2016,Carrick2015,Boruah2020}. Therefore, to simulate the measurement procedure in real observations, we need to project the reconstructed velocity to the line-of-sight and re-scale to $\beta=1$ using \begin{equation} s =\frac{1}{\beta_{\rm fid}}{\bf V}_{\rm p}\cdot\hat{\bf r}~. \end{equation} Then we can calculate the observed redshift $z_{\rm p}$ (of a galaxy at real-space position ${\bf r}$) predicted from our reconstructions using \citep{Carrick2015,Boruah2020} \begin{equation} 1+z_{\rm p}=(1+z_{\rm h})\left[ 1+\frac{1}{c}(\beta s + {\bf V}_{\rm ext} \cdot\hat{\bf r}) \right] ~. \end{equation} The reconstruction is usually performed within a limited survey volume $D$, therefore a extra nuisance term ${\bf V}_{\rm ext}$, namely the residual bulk flow, is introduced to encapsulate contributions from beyond the reconstruction volume $D$, and we treat it as a free parameter in our analysis. The Hubble recessional redshift $z_{\rm h}$ is given by \citep{peebles1993,Carrick2015,Boruah2020}: \begin{equation} z_{\rm h}=\frac{1}{1+q_0}\left( 1-\sqrt{1-\frac{2H_0 r}{c}(1+q_0)} \right) ~, \end{equation} where the deceleration factor is given by $q_0={\Omega_{\rm m}}/{2}-\Omega_{\Lambda}$. In observations, to accurately estimate the $\beta$ parameter using the velocity-velocity comparison method, both the homogeneous and inhomogeneous Malmquist biases are required to be removed. The homogeneous Malmquist bias is a consequence of selection effects, while the inhomogeneous Malmquist bias arises from local density variations due to large-scale structure along the line of sight \citep{Strauss1995, Springob2016}. A commonly used method to remove these Malmquist biases is the Forward Likelihood estimation \citep{Pike2005}. However, in this paper, we use simulations with the exact positions of the mock galaxies, and the Malmquist biases are negligible. Therefore, we use the simple $\chi^2$ minimization to estimate $\beta$. The $\chi^2$ between the predicted redshift and the observed redshift of galaxies is given by \citep{Carrick2015,Boruah2020}: \begin{equation} \chi^2(\beta, {\bf V}_{\rm ext}) = \sum^{N_{\rm gal}}_{i=1}\frac{(cz_{{\rm obs},i}-cz_{{\rm p},i})^2}{\sigma_v^2} ~, \end{equation} where $z_{\rm obs}$ is given by Eq.~\ref{travp}. The true galaxy peculiar velocities are used to compute $z_{\rm obs}$, the measurement errors are zeros. Therefore, only the velocity dispersion $\sigma_v$ appears in the above $\chi^2$. The parameters $\beta$ and ${\bf V}_{\rm ext}$ are estimated by minimizing the above $\chi^2$. \begin{figure*} \centering \includegraphics[width=79mm]{fig13.pdf} \caption{Comparison between the $\beta$ measurements from the reconstructed velocity fields ($\beta_{\rm p}$) and those from the true velocity fields ($\beta_{\rm t}$) from the 538 testing sub-cubes. Top panel shows the probability distribution of $\beta_{\rm t}$. Right side panel shows the probability distribution of $\beta_{\rm p}$, the shade shows the 68\% certainty (1$\sigma$) level. Black dashes indicate the fiducial value $\beta_{\rm fid} = 0.52$. The 2D contours are the 68\%, 95\%, and 99.7\% certainty levels. Solid line indicates the diagonal ($\beta_{\rm p} = \beta_{\rm t}$). } \label{fig9betas} \end{figure*} In Fig.~\ref{fig9betas}, we plot the estimations using the reconstructed velocity field, $\beta_{\rm p}$, against the estimations from the true velocity field, $\beta_{\rm t}$, from the 538 testing sub-cubes. The estimated $\beta_{\rm p}$ value ($\beta_{\rm p} = 0.491^{+0.055}_{-0.060}$) agrees with the fiducial value $0.52$ (dashed-lines) within the 68\% confidence level, as shown in the shaded area in the right panel. However, the $\beta_{\rm p}$ estimated using the reconstructed velocity fields shows a systematic shift compared to the $\beta_{\rm t}$, which is estimated from the true fields ($\beta_{\rm t} = 0.526^{+0.042}_{-0.056}$). The scatters of $\beta_{\rm p}$ are result of the variance between the sub-cubes and the whole simulation box, as well as the variance between the V-net reconstructed fields and the true fields. \section{Conclusion}\label{sec:conc} The peculiar velocities of galaxies serve as a valuable tool for studying the gravitational potential field, allowing for a more direct measurement of the large-scale distribution of matter than positions of galaxies alone. However, effectively utilizing these velocities requires a precise prediction of the density and velocity fields. In this study, we evaluate the effectiveness of a Convolutional Neural Network (CNN) architecture, the V-net, in reconstructing these fields and making inferences about the growth rate of cosmological structure. In this work, the real-space density fields are reconstructed from input galaxy redshift catalogs using an initial V-net. Results indicate that tuning the loss function with density-dependent weights enhances the V-net's accuracy in predicting density values across both low- and high-density regions. Additionally, the reconstructed density fields exhibit minimal contamination from redshift-space distortions in the input galaxy catalogs. The velocity fields are then reconstructed from the density fields using another V-net. The results demonstrate that tuning the loss function with velocity-dependent weights enhances the accuracy of the V-net in predicting pixels with large velocity amplitudes. As with the reconstructed density fields, the velocity fields also exhibit reduced contamination from redshift-space distortions in the input galaxy catalogs. The estimation of the cosmological parameter $\beta$ through comparison of the reconstructed and true velocity fields yields results consistent with the fiducial value. While the $\beta$ values estimated using the reconstructed velocity fields exhibit a systematic offset relative to the true fields, they still agree with the fiducial value within $1\sigma$. This suggests that the density and velocity fields reconstructed using AI provide reasonably accurate constraints. This study successfully illustrates the concept of reconstructing large-scale density and velocity fields through the use of a CNN architecture. However, its scope is limited, as it only considers a cubic geometry without observational selection effects, simplistic peculiar velocity errors, and only a single cosmological model. To address these complexities, additional simulations and training would be necessary, and such efforts are left for future studies. \acknowledgments FQ, DP, and SEH are supported by the project \begin{CJK}{UTF8}{mj}우주거대구조를 이용한 암흑우주 연구\end{CJK} (``Understanding Dark Universe Using Large Scale Structure of the Universe''), funded by the Ministry of Science. CGS acknowledges support via the Basic Science Research Program from the National Research Foundation of South Korea (NRF) funded by the Ministry of Education (2018R1A6A1A06024977 and 2020R1I1A1A01073494). This work was supported by the high performance computing cluster Seondeok at the Korea Astronomy and Space Science Institute.
\part{} \twocolumn[ \icmltitle{Reinforcement Learning with History-Dependent Dynamic Contexts} \icmlsetsymbol{equal}{*} \begin{icmlauthorlist} \icmlauthor{Guy Tennenholtz}{equal,google} \icmlauthor{Nadav Merlis}{equal,crest} \icmlauthor{Lior Shani}{google} \icmlauthor{Martin Mladenov}{google} \icmlauthor{Craig Boutilier}{google} \end{icmlauthorlist} \icmlaffiliation{google}{Google Research} \icmlaffiliation{crest}{CREST, ENSAE} \icmlcorrespondingauthor{Guy Tennenholtz}{<EMAIL>} \icmlkeywords{Machine Learning, ICML} \vskip 0.3in ] \printAffiliationsAndNotice{\icmlEqualContribution} \begin{abstract} We introduce \emph{Dynamic Contextual Markov Decision Processes (DCMDPs)}, a novel reinforcement learning framework for history-dependent environments that generalizes the contextual MDP framework to handle non-Markov environments, where contexts change over time. We consider special cases of the model, with a focus on \emph{logistic DCMDPs}, which break the exponential dependence on history length by leveraging aggregation functions to determine context transitions. This special structure allows us to derive an upper-confidence-bound style algorithm for which we establish regret bounds. Motivated by our theoretical results, we introduce a practical model-based algorithm for logistic DCMDPs that plans in a latent space and uses optimism over history-dependent features. We demonstrate the efficacy of our approach on a recommendation task (using MovieLens data) where user behavior dynamics evolve in response to recommendations. \end{abstract} \section{Introduction} Reinforcement learning (RL) is a paradigm in which an agent learns to act in an environment to maximize long-term reward. RL has been applied to numerous domains, including recommender systems, robot control, video games, and autonomous vehicles \citep{afsar2022reinforcement,tessler2019distributional,mnih2015human,fayjie2018driverless}. While typical RL approaches rely on a Markov property of both the reward process and environment dynamics, many scenarios are inherently history-dependent \cite{BBG:NMRDPs,ronca:ijcai21}, particularly, when humans are involved. As one example, the behavior of users in recommender systems often exhibits non-Markovian characteristics reflective of a user's latent state, including: user preference elicitation sessions, where users respond to a sequence of feedback-gathering interventions (e.g., ratings, comparisons, annotations) \cite{chen_critiquing_survey:umuai2012,zhao13interactive}; user \emph{ad blindness} (i.e., the tendency to gradually ignore ads) \cite{hohnhold:kdd15}; and the long-term evolution of user satisfaction \cite{wilhelm:cikm18,advamp:ijcai19}. Many aspects of a user's latent state determine their disposition towards specific actions. For example, a user's level of frustration, trust, receptivity, and overall satisfaction, may affect their tendency toward accepting recommendations, providing feedback, or abandoning a session. Notably, such features are cumulatively impacted by the user's long-term history, which makes RL especially challenging due to difficult credit assignment, where the impact of any individual action is usually small and noisy. \footnote{A similar problem occurs in medical settings, where a patient's previous reactions to certain treatments could implicitly affect the physician's receptivity for treatment recommendations over long horizons. Another example includes human driver interventions in autonomous vehicles, where humans may take control of a vehicle for short periods of time.} In this paper, we introduce \emph{Dynamic Contextual Markov Decision Processes (DCMDPs)} to model such environment dynamics in a \emph{\textbf{history-dependent} contextual} fashion. DCMDPs decompose the state space to include dynamic history-dependent contexts, where each context represents a different MDP, e.g., preferences of a human interacting with an agent, being affected by previous interactions. Particularly, we introduce a special class of \emph{logistic DCMDPs}, in which context dynamics are determined by the aggregation of a set of feature vectors---functions of the immediate context, state and action---over time. This model is inspired by various psychological studies of human learning and conditioning; in particular, the Rescorla-Wagner (RW) model \cite{rescorla1972theory}, a neuroscience model which describes the diminishing impact of repeated exposure to a stimulus due to historical conditioning. Critically, this structure allows us to develop tractable, UCB-style algorithms \citep{auer2008near} for logistic DCMDPs that break the exponential dependence on history length in general DCMDPs. Our contributions are as follows: (1) We introduce DCMDPs, a model that captures non-Markov context dynamics. (2) We introduce a subclass of DCMDPs for which state-action-context features are aggregated over time to determine context dynamics. We show how such problems can be solved by devising sample efficient and computationally tractable solutions, for which we establish regret bounds. (3) Inspired by our theoretical results, we construct a practical algorithm, based on MuZero \citep{schrittwieser2020mastering}, and demonstrate its effectiveness on a recommendation system benchmark with long history-dependent contexts. \begin{figure}[t!] \centering \includegraphics[width=\linewidth]{imgs/dcmdp_causal.pdf} \caption{\small Causal diagrams comparing Contextual MDPs \citep{hallak2015contextual}, Markov DCMDPs (\Cref{section: markov dcmdp}) and Logistic DCMDPs (\Cref{section: logistic DCMDPs}). Logistic DCMDPs are history dependent, where ${\sigma_t = \sum_{l=0}^{t-1} \alpha^{t-l-1}\paramvectrue_l(s_l, a_l, x_l)}$, and $\paramvectrue_l:\s \times \A \times \X \mapsto \R^M$ are \emph{unknown}, non-stationary, vector valued feature mappings.} \label{fig: DCMDP causal diagram} \end{figure} \section{Dynamic Contextual MDPs} \label{section: dcmdp} We begin by defining \emph{Dynamic Contextual MDPs (DCMDPs)}, a general framework for modeling history-dependent contexts\footnote{The term ``context", as opposed to ``state", differentiates between the Markov part of the state and the history dependent part of the state. Additionally, contexts often quantify characteristics of the environment (e.g., types of humans-in-the-loop), which can evolve in a distinct fashion, in contrast to the rest of the state.}. Let $\s$, $\A$ and $\X$ be state, action, and context spaces, with cardinalities $S, A, X$, respectively. For any time $t \geq 1$, let $\mathcal{H}_t = \brk[c]*{\brk*{s_1, a_1, x_1, \hdots, s_t, a_{t-1}, x_{t-1}}}$ be the set of histories up to time $t$; and let $\mathcal{H} = \bigcup_t \mathcal{H}_t$. We denote $(s_0, a_0, x_0) = \emptyset$. A DCMDP is given by the tuple $\brk*{\X, \s, \A, r, P, H}$, where, $r: \s \times \A \times \X \mapsto [0,1]$ is a reward function, $P: \mathcal{H} \times \s \times \A \mapsto \Delta_{\s}$ is a history-dependent transition function, and $H$ is the horizon. DCMDP dynamics proceeds in discrete episodes $k=1,2, \hdots, K$. At the beginning of episode $k$, the agent is initialized at state $s_1^k$. At any time $h$, the agent is in state $s_h^k$, has observed a history $\hist_h^k = (s_1^k, a_1^k, x_1^k, \hdots, s_{h-1}^k, a_{h-1}^k, x_{h-1}^k) \in \mathcal{H}_h$, and selects an action $a_h^k \in \A$. Then, the next context $x_h^k$ occurs with (history-dependent) probability $P(x_h^k | \hist_h^k)$, the agent receives reward $r(s_h^k, a_h^k, x_h^k)$, and the environment transitions to state $s_{h+1}^k$ with probability $P_h(s_{h+1}^k | s_h^k, a_h^k, x_h^k)$. Note that state transitions are Markov w.r.t.\ $s_h^k$, $a_h^k$, and the context $x_h^k$. A policy $\pi: \s \times \mathcal{H} \mapsto \Delta_{\A}$ maps states and histories to distributions over actions. The value of $\pi$ at time $h$ is defined as $V_h^\pi(s, \hist) = \expect*{\pi}{\sum_{t=h}^H r(s_t, a_t, x_t) | s_h = s, \hist_h = \hist}$, where $a_t \sim \pi(s_t, \hist_t)$, and $x_t \sim P(\cdot | \hist_t)$. An optimal policy $\pi^*$ maximizes the value over all states and histories\footnote{Such a value always exists, since all histories can be represented as states of an equivalent MDP, for which an optimal value exists.}; we denote its value function by $V^*$. We measure the performance of an RL agent by its \emph{regret} -- the difference between its value and that of an optimal policy: $\text{Reg}(K) = \sum_{k=1}^K V_1^*(s_1^k) - V_1^{\pi^k}(s_1^k)$. \Cref{fig: DCMDP causal diagram} depicts causal diagrams comparing different types of DCMDPs, including three special cases: Contextual MDPs \citep{hallak2015contextual}\footnote{To see that Contextual MDPs are a special case of DCMDPs for discrete $\X$, define ${P(x_t | \hist_t) = \indicator{x_{t} = x_{t-1}}}$, fixing the context across transitions.}, Markov DCMDPs, and logistic DCMDPs (defined in the next two sections). In the next section, we describe a simple instance of DCMDPs, for which contexts are Markov, and show that standard MDP solutions can be applied. Then, in \Cref{section: logistic DCMDPs}, we describe a more general DCMDP model, which uses aggregated features to represent histories, for which we provide sample efficient solutions and strong regret guarantees. \subsection{Markov DCMDPs} \label{section: markov dcmdp} As a warm-up, we consider a simple version of DCMDPs in which context distributions are Markov w.r.t. the state and previous context. Specifically, we define a \emph{Markov DCMDP} as a DCMDP which satisfies for all $h \in [H]$, $\hist_h = (x_1, s_1, a_1, \hdots, x_{h-1}, s_{h-1}, a_{h-1}) \in \mathcal{H}_h$ \begin{align*} P(x_h | \hist_h) = P(x_h | s_{h-1}, a_{h-1}, x_{h-1}). \end{align*} A Markov DCMDP $\M = (\X, \s, \A, r, P, H)$ can be reduced to an MDP by augmenting the state space to include the context. To see this, we define the augmented MDP $\overline{\M} = (\bar \s, \A, \bar r, \bar P, H)$, where $\bar \s = \s \times \X$ and $ \bar r(\bar s_t, a_t) = r(s_t, a_t, x_t)$, $\bar P(\bar s_{t+1} | \bar s_t, a_t) = P(s_{t+1} | s_t, a_t, x_t) P(x_{t+1} | s_t, a_t, x_t). $ As a consequence, the Markov DCMDP $\M$ and the MDP $\overline{\M}$ have the ``same'' optimal policy and value, and $\M$ can be solved using standard RL methods. For instance, using UCBVI \citep{azar2017minimax} one can obtain a regret of ${ \Reg{K} \leq \tilde{\mathcal{O}} \brk*{\sqrt{H^3SAXK}}.} $ Markov DCMDPs also generalize contextual MDPs in an especially simple way; but they fail to capture the history dependence of contexts embodied by general DCMDPs. In the next section, we turn to a special case of DCMDPs that does so, but also admits tractable solution methods. \section{Logistic DCMDPs} \label{section: logistic DCMDPs} We introduce a general class of DCMDPs, called \emph{logistic DCMDPs}, where history dependence is structured using an aggregation of state-action-context-dependent features. Unlike Markov DCMDPs, logistic DCMDPs allow for context transitions to depend on history. We define the softmax function $z_i: \R^M \mapsto [0,1]$, with temperature $\eta > 0$ as \begin{align} \label{eq: softmax} z_i(\bs{u}) = \frac{\exp \brk*{\eta u_i}} {1 + \sum_{m=1}^M\exp \brk*{\eta u_m}} \end{align} for $i \in [M]$, $\bs{u} \in \R^{M}$, and $z_{M+1}(\bs{u}) = 1 - \sum_{i=1}^M z_i(\bs{u})$. \begin{definition}[Logistic DCMDP] \label{def: logistic dcmdp} A \emph{logistic DCMDP} with latent feature maps $\brk[c]*{\paramvectrue_{h}: \s \times \A \times \X \mapsto \R^M}_{h=0}^{H-1}$ is a DCMDP with context space $\X = \brk[c]*{\x[i]}_{i=1}^{M+1}$, which satisfies, for all $h \in [H]$, $\hist_h = (s_1, a_1,x_1, \hdots, s_{h-1}, a_{h-1}, x_{h-1}) \in \mathcal{H}_h$, and $i \in [M+1]$: \begin{align*} P_{\paramvectrue}(\x[i]_h | \hist_h) = z_i\brk*{\sum_{t=0}^{h-1} \alpha^{h-t-1}\paramvectrue_t(s_t, a_t, x_t))}, \end{align*} where $\alpha \in [0,1]$ is a \emph{history discount factor}. \end{definition} Note that the latent functions $\paramvectrue_h$ are vector-valued and \emph{unknown}. In a recommender system, $\paramvectrue_h$ may represent a user's unknown degree of trust in the system, or the effect of a sequence of recommendations on their satisfaction. The discount $\alpha$ allows for immediate effects to diminish over time (if less than 1). A logistic DCMDP is denoted by $\brk*{\X, \s, \A, r, P, H, \paramvectrue, \alpha}$. We assume $\paramvectrue$ is $\ell_2$-bounded with ${\sqrt{\sum \paramfunc_{h,i}^{*2}(s,a,x)} \leq L}$, and we denote \begin{align} \label{eq: param set} \paramset = \brk[c]*{\paramvec: \abs{\paramfunc_{h,i}(s,a,x)} \leq b_{h,i}(s,a,x)} \end{align} the (rectangular) set where $b_{h,i}(s,a,x)$ are upper bounds on $\paramvectrue$. Throughout our analysis we denote the effective history horizon ${\Halpha = \frac{\alpha^{2H}-1}{\alpha-1}}$, and without loss of generality scale transitions in $z_i$ (\Cref{eq: softmax}) with temperature $\eta = H_\alpha^{-1}$.\footnote{We set $\eta=\Halpha^{-1/2}$ for convenience. Different choices of $\eta$ are equivalent to varying the bounds on $\paramset$ in \Cref{eq: param set}.} For clarity, we write $r(s, a, \x[i]) = r_i(s,a)$, $P(s'| s, a, \x[i]) = P_i(s' | s, a)$, and $\bs{r}(s,a) = (r_1(s,a), \hdots, r_{M+1}(s,a))^T$, $\bs{P}(s'|s,a) = (P_1(s'|s,a), \hdots, P_{M+1}(s'|s,a))^T$. We also denote by $n_h^k(s,a,x)$ the number of visits to $s,a,x$ at time step $h$ of episode $k-1$. Next, we define a sufficient statistic for logistic DCMDPs that will prove valuable in our solution methods that follow. \begin{definition}[Sufficient Statistic] \label{defition: sufficient statistic} Given a logistic DCMDP with feature maps $\paramvec$, define ${\suff: \mathcal{H} \mapsto R^M}$ as $ \suff(\hist_h; \paramvec) := \sum_{t=0}^{h-1} \alpha^{h-t-1}\paramvec_t(s_t, a_t, x_t), $ and the set of sufficient statistics by $\suffset(\paramvec) := \brk[c]*{\suff(\hist; \paramvec)}_{\hist \in \mathcal{H}}$. \end{definition} In \Cref{appendix: sufficient statistic}, we prove that $\suff(\hist_h; \paramvec)$ is a sufficient statistic of the history for purposes of computing the optimal policy at time $h$. We do so by defining an equivalent MDP with state space $\s \times \suffset(\paramvec)$ with well-defined dynamics and reward, and an equivalent optimal policy, which achieves the same optimal value. Finally, similar to previous work on logistic and multinomial bandits \citep{abeille2021instance,amani2021ucb}, we define a problem-dependent constant for logistic DCMDPs which plays a key role in characterizing the behavior of $M \geq 1$ mulitnomial logit bandit algorithms. For $\bs{x} \in \R^{M+1}$ and ${\hist \in \mathcal{H}}$, let $\bs{z}(\bs{x}) = \brk*{z_0(\bs{x}), \hdots, z_{M+1}(\bs{x})}^T$, $\bs{A}(\hist ; \paramvec) = \text{diag}(\bs{z}(\suff(\hist; \paramvec))) - \bs{z}(\suff(\hist; \paramvec))\bs{z}(\suff(\hist; \paramvec))^T$, and $ 1/\kappamin = \inf_{\hist \in \mathcal{H}} \lambda_{\min}\brk[c]*{\bs{A}(\hist ; \paramvectrue)}. $ Informally, $\kappamin$ is related to saturation of the softmax $z_i$. For logistic DCMDPs, it is related to a worst-case context distribution w.r.t.\ $\paramvectrue$ and $\hist \in \mathcal{H}$. We refer to \citet{abeille2021instance,amani2021ucb} for details, as well as lower bounds using this constant in logistic bandits. \paragraph{The Rescorla-Wagner Model in Recommenders.} Before continuing to provide sample efficient methods for solving logistic DCMDPs, we turn to motivate the aggregated model of history through the lens of the Rescola-Wagner (RW) model \citep{rescorla1972theory} in a recommendation setting. Logistic DCMDPs generate context transitions based on the sum of specific features of prior states, actions, and contexts, as captured by $\paramvectrue$, with backward discounting to diminish the effect of past features or experiences, as captured by $\alpha$. Such a model can be used to capture a (very simple) RW formulation of user behavior in an interactive recommender system. Let $I = \{i_1,\ldots, i_n\}$ be a set of items. A user may like, dislike, or be unfamiliar with any of these items, represented by $u \in \{1, 0, -1\}^n$. Let $g_t$ be the user's (latent) current degree of satisfaction or engagement with the system. At each time $t$, the system asks the user for their disposition (e.g., rating) of an item $i_t \in I$. The user decides to answer the question with probability $z_1(g_t)$ (\Cref{eq: softmax}), which is strictly increasing with higher degrees of engagement level. The engagement level then evolves as $g_{t+1} = \alpha g_t + \beta u_{i_t}$, where $\alpha \in [0,1]$, and $\beta$ is a user-specific sensitivity factor. This model gives rise to a logistic DCMDP, whose solution gives the optimal recommender system policy. Specifically, actions $a_t := i_t \in {I}$ are the questions asked by the system, $\paramfunc^*(s_t, a_t, x_t) = \beta u_{a_t}$ depends only on $a_t$, user engagement is $ g_h = \sum_{t=0}^{h-1} \alpha^{h-t-1} \paramfunc^*(s_t, a_t, x_t) = \sum_{t=0}^{h-1} \alpha^{h-t-1} \beta u_{i_t}$, $x_t$ is the decision whether to answer, and $s_t$ is the observation of the answer. \section{Optimistic Methods for Logistic DCMDPs} Logistic DCMDPs' aggregation of features allow us to obtain sample efficient and computationally tractable solutions; namely, solutions which do not depend exponentially on history. In this section, we describe an optimistic algorithm for solving logistic DCMDPs and provide regret bounds. We focus on theoretical motivations here, and address computational tractability in the next section. We first develop \emph{Logistic Dynamic Context Upper Confidence Bound (LDC-UCB)}, a general RL method for logistic DCMDPs with unknown latent features (see \Cref{alg: LDC-UCB}). At each episode $k$, LDC-UCB uses estimates of rewards $\hat r_{x,h}^k(s,a) = \frac{\sum_{k'=1}^k\indicator{x_h^{k'} = x, s_h^{k'} = s, a_h^{k'} = a}r_{h}^{k'}}{n_h^k(s,a,x)}$, transitions ${\hat P_{x,h}^k(s'|s,a) = \frac{\sum_{k'=1}^k\indicator{x_h^{k'} = x, s_h^{k'} = s, a_h^{k'} = a, s_{h+1}^{k'} = s'}}{n_h^k(s,a,x)}}$, and a projected estimate of $\estparamvec$, calculated by maximizing the regularized log likelihood: \begin{align} \label{eq: likelihood} \mathcal{L}^k_\lambda(\paramvec) = \sum_{k'=1}^{k} \sum_{h=1}^{H-1} \sum_{i=1}^{M+1} \indicator{x_h^k = i} \ell_{i,h}^k(\paramvec) - \lambda\norm{\paramvec}_2^2, \end{align} where $\ell_{i,h}^k(\paramvec) = \log \brk*{z_i(\suff(\hist_h^k; \paramvec))}$, $\lambda > 0$, and recall that $\suff(\hist_h^k; \paramvec) = \sum_{t=0}^{h-1} \alpha^{h-t-1}\paramvec_t(s_t^k, a_t^k, x_t^k)$. \begin{algorithm}[t!] \caption{LDC-UCB} \label{alg: LDC-UCB} \begin{algorithmic}[1] \FOR{$k=1, \hdots, K$} \STATE $\bar r_{i,h}^{k}(s,a) = \hat r_{i,h}^{k}(s,a) + b^k_{i,h}(s,a), \forall i,h,s,a$ \STATE $\bar \pi^k \gets \text{Optimistic Planner}\brk*{\bar \M_k(\delta)}$ \hfill {\color{gray}// Eq.~\ref{eq: optimistic dcmdp set}} \STATE Rollout a trajectory by acting $\bar \pi^k$ \STATE $\estparamvec^k \in \arg\max_{\paramvec \in \C_k(\delta)} \mathcal{L}^k_\lambda(\paramvec)$ \hfill {\color{gray}// Eq.~\ref{eq: likelihood}} \STATE Update $\hat{P}_i^{k+1}(s,a), \hat{r}_i^{k+1}(s,a), n^{k+1}(s,a,x)$ over rollout trajectory \ENDFOR \end{algorithmic} \end{algorithm} We account for uncertainty in these estimates by incorporating optimism. For rewards and transitions, we add a bonus term $b^k_{i,h}$ (see \Cref{appendix: regret analysis ldc-ucb} for explicit definitions) to the estimated reward (line 2). To incorporate optimism in the latent features $\estparamvec$, we build on results from multinomial logistic bandits \citep{amani2021ucb}. Specifically, we derive a confidence bound over $\estparamvec$, for which with probability at least $1-\delta$ \begin{align} \norm{g_k(\paramvectrue) - g_k(\estparamvec_t)}_{\bs{H}_k^{-1}(\paramvectrue)} \leq \beta_k(\delta), \label{eq: global bound} \end{align} where $H_k(\paramvec) = -\nabla^2_{\paramvec} \mathcal{L}^k_\lambda(\paramvec)$, ${g_k(\paramvec) = -\nabla_{\paramvec}\mathcal{L}^k_\lambda(\paramvec) + D_k}$, $\beta_k(\delta) = \frac{M^{5/2}SAH}{\sqrt{\lambda}}\brk*{\log\brk*{1 + \frac{k}{d\lambda}} + 2\log\brk*{\frac{2}{\delta}}} + \sqrt{\frac{\lambda}{4M}} + \sqrt{\lambda}L$. See \Cref{appendix: confidence sets} for exact expressions and a proof of the bound in \Cref{eq: global bound}. Next, we leverage the bound in \Cref{eq: global bound} to construct a feasible set of logistic DCMDPs. Specifically, we define the confidence set \begin{align} \label{eq: global confidence set} \C_k(\delta) = \brk[c]*{\paramvec \in \paramset : \norm{g_k(\paramvec) - g_k(\hat \paramvec_t)}_{\bs{H}_k^{-1}(\paramvec)} \leq \beta_k(\delta)}. \end{align} and the following set of logistic DCMDPs: \begin{align} \bar \M_k(\delta) = \brk[c]*{\brk*{\X, \s, \A, \bar r, \hat P, H, \paramvec, \alpha} : \paramvec \in \C_k(\delta)}. \label{eq: optimistic dcmdp set} \end{align} The optimistic policy $\bar \pi^k$ (line 3) is that with greatest value over all DCMDPs in $\bar \M_k(\delta)$, i.e., $\bar \pi^k$ corresponding to $\max_{\bar m \in \bar \M_k(\delta)} V^*(s_1 ; \bar m)$. Combining the above, we prove the following regret guarantee for \Cref{alg: LDC-UCB}. \begin{restatable}{theorem}{ldcucb} \label{thm: regret ldc-ucb} Let $\lambda = \Theta(\frac{H M^{2.5}SA}{L})$. With probability at least $1-\delta$, the regret of \Cref{alg: LDC-UCB} is \begin{align*} \Reg{K} \leq \tilde{\Ob}\brk{\sqrt{H^6 M^{4.5} S^2 A^2L^2 \kappamin K}}. \end{align*} \end{restatable} The proof of \Cref{thm: regret ldc-ucb} can be found in \Cref{appendix: regret analysis ldc-ucb}. We note that computing the optimistic policy over $\bar \M_k(\delta)$ (line 3) is computationally difficult, especially due the history dependence of $\pi$ on the accumulated latent features $\sum_{t=1}^h \alpha^{h-t}\paramvec(s_t, a_t, x_t)$. We address this challenge next. \section{Mitigating Computational Complexity} \label{sec: mitigating computational complexity} In this section we show how to relax LDC-UCB (\Cref{alg: LDC-UCB}) to mitigate its high computational complexity. Importantly, we maintain regret guarantees similar to those of \Cref{thm: regret ldc-ucb} while obtaining an exponential improvement to computational cost. We later use these results to construct a practical model-based algorithm in \Cref{section: dczero}. To address the computational challenges of \Cref{alg: LDC-UCB}, we focus on two problems. The first involves the set $\C_k(\delta)$ (\Cref{eq: global confidence set} and line 5 of \Cref{alg: LDC-UCB}) -- where computation of the maximum likelihood constrained to set $\C_k(\delta)$ is intractable. To address this, we prove that the constraint on the maximum likelihood estimator can be replaced by a simpler, rectangular set, enabling efficient calculation of the projected maximum likelihood. The second challenge is the complexity of the optimistic planner (\Cref{eq: optimistic dcmdp set} and line 3 of \Cref{alg: LDC-UCB}). To overcome this, we develop a \emph{local} confidence bound, for every state-action-context triple $(s,a,x)$, and show it can be leveraged to design an optimistic planner, using a novel thresholding mechanism for optimism in logistic DCMDPs. Pseudocode for this tractable variant of LDC-UCB is presented in \Cref{alg: LDC-UCB Tractable}. \subsection{A Tractable Estimator} \label{section: tractable estimator} We begin by constructing a tractable estimator for the latent feature maps $\paramvectrue$ which, instead of projecting to the set $\C_k(\delta)$, solves for projected maximum likelihood on the rectangular set $\paramset$ (\Cref{eq: param set}). Let $\gamma_k(\delta) = \brk*{2+2L\sqrt{MH} + \sqrt{2(1+L)}}\beta_k + \sqrt{\frac{2(1+L)HM}{\lambda}}\beta_k^2(\delta)$. We define the tractable maximum likelihood estimator $ \estparamvec^k_T \in \arg\max_{\paramvec \in \paramset} \mathcal{L}^k_\lambda(\paramvec), $ and have the following bound. \begin{lemma} \label{prop:convex relaxation bound} With probability at least $1 - \delta$, for all $k \in [K]$, \begin{align} \norm{\estparamvec^k_T -\paramvectrue}_{{\bs{H}}_k(\paramvectrue)} \leq \gamma_k(\delta). \label{eq: f-normalized upper bound} \end{align} \end{lemma} The proof (see \Cref{appendix: convex relaxation}) uses a convex relaxation of the set $\C_k(\delta)$. Notice that the confidence region for $\estparamvec^k_T$ is looser than that for $\estparamvec^k$ (see \Cref{eq: global bound}), as $\beta_k(\delta) < \gamma_k(\delta)$. Nevertheless, its computation is tractable. Next we can exploit the confidence bound in \Cref{eq: f-normalized upper bound} to construct a \emph{local} bound for every state-action-context triple $(s,a,x)$ using the number of visits to $(s,a,x)$, i.e., $n_h^k(s,a,x)$. The following result uses structural properties of logistic DCMDPs to achieve a local bound for $\estparamvec^k_T$. Its proof generalizes the local confidence bound in \citet{tennenholtz2022reinforcement}, and can be found in \Cref{appendix: local confidence bound}. \begin{lemma}[Local Estimation Confidence Bound] \label{lemma: local feature confidence} For any $\delta>0$, with probability of at least $1-\delta$, for all $k\in [K], h\in[H], i\in [M]$ and $s,a,x\in\s\times\A\times\X$, it holds that \begin{align*} \Big\lvert \big(\hat \paramvec^k_T(s,a,x)\big)_{i,h} \!- \! \big(\paramvectrue(s,a,x)\big)_{i,h} \Big\rvert \leq \frac{2\sqrt{\kappamin}\gamma_k(\delta)}{\sqrt{n_h^k(s,a,x) \!+\! 4\lambda}}. \end{align*} \end{lemma} \Cref{lemma: local feature confidence} allows one to reason about the unknown features locally for any visited $(s,a,x)$, a vital step toward an efficient optimistic planner. Indeed, as we see in the next section, the cost of planning in logistic DCMDPs can be reduced significantly using this bound. \subsection{Threshold Optimistic Planning} \label{section: optimistic planning} We now address the major computational challenge of \Cref{alg: LDC-UCB} -- the complexity of optimistic planning (line 3 of \Cref{alg: LDC-UCB}). To do this, we leverage the local bound in \Cref{lemma: local feature confidence} and construct an optimistic planner using a novel threshold mechanism, as we describe next. Recall the set of sufficient statistics $\suffset(\paramvec) = \brk[c]*{\suff(\hist; \paramvec)}_{\hist \in \mathcal{H}}$ (\Cref{defition: sufficient statistic}), which is a finite, vector-valued set with cardinality $\abs{\suffset(\paramvec)} = \mathcal{O}\brk*{(SAMH)^{MH}}$, making planning in state space $S \times \suffset$ exponentially hard. Consequently, searching for the optimistic DCMDP in the space of feature maps satisfying $\paramvec \in \C_k(\delta)$ (\Cref{eq: optimistic dcmdp set}) requires searching over an exponentially large space. We mitigate this problem exponentially, by leveraging the local confidence bound in \Cref{lemma: local feature confidence}. Let $\rectset \subset \R^M \times \R^M$ be the rectangular cuboid of all candidate confidence intervals satisfying the bound in \Cref{lemma: local feature confidence}. That is, $\rectset$ is the set of all $M$ dimensional intervals $\brk[s]*{\bs{l}_h^k(s,a,x), \bs{u}_h^k(s,a,x)}$, such that for all $h,s,a,x$, $\paramvectrue_h(s,a,x) \in \brk[s]*{\bs{l}_h^k(s,a,x), \bs{u}_h^k(s,a,x)}$, where, $ \bs{u}_h^k(s,a,x), \bs{l}_h^k(s,a,x) = {\estparamvec^k_T \pm \brk*{\frac{2\sqrt{\kappamin}\gamma_k(\delta)}{\sqrt{n^k_{h}(s,a,\x[1]) + 4\lambda}}, \hdots, \frac{2\sqrt{\kappamin}\gamma_k(\delta)}{\sqrt{n^k_{h}(s,a,\x[M]) + 4\lambda}}}^T} $. In what follows, we identify key characteristics of the optimistic value when optimized over $\rectset$. Specifically, we show that an optimistic solution lies on the extreme points of $\rectset$, but more importantly, at one of \emph{$M$ specific extreme points}. This limits the search required by optimistic planning to a much smaller set, which can be approximated effectively in practice. \paragraph{Optimism in intervals. } Instead of augmenting the state space with $\suffset(\paramvec)$, we use the set of confidence intervals defined by $\rectset$. We denote by $\ci_h^k: \suffset(\estparamvec^k) \mapsto \R^M \times \R^M$ the confidence interval of the sufficient statistic $\suff(\hist_h^k, \estparamvec^k)$. That is, \begin{align*} &\ci_h^k = \ci(\suff(\hist_h^k; \estparamvec^k)) \\ &= \brk[s]*{ \sum_{t=0}^{h-1} \alpha^{h-t-1} \bs{l}_h^k(s_t^k,a_t^k,x_t^k), \sum_{t=0}^{h-1} \alpha^{h-t-1} \bs{u}_h^k(s_t^k,a_t^k,x_t^k) }. \end{align*} We also denote by $\ciset^k = \brk[c]*{\ci(\suff(\hist, \estparamvec^k_T))}_{\hist \in \mathcal{H}}$ the set of possible confidence intervals over $\rectset$ in episode $k$. Next, we augment the state space $\s$ at every episode $k$ by $\s \times \ciset^k$, and define the augmented state-action optimistic value for context $i \in [M+1]$ and confidence interval $\ci_h^k = \ci(\suff(\hist_h^k, \paramvec^k))$ at time step $h \in [H]$ by \begin{align*} \bar Q_i(s,a, \ci_h^k)) = \bar r_i(s,a) + \expect*{s' \sim \hat P_i(\cdot|s,a)}{\bar V_{h+1}(s', \ci_{h+1}^k)}, \end{align*} where, with slight abuse of notation, we used $\ci_{h+1}^k = \ci\brk*{\suff\brk*{\hist_h^k \cup \brk[c]*{s, a, \x[i]}, \estparamvec^k_T}}$ to denote the next aggregated confidence interval. The optimistic value $\bar V_h$ is defined by maximizing over sufficient statistics in the confidence set $\ci_h^k$ and $a\in\A$. That is, \begin{align} \bar V_h(s, \ci_h^k) = \max_{a \in \A} \max_{\bar \suff \in \ci_h^k} \sum_{i=1}^{M+1} z_i(\bar \suff) Q_i(s,a, \ci_h^k) \label{eq: value hard maximization} \end{align} Indeed, $\bar V_h$ is an optimistic value, as shown by the following proposition. Its proof is provided in \Cref{appendix: proof of optimistic value proposition}. \begin{restatable}[Optimistic Value]{proposition}{OptimisticValue} \label{prop: optimism tractable ldc-ucb} Let $\bar V_h$ as defined in \Cref{eq: value hard maximization}. Then, w.h.p. $\bar V_1(s_1^k, \ci_1^k) \geq V^*_1(s_1^k)$. \end{restatable} \begin{algorithm}[t!] \caption{Tractable LDC-UCB} \label{alg: LDC-UCB Tractable} \begin{algorithmic}[1] \FOR{$k=1, \hdots, K$} \STATE $\bar r_{i,h}^{k}(s,a) = \hat r_{i,h}^{k}(s,a) + b^k_{i,h}(s,a), \forall i,h,s,a$ \STATE $\bar \pi^k \gets \texttt{Optimistic DP}\brk*{\bar r^k, \hat P^k, \rectset}$ \hfill {\color{gray}// Eq.~\ref{eq: value hard maximization}} \STATE Rollout a trajectory by acting $\bar \pi^k$ \STATE $\estparamvec^{k+1}_T \in \arg\max_{\paramvec \in \paramset} \mathcal{L}^k_\lambda(\paramvec)$ \hfill {\color{gray}// Eq.~\ref{eq: likelihood}} \STATE Update $\hat{P}_i^{k+1}(s,a), \hat{r}_i^{k+1}(s,a), n^{k+1}(s,a,x)$ over rollout trajectory \ENDFOR \end{algorithmic} \end{algorithm} Next, we turn to show that the maximization problem in \Cref{eq: value hard maximization} can be solved efficiently, though $\ci_h^k$ is an exponentially large set. Notice that the inner term $\sum_{i=0}^M z_i(\bar \suff) Q_i(s,a, \ci_h^k)$ in \Cref{eq: value hard maximization} is not convex. Still, our analysis shows that a solution to the inner maximization problem lies in the set of extreme points of $\ci_h^k$. That said, these $2^M$ extreme points make exhaustive search intractable. Fortunately, we can also show that the optimal solution lies in a space of exactly $M$ solutions -- a linearly sized, tractable search space. To this end, we define the threshold set, which we will use to construct the (linear) set of feasible extreme points. \begin{definition} For a rectangular cuboid defined by the interval $\ci = [\bs{l}, \bs{u}] \subseteq \R^{M+1} \times \R^{M+1}$, vector $\bs{y} \in \R^{M+1}$ and real number $t \in \R$ we define $\thr{t}{\bs{y},\ci} \in \R^{M+1}$ by \begin{align*} \brk[s]*{\thr{t}{\bs{y},\ci}}_i = \begin{cases} l_i & y_i < t\\ u_i & \text{o.w.} \end{cases} \end{align*} \end{definition} \begin{definition} \label{def: threshold set} For a vector $\bs{Q} \in \R^{M+1}$, we define the threshold set $\thrset{\bs{Q}} = \brk[c]*{\frac{Q_i + Q_{i+1}}{2}}_{i=1}^{M}$. \end{definition} We use these definitions to show that the optimal solution to \Cref{eq: value hard maximization} lies in the threshold set of $Q$-values (see proof in \Cref{appendix: proof of threshold optimism}). \begin{restatable}[Threshold Optimism]{lemma}{ThresholdOptimism} \label{lemma: threshold optimism} Let $\bs{Q} \in \R^{M+1}$. For any $\bs{x} \in \R^{M+1}$ such that $x_i = 0$ define $f(\bs{x}) = \sum_{i=1}^{M+1} z_i(\bs{x}) Q_i$. Let $\ci = [\bs{l}, \bs{u}] \subseteq \R^{M+1} \times \R^{M+1}$ and assume that $\bs{l} < \bs{u}$. Then, there exists $t \in \thrset{\bs{Q}}$ such that $\thr{t}{\bs{Q},\ci} \in \arg\max_{\bs{x} \in \ci} f(\bs{x})$. \end{restatable} We can now leverage \Cref{lemma: threshold optimism} to solve the inner maximization in \Cref{eq: value hard maximization}. For notational convenience, we write $\bar Q_i = \bar Q_i(s,a, \ci_h^k)$ and $\bs{Q} = \brk*{Q_1, \hdots, Q_{M+1}}^T$. Applying \Cref{lemma: threshold optimism}, we get that \begin{align} \max_{\bar \suff \in \ci_h^k} \sum_{i=1}^{M+1} z_i(\bar \suff) \bar Q_i = \max_{t \in \thrset{\bs{Q}}} \sum_{i=1}^{M+1} z_i\brk*{\thr{t}{\bs{Q},\ci_h^k}} \bar Q_i. \label{eq: threshold maximization} \end{align} As a result, the non-convex maximization problem in \Cref{eq: threshold maximization} reduces the search space to $M$ optimistic candidates. \subsection{Putting It All Together} Using \Cref{lemma: threshold optimism} and particularly its derived corollary in \Cref{eq: threshold maximization}, we construct an optimistic planner, denoted by \texttt{Optimistic DP}, which plans via dynamic programming using \Cref{eq: threshold maximization}; we refer to \Cref{appendix: threshold optimistic planning} for an explicit formulation of the optimistic planner. Finally, using the tractable estimator $\estparamvec^k_T$, and the threshold optimistic planner, we present a tractable variant of LDC-UCB in \Cref{alg: LDC-UCB Tractable}, for which we have the following regret guarantee. \begin{restatable}{theorem}{tractableLdcUcb} \label{thm: regret tractable ldc-ucb} Let $\lambda = \Theta(\frac{HM^{2.5}SA}{L})$. With probability at least $1-\delta$, the regret of \Cref{alg: LDC-UCB Tractable} is \begin{align*} R(K) \leq \tilde \Ob\brk*{\sqrt{H^8 M^{6.5} S^2 A^2 L^4 \kappamin K}}. \end{align*} \end{restatable} The proof of the theorem can be found in \Cref{appendix: regret analysis tractable algorithm}. As expected, the regret upper bound in \Cref{alg: LDC-UCB Tractable} is worse than that of \Cref{alg: LDC-UCB} by a factor of $\tilde{\Ob}\brk*{HML}$. This result is strongly affected by the looser bound for the tractable feature maps in \Cref{lemma: local feature confidence}. Nevertheless, the intractability of \Cref{alg: LDC-UCB} compared to the tractability of \Cref{alg: LDC-UCB Tractable} suggests this is a more-than-reasonable tradeoff. Moreover, our tractable variant of LDC-UCB gives rise to practical optimistic algorithms, as we demonstrate next. \section{DCZero} \label{section: dczero} Motivated by our theoretical results, we present a practical model-based optimistic algorithm for solving DCMDPs. We build on MuZero \citep{schrittwieser2020mastering}, a recent model-based algorithm which constructs a model in latent space and acts using Monte Carlo Tree Search (MCTS, \citet{coulom2007efficient}). MuZero uses representation, transition, and prediction networks for training and acting. The representation network first embeds observations in a latent space, after which planning takes place using the transition and prediction networks through a variant of MCTS. Importantly, instead of predicting the next state (e.g., using world models \citep{hafner2023mastering}), MuZero trains its latent space by predicting three quantities---the reward, value, and current policy---by rolling out trajectories in latent space (see \citet{schrittwieser2020mastering} for further details). We develop DCZero, an algorithm based on MuZero for DCMDPs (see \Cref{alg: DCZero}). Like MuZero, DCZero uses representation, transition, and prediction networks to learn and act in the environment. In contrast to MuZero, DCZero trains an additional ensemble of networks to estimate the unknown features $\paramvectrue$ using cross-entropy. Estimated quantities of the ensemble are used to construct confidence intervals for the sufficient statistics, which are used to augment the state. DCZero uses $M+1$ transition networks (one for each context), and predicts $M+1$ reward functions. To incorporate optimism, the value function is trained optimistically using the thresholding technique in the previous section, where rewards for unseen actions are sampled from the trained reward models $r_i$ and next states are sampled from the trained models $P_i$. \paragraph{Movie Recommendation Environment.} To evaluate the effectiveness of DCZero, we develop a movie recommendation environment based on the MovieLens dataset \citep{harper2015movielens}. Users and items are represented in embedding space computed using SVD of the MovieLens ratings matrix. Each of $n$ users is assigned a set of $M$ possible user embeddings; i.e., each user $u \in \brk[c]*{u^{(i)}}_{i=1}^n$ is assigned a set of preference vectors $\bs{x} = \brk[c]*{\bs{x}^{(j)}}_{j=1}^{M+1}, \bs{x}^{(j)} \in \R^d$. Intuitively, these vectors reflect distinct user preferences corresponding to some aspect of the user's latent state (e.g., mood or current interest \cite{cen:kdd20}; location, companions, or activity; level of trust or satisfaction with the system) and hence influence $u$'s behavior. The recommendation agent interacting with a user selects an item $x$ from a random set of $A$ movies, $\brk[c]{\bs{v}^{(a)}}_{a=1}^A, \bs{v}^{(a)} \in \R^d$, and recommends it. The user context then evolves according to some history-dependent dynamics represented by a logistic DCMDP. Specifically, we assume unknown latent features $\paramvectrue(\bs{x},\bs{v})$ with the user's aggregated features (at time $h \in [H]$, episode $k$) being: $\suff_{k,h} = \sum_{t=0}^{h-1} \alpha^{h-t-1} \paramvectrue(\bs{x}_{k}^{(j_t)},\bs{v}^{(a_t)})$. The agent recommends movie $\bs{v}^{(a)}$ to the user, while the user preference vector is sampled as $\bs{x}_k^{j_h} \sim z(\suff_{k,h})$. The agent then receives a reward $r_j(\bs{x}, a) = (\bs{x}^{(j_h)}_k)^T \bs{\Sigma} \bs{v}^{(a)}$ reflecting the user's (current) preference for the movie, and the user's latent state transitions given the unknown function $\paramvectrue(\bs{x},\bs{v})$ and discount $\alpha$; that is, $\suff_{k,h+1} = \alpha \suff_{k,h} + \paramvectrue(\bs{x}^{(j_h)}_{k}, \bs{v}^{(a)})$. We test our methods in two variants of this environment. In the first, ``AttractionEnv'', user latent features $\paramvectrue$ are correlated with the user's degree of preference for the recommended movie: \begin{align*} \paramvectrue(\bs{x}^{(j)}, \bs{v}) = \mu\brk1{(\bs{x}^{(j)})^T \bs{\Sigma} \bs{v}}, \tag{Attraction} \end{align*} where $\mu$ is a component-wise monotonically increasing function. AttractionEnv reflects users with a tendency to desire content similar to those they most recently consumed. This may reflect the positive influence of exposure to new types of content, increased familiarity increasing preference, or content domains (such as music) where some mild consistency of experience is preferred to jarring shifts in style or genre. The second environment, ``NoveltyEnv'', reflects a contrasting dynamics in which user latent features evolve such that $\paramvectrue$ is anti-correlated with the user's preference for the recommended movie: \begin{align*} \paramvectrue_i(\bs{x}^{(j)}, \bs{v}) = \begin{cases} -\mu\brk*{(\bs{x}^{(j)})^T \bs{\Sigma} \bs{v}} & ,j = i \\ \mu\brk*{(\bs{x}^{(j)})^T \bs{\Sigma} \bs{v}} & ,\text{o.w.} \end{cases} \tag{Novelty} \end{align*} As a result, movies that previously appealed to the user become less preferred, reflecting a desire for novelty over short time periods. \begin{algorithm}[t!] \caption{DCZero} \label{alg: DCZero} \begin{algorithmic}[1] \STATE{ \textbf{require:}} Size of ensemble $B$ \STATE{ \textbf{init:}} Replay buffer $\mathcal{R} \gets \emptyset$ \FOR{$k=1, 2, \hdots$} \STATE Train bootstrap ensemble of $B$ feature maps $\brk[c]*{\estparamvec_{\bs{\theta}_b}: \s \times \A \times \X \mapsto \R^M}_{b=1}^B$ over $\mathcal{R}$ using cross-entropy loss. \STATE Augment state $s$ with aggregated feature confidence ${\ci_h \gets \sum_{t=0}^{h-1} \alpha^{h-t-1} \text{std}_{b} \brk*{\brk[c]*{ \estparamvec_{\bs{\theta}_b}(s_t, a_t, x_t)}_{b=1}^B}}$. \STATE Train threshold optimistic value estimator over $\mathcal{R}$ \begin{align*} &\bar Q_{i,\bs{\psi}}(s,a, \ci_h)) = \hat r_i(s,a) + \gamma \expect*{s' \sim \hat P_i(\cdot|s,a)}{\bar V_{\bs{\psi}}(s', \ci_{h+1})}, \\ &\bar V_{\bs{\psi}}(s, \ci_h) = \max_{t \in \thrset{\bs{Q}_{\bs{\psi}}}} \sum_{i=1}^{M+1} z_i\brk*{\thr{t}{\bs{Q}_{\bs{\psi}},\ci_h^k}} \bar Q_{i,\bs{\psi}}^{\pi_{\bs{\phi}}(s)}. \end{align*} \STATE Act and train representation network, $M$ transition networks (for each $\hat P_i$), and $M$ prediction networks (for each $\hat r_i$) using \texttt{MuZero-ALG} with the optimistic value $\bar V_{\bs{\psi}}$ in MCTS. Return replay buffer $\mathcal{R}$. \ENDFOR \end{algorithmic} \end{algorithm} \begin{figure*}[t!] \centering \includegraphics[width=\linewidth]{imgs/plots.pdf} \caption{\small Plots comparing MuZero, Hist-Muzero, and DCZero on the AttractionEnv(left) and NoveltyEnv (middle). We also compare results for different values of $\alpha$ (right). All experiments show mean scores with 95\% confidence intervals. } \label{fig: experiments} \end{figure*} \paragraph{Experiments.} All experiments used a horizon of ${H=300}$, $M=6$ user classes, $A=6$ slate items (changing every reset), and a user embedding dimension of $d=20$. We used default parameters for MuZero and applied the same parameters to DCZero. We compared DCZero and MuZero on the AttractionEnv and NoveltyEnv environments. We also tested a history-dependent variant of MuZero, which uses the sequence of past movies and contexts to densely represent history. More specifically, Hist-MuZero uses a stack of $30$ previous observations as its state. We implemented both MLP and Transformer-based model architectures, but present results for the Transformer, as both had similar performance. \Cref{fig: experiments} shows these comparisons. The plots compare the return of DCZero with the two baselines on AttractionEnv and NoveltyEnv with $\alpha=0.99$; we also vary the values of $\alpha$ on the AttractionEnv. We see that DCZero is able to outperform both baselines, with significant increases in performance for larger values of $\alpha$ (i.e., longer history dependence). This suggests that DCZero can be especially beneficial in problems that exhibit long history dependence. Interestingly, we note that using a dense history-dependent Transformer hurts performance, except for very small values of $\alpha$ (indeed, only for $\alpha = 0.1$ does the sequence model outperform the other methods). \section{Related Work} Our work is related to a range of research on contextual MDPs, partially observable environments, and termination-based reinforcement learning. \paragraph{Contextual MDPs.} Contextual MDPs \citep{hallak2015contextual} have proven useful in a numerous studies \citep{jiang2017contextual,zintgraf2019varibad,kwon2021rl}. Contexts are sampled once and are fixed throughout the episode. DCMDPs can be seen as a generalization of contextual MDPs, where contexts can change over time in a realistic, history-dependent fashion. Other forms of DCMDPs, are interesting directions for future work, including DCMDPs for which contexts change slowly in time. \paragraph{Partially Observable Environments.} Partially observable MDPs are widely studied \citep{papadimitriou1987complexity,vlassis2012computational,krishnamurthy2016pac,tennenholtz2020off,xiong2022sublinear}. As POMDPs are inherently history dependent, recent work has identified models and assumptions for which sample-efficient algorithms can be derived \citep{xiong2022sublinear,liu2022partially,liu2022optimistic}. Nevertheless, such solutions are often computationally intractable, impeding their practical implementation. With DCMPDs, we focus on specific forms of history-dependence, and show them to be computationally tractable, as well as effectively deployable. \paragraph{Termination-based RL.} \citet{tennenholtz2022reinforcement} define TerMDPs, a framework which models exogenous, non-Markovian termination in the environment. Once terminated, the agent stops acting and accrues no further rewards. TerMDPs capture various scenarios in which exogenous actors disengage with the agent (e.g., passengers in autonomous vehicles or users abandoning a recommender), and can be shown to be a special case of logistic DCMDPs (see \Cref{appendix: termdp}). As such, logistic DCMDPs support reasoning about optimizing more general contextual behavior, including: those involving notions of trust (e.g., where users become more or less receptive to agent recommendations); situations where humans override an agent for short periods; and modeling the effects of user satisfaction, moods, etc. \section{Discussion and Future Work} In this work we presented DCMDPs, and logistic DCMDPs in particular---a general history-dependent contextual framework which admits sample and computationally efficient solutions. The aggregation structure of logistic DCMDPs gives rise to efficient estimation of the unknown feature maps. We provided regret guarantees and developed a tractable realization of LDC-UCB using a computational estimator and a novel planning procedure. Finally, we tested DCZero, a model-based implementation of LDC-UCB, demonstrating its efficacy on a recommendation benchmark. While logistic DCMDPs assume linear aggregations of past features, other variants with more complex parametric function classes over history are possible. Nevertheless, such complex function classes often require sample-inefficient techniques, suggesting that logistic DCMDPs may be especially well-suited to capturing extended, long history dependence. In particular, they admit sample and computationally efficient solutions, which can be implemented in practice. As future work, a hybrid approach which considers combining dense models (such as Transformers) for short-history dependence, and aggregated models (such as logistic DCMDPs) for very long history dependence, may offer the ``best of both worlds" in practice. We leave this as an interesting direction for future work. Finally, this paper did not discuss solutions for partially observable contexts in logistic DCMDPs (where contexts are history dependent, yet unobserved). Such a setting requires additional assumptions, that are out-of-scope in this work. Nevertheless, our results can be used as building blocks for solving such latent logistic DCMDPs. \section*{Acknowledgements} \begin{wrapfigure}{r}{0.1\linewidth} \vspace{-.25cm} \hspace{-.35cm} \includegraphics[width=1.2\linewidth]{imgs/EU_logo.png} \vspace{-.2cm} \end{wrapfigure} This project has received funding from the European Union’s Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No 101034255. Nadav Merlis is partially supported by the Viterbi Fellowship, Technion.
\section{Introduction} \label{sec:intro} Simulation of large-scale nonlinear dynamical systems can be time-consuming and resource-intensive. It is a frequent bottleneck when these simulations are used for real-time, model-based control. Reduced-order models (ROMs) provide an attractive solution to this problem by approximating dynamical systems (and their relevant system-theoretic properties) in a much lower dimensional state space; see, e.g., \cite{AntBG20, antoulas05, BCOW2017morBook, Zho96, SvdVR08,BGW15surveyMOR} for a general overview. These ROMs then allow for the design of low-dimensional controllers and filters. Balanced truncation model reduction, as pioneered by Moore~\cite{moore81principal} and Mullis and Roberts~\cite{mullis1976synthesis} for \textit{linear} time-invariant (LTI) systems, provides an elegant approach to the model reduction problem for open-loop settings. The approach uses the controllability and observability energies of a system to determine those states that have the most relative importance. If a state requires a large amount of input energy to be reached and also has minimal effect on the output, then the reduced model would neglect that state without a significant impact on the input-output behavior of the system. Extensions of this concept to closed-loop LTI systems led to the LQG balancing \cite{verriest1981suboptimal,jonckheere1983LQGbalancing} and $\mathcal{H}_\infty$ balancing concepts~\cite{glover91Hinftybalancing}. Several variants for different formulations of the LTI system and different reduced-model outcomes exist, such as stochastic balancing~\cite{desai1984stochasticBal,green1988balancedstochastic}, bounded real balancing~\cite{opdenacker1988contraction}, positive real balancing~\cite{desai1984stochasticBal,ober1991balanced}, and frequency-weighted balancing~\cite{enns1984model}; see also the surveys~\cite{gugercin2004survey,benner2017chapter}. The interest in balancing methods for LTI systems in the 1980s stimulated research in computational methods for solving large-scale Lyapunov or Riccati-type algebraic matrix equations that yielded low-rank solvers \cite{benner2013numerical,simoncini2016computational} and {doubling methods~\cite{li2013solving}} that can solve these matrix equations for millions of states. For \textit{nonlinear} large-scale systems, the theory is largely developed, yet computationally scalable approaches and efficient ROM development remain open problems. The theoretical foundation for balanced truncation of nonlinear open-loop systems proposed by Scherpen~\cite{scherpen1993balancing} defines input and output energy functions and shows that they can be computed as solutions to Hamilton-Jacobi ({HJ}) partial differential equations (PDEs). Theoretical extensions of~\cite{scherpen1993balancing} to the closed-loop setting, such as Hamilton-Jacobi-Bellman (HJB) balancing~\cite{scherpen1994normCoprime} and $\mathcal{H}_\infty$ balancing~\cite{scherpen1996hinfty_balancing} have also been proposed for nonlinear systems, which can be unstable. Aside from the need for computing solutions of HJ(B) equations, nonlinear balancing requires a {\em nonlinear transformation} whereas balancing for LTI systems requires a linear change of variables. While reduced models obtained through the original nonlinear balancing framework~\cite{scherpen1993balancing} were quickly shown to be non-unique~\cite{gray2001nonuniqueness}, a slightly altered transformation suggested in~\cite{fujimoto2010balanced} resolved this issue, resulting in uniquely determined reduced-order models. Krener~\cite{krener2008reduced} suggested a different balancing strategy that applies the balancing to each degree of the polynomial approximations of the energy functions separately. The full nonlinear balance-then-reduce approaches first compute the balancing transformation in the high-dimensional space, and subsequently reduce the model dimension, see~\cite{scherpen1993balancing,scherpen1994normCoprime,scherpen1996hinfty_balancing,fujimoto2008TaylorSeriesBT,sahyoun2013reduced}. However, in the linear case, balance-then-reduce approaches have been shown to be ill-conditioned due the need to invert small Hankel singular values~\cite{antoulas05}. In sum, the nonlinear transformation is difficult to compute---reducing the efficiency of the nonlinear ROM---and can be ill-conditioned as well. Lastly, the development of an error bound similar to the linear case (in terms of neglected Hankel singular values) remains an open problem. Other methods for reducing the dimensionality of the FOM via balancing have been proposed that avoid the computation of the fully nonlinear energy function. Generally, these methods compute a quadratic energy function that then leads to linear subspace reduction. For instance, \cite{verriest2006algebraicGramiansNLBT,bennerGoyal2017BT_quadBilinear} derive algebraic Gramians for the nonlinear system and propose a linear coordinate transform. The authors in \cite{condon2005nonlinear} combined Carleman bilinearization with a balancing method to approximately balance weakly nonlinear systems. Empirical Gramians for nonlinear systems can also be used~\cite{lall2002subspace} and also lead to linear subspace reduction. Lastly, a method for approximating the nonlinear balanced truncation reduction map via reproducing kernel Hilbert spaces (a machine learning-based, data-driven technique) has been proposed in~\cite{bouvrie2017kernel}, and applied to two- and seven-dimensional ODE examples. The idea is to embed the nonlinear dynamical system into a high (or infinite) dimensional Reproducing Kernel Hilbert Space (RKHS). There, linear theory can be applied. Then, the authors learn mappings from the high dimensional RKHS to the balanced finite dimensional system and demonstrate their results on 2d and 7d ODE examples. There also exist related methods that balance different characteristics of the problem (not the aforementioned nonlinear energy functions), such as flow balancing~\cite{verriest2000flow}, incremental balancing~\cite{besselinkScherpen2014incrementalBT}, dynamic balancing~\cite{sassano2014dynamic}. These methods are only loosely connected to the nonlinear Hankel operator and the energy functions~\cite{kawano2016model}. Moreover, incremental balancing is restricted to only odd functions on the right-hand-side of the dynamical systems. Another type of balancing, called differential balancing~\cite{kawano2016model}, has been developed with a connection to the nonlinear Hankel operator. This method requires solving linear time-dependent matrix inequalities (extensions of Lyapunov inequalities) and is therefore focused on open-loop systems. In this two-part article, we propose a scalable and computationally efficient nonlinear balanced truncation approach via nonlinear energy functions that works for both closed- and open-loop systems. Such a method is currently lacking for medium- and large-scale systems. In Part~1 of this article, \cite{KGB_NonlinearBT_Part1}, we (i) propose a unifying framework to the open- \textit{and} closed-loop nonlinear balancing problem by considering Taylor-series-based approaches to solve a class of parametrized HJB equations; (ii) derive the explicit tensor structure for the coefficients of the polynomial expansion which allows our numerical methods to scale up to thousands of state variables; (iii) provide large-scale numerical examples, a scalability analysis, and open-access software for all algorithms. There are three main contributions of this article (Part~2). First, we present a scalable Taylor-series-based strategy that is implemented in open-access software (the \texttt{NLbalancing} repository~\cite{NLbalancing}) for computing the nonlinear state transformations and singular value functions. We then derive the nonlinearly balanced models. The nonlinear state transformation simultaneously ``diagonalizes'' the open- and closed-loop energy functions in the new coordinates. However, this nonlinear balancing transformation can be ill-conditioned (which also occurs in the LTI case) and is expensive to evaluate. Second, we thus develop a computationally efficient \textit{balance-\underline{and}-reduce} strategy that reduces the dimensional of the full-order model (FOM) via model reduction on nonlinear manifolds. The strategy addresses the ill-conditioning problem in the full nonlinear transformation and allows for efficient nonlinear ROM construction. Third, we present nonlinear balanced ROMs for a semi-discretized PDE of Burgers-type, where we investigate the impact of the degree of the nonlinear transformation on the ROM input-output quality and illustrate the behavior of the singular value functions. We highlight that the work herein does not assume a specific form of the dynamical system: the transformation merely balances two polynomial energy functions and produces a nonlinear mapping that can be applied to any nonlinear system. This article is organized as follows. Section~\ref{sec:NLBal} briefly reviews background material on energy functions for nonlinear systems. Section~\ref{sec:BalModels} presents our first key contribution, a scalable strategy for computing the nonlinear basis transformations and the singular value functions. We also present the nonlinearly balanced models in that section. Section~\ref{sec:ROMs} presents our second key contribution, a modified and scalable method to obtain a balanced nonlinear ROM that addresses the ill-conditioning problem in the full nonlinear transformation and allows for more efficient nonlinear ROM evaluation. Section~\ref{sec:numerics} presents numerical results for the nonlinear ROMs for the semi-discretized Burgers equation. Lastly, Section~\ref{sec:conclusions} offers conclusions and an outlook toward future work. \section{Energy functions for nonlinear balancing} \label{sec:NLBal} This section briefly reviews the unifying concept of the $\mathcal{H}_\infty$ energy functions for nonlinear control-affine dynamical systems, see Part~1 of this article (\hspace{-.01em}\cite{KGB_NonlinearBT_Part1}) for more details. Consider the finite-dimensional system \begin{align} \dot{\mathbf{x}}(t) & = \mathbf{f}(\mathbf{x}(t)) + \mathbf{g}(\mathbf{x}(t)) \u(t), \label{eq:FOMNL1}\\ \mathbf{y}(t) &= \mathbf{h}(\mathbf{x}(t)),\label{eq:FOMNL2} \end{align} where $t$ denotes time, $\mathbf{x}(t) \in \mathbb{R}^{n}$ is the state, $\u(t) \in \mathbb{R}^m$ is a time-dependent input vector, $\mathbf{g}:\mathbb{R}^n\mapsto\mathbb{R}^{n\times m}$ encodes the actuation mechanism, $\mathbf{y}(t) \in \mathbb{R}^p$ is the output vector measured by the function $\mathbf{h}:\mathbb{R}^n \mapsto \mathbb{R}^p$, the nonlinear drift term is $\mathbf{f}:\mathbb{R}^n\mapsto\mathbb{R}^n$, and $\mathbf{x} =\mathbf{0}$ is an isolated equilibrium point for $\u=\mathbf{0}$. For the system \eqref{eq:FOMNL1}-\eqref{eq:FOMNL2}, the $\mathcal{H}_\infty$ past energy in the state $\mathbf{x}_0$ is defined, for $0<\gamma$, $\gamma\neq 1$, as {\small \begin{equation} \label{eq:HinftyenergyFunctions1} \mathcal{E}_\gamma^{-}(\mathbf{x}_0) :=\min_{\substack{\u \in L_{2}(-\infty, 0] \\ \mathbf{x}(-\infty) = \mathbf{0}, \\ \mathbf{x}(0) = \mathbf{x}_0}} \ \frac{1}{2} \int\displaylimits_{-\infty}^{0} (1-\gamma^{-2})\Vert \mathbf{y}(t) \Vert^2 + \Vert \u(t) \Vert^2 {\rm{d}}t. \end{equation}} Furthermore, the $\mathcal{H}_\infty$ future energy in the state $\mathbf{x}_0$ is defined, for $0<\gamma<1$ as \begin{equation} \label{eq:HinftyenergyFunctions3} \mathcal{E}_\gamma^{+}(\mathbf{x}_0) :=\max_{\substack{\u \in L_{2}[0,\infty) \\ \mathbf{x}(0) = \mathbf{x}_0, \\ \mathbf{x}(\infty) = \mathbf{0}}} \ \frac{1}{2} \int\displaylimits_{0}^{\infty} \Vert \mathbf{y}(t) \Vert^2 + \frac{\Vert \u(t) \Vert^2}{1-\gamma^{-2}} {\rm{d}}t, \end{equation} and for $\gamma>1$, as \begin{equation} \label{eq:HinftyenergyFunctions2} \mathcal{E}_\gamma^{+}(\mathbf{x}_0) :=\min_{\substack{\u \in L_{2}[0,\infty) \\ \mathbf{x}(0) = \mathbf{x}_0 , \\ \mathbf{x}(\infty) = \mathbf{0}}} \ \frac{1}{2} \int\displaylimits_{0}^{\infty} \Vert \mathbf{y}(t) \Vert^2 + \frac{\Vert \u(t) \Vert^2}{1-\gamma^{-2}} {\rm{d}}t. \end{equation} The $\mathcal{H}_\infty$ energy functions can be computed via HJB PDEs, see Part~1 of this paper, \cite[Sec.~II]{KGB_NonlinearBT_Part1}, for more details. For LTI systems, these energy functions are quadratic in the state and can be computed by solving $\mathcal{H}_\infty$ algebraic Riccati equations. Under the assumption that the energy functions exist and are smooth, the open-loop nonlinear energy functions $\mathcal{E}_c(\mathbf{x})$ and $\mathcal{E}_o(\mathbf{x})$ (see \cite[Sec 2.5]{KGB_NonlinearBT_Part1} can be obtained in the limit $\gamma\rightarrow 1$ of the $\mathcal{H}_\infty$ energy functions $\mathcal{E}_\gamma^{-}(\mathbf{x})$ and $\mathcal{E}_\gamma^{+}(\mathbf{x})$, i.e., \begin{equation} \label{eq:limitto1} \lim_{\gamma\rightarrow 1} \mathcal{E}_\gamma^{-}(\mathbf{x}) = \mathcal{E}_c(\mathbf{x}), \quad \lim_{\gamma\rightarrow 1} \mathcal{E}_\gamma^{+}(\mathbf{x}) = \mathcal{E}_o(\mathbf{x}). \end{equation} In this article, we assume similar to \cite{lukes1969optimal} that the energy functions are polynomial (or are approximated as such), which allows us scalability in our approach to the model reduction process. In particular, we assume that the past energy function is represented in the form (or is approximated as) \begin{equation} \label{eq:pastenerexp} \mathcal{E}_\gamma^-(\mathbf{x}) \approx \frac{1}{2}\left ( \v_2^\top \kronF{\mathbf{x}}{2} + \v_3^\top \kronF{\mathbf{x}}{3} + \cdots + \v_d^\top \kronF{\mathbf{x}}{d} \right ). \end{equation} where {$\v_k \in \mathbb{R}^{n^k}$ and} $\kronF{\mathbf{x}}{k}$ denotes the $k$-term Kronecker product of $\mathbf{x}$ defined as \begin{equation} \kronF{\mathbf{x}}{k}: = \underbrace{\mathbf{x} \otimes \dots \otimes \mathbf{x}}_{k \ \text{times}} {\in \mathbb{R}^{n^k}}. \end{equation} We also assume the future energy function $\mathcal{E}_\gamma^+(\mathbf{x})$ has the form (or is approximated as) \begin{align} \mathcal{E}_\gamma^+(\mathbf{x}) & \approx \frac{1}{2}\left ( \mathbf{w}_2^\top \kronF{\mathbf{x}}{2} + \mathbf{w}_3^\top \kronF{\mathbf{x}}{3} + \dots + \mathbf{w}_d^\top \kronF{\mathbf{x}}{d} \right ), \label{eq:wi_coeffs} \end{align} where {$\mathbf{w}_k \in \mathbb{R}^{n^k}$}. To ensure a unique representation of the coefficients in \eqref{eq:pastenerexp} and \eqref{eq:wi_coeffs}, we assume that the polynomial representations of the energy functions have a symmetric representation as explained next. \begin{definition}[Symmetric Coefficients\label{def:sym}] A monomial term with real coefficients $\mathbf{w}_d^\top \kronF{\mathbf{x}}{d}$ has {\em symmetric coefficients} if it satisfies \begin{displaymath} \mathbf{w}_d^\top \hspace{-0.5ex} \left(\a_1 \otimes \a_2 \otimes \cdots \otimes \a_d\right) = \mathbf{w}_d^\top \hspace{-0.5ex} \left(\a_{i_1} \otimes \a_{i_2} \otimes \cdots \otimes \a_{i_d}\right), \end{displaymath} where the indices $\{ i_k \}_{k=1}^d$ are any permutation of $1, \ldots, d$. \end{definition} Note that Algorithm~1 in Part~1 of this paper is designed to ensure symmetry in the computed coefficients. This symmetry definition generalizes the definition of symmetry from matrices to tensors. For example, requiring $\mathbf{w}_2^\top (\a\otimes \b) = \mathbf{w}_2^\top (\b\otimes \a)$ for any $\a$ and $\b$ is equivalent to $(\a^\top\otimes\b^\top)\mathbf{w}_2 = (\b^\top\otimes\a^\top)\mathbf{w}_2$. Hence, using $\mathbf{w}_2 = \text{vec}(\mathbf{W}_2)$, we have $\b^\top \mathbf{W}_2 \a = \a^\top \mathbf{W}_2 \b$. Since these are real scalars, this implies $\mathbf{W}_2 = \mathbf{W}_2^\top$. \begin{remark} In \cite[Sec.~3]{KGB_NonlinearBT_Part1}, we present scalable methods to compute the polynomial approximations \eqref{eq:pastenerexp} and \eqref{eq:wi_coeffs} to the energy functions. However, one may also exploit other approaches, e.g., machine learning~\cite{bouvrie2017kernel} or polynomial fitting to obtain a polynomial form of the energy functions. The methods in this paper are agnostic to how the vectors $\v_i$ and $\mathbf{w}_i$ are computed. \end{remark} \section{From energy functions to balanced models} \label{sec:BalModels} Energy functions are at the heart of the balancing and model reduction process, both for linear and nonlinear systems. In this section, we suggest a tensor-based approach to compute two different balancing transformations that efficiently ``diagonalize" these energy functions by exploiting the polynomial structure of the energy functions in \eqref{eq:pastenerexp} and \eqref{eq:wi_coeffs}. We compute the {\em input-normal/output-diagonal} balancing transformation in Section~\ref{sec:inputnormal}, the {\em input-output} balancing transformation in Section~\ref{sec:inputoutput}, and present the nonlinearly transformed FOM (in either input-normal/output-diagonal form or in input-output balanced form) in Section~\ref{sec:balancedFOM}. \subsection{Input-normal/output-diagonal balancing transformation} \label{sec:inputnormal} The following theorem shows the existence of a nonlinear coordinate transformation that brings the nonlinear system \eqref{eq:FOMNL1}--\eqref{eq:FOMNL2} into the input-normal/output-diagonal form. \begin{theorem} \cite[Thm. 8]{fujimoto2010balanced} \label{thm:inputnormal} Suppose the Jacobian linearization of the nonlinear system is controllable, observable, and asymptotically stable. Then there is a neighborhood $\mathcal{W}$ of the origin and a smooth coordinate transformation $\mathbf{x} = \Phi(\mathbf{z})$ on $\mathcal{W}$ with $\mathbf{z} = [z_1, z_2, \ldots, z_n]$ such that the controllability and observability energy functions have {\em input-normal/output-diagonal} form: \begin{align} \mathcal{E}_c(\Phi(\mathbf{z})) & = \frac{1}{2} \sum_{i=1}^n z_i^2, \label{eq:balRealCont} \\ \mathcal{E}_o(\Phi(\mathbf{z})) & = \frac{1}{2} \sum_{i=1}^n \xi_i^2(z_i) z_i^2. \label{eq:balRealObs} \end{align} \end{theorem} \vspace{0.1cm} The above theorem also holds for the closed-loop balancing case (even for unstable systems under additional assumptions, see \cite[Thm. 5.13]{scherpen1996hinfty_balancing}). In \eqref{eq:balRealObs}, the functions $\xi_i(z_i)$ are called the singular value functions of the input-normal form. One can think of \eqref{eq:balRealCont} as an energy function with equal contribution from each state to the controllability energy. Unlike the linear case, the singular value functions $\xi_i(z_i)$ are not constant and are state-dependent. Notably, the $i$th singular value function $\xi_i$ only depends on the $i$th state $z_i$, which allows for truncation of the individual states when constructing the ROM, as we see in Section~\ref{sec:ROMs}. \subsubsection{Taylor expansion of singular value functions and the state transformation} Under the conditions of Theorem \ref{thm:inputnormal}, a $C^\infty(\mathbb{R}^n)$ mapping $\mathbf{x} = \Phi(\mathbf{z})$ exists to transform the nonlinear system into the input-normal/output-diagonal form. Here, we assume that this transformation is analytic, so that we can write (or approximate) it as \begin{align} \mathbf{x} = \Phi(\mathbf{z}) & = \mathbf{T}_1 \mathbf{z} + \mathbf{T}_2 \kronF{\mathbf{z}}{2} + \dots + \mathbf{T}_{k} \kronF{\mathbf{z}}{k} \nonumber \\ & =: \mathbf{T}_1 \mathbf{z} + \Phi^h(\mathbf{z}) \label{eq:trafo}, \end{align} where $\mathbf{T}_j \in \mathbb{R}^{n\times n^j}$ are the polynomial coefficients, $\mathbf{T}_1$ is nonsingular, and $\kronF{\mathbf{z}}{k}$ is, as before, the $k$-times Kronecker product of $\mathbf{z}$. This allows for scalable computation of this nonlinear transformation. To abbreviate notation in what follows we group the higher-degree terms in \eqref{eq:trafo} into the term $\Phi^h$. We similarly expand the singular value functions of the input-normal/output-diagonal form associated with the $i$th state component as a degree $\ell$ polynomial \begin{align} \xi_i(z_i) & = \xi_i(0) + c_i^{(1)} z_i + c_i^{(2)} z_i^2 + \cdots + c_i^{(\ell)} z_i^\ell \nonumber\\ & =: \xi_i(0) + \xi_i^h(z_i), \label{eq:expandSval} \end{align} for $i=1, 2, \ldots, n$. Define the coefficients of the degree $j$th terms as $\c_j= [c_1^{(j)}, \ c_2^{(j)}, \ldots, c_n^{(j)}]^\top$, which allows us to write the vector of singular value functions $\mathbf{\xi}(\mathbf{z}) = \left [ \begin{matrix} \xi_1(z_1) & \xi_2(z_2) & \cdots & \xi_n(z_n) \end{matrix} \right ]^\top$ of the input-normal/output-diagonal form as \begin{align} \label{eq:sval_expansion} \mathbf{\xi}(\mathbf{z}) = \mathbf{\Xi} \cdot \mathbf{1} + \diag(\c_1)\mathbf{z} + \dots + \diag(\c_\ell) \mathbf{z}^\ell, \end{align} where $\mathbf{z}^\ell$ denotes \emph{the componentwise power} of the vector $\mathbf{z}$, the diagonal matrix $\mathbf{\Xi}= {\normalfont \text{diag}} (\xi_1^2(0), \ldots, \xi_n^2(0))$, and $\mathbf{1}$ is the vector of ones. The following two sections derive tensor expressions for the efficient computation of $\mathbf{T}_i$ and $\c_i$. \subsubsection{Computing the polynomial coefficient matrices of the input-normal/output-diagonal nonlinear transformation} This section outlines the computations required to obtain the polynomial coefficient matrices $\{\mathbf{T}_i\}_{i=1}^{k}$ for the nonlinear transformation \eqref{eq:trafo}. To begin, we rewrite \eqref{eq:pastenerexp} and \eqref{eq:wi_coeffs} as \begin{align} \mathcal{E}_\gamma^-(\mathbf{x}) & = \frac{1}{2}\mathbf{x}^\top \mathbf{V}_2\mathbf{x} + \mathcal{E}_c^h(\mathbf{x}), \label{eq:NLen}\\ \mathcal{E}_\gamma^+(\mathbf{x}) & = \frac{1}{2}\mathbf{x}^\top \mathbf{W}_2\mathbf{x} + \mathcal{E}_o^h(\mathbf{x}),\label{eq:NLen2} \end{align} with $\mathcal{E}_c^h(\mathbf{x}) = \frac{1}{2}\left ( \v_3^\top \kronF{\mathbf{x}}{3} + \cdots + \v_d^\top \kronF{\mathbf{x}}{d} \right)$ and $\mathcal{E}_o^h(\mathbf{x}) = \frac{1}{2}\left ( \mathbf{w}_3^\top \kronF{\mathbf{x}}{3} + \cdots + \mathbf{w}_d^\top \kronF{\mathbf{x}}{d} \right)$. Note, that from \cite[Thm 5.17]{scherpen1996hinfty_balancing} it follows that $\text{unvec}(\v_2) = \mathbf{V}_2 = \mathbf{Y}_\infty^{-1}$ and $\text{unvec}(\mathbf{w}_2) = \mathbf{W}_2 =\mathbf{X}_\infty$ are the unique symmetric positive-definite stabilizing solutions to the $\mathcal{H}_\infty$ filter ARE {\small \begin{equation} \mathbf{A} \mathbf{Y}_\infty + \mathbf{Y}_\infty \mathbf{A}^\top + \mathbf{B} \mathbf{B}^\top - (1-\gamma^{-2}) \mathbf{Y}_\infty \mathbf{C}^\top \mathbf{C} \mathbf{Y}_\infty = \mathbf{0}, \label{eq:HinftyRiccati1} \end{equation} } and the $\mathcal{H}_\infty$ control ARE {\small \begin{equation} \mathbf{A}^\top \mathbf{X}_\infty + \mathbf{X}_\infty \mathbf{A} + \mathbf{C}^\top \mathbf{C} - (1-\gamma^{-2}) \mathbf{X}_\infty \mathbf{B} \mathbf{B}^\top \mathbf{X}_\infty = \mathbf{0}. \label{eq:HinftyRiccati2} \end{equation} } \noindent To obtain a balanced representation, we insert the transformation \eqref{eq:trafo} into the past energy function~\eqref{eq:NLen} and enforce the input-diagonal structure in equation~\eqref{eq:balRealCont} to obtain \begin{align} \mathbf{z}^\top \mathbf{z} = & \mathbf{z}^\top \mathbf{T}_1^\top \mathbf{V}_2 \mathbf{T}_1 \mathbf{z} + 2\mathbf{z}^\top \mathbf{T}_1^\top \mathbf{V}_2 \Phi^h(\mathbf{z}) \nonumber \\ & + \Phi^h(\mathbf{z})^\top \mathbf{V}_2 \Phi^h(\mathbf{z}) + 2 \mathcal{E}_c^h(\Phi(\mathbf{z})). \label{eq:phiMatch1} \end{align} We can then proceed to compute the matrices $\{\mathbf{T}_i\}_{i=1}^{k}$ by matching polynomial coefficients. Similarly, inserting the transformation \eqref{eq:trafo} into the future energy function \eqref{eq:NLen2} and enforcing diagonalization as in \eqref{eq:balRealObs} yields \begin{align} \sum_{i=1}^n & z_i^2 \left ( \xi_i^2(0) + 2\xi_i(0) \xi_i^h(z_i) + \xi_i^h(z_i)^2 \right ) \nonumber \\ & = \mathbf{z}^\top \mathbf{T}_1^\top \mathbf{W}_2 \mathbf{T}_1 \mathbf{z} + 2\mathbf{z}^\top \mathbf{T}_1^\top \mathbf{W}_2 \Phi^h(\mathbf{z}) \nonumber \\ & \quad + \Phi^h(\mathbf{z})^\top \mathbf{W}_2 \Phi^h(\mathbf{z}) + 2 \mathcal{E}_o^h(\Phi(\mathbf{z})). \label{eq:phiMatch2} \end{align} Knowing the $\{\mathbf{T}_i\}_{i=1}^{k}$ from the previous step, we can solve \eqref{eq:phiMatch2} for the singular value functions. Before stating the next theorem, we introduce the notation \begin{equation} \label{eq:tensorproducts} \mathcal{T}_{m,l} = \sum_{\sum{i_j}=l} \mathbf{T}_{i_1}\otimes \cdots \otimes \mathbf{T}_{i_m} \in \mathbb{R}^{n^m\times n^l}, \end{equation} where $i_j \geq 1$ for each $j=1,\ldots,m$. Thus, $\mathcal{T}_{m,l}$ denotes all unique tensor products with $m$ terms and $n^{l}$ columns. For instance, $\mathcal{T}_{2,3}= \mathbf{T}_1\otimes \mathbf{T}_2 + \mathbf{T}_2\otimes\mathbf{T}_1$, or $\mathcal{T}_{3,4}= \mathbf{T}_1\otimes\mathbf{T}_1\otimes \mathbf{T}_2 + \mathbf{T}_1\otimes\mathbf{T}_2\otimes \mathbf{T}_1 +\mathbf{T}_2\otimes\mathbf{T}_1\otimes \mathbf{T}_1$, which contains three unique triple tensor products, and $\mathcal{T}_{4,4} = \kronF{\mathbf{T}_1}{4}$. \begin{theorem}[Input-normal/output-diagonal transform] \label{thm:polyCoeffsTrafo} Let $\mathbf{w}_i,\v_i$ be the vectors of polynomial coefficients for the energy functions in \eqref{eq:pastenerexp} and \eqref{eq:wi_coeffs}. Let $\L, \mathbf{R}$ be Cholesky factors of $\mathbf{W}_2 = {\rm unvec}(\mathbf{w}_2)$ and $\mathbf{V}_2={\rm unvec}(\v_2)$, i.e., $\mathbf{W}_2 = \L \L^\top$ and $\mathbf{V}_2 = \mathbf{R} \mathbf{R}^\top$. Compute the singular value decomposition of $\L^\top \mathbf{R}^{-\top} = \mathcal{U} \mathbf{\Xi} \mathcal{V}^\top$. % The linear transformation $\mathbf{T}_1$ in \eqref{eq:trafo} and its inverse $\mathbf{T}_1^{-1}$ are given by \begin{equation} \mathbf{T}_1 = \mathbf{R}^{-\top} \mathcal{V} \in \mathbb{R}^{n\times n}, \quad {\mathbf{T}_1^{-1}} = \mathbf{\Xi}^{-1} \mathcal{U}^\top \L^\top \in \mathbb{R}^{n\times n} \end{equation} and they satisfy $\mathbf{T}_1^\top \mathbf{V}_2 \mathbf{T}_1 = \mathbf{I}$ (input-normal) and $\mathbf{T}_1^\top \mathbf{W}_2 \mathbf{T}_1 = \mathbf{\Xi}^2$ (output-diagonal). Moreover, $\mathbf{T}_1^{-1} \mathbf{V}_2^{-1} \mathbf{W}_2 \mathbf{T}_1=\mathbf{\Xi}^2$, i.e., $\mathbf{V}_2^{-1}\mathbf{W}_2$ is similar to $\mathbf{\Sigma}^2$. Thus, $\mathbf{T}_1$ is the well-known input-normal/output-diagonal transformation for the linearized system. The higher-degree tensors of the nonlinear transformation \eqref{eq:trafo} for $k\geq 2$ take the form {\small \begin{subequations} \begin{align} \mathbf{T}_{k} &= -\frac{1}{2} \mathbf{T}_1 {\rm{unvec}}\left( \mathbf{M}_k\right)^\top \in \mathbb{R}^{n\times n^k},~\mbox{where} \label{eq:Tkformula1} \\ \mathbf{M}_k & = \sum_{\substack{i,j>1\\ i+j=k+1}} {\rm{vec}} \left ( \mathbf{T}_{j}^\top \mathbf{V}_2 \mathbf{T}_{i} \right ) + \sum_{i=3}^{k+1} \mathcal{T}_{i,k+1}^\top \v_i \label{eq:Tkformula2} \end{align} \end{subequations} } \end{theorem} \vspace{0.2cm} \begin{remark} \label{remark:kroneckerPoly} Throughout, we often use the fact that the symmetry of the matrix $\mathbf{V}_2$ leads to $\mathbf{z}^\top \mathbf{T}_1^\top \mathbf{V}_2 \Phi^h(\mathbf{z}) + \Phi^h(\mathbf{z})^\top \mathbf{V}_2 \mathbf{T}_1 \mathbf{z} = 2\mathbf{z}^\top \mathbf{T}_1^\top \mathbf{V}_2 \Phi^h(\mathbf{z})$ since these are scalar quantities. Likewise $(\kronF{\mathbf{z}}{k})^\top \mathbf{T}_k^\top \mathbf{V}_2 \mathbf{T}_1 \mathbf{z} = \mathbf{z}^\top \mathbf{T}_1^\top \mathbf{V}_2 \mathbf{T}_k \kronF{\mathbf{z}}{k}$ leads to $\text{vec}(\mathbf{T}_1^\top \mathbf{V}_2 \mathbf{T}_k)^\top \kronF{\mathbf{z}}{k+1} = \text{vec}(\mathbf{T}_k^\top \mathbf{V}_2 \mathbf{T}_1)^\top \kronF{\mathbf{z}}{k+1}$. In general, $\text{vec}(\mathbf{T}_1^\top \mathbf{V}_2 \mathbf{T}_k)^\top \b \neq \text{vec}(\mathbf{T}_k^\top \mathbf{V}_2 \mathbf{T}_1)^\top \b$ for an arbitrary vector $\b$. \end{remark} The tensors $\mathbf{T}_i$ for the quadratic and cubic part of the transformation have the specific form \begin{align} \label{eq:T2} \mathbf{T}_2 =& -\frac{1}{2} \mathbf{T}_1 \ {\rm{unvec}}( [\kronF{\mathbf{T}_1}{3}]^\top \v_3)^\top\\ % \mathbf{T}_3 =& -\frac{1}{2} \mathbf{T}_1 \ {\rm{unvec}}\left ( {\rm{vec}}(\mathbf{T}_{2}^\top \mathbf{V}_2 \mathbf{T}_{2} ) \ldots \right. \nonumber \\ & \left. \qquad \qquad \qquad+ \mathcal{T}_{3,4}^\top \v_3 + [\kronF{\mathbf{T}_1}{4}]^\top \v_4 \right )^\top. \label{eq:T3} \end{align} \begin{proof} We start by proving the results for the matrix $\mathbf{T}_1$. Comparing the quadratic terms in~\eqref{eq:phiMatch1}, we conclude that $\mathbf{T}_1^\top \mathbf{V}_2 \mathbf{T}_1 = \mathbf{I}$ and then comparing quadratic terms in~\eqref{eq:phiMatch2} we obtain $\mathbf{T}_1^\top \mathbf{W}_2 \mathbf{T}_1 = \text{diag}(\xi_1^2(0), \ldots, \xi_n^2(0))=\mathbf{\Xi}^2$. Taken together these yield $\mathbf{\Xi}^2 = \mathbf{I}^{-1} \mathbf{T}_1^\top \mathbf{W}_2 \mathbf{T}_1 = \mathbf{T}_1^{-1} \mathbf{V}_2^{-1} \mathbf{T}_1^{-\top} \mathbf{T}_1^\top \mathbf{W}_2 \mathbf{T}_1 = \mathbf{T}_1^{-1} \mathbf{V}_2^{-1} \mathbf{W}_2 \mathbf{T}_1$. This shows that $\mathbf{V}_2^{-1}\mathbf{W}_2$ is similar to $\mathbf{\Xi}^2$, i.e., they both have eigenvalues $\xi_i^{2}(0)$. Therefore $\mathbf{T}_1$ is the input-normal/output-diagonal linear balancing transformation that uses the $\mathcal{H}_\infty$-ARE solutions, see~\eqref{eq:HinftyRiccati1}--\eqref{eq:HinftyRiccati2}, where $\mathbf{V}_2 = \mathbf{Y}_\infty^{-1}$ and $\mathbf{W}_2 =\mathbf{X}_\infty$. We next determine $\mathbf{T}_2, \ldots, \mathbf{T}_k$ by observing that the cubic and higher-degree terms of~\eqref{eq:phiMatch1} are zero, i.e., \begin{align} 0 & =2\mathbf{z}^\top \mathbf{T}_1^\top \mathbf{V}_2 \Phi^h(\mathbf{z}) + \Phi^h(\mathbf{z})^\top \mathbf{V}_2 \Phi^h(\mathbf{z}) + 2 \mathcal{E}_c^h(\Phi(\mathbf{z})). \end{align} Recall that $\Phi^h(\mathbf{z}) = \mathbf{T}_2 \kronF{\mathbf{z}}{2} + \dots + \mathbf{T}_k \kronF{\mathbf{z}}{k}$; thus for $k\geq3$ we match the degree $k$th terms to obtain \begin{align} - 2& \mathbf{z}^\top \mathbf{T}_1^\top \mathbf{V}_2 \mathbf{T}_{k-1} \kronF{\mathbf{z}}{k-1} \nonumber \\ & = \left [ \Phi^h(\mathbf{z})^\top \mathbf{V}_2 \Phi^h(\mathbf{z})\right ]^{\{ k\}} + 2 [ \mathcal{E}_c^h(\Phi(\mathbf{z}))]^{\{ k\}}, \label{eq:phiMatchTerms1} \end{align}% where $[\cdot]^{\{ k \}}$ selects the degree $k$ terms of the expressions inside the bracket. Recall that the higher-degree terms in the energy functions start with cubic contributions, i.e., $\mathcal{E}_c^h(\mathbf{x}) = \frac{1}{2}\left ( \v_3^\top \kronF{\mathbf{x}}{3} + \cdots + \v_d^\top \kronF{\mathbf{x}}{d} \right )$. We next use that for a given matrix $\mathbf{M}$ we have $\mathbf{z}^\top \mathbf{M} \mathbf{z} = \text{vec}(\mathbf{M}^\top)^\top (\mathbf{z} \otimes \mathbf{z})$, see also Remark~\ref{remark:kroneckerPoly}. Consequently, $\mathbf{z}^\top \mathbf{T}_1^\top \mathbf{V}_2 \mathbf{T}_{k-1} \kronF{\mathbf{z}}{k-1} = \text{vec}(\mathbf{T}_{k-1}^\top \mathbf{V}_2 \mathbf{T}_1)^\top \kronF{\mathbf{z}}{k}$. For general $k$, equation \eqref{eq:phiMatchTerms1} can therefore be rewritten as \begin{align} -2 & \text{vec}(\mathbf{T}_{k-1}^\top \mathbf{V}_2 \mathbf{T}_1)^\top \kronF{\mathbf{z}}{k} \\ & = \sum_{\substack{i,j>1\\ i+j=k}} [\kronF{\mathbf{z}}{i}]^\top \mathbf{T}_{i}^\top \mathbf{V}_2 \mathbf{T}_{j} \kronF{\mathbf{z}}{j} + \left ( \sum_{i=3}^k \v_i^\top \kronF{[\Phi(\mathbf{z})]}{i} \right )^{\{ k\}}, \nonumber \end{align} since $\mathbf{V}_2$ is symmetric. Expanding $\Phi(\mathbf{z})$ and using again $\mathbf{z}^\top \mathbf{M} \mathbf{z} = \text{vec}(\mathbf{M}^\top)^\top (\mathbf{z} \otimes \mathbf{z})$ yields {\small \begin{align} -2 & \text{vec}(\mathbf{T}_{k-1}^\top \mathbf{V}_2 \mathbf{T}_1)^\top \kronF{\mathbf{z}}{k} \nonumber \\ & = \sum_{\substack{i,j>1\\ i+j=k}} \text{vec} \left ( \mathbf{T}_{j}^\top \mathbf{V}_2 \mathbf{T}_{i} \right )^\top \kronF{\mathbf{z}}{k} \label{Tkhigher} \nonumber\\ & + \left ( \sum_{i=3}^k \v_i^\top \kronF{[\mathbf{T}_1\mathbf{z} + \mathbf{T}_2 \kronF{\mathbf{z}}{2} +\dots + \mathbf{T}_{k}\kronF{\mathbf{z}}{k}]}{i}\right )^{\{ k\}}. \end{align} } \noindent We next use $\mathbf{V}_2 \mathbf{T}_1 = \mathbf{T}_1^{-\top}$ and the definition of the unique tensor products with $i$ terms and $n^{k}$ columns, $ \mathcal{T}_{i,k}$ and observe that \eqref{Tkhigher} holds if \begin{align} &-2 \text{vec}(\mathbf{T}_{k-1}^\top \mathbf{T}_1^{-\top})^\top \nonumber \\ & = \sum_{\substack{i,j>1\\ i+j=k}} \text{vec} \left ( \mathbf{T}_{j}^\top \mathbf{V}_2 \mathbf{T}_{i} \right )^\top + \sum_{i=3}^k \v_i^\top \mathcal{T}_{i,k} .\label{eq:phiMatchTerms1a} \end{align} Reindexing from $k-1$ to $k$ and reshaping \eqref{eq:phiMatchTerms1a} proves \eqref{eq:Tkformula1}--\eqref{eq:Tkformula2}. Specifically, for $k=2$, the first sum in $\mathbf{M}_k$ in~\eqref{eq:Tkformula2} is zero, to produce~\eqref{eq:T2}. For $k=3$, equation~\eqref{eq:Tkformula2} yields~\eqref{eq:T3}. \end{proof} \noindent The next section focuses on computing the singular value functions $\xi_i^h(z_i)$ associated with the input-normal form, which we obtain by polynomial expansion. \subsubsection{Computing the state-dependent singular value functions} With the $\{\v_i\}_{i=2}^d$ and $\{\mathbf{w}_i\}_{i=2}^d$ available from the energy functions \eqref{eq:pastenerexp} and \eqref{eq:wi_coeffs}, and the $\{\mathbf{T}_i\}_{i=1}^{k}$ from Theorem~\ref{thm:polyCoeffsTrafo}, it remains to compute the polynomial coefficients $\{\c_i\}_{i=1}^{\ell}$ of the singular value functions defined in~\eqref{eq:expandSval}--\eqref{eq:sval_expansion}. The singular value functions are used to determine which modes to keep in the balanced ROM. To determine the singular value functions, consider the cubic and higher-degree terms of equation \eqref{eq:phiMatch2}, i.e., \begin{align} \label{eq:svfunctionsCoeff} &\sum_{i=1}^n z_i^2 \xi_i^h(z_i) \left (2\xi_i(0) + \xi_i^h(z_i) \right ) \\ & = 2\mathbf{z}^\top \mathbf{T}_1^\top \mathbf{W}_2 \Phi^h(\mathbf{z}) + \Phi^h(\mathbf{z})^\top \mathbf{W}_2 \Phi^h(\mathbf{z}) + 2 \mathcal{E}_o^h(\Phi(\mathbf{z})), \nonumber \end{align} for which we know the terms on right-hand side ($\mathbf{T}_i$ from Theorem~\ref{thm:polyCoeffsTrafo} and $\mathbf{w}_i$ from \eqref{eq:wi_coeffs}) as well as $\xi_i(0)$ in the left-hand side from Theorem~\ref{thm:polyCoeffsTrafo}. The following theorem shows how to compute the coefficients $\c_i$ associated with the state-dependent part of the singular value functions in~\eqref{eq:expandSval}. \begin{theorem} Let $\mathbf{z} = [z_1, z_2, \ldots, z_n]^\top$ be the transformed state and $\c_k= [c_1^{(k)}, \ c_2^{(k)}, \ldots, c_n^{(k)}]^\top$ be the $n$ dimensional unknown coefficients vector for the degree $k$ terms as defined in~\eqref{eq:expandSval} and~\eqref{eq:sval_expansion}. The coefficients for the terms that are linear ($k=1$) in the state can be obtained as \begin{equation} \label{eq:c1formula} \c_1 = \mathbf{\Xi}^{-1} \left ({\normalfont \text{vec}} (\mathbf{T}_{2}^\top \mathbf{W}_2 \mathbf{T}_1)^\top + \frac{1}{2}\mathbf{w}_3^\top \kronF{\mathbf{T}_1}{3} \right)_{\mathcal{I}_1} \end{equation} for the indices $\mathcal{I}_1=\{ j \ | \ j=(i-1)(n^2+n) +i, \ i=1,\ldots, n\}$. In general, for $k\geq 1$ we obtain the explicit recursion \begin{align} \label{eq:generalck} \c_{k} = & \frac{1}{2} \mathbf{\Xi}^{-1} \left [ \left(\mathbf{C}_k\right)_{\mathcal{I}_{k}} - \sum_{i+j=k} \c_i\odot\c_j \right ] \end{align} where \begin{align} \label{eq:bigCk} \mathbf{C}_{k} = \hspace*{-1ex} \sum_{\substack{i,j\geq 1\\ i+j=k+2}} \hspace*{-1ex} {\normalfont \text{vec}} \left ( \mathbf{T}_{j}^\top \mathbf{W}_2 \mathbf{T}_{i} \right )^\top + \sum_{i=3}^{k+2} \left(\mathcal{T}_{i,k+2}\right)^\top\mathbf{w}_i, \end{align} $\mathcal{I}_{k}$ is the index set $\mathcal{I}_{k}=\{j \ | \ j=(i-1)\sum_{l=1}^{k+1} n^l+i, \ i=1,\ldots, n \}$, and $\odot$ denotes the Hadamard product (componentwise multiplication). \end{theorem} \begin{proof} We start by matching degree $k$ polynomial terms on both sides of \eqref{eq:svfunctionsCoeff} to obtain \begin{subequations} \label{eq:phiMatchTerms2} \begin{align} \label{eq:phiMatchTerms2a} &\sum_{i=1}^n z_i^2 \left [ \xi_i^h(z_i) \left (2\xi_i(0) + \xi_i^h(z_i) \right ) \right ]^{\{ k-2\}} \\ & = \sum_{i=1}^n z_i^2 \left [ \left(c_i^{(1)} z_i + c_i^{(2)} z_i^2 + \dots + c_i^{(\ell)} z_i^\ell\right) \right. \label{eq:phiMatchTerms2b} \\ & \left. \qquad \cdot \left (2\xi_i(0) +c_i^{(1)} z_i + c_i^{(2)} z_i^2 + \dots + c_i^{(\ell)} z_i^\ell \right ) \right ]^{\{ k-2\}} \nonumber \\ & = 2\mathbf{z}^\top \mathbf{T}_1^\top \mathbf{W}_2 \mathbf{T}_{k-1} \kronF{\mathbf{z}}{k-1} + [ \Phi^h(\mathbf{z})^\top \mathbf{W}_2 \Phi^h(\mathbf{z})]^{\{ k\}} \nonumber \\ & \ \ \ + 2 [\mathcal{E}_o^h(\Phi(\mathbf{z}))]^{\{ k\}}. \label{eq:phiMatchTerms2c} \end{align} \end{subequations} Similar to the proof of Theorem~\ref{thm:polyCoeffsTrafo}, for $k\geq 3$ we obtain the system \begin{align} &\sum_{i=1}^n z_i^2 \left [ (c_i^{(1)} z_i + c_i^{(2)} z_i^2 + \dots + c_{i}^{(k-2)} z_i^{(k-2)} ) \right. \cdot \nonumber \\ & \left. \left (2\xi_i(0) +c_i^{(1)} z_i + c_i^{(2)} z_i^2 + \dots + c_{i}^{(k-3)} z_i^{(k-3)} \right ) \right ]^{\{ k-2\}} \nonumber \\ & = \left ( \sum_{\substack{i,j\geq 1\\ i+j=k}} \text{vec} \left ( \mathbf{T}_{j}^\top \mathbf{W}_2 \mathbf{T}_{i} \right )^\top + \sum_{i=3}^k \mathbf{w}_i^\top \mathcal{T}_{i,k} \right ) \kronF{\mathbf{z}}{k}, \label{eq:ci_equality} \end{align} where in~\eqref{eq:phiMatchTerms2b} we replaced the first $\ell$ with $k-2$ and the second $\ell$ with $k-3$, as those correspond to the highest-degree polynomials we expect to match inside the $\{k-2\}$ selection. Moreover, we exploited the symmetry of $\mathbf{W}_2$ and the fact that $2{\normalfont \text{vec}} (\mathbf{T}_{k+1}^\top \mathbf{W}_2 \mathbf{T}_1)^\top \kronF{\mathbf{z}}{2} = {\normalfont \text{vec}} (\mathbf{T}_{1}^\top \mathbf{W}_2 \mathbf{T}_{k+1})^\top \kronF{\mathbf{z}}{2}+ {\normalfont \text{vec}} (\mathbf{T}_{k+1}^\top \mathbf{W}_2 \mathbf{T}_1)^\top \kronF{\mathbf{z}}{2}$. Focusing on the case $k=3$ then yields an equation for the coefficients $\c_1$: \begin{align} \label{eq:sumci} 2 \sum_{i=1}^n \xi_i(0) c_i^{(1)} z_i^3 = \left ( 2 \text{vec}(\mathbf{T}_{2}^\top \mathbf{W}_2 \mathbf{T}_1)^\top + \mathbf{w}_3^\top \kronF{\mathbf{T}_1}{3} \right )\kronF{\mathbf{z}}{3}. \end{align} For $i=1,2,\ldots,n$, matching the coefficients of $z_i^3$ on both sides of~\eqref{eq:sumci} yields~\eqref{eq:c1formula}, the formula for $\c_1$, where the index set $\mathcal{I}_1$ corresponds to the location of the monomials in $\kronF{\mathbf{z}}{3}$. Next, we focus on quartic ($k=4$) terms in~\eqref{eq:ci_equality} and obtain \begin{align} & \sum_{i=1}^n \left (2c_i^{(2)}\xi_i(0) + (c_i^{(1)})^2 \right )z_i^4 \nonumber \\ & = \left ( 2 \text{vec}(\mathbf{T}_{3}^\top \mathbf{W}_2 \mathbf{T}_1)^\top + {\rm{vec}}(\mathbf{T}_2^\top \mathbf{W}_2 \mathbf{T}_2)^\top \right. \nonumber\\ & \left. \quad + \mathbf{w}_3^\top \mathcal{T}_{3,4} + \mathbf{w}_4^\top \kronF{\mathbf{T}_1}{4} \right ) \kronF{\mathbf{z}}{4}. \end{align} Again, for $i=1,2,\ldots,n$ we match the coefficients of $z_i$ on both sides and so for $\c_2 = [c_1^{(2)}, \ c_2^{(2)}, \ldots, c_n^{(2)}]^\top$, we obtain the formula \begin{align} \c_2 = & \frac{1}{2} \mathbf{\Xi}^{-1} \Big [ \Big (2 \text{vec}(\mathbf{T}_{3}^\top \mathbf{W}_2 \mathbf{T}_1) + {\rm{vec}}(\mathbf{T}_2^\top \mathbf{W}_2 \mathbf{T}_2) \nonumber \\ & + \mathcal{T}_{3,4}^\top \mathbf{w}_3 + (\kronF{\mathbf{T}_1}{4})^\top \mathbf{w}_4 \Big )_{\mathcal{I}_2} - \c_1^2 \Big ] \end{align} for the indices $\mathcal{I}_2= \{ j \ | \ j=(i-1)(n^3 + n^2 +n) + i, \ i=1,\ldots, n\}$, which corresponds to the location of the monomials in $\kronF{\mathbf{z}}{4}$ and where $\c_1^2$ denotes the componentwise square of $\c_1$. The case $k=5$ yields \begin{align} \sum_{i=1}^n & \left (2 c_i^{(1)} c_i^{(2)} + 2\xi_i(0)c_i^{(3)} \right ) z_i^5 \nonumber \\ = & \Big ( 2\text{vec} (\mathbf{T}_{4}^\top \mathbf{W}_2 \mathbf{T}_1)^\top + 2 \text{vec} \left (\mathbf{T}_{2}^\top \mathbf{W}_2^\top \mathbf{T}_{3}\right )^\top \nonumber \\ & + \sum_{i=3}^5 \mathbf{w}_i^\top \mathcal{T}_{i,k} \Big ) \kronF{\mathbf{z}}{k}, \end{align} leading to the explicit expression for $\c_3$ as \begin{align} \c_3 = & \frac{1}{2} \mathbf{\Xi}^{-1} \Big [\Big (2\text{vec} (\mathbf{T}_{4}^\top \mathbf{W}_2 \mathbf{T}_1) \nonumber \\ & + 2 \text{vec} \Big ( \mathbf{T}_{3}^\top \mathbf{W}_2^\top \mathbf{T}_{2} \Big ) \nonumber \\ & + \sum_{i=3}^5 \mathcal{T}_{i,k}^\top \mathbf{w}_i \Big )_{\mathcal{I}_3} -2\c_1\odot\c_2 \Big ] \end{align} for the indices $\mathcal{I}_3 = \{ j \ | \ j=(i-1)(n^4+ n^3 + n^2+n) +i, \ i=1, \ldots, n \}$. Continuing in this fashion yields the recursion formula~\eqref{eq:generalck} for $\c_k$ for general $k$ after the index change $k-2 \to k$. \end{proof} \subsubsection{Complete algorithm and implementation} A complete algorithm for the tensor-based computation of the nonlinear input-normal/output-diagonal transformation $\Phi(\mathbf{z})$ is given in Algorithm~\ref{algo:inputnormalTrafo} and the associated singular value functions $\xi_i(z_i)$ in Algorithm~\ref{algo:inputnormalSvals}. \begin{algorithm}[htb] \caption{Computation of polynomial coefficients $\{ \mathbf{T}_i \}_{i=1}^k$ in approximations to $\Phi(\mathbf{z})$ from \eqref{eq:trafo}.} \label{algo:inputnormalTrafo} \begin{algorithmic}[1] \Require Coefficients $\{\v_i\}_{i=2}^d$ and $\{\mathbf{w}_i\}_{i=2}^d$ from \eqref{eq:pastenerexp} and \eqref{eq:wi_coeffs}. \Ensure Coefficients $\{\mathbf{T}_i\}_{i=1}^{k}$ of the transformation and $\mathbf{\Xi} = \diag(\xi_1(0), \ldots, \xi_n(0))$ % \State Compute Cholesky factors $\mathbf{V}_2 = \mathbf{R} \mathbf{R}^\top$ and $\mathbf{W}_2 = \L \L^\top$ % \State Compute the singular value decomposition $\L^\top \mathbf{R}^{-\top} = \mathcal{U} \mathbf{\Xi} \mathcal{V}^\top$ and set \begin{equation*} \mathbf{T}_1 = \mathbf{R}^{-\top} \mathcal{V} \end{equation*} % \State Compute the higher-degree polynomial coefficients: % {\footnotesize{ \begin{align*} \mathbf{T}_2 & = -\frac{1}{2} \mathbf{T}_1 \ {\rm{unvec}}( [\kronF{\mathbf{T}_1}{3}]^\top \v_3)^\top\\ % \mathbf{T}_3 &= -\frac{1}{2} \mathbf{T}_1 \ {\rm{unvec}}\left ( {\rm{vec}}(\mathbf{T}_{2}^\top \mathbf{V}_2 \mathbf{T}_{2} ) + \mathcal{T}_{3,4}^\top \v_3 + [\kronF{\mathbf{T}_1}{4}]^\top \v_4 \right )^\top\\ \mathbf{T}_{k} &= -\frac{1}{2} \mathbf{T}_1 {\rm{unvec}} \left ( \sum_{\substack{i,j>1\\ i+j=k+1}} {\rm{vec}} \left ( \mathbf{T}_{j}^\top \mathbf{V}_2 \mathbf{T}_{i} \right ) + \sum_{i=3}^{k+1} \mathcal{T}_{i,k+1}^\top \v_i \right )^\top \end{align*} }} \State Symmetrize the coefficients $\mathbf{T}_{k}$ at each step (see Remark~\ref{remark:kroneckerPoly}). \end{algorithmic} \end{algorithm} \begin{algorithm}[htb] \caption{Computation of the input-normal singular value functions $\xi_i(z_i)$ from \eqref{eq:sval_expansion}.} \label{algo:inputnormalSvals} \begin{algorithmic}[1] \Require Coefficients $\{\v_i\}_{i=2}^d$ and $\{\mathbf{w}_i\}_{i=2}^d$ from \eqref{eq:pastenerexp} and \eqref{eq:wi_coeffs}, $\{\mathbf{T}_i\}_{i=1}^k$ and $\mathbf{\Xi}$ from Algorithm~\ref{algo:inputnormalTrafo}. \Ensure Coefficients of singular value functions $\{ \c_i\}_{i=1}^\ell$. % \State Compute coefficients for the linear terms \begin{equation*} \c_1 = \mathbf{\Xi}^{-1} \left ({\normalfont \text{vec}} (\mathbf{T}_{2}^\top \mathbf{W}_2 \mathbf{T}_1) + \frac{1}{2} (\kronF{\mathbf{T}_1}{3})^\top \mathbf{w}_3 \right)_{\mathcal{I}_1} \end{equation*} for the indices ${\mathcal{I}_1}=\{ j \ | \ j=(i-1)(n^2+n) +i, \ i=1, \ldots, n\}$. % \State For $m=1,2,\ldots, \ell$, compute the coefficients \begin{align*} \c_{m} &= \frac{1}{2} \mathbf{\Xi}^{-1} \left [ \left (\sum_{\substack{i,j\geq 1\\ i+j=m+2}} {\normalfont \text{vec}} \left ( \mathbf{T}_{j}^\top \mathbf{W}_2^\top \mathbf{T}_{i} \right ) \right. \right. \nonumber \\ & + \left. \left. \sum_{i=3}^{m+2} \mathcal{T}_{i,m+2}^\top \mathbf{w}_i \right)_{\mathcal{I}_{m}} - \sum_{i+j=m} \c_i\odot\c_j \right ] \end{align*} for the index set $\mathcal{I}_{m}=\{j \ | \ j=(i-1)\sum_{l=1}^{m+1} n^l+i, \ i=1,\ldots, n \}.$ \end{algorithmic} \end{algorithm} \begin{remark} In the linear case the energy functions are quadratic, e.g., $\mathcal{E}_\gamma^-(\mathbf{x}) = \frac{1}{2}\v_2^\top\kronF{\mathbf{z}}{2}$, and hence $\v_i=\mathbf{0}$ for $i\geq3$. We see from Algorithm~\ref{algo:inputnormalTrafo} that $\mathbf{T}_i = \mathbf{0}$ for $i\geq 2$. Thus, we recover the usual linear state transformation $\Phi(\mathbf{z}) = \mathbf{T}_1\mathbf{z}$. Moreover, we know that the singular value functions are constant, and we see from Algorithm~\ref{algo:inputnormalSvals} that indeed $\c_i=\mathbf{0}$ for $i\geq 1$. In sum, for the linear case, the energy functions are quadratic, the transformation linear, and the singular value functions constant. However, this cascade of degrees does not hold for the general nonlinear case. Assume the energy function is exactly cubic, i.e., $\mathcal{E}_\gamma^-(\mathbf{x}) =\frac{1}{2}(\v_2^\top \kronF{\mathbf{z}}{2} + \v_3^\top \kronF{\mathbf{z}}{3})$. In Algorithm~\ref{algo:inputnormalTrafo} we are still able to compute $\mathbf{T}_k, k\geq3$ as $\mathbf{T}_3\neq \mathbf{0}$ and consequently the first sum on the right-hand-side of the $\mathbf{T}_k$ computation is also nonzero. We similarly see that the $\c_i$ coefficients in Algorithm~\ref{algo:inputnormalSvals} can be nonzero. Thus the degree of the energy function has, in general, no direct impact on the degree of the transformation and singular value functions. \end{remark} \subsubsection{Demonstration} We demonstrate the effectiveness of using higher degree transformations to bring energy functions into input-normal/output-diagonal form. Using the example found in \cite[Sec. IV.B]{KGB_NonlinearBT_Part1} (modified from \cite{kawano2016model}), we consider \begin{equation} \label{eq:quadratic} \dot{\mathbf{x}} = \mathbf{A} \mathbf{x} + \mathbf{N} (\mathbf{x} \otimes \mathbf{x}) + \mathbf{B} u , \qquad y = \mathbf{C}\mathbf{x} \end{equation} where \begin{align} \label{eq:example1} \begin{split} \mathbf{A}\mathbf{x} & = \begin{bmatrix} -x_1 + x_2 \\ -x_2 \end{bmatrix}, \quad \mathbf{N}(\mathbf{x}\otimes \mathbf{x}) = \begin{bmatrix} -x_2^2 \\ 0\end{bmatrix}, \\ \mathbf{B} & = \begin{bmatrix} 1 \\ 1 \end{bmatrix}, \quad \mathbf{C} = [1 \ 1]. \end{split} \end{align} A plot of a degree 8 approximation to the past energy function, ${\cal E}_\gamma^-(\mathbf{x})$ with $\eta=0.1$ (or $\gamma=\sqrt{2}$), is provided in Fig.~\ref{fig:pastEnergyOrig}. It is clear that this function is not quadratic. To bring it into input-normal form (in which the past energy function is quadratic, see~\eqref{eq:balRealCont}), we qualitatively compare using a linear transformation $\mathbf{x}=\mathbf{T}_1\mathbf{z}$ (Fig.~\ref{fig:pastEnergyLinearTrans}) and a quadratic transformation $\mathbf{x}=\mathbf{T}_1\mathbf{z}+\mathbf{T}_2\kronF{\mathbf{z}}{2}$ (Fig.~\ref{fig:pastEnergyQuadraticTrans}). While the linear state transformation does not adequately transform the energy into quadratic form, we observe a better local approximation to \eqref{eq:balRealCont} using the quadratic state transformation. The quality of this transformation extends over the region $(-0.2,0.2)\times (-0.2,0.2)$ in the $z$-coordinates. To quantitatively assess the ability of polynomial transformations to place the past energy function into input-normal form, i.e., to make it quadratic in the state, we tabulate the maximum error between the transformed energy function and the desired form \eqref{eq:balRealCont} over regions of different sizes in Table~\ref{tab:TransformedPastEnergy}. As expected, higher degree transformations provide a better solution to the balancing problem in regions close to the origin. We also observe the benefits of using higher degree transformations as we move closer to the origin. These transformations are developed as local approximations, yet we see improvements over the linear transformation in a larger region. Furthermore, the accuracy away from the origin can be achieved with a quadratic or cubic transformation in this example. As we move closer to the origin, the superiority of the higher degree transformations arises. \begin{figure} \centering \includegraphics[width=0.475\textwidth]{pastEnergyOrig.pdf} \caption{\label{fig:pastEnergyOrig}Past energy function $\mathcal{E}_\gamma^-$ for the model \eqref{eq:quadratic}--\eqref{eq:example1} in the original coordinates.} \end{figure} \begin{figure} \centering \includegraphics[width=0.475\textwidth]{pastEnergyDeg1Transform.pdf} \caption{\label{fig:pastEnergyLinearTrans}Past energy function $\mathcal{E}_\gamma^-$ for the model \eqref{eq:quadratic}--\eqref{eq:example1} using a linear state transformation, $\mathbf{x} =\mathbf{T}_1\mathbf{z}$.} \end{figure} \begin{figure} \centering \includegraphics[width=0.475\textwidth]{pastEnergyDeg2Transform.pdf} \caption{\label{fig:pastEnergyQuadraticTrans}Past energy function $\mathcal{E}_\gamma^-$ for the model \eqref{eq:quadratic}--\eqref{eq:example1} using a quadratic state transformation, $\mathbf{x}=\mathbf{T}_1\mathbf{z} + \mathbf{T}_2(\mathbf{z}\otimes\mathbf{z})$.} \end{figure} \begin{table} \centering \caption{The effect of varying degree transformations on maximum error in the transformed past energy function $\mathcal{E}_\gamma^-$ over the domain $(-a,a)^2$.} \label{tab:TransformedPastEnergy} \begin{tabular}{c|ccc} degree & $a=0.2$ & $a=0.05$ & $a=0.01$ \\ \hline 1 & 4.0566e-02 & 1.5498e-04 & 1.0886e-06 \\ 2 & 1.8411e-02 & 7.6587e-06 & 9.2309e-09 \\ 3 & 1.6217e-02 & 1.7734e-06 & 4.2417e-10 \\ 4 & 1.8339e-02 & 4.2031e-07 & 1.9737e-11 \\ 5 & 1.6364e-02 & 1.0820e-07 & 1.0743e-12 \\ 6 & 1.8547e-02 & 2.3594e-08 & 6.2827e-14 \\ 7 & 1.5997e-02 & 1.7912e-08 & 4.7472e-15 \\ 8 & 1.9368e-02 & 1.1080e-08 & 1.0545e-15 \end{tabular} \end{table} \subsection{Input-output balancing transformation} \label{sec:inputoutput} The transformation in Section~\ref{sec:inputnormal} brings the system into the input-normal/output-diagonal form, see Theorem~\ref{thm:inputnormal}. The next theorem suggests a transformation that brings the system into the widely-used input-output balanced form, where the singular values appear in both the controllability and observability energy functions. \begin{theorem} \cite[Thm. 9]{fujimoto2010balanced} \label{thm:fullybalanced} Suppose that the Jacobian linearization of the nonlinear system is controllable, observable, and asymptotically stable. Then there is a neighborhood $\mathcal{W}$ of the origin and a smooth coordinate transformation $\mathbf{x} = \bar{\Phi}(\bar{\mathbf{z}})$ on $\mathcal{W}$ converting the controllability and observability energy functions into the form \begin{align} \label{eq:energyfct_fullybalanced} \mathcal{E}_c(\bar{\Phi}(\bar{\mathbf{z}})) & = \frac{1}{2} \sum_{i=1}^n \frac{\bar{z}_i^2}{{\sigma}_i(\bar{z}_i)}, \\ \mathcal{E}_o(\bar{\Phi}(\bar{\mathbf{z}})) & = \frac{1}{2} \sum_{i=1}^n {\sigma}_i(\bar{z}_i) \bar{z}_i^2. \end{align} Moreover, if $\mathcal{W} = \mathbb{R}^n$, then the Hankel norm of the nonlinear system is given by \begin{equation} \Vert \Sigma \Vert_H := \sup_{\u \in L_2(\mathbb{R}^+), \u\neq \mathbf{0}} \frac{\Vert \mathcal{H}(\u)\Vert}{\Vert \u \Vert} = \sup_{\bar{z}_1} {\sigma}_1(\bar{z}_1), \end{equation} where $\mathcal{H}$ is the Hankel operator for the nonlinear system. \end{theorem} \vspace{0.2cm} Such a variable transformation also exits under more technical assumptions for closed-loop system, see \cite[Thm 5.13]{scherpen1996hinfty_balancing}, where the past and future energy functions $\mathcal{E}_\gamma^-$ and $\mathcal{E}_\gamma^+$ are transformed into input-output form, and where the underlying system is potentially unstable. Note that since each singular value function in \eqref{eq:energyfct_fullybalanced} is associated with a single state component $z_i$, they can be used to decide the truncation of the states, see Section~\ref{sec:ROMs}. To obtain the transformation $\bar{\Phi}(\bar{\mathbf{z}})$, first consider the past energy function in input-normal form, i.e., $\mathcal{E}_\gamma^-(\Phi(\mathbf{z})) = \frac{1}{2} \sum_{i=1}^n z_i^2$ from \eqref{eq:balRealCont}. We now need to \emph{scale} the individual states to obtain $\mathcal{E}_\gamma^-(\bar{\Phi}(\bar{\mathbf{z}})) = \frac{1}{2} \sum_{i=1}^n \frac{\bar{z}_i^2}{{\sigma}_i(\bar{z}_i)}$. To do this, consider the nonlinear transformation \begin{equation} \label{eq:fulltrafo} \bar{z}_i = z_i \sqrt{\xi_i(z_i)} = \bar{\Phi}_i^{-1}(z_i) \quad \Rightarrow \quad \bar{\Phi}_i(\bar{z}_i) = z_i . \end{equation} We insert this transformation into the energy function in \eqref{eq:balRealCont} and obtain \begin{align} \mathcal{E}_\gamma^-(\bar{\Phi}(\bar{\mathbf{z}})) & = \frac{1}{2} \sum_{i=1}^n \frac{\bar{z}_i^2}{\xi_i(z_i)} \nonumber \\ &= \frac{1}{2} \sum_{i=1}^n \frac{\bar{z}_i^2}{\xi_i(\bar{\Phi}_i(\bar{z}_i))} = \frac{1}{2} \sum_{i=1}^n \frac{\bar{z}_i^2}{\sigma_i(\bar{z}_i)}, \end{align} where the new input-output singular value functions are defined (see \cite[Thm 11]{fujimoto2010balanced}) as \begin{equation} \label{eq:fullybalSVs} \sigma_i(\bar{z}_i):= \xi_i(\bar{\Phi}_i(\bar{z}_i)) = \xi_i(z_i). \end{equation} This implies that the singular value functions of the input-normal/output-diagonal and the input-output balancing transformations are identical. To clarify this point, let us recall the linear case. For an LTI system, let $\mathbf{Y}_\infty$ and $\mathbf{X}_\infty$ be the solutions to the the $\mathcal{H}_\infty$ AREs \eqref{eq:HinftyRiccati1} and \eqref{eq:HinftyRiccati2}, respectively. Then, the input normal form would imply that $\mathbf{Y}_\infty = \mathbf{I}$ and $\mathbf{X}_\infty = \diag(\xi_1(0)^2,\ldots,\xi_n(0)^2)$. However, since the $\mathcal{H}_\infty$-characteristic values $\xi_i(0)$, which are the Hankel singular values in the limit $\gamma\rightarrow 1$ in \eqref{eq:HinftyenergyFunctions1}--\eqref{eq:HinftyenergyFunctions2}, are invariant under state-space transformation, in the fully balanced coordinates (after proper scaling) one would have $\mathbf{Y}_\infty = \mathbf{X}_\infty = \diag(\xi_1(0),\ldots,\xi_n(0))$. Next, we consider how the nonlinear state transformation~\eqref{eq:fulltrafo} affects the future energy function of the input-normal/output-diagonal form, $\mathcal{E}_\gamma^+(\Phi(\mathbf{z})) = \frac{1}{2} \sum_{i=1}^n z_i^2 \xi_i^2(z_i)$. Applying the nonlinear transformation from \eqref{eq:fulltrafo}, it follows that the future energy function is automatically transformed into the input-output balanced form as in Theorem~\ref{thm:fullybalanced}: \begin{align} \mathcal{E}_\gamma^+(\bar{\Phi}(\bar{\mathbf{z}})) & = \frac{1}{2} \sum_{i=1}^n \bar{z}_i^2 \xi_i(z_i) = \frac{1}{2} \sum_{i=1}^n \bar{z}_i^2 \xi_i(\bar{\Phi}(\bar{z}_i)) \nonumber \\ & = \frac{1}{2} \sum_{i=1}^n \bar{z}_i^2 \sigma_i(\bar{z}_i), \end{align} with the the singular value functions from \eqref{eq:fullybalSVs}. \begin{remark} The connection to balanced truncation for LTI systems can be further appreciated by writing the energy functions in~\eqref{eq:energyfct_fullybalanced} in the form \begin{align} \mathcal{E}_\gamma^-(\bar{\Phi}(\bar{\mathbf{z}})) & = \frac{1}{2}\bar{\mathbf{z}}^\top \mathbf{\Sigma}(\bar{\mathbf{z}})^{-1} \bar{\mathbf{z}}, \\ \quad \mathcal{E}_\gamma^+(\bar{\Phi}(\bar{\mathbf{z}})) & = \frac{1}{2} \bar{\mathbf{z}}^\top \mathbf{\Sigma}(\bar{\mathbf{z}}) \bar{\mathbf{z}} \end{align} where $\mathbf{\Sigma}(\bar{\mathbf{z}})= {\rm{diag}}({\sigma}_1(\bar{z}_1), \ldots, {\sigma}_n(\bar{z}_n))$. The interpretation of this form is to consider the `Gramian' in the balanced coordinates$, \mathbf{\Sigma}(\bar{\mathbf{z}})$, as state dependent, as opposed to it being constant in the LTI case. \end{remark} \subsection{Balanced high-dimensional model} \label{sec:balancedFOM} The nonlinear transformation from Theorem~\ref{thm:fullybalanced} and \eqref{eq:fulltrafo} that brings the dynamical system~\eqref{eq:FOMNL1}--\eqref{eq:FOMNL2} into the input-output balanced coordinate system can be summarized as \begin{equation} \label{eq:scaledStates} \begin{cases} \mathbf{x} & = \bar{\Phi}(\bar{\mathbf{z}}) = \mathbf{T}_1 \mathbf{z} + \mathbf{T}_{2} \kronF{\mathbf{z}}{2} + \cdots + \mathbf{T}_{k} \kronF{\mathbf{z}}{k} \\ z_i & = \bar{z}_i /\sqrt{\sigma_i(\bar{z}_i)} . \end{cases} \end{equation} Note that the transformation matrices $\mathbf{T}_i$ did not change, as the input-normal/output-diagonal form is already diagonalized, but the scaling has. In other words, using \eqref{eq:fullybalSVs} each new state is now scaled by $\sqrt{\xi_i(z_i)}$ to get the fully balanced form from Theorem~\ref{thm:fullybalanced}. In the LTI case, $\mathbf{x}= \mathbf{T}_1\mathbf{z}$ from \eqref{eq:trafo} yields the input-normal/output-diagonal and by an additional scaling of the state, $\bar{z}_i/\sqrt{\xi_i(0)}=z_i$ we obtain the transformation $\mathbf{x}= \mathbf{T}_1{\mathbf{z}}= \mathbf{T}_1\mathbf{\Sigma}^{-1/2}\bar{\mathbf{z}}$ which is the input-output balanced form in \eqref{eq:scaledStates}. The dynamical system when transformed with the input-output balancing transformation $\mathbf{x} = \bar{\Phi}(\bar{\mathbf{z}})$ is \begin{equation} \label{eq:balFOM} \bar{\mathbf{J}}(\bar{\mathbf{z}}) \dot{\bar{\mathbf{z}}} = \mathbf{f} (\bar{\Phi}(\bar{\mathbf{z}})) + \mathbf{g}(\bar{\Phi}(\bar{\mathbf{z}})) \u, \end{equation} where the Jacobian $\bar{\mathbf{J}}(\bar{\mathbf{z}})\in \mathbb{R}^{n\times n}$ of the state-space transformation is given by \begin{align} \label{eq:Jacobian} \bar{\mathbf{J}}(\bar{\mathbf{z}}) := & \frac{\text{d}{\bar{\Phi}(\bar{\mathbf{z}})}}{\text{d}\bar{\mathbf{z}}} \\ = & \mathbf{T}_1 + 2\mathbf{T}_2(\bar{\mathbf{z}}\otimes \mathbf{I}) + 3\mathbf{T}_3 (\bar{\mathbf{z}}\otimes \bar{\mathbf{z}}\otimes \mathbf{I}) + \ldots, \nonumber \end{align} where we used the fact that since we compute $\mathbf{T}_k$ with symmetric coefficients, it follows that, e.g., $\mathbf{T}_2(\bar{\mathbf{z}}\otimes\mathbf{I}) = \mathbf{T}_2(\mathbf{I}\otimes\bar{\mathbf{z}})$. See Definition~\ref{def:sym} for more details on symmetric coefficients. The Jacobian can be computed explicitly without numerical approximation, as it is the derivative of a polynomial transformation. Remarkably, the Jacobian $\frac{\text{d}{\Phi(\mathbf{z}})}{\text{d}\mathbf{z}}$ of the input-normal/output-diagonal transformation \eqref{eq:trafo} and the Jacobian $\frac{\text{d}{\bar{\Phi}(\bar{\mathbf{z}})}}{\text{d}\bar{\mathbf{z}}}$ of the input-output balancing transformation \eqref{eq:scaledStates} have the same coefficient matrices $\mathbf{T}_i$, which significantly simplifies the ROM simulation. In the next section we revisit the standard balancing transformation that typically results in conditioning problems. We then introduce a novel approximation to simultaneously balance-and-reduce nonlinear systems in a well-conditioned and computationally efficient way. \section{Balanced truncation model reduction via nonlinear transformations} \label{sec:ROMs} In this section, we reduce the dimensionality of the fully balanced model \eqref{eq:balFOM}. To determine the reduced dimension $r$ of the ROM, we look for a significant gap in the $\mathcal{H}_\infty$ singular value functions, i.e., we look for the reduced dimension $r$ such that \begin{equation} \max_{\bar{z}_r} \sigma_r(\bar{z}_r) \gg \max_{\bar{z}_{r+1}} \sigma_{r+1}(\bar{z}_{r+1}) \end{equation} (at a minimum we require that `$>$' holds) in a neighborhood of the origin. This indicates that the state components $\bar{z}_1, \bar{z}_2, \ldots, \bar{z}_r$ are more important in terms of the past and future energy functions $\mathcal{E}_\gamma^-$ and $\mathcal{E}_\gamma^+$ than the states $\bar{z}_{r+1}, \bar{z}_{r+2}, \ldots, \bar{z}_n$. We therefore set $\bar{z}_{r+1} = \bar{z}_{r+2} = \ldots = \bar{z}_n = 0$ in the balanced coordinates and define the reduced state vector as \begin{equation} \label{eq:reducedStates} \bar{\mathbf{z}}_r = \mathbf{\Psi}_r^\top \ \bar{\mathbf{z}} = [\bar{z}_1, \bar{z}_2, \ldots \bar{z}_r]^\top, \quad \mathbf{\Psi}_r = \begin{bsmallmatrix} \mathbf{I}_r & \mathbf{0} \end{bsmallmatrix}^\top \in \mathbb{R}^{n\times r}. \end{equation} The next Section~\ref{sec:balthenreduce} presents the originally-proposed balanced ROM from \cite{scherpen1993balancing,scherpen1996hinfty_balancing}. Section~\ref{sec:simultaneiousBalancingROM} proposes a novel and numerically more efficient and better conditioned approximate strategy to compute the nonlinear ROMs corresponding to this truncation strategy. Section~\ref{sec:NLmanifolds} suggests a different perspective of the nonlinear ROM, namely the approximation on a nonlinear balanced manifold. \subsection{Balance-then-reduce approach} \label{sec:balthenreduce} The balance-\textit{then}-reduce strategy suggested in~\cite{scherpen1993balancing,scherpen1996hinfty_balancing} first computes the full balancing transformation, and then truncates the resulting fully balanced system. Applying this to equation~\eqref{eq:balFOM} yields \begin{align} \dot{\bar{\mathbf{z}}}_r = & \underbrace{\mathbf{\Psi}_r^\top [\bar{\mathbf{J}}([\bar{\mathbf{z}}_r,\mathbf{0}])]^{-1} \mathbf{f} (\bar{\Phi}([\bar{\mathbf{z}}_r,\mathbf{0}]))}_{=:\mathbf{f}_r(\bar{\mathbf{z}}_r)} \nonumber \\ & + \underbrace{\mathbf{\Psi}_r^\top [\bar{\mathbf{J}}([\bar{\mathbf{z}}_r,\mathbf{0}])]^{-1} \mathbf{g}(\bar{\Phi}([\bar{\mathbf{z}}_r,\mathbf{0}]))}_{=:\mathbf{g}_r(\bar{\mathbf{z}}_r)} \u, \label{eq:balROM1} \\ \mathbf{y}_r = & \underbrace{\mathbf{h} ( \bar{\Phi}([\bar{\mathbf{z}}_r, \mathbf{0}]))}_{=:\mathbf{h}_r(\bar{\mathbf{z}}_r)}. \label{eq:balROM2} \end{align} The high-dimensional state is reconstructed as $\mathbf{x} \approx \bar{\Phi}([\bar{\mathbf{z}}_r, \mathbf{0}])$. A goal of balanced truncation is to obtain ROMs that are balanced in the reduced coordinates and that retain properties of the FOM, such as stability. The following theorems show that obtaining such results depends on which energy functions are used for balancing. First, we consider the case of balancing the open-loop energy functions from~\eqref{eq:limitto1}. \begin{theorem} \cite[Thm. 10]{fujimoto2010balanced} \label{thm:prop1} Consider the nonlinear dynamical system~\eqref{eq:FOMNL1}--\eqref{eq:FOMNL2}. Suppose that \begin{enumerate} \item the open-loop controllability and observability energy functions $\mathcal{E}_c$ and $\mathcal{E}_o$ exist, \item the matrices $\left [\frac{\partial^2 \mathcal{E}_c(\mathbf{x})}{\partial x_i \partial x_j}(\mathbf{0})\right ]_{i,j =1, \ldots n}$ and $\left [\frac{\partial^2 \mathcal{E}_o(\mathbf{x})}{\partial x_i \partial x_j}(\mathbf{0})\right ]_{i,j =1, \ldots n}$ are positive definite, \item the eigenvalues of $\left [\frac{\partial^2 \mathcal{E}_c(\mathbf{x})}{\partial x_i \partial x_j}(\mathbf{0})\right ]^{-1} \left[\frac{\partial^2 \mathcal{E}_o(\mathbf{x})}{\partial x_i \partial x_j}(\mathbf{0})\right ]$ are distinct. \end{enumerate} Then, with the input-output balancing transformation $\bar{\Phi}(\bar{\mathbf{z}})$, the controllability function $\mathcal{E}_{c,r}$ and observability energy function $\mathcal{E}_{o,r}$ of the balanced ROM~\eqref{eq:balROM1}--\eqref{eq:balROM2} satisfy \begin{align} \mathcal{E}_{c,r}(\bar{\mathbf{z}}_r) = \mathcal{E}_c([\bar{\mathbf{z}}_r,\mathbf{0}]), \quad \mathcal{E}_{o,r}(\bar{\mathbf{z}}_r) = \mathcal{E}_o([\bar{\mathbf{z}}_r,\mathbf{0}]). \end{align} Moreover, the singular value functions $\sigma_{i,r}(\bar{z}_i)$ of the ROM similarly satisfy \begin{align} \sigma_{i,r}(\bar{z}_i) = \sigma_i(\bar{z}_i), \end{align} and the energy functions of the ROM are balanced in the sense of Theorem~\ref{thm:fullybalanced}. \end{theorem} \begin{remark} From Theorem~\ref{thm:prop1} we see that under suitable assumptions, the open-loop energy functions are preserved at the ROM level. This implies that the ROM inherits the local asymptotic stability of the FOM~\cite[Thm 5.3]{scherpen1993balancing}. In some special cases global asymptotic stability can be guaranteed, see~\cite[Thm 5.4]{scherpen1993balancing}. pp\end{remark} The next theorem addresses the case when balancing is performed with the closed-loop $\mathcal{H}_\infty$ (past and future) energy functions~\eqref{eq:HinftyenergyFunctions1}--\eqref{eq:HinftyenergyFunctions3}. In this scenario, an extra condition is needed so that the ROMs remain balanced in the reduced coordinates as well. \begin{theorem} \cite[Thm 6.1.]{scherpen1996hinfty_balancing} Let $\check{\mathbf{z}} = [\bar{z}_{r+1}, \ldots, \bar{z}_{n}]$ be the vector of state components that are truncated from the FOM. Correspondingly, let the input-output balanced system \eqref{eq:balFOM} be partitioned as $[\dot{ \bar{\mathbf{z}}}_r; \dot{\check{\mathbf{z}}}]^\top = [\mathbf{f}_1(\bar\mathbf{z}); \mathbf{f}_2(\bar\mathbf{z})]^\top + [\mathbf{g}_1(\bar\mathbf{z}); \mathbf{g}_2(\bar\mathbf{z})]^\top \u$. % Suppose that the closed-loop energy functions $\mathcal{E}_\gamma^-$ and $\mathcal{E}_\gamma^+$ from ~\eqref{eq:HinftyenergyFunctions1}--\eqref{eq:HinftyenergyFunctions3} exist. % With the input-output balancing transformation $\bar{\Phi}(\bar{\mathbf{z}})$, the past energy function of the balanced ROM~\eqref{eq:balROM1}--\eqref{eq:balROM2} satisfies \begin{align} \mathcal{E}_\gamma^-(\bar{\mathbf{z}}_r) = \mathcal{E}_\gamma^-([\bar{\mathbf{z}}_r,\mathbf{0}]). \end{align} Assume further that \begin{align} \frac{\partial \mathcal{E}_\gamma^+}{\partial \check{\mathbf{z}}}(\bar{\mathbf{z}}_r,\mathbf{0})\mathbf{f}_2(\bar{\mathbf{z}}_r,\mathbf{0})=0, \quad \frac{\partial \mathcal{E}_\gamma^+}{\partial \check{\mathbf{z}}}(\bar{\mathbf{z}}_r,\mathbf{0})\mathbf{g}_2(\bar{\mathbf{z}}_r,\mathbf{0})=0 \end{align} holds; then the future energy function satisfies \begin{align} \qquad \mathcal{E}_\gamma^+(\bar{\mathbf{z}}_r) = \mathcal{E}_\gamma^+([\bar{\mathbf{z}}_r,\mathbf{0}]). \end{align} \end{theorem} Since the original system is not assumed stable in the $\mathcal{H}_\infty$ framework, an interesting property to study is whether the reduce-\textit{then}-design strategy for the $\mathcal{H}_\infty$ suboptimal control is guaranteed to produce a suboptimal control for the $\mathcal{H}_\infty$-balanced ROM. For conditions when that holds true, we refer to \cite[Thm 6.3]{scherpen1996hinfty_balancing}. The evaluation of the polynomials terms on the right-hand side of the ROM~\eqref{eq:balROM1} can be simplified for the special case $\mathbf{f}(\mathbf{z}) = \mathbf{A}\mathbf{z} + \mathbf{N}(\mathbf{z}\otimes\mathbf{z})$, which yields \begin{align} & \mathbf{f} (\bar{\Phi}([\bar{\mathbf{z}}_r,\mathbf{0}]))= \nonumber \sum_{i=1}^k [ \mathbf{A} \mathbf{T}_i \kronF{\mathbf{I}_{n\times r}}{i}] \kronF{\bar{\mathbf{z}}_r}{i} \nonumber \\ & \qquad + \mathbf{N} \left (\sum_{i=1}^k [\mathbf{T}_i \kronF{\mathbf{I}_{n\times r}}{i}] \kronF{\bar{\mathbf{z}}_r}{i} \otimes \sum_{i=1}^k [\mathbf{T}_i \kronF{\mathbf{I}_{n\times r}}{i}] \kronF{\bar{\mathbf{z}}_r}{i} \right ). \end{align} Nevertheless, simulating the ROM~\eqref{eq:balROM1} is computationally expensive and will likely result in inverting an ill-conditioned matrix, which is in analogy to the linear case. In the next section, we propose a better conditioned and computationally more efficient implementation of the nonlinear ROM. \subsection{Simultaneous balancing and reduction} \label{sec:simultaneiousBalancingROM} The computation of $\mathbf{\Psi}_r^\top [\bar{\mathbf{J}}([\bar{\mathbf{z}}_r,\mathbf{0}])]^{-1}$ in the balanced ROM \eqref{eq:balROM1}--\eqref{eq:balROM2} requires inverting the full Jacobian followed by truncation. This has a computational and a numerical disadvantage. First, this strategy requires a high number of floating point operations to form the full $\mathbf{T}_j \in \mathbb{R}^{n\times n^j}, \ j=2, \ldots, k$ as in Theorem~\ref{thm:polyCoeffsTrafo}. Second, computing $\mathbf{T}_1$ requires inversions that are often ill-conditioned for large-scale systems (the main focus of this work) since it requires inverting all the $\mathcal{H}_\infty$-characteristic values, including the smallest ones. In the linear case, the balance-\textit{then}-reduce strategy is well known to be ill-conditioned due to small Hankel singular values, see, e.g.,~\cite[Sec. 7.3]{antoulas05} and a remedy is to perform simultaneous model reduction and truncation. We suggest a new computational framework for the nonlinear case following these ideas from the linear case. Our goal is to compute the truncated versions of the linear transformations and higher-degree tensors $\{\mathbf{T}_i\}_{i=1}^k$ from Theorem~\ref{thm:polyCoeffsTrafo} directly without computing the full-order quantities. We begin with deriving the form of the nonlinear ROM for the FOM~\eqref{eq:FOMNL1}--\eqref{eq:FOMNL2} when a general polynomial state transformation and simultaneous reduction is applied. In other words, we are approximating the FOM~\eqref{eq:FOMNL1}--\eqref{eq:FOMNL2} on a nonlinear (here: balanced) manifold such that $\mathbf{x} \approx \Phi_r(\bar{\mathbf{z}}_r)$, where the mapping $\Phi_r$ defines a manifold. The following result applies to \textit{any} polynomial state transformation. \begin{proposition} \label{prop:redman} Consider the nonlinear system~\eqref{eq:FOMNL1}--\eqref{eq:FOMNL2}. Let $\mathbf{T}_{k,r} \in \mathbb{R}^{n\times r^k}$ be (truncated) transformation matrices with symmetric coefficients and $\bar{\mathbf{z}}_r\in \mathbb{R}^r$ denote the reduced state. Define the embedding $\Phi_r: \mathbb{R}^r \mapsto \mathbb{R}^n$ via \begin{equation} \mathbf{x} \approx \Phi_r(\bar{\mathbf{z}}_r) := \mathbf{T}_{1,r} \bar{\mathbf{z}}_r + \mathbf{T}_{2,r} \kronF{\bar{\mathbf{z}}_r}{2} + \cdots + \mathbf{T}_{k,r} \kronF{\bar{\mathbf{z}}_r}{k}, \label{eq:NlStateReduction} \end{equation} for which the reduced Jacobian can be computed explicitly via \begin{align} \label{eq:newJr} \mathbf{J}_r(\bar{\mathbf{z}}_r) :=& \frac{{\rm{d}}\Phi_r(\bar{\mathbf{z}}_r)}{{\rm{d}}\bar{\mathbf{z}}_r} \nonumber \\ =& \mathbf{T}_{1,r} + 2\mathbf{T}_{2,r}(\bar{\mathbf{z}}_r\otimes \mathbf{I}) \nonumber \\ & + 3 \mathbf{T}_{3,r} (\bar{\mathbf{z}}_r\otimes \bar{\mathbf{z}}_r\otimes \mathbf{I}) + \cdots \in \mathbb{R}^{n\times r}. \end{align} Thus, the nonlinear ROM for $\bar{\mathbf{z}}_r\in\mathbb{R}^r$ is \begin{align} \dot{\bar{\mathbf{z}}}_r & = \underbrace{\mathbf{J}_r(\bar{\mathbf{z}}_r)^{\dagger} \mathbf{f}(\Phi_r(\bar{\mathbf{z}}_r))}_{=:\mathbf{f}_r(\bar{\mathbf{z}}_r)} + \underbrace{ \mathbf{J}_r(\bar{\mathbf{z}}_r)^{\dagger} \mathbf{g}(\Phi_r(\bar{\mathbf{z}}_r))}_{=:\mathbf{g}_r(\bar{\mathbf{z}}_r)} \u \label{eq:NLROM1} \\ \mathbf{y}_r & = \underbrace{\mathbf{h}(\Phi_r(\bar{\mathbf{z}}_r))}_{=:\mathbf{h}_r(\bar{\mathbf{z}}_r)}. \label{eq:NLROM2} \end{align} \end{proposition} \vspace{0.1cm} where $[\cdot]^\dagger$ denotes the Moore-Penrose pseudoinverse. \begin{proof} Given $\Phi_r(\bar{\mathbf{z}}_r)$ in~\eqref{eq:NlStateReduction} and using the symmetry arguments as in \eqref{eq:Jacobian} (which result from our symmetrized computation of the $\mathbf{T}_{i,r}$), we can directly verify the polynomial form of the Jacobian following \eqref{eq:Jacobian} with $\bar{\mathbf{z}}_r$ instead of $\bar{\mathbf{z}}$, thus obtaining~\eqref{eq:newJr}. With this reduced Jacobian defined, the model~\eqref{eq:balFOM} becomes \begin{align} \mathbf{J}_r(\bar{\mathbf{z}}_r) \dot{\mathbf{z}}_r = \mathbf{f}(\Phi_r(\bar{\mathbf{z}}_r))+ \mathbf{g}(\Phi_r(\bar{\mathbf{z}}_r)) \u \in \mathbb{R}^n. \end{align} We left-multiply the last equation with the pseudo-inverse of the Jacobian to get the ROM~\eqref{eq:NLROM1}--\eqref{eq:NLROM2}. \end{proof} The version of the ROM formulated in Proposition~\ref{prop:redman} resolves the ill-conditioning issue since it no longer requires inverting the full Jacobian. Now, what is needed is a strategy that could compute the coefficient matrices, $\mathbf{T}_{i,r} \in \mathbb{R}^{n\times r^i}$ of the nonlinear embedding $\Phi_r$ without needing to construct full coefficient matrices, $\mathbf{T}_{i}\in \mathbb{R}^{n\times n^i}$. Following Theorem~\ref{thm:polyCoeffsTrafo} and Algorithm~\ref{algo:inputnormalTrafo} and motivated by the linear balanced truncation framework, in the next result we propose a new strategy to compute the matrices $\mathbf{T}_{i,r}$ of the nonlinear balancing transformation~\eqref{eq:NlStateReduction}. Before stating this result, we point out that the ROM computation in~\eqref{eq:NLROM1} still requires evaluating the full $\mathbf{f}(\cdot)$ and $\mathbf{g}(\cdot)$ as nonlinear functions acting on vectors of dimension $n$. We revisit and resolve this issue---known as the lifting bottleneck---in Remark~\ref{rem:deim}. \begin{proposition} \label{prop:TruncatedBT} (\textit{Truncated (approximate) balanced transformation}) Let $\v_i,\mathbf{w}_i$ be the vectors of polynomial coefficients for the energy functions from \eqref{eq:pastenerexp}, \eqref{eq:wi_coeffs}. Let $\mathbf{R}, \L$ be their Cholesky factors, i.e., $\mathbf{V}_2 = \mathbf{R} \mathbf{R}^\top$ and $\mathbf{W}_2 = \L \L^\top$. Let $\L^\top \mathbf{R}^{-\top} = \mathcal{U} \mathbf{\Xi} \mathcal{V}^\top$ be the singular value decomposition and define $$ \mathcal{U}_r = \mathcal{U}(:,1:r),~~\mathbf{\Xi}_r = \mathbf{\Xi}(1:r,1:r),~~\mathcal{V}_r = \mathcal{V}(:,1:r). $$ % {Then, the coefficient matrices of the nonlinear embedding $\Phi_r: \mathbb{R}^r \mapsto \mathbb{R}^n$ in~\eqref{eq:NlStateReduction} are} \begin{align} \mathbf{T}_{1,r} &= \mathbf{R}^{-\top} \mathcal{V}_r \in \mathbb{R}^{n\times r},\\ \mathbf{T}_{1,r}^{\dagger} & = \mathbf{\Xi}_r^{-1} \mathcal{U}_r^\top \L^\top \in \mathbb{R}^{r\times n}, \ \text{(left inverse)}\\ \mathbf{T}_{2,r} & = -\frac{1}{2} \mathbf{T}_{1,r} \ {\normalfont \text{unvec}} \left (\kronF{[\mathbf{T}_{1,r}}{3}]^\top \v_3 \right )^\top \in \mathbb{R}^{n\times r^2}, \end{align} and more generally, for $2\leq k$, {\small \begin{subequations} \begin{align} \mathbf{T}_{k,r} &= -\frac{1}{2} \mathbf{T}_{1,r} {\normalfont \text{unvec}} (\mathbf{M}_{k,r} )^\top \in \mathbb{R}^{n\times r^k},~\mbox{where} \\ \mathbf{M}_{k,r} & = \sum_{\substack{i,j>1\\ i+j=k+1}} {\normalfont \text{vec}} \left ( \mathbf{T}_{j,r}^\top \mathbf{V}_2 \mathbf{T}_{i,r} \right ) + \sum_{i=3}^{k+1} \mathcal{T}_{i,k+1}^\top \v_i. \end{align} \end{subequations} } \end{proposition} We highlight that due to the way we compute $\mathbf{T}_{i,r}$ above, the embedding, and hence Jacobian, is better conditioned and faster to evaluate than in the balance-\textit{then}-reduce strategy in Section~\ref{sec:balthenreduce}. The next theorem shows that the linear part of the transformation diagonalizes the product of the Gramians, as in the linear case. \begin{proposition} {The approximate balancing transformation}~\eqref{eq:NlStateReduction} with $\mathbf{T}_{i,r}$ from Proposition~\ref{prop:TruncatedBT} satisfies \begin{equation} \mathbf{\Xi}_r^2 = {\normalfont \text{diag}} (\xi_1^2(0), \ldots, \xi_r^2(0)) = \mathbf{T}_{1,r}^{\dagger} \mathbf{V}_2^{-1} \mathbf{W}_2 \mathbf{T}_{1,r}. \end{equation} \end{proposition} \begin{proof} Given the definitions of Proposition~\ref{prop:TruncatedBT} we directly compute \begin{align*} & \mathbf{T}_{1,r}^{\dagger} \mathbf{V}_2^{-1} \mathbf{W}_2 \mathbf{T}_{1,r} \\ & = \mathbf{\Xi}_r^{-1} \mathcal{U}_r^\top \L^\top \mathbf{R}^{-\top} \mathbf{R}^{-1} \L \L^\top \mathbf{R}^{-\top} \mathcal{V}_r \\ & = \mathbf{\Xi}_r^{-1} \mathcal{U}_r^\top \mathcal{U}_r \mathbf{\Xi}_r \mathcal{V}_r^\top \mathcal{V}_r \mathbf{\Xi}_r \mathcal{U}_r^\top \mathcal{U}_r \mathbf{\Xi}_r \mathcal{V}_r^\top \mathcal{V}_r \\ & = \mathbf{\Xi}_r^{-1} \mathbf{\Xi}_r^3 = \mathbf{\Xi}_r^2 \end{align*} \end{proof} With a numerically well-conditioned ROM~\eqref{eq:NLROM1}--\eqref{eq:NLROM2} and a computationally efficient way to compute the nonlinear balanced manifold, see Proposition~\ref{prop:TruncatedBT}, we summarize the steps to arrive at a simultaneously balanced-\underline{and}-reduced ROM in Algorithm~\ref{alg:fullBTROM}. \begin{algorithm}[!htb] \caption{Computation of nonlinear input-output $\mathcal{H}_\infty$-balanced ROM.} \label{alg:fullBTROM} \begin{algorithmic}[1] \Require Constant $\gamma>\gamma_0\geq0$, $\gamma \neq 1$; polynomial degrees $d> k>\ell$; reduced model order $r$ % \Ensure Input-output nonlinear $\mathcal{H}_\infty$-balanced ROM~\eqref{eq:NLROM1}--\eqref{eq:NLROM2}. % \State Obtain a polynomial representation (or approximation) of the past and future energy functions $\mathcal{E}_\gamma^-(\mathbf{x})$ and $\mathcal{E}_\gamma^+(\mathbf{x})$, i.e., coefficients $\left \{ \v_i \right \}_{i=2}^d$ and $\left \{ \mathbf{w}_i \right \}_{i=2}^d$ in \eqref{eq:pastenerexp}, \eqref{eq:wi_coeffs} (e.g., through Part~1 of this paper\cite{KGB_NonlinearBT_Part1}) % \State Compute the truncated polynomial coefficient matrices $\left \{ \mathbf{T}_{i,r}\right \}_{i=1}^k$ for $\mathbf{x} \approx \Phi_r(\bar{\mathbf{z}}_r)$ from \eqref{eq:NlStateReduction} following Proposition~\ref{prop:TruncatedBT}. % \State Symmetrize the coefficients $\left \{ \mathbf{T}_{i,r}\right \}_{i=1}^r$ (see Remark~\ref{remark:kroneckerPoly}) % \State Assemble the nonlinear ROM functions $\mathbf{f}_r(\bar{\mathbf{z}}_r), \mathbf{g}_r(\bar{\mathbf{z}}_r), \mathbf{h}_r(\bar{\mathbf{z}}_r)$ as in ~\eqref{eq:NLROM1}--\eqref{eq:NLROM2} with the explicit Jacobian in \eqref{eq:newJr}. \end{algorithmic} \end{algorithm} Algorithm~\ref{alg:fullBTROM} requires a choice of ROM dimension $r$. This can be done by plotting all state-dependent singular value functions from \eqref{eq:expandSval}, whose coefficients are obtained via Algorithm~\ref{algo:inputnormalSvals}, and deciding on an ordering of the functions in magnitude. However, this procedure increases the (offline) cost of the algorithm, as all $\c_i$ and $\mathbf{T}_i$, for $i=1,2,\ldots,n$ are required. To reduce the offline cost, it may be enough in some cases to only consider the constant terms $\xi_i(0)$ in the singular value functions to make a truncation decision based on their decay, as is done in balanced truncation for LTI systems. \begin{remark} \label{rem:deim} Algorithm~\ref{alg:fullBTROM} helps to resolve the computational complexity and numerical ill-conditioning issues of the balance-then-reduce strategy using the simultaneous (approximate) balancing-\underline{and}-reduce strategy. However, as stated earlier, we point out that the ROM computation in~\eqref{eq:NLROM1}-\eqref{eq:NLROM2} still requires evaluating the full $\mathbf{f}(\cdot)$ and $\mathbf{g}(\cdot)$ as nonlinear functions acting on vectors of dimension $n$. This is a common issue in nonlinear model reduction not specific to nonlinear balanced truncation. If the inputs and outputs are linear, then $\mathbf{g}_r(\bar{\mathbf{z}}_r) = \mathbf{J}_r(\bar{\mathbf{z}}_r)^{\dagger}\mathbf{B}$ and $\mathbf{h}_r(\bar{\mathbf{z}}_r)=\mathbf{C} \Phi_r(\bar{\mathbf{z}}_r)$ where all products of $\mathbf{C}$ and $\mathbf{T}_{k,r}$ can be precomputed. However, still the ROM in~\eqref{eq:NLROM1} requires evaluating the full nonlinearity. This could be circumvented by a hyper-reduction procedure, e.g., DEIM~\cite{chaturantabut2010nonlinear} and its variants~\cite{DrmG16,DrmS18}. Only when the, inputs, outputs \textit{and} dynamics are linear, then $\Phi(\bar{\mathbf{z}}_r) = \mathbf{T}_{1,r}\bar{\mathbf{z}}_r$ and $\mathbf{J}_r(\bar{\mathbf{z}}_r) = \mathbf{T}_{1,r}^\dagger$, so the linear ROM becomes \begin{align} \dot{\bar{\mathbf{z}}}_r = \mathbf{T}_{1,r}^\dagger \mathbf{A} \mathbf{T}_{1,r}\bar{\mathbf{z}}_r + \mathbf{T}_{1,r}^\dagger \mathbf{B} \u, \quad \mathbf{y}_r = \mathbf{C} \mathbf{T}_{1,r} \bar{\mathbf{z}}_r, \end{align} where everything can be precomputed and the ROM can be simulated without any reference to the full dimension~$n$. \end{remark} \subsection{Nonlinear balanced manifold ROMs} \label{sec:NLmanifolds} The described nonlinear balanced truncation approach performs model reduction on an $r$-dimensional polynomially-nonlinear manifold with specific structure. Nonlinear balanced truncation first performs a nonlinear balancing transformation $\mathbf{x} = \bar{\Phi}(\mathbf{z})$, which is followed by truncation. Thus, $\mathbf{x} \approx \Phi_r(\bar{\mathbf{z}}_r) := \mathbf{T}_{1,r} \bar{\mathbf{z}}_r + \mathbf{T}_{2,r} \kronF{\bar{\mathbf{z}}_r}{2} + \cdots + \mathbf{T}_{k,r} \kronF{\bar{\mathbf{z}}_r}{k}$ as in \eqref{eq:NlStateReduction}, which defines the nonlinear balancing manifold \begin{equation} \mathcal{M}:= \left \{ \Phi_r(\bar{\mathbf{z}}_r)\ : \ \bar{\mathbf{z}}_r \in \mathbb{R}^r \right \}\subseteq \mathbb{R}^n. \end{equation} Figure~\ref{fig:balancedManifold} illustrates that the system evolves on this balanced nonlinear manifold (the $\bar{z}_i$-coordinates) of the original state space (the $x_i$-coordinates) such that the past and future energy (or controllability/observability energy) of a reduced state can be assessed via the well-known balanced form as outlined in Theorem~\ref{thm:fullybalanced}. This fact then allows for truncation of individual states, as each state has associated energies. In the $\mathcal{H}_\infty$-balancing case, the retained ROM states are easy to filter and easy control. In the open-loop case, the retained states are easy to reach and easy to observe. \begin{figure} \centering \includegraphics[width=0.5\textwidth,trim={0 0.6cm 0.15cm 0},clip]{approxNL_balancedManifold.pdf} \caption{The input-output balanced ROM evolves on a nonlinear manifold, $\mathcal{M}$, such that the controllability/observability (or past/future) energy of a state can be measured in the well-known form that involves the singular value functions $\sigma_i(\bar{z}_i)$.} \label{fig:balancedManifold} \end{figure} Nonlinear manifold ROMs have become popular recently, as they address the challenges that linear subspace ROMs can face due to slow decay of the Kolmogorov $n$-width, see the survey article~\cite{peherstorfer22breakingKolmogorov}. For instance, the authors in \cite{carlberg20autoencoderROM,fresca2021comprehensive} use a fully nonlinear autoencoder approach to define the nonlinear manifold ROM $\mathbf{x} \approx \psi(\bar{\mathbf{z}}_r)$, while the work in~\cite{jain2017quadratic,geelen2022nonlinearManifoldOPINF,barnett2022quadraticManifold} uses quadratic manifolds of the kind $\mathbf{x} \approx \mathbf{V} \bar{\mathbf{z}}_r + \bar{\mathbf{V}}(\bar{\mathbf{z}}_r\otimes \bar{\mathbf{z}}_r)$. While these nonlinear manifold approaches improve the state-approximation error, they do not take into account the system-theoretic (observability/controllability) energies in the reduction, in turn neglecting the full dynamics of the input-to-output map. \section{Numerical Results: Burgers Equation} \label{sec:numerics} We present a proof-of-concept example that tests the effectiveness of the algorithms presented in Sections~\ref{sec:BalModels} and \ref{sec:ROMs}. The finite-dimensional model is generated from finite element discretizations of a PDE. The PDE of Burgers type is chosen for its quadratic nonlinear terms. This test problem has a long history in the study of control for distributed parameter systems, e.g.~\cite{thevenet2009nonlinear}, including the development of effective computational methods, e.g.~\cite{burns1990control}, and reduced-order models, e.g.~\cite{kunisch1999cbe}. Consider the controlled Burgers equation \begin{align} \label{eq:burgers} \omega_t(\xi,t) &= \epsilon \omega_{\xi\xi}(\xi,t) - \frac{1}{2}\left(\omega^2(\xi,t)\right)_\xi + \sum_{j=1}^m b_j^m(\xi) u_j(t),\\ \label{eq:averagingObservation} y_i(t) &= \int_{\chi_{[(i-1)/p,i/p]}}\hspace{-2em}\omega(\xi,t) \text{d} \xi, \qquad i=1,\ldots,p, \end{align} with zero Dirichlet boundary conditions. Control inputs are described using the characteristic function $\chi$ as $b_j^m(\xi) = \chi_{[(j-1)/m,j/m]}(\xi)$ and the outputs are spatial averages of the solution over $p$ equally-spaced subdomains. We discretize the state equation with $n+1$ linear finite elements leading to an $n$-dimensional state vector. The discretized system has the form \begin{align}\label{eq:discreteCI} \widetilde{\bf E}\dot{\boldsymbol \omega} &= \widetilde{\bf A}{\boldsymbol \omega} + \widetilde{\bf N}_2\left( {\boldsymbol \omega}\otimes{\boldsymbol \omega} \right) + \widetilde{\bf B}{\bf u}\\ {\bf y} &= \widetilde{\bf C}{\boldsymbol \omega}, \end{align} where ${\boldsymbol \omega}(t)$ are the coefficients of the finite element approximation to $\omega(x,t)$. To place this in the form~\eqref{eq:FOMNL1}--\eqref{eq:FOMNL2} where the mass matrix is the identity, we introduce the change of variables ${\bf x} = \widetilde{\bf E}^{1/2}{\boldsymbol \omega}$ where $\widetilde{\bf E}^{1/2}$ is a matrix square root of the finite element mass matrix. Then defining $\mathbf{A}=\widetilde{\bf E}^{-1/2}\widetilde{\mathbf{A}}\widetilde{\bf E}^{-1/2}$, $\mathbf{B}=\widetilde{\bf E}^{-1/2}\widetilde{\bf B}$, ${\bf C} = \widetilde{\bf C}\widetilde{\bf E}^{-1/2}$, ${\bf N}_2 = \widetilde{\bf N}_2(\widetilde{\bf E}^{-1/2}\otimes\widetilde{\bf E}^{-1/2})$ leads to a system in the required form. \subsection{Singular value functions} In the first experiment, we use the values $\epsilon=0.05$, $n=16$, $m=4$, $p=4$, and $\gamma=3$, and we compute the quartic approximations to the past and future energy functions as described in Part~1 of this paper, \cite{KGB_NonlinearBT_Part1}, to find the coefficients in \eqref{eq:pastenerexp} and \eqref{eq:wi_coeffs}. Using these coefficients, we compute the cubic transformation tensors $\mathbf{T}_{1}, \mathbf{T}_{2}, \mathbf{T}_{3}$ using Algorithm~\ref{algo:inputnormalTrafo}. Finally, we compute quadratic approximations to the singular value functions as in Algorithm~\ref{algo:inputnormalSvals}. The first eight of these are plotted in Figure~\ref{fig:svf}. For this problem, we observe that the first four singular value functions are significantly larger in magnitude than the remainder. Moreover, the ranks of the singular value functions change across the variable range. We observe interesting behavior in the fifth singular value function, with a quadratic approximation that rapidly goes negative in a small region around zero. Although not plotted here for space, the cases with $p=1$ and $p=2$ outputs are different. In the $p=1$ case, the singular value functions do not cross in the same parameter interval; there is an order of magnitude separation of $\xi_1$, $\xi_2$, and $\xi_3$; there are nearly two orders of magnitude between $\xi_5$ and $\xi_6$. For the case $p=2$, there is a strong separation of the singular value functions near 0, but $\xi_1$ and $\xi_2$ do cross at about $|z|\approx 0.1$. We investigate the quality of ROMs with growing dimension in the next section and correlate the results with the qualitative behavior of the singular value functions. \begin{figure} \centering \includegraphics[width=0.475\textwidth]{singValueFcnsp=4.pdf} \caption{\label{fig:svf}Quadratic approximations to the first eight singular value functions for the Burgers example.} \end{figure} \subsection{Output behavior} We simulate the outputs for the system described above. We present results for different ROM-dimensions $r$ and different degree $k$ nonlinear transformations. We simulate the ROMs from $t=0$ to $t=10$ and report the relative error for each output, $e_i$, defined using \begin{displaymath} e_i = \frac{\left(\int_0^{10} \left| y_i(t)-y_{i,r}(t) \right|^2\ {\rm d}t\right)^{1/2}}{\left(\int_0^{10} \left| y_i(t) \right|^2\ {\rm d}t\right)^{1/2}} , \ i=1,\ldots,p, \end{displaymath} where $y_{i,r}$ is the $i$th output of the ROM of order $r$. For all of our tests, $m>1$ and we use the inputs \begin{displaymath} u_i(t) = \left\{ \begin{array}{cl} 0.002\tan^{-1}(t) + 0.001\sin(t), & i=1 \\ 0, & \mbox{otherwise} \end{array} \right. . \end{displaymath} \begin{table} \caption{\label{tab:relErr}Relative errors ($e_1$) for the $m=4$ and $p=1$ case.} \centering \begin{tabular}{cccc} \hline $r$ & $k=1$ & $k=3$ & $k=5$ \\ \hline 1 & 0.0714831 & 0.0714814 & 0.0713882 \\ 2 & 0.0036861 & 0.0036778 & 0.0031076 \\ 3 & 0.0026888 & 0.0026784 & 0.0026665 \\ 4 & 0.0024333 & 0.0024288 & 0.0024238 \\ 5 & 0.0024095 & 0.0024032 & 0.0023853 \\ \hline \end{tabular} \end{table} In Table~\ref{tab:relErr}, we present the performance of the ROMs for increasing model order and degree of the nonlinear transformation. As expected, we see the general trend of a decreasing error with increasing the reduced dimension and the degree of the transformation. We do not include in Table~\ref{tab:relErr} the results past $r=5$ as the relative error does not improve further using any degree of the transformations as expected from the singular value function behavior in Figure~\ref{fig:svf}. In the next experiment, we consider a problem where the linear portion of the model is more significant $\epsilon=0.1$ and we take two model outputs $p=2$ (with the same number of inputs $m=4$). The results of these experiments are presented in Table~\ref{tab:twoOutputs}. \begin{table} \caption{\label{tab:twoOutputs}Relative errors ($e_1$ and $e_2$) for the $m=4$ and $p=2$ case.} \centering \begin{tabular}{cc|ccc} \hline $r$ & &$k=1$ & $k=3$ & $k=5$ \\ \hline 1 & $e_1$ & 0.361839 & 0.361834 & 0.361626 \\ & $e_2$ & 0.710212 & 0.710226 & 0.710790 \\ \hline 2 & $e_1$ & 0.043155 & 0.043149 & 0.043112 \\ & $e_2$ & 0.111431 & 0.111421 & 0.111301 \\ \hline 3 & $e_1$ & 0.004940 & 0.004941 & 0.004861 \\ & $e_2$ & 0.009017 & 0.009017 & 0.008764 \\ \hline 4 & $e_1$ & 0.003625 & 0.003623 & 0.003628 \\ & $e_2$ & 0.020935 & 0.020940 & 0.020898 \\ \hline 5 & $e_1$ & 0.004086 & 0.004087 & 0.004091 \\ & $e_2$ & 0.018565 & 0.018553 & 0.018534 \\ \hline \end{tabular} \end{table} We again see the same trends as the $\epsilon=0.05$ example with improvements in reduced model dimension and transformation degree. We see the most dramatic improvements with reduced model order with much milder improvements in transformation dimension. The relative error for each output does not monotonically improve with model order (compare $e_1$ for $r=4$ and $r=5$), but overall, the models are generally better ($e_2$ has more a significant improvement from $r=4$ to $r=5$ in this case). \section{Conclusions and future directions} \label{sec:conclusions} We presented a novel and scalable approach for nonlinear balanced truncation of medium to large-scale nonlinear control-affine systems. The approach assumes that system energy functions (e.g., controllability and observability) functions are given in polynomial form. We derive scalable tensor-based formulas for the polynomially-nonlinear state transformation that simultaneously ``diagonalizes'' these relevant energy functions in the new coordinates. Since this nonlinear balancing transformation can be ill-conditioned and expensive to evaluate, inspired by the linear case we developed a computationally efficient \textit{balance-and-reduce} strategy. This resulted in further improved scalability and a better conditioned truncated transformation. We derived closed-form expressions for the resulting ROMs. We highlight that the work in this paper does not make assumptions on the dynamical systems model form, only on the form of the energy functions (polynomial). Hence the work in this paper applies to general nonlinear systems of control-affine form. There are several interesting future research directions to pursue. First, the $\mathcal{H}_\infty$ and HJB balancing methods automatically (as a byproduct) give controllers for nonlinear systems, see Part~1 of this paper~\cite[Sec. 2]{KGB_NonlinearBT_Part1} and \cite{sahyoun2013reduced}, \cite{scherpen1996hinfty_balancing}. We plan to evaluate the performance of these controllers on nonlinear systems. Second, the evaluation of the nonlinear term and the Jacobian evaluation can be further accelerated by considering empirical interpolation techniques. Third, the singular value functions are state-dependent, and cross in state space, necessitating the development of local ROMs. \section{Acknowledgements} We thank Nick Corbin for assisting in the production of Fig.~\ref{fig:balancedManifold} and for valuable comments on drafts of this manuscript.
\section{Appendix} \subsubsection{Group-3:} \hfill \\ {\bf Hypothesis:} Would \emph{Gender} and \emph{Race} affect the sentiment value computed by the SASs when there is no possibility of confounding effect? {\bf Experimental Setup:} The setup is similar to what we constructed for Group-1. However, there is one extra protected attribute in this case. We compared gender distributions and race distributions separately as shown in Table \ref{tab:g3}. In addition to that, we considered a composite case where we combined both race and gender attributes together to form one single attribute called \emph{RG} as shown in Table \ref{tab:g3-comp} . For example, in the composite case, European name and male gender would be considered as a European male and we compute the pairwise t-values for each of these distributions. Table \ref{tab:g3} Shows the t-values obtained from each of the SASs for each emotion word set and the superscripts for the different values indicate the CIs for which the null hypothesis is rejected or accepted as described for Group-1. $R_e$$R_n$: Modulus of the t-value computed for male and NA distributions. $R_e$$R_a$: Modulus of the t-value computed for male and female distributions. $R_a$$R_n$: Modulus of the t-value computed for female and NA distributions. \begin{table} \centering {\tiny \begin{tabular}{|p{4em}|p{2em}|p{3em}|p{3em}|p{3em}|p{3em}|p{3em}|p{3em}|} \hline {\bf SAS} & {\bf E. words} & {\bf $G_m$$G_n$} & {\bf $G_m$$G_f$} & {\bf $G_f$$G_n$} & {\bf $R_e$$R_n$} & {\bf $R_e$$R_a$} & {\bf $R_a$$R_n$} \\ \hline $S_b$ & E1 & 0 & H$^1$ & H$^1$ & 2.64$^1$ & 0 & 2.64$^1$ \\ \hline & E2 & 0 & H$^1$ & H$^1$& 2.64$^1$ & 0 & 2.64$^1$ \\\hline & E3 & 0 & H$^1$ & H$^1$ & 3.87$^1$ & 0 & 3.87$^1$ \\ \hline & E4 & 0 & H$^1$ & H$^1$ & 4.80$^1$ & 0 & 4.80$^1$ \\ \hline & E5 & 0 & H$^1$ & H$^1$ & 4.80$^1$ & 0 & 4.80$^1$ \\ \hline $S_r$ & E1 & 0 & 0.97 & 0.97 & 0.48 & 0 & 0.48 \\\hline & E2 & 1.53$^2$ & 0.50 & 0.97 & 0.48 & 1.65$^2$ & 2.25$^2$ \\ \hline & E3 & 0.34 & 0.34 & 0 & 0.69 & 1.04 & 0.35 \\ \hline & E4 & 0.57 & 0.28 & 0.85 & 1.77$^2$ & 2.08$^2$ & 0.28 \\ \hline & E5 & 0.29 & 1.44$^3$ & 1.15 & 0.28 & 0.28 & 0.56 \\ \hline $S_t$ & E1 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline & E2 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline & E3 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline & E4 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline & E5 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline $S_d$ & E1 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline & E2 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline & E3 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline & E4 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline & E5 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline $S_g$ & E1 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline & E2 & 1 & 0 & 1 & 1 & 0 & 1 \\ \hline & E3 & 0.89 & 0 & 0.89 & 0.89 & 0 & 0.89 \\ \hline & E4 & 1.55$^2$ & 0 & 1.55$^2$ & 1.55$^2$ & 0 & 1.55$^2$ \\ \hline & E5 & 1.33$^3$ & 0 & 1.33$^3$ & 1.33$^3$ & 0 & 1.33$^3$ \\ \hline \end{tabular} \caption{Results for Group 3 datasets.} \label{tab:g3} } \end{table} \begin{table*}[t] \centering {\tiny \begin{tabular}{|p{2em}|p{2em}|p{5em}|p{5em}|p{5em}|p{5em}|p{6em}|p{6em}|p{6em}|p{6em}|p{6em}|p{6em}|} \hline {\bf SAS} & {\bf E. words} & {\bf $RG_n$$RG_{em}$} & {\bf $RG_n$$RG_{ef}$} & {\bf $RG_n$$RG_{am}$} & {\bf $RG_n$$RG_{af}$} & {\bf $RG_{em}$$RG_{ef}$} & {\bf $RG_{em}$$RG_{am}$} & {\bf $RG_{em}$$RG_{af}$} & {\bf $RG_{ef}$$RG_{am}$} & {\bf $RG_{ef}$$RG_{af}$} & {\bf $RG_{am}$$RG_{af}$} \\ \hline $S_b$ & E1 & 0 & H$^1$ & 0 & H$^1$ & H$^1$ & 0 & H$^1$ & H$^1$ & 0 & H$^1$ \\\hline & E2 & 0 & H$^1$ & 0 & H$^1$ & H$^1$ & 0 & H$^1$ & H$^1$ & 0 & H$^1$ \\\hline & E3 & 0 & H$^1$ & 0 & H$^1$ & H$^1$ & 0 & H$^1$ & H$^1$ & 0 & H$^1$ \\ \hline & E4 & 0 & H$^1$ & 0 & H$^1$ & H$^1$ & 0 & H$^1$ & H$^1$ & 0 & H$^1$ \\ \hline & E5 & 0 & H$^1$& 0 & H$^1$ & H$^1$& 0 & H$^1$ & H$^1$ & 0 & H$^1$ \\ \hline $S_r$ & E1 & 0.40 & 1.21 & 0.37 & 0.37 & 1.41 & 0.65 & 0.65 & 0.65 & 0.65 & 0 \\ \hline & E2 & 1.21 & 0.40 & 1.21 & 3.41$^1$ & 1.41 & 0 & 1 & 1.41 & 3$^1$ & 1 \\\hline & E3 & 0.84 & 0.28 & 0.28 & 0.28 & 0.48 & 0.97 & 0.97 & 0.48 & 0.48 & 0 \\ \hline & E4 & 1.18 & 1.75$^2$ & 0.23 & 0.23 & 0.43 & 1.21 & 1.21 & 1.68$^2$ & 1.68$^2$ & 0 \\ \hline & E5 & 0 & 0.46 & 0.47 & 1.42$^3$ & 0.40 & 0.40 & 1.21& 0.80 & 0.80 & 1.66$^2$ \\ \hline $S_t$ & E1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\\hline & E2 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\\hline & E3 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline & E4 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline & E5 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline $S_d$ & E1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\\hline & E2 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\\hline & E3 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline & E4 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline & E5 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline $S_g$ & E1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\\hline & E2 & 0.75 & 0.75 & 0.75 & 0.75 & 0 & 0 & 0 & 0 & 0 & 0 \\\hline & E3 & 0.68 & 0.68 & 0.68 & 0.68 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline & E4 & 1.17 & 1.17 & 1.17 & 1.17 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline & E5 & 1.03 & 1.03 & 1.03 & 1.03 & 0 & 0 & 0 & 0 & 0 & 0 \\ \hline \end{tabular} \caption{Results for combined Group 3 datasets.} \label{tab:g3-comp} } \end{table*} \subsubsection{Group-2:} \hfill \\ {\bf Hypothesis:} When there is a possibility of \emph{Gender} acting as a confounder, what is the impact of confounder on the distribution of (\emph{Sentiment $|$ Emotion Word}) \kl{Can this be written in a better way?}? \kl{Note to Biplav: When we encounter an 'X', consider the worst rating that is exhibited from the test data (for ex. like a False Negative).} \kl{We are interested in the worst behavior of the system (how worse could it get?). So we perform MAX(DIE).} {\bf Experimental Setup:} The analysis we perform here is different from what we did for the previous group. For group - 2, we do not calculate the sentiment distribution across each of the protected attribute classes as the emotion word distribution for each of the genders is different. Instead, we use our proposed DIE \% to compare the sentiment distribution before and after deconfounding as the presence of confounder opens a backdoor path from the input to the output through the confounders. The causal link between \emph{Gender} and \emph{Emotion Word} denotes that the gender affects the way emotion words are associated with a specific gender. For example, in one of the cases, we associate positive words more with sentences having a specific gender variable than sentences with other gender variables. We select one of these cases to illustrate the results. Choice of the case depends on the socio-technical context. \kl{Content need to be reviewed (Should we remove class names? Any justification?)} For example, in some scenarios, positive emotion words might be associated more with sentences with male gender variable. One has to choose a case depending on the socio-technical context. Table \ref{tab:emo-dist} shows different cases that can be considered. k=0 represents the group 1 datasets where the emotion words are associated uniformly across all the genders. To this the group-2 hypothesis, we use only E3 emotion word set for simplicity. We choose k=1 for this experiment in which 90\% of the sentences with male gender variables are associated with positive emotion words and rest with negative emotion words. For sentences with female gender variables, it is vice-versa and for NA, emotion words are equally distributed for male and female. This makes the number of positive and negative emotion words in the distribution equal. \begin{table} {\small \centering \begin{tabular}{ | m{1cm} | m{1cm}| m{1cm} | m{1em} | } \hline {\bf Male} & {\bf Female} & {\bf NA} & {\bf k} \\ \hline \hline (50,50) & (50,50) & (50,50) & 0 \\ \hline (90,10) & (10,90) & (50,50) & 1 \\ \hline (10,90) & (90,10) & (50,50) & 2 \\ \hline (90,10) & (50,50) & (10,90) & 3 \\ \hline (10,90) & (50,50) & (90,10) & 4 \\ \hline (50,50) & (90,10) & (10,90) & 5 \\ \hline (50,50) & (10,90) & (90,10) & 6 \\ \hline \end{tabular} \caption{Different dataset distributions that can be considered holding the number of positive and negative words constant in each of the cases along with the number of male, female and NA sentences. Each of these tuples represent the \% of (positive,negative) emotion words associated with that particular gender. 'k' is the label that is used to represent each of these cases.} \label{tab:emo-dist} } \end{table} \begin{table} \centering {\tiny \begin{tabular}{|p{3em}|p{4em}|p{5em}|p{5em}|p{5em}|p{4em}|} \hline {\bf SAS} & {\bf E.words} & {\bf E[\emph{Sentiment $|$ Emotion Word}]} & {\bf E[\emph{Sentiment $|$ do(Emotion Word)}]} & {\bf DIE \%} & {\bf MAX(DIE \%)} \\ \hline $S_b$ & E3 & (0.55,0.15) & (0.45,0.29) & (18.18,93.33) & 93.33 \\ \hline & E4 & (0.62,0) & (0.49,0.19) & (20.96,190) & 190$^*$ \\ \hline & E5 & (0.5,0.1) & (0.49,0.22) & (2,120) & 120 \\ \hline $S_r$ & E3 & (0.54,0.38) & (0.55,0.40) & (1.85,5.26) & 5.26 \\ \hline & E4 & (0.46,0.72) & (0.41,0.77) & (10.87,6.94) & 10.87$^*$ \\ \hline & E5 & (0.57,0.4) & (0.57,0.4) & (0,0) & 0 \\ \hline $S_t$ & E3 & (0,1) & (0,1) & (0,0) & 0 \\ \hline & E4 & (0,1) & (0,1) & (0,0) & 0 \\ \hline & E5 & (0,1) & (0,1) & (0,0) & 0 \\ \hline $S_d$ & E3 & (0,1) & (0,1) & (0,0) & 0 \\ \hline & E4 & (0,1) & (0,1) & (0,0) & 0 \\ \hline & E5 & (0,1) & (0,1) & (0,0) & 0 \\ \hline $S_g$ & E3 & (0.08,0.33) & (0.09,0.30) & (12.50,9.09) & 12.50 \\ \hline & E4 & (0.06,0.47) & (0.07,0.45) & (16.66,4.25) & 16.66$^*$ \\ \hline & E5 & (0.01,0.49) & (0,0.5) & (X,2.04) & X$^*$ \\ \hline \end{tabular} \caption{E[Sentiment $|$ Emotion Word] and E[Sentiment $|$ do(Emotion Word)] values for Group 2 datasets and the DIE \% when only one emotion word set, E3, is considered. } \label{tab:g2} } \end{table} \kl{Move group-3 (complete) to the supplmentary.} \section{Solution Approach} Our approach consists of the following main steps: (1) experimental apparatus consisting of data and SASs to be used, (2) creating a causal framework, (3) performing statistical tests to assess causal dependency, (4) assigning ratings. We now discuss them in turn. \vspace{-0.1in} \subsection{Experimental Apparatus} \label{subsec:apparatus} Although our approach is general-purpose, to ground the discussion, we present SASs and data considered in our implementation and evaluation. \noindent {\bf Sentiment Analysis Systems Considered: } The SASs we consider are: lexicon-based {\em TextBlob}, two custom built deep-learning systems trained by us based on the published descriptions and training datasets which are Gated Recurrent Units (GRU) based and DistilBERT based systems, and two other custom-built synthetic models which we call `Biased Female SAS' and `Random SAS'. The synthetic SASs represent extremes which can be used to contextualize the system's output. Sentiment is normally measured on a discrete scale like positive, negative and neutral. Hence, all SASs we considered are eventually evaluated on a discrete scale. In situations where the original SAS gave continuous output, we show evaluation before and after discretization. The reason for considering the two different cases is to show that our method works with different output types. However, as in all cases where the state space of a variable is coarsened, the results may be impacted. (a) The {\bf {\em TextBlob} SAS} (\cite{loria2018textblob}) takes a text and returns two values: polarity and subjectivity. Polarity gives the numerical sentiment of the text, and it lies in the interval [-1,1]. We considered two different cases, denoted by $S_t$ for original, and $S_{t}^{\dagger}$ for discretized. (b) The {\bf {\em GRU}-based SAS} is a Gated Recurrent Unit ({\em GRU}) (\cite{cho2014learning}) based implementation as described in (\cite{SemEval2018Task1}). It is a neural network model consisting of an embedding layer, two {\em GRU} layers and a dense layer with '{\em Softmax}' as its activation function. It classifies the text into 7 categories from numbers 0 to 6 based on its sentiment. We normalized the scores by $v_n = v/3 - 1$ where $v_n$ is the normalized value and $v$ is the raw sentiment score. Now, the sentiment values will lie in the interval, [-1,1]. We considered two different cases, denoted by $S_g$ for original, and $S_{g}^{\dagger}$ for discretized. (c) The {\bf {\em DistilBERT}-based SAS} (\cite{distilbert}) uses the distilled version of BERT base model called DistilBERT. It is fine-tuned on SST-2 (Stanford Sentiment Treebank V2) (\cite{socher-etal-2013-recursive}). The model tells how positive or negative a sentence is by giving a value between [0,1] as the output and a label specifying whether the value is negative or positive. We considered two different cases. We subtracted the value from 0, if it has a negative label so that the scores will lie in the interval [-1,1]. We considered two different cases, denoted by $S_d$ for original, and $S_{d}^{\dagger}$ for discretized. (d) The {\bf{\em Biased female} SAS} is a biased sentiment analyzer that is biased towards the female gender, as the name indicates. The system assigns a score of '1' (positive sentiment) for all the sentences containing the female gender variable and a score of '-1' (negative sentiment) to all other sentences irrespective of the emotion word used in the sentence. The system is denoted by $S_b$. (e) The {\bf{\em Random} SAS} assigns random score to its input sentences irrespective of their content. We considered two different cases. We considered two different cases, denoted by $S_r$ for original, and $S_{r}^{\dagger}$ for discretized. \begin{table*}[ht] \centering {\small \begin{tabular}{|p{2.2em}|p{3.4em}|p{6.5em}|p{11em}|p{10em}|p{12em}|} \hline {\bf Group} & {\bf Input} & {\bf Possible confounders} & {\bf Choice of emotion word} & {\bf Causal model} & {\bf Example sentences}\\ \hline 1 & {\em Gender, Emotion Word} & None & \{Grim\},\{Happy\}, \{Grim, Happy\},\{Grim, Depressing, Happy\},\{Depressing, Happy, Glad\} & \begin{minipage}{.05\textwidth} \vspace{2.5mm} \centering \includegraphics[width=30mm, height=15mm]{figs/Group1.png} \end{minipage} & I made this boy feel grim; I made this girl feel grim. \\ \hline 2 & {\em Gender, Emotion Word} & {\em Gender} & \{Grim, Happy\},\{Grim, Depressing, Happy\},\{Depressing, Happy, Glad\} & \begin{minipage}{.05\textwidth} \vspace{2.5mm} \centering \includegraphics[width=30mm, height=15mm]{figs/Group2.png} \end{minipage} & I made this woman feel grim; I made this boy feel happy; I made this man feel happy. \\ \hline 3 & {\em Gender, Race and Emotion Word} & None & \{Grim\},\{Happy\}, \{Grim, Happy\},\{Grim, Depressing, Happy\},\{Depressing, Happy, Glad\} & \begin{minipage}{.05\textwidth} \vspace{2.5mm} \centering \includegraphics[width=30mm, height=15mm]{figs/Group3.png} \end{minipage} & I made Adam feel happy; I made Alonzo feel happy. \\ \hline 4 & {\em Gender, Race and Emotion Word} & {\em Gender, Race} & \{Grim, Happy\},\{Grim, Depressing, Happy\},\{Depressing, Happy, Glad\} & \begin{minipage}{.05\textwidth} \vspace{2.5mm} \centering \includegraphics[width=30mm, height=15mm]{figs/Group4.png} \end{minipage} & I made Torrance feel grim; Torrance feels grim; Adam feels happy. \\ \hline \end{tabular} } \caption{Different types of datasets we constructed based on the input given to the SASs, presence of confounder, the choice of emotion words and the respective causal model for each of the groups.} \label{tab:cases} \end{table*} {\bf Data - Reuse and Generated: } The sentence templates required for the experiments were taken from the EEC dataset (\cite{sentiment-bias}) along with race, gender and emotion word attributes. We extract two types of gender variables from the EEC dataset. They are male (Ex: `this boy') and female (Ex: `this girl'). We also add a third gender variable, NA (Ex: `they/them'), which denotes that the gender is not revealed. We also extract names which serve as a proxy for two types of races. They are European (Ex: 'Adam') and African-American (Ex: 'Alonzo'). We again use 'NA' which, in this case, denotes that both the gender and race are not revealed. Table \ref{tab:cases} illustrates different types of datasets we generated. Based on the protected attributes considered, emotion words used and the presence of a confounder, we can broadly classify the datasets generated into four groups. They are: \\ \noindent {\bf (a) Group 1:} \emph{Gender} and \emph{Emotion Word} are the only attributes extracted from the EEC dataset. They are combined using the templates extracted from EEC and given as input to the SASs. In this case, there is no causal link between \emph{Gender} and \emph{Emotion Word} as the \emph{Emotion Word} and \emph{Gender} are generated independently to form the sentences. Hence, there is no possibility of any confounding effect. \\ \noindent {\bf (b) Group 2:} The datasets have the same attributes as that of Group 1. However, the way the emotion words are associated with each of the genders is different. We associate positive words more often with the sentences having a specific gender variable than the sentences with other gender variables. Hence, gender might act as a confounder as it affects how emotion words are associated with the gender. \noindent {\bf (c) Group 3:} Along with \emph{Gender}, another protected attribute, \emph{Race}, is also given as an input to the SASs. In this group, there is no causal link between any of the protected attributes and the \emph{Emotion Word}. Hence, no possible confounders. \\ \noindent {\bf (d) Group 4:} In this group, there is a possibility of both \emph{Race} and \emph{Gender} acting as confounders as the \emph{Emotion Word} association depends on the value of the protected attributes. We consider a composite case for this group in which we associate positive words more with a certain class and negative words more with some other class. For other classes, emotion words will be uniformly distributed. An example of a class, in this group, would be `European female'. \\ Four templates were extracted from the EEC dataset. \emph{``$<$Person subject$>$ is feeling $<$emotion word$>$"} is one such example. We extracted 4 emotion words (2 positive, 2 negative). ``Grim" is an example of a negative emotion word and ``happy" is an example of a positive emotion word. In the template,``Person subject" refers to the gender $/$ race variable. Within each of these groups, we created five different datasets for Group-1 and Group-3 and three different datasets for Group-2 and Group-4 by varying the number of emotion words as shown in Table \ref{tab:cases}. In total, we generated 16 different datasets for our experiments. \subsection{Creating a Causal Framework} Causal models allow us to define the cause-effect relationships between each of the attributes in a system. They are diagrammatically represented using a causal diagram which is a directed graph. Each node represents an attribute and each node can be connected to one or more nodes by an arrow. Arrowhead direction shows the causal direction from cause to effect. Figure \ref{fig:causal-model} shows our proposed causal model which captures the causal relations between each of the attributes in our system. \begin{figure}[h] \centering \includegraphics[height=0.20\textwidth]{figs/causal_model.png} \caption{Our proposed causal model} \label{fig:causal-model} \end{figure} \vspace{-0.1in} We generated the data for the experiments as described in the previous section. The reason for adding two different variations (one with possible confounders and one without) is due to the fact that sometimes the data that is available might have protected attributes affecting the emotion word. For example, if negative emotion words are associated more with one gender than the other in a dataset, that would add a spurious correlation between the \emph{Emotion Word} and the \emph{Sentiment} given by the SASs. This variation is represented as a dotted arrow from the protected attributes to the {\em Emotion Word}. The causal link from {\em Emotion Word} to {\em Sentiment} indicates that the emotion word affects the sentiment given by an SAS. We colored the arrow green to indicate that this causal link is desirable i.e., {\em Emotion Word} should be the only attribute affecting the {\em Sentiment}. The causal links from the protected attributes to the {\em Sentiment} were colored red to indicate that it is an undesirable path. If any of the protected attributes are affecting the {\em Sentiment}, then the system is said to be biased. The '?' indicates that we will be testing whether these attributes influence the sentiment given by each of the SASs and the final rating would be based on the validity of these tests. \vspace{-0.1in} \subsection{Performing Statistical Tests to Assess Causal Dependency} Our aim is to test the hypothesis of whether protected attributes like \emph{Gender} and \emph{Race} influence the output (\emph{Sentiment}) given by the SASs or if the sentiment is based on other components of the textual input like chosen emotion words. We compute two values which would aid us in rating the AI systems. They are: \\ {\bf Effect of protected attributes on \emph{Sentiment}:} This is done in two different ways based on the data groups. \\ {\bf (a) Group 1:} There is only one protected attribute (\emph{Gender}) in these datasets along with the emotion word. To compute this we measure mean of the distribution, \emph{Sentiment} given \emph{Gender}, which is denoted by E[\emph{Sentiment $|$ Gender}]. We then compare this distribution across each of the genders using Student's t-test (\cite{student1908probable}). We measure this for each pair of the genders (male and female; male and NA; ...). \\ {\bf (b) Group 3:} There are two protected attributes (\emph{Gender} and \emph{Race}) in these datasets along with the \emph{Emotion Word}. For this group, we have two individual cases and one composite case. {\bf (i) Individual cases}: In the individual cases, we compute E[\emph{Sentiment $|$ Gender}] and E[\emph{Sentiment $|$ Race}] and compare distributions across each of the classes in each of the protected attributes using the t-test. {\bf (ii) Composite case}: In the composite case, we combine the \emph{Gender} and \emph{Race} attributes into one single attribute (e.g., `African-American female', `European male', etc.). We call this attribute, `RG'. We then compute E[\emph{Sentiment $|$ RG}]. We again use the t-test to compare each pair of the distribution. \\ The computed t-value for each pair of genders are compared with the critical t-value obtained from the lookup table (based on confidence interval (CI) and degrees of freedom (DoF)). Based on this, null hypothesis (means are equal) is rejected or accepted. We tweak the t-test analysis by introducing a metric called {\em Weighted Rejection Score (WRS)} which is defined by the following equation. {\bf Weighted Rejection Score (WRS)} \begin{equation} \begin{split} = \sum_{i} w_i*x_i \end{split} \label{eq:wrs} \end{equation} $x_i$ is the variable set based on whether the null hypothesis is accepted (0) or rejected (1). $w_i$ is the weight that is multiplied by $x_i$ based on the CI. For example, if CI is 95\%, $x_1$ is multiplied by 1. Lesser the CI, the lesser the multiplied weight should be. {\bf (c) Groups 2 and 4:} As the emotion word distribution is different for each of the genders / races, this analysis would not fetch us any useful results. So, this would be redundant. {\bf Effect of \emph{Emotion Word} on \emph{Sentiment}:} This is also done in two different ways based on the data groups.\\ {\bf (a) Groups 2 and 4:} In group 2, \emph{Gender} is the only possible confounder whereas in group 4, both \emph{Gender} and \emph{Race} together act as confounders. We apply backdoor adjustment as described in (\cite{Pearl09}). The backdoor adjustment formula is given by the equation: {\tiny \begin{equation} \begin{split} P[Y | do(X)] = \sum_{Z} P(Y | X, Z)P(Z) \end{split} \end{equation} } 'X' refers to the input emotion word and 'Y' refers to the output sentiment. 'Z' refers to the set of protected attributes (gender, race or both together). Removing this confounding effect is called Deconfounding. In our case, deconfounding does not completely remove the effect of the protected attributes on the \emph{Sentiment}, but removes the causal link between the protected attributes and the \emph{Emotion Word} (removes the backdoor path). We introduce a new metric called {\em Deconfounding Impact Estimation} (DIE) which measures the relative difference between the expectation of the distribution, (Output $|$ Input) before and after deconfounding. DIE \% can be computed using the following equation: {\bf Deconfounding Impact Estimate (DIE) \%} = {\tiny \begin{equation} \begin{split} {\frac{ [|E(Output = j| do(Input = i)) – E(Output = j | Input = i) | ]} {E(Output = j | Input = i) }} * 100 \label{eq:die} \end{split} \end{equation} } {\bf (b) Groups 1 and 3:} There is no possibility of confounding effect in both these cases. Hence, there is no need to perform any backdoor adjustment. \vspace{-0.1in} \subsection{Assigning Ratings} Using the t-test and our proposed DIE \%, we compute the rating with respect to the input (\emph{Emotion Word}). Based on the fine-grained ratings in each of these cases, we compute an overall rating for the system using the following algorithms. Table \ref{tab:op} shows the results obtained from each of these algorithms after running them on different datasets belonging to the four groups when the output sentiment attribute is discretized. Table \ref{tab:op-cont} shows the results obtained from each of these algorithms after running them on different datasets belonging to the four groups when the output sentiment attribute is not discretized (retaining the original values). The experiments and the corresponding results will be explained in detail in Section-4 of this paper. \SetKwComment{Comment}{/* }{ */} \begin{algorithm} \tiny \caption{\emph{WeightedRejectionScore}} \textbf{Purpose:} is used to calculate the weighted sum of number of rejections of null-hypothesis for Datasets $d_j$ pertaining to an SAS $s$, Confidence Intervals (CI) $ci_k$ and Weights $w_k$. \textbf{Input:}\\ $D$, datasets pertaining to different dataset groups.\\ $CI$, confidence intervals (95\%, 70\%, 60\%). \\ $W$, weights corresponding to different CIs (1, 0.8, 0.6). \\ \textbf{Output:} \\ $\psi$, weighted rejection score. $ \psi \gets 0$ \For {each $ci_i, w_i \in CI, W$} { \For {each $d_j \in D$} { \For {each $p_k \in P$ } { \For {each $c_m, c_n \in C$} { $t, pval, dof \gets T-Test(c_m, c_n) $\; $t_{crit} \gets LookUp(ci_i, dof) $\; \eIf{$t_{crit} > t$} { $\psi \gets \psi + 0 $\; } {$\psi \gets \psi + w_i $} } } } } \Return $\psi$ \end{algorithm} Algorithm 1 computes the weighted rejection score for datasets belonging to Groups 1 and 3. It takes the datasets pertaining to an SAS as input along with the different confidence intervals ($ci_k$) and the weights ($w_k$) assigned to each of these confidence intervals. Weighted Rejection Score (WRS) was defined in eq. \ref{eq:wrs}. In the algorithm, $P$ represents the set of protected attributes (race and gender, in our case). $\psi$ is incremented by the corresponding weight for the considered confidence interval whenever the null hypothesis is rejected for a pair, $c_m, c_n$ in a dataset, $d$ belonging to an SAS, $s$. \begin{algorithm} \tiny \caption{ \emph{ComputeDIEScore}} \textbf{Purpose:} is used to calculate the Deconfounding Impact Estimation (DIE) score for Group-2 and Group-4 datasets. \textbf{Input:}\\ $s$, an SAS belonging to the set of SASs, $S$.\\ $D$, datasets pertaining to different dataset groups.\\ \textbf{Output:} \\ $\psi$, Deconfounding Impact Estimation (DIE) score. $ \psi \gets 0$ $DIE\_list \gets []$ \hspace{0.5 in} // To store the list of DIE \% of all the datasets. \For {each $d_j \in D$} { $ Obs \gets E(Sentiment|Emotion)$\; $ Int \gets E(Sentiment|do(Emotion))$\; $DIE \gets MAX(List([Obs - Int])/Obs))$\; $DIE\_list[j] \gets DIE * 100$\; } $\psi \gets MAX(DIE\_list)$\; \Return $\psi$ \end{algorithm} Algorithm 2 computes our proposed DIE \% for datasets belonging to Groups 2 and 4. This will be computed using the equation \ref{eq:die}. We compute the mean of the experimental distribution (\emph{Sentiment}$|$do(\emph{Emotion Word})) using the Causal Fusion tool (\cite{fusion}). The obtained DIE score from each of the datasets will be in the form of a tuple with 2 numbers. One corresponds to the DIE score computed for sentences with negative emotion words and the other for sentences with positive emotion words. We rate the systems based on the worst possible behavior. So we take the maximum value (high DIE score implies that the confounding effect is more prominent in that case) out of those two. From these scores, we again compute the maximum for each of the SASs. This will get us the worst possible DIE from each of the SASs. \begin{algorithm} \tiny \caption{ \emph{CreatePartialOrder}} \textbf{Purpose:} is used to create a partial order based on the computed weighted rejection score for Group-1 and Group-3 and based on the DIE \% for Group-2 and Group-4. \textbf{Input:}\\ $S$, Set of SASs, $S$.\\ $G$, Group number. \\ $D$, $CI$, $W$ (as defined in the previous algorithms). \\ \textbf{Output:} \\ $PO$, dictionary with partial order. $ KV \gets \{\}$\; \eIf {G == 1 OR G == 3}{ \For {each $s_i \in S$}{ $\psi \gets WeightedRejectionScore(s_i, D, CI, W)$\; $KV[s_i] \gets \psi$\; } } {\For {each $s_i \in S$} { $\psi \gets ComputeDIEScore(s_i, D)$\; $KV[s_i] \gets \psi$\; } } $PO \gets Sort(KV)$\; \Return $PO$ \end{algorithm} Based on the $\psi$ value computed in each case, Algorithm 3 creates a partial order in the form of a dictionary with key, value pairs. The key will be the SAS name and the value is the corresponding $\psi$ value. This algorithm will also take the group number as input as the $\psi$ value computed for each of these groups will be different. As shown in Table \ref{tab:op} and Table \ref{tab:op-cont}, the SASs with the least $\psi$ will be placed first and SASs with the worst $\psi$ will be placed at the end of the dictionary. For Group-2 and Group-4 (in Table \ref{tab:op}), an SAS has the value 'X'. While computing the DIE \% for this system, we may encounter a '0' in the denominator. These values will be represented with an 'X'. In order to provide a safe and reliable rating to the user, we assign the worst possible rating to these systems (false negatives are better than false positives, in cases like these). \vspace{-0.1in} \begin{algorithm} \tiny \caption{\emph{AssignRating}} \textbf{Purpose:} \emph{AssignRating} is used to assign a rating to each of the SASs based on the partial order and the number of rating levels, $L$. \textbf{Input:}\\ $S$, $D$, $CI$, $W$, $G$ (as defined in the previous algorithms). $L$, rating levels chosen by the user.\\ \textbf{Output:} \\ $R$, dictionary with ratings assigned to each of the SASs. $ R \gets \{\} $\; $ PO \gets CreatePartialOrder(S,D,CI,W,G)$\; $ \psi \gets [ PO.values()]$\; \eIf {len(S) $>$ 1}{ $P \gets ArraySplit(V,L) $\; \For {$k,i \in PO,\psi $}{ \For {$p_j \in P$}{ \If {$i \in p_j$}{ $R[k] \gets j$\; } } } } { // Case of single SAS in $S$ \eIf {$\psi$ $==$ 0} {$R[k] \gets 1$ \hspace{0.5 in} // Unbiased, also denoted $R_1$ } {$R[k] \gets $L$ $ \hspace{0.5 in} // Highest level, also denoted $R_L$ } } \Return $R$ \end{algorithm} Algorithm 4 computes the fine-grained ratings for each group belonging to different SASs. The rating that is calculated indicates how biased the system is. The higher the rating, the more biased the system will be. In Table \ref{tab:op} and Table \ref{tab:op-cont}, the last column shows the ratings given to each of the SASs based on the weighted rejection score, in case of Group-1 and Group-3 datasets and DIE \%, in case of Group-2 and Group-4 datasets. If the number of SASs provided as an input are greater than one then the algorithm computes a relative rating. In addition to the SASs, datasets, confidence intervals, weights and the group number, rating levels, L is also given as an input. This is a number that can be chosen by the user which denotes the rating scale. For example, if L = 3, then 3 possible ratings can be given to each of the systems (1,2,3). Rating '1' and '3' are the extremes denoting the worst and best ratings respectively. In order to give this rating, we split the sorted list of all the $\psi$ into 'L' partitions and the rating is given based on the partition number in which $\psi$ of a system resides. For example, if the $\psi$ value is in partition-1 (which has the lowest $\psi$ values), it will be given a rating of '1'. If only one SAS is given as an input to the algorithm, it computes an absolute rating. The $L$ value will be taken as the biased value, and if not provided, $L$ will be 2. So, for single SAS, the algorithm gives two possible ratings indicating whether the system is unbiased (1 - $R_1$) or biased ($L - R_L$). \begin{table} \centering {\tiny \begin{tabular}{|p{6em}|p{15em}|p{10em}|} \hline {\bf SAS} & {\bf Partial Order} & {\bf Complete Order} \\ \hline Group-1 & \{$S_d^\dagger$: 0, $S_t^\dagger$: 0, $S_r^\dagger$: 0.6, $S_g^\dagger$: 2.6, $S_b$: 23\} & \{$S_d^\dagger$: 1, $S_t^\dagger$: 1, $S_r^\dagger$: 2, $S_g^\dagger$: 2, $S_b$: 3\} \\ \hline Group-2 & \{$S_d^\dagger$: 0, $S_t^\dagger$: 0, $S_r^\dagger$: 10.87, $S_b$: 128.5, $S_g^\dagger$: \{X, 16.16\}\} & \{$S_d^\dagger$: 1, $S_t^\dagger$: 1, $S_r^\dagger$: 2, $S_b$: 3, $S_g^\dagger$: 3\} \\ \hline Group-3\_R & \{$S_d^\dagger$: 0, $S_t^\dagger$: 0, $S_g^\dagger$: 3.8, $S_r^\dagger$: 5.2, $S_b$: 23\} & \{$S_d^\dagger$: 1, $S_t^\dagger$: 1, $S_g^\dagger$: 2, $S_r^\dagger$: 2, $S_b$: 3\} \\ \hline Group-3\_G & \{$S_d^\dagger$: 0, $S_t^\dagger$: 0, $S_r^\dagger$: 1.9, $S_g^\dagger$: 3.8, $S_b$: 23\} & \{$S_d^\dagger$: 1, $S_t^\dagger$: 1, $S_r^\dagger$: 2, $S_g^\dagger$: 2, $S_b$: 3\} \\ \hline Group-3\_RG & \{$S_d^\dagger$: 0, $S_g^\dagger$: 0, $S_t^\dagger$: 0, $S_r^\dagger$: 10.4, $S_b$: 69\} & \{$S_d^\dagger$: 1, $S_g^\dagger$: 1, $S_t^\dagger$: 1, $S_r^\dagger$: 2, $S_b$: 3\} \\ \hline Group-4 & \{$S_d^\dagger$: 0, $S_t^\dagger$: 0, $S_r^\dagger$: 7.4, $S_b$: 105.4, $S_g^\dagger$: \{X, 18.18\}\} & \{$S_d^\dagger$: 1, $S_t^\dagger$: 1, $S_r^\dagger$: 2, $S_b$: 3, $S_g^\dagger$: 3\} \\ \hline \end{tabular} \caption{Output from Algorithms 3 and 4 on SASs = \{$S_d^\dagger, S_t^\dagger, S_r^\dagger, S_g^\dagger, S_b$\} when output sentiment is discretized and the chosen rating level, $L$ = 3. Final rating of 1 denotes unbiased and 3 (highest level) as biased. The experiments to assess them are explained in Section 4 and supplementary material. Final output is shown later in Table~\ref{tab:sas-rating}. } \label{tab:op} } \end{table} \begin{table} \centering {\tiny \begin{tabular}{|p{6em}|p{15em}|p{10em}|} \hline {\bf SAS} & {\bf Partial Order} & {\bf Complete Order} \\ \hline Group-1 & \{$S_d$: 0, $S_t$: 0, $S_g$: 0.6, $S_r$: 1.9, $S_b$: 23\} & \{$S_d$: 1, $S_t$: 1, $S_g$: 2, $S_r$: 2, $S_b$: 3\} \\ \hline Group-2 & \{$S_g$: 42.85, $S_r$: 71.43, $S_t$: 76, $S_d$: 84, $S_b$: 128.5\} & \{$S_g$: 1, $S_r$: 1, $S_t$: 2, $S_d$: 2, $S_b$: 3\} \\ \hline Group-3\_R & \{$S_d$: 0, $S_t$: 0, $S_g$: 0, $S_r$: 7.2, $S_b$: 23\} & \{$S_d$: 1, $S_t$: 1, $S_g$: 1, $S_r$: 2, $S_b$: 3\} \\ \hline Group-3\_G & \{$S_d$: 0, $S_t$: 0, $S_g$: 0, $S_r$: 7.5, $S_b$: 23\} & \{$S_d$: 1, $S_t$: 1, $S_g$: 1, $S_r$: 2, $S_b$: 3\} \\ \hline Group-3\_RG & \{$S_d$: 0, $S_t$: 0 , $S_g$: 0, $S_r$: 16.1, $S_b$: 69\} & \{$S_d$: 1, $S_t$: 1, $S_g$: 1, $S_r$: 2, $S_b$: 3\} \\ \hline Group-4 & \{$S_g$: 28.57, $S_r$: 45, $S_t$: 78, $S_d$: 80, $S_b$: 105.4\} & \{$S_g$: 1, $S_r$: 1, $S_t$: 2, $S_d$: 2, $S_b$: 3\} \\ \hline \end{tabular} } \caption{Output from Algorithms 3 and 4 on SASs = \{$S_d, S_t, S_r, S_g, S_b$\} when original output sentiment is used (without discretizing) and the chosen rating level, $L$ = 3. Final rating of 1 denotes unbiased and 3 (highest level) as biased. The experiments to assess them are explained in Section 4 and supplementary material. Final output is shown later in Table~\ref{tab:sas-rating-cont}.} \label{tab:op-cont} \end{table} \section{Background} \noindent {\bf Bias in AI Systems:} There is increasing awareness of bias issues in AI services (\cite{bias-survey}). Restricting to text data, there have been previous works to assess bias in translators (\cite{translator-assess-bias,translator-bias}. To exemplify, in (\cite{translator-assess-bias}), the authors test {\em Google Translate} on sentences like "He/She is an Engineer" where occupation is from U.S. Bureau of Labor Statistics (BLS). They compare the observed frequency of female, male and gender-neutral pronouns in the translated output with the expected frequency according to BLS data. \noindent {\bf Bias in Sentiment Assessment Systems:} Another popular form of AI services is sentiment analysis which, given a piece of text, assigns a score conveying the sentiment and emotional intensity expressed by it. In (\cite{sentiment-bias}), the authors experiment with sentiment analysis systems that participated in SemEval-2018 competition. They create the Equity Evaluation Corpus (EEC) dataset which consists of 8,640 English sentences where one can switch a person’s gender or choose proper names typical of people from different races. They also experiment with Twitter datasets. The authors find that up to 75\% of the sentiment systems can show variations in sentiment scores which can be perceived as bias based on gender or race. While much of the work in sentiments has happened for English, there is growing interest in other languages. In (\cite{sentiment-multilingual}), the authors re-implement sentiment methods from literature in multiple languages and report accuracy lower than published. Since multilingual SASs often use machine translators which can be biased, and further acquiring training data in non-English languages is an additional challenge, we hypothesize that multilingual SASs could exhibit gender bias in their behavior (\cite{round-trip}). \noindent {\bf Rating of AI Systems:} A recent line of work in fairness is on assessing and rating AI systems (translators and chatbots) for trustworthiness from a third-party perspective, i.e., without access to the system's training data. In (\cite{trans-rating-jour,trans-rating}), the authors propose to rate automated machine language translators for gender bias. Further, they created visualizations to communicate ratings (\cite{vega-rating-viz}), and conducted user studies to determine how users perceive trust (\cite{vega-user-study}). \noindent {\bf Causal Analysis of AI Systems:} There is also increased interest in exploring causal effects for AI systems. For example, the use of a causal model of complex software systems has been shown to provide support to users in avoiding misconfiguration and in debugging highly configurable and complex software systems (\cite{unicorn2022,why19}). For natural language processing (NLP), (\cite{causal-nlp}) provides a survey on estimating causal effects on text. Similarly, causal reasoning is being used for object recognition systems (\cite{mao2021generative}) and recommendation systems (\cite{causal-collab}). These works do not consider using such analyses for communicating trust issues. In this paper, we use a causal Bayesian network to represent causal and probabilistic relations of interest. Variables are used to represent features (usually derived from analysis of text or images), protected features, such as gender and race, and sentiment, as expressed in the output of an SAS. As usual for Bayesian networks, each node corresponds to a variable. Since our Bayesian networks are causal, the links represent both the independence structure of a probability distribution and causal relations. The model that we propose in this paper, shown in Figure~\ref{fig:causal-model}, is similar to ones used in social science research, such as the analysis of fairness in hiring or college admissions; for a recent review, see~(\cite{causal-fairness}). \noindent {\bf Hate Speech Detection:} In (\cite{toxic-debiasing}), the authors debias toxic language detectors. They do not attempt to measure or quantify the bias. In (\cite{davidson2019racial}), the authors measure the racial bias in hate speech and abusive language detection datasets. They do not measure gender bias. In (\cite{park2018reducing}), the authors reduce gender bias in abusive language detection models. They do not measure the bias in the models. In all the works mentioned above, there is no notion of causality. Their results cannot be interpreted causally, while ours can be. They attempt to remove bias without fully exploring the range of bias possible. \section{Conclusion} Artificial Intelligence (AI) systems, whether in general use or at prototype stages, have been reported to exhibit issues like gender-bias and racial-bias. In this paper, we introduced a novel method to assess and rate the sentiment analyzers where inputs are perturbed in a controlled causal setting to test the sensitivity of the output sentiment to protected attributes. Overall, we demonstrated that our rating system can help users compare alternatives to make informed decision regarding selection of SASs with respect to gender and racial-bias. Our method could also detect different in behavior when the output of SAS is discretized v/s left unchanged as continuous. Our work can be extended by not only relaxing the assumptions made but also trying them on more general settings. First, one could extend it to more complex input - i.e., sentence templates with more that one emotion word and gender / race variables in each sentence. Second, the proposed rating methodology, with little tweaks, can be applied to other AI systems like machine translators and object detectors which too have exhibited the bias issue. Third, one could explore composite settings where diverse types of AIs are used together like SAS and machine translator, e.g., (\cite{round-trip}. \section{Discussion} We now review the proposed method and discuss its characteristics since its working and usability is affected by design choices and socio-technical considerations that we elaborate on. When a single SAS is used for rating, the method can produce only two ratings: $R_1$, corresponding to unbiased and $R_L$, corresponding to biased. When more SASs are given, the rating output for a SAS can be both relative to others input, and also absolute with respect to the number of rating levels ($L$) provided as input. A relative ranking of SASs is useful when they will be shown to a user to choose among them. On the other hand, an absolute ranking based on levels (for example, $L$ = 3 corresponding to low, medium and high) can be useful in comparing SAS as new ones are developed over time and old ones are deprecated. The actual $L$ to use depends on the usage context but cognitive theory also has a role since people have to understand the rating; literature recommends a number approximately not to exceed seven (\cite{magical-seven}). Some assumptions that we made in the paper are: (1) Number of confounders as 2. A system might have more confounders based on the setting, (2) Our causal model has confounders but no mediators. Mediation analysis is not possible with our setting. More generally, our method also requires following decisions to be made during deployment: (1) the choice of protected variables and their values, which is a socio-technical decision. We considered gender and race, (2) the choice of statistical test, which we used as the student t-test, (3) the choice of input (sentence structure and words), which we chose based on EEC. \section{Experiments and Results} \vspace{-0.1in} \subsection{Hypotheses and Experimental Setup} We want to test some hypotheses for each of the SASs described in the previous section using our experimental setup. We make use of the data groups described in the solution approach to check whether a hypothesis is valid or not. Based on their validity, we assign fine-grained ratings to each of the data groups for every SAS and an overall rating to each of the SASs based on these fine-grained ratings. Due to space constraints, we could not include the Group-2 and Group-3 results in the main paper. They can be found in the supplementary material. However, Group-1 and Group-4 experiments captured most of the significant results. \noindent {\bf Group-1:} {\bf Hypothesis:} Would \emph{Gender} affect the sentiment value computed by the SASs when there is no possibility of confounding effect? \\ {\bf Experimental Setup:} We considered different sets of emotion words as described in the solution approach. They are: E1: \{Grim\}, E2: \{Happy\}, E3: \{Grim, Happy\}, E4: \{Grim, Depressing, Happy\}, E5: \{Depressing, Happy, Glad\}. We used t-value, p-value and DoF from the student's t-test (\cite{student1908probable}) to compare different sentiment distributions across each of the genders. Table \ref{tab:g1} shows the t-values obtained from each of the SASs for each emotion word set when the output sentiments are discretized and Table 5 in the supplementary material shows the results when the output sentiments are not discretized. Here, $G_m$$G_n$ is the absolute t-value computed for male and NA distributions; similarly, $G_m$$G_f$ and $G_f$$G_n$ are defined between male and female, and female and NA, respectively. T-value formula is given by the equation, $$t = (mean(x1) - mean(x2))/\sqrt{((s1^2/n1)+(s2^2/n2))}$$ x1 and x2 are the two distributions. s1 and s2 are their standard deviations and n1 and n2 are their counts. We added a small '$\epsilon$' of 0.0001 to the denominator of t-value formula because for some distributions the standard deviation is 0. We calculated the t-value for each of these datasets. We have chosen different confidence intervals for which there are different alpha values (or critical values). If t-value is less that the alpha, we accept the {\em null hypothesis} (the means are equal) in favor of the {\em alternative} (the means are not equal) and vice-versa. The superscripts for each value in the table denote different Confidence Intervals (CIs) (95\%, 70\%, 60\%). A superscript, '1', indicates that we can reject the null hypothesis for any of the CIs we have considered. '2' indicates that we can reject the null hypothesis for CIs, 70\%, and 60\%. '3' indicates that the null hypothesis can be rejected for a CI of 60\%. A value 'H' (in the biased SAS) indicates that the difference between the distributions considered is high (large number due to the presence of $\epsilon$ value in the denominator). These values are used to compare WRS which was defined in eq. \ref{eq:wrs}. \begin{table} \centering {\tiny \begin{tabular}{|p{4em}|p{2em}|p{3em}|p{3em}|p{3em}|} \hline \bf{SAS} & \bf{E. words} & $\bf{G_mG_n}$ & $\bf{G_mG_f}$ & $\bf{G_fG_n}$ \\ \hline $S_b$ & E1 & 0 & H$^1$ & H$^1$ \\ \hline & E2 & 0 & H$^1$ & H$^1$ \\ \hline & E3 & 0 & H$^1$ & H$^1$ \\ \hline & E4 & 0 & H$^1$ & H$^1$ \\ \hline & E5 & 0 & H$^1$ & H$^1$ \\ \hline $S_r^\dagger$ & E1 & 0.48 & 0 & 0.48 \\ \hline & E2 & 0 & 0.48 & 0.48 \\ \hline & E3 & 0 & 0.34 & 0.34 \\ \hline & E4 & 0.87 & 0.28 & 0.59 \\ \hline & E5 & 1.46$^3$ & 0.87 & 0.57 \\ \hline $S_t^\dagger$ & E1 & 0 & 0 & 0 \\ \hline & E2 & 0 & 0 & 0 \\ \hline & E3 & 0 & 0 & 0 \\ \hline & E4 & 0 & 0 & 0 \\ \hline & E5 & 0 & 0 & 0 \\ \hline $S_d^\dagger$ & E1 & 0 & 0 & 0 \\ \hline & E2 & 0 & 0 & 0 \\ \hline & E3 & 0 & 0 & 0 \\ \hline & E4 & 0 & 0 & 0 \\ \hline & E5 & 0 & 0 & 0 \\ \hline $S_g^\dagger$ & E1 & 1 & 1 & 0 \\ \hline & E2 & 1 & 0.48 & 0.50 \\ \hline & E3 & 1.27 & 0.80 & 0.47 \\ \hline & E4 & 1.55$^2$ & 0.70 & 0.86 \\ \hline & E5 & 1.63$^2$ & 0.92 & 0.70 \\ \hline \end{tabular} \caption{Results for Group 1 datasets (when the output sentiment is discretized) showing the t-values and the superscript shows whether the null hypothesis is rejected or accepted in each case for the CIs considered (95\%, 70\%, 60\%). Superscript '1' indicates rejection with all 3 CIs, '2' indicates rejection with 70 and 60. '3' indicates rejection with 60 \%.} \label{tab:g1} } \end{table} \begin{figure}[h] \centering \includegraphics[height=0.18\textwidth]{figs/rg.png} \caption{Causal model for Group-4 (Composite case). Note that this is a specific variation of Group-4 in Table~\ref{tab:cases}.} \label{fig:group4} \end{figure} \vspace{-0.1in} \noindent{\bf Group-4:} {\bf Hypothesis:} Would gender and race affect the sentiment values computed by the SASs when there is a possibility of confounding effect? \\ {\bf Experimental Setup:} We consider a composite case in which we create a new attribute called \emph{RG} by combining both race and gender into one single attribute as shown in Figure \ref{fig:group4}. For example, one combination would be an European male. A total of 5 such combinations are possible by combining different races and genders: European male, European female, African-American male, African-American female and Unknown (race and gender). If \emph{RG} affects the way emotion words are generated, a causal link would be formed from \emph{RG} to \emph{Emotion Word}. Out of several possible cases, we choose one in which 90\% of the sentences containing European male variable are associated with positive emotion words and the rest with negative emotion words. Vice-versa for African-American female. Equal number of positive and negative emotion words are associated with all other RG combinations. The choice of the case depends on the socio-technical context to be studied; our experimental setting is motivated by the results from literature for face detection algorithms where error rates for African-American females were found to be disproportionately higher than that for European males (\cite{gender-shades-image}). In our text setting, we consider whether such group bias exists. The authors want to emphasize that they do not endorse any form of bias in society or systemic errors in AI algorithms. In fact, that is the reason to test and rate AI systems. Our method would work for any gender or race combination to be evaluated. The results from this experiment (when the output sentiments are discretized) are shown in Table \ref{tab:g4} and (when the output sentiments are not discretized) in Table 9 in the supplementary. \begin{table} \centering {\tiny \begin{tabular}{|p{2em}|p{3em}|p{6em}|p{6em}|p{5em}|p{3.5em}|} \hline {\bf SAS} & {\bf E.words} & {\bf E[\emph{Sentiment $|$ Emotion Word}]} & {\bf E[\emph{Sentiment $|$ do(Emotion Word)}]} & {\bf DIE \%} & {\bf MAX(DIE \%)} \\ \hline $S_b$ & E3 & (-0.16,-0.50) & (-0.08,-0.08) & (50,84)& 84 \\ \hline & E4 & (-0.20,-0.55) & (-0.10,0.03) & (50,105.4) & 105.4 \\ \hline & E5 & (0.11,-0.60) & (0.03,-0.11) & (72.72,74.24) & 74.24 \\ \hline $S_r^\dagger$ & E3 & (0.82,0.54) & (0.87,0.50) & (6.09,7.40) & 7.40$^*$ \\ \hline & E4 & (0.44,0.40) & (0.44,0.42) & (0,5) & 5 \\ \hline & E5 & (0.55,0.40) & (0.58,0.38) & (5.45,5) & 5.45 \\ \hline $S_t^\dagger$ & E3 & (0,1) & (0,1) & (0,0) & 0 \\ \hline & E4 & (0,1) & (0,1) & (0,0) & 0 \\ \hline & E5 & (0,1) & (0,1) & (0,0) & 0 \\ \hline $S_d^\dagger$ & E3 & (0,1) & (0,1) & (0,0) & 0 \\ \hline & E4 & (0,1) & (0,1) & (0,0) & 0 \\ \hline & E5 & (0,1) & (0,1) & (0,0) & 0 \\ \hline $S_g^\dagger$ & E3 & (0,0.38) & (0,0.37) & (0,2.63) & 2.63 \\ \hline & E4 & (0.11,0.33) & (0.09,0.35) & (18.18,6.06) & 18.18$^*$ \\ \hline & E5 & (0,0.27) & (0.03,0.25) & (X,7.40) & X$^*$ \\ \hline \end{tabular} \caption{E[Sentiment $|$ Emotion Word] and E[Sentiment $|$ do(Emotion Word)] values for Group 4 datasets (when output sentiment is discretized) and the DIE \% when emotion word sets, E3, E4 and E5 are considered. We then compute the MAX() from the DIE \%.} \label{tab:g4} } \end{table} \begin{table} \centering {\tiny \begin{tabular}{|l|l|l|l|l|l|l|l|} \hline & \bf{G1} & \bf{G2} & \bf{G3\_R} & \bf{G3\_G} & \bf{G3\_RG} & \bf{G4} & \bf{Overall} \\ \hline ${\bf S_b}$ & 3 & 3 & 3 & 3 & 3 & 3 & 3\\ \hline ${\bf S_r^\dagger}$ & 2 & 2 & 2 & 2 & 2 & 2 & 2 \\ \hline ${\bf S_t^\dagger}$ & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ \hline ${\bf S_d^\dagger}$ & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ \hline ${\bf S_g^\dagger}$ & 2 & 3 & 2 & 2 & 1 & 3 & 2 \\ \hline \end{tabular} } \caption{Rating of SASs at the level of data groups (fine-grained) and overall rating for each of the SASs when the output sentiment is discretized and $L$=3. The first column represents different SASs and the first row represents different groups. $S_t^\dagger$ and $S_d^\dagger$ are least biased.} \label{tab:sas-rating} \end{table} \vspace{-0.1in} \begin{table} \centering {\tiny \begin{tabular}{|l|l|l|l|l|l|l|l|} \hline & \bf{G1} & \bf{G2} & \bf{G3\_R} & \bf{G3\_G} & \bf{G3\_RG} & \bf{G4} & \bf{Overall} \\ \hline ${\bf S_b}$ & 3 & 3 & 3 & 3 & 3 & 3 & 3\\ \hline ${\bf S_r}$ & 2 & 1 & 2 & 2 & 2 & 1 & 2 \\ \hline ${\bf S_t}$ & 1 & 2 & 1 & 1 & 1 & 2 & 1 \\ \hline ${\bf S_d}$ & 1 & 2 & 1 & 1 & 1 & 2 & 1 \\ \hline ${\bf S_g}$ & 2 & 1 & 1 & 1 & 1 & 1 & 1 \\ \hline \end{tabular} \caption{Rating of SASs at the level of data groups (fine-grained) and overall rating for each of the SASs when original output sentiments are used (not discretized) and $L$=3. The first column represents different SASs and the first row represents different groups. $S_t$, $S_g$ and $S_d$ are least biased.} \label{tab:sas-rating-cont} } \end{table} \subsection{Interpretation of Ratings} Table \ref{tab:sas-rating} and Table \ref{tab:sas-rating-cont} shows the rating results for each SAS when the output sentiments are discretized and not discretized, respectively. The tables show fine-grained rating for each group and the overall rating for the system. The chosen rating level, L$=$3. G1 denotes Group-1, G2 denotes Group-2, and so on. The two variations of G3, G3\_G, and G3\_R represent the individual cases when only gender and only race are considered, respectively, for computing t-values. G3\_RG represents the composite case. Ratings given to these groups are fine-grained ratings. For example, if the user only wants to know how biased the system is when the emotion word distribution does not depend on protected attributes, then they can look at the results of G1 and G3. The overall rating in the table is the average of all the individual ratings. $S_b$ is the most biased one in any case. If the bias rating for Group-1 and Group-2 is higher than that of Group-3 and Group-4 for any system, then gender bias is said to be more prominent than racial bias and vice-versa. Table \ref{tab:op} and Table \ref{tab:op-cont} show the final results from the rating algorithms described in the solution approach section. From these tables, we can say that the $\psi$ value of $S_b$ is the highest for Group-2 than any other group indicating a high gender bias. Further, we note that rating of $S_g^\dagger$ is 1 (compared to its peers) while $S_g$ is 2 (compared to its peers, the non-discretized versions as appropriate). We note that by discretizing, $S_g$ is becoming more biased, and our rating method is able to detect this phenomenon. The rating of other SASs do not change. \subsection{Comparison with Propensity Score Methods} Propensity score methods (\cite{austin2011introduction}), (\cite{prop-score}) allow one to design an observational study which mimics the characteristics of a Randomized Controlled Trial (RCT). In the context of SASs, the propensity score is the probability of receiving a treatment (associated emotion word), given the other independent attributes (gender, race). In other words, propensity scores are an alternative method to calculate the effect of receiving a treatment when random assignment of treatments to subject is not possible. The propensity score of the treated (if the associated emotion word is positive) and untreated groups (if the associated emotion word is negative) are matched to remove the effect of confounding effect and Average Treatment Effect (ATE) is computed to compare the treated and untreated. For example, in Table \ref{tab:cases}, consider the emotion word set, {Grim, Depressing, Happy}. The sentences with the former two emotion words can be considered as untreated group and the sentences with the emotion word, happy can be considered as the treated group. ATE computes the difference between the outcomes of the treated and untreated groups. However, when computing DIE \% we calculate the expectation of distribution, (Sentiment $|$ Emotion Word) before and after deconfounding using the do-operator. This would help us in testing the hypotheses stated in the Section 4.1 above. The following formula of ATE makes the argument more clear: {\tiny \begin{equation} \begin{split} ATE = E[Sentiment(EW=1)] - E[Sentiment(EW=0)] \end{split} \label{eq:ate} \end{equation} } Sentiment(EW=1) is the outcome when emotion word is positive and Sentiment(EW=0) is the outcome when emotion word is negative. ATE can be used along with DIE to compute the rating as our rating is agnostic to the raw score used. The way we compute raw scores solely depend on the hypotheses we want to test. \section{Introduction} As Artificial Intelligence (AI) systems are used for routine decision support and get manifested in online services, devices, robots and application programming interfaces for further reuse, bias exhibited by them creates a major hurdle for large-scale adoption. Gender and race are common forms of bias studied in AI (\cite{bias-survey}) but other prominent ones are based on religion, region and (dis)ability. Bias has been reported with AI services that process text (\cite{prob-bias-text,sentiment-bias}), audio (\cite{prob-bias-sound}) and video (\cite{prob-bias-image}). In this paper, we focus on Sentiment Analysis Systems (SASs) that work on text. These Artificial Intelligence (AI) systems are built using a variety of techniques--lexicons, rules and learning, and are widely used in practice. For example, in (\cite{senti-bias-finance}), the authors review the usage of sentiment analysis in the finance industry spanning lexicon-based, machine learning, and deep-learning based approaches. They find that neural transformer and language model based methods are better than learning based models in terms of performance, which are better than finance-lexicon based methods. In (\cite{senticnet6}), the authors report state-of-the-art results using a method that combines symbolic and neural methods together for sentiment analysis. However, SASs have a problem of bias spanning different approaches which can hamper their large scale adoption. In (\cite{sentiment-bias}), the authors studied over two hundred sentiment systems and found widespread bias in terms of gender and race based on various inputs given to the systems. However, there is no widely used principled methodology on how to characterize the seemingly biased behavior of such systems - e.g., is the behavior widespread, or is it triggered by selective data? Is it across SASs types, or is it only for some types of SASs? Is it due to the learned model, or is it due to the data used for learning? We argue that answers to such questions will allow a user to make an informed selection about which SAS to choose from available SASs for a given application. Furthermore, such systems are often used in business applications in conjunction with other AI systems like machine translators, which too may have bias. So, how to characterize the behavior of such composite systems is still an open problem. In this regard, a well-established practice to communicate behavior of a piece of technology to users and build trust is by {\em Transparency via Documentation} (\cite{about-ml}) which increases transparency as it would help users to decide the extent to which they could trust an AI system based on the data at hand. For AI, a novel attempt in this direction is in the context of automated machine translators for gender bias from a perspective independent from the service provider or consumer (hence, also called third-party) (\cite{trans-rating-jour,trans-rating}). In this paper, we introduce a novel method to assess and rate SASs where inputs are first perturbed in a controlled causal setting to test if the output sentiment is sensitive to protected attributes or other components of the textual input, e.g., chosen emotion words. Then, we use the result to assign labels (ratings) at fine-grained and overall levels to convey the robustness of the SASs to input changes. The ratings serve as a principled basis to compare SASs and choose among them based on behavior. The primary stakeholders for SASs are businesses. Customer service would benefit from knowing the sentiment of customer feedback. Sentiment analysis would help a company understand how stakeholders feel about a new product or a service launched by the company (\cite{clarity2}). There are numerous stakeholders for sentiment analysis who would benefit from these ratings. It also benefits developers who reuse off-the-shelf SASs to build larger AI systems but do not have access to their code or training data to compare otherwise. Our contributions are that we: (a) introduce the idea of rating SASs for bias, (b) use a causal interpretation of rating rather than an arbitrary label, (c) produce a statistically interpretable rating which can be further interpreted for group bias, (d) introduce a new metric, {\em Deconfounded Impact Estimation (DIE)}, to measure the discrepancy between the confounded and deconfounded distributions, (e) release open-source implementations of SASs - two deep-learning based (GRU-based ($S_g$) and DistilBERT-based ($S_d$)) and two custom-built models (Biased female ($S_b$) and Random SAS ($S_r$)). We will release our code upon publication of this work. In the remainder of the paper, we start with the background on bias in NLP services and a method for rating AI services for bias. We then introduce our setting consisting of the proposed causal model, datasets and sentiment systems. We present our solution and a case-study for empirical evaluation. Finally, we conclude with a discussion. The supplementary material contains additional related work, experiments and results. \subsubsection*{\bibname}} \bibliographystyle{apalike} \usepackage{algorithm2e} \RestyleAlgo{ruled} \usepackage{xcolor} \usepackage{mathtools} \newcommand{\biplav}[1]{{\color{violet}~{\em Comment by Biplav: #1}}} \usepackage{color} \newcommand{\kl}[1]{{\color{red}~{\em Comment by Kausik: #1}}} \usepackage{color} \newcommand{\marco}[1]{{\color{blue}~{\em Comment by Marco: #1}}} \usepackage{array} \usepackage{lscape} \usepackage{amsmath} \usepackage{amssymb} \usepackage{tcolorbox} \usepackage[round]{natbib} \renewcommand{\bibname}{References} \renewcommand{\bibsection}{\subsubsection*{\bibname}} \begin{document} \twocolumn[ \aistatstitle{Rating Sentiment Analysis Systems for Bias through a Causal Lens} \aistatsauthor{ Kausik Lakkaraju \And Biplav Srivastava \And Marco Valtorta } \aistatsaddress{ University of South Carolina \And University of South Carolina \And University of South Carolina} ] \begin{abstract} Sentiment Analysis Systems (SASs) are data-driven Artificial Intelligence (AI) systems that, given a piece of text, assign one or more numbers conveying the polarity and emotional intensity expressed in the input. Like other automatic machine learning systems, they have also been known to exhibit model uncertainty where a (small) change in the input leads to drastic swings in the output. This can be especially problematic when inputs are related to protected features like gender or race since such behavior can be perceived as a lack of fairness, i.e., bias. We introduce a novel method to assess and rate SASs where inputs are perturbed in a controlled causal setting to test if the output sentiment is sensitive to protected variables even when other components of the textual input, e.g., chosen emotion words, are fixed. We then use the result to assign labels (ratings) at fine-grained and overall levels to convey the robustness of the SAS to input changes. The ratings serve as a principled basis to compare SASs and choose among them based on behavior. It benefits all users, especially developers who reuse off-the-shelf SASs to build larger AI systems but do not have access to their code or training data to compare. \end{abstract} \input{introduction} \input{background} \input{approach} \input{experiments} \input{discussion} \input{conclusion} \subsubsection*{\bibname}} \onecolumn \aistatstitle{Supplementary Material for \\ `Rating Sentiment Analysis Systems for Bias through a Causal Lens'} In this supplementary material, we provide additional information about related work, experiments and results to help better understand our work in detail. The material is organized as follows:
\section{Introduction} \begin{figure}[t!] \centering \includegraphics[width=0.4\textwidth]{Figures/regression.pdf} \caption{Illustration of regression errors when upgrading from BERT \citep{devlin-etal-2019-bert} to ELECTRA \citep{Clark2020ELECTRA:} for classification. Red circles and green squares denote examples of different classes. Dashed lines represent decision boundaries. } \label{fig:regression} \end{figure} In order to achieve a smooth continuous improvement of NLP applications, it is critical to guarantee consistent operation of the system after an upgrade. New errors introduced during the model upgrade interfere with the existing user experience and are considered to be a \emph{regression} in the quality. Due to the difficulty of modularizing or explaining the behavior of deep neural networks, traditional software regression tests are inapplicable to neural based systems. The cost of arduous error analysis and model patching often exceeds the benefits of model upgrades. Developing methods that ensure backward compatibility during model upgrades without compromise in performance becomes a valuable research direction \citep{yan2021positive,work-in-progress,trauble2021backward,cai2022measuring}. The \textit{prediction backward-compatible model upgrade} problem aims to improve consistency of correct classification predictions between legacy and upgraded models without accuracy loss. \citet{yan2021positive} first studied backward compatibility during model upgrade on image classification tasks. They proposed to enforce the positive congruence of the new model with the old one by applying a knowledge distillation objective \citep{Hinton2015DistillingTK} objective with re-weighting of training samples. Later, \citet{work-in-progress} extended the work of \citet{yan2021positive} by investigating the backward compatibility in NLP classification tasks. They found that their proposed distillation-based approach can help decrease the regression errors of specific linguistic phenomena in NLP classification tasks. Despite progress with both distillation- and ensemble-based regression-mitigation approaches, there are limitations that prevent them from broad practical adoption in ML operations. Distillation-based methods attempt to transfer the prediction power of the old model to the new one on potential regression instances \citep{Hinton2015DistillingTK}. However, given the huge complexity of current neural architectures and relatively scarce training data in downstream tasks, models could have insufficient data to reliably estimate the probable regression cases and carry out the transfer on them \citep{work-in-progress,cai2022measuring}. On the other hand, model ensemble aggregates predictions from differently-trained new models but bears no connection with the legacy version \citep{yan2021positive}. These limitations reveal the two major challenges when striving to ensure backward compatibility. First, the new model could have distinct inductive bias and prediction behavior than the old system, rooted from inherent differences such as architecture, model size, and pretraining procedure \citep{liu2021self}. Second, during new model training, a reliable mechanism is needed in place to bridge the gap between two models and mitigate potential inconsistencies. Inspired by the strength and weakness of prior approaches, we propose \emph{Gated Fusion} to integrate old and new models via gating mechanism \citep{hochreiter1997long,chung2014empirical,gu2016incorporating}, essentially a light-weight ensemble of legacy and upgrade models connected via a learned fusion gate. Specifically, we add a \textit{learned} gate on top of the new model. We combine the logits from old and new models according to the weight from the gate. We train our Gated Fusion model by minimizing the standard cross-entropy error. The intuition is that the gate could learn to put more weights on the old model when the new model cannot produce correct predictions, effectively doing fall-backs that optimizes backward compatibility. Empirical results demonstrate that our proposed approach outperforms other competing methods significantly, where we can obtain on average $62\%$ reduction of total negative flips, i.e. new errors caused by the model upgrade, without any degradation in accuracy performance. The effectiveness of Gated Fusion is validated across three diverse classification tasks and two distinct model upgrade scenarios (a) upgrade to larger model size (b) upgrade to advanced pretrained model, where consistent results are attained across the board. Our main contributions are as follows: \begin{itemize}[itemsep=4pt,topsep=4pt,parsep=0pt,partopsep=0pt] \item We propose Gated Fusion that integrates old and new models via gating mechanism for backward-compatible model upgrade; \item We evaluate competing methods on two distinct and challenging model upgrade scenarios across three diverse classification tasks; \item Empirical results show that our proposed approach significantly outperforms competing methods and achieves regression reductions by a large margin across the board. \end{itemize} \section{The Backward-Compatible Model Upgrade Problem} \begin{figure*}[t!] \centering \includegraphics[width=0.9\textwidth]{Figures/method.pdf} \caption{Methods to improve prediction backward compatibility during model upgrade. (a) Distillation-based approach to align predicted logits on potential regression instances \citep{work-in-progress}. (b) Ensemble of old and new models via weighted sum of either predicted logits or probabilities. (c) Our proposed Gated Fusion that learns a gate as a soft switch to dynamically determine whether to fall back to previous predictions.} \label{fig:method} \end{figure*} The goal of backward-compatible model upgrade is to minimize regression errors without compromising the accuracy performance during model upgrade \citep{yan2021positive,work-in-progress}. In this work, we aim to improve the backward compatibility of model predictions in the NLP classification tasks. Following \citet{work-in-progress}, we study the scenario where the underlying pretrained language model (LM) is being upgraded. Let $x$ be a natural language input with a class label $y \in \{1, 2, ..., C\}$. $\mathcal{D}=\{x_i, y_i\}_{i=1}^{N}$ denotes a set of $N$ examples with corresponding labels. A classifier $f$ estimates the class probabilities given the input $\vec{f}(x) = (p(y=1|x), ..., p(y=C|x))^{\top}$. When upgrading from an \emph{old} model $f_{old}$ to a \emph{new} model $f_{new}$, normally with distinct architectures and trained on the same data, an improved model $f^{*}$ is produced based on $f_{old}$ and $f_{new}$. Our goal is for $f^{*}$ to minimize \emph{regression errors} as an additional objective, while still achieving comparable performance to $f^{o}_{new}$, the new model trained in the vanilla setting. Note that $f^{*}$ could be multiple times larger than $f^{o}_{new}$, with model ensemble of $f^{o}_{new}$ as one example \citep{yan2021positive}. \vspace{-0.05cm} \paragraph{Measuring Backward Compatibility.} The backward compatibility is measured via quantifying regression errors on a given regression measurement set $\mathcal{D}_{reg}=\{x_i, y_i\}_{i=1}^{M}$. $\mathcal{D}_{reg}$ could be a hidden customer test set comprising critical use cases, a set of behavioral testing examples for targeted evaluation \citep{ribeiro-etal-2020-beyond}, or the development split from the dataset of interest. In this work, we take the development set as our $\mathcal{D}_{reg}$ for evaluation. For classification, regression errors are characterized by \emph{negative flips}, denoted as $\mathcal{R}_{NF}$ -- the portion of samples in $\mathcal{D}_{reg}$ that flip from correct prediction $f_{old}(x_i)=y_i$ to incorrect output $f_{new}(x_i)\neq y_i$ during model upgrade: \begingroup\makeatletter\def\f@size{10}\check@mathfonts \begin{equation} \mathcal{R}_{NF}(\mathcal{D}_{reg}, \vec{f}_{old}, \vec{f}_{new}) =\frac{|\{x|f_{old}=y, f_{new}\neq y\}|} {|\mathcal{D}_{reg}|}. \end{equation} \endgroup One thing to emphasize is that maximizing classifier performance does not necessarily help in minimizing $\mathcal{R}_{NF}$\xspace\citep{yan2021positive,work-in-progress}. \section{Gated Fusion: Methodology} \subsection{Method Overview} \label{model} To improve backward compatibility in model upgrade, it's crucial to have a mechanism that detects potential regression errors and mitigates them when making predictions. We propose Gated Fusion (GF) to achieve this by learning a gate as a soft switch to choose between generating predictions by the new model or resorting to outputs of the old model. Gated Fusion is inspired by the gating mechanism widely used in other applications. For example, mixing word copying mode with word generation mode for language modeling \citep{merity2016pointer} and summarization \citep{see2017get}. Our proposed Gated Fusion $f^{*}_{GF}$ consists of the old model $f_{old}$, the new model $f_{new}$, and a gating network $g_{\theta}$. The old model $f_{old}$ is the legacy version before upgrade where the parameters are fixed. The new model $f_{new}$ has the same architecture as $f^{o}_{new}$ and is randomly initialized. The gating network $g_{\theta}$ is a multi-layer feed-forward network with sigmoid function. It produces a scalar weight $\alpha_{gate}$ in the range $[0, 1]$ from the output layer of $f_{new}$, denoted as $\mathcal{E}_{new}$: \begingroup\makeatletter\def\f@size{10}\check@mathfonts \begin{equation} \alpha_{gate}(x) = g_{\theta}(\mathcal{E}_{new}(x)). \end{equation} \endgroup \noindent We use $\alpha_{gate}$ to combine the logits of old and new models as our final outputs: \begingroup\makeatletter\def\f@size{10}\check@mathfonts \begin{equation} l^{*}_{GF}(y|x) = ( 1-\alpha_{gate}) \cdot \frac{l_{old}(y|x)}{T} + \alpha_{gate} \cdot l_{new}(y|x), \end{equation} \endgroup where $l(y|x)$ denotes predicted logits from models and $T$ is the temperature scaling to regularize the magnitude of old model's logits. $f_{new}$ and $g_{\theta}$ are then jointly trained end-to-end with cross-entropy loss between our output logits $l^{*}_{GF}(y|x)$ and label distributions on downstream tasks. The intuition behind Gated Fusion is that when $f_{new}$ makes a mistake while $f_{old}$ produces the correct output, the gate $g_{\theta}$ will learn to put more weight on $f_{old}$ in order to minimize the final classification loss. This process effectively mitigates potential negative flips introduced by the model upgrade and thus improves the backward compatibility of final predictions. \subsection{Training and Inference} In practice, training Gated Fusion with randomly initialized $f_{new}$ would make the shallow gating network quickly converge to favor the fully-trained $f_{old}$. To prevent this, we only train $f_{new}$ for the first few epochs to ensure its competence before jointly training $g_{\theta}$ and $f_{new}$ using $l^{*}_{GF}(x)$. In addition, we found that stopping gradient flow from $g_{\theta}$ to $f_{new}$ can further prevent the performance decrease of the new model within Gated Fusion: \begingroup\makeatletter\def\f@size{10}\check@mathfonts \begin{equation} \alpha_{gate}(x) = g_{\theta}(\mathit{stop\_grad}(\mathcal{E}_{new}(x))). \end{equation} \endgroup At inference time, Gated Fusion produces logits from $f_{old}$ and $f_{new}$ as well as the gate value $\alpha_{gate}$ to make output predictions: \begingroup\makeatletter\def\f@size{10}\check@mathfonts \begin{equation} f^{*}_{GF}(x) = \mathit{Softmax}\Big( (1-\alpha_{gate}) \cdot \frac{l_{old}}{T} + \alpha_{gate} \cdot l_{new}\Big). \end{equation} \endgroup \subsection{Inference with Cache}\label{cache} Our proposed Gated Fusion requires $f_{old}$ to be hosted together with the new model. In reality, one could have a resource-constrained setting and request the old model to be discarded at inference. We note that in real applications, repetitive inputs are commonly seen in live traffic \citep{batrinca2015social} and the backward compatibility of model upgrade entails that correct predictions can be preserved on the legacy instances already seen and predicted by the old model. To simulate real scenarios, we randomly cache old model's logits on a portion of test inputs. When getting out-of-cache instances, we use new model's output embedding $\mathcal{E}_{new}(x)$ as key and euclidean distance as metric to search for the nearest cached instance. The cached old-model logits can then be used for Gated Fusion to make predictions without hosting $f_{old}$ at inference. \section{Experiments Setup} \subsection{Model Upgrade Scenarios} We conduct experiments on two representative model upgrade scenarios: (a) upgrade to a larger pretrained model of the same type, where we use \emph{\bert{base} to \bert{large}}. (b) upgrade to a distinct pretrained model with the same size. We use \emph{\bert{base} to \electra{base}} \citep{Clark2020ELECTRA:} as this challenging model upgrade scenario for backward-compatibility, as they are pretrained under different self-supervised learning paradigms. The former uses masked language modeling (MLM) with reconstruction loss, while the latter is pretrained in generative-contrastive (adversarial) fashion with distributional divergence as the loss \citep{liu2021self}. \subsection{Datasets and Implementation} We evaluate our approach across three datasets. They represent different sentence-level classification tasks, from single-sentence to sentence-pair classification, with varying dataset sizes. We use: (a) Stanford Sentiment Treebank (SST-2), a single-sentence task to classify movie review sentiment, with $67$k train and $0.9$k dev set \citep{socher2013recursive}. (b) Microsoft Research Paraphrase Corpus (MRPC) \citep{dolan2005automatically}, a sentence-pair classification task for identifying paraphrases, with $3.7$k train and $0.4$k dev set. (c) Question Natural Language Inference (QNLI), a question-paragraph pair task to determine whether the paragraph contains the answer to the question, with $100$k train and $5.5$k dev set. Datasets are taken from GLUE Benchmark \citep{wang2018glue} and processed with scripts from Hugging Face\footnote{\scriptsize \url{https://huggingface.co/datasets/glue}}. For implementation, we use the sequence classification and pre-trained model parameters from Hugging Face Transformers\footnote{\scriptsize \url{https://huggingface.co/docs/transformers/index}}. Experiments are done in PyTorch \citep{NEURIPS2019_9015} with Tesla V100 GPUs and results are averaged over $5$ random seeds. Learning rate, batch size, and train epoch are tuned during training new model alone on given tasks and then fixed for all backward-compatible solutions. In Gated Fusion, we first train $f_{new}$ alone for first $(N - 1)$ epochs and then jointly train $g_{\theta}$ and $f_{new}$ with Gated Fusion logits $l^{*}_{GF}$ in the last epoch. Further implementation details can be found in the Appendix. \subsection{Baselines} We compare our approach with several strong baselines. (a) Train the new model directly on the target task without any adjustment, i.e. $f^{o}_{new}$. (b) The specialized distillation method proposed in \citet{work-in-progress}, where the KL-divergence of prediction probabilities between old and new models is applied when $p_{old}(y=y_i|x_i) > p_{new}(y=y_i|x_i)$. (c) Model ensemble via majority-voting that was shown to be very effective \citep{yan2021positive,work-in-progress}. Similarly, we use $5$-seed new model ensemble as a strong baseline. (d) The ensemble of the old and new models probabilities, $p^{*}(y|x)=(1-\alpha) \cdot p_{old}(y|x) + \alpha \cdot p_{new}(y|x)$, as well as ensemble of the old and new models logits, $l^{*}(y|x)=(1-\alpha) \cdot l_{old}(y|x) + \alpha \cdot l_{new}(y|x)$, where $\alpha$ is searched among $[0.5, 0.6, 0.7, 0.8, 0.9]$ to maximize backward-compatibility while achieving accuracy on par with the vanilla $f^{o}_{new}$. \section{Results and Analysis} \input{Tables/table1_largeresults} \input{Tables/table2_electraresults} \subsection{Upgrade to a Larger Pretrained Model} Our first model upgrade scenario scales up the size of underlying pretrained language models. We experiment with \bert{base} to \bert{large}, where the model size is tripled (110M vs 340M) and the model depth is doubled (12 vs 24 layers). Table \ref{tab:bertlarge_main} shows the results. For $f^{o}_{new}$, we can observe that the negative flip rates $\mathcal{R}_{NF}$\xspace are usually much larger than the accuracy gains across tasks, which could be the reason to hinder new model adoptions in real-world applications. Besides, when dividing $\mathcal{R}_{NF}$\xspace over the error rate $(1 - \textit{accuracy})$, we can observe that around $30\%$ to $40\%$ of all $f^{o}_{new}$ prediction errors are in fact the \emph{new} errors introduced during model upgrade. \iffalse This is a significant amount of portion as the error rate is the mathematical upper bound of $\mathcal{R}_{NF}$\xspace.\fi For improving prediction backward-compatibility, our proposed Gated Fusion outperforms other competing methods to considerably reduce $\mathcal{R}_{NF}$\xspace without degradation on accuracy. Note that best $\alpha$ values found for the two variants of old-new ensemble are both $0.5$, hence producing identical results. Compared to the vanilla new model, gated fusion obtains absolute $\mathcal{R}_{NF}$\xspace reductions of \textminus$1.40\%$ on SST-2, \textminus$2.94\%$ on MRPC, and \textminus$1.99\%$ on QNLI. These translate to reducing the total negative flip cases by $64.2\%$, $71.4\%$, $73.2\%$, respectively. Compared to the strongest baseline (old-new ensemble), we obtain further absolute $\mathcal{R}_{NF}$\xspace reductions of \textminus$0.28\%$ on SST-2, \textminus$0.49\%$ on MRPC, and \textminus$0.31\%$ on QNLI, which translate to further reducing $12.8\%$, $11.9\%$, and $11.4\%$ of negative flip cases. These results show the effectiveness of our method to mitigate a significant amount of regression errors during model upgrade. \input{Tables/table5_ensemble} \vspace{-0.03cm} \subsection{Upgrade to a Different Pretrained Model} \vspace{-0.03cm} A more challenging upgrade scenario is when old and new models are pretrained under distinctive paradigms, producing two representation spaces of fairly different characteristics \citep{meng2021coco}. We experiment with \bert{base} to \electra{base} in this scenario, where two models have the same size but are pretrained under utterly different schemes, i.e. generative versus adversarial. Table \ref{tab:electra_main} shows the results. For $f^{o}_{new}$, compared with upgrading to \bert{large}, we observe larger accuracy gains and lower $\mathcal{R}_{NF}$\xspace on SST-2 and MRPC. However, on QNLI, upgrading to \electra{base} achieves a higher accuracy gain but an even a higher $\mathcal{R}_{NF}$\xspace. This implies that boosting accuracy and improving backward compatibility could be two related but different objectives. For mitigation strategies, Gated Fusion achieves the lowest negative flip rates across datasets without any accuracy loss. We obtain absolute $\mathcal{R}_{NF}$\xspace reductions of \textminus$0.92\%$ on SST-2, \textminus$1.33\%$ on MRPC, and \textminus$2.01\%$ on QNLI over the vanilla setup, reducing $56.4\%$, $35.7\%$, and $71.3\%$ of overall negative flips, respectively. Compared with upgrading to \bert{large}, we observe that upgrading to \electra{base} has much smaller relative negative flip reductions on SST-2 and MRPC, showing that it could be indeed harder to improve backward-compatibility when upgrading to a distinct pretrained model. In contrast, similar relative negative flip reductions are observed on QNLI across two upgrade scenarios. This could be attributed to the abundant training data of the downstream task. \input{Tables/table3_newalone} \input{Tables/table4_cache} \subsection{Drop Old Model at Inference Time} Our proposed method requires the old model to be hosted together with the new model. A natural question is whether we could train Gated Fusion with the old model and then discard it at inference time to host the new model only. We first experiment with directly dropping the old model within Gated Fusion at inference time. Results in Table \ref{tab:newalone} show that dropping old model in Gated Fusion can still achieve comparable accuracy across the board, suggesting no performance degradation. Nonetheless, we observe that the negative flip rates also fall back to similar positions as training the new model in the vanilla setting. However, in real application scenario, live inputs are often repetitively seen across time and ensuring backward-compatibility means that correct predictions on same instances can be preserved after model upgrade. We experiment with the caching method introduced in section \ref{cache} to store old model's logits on random $X\%$ of test instances where Gated Fusion can later access them for inference. Results in Table \ref{tab:cache} show that with higher percentage of cache, $\mathcal{R}_{NF}$\xspace is gradually reduced towards $\mathcal{R}_{NF}$\xspace of the original Gated Fusion, which is equivalent to $100\%$ cache. Still, we observe a notable gap in $\mathcal{R}_{NF}$\xspace between the partial caching and full settings. We leave the examination of ways to achieve the upper bound in reduction in $\mathcal{R}_{NF}$\xspace with smaller cache to the future work. \input{Tables/table6_examples} \subsection{Limitations of New Model Ensemble} In previous works \citep{yan2021positive,work-in-progress}, new model ensemble via majority voting is shown to effectively reduce negative flips and posed as a difficult-to-beat baseline. Here, we increase the number of models in ensemble to examine its limitations. Results in Table \ref{tab:ensemble} show that ensemble with more models generally help to obtain lower $\mathcal{R}_{NF}$\xspace. However, $\mathcal{R}_{NF}$\xspace converges quickly as number of models increased, where a notable gap remains between new model ensemble and Gated Fusion. Moreover, the results show once more that boosting accuracy does not necessarily improve the backward compatibility in model upgrade. In principle, two sources could cause negative flips during model upgrade (a) the stochasticity during model training, including initializations, data loading order, and optimization process \citep{somepalli2022can}. (b) the distinctions between old and new model hypotheses, including architecture and pretraining data and procedure, leading to different representation space structures and prediction behaviors in terms of decision boundaries. Without an explicit connection to $f_{old}$, new model ensemble can only reduce negative flips primarily caused by the first factor, while our proposed Gated Fusion directly learns to mitigate regression errors regardless of their causes. Besides, as large-scale generative models become more and more powerful and popular \citep{raffel2020exploring,brown2020language,su2021multi}, it would be difficult to fine-tune them multiple times on a target task for ensemble. \subsection{Analysis of Gated Fusion} Comparing $f^{o}_{new}$ with $f^{*}_{GF}$, we can calculate the \textit{fix rate} and \textit{new fault rate} of our Gated Fusion method. During an upgrade, if there are $20$ negative flips with $f^{o}_{new}$ and $16$ out of them can be mitigated by $f^{*}_{GF}$, we obtain the fix rate to be $16/20=80\%$. Similarly, if $f^{*}_{GF}$ introduces another $4$ new negative flips which are not present with $f^{o}_{new}$, the new fault rate is computed to be $4/20=20\%$. We calculate the $5$-seed average of these two rates across different classification tasks and upgrade scenarios. In \bert{base} to \bert{large}, the averaged fix rates by Gated Fusion are $68.4\%$ on SST-2, $83.8\%$ on MRPC, and $82.9\%$ on QNLI, with new fault rates being $4.1\%$ on SST-2, $11.3\%$ on MRPC, and $9.7\%$ on QNLI. In \bert{base} to \electra{base}, Gated Fusion achieves the averaged fix rates $58.0\%$ on SST-2, $50.8\%$ on MRPC, and $75.6\%$ on QNLI, with new fault rates being $2.8\%$ on SST-2, $15.2\%$ on MRPC, and $4.0\%$ on QNLI. These results show that, on average, Gated Fusion is able to eliminate $69.9\%$ of total regression errors while adding only $7.9\%$ new ones, comparing with doing model upgrade without any treatment, i.e. $f^{o}_{new}$. Table \ref{tab:examples} shows a few regression error cases fixed by our proposed approach. In general, Gated Fusion can mitigate negative flips happened on different classes across diverse tasks as well as on inputs with variable lengths. With closer inspections of $f^{*}_{GF}$, we found that when $f_{new}$ produces incorrect predictions and $f_{old}$ gives correct outputs, $g_\theta$ is capable of putting larger weights on $f_{old}$ to ensure the backward compatibility. We also observed that the gate $g_{\theta}$ is more prone to over-fitting when the downstream tasks have smaller training set, e.g. MRPC, or are more difficult in nature, e.g. single-sentence task SST-2 versus sentence-pair tasks, which causes Gated Fusion to introduce more new errors, i.e. higher new fault rates. \section{Discussion} Gated Fusion requires to host both old and new models at inference time, which could raise a concern regarding the increased computational burden. However, in practice, old model’s logits of previous inference instances can be cached in storage and later leveraged in our Gated Fusion. That is, we only need to host the new model with the gate at inference time and leverage old predictions from cache. And for the out-of-cache inputs, backward-compatibility would be less of an issue since users have not observed such examples to make conclusions on the underlying regression. For real-world applications, there could be multiple model updates and thus multiple legacy versions. We note that in this scenario, user experience would be primarily grounded on predictions of the latest legacy version, which are also saved in cache. Our Gated Fusion can hence leverage them and make new model’s predictions compatible to those from the latest legacy version. In addition, we emphasize that the main challenge in the regression reduction research problem is to find the best trade-off between model effectiveness and backward compatibility. In this work, we show that the weighted ensemble of old-new models with a learned gate, which we call Gated Fusion, achieves a better negative flip rate than previously explored methods for regression reduction, while straight-forward ensemble approaches cannot naturally weigh on this trade-off. We don’t claim to invent the gated ensemble of old and new models but rather that our main contribution is to show that by repurposing the classic gating mechanism, the gated ensemble can become the most competitive approach to the challenging model-upgrade regression reduction problem, with no overall performance degradation on two realistic model update scenarios across three different datasets. Recently, more and more NLP products have been deployed in the industry as this field matures. We would like to stress that as better NLP models are being developed, the backward-compatible model upgrade problem naturally emerges as the new research topic strongly motivated by the real-world challenges. While backward-compatibility is currently a niche research topic, we believe that there are many thrilling future directions worth to be investigated. \section{Related Work} \citet{yan2021positive} first studied the backward compatibility of predictions during model upgrade on image classification tasks. Later, \citet{work-in-progress} investigated the similar topic in natural language understanding and formulated it as a constrained optimization problem. They both show that customized variants of knowledge distillation \citep{Hinton2015DistillingTK}, which align the predictions of old and new models on potential regression errors, are effective approaches. A model ensemble has also shown to be surprisingly effective \citep{yan2021positive,work-in-progress}, despite no explicit connection between old and new models. This was credited to variance reduction in model predictions, making it less prone to over-fitting and reducing regression errors indirectly. In this work, we leverage the gating mechanism to combine old and new models to further reduce model upgrade regression errors by a large margin across classification tasks. \citet{cai2022measuring} analyzed and proposed backward congruent re-ranking to reduce regression in model upgrades for structured predictions tasks such as dependency parsing and conversational semantic parsing. \citet{trauble2021backward} proposed an efficient probabilistic approach to locate data instances whose old predictions could be incorrect and update them with ones from the new model. \citet{zhou2022forward} looked into forward compatibility, where new classes can be easily incorporated without negatively impacting existing prediction behavior. More recently, \citet{schumann2023backward} inspected classification model regression during training data updates and mitigated the problem by interpolating between weights of the old and new models. On top of that, learning cross-model compatible embeddings has been extensively explored in visual search \citep{chen2019r3,hu2019towards,wang2020unified}. Several techniques have been proposed to optimize cross-model interoperability of embeddings, including metric space alignment \citep{Shen2020TowardsBR}, architecture search \citep{duggalcompatibility}, and aligning class centers between models \citet{meng2021learning}. In this work, we focus on improving backward compatibility during model upgrade in terms of prediction behavior on classification tasks, i.e. old and new models should produce consistently correct predictions. Reducing regression during model upgrade is also related to continual learning \citep{parisi2019continual,de2019continual,sun2019lamol,chuang2020lifelong,sachidananda2021efficient}, incremental learning \citep{chaudhry2018riemannian,shan2020learn} and concept drifting \citep{gama2014survey,vzliobaite2016overview,ganin2016domain,zhuang2020comprehensive,lazaridou2021pitfalls}. In these problems, models are required to learn from and deal with continuously changing data (in terms of examples, classes or tasks), and also need to prevent the forgetting of previously learnt knowledge. This could be one potential cause of regression observed at inference. However, in backward-compatible model upgrade, a new model, usually with distinct network architecture, is trained from scratch to perform the same task and is expected to behave similarly wherever the previous model predicts correctly. The gating mechanism is widely adopted by recurrent neural networks to effectively control information flows across networks \citep{hochreiter1997long,cho2014properties,van2016pixel,dauphin2017language,lai2019goal} and contextualize embeddings \cite{peters2018deep,lai2020context}. It is then repurposed to act as a switch for the mixture of different prediction modes, notably to combine input word copying based on the pointer network \citep{vinyals2015pointer} with the word generation from output vocabulary \citep{gu2016incorporating,merity2016pointer,see2017get}. Our proposed approach is inspired by these works and leverages the gating mechanism to effectively combine old and new models to improve backward compatibility during model upgrade. \section{Details on Experiment Settings} \subsection{Model Training Hyper-parameters} We search among following hyper-parameter space for the training of the old model $f_{old}$ and the new model in the vanilla setting $f^{o}_{new}$ across all datasets: \begin{itemize}[itemsep=0pt,topsep=0pt,parsep=0pt,partopsep=0pt] \item Learning Rate: $5e^{-6}$, $1e^{-5}$, $3e^{-5}$, $5e^{-5}$ \item Batch Size: $16$, $32$ \item Training Epochs: $3$, $5$, $8$. \end{itemize} The selected hyper-parameters for each model with \textit{(learning rate, batch size, training epoch)}: \begin{itemize}[itemsep=0pt,topsep=0pt,parsep=0pt,partopsep=0pt] \item \bert{base}: \begin{itemize} \item On SST-2: $(\text{lr }1e^{-5}, \text{batch }16, \text{epoch } 5)$ \item On MRPC: $(\text{lr }3e^{-5}, \text{batch }16, \text{epoch } 5)$ \item On QNLI: $(\text{lr }3e^{-5}, \text{batch }32, \text{epoch } 3)$ \end{itemize} \item \bert{large}: \begin{itemize} \item On SST-2: $(\text{lr }1e^{-5}, \text{batch }16, \text{epoch } 5)$ \item On MRPC: $(\text{lr }3e^{-5}, \text{batch }16, \text{epoch } 5)$ \item On QNLI: $(\text{lr }3e^{-5}, \text{batch }32, \text{epoch } 3)$ \end{itemize} \item \electra{base}: \begin{itemize} \item On SST-2: $(\text{lr }1e^{-5}, \text{batch }16, \text{epoch } 5)$ \item On MRPC: $(\text{lr }5e^{-5}, \text{batch }32, \text{epoch } 5)$ \item On QNLI: $(\text{lr }3e^{-5}, \text{batch }32, \text{epoch } 3)$ \end{itemize} \end{itemize} These model training hyper-parameters for a specific model on one specific dataset is then fixed and reused for all the competing methods to improve backward compatibility during model upgrade. \subsection{Distillation Hyper-parameters} The knowledge distillation method from \citet{work-in-progress} imposed an additional loss $\lambda \cdot KL(l_{old} / T, l_{new} / T)$ on potential regression instances. We experimented the best possible hyper-parameters from the following: \begin{itemize}[itemsep=0pt,topsep=0pt,parsep=0pt,partopsep=0pt] \item $\lambda$: $0.1, 1.0, 10.0$ \item Temperature $T$: $0.5, 1.0, 2.0$ \end{itemize} \subsection{Details on Gated Fusion} We initialize the gate $g_{\theta}$ to be a two-layer feed-forward network with the architecture \textit{(Dropout, Linear, LayerNorm, ReLU, Dropout, Linear, Sigmoid)} and fix the hidden size to be $64$ across all our experiments. During the training of Gated Fusion, we only train the $f_{new}$ within $f^{*}_{GF}$ for the first $(N - 1)$ epochs to ensure its competence, where $N$ is the total training epochs. In the last training epoch, we jointly train $g_{\theta}$ and $f_{new}$ using the Gated Fusion logits $l^{*}_{GF}$ with the secondary learning rate $lr2$. To prevent the overfitting of the gate, we also apply \textit{drop\_gate} where at each training step during the last epoch, there is $D\%$ to only train $f_{new}$ within $f^{*}_{GF}$ and $(1 - D)\%$ to train with $l^{*}_{GF}$. The hyper-parameter space of Gated Fusion is listed as follows: \begin{itemize}[itemsep=0pt,topsep=0pt,parsep=0pt,partopsep=0pt] \item Drop Gate ($\%$): $40, 50, 60, 80$ \item Temperature $T$ on old logits: $1.0, 1.2, 1.4, 1.6$ \item lr2: $5e^{-7}$, $1e^{-6}$, $3e^{-6}$, $1e^{-5}$, $3e^{-5}$ \end{itemize} We found that to achieve good results, the gap in logit magnitude of $f_{old}$ and $f_{new}$ needs to be bridged by the temperature when upgrading from \bert{base} to \electra{base}, with $T$ being $1.6$ on SST-2, $1.6$ on MRPC, and $1.2$ on QNLI. On the other hand, $T=1$ gives good results across three datasets when upgrading from \bert{base} to \bert{large}. This could result from the distinct pretraining schemes between models where MLM seem to produce larger magnitude of output logits. \section{Conclusion} Ensuring backward compatibility during model upgrade has become a critical topic in real-world NLP applications. In this work, we proposed a new approach, \emph{Gated Fusion}, that achieves significantly better backward compatibility without compromising accuracy performance on two challenging upgrade scenarios for NLP classification. Experiments demonstrated that our approach outperforms competing methods and achieves negative flip rate reductions by up to $73.2\%$. Our future research includes improving backward compatibility beyond classification to span detection, model upgrades with very large language models, and upgrades on training data or label schema. We hope that this work can inspire further research and make progress towards smoother transitions of prediction powers as NLP systems evolve. \section*{Limitations} Our proposed method mostly works on the upgrades of underlying pretrained language models for NLP classification tasks. Potential limitations include applying our approach on distant tasks such as question answering or information retrieval, upgrade to models from different architecture families such as recurrent neural nets, and the inapplicability of our method to more recent learning formulation such as in-context learning via prompting. \section*{Ethics Statement} Prediction backward compatibility during model upgrade is an emerging research topic to ensure positive congruency and smoother transitions from existing models towards more performant systems. With primary evaluation on accuracy and negative flips, we acknowledge that our method may also inherit social biases and other toxicity persisted in the legacy models. On the other hand, we have noted that fairness and safety have been one of principal criteria when developing system upgrades. Investigations of the inheritance of persistent toxicity and mitigation of it during backward-compatible upgrades merit interests of future research. \section*{Acknowledgements} We would like to acknowledge AWS AI Labs for inspiring discussions, honest feedback, and full support. We are also very grateful to reviewers for judicious comments and valuable suggestions.
\section{Introduction} The data-hungry problem in image classification has been a hot topic~\cite{LI_DA_surevey,zhang2022expanding}. Since labeled data collection is usually very expensive, Data Augmentation (DA) has a wide range of applications in image classification. There are several categories of existing image DA methods, including image erasing~\cite{zhong2020random}, image mixup~\cite{yun2019cutmix}, auto augment~\cite{cubuk2020randaugment}, and feature augmentation~\cite{li2021feature}. Despite their effectiveness in some applications, most image augmentation methods apply pre-defined transformations or mixup to augment original images, which makes them only locally vary the images. Due to the inherent limitations of these approaches, they often struggle to maintain a proper balance between the diversity and semantic stability of augmented images, ultimately limiting their performances. It is a significant challenge to generate diverse augmented images and retain the semantic information of the original images. \begin{figure}[!t] \centering \includegraphics[width=1.00 \linewidth]{figures/intro_v2-crop.pdf} \caption{ Comparison between Random Erasing (RE), CutMix, RandAugment (RA), MoEx, and our \proposed{} with ViT as the backbone on Caltech101 (Cal101), Cars, OxfordPets (Pets), and DTD datasets. } \label{fig:intro-compare} \end{figure} Meanwhile, recent breakthroughs in large-scale pre-trained models (PMs) have brought the possibility of solving the above challenge. PMs~\cite{NEURIPS2020_1457c0d6,ClarkLLM2020electra} acquire a large amount of knowledge through pre-training on large-scale data, and achieve human-level performance on various benchmarks~\cite{wang2018glue,wang2019superglue}. Recently, in natural language processing (NLP), generating augmented training data with pre-trained large language models has garnered enormous interest~\cite{meng2022generating,wang2021towards}. It has shown effectiveness in various scenarios~\cite{ye2022zerogen}, so that motivates us to explore this strategy in image augmentation. Then, a natural question arises, how to properly apply PMs to effectively generate augmented images and improve the model performance? We argue that text can serve this purpose. First, text and images are two important modalities for human beings to understand and express world intelligence~\cite{Li2019VisualSR}, and text can be used to describe and represent the visual semantic of images~\cite{radford2021learning}. Second, there have been works bridging these two modalities, enabling the model to build a joint mapping between them. Such works have demonstrated that visual semantic contained in the text provides improvements to model performance. Therefore, we try to use semantic information to improve the quality of images generated from pre-trained models. In this paper, we propose \proposed{}, a semantic-guided image augmentation method with pre-trained models to ensure the stability of semantic in original images and bring enough diversity (see Figure~\ref{fig:intro-compare}). \proposed{} consists of two components. First, we generate the image caption with a pre-trained BLIP model~\cite{li2022blip} and obtain the textual image label. Both of them convey the semantic of the original image. Second, we concatenate the label and the caption to construct a textual prompt. The textual prompt is then fed into the pre-trained Stable Diffusion along with the original image. The model adds perturbations guided by the text to the original image to generate diverse augmented images (see Sec~\ref{sec:diverdity}). We conduct experiments on seven image classification datasets based on ResNet-50~\cite{he2016deep} and ViT~\cite{dosovitskiy2020image}. We compare \proposed{} with four different kinds of strong DA baselines. Our method outperforms the backbones on all datasets and achieves the best or comparable performance than all baselines. \proposed{} outperforms ResNet-50 by 12.60\% on average, and outperforms ViT by 2.07\% . Moreover, we found that combining \proposed{} with the baseline method can achieve further improvement on seven datasets on average (especially on ResNet-50), which confirms that our method is orthogonal to existing DA methods. Finally, we prove the diversity of \proposed{} and further analyze it through ablation experiments, analysis experiments, etc. Our contributions are as follows: \begin{itemize} \item To the best of our knowledge, we are the first to apply pre-trained models for semantic-guided image augmentation, which maintains semantic information in the original image and brings enough diversity. \item We demonstrate the effectiveness of our proposed \proposed{} on several common image classification datasets, achieving better average performance than the best baseline by 4.46\% and 1.23\% on two backbones. \item \proposed{} is also a plug-and-play method to be naturally integrated with other image augmentation methods and improves the overall performance. \end{itemize} \section{Related Works} \subsection{Image Data Augmentation}\label{Sec:Related-DA} Data augmentation is widely used in computer vision tasks~\cite{minaee2021image,algan2021image}. Currently, data augmentation methods are mainly divided into~\cite{yang2022image} several categories: (1) \textbf{Image Erasing}, such as Cutout~\cite{devries2017improved} and RandomErasing~\cite{zhong2020random}, generates augmented images by deleting one or more subregions of an image. (2) \textbf{Image Mix}, such as Mixup~\cite{zhang2018mixup} and Cutmix~\cite{yun2019cutmix}, uses the full or partial features and labels of different images to apply some interpolation methods. (3) \textbf{Auto augment}, such as AutoAugment~\cite{cubuk2019autoaugment} and RandAugment~\cite{cubuk2020randaugment}, tries to search the space of augmentation methods according to different tasks. (4) \textbf{Feature Augmentation}, such as FeatMatch~\cite{kuo2020featmatch} and MoEx~\cite{li2021feature}, performs the transformation in a learned feature space rather than conduct augmentation only in the input space. They have some commonalities: augmentation schemes are manually selected to directly modify the original images. This makes them struggle to find a balance between maintaining semantic information and improving the diversity of augmented images. \begin{figure*}[!t] \centering \includegraphics[width=1.0\linewidth]{figures/framework-final-1page-crop.pdf} \caption{An illustration of the proposed \textbf{\proposed{}}, a semantic-guided image augmentation method with pre-trained models. \textbf{Step 1} uses the BLIP and CLIP models for caption generation and calculates the similarity between the chosen caption and the original image. \textbf{Step 2} generates the augmented images by using the Stable Diffusion model, utilizing the original image, the prompt consisting of the textual label and caption, the noise rate, and the guidance scale based on the similarity.} \label{fig:main_method} \end{figure*} In addition, we notice some concurrent interesting work, such as~\newcite{zhang2022expanding}. Unlike manipulating only the image features and labels, \proposed{} proposes to construct prompts with image labels and captions to better guide the image-to-image generation process. \subsection{Image-Text Pre-trained Models} Currently, there has been a lot of work unifying text and visual tasks within a single framework~\cite{cho2021unifying,wang2021simvlm}, and the success of VLP (vision-language pre-training) has benefited from the large-scale image-text pairs collected from the internet~\cite{jia2021scaling,changpinyo2021conceptual}. Overall, there are three kinds of image-text pre-trained models: (1) Encoder architecture models, such as CLIP~\cite{radford2021learning}, based on an encoder architecture, encodes both text and images, and learns visual features using natural language as a supervision signal, successfully bridging the feature space between language and vision. (2) Encoder-decoder models, such as BLIP~\cite{li2022blip,huang2022nlip}, are jointly pre-trained with three visual-language objectives: image-text contrastive learning, image-text matching, and image-conditioned language modeling, and obtains applications in downstream tasks such as image captioning. (3) Image-to-image generation models, such as Stable diffusion~\cite{rombach2022high}, captures the essential information of the images by compressing specific or random images from the pixel space to the latent space, and gradually adding Gaussian noise for the diffusion process. The CLIP encoder converts the text description into the condition for the denoising process, and the image decoder decodes the denoised image into the final image. The diffusion and conditional denoising process provides sufficient diversity for image generation, and achieves good results on some downstream tasks including text-to-image, super-resolution, etc. \section{\proposed{}} In this work, we present \proposed{}, a semantic-guided image augmentation method with pre-trained models. \proposed{} aims not to exceed traditional image enhancement baselines on various benchmarks, but to explore such a method that might find a balance between preserving the semantic information in original images and bringing enough diversity. In addition, \proposed{} is also a plug-and-play method that can be naturally integrated with other augmentation methods and further improve performance. It consists of two essential components, as illustrated in Figure~\ref{fig:main_method}: \begin{enumerate}\itemsep 2pt \item We first collect labels for each image and generate captions with the pre-trained image captioning model, BLIP. Both labels and captions convey semantic information in original images. \item We construct the prompt based on the label and caption of each image. The prompt is then fed into the pre-trained image-to-image generation model, Stable Diffusion, along with the original image. The perturbations guided by the prompt are then added to the original image to generate diverse augmented images. \end{enumerate}\itemsep 2pt \begin{table*}[] \small \centering \begin{tabular}{lc|ccccc} \toprule \multirow{2}{*}{\textbf{Dataset}} & \multirow{2}{*}{\textbf{Image Label Example}} & \multirow{2}{*}{\textbf{Label Guidance}} & \multicolumn{3}{c}{\textbf{Caption Guidance}} & \multirow{2}{*}{\textbf{Prompt Weighting}} \\ \cline{4-6} & & & \textbf{Beam} & \textbf{Nucleus} & \textbf{CLIP} & \\ \hline CIFAR-100 & forest, fox, bed & \ding{52} & \ding{56} & \ding{52} &\ding{56} & \ding{52} \\ CIFAR-10 & airplane, bird, ship & \ding{52} &\ding{56} &\ding{56} & \ding{52} & \ding{52} \\ Cal101 & anchor, cellphone, pyamid & \ding{52} &\ding{56} & \ding{52} &\ding{56} &\ding{56} \\ Cars & \begin{tabular}[c]{@{}c@{}}Acura\_Integra\_Type\_R\_2001, \\ AM\_General\_Hummer\_SUV\_2000\end{tabular} & \ding{52} &\ding{56} & \ding{56} &\ding{56} & \ding{56} \\ Flowers & moon orchid, sword lily & \ding{52} & \ding{56} & \ding{56} & \ding{52} & \ding{52} \\ Pets & abyssinian, shiba inu & \ding{52} & \ding{52} & \ding{56} & \ding{56} & \ding{56} \\ DTD & banded, zigzagged & \ding{52} & \ding{56} & \ding{56} & \ding{52} & \ding{52} \\ \bottomrule \end{tabular} \caption{Detailed experimental settings on label guidance, caption guidance and prompt weighting.} \label{tab:dataset_setting} \end{table*} \subsection{Caption Generation and Label Acquisition} For an image classification dataset $\mathcal{D} = (\mathcal{X}, \mathcal{Y})$, we aim at generating captions for each image $\mathbf{x} \in \mathcal{X}$ with the help of a pre-trained caption generation model BLIP: \begin{equation} \label{eq:gen_caption} c = \textsc{BLIP}(\mathbf{x}), \end{equation} In which $\mathbf{c}$ is one caption generated from $\mathbf{x}$. Since the parameters of BLIP is frozen and the generation $\mathbf{c}$ for each $\mathbf{x}$ is deterministic, we can adopt different sampling algorithms (e.g., beam search~\cite{shen2017style} and nucleus sampling~\cite{Holtzman2019TheCC} ) to increase diversity. Nucleus sampling generates more diverse and surprising captions, which contain more new information. Beam search tends to generate safe captions that are common, hence offering less extra knowledge~\cite{li2022blip}. Then we obtain the corresponding caption set $\mathcal{C} \sim \mathbf{U}(c_1, c_2, \ldots, c_k)$. We show an example about generating captions for a given image in Figure~\ref{fig:main_method}. Given the generated caption set $\mathcal{C}$, we use a pre-trained CLIP model to calculate the similarity between the original image with each caption and obtain the similarity set: $\mathcal{S} \sim \mathbf{U}(s_1, s_2, \ldots, s_k)$. We randomly choose one caption and its similarity from $\mathcal{C}$ and $\mathcal{S}$ , and denote them with $\mathbf{c}^*$ and $\mathbf{s}^*$. Moreover, for potentially higher quality captions, an \textbf{optional} process is to choose the caption with the highest similarity from $\mathcal{C}$, according to its corresponding similarity in $\mathcal{S}$. In this case, we also denote them with $\mathbf{c}^*$ and $\mathbf{s}^*$. For example, in Figure~\ref{fig:main_method}, the caption $\mathbf{c}^*$ with the highest similarity $\mathbf{s}^*$ of 0.57 is ``the 2009 chevrolet silverado in a desert" generated by nucleus sampling. Note that we \textit{do not} expect $c*$ generated by the \textit{frozen} BLIP to be absolutely correct Since image quality is another important factor. In fact, we expect the captions to provide further information not limited to objects in the figure, such as background, color, etc. In our experiments (Sec. ~\ref{sec:Textual-Prompt}), we find that BLIP fulfills such a need. Thus, golden labels containing accurate semantic information can be used to avoid the above caption quality problem. Given an image $\texttt{label}$, we use the following algorithm to construct a corresponding sentence: \begin{equation}\label{textual-prompt} \mathbf{l} = ``\text{A picture of a }\texttt{[label]}". \end{equation} \subsection{Image Generation}\label{sec:Image-Generation} Given the label $\mathbf{l}$ and the caption $\mathbf{c}^*$, we concatenate them together to construct the textual prompt, i.e., $\bm{p} = (\mathbf{l}, \mathbf{c^*})$. The image label carries accurate but brief image semantic, and the generated caption describes the overall image semantic. Considering their different contributions, we adopt different weights, $w_l$ and $w_c$, for the label and caption respectively. We multiply the token embeddings of $\mathbf{l}$ and $\mathbf{c}^*$ by $w_l$ and $w_c$ respectively, and then subsequently encode them before fed to Stabel Diffusion. We apply a function $f$ to map the similarity $s^*$ between $\mathbf{x}$ and $c^*$ to the guidance scale $g$, i.e., $g = f(\mathbf{s}^*)$. The guidance scale $g$ indicates the degree to which the model refers to $\bm{p}$ when generating images. Stable Diffusion generates the augmented images given the following content: \begin{equation} \label{eq:gen_image} \mathbf{x}' = \textsc{StableDiffusion}(\mathbf{x}, \bm{p}, g, n), \end{equation} in which $\mathbf{x}'$ is the augmented image, $\mathbf{x}$ is the original image, $\bm{p}$ is the textual prompt, $g$ is the guidance scale, and $n$ is the parameter of noise rate in Stable Diffusion that indicates the noise amount added to the original image. \section{Experiments} \subsection{Datsets} We first evaluate the effectiveness of our proposed method on seven small-scale natural image datasets, including object classification: \textbf{CIFAR-10}~\cite{krizhevsky2009learning}, \textbf{CIFAR-100}~\cite{krizhevsky2009learning}, \textbf{Caltech101} (Cal101) ~\cite{DBLP:conf/cvpr/LiFP04}, fine-grained object classification: \textbf{Stanford Cars} (Cars)~\cite{krausecollecting}, \textbf{Flowers102} (Flowers)~\cite{nilsback2008automated}, \textbf{OxfordPets} (Pets)~\cite{parkhi2012cats} and texture classification: \textbf{DTD}~\cite{cimpoi2014describing}. \subsection{Baseline} We compare our \proposed{} with several categories of augmentation methods mentioned in Sec~\ref{Sec:Related-DA}, including Image Erasing, Mixup, Auto Augment, and Feature Augment. \begin{enumerate}\itemsep 2pt \item \textbf{Random Erasing} (RE)~\cite{zhong2020random} selects a rectangle region in an image randomly and replaces its pixels with random values. \item \textbf{CutMix}~\cite{yun2019cutmix} replaces the removed regions with a patch from another image to generate augmented images, instead of simply removing pixels or mixing images from the training set. \item \textbf{RandAugment} (RA)~\cite{cubuk2020randaugment} dramatically reduces the search space for data augmentation by removing a separate search, which is computationally expensive. \item \textbf{MoEx}~\cite{li2021feature} utilizes the moment information of latent features, i.e., combines normalized features of one instance with the feature moments of another. \end{enumerate}\itemsep 2pt \subsection{Implementation Details} \paragraph{Caption Generation.} During the caption generation process with BLIP, we apply both nucleus sampling and beam search to respectively generate ten captions. The maximum and minimum lengths are 5 and 20 respectively. As for nucleus sampling, we use $p$ = 0.9 by default as it is considered to be able to generate both fluent and diverse texts~\cite{li2022blip}. As for beam search, we use $num\_beams$ = 3 by default. When applying the pre-trained CLIP model to calculate the similarity, we use the default ``ViT-B/32'' model to encode both the original image and the caption candidates. \paragraph{Image Generation.} During the image-to-image generation process with Stable Diffusion, we apply the pre-trained ``stable-diffusion-v1-5'' model. For each image, we generate one augmented image, and set $denoising\_steps$ as 100 for higher quality. In our implementation, the quadratic function $f(s^*) =-4 \cdot {s^*} ^{2}+ 2\cdot s^* + 1$ has the best performance. We select the noise rate $n$ among \{3, 5, 7\}. As for prompt weighting, We assign a weight of 1.50 to the labels because it carries more accurate information for the original image, and a weight of 0.90 to the caption to reduce the interference caused by the potential low-quality captions. Some other details are shown in Table~\ref{tab:dataset_setting}. \paragraph{Image Classification.} We employ two image classification backbones including ResNet-50~\cite{he2016deep} and ViT \textit{(vit-base-patch16-224-in21k)}~\cite{dosovitskiy2020image}. We train ResNet-50 from the scratch for 300 epochs. The learning rate starts from 0.1 and is divided by 10 after the 150th and 225th epochs. The batch size is set to 256. We use the SGD optimizer, and the momentum, weight decay are set to 0.9 and 5e-4. As for the pre-trained ViT, we use the framework provided by HuggingFace~\cite{wolf-etal-2020-transformers}. On the CIFAR-10 and CIFAR-100, the learning rate and training epoch are set to 5e-5 and 3. On the other datasets, we follow ~\newcite{dosovitskiy2020image} and choose the learning rate based on the best performances among\{1e-4, 3e-4, 1e-3, 3e-3, 5e-5\} and the training epoch is set to 15. All models are trained with the basic image transform methods: randomly performs horizontal flips and, for the ResNet-based model, takes a random resized crop with 32 $\times$ 32 on CIFAR-10 and CIFAR-100 datasets from images padded by 4 pixels on each side, 224 $\times$ 224 on the other datasets. Models are developed with PyTorch~\cite{NEURIPS2019_9015}. All experiments are conducted with NVIDIA A100 40GB and NVIDIA A100 80GB. More implementation details can be found in the Appendix. \begin{figure*}[!t] \centering \includegraphics[width=1.0\linewidth]{figures/6pics_crop.pdf} \caption{ \proposed{} outperforms not only both backbones but also the strongest baseline RandAugment. Moreover, \proposed{} can further improve the performance of RandAugment by integrating naturally with it. } \label{fig:ours-compare-backbone} \end{figure*} \subsection{Main Results} We present our main results in Table~\ref{tab:main-results}. Our method leads to 12.60\% accuracy gain on average over seven datasets on ResNet-50, and 2.07\% on ViT. It achieves the best or comparable performance to all baselines. Such improvement not only shows that semantic-guided image DA with PMs is a promising direction, but also verifies the effectiveness of our method in creating new samples. In Figure~\ref{fig:ours-compare-backbone} (a-b) we compare \proposed{} with ResNet-50 and ViT. \proposed{} outperforms the two backbones on all seven datasets. Looking at individual datasets reveals some interesting behavior. On ResNet-50, we observe a wide spread in performance on fine-grained datasets. On two of these datasets, OxfordPets and DTD outperforms ResNet-50 features by over 20\% while on two others, Flowers102 and Stanford Cars by around 10\%. On ``general” object classification datasets, There is a significant improvement of nearly 20\% on Caltech101, while \proposed{} is relatively similar with a slight advantage on CIFAR-100 and CIFAR-10. As for the pre-trained ViT, \proposed{} achieves a relatively obvious improvement on Stanford Cars (3.74\%), Caltech101 (2.87\%), CIFAR-100 (2.14\%), and DTD (2.13\%). As shown in Figure~\ref{fig:ours-compare-backbone} (c-d), we compare \proposed{} with RandAugment, the strongest baseline on both ResNet-50 and ViT. On ResNet-50, \proposed{} outperforms RandAugment on five of the seven datasets, with an average of 4.46\% higher than RandAugment, and a maximum of 23.25\% on DTD. On ViT, \proposed{} outperforms RandAugment by 1.23\% on average, and exceeds RandAugment on all seven datasets. Comparison with the strongest baseline models shows promising capabilities of \proposed{}, which generates image from large models under semantic guidance. We further explore the unified DA methods, i.e., combining \proposed{} with the baselines together. In Figure~\ref{fig:ours-compare-backbone} (e-f), we construct such a unified model with RandAugment and compare it with RandAugment itself. We find that the unified model can achieve further improvement based on RandAugment on six out of the seven datasets on ResNet-50, and on all seven datasets on ViT. As shown in Table~\ref{tab:main-results}, this conclusion holds for all baselines on both ResNet-50 and ViT (12.32\% and 1.48\% on two backbones for CutMix; 10.67\% and 1.61\% for RandAugment; 9.56\% and 1.13\% for MoEx). The results of the unified DA methods confirm that augmented images generated from PMs include orthogonal information from existing DA methods, and existing DA methods could benefit from \proposed{} for greater improvement. \subsection{Image Diversity Augmented by \proposed{}}\label{sec:diverdity} We study the diversity of images augmented by \proposed{}. First, we separately use \proposed{} and all other DA baselines to generate five augmented images for each original image in the dataset. Inspired by~\newcite{zhang2022expanding}, for each DA method, we calculate the average cosine similarity between the original image and its five augmented ones. We repeat this process on all the original images of each dataset label, and calculate the average value as a measure of the augmented image diversity on this label. The lower average similarity between the augmented images and the original image, the greater the diversity brought by the corresponding augmented method. We choose CIFAR-10 to evaluate the diversity of DA methods, and the result is shown in Figure~\ref{fig:similarity}. \begin{figure}[!t] \centering \includegraphics[width=1.0 \linewidth]{figures/grid_v3_crop.pdf} \caption{Average cosine similarity between the augmented and original images for each label of the CIFAR-10 dataset (air.: airplane, auto.: automobile ).} \label{fig:similarity} \end{figure} As we can see, \proposed{} has the lowest similarity (85.48\%) compared to other DA methods, which means that its augmented images are the most diverse while remaining outstanding performance. The similarity of MoEx (87.18\%) is similar to that of \proposed{}, because it augments the original image by transforming the feature space, instead of locally changing image pixels (\proposed{} neither). However, \proposed{} achieves better classification performance, as shown in Figure~\ref{tab:main-results}. We argue that this is the benefit of a large amount of knowledge contained in the pre-trained Stable Diffusion and the diffusion mechanism adding random noise to the image during the generation process. \subsection{Influence of the Textual Prompt}\label{sec:Textual-Prompt} We study the influence of the textual prompt based on ResNet-50 in Table~\ref{tab:ablation}. \begin{table}[t] \small \centering \begin{tabular}{lcccc} \toprule \textbf{} & \textbf{CIFAR-100} & \textbf{Cars} & \textbf{Pets} & \textbf{DTD} \\ \midrule Whole Prompt & \textbf{75.72} & \underline{84.31} & \textbf{76.15} & \textbf{37.55} \\ w/o Label & \underline{75.65} & 83.89 & 63.80 & 34.78 \\ w/o Caption & 73.99 & \textbf{88.28} & \underline{75.90} & \underline{37.43} \\ w/o Prompt & 74.11 & 82.09 & 55.76 & 32.39 \\ \bottomrule \end{tabular} \caption{ Ablation study over the construction of textual prompts. ``Whole Prompt'' indicates the whole prompt as the guidance, ``w/o Label'' indicates the caption only, and ``w/o Caption'' indicates the label only. ``w/o Prompt'' indicates no semantic guidance. } \label{tab:ablation}% \end{table} We can see that in most cases except CIFAR-100, the performance of ``w/o Prompt'' is the lowest. This shows the importance of semantic guidance in \proposed{} when generating augmented images from pre-trained models. We can see that in most cases except for Stanford Cars, ``Whole Prompt” has achieved the best results. This confirms our claim in Section~\ref{sec:Image-Generation}: the label and the caption provide different semantic information and both have contributions. As for Stanford Cars, it has higher performance when only using labels than using the whole prompt. We argue that this is because the dataset is fine-grained and its label carries very detailed information, such as ``Chevrolet\_Silverado\_1500\_Extended\_Cab\_2012'', which is sufficient for the model to generate an augmented image based on the original one. As for the comparison between the caption and the label, in most cases, only using labels outperforms only using captions. It is because the image label carries golden and accurate image semantic, as we mentioned in Section~\ref{sec:Image-Generation}. However, this is not true for CIFAR-100, where the effect of captions is better than labels. We argue that this is because CIFAR-100 is a ``general'' classification dataset, and its labels (such as bed, forest, etc.) cannot provide detailed information like fine-grained datasets. \begin{figure*}[!t] \centering \includegraphics[width=1.0\linewidth]{figures/case_study_crop.pdf} \caption{Visualization of the case study on Stanford Cars.} \label{fig:case-study} \end{figure*} \subsection{Caption Selection \& Prompt Weighting} We study the influence of the caption selection strategy and the prompt weighting strategy based on ResNet-50 in Table~\ref{tab:analysis}. We can see that nucleus sampling, beam search, and the CLIP filter contribute the best performance on three datasets respectively. This may be because of the different characteristics of nucleus sampling and beam search, as we mentioned in Section~\ref{sec:Image-Generation}. Nucleus sampling generates more diverse and surprising captions, while beam search tends to generate safe captions~\cite{li2022blip}. We hypothesize that OxfordPets is a fine-grained dataset whose labels are very detailed and a ``safe'' caption would not influence the semantic of the labels. In contrast, CIFAR-100 is a ``general'' classification dataset whose label cannot carry much information, so it needs to be supplemented by more diversified captions from nucleus sampling. As for DTD, a texture classification dataset, which is in fact challenging for BLIP to generate captions that ensure image semantic. Then a pre-trained CLIP filter would help to improve the quality of the caption to guide image generation. As for the prompt weighting strategy, its effectiveness is proven in two out of three datasets in Table~\ref{tab:analysis}. We hypothesize that adding different weights to different parts of the textual prompt could reconcile different semantic information of label and caption. \begin{table}[t] \small \centering \setlength{\tabcolsep}{0.9mm}{ \begin{tabular}{lcccccc} \toprule \multirow{2}{*}{} & \multicolumn{2}{c}{\textbf{CIFAR-100}} & \multicolumn{2}{c}{\textbf{Pets}} & \multicolumn{2}{c}{\textbf{DTD}} \\ & PW & w/o PW & PW & w/o PW & PW & w/o PW \\ \midrule Beam & 75.60 & 74.69 & 75.06 & \textbf{76.15} & 37.47 & 35.79 \\ Nucleus & \textbf{75.72} & 74.93 & 73.72 & 75.70 & 37.16 & 37.04 \\ CLIP & 74.80 & 74.85 & 70.86 & 71.95 & \textbf{37.55} & 32.44 \\ \bottomrule \end{tabular} } \caption{ Analysis study over the caption selection and prompt weighting on three datasets. Beam and Nucleus indicate we only use captions generated by beam search or nucleus sampling. CLIP indicates we select the highest CLIP similarity to the original image from the captions generated by Beam and Nucleus. PW indicates the prompt weighting strategy. } \label{tab:analysis}% \end{table}% \subsection{Case Study} Figure \ref{fig:case-study} (a) shows the comparison of the augmentation images generated by our method and other data augmentation methods. Random Erasing and CutMix both generate augmented images by replacing a part of the image. AutoAugment shows the effect of multiple transformations on the image. For MoEx, the features of one image are normalized and then infused from another image. The baselines can bring diversity to images through transformation or feature augmentation. However, this diversity often comes only from the images themselves or from other images within the dataset, and does not explore the rich semantic information that comes from the images themselves, making it difficult to bring new content and style to the images. Figure \ref{fig:case-study} (a) shows that our method can generate more diversity and readable images. These images trade off well between diversity and image semantic, and improve the performance of downstream tasks by exploiting the diversity information brought by image semantic. We further explored the effect of adjusting the guidance scale and noise rate on generating augmented images, as shown in Figure \ref{fig:case-study} (b). We can see that the generated images have more meaningful diversity (e.g., changes in body orientation and color, variations in background, etc.) when the noise rate and guidance scale are increased. However, the experimental results show that as the guidance increase and noise rate, the performance decreases while more diversity is introduced. This suggests that noise has a greater effect on performance, which will be further explored in our future work. \section{Conclusion} In this paper, we introduce a semantic-guided image augmentation method with pre-trained models, \proposed{}. It gives attention to image diversity as well as image semantic retention. Specifically, \proposed{} employs the pre-trained Stable Diffusion model to generate diverse augmented images, and construct prompts with image labels and captions to guide the generation process, which preserves image semantic from the original image. We conduct experiments on ResNet-50 and ViT. Experimental results show that \proposed{} outperforms the two baselines by 12.60\% and 2.07\% on average over seven datasets. We compare \proposed{} with four strong baselines including Random Erasing, CutMix, RandAugment, and MoEx, and \proposed{} achieves the best or competitive performance. Moreover, we find that the performance of the baselines can be further improved when used in conjunction with \proposed{}. For example, RandAugment improves 10.67\% on ResNet-50 and 1.60\% on ViT and achieves the highest performance among all methods on both backbones. We also provide a detailed analysis of the diversity of augmented images generated by \proposed{}. \section{Implementation Details} We adopt three visual backbones for image classification, including ResNet-50 (ResNet;~\cite{he2016deep}), WideResNet-28-10 (WRN;~\cite{zagoruyko2016wide}), and vit-base-patch16-224-in21k (ViT;~\cite{dosovitskiy2020image}). Among different DA methods, in order to ensure the fairness of the experiments, a grid search was performed with a fixed seed in the same hyperparameter search space, and the best result of each method is reported. We develop and experiment based on the Pytorch~\cite{NEURIPS2019_9015} framework. All experiments are conducted with NVIDIA A100. As for ResNet and WRN, we apply basic image transforms, including random horizontal flips and a random resized crop with 32 $\times$ 32 on CIFAR-10 and CIFAR-100 datasets (images are padded by 4 pixels on each side), and 224 $\times$ 224 on other datasets. We train these models from scratch for 300 epochs. Following~\newcite{zhong2020random}, the learning rate starts from 0.1 and is divided by 10 after the 150$^\text{th}$ and 225$^\text{th}$ epoch. The batch size is set to 256 for ResNet, and 64 for WRN. We use the SGD optimizer, and the momentum, weight decay are set to 0.9 and 5e-4 for both backbones. As for ViT, we use the pre-trained \MYhref{https://huggingface.co/google/vit-base-patch16-224-in21k}{\textit{vit-base-patch16-224-in21k}} model and the image classification \MYhref{https://github.com/huggingface/transformers/tree/main/examples/pytorch/image-classification}{framework} provided by HuggingFace~\cite{wolf-etal-2020-transformers}. Basic image transforms are applied, including random horizontal flips and a random resized crop with 224 $\times$ 224 to match the input dimensions of the pre-trained \textit{vit-base-patch16-224-in21k} model on all datasets. During model training, the batch size is set to 64 and the AdamW~\cite{loshchilov2018decoupled} optimizer is used. On CIFAR-10 and CIFAR-100, we use the default parameters from the framework , i.e., the learning rate and training epoch are set to 5e-5 and 3. On the other datasets, we follow~\newcite{dosovitskiy2020image} and choose the learning rate based on the best performances among\{1e-4, 3e-4, 1e-3, 3e-3\} and the training epoch is set to 15. The hyper-parameters of baseline models are as follows: \begin{itemize} \item For Random Erasing, we follow the \MYhref{https://github.com/zhunzhong07/Random-Erasing}{official implementation} of ~\newcite{zhong2020random} ($p=0.5$, $s_{h}=0.4$ and $r_{1}=0.3$); \item For CutMix, we follow the \MYhref{https://github.com/clovaai/CutMix-PyTorch}{official implementation} of ~\newcite{yun2019cutmix} ($\alpha=1$, cutmix probability is 0.5); \item For RandAugment, we use \MYhref{https://github.com/pytorch/vision/blob/main/torchvision/transforms/autoaugment.py}{\textit{torchvision.transforms.RandAugment}} provided by PyTorch without changing any default parameters ($N=2$, $M=9$); \item For MoEx, we follow the \MYhref{https://github.com/Boyiliee/MoEx}{official implementation} of \newcite{li2021feature} ($\lambda=0.5$, $p=0.25$, PONO normalization). \end{itemize} \begin{figure}[!t] \centering \includegraphics[width=1.0 \linewidth]{figures/cifar_case_study_v2_crop.pdf} \caption{The augmented images generated by the image-to-image \proposed{} and the vanilla text-to-image Stable Diffusion on CIFAR-100.} \label{fig:text2img-1} \end{figure} \begin{table*}[htbp] \centering \begin{tabular}{lccccc} \toprule & \textbf{CIFAR-100-S} & \textbf{Cars} & \textbf{Pets} & \textbf{DTD} \\ \midrule Backbone & 39.90 & 82.15 & 49.19 & 14.57 \\ + Dataset Expansion & 54.50 ($\times$ 5) & 53.10$^*$ ($\times$ 20) & 66.40 ($\times$ 30) &31.20 ($\times$ 5) \\ + \proposed{} & \textbf{65.20} ($\times$ 2) & \textbf{88.28} ($\times$ 1) & \textbf{76.15} ($\times$ 1) & \textbf{37.55} ($\times$ 1) \\ \bottomrule \end{tabular}% \caption{Comparison between Dataset Expansion~\protect\cite{zhang2022expanding} and \proposed{} on four datasets. ($\times$ $n$) indicates that the augmented data is $n$ times the original data. Since \protect\newcite{zhang2022expanding} does not provide open-source code, the results of ``Backbone" are from our corresponding experiments. In addition, ``$\*$" is the performance of Dataset Expansion on Stanford Cars by \protect\newcite{zhang2022expanding}, which is lower than our backbone because the backbone performance provided by them in the paper is different from ours.} \label{tab:appendix-expand-results}% \end{table*}% \begin{table}[htbp] \centering \small \begin{tabular}{lccc} \toprule & \textbf{CIFAR-100} & \textbf{Cars} & \textbf{Avg.} \\ \midrule Backbone & 89.86 &82.99 & 86.42 \\ + Text-to-Image &90.86 & 83.70 & 87.28 \\ + \proposed{} & \textbf{92.00} & \textbf{86.73}& \textbf{89.36} \\ \bottomrule \end{tabular}% \caption{ Comparison between the vanilla text-to-image Stable Diffusion and \proposed{}. } \label{tab:appendix-text2img-results} \end{table}% \textit{} \section{Results on WRN Backbone} We further conduct experiments on WRN, and the results are shown in Table~\ref{tab:appendix-main-results}. Our method leads to 2.48\% accuracy gain on average over four datasets. The results demonstrate the effectiveness of semantic-guided image DA with PMs. Moreover, when the baselines are naturally integrated with \proposed{}, their performances are improved on all datasets. This conclusion holds for all baselines (1.83\% for CutMix; 2.81\% for MoEx; 5.69\% for RandAugment), which is consistent with the results in Table 2 and Figure 3 (e-f) of the main paper. This further demonstrates that the proposed Semantic-Guided Image Augmentation method can bring different new knowledge from the pre-trained image-to-image generation model, Stable Diffusion, to the image classification backbones. Thus, \proposed{} can further improve the performance of different traditional image augmentation baselines. Based on extensive experiments with different backbones on different datasets, the contributions of our approach and the traditional image augmentation baselines to the performance of image classification are orthogonal. More excitingly, \proposed{} can naturally integrate and collaborate with these image augmentation baselines without any additional parameters or training. \section{Results of Text-to-Image Generation} In this section, we investigate the importance of using pre-trained \textit{\textbf{image-to-image}} generation paradigm in \proposed{}. We apply the Stable Diffusion model for \MYhref{https://github.com/CompVis/stable-diffusion/blob/main/scripts/txt2img.py}{\textit{text-to-image}} generation, which only takes the text as the model input without the original image. We use the same prompt $\bm{p} = (\mathbf{l}, \mathbf{c^*})$ as introduced in Sec.3.2, and directly feed it into the model to generate images as the augmented images for the original one. Experiments are conducted on CIFAR-100 and Stanford Cars based on the ViT backbone. As shown in Table~\ref{tab:appendix-text2img-results}, both paradigms outperform the ViT backbone, which proves the effectiveness of pre-trained image generation models in \proposed{}. Furthermore, the model performance of the text-to-image generation paradigm is significantly lower than the image-to-image generation paradigm in \proposed{}. We argue that the textual prompt composed of the caption and the label may contain noise. Therefore, the original image is essential when generating augmented images, so as to ensure the quality of the generated results from the pre-trained image generation model as much as possible. Otherwise, when the model only takes the prompt as input, it tends to lose the reference of the original image and thus generates images that are too different from the original image. Augmented images generated by this paradigm would have a different distribution from the original dataset, thus hurting model performance~\cite{hataya2022will}. As shown in Figure~\ref{fig:text2img-1} and Figure~\ref{fig:text2img-2}, we further compare the augmented images of these two paradigms on two labels of CIFAR-100 and Stanford Cars respectively. We can see that augmented images by \proposed{} are more similar to the original image while still maintaining the diversity, i.e., it generates objects with different angles, poses and different backgrounds. In contrast, the distribution of augmented images by the text-to-image generation paradigm is too different from the original image, which may instead confuse image classification learning. \begin{figure}[!t] \centering \includegraphics[width=1.0 \linewidth]{figures/car_case_study_v2_crop.pdf} \caption{The augmented images generated by the image-to-image \proposed{} and the vanilla text-to-image Stable Diffusion on Stanford Cars.} \label{fig:text2img-2} \end{figure} \section{Comparison with Dataset Expansion} We notice a concurrent work~\cite{zhang2022expanding} that expands the dataset via some pre-trained image generation models. This is achieved by optimizing the latent features of the original image in the semantic space, and feeding the latent features into the generative models to generate images with new contents. Similarly, \newcite{zhang2022expanding} also employ large pre-trained generative models. However, they only use the original images as the model input. The image labels are only used for optimizing the training loss, instead of used for constructing the textual prompt along with image captions as input to the model, i.e., as a direct semantic guidance for image-to-image generation in \proposed{}. Moreover, they require additional training on the large pre-trained image generation models, and more times of expansion (usually 5-30 times in \newcite{zhang2022expanding}) are required on the small datasets they focus on. They perform their experiments on ResNet-50 while their open-source code is not provided. We compared \proposed{} with them on ResNet-50, and the results are shown in Table~\ref{tab:appendix-expand-results}. Since they do not provide the open-source code, the results of ``Backbone" in Table~\ref{tab:appendix-expand-results} are from our corresponding experiments, including the ``CIFAR-100-S".\footnote{100-shot of CIFAR-100.} The results prove that \proposed{} achieves more significant improvements on several data sets with a smaller number of dataset expansion multiples (up to two times on CIFAR-100-S). In addition, our method is also applicable to larger datasets (such as CIFAR-10 and CIFAR-100). This demonstrates the effectiveness of directly applying semantic information as guidance during image-to-image generation. \proposed{} is more effective and requires no additional training for augmenting images. \section{Case Study of DA Methods} We show augmented images of \proposed{} and other image augmentation baselines on the following datasets, including CIFAR-100, CIFAR-10, Caltech101, Flowers102, OxfordPets, and DTD. The results are shown in Figure~\ref{fig:appendix-case-study-cifar100} - Figure~\ref{fig:appendix-case-study-DTD}. \begin{figure*}[!t] \centering \includegraphics[width=0.8 \linewidth]{figures/cifar100_crop.pdf} \caption{Augmented images by \proposed{} and other DA baselines on CIFAR-100.} \label{fig:appendix-case-study-cifar100} \end{figure*} \begin{figure*}[!t] \centering \includegraphics[width=0.8 \linewidth]{figures/cifar10_crop.pdf} \caption{Augmented images by \proposed{} and other DA baselines on CIFAR-10.} \label{fig:appendix-case-study-cifar10} \end{figure*} \begin{figure*}[!t] \centering \includegraphics[width=0.8 \linewidth]{figures/cal101_crop.pdf} \caption{Augmented images by \proposed{} and other DA baselines on Caltech101.} \label{fig:appendix-case-study-cal101} \end{figure*} \begin{figure*}[!t] \centering \includegraphics[width=0.8 \linewidth]{figures/flowers_crop.pdf} \caption{Augmented images by \proposed{} and other DA baselines on Flowers102.} \label{fig:appendix-case-study-flower} \end{figure*} \begin{figure*}[!t] \centering \includegraphics[width=0.8 \linewidth]{figures/pet_crop.pdf} \caption{Augmented images by \proposed{} and other DA baselines on OxfordPets.} \label{fig:appendix-case-study-pets} \end{figure*} \begin{figure*}[!t] \centering \includegraphics[width=0.8 \linewidth]{figures/dtd_crop.pdf} \caption{Augmented images by \proposed{} and other DA baselines on DTD.} \label{fig:appendix-case-study-DTD} \end{figure*}
\section{Introduction} The discovery of the Higgs boson at the Large Hadron Collider (LHC)~\cite{ATLAS:2012yve,CMS:2012qbp} has opened a new era in particle physics. The precise measurements of the Higgs couplings play a crucial role to test the Standard Model (SM) and beyond~\cite{Cheung:2014noa,Englert:2014uua,Cao:2015oaa,Falkowski:2015fla,Cao:2015oxx,Corbett:2015ksa,Cao:2016zob,Durieux:2017rsg,Cao:2018cms,DeBlas:2019qco,Li:2019uyy,Ellis:2020unq,Xie:2021xtl,Yan:2021tmw,Dong:2022bkd}. From the recent global analysis of the ATLAS and CMS Collaborations at the LHC Run-2~\cite{ATLAS:2022vkf,CMS:2022dwd}, it shows that the observed properties of the Higgs boson agree with the SM prediction very well. Owing to the dominant production channel of the Higgs boson at the LHC being the top quark loop-induced gluon-fusion process, the effective coupling of the Higgs boson to gluons has received much attention in the high energy physics community. It shows that the effective coupling strength modifier $\kappa_g$ of the $Hgg$ coupling has been strongly constrained by the Higgs signal strength measurements at the LHC Run-2~\cite{ATLAS:2022vkf,CMS:2022dwd}, {\it i.e.,} $\kappa_g=0.95\pm 0.07$ (ATLAS) and $\kappa_g=0.92\pm 0.08$ (CMS). Here the effective Lagrangian of the $Hgg$ coupling is parameterized as, \begin{equation} \mathcal{L}_{Hgg}=\kappa_g\frac{\alpha_s}{12\pi v}HG_{\mu\nu}^aG^{a\mu\nu}, \end{equation} where $v=246~{\rm GeV}$ is the vacuum expectation value and $\alpha_s$ is the strong coupling. $G_{\mu\nu}^a$ is the field strength tensor of the gluon with the color index $a$ and $\kappa_g=1$ for the SM. However, the limit for the $Hgg$ coupling at the LHC is inferred from the signal strength measurement of the gluon-fusion Higgs production, which would strongly depend on the assumption of the Higgs decay information. A more straightforward strategy to probe the $Hgg$ coupling is measuring the signal strength of $H\to gg$. Unfortunately, it would be a challenging task at the LHC due to the overwhelmingly large QCD background. But the signature of the Higgs boson at the $e^+e^-$ collider is clean and readily identifiable, therefore, we could directly extract the $Hgg$ coupling information from the Higgs decay with very high accuracy. Currently, several candidates for the lepton colliders have been proposed by the high energy physics community, such as the Circular Electron Positron Collider (CEPC)~\cite{CEPCStudyGroup:2018ghi}, the Future Circular Collider (FCC-ee)~\cite{FCC:2018evy}, and the International Linear Collider (ILC)~\cite{ILC:2013jhg}. With the help of the high tagging efficiencies of the heavy quarks at the lepton collider, the uncertainty of the $\kappa_g$ could be reduced to the $\mathcal{O}$(1\%) level~\cite{An:2018dwb}. Although the Higgs boson production can be disentangled from its decay by the recoil mass method at the lepton collider, the measurements of the Higgs couplings are still depending on the assumption of the Higgs width. One of the approaches to avoid the impact of the Higgs width without the global fitting is to measure the jet energy profile from the Higgs boson decay, which utilizes the different features of the soft gluon radiations between the quark jet and gluon jet~\cite{Li:2018qiy,Li:2019ufu}. It shows that the jet energy profile would be sensitive to the fractions of quark and gluon final states, while the dependence of the production cross section and the Higgs width would be canceled from the definition. Recently, we demonstrated that the jet charge asymmetry from the two leading jets of the production of the Higgs+2 jet is sensitive to the charge correlations between the jets and can be used to discriminate the different Higgs production mechanisms at the LHC~\cite{Li:2023tcr}. With a similar idea, we will apply this observable to measure the $Hgg$ coupling at the lepton collider due to the uncorrelated nature of the jet charges in $H\to gg$, while the jet charges are correlated for the main backgrounds. As to be shown below, this observable would be also only sensitive to the fractions of the different channels, and the possible new physics effects in Higgs production and total width would be canceled. The jet charge asymmetry from the Higgs boson decay can be defined as~\cite{Li:2023tcr}, \begin{equation} \overline{A}_Q\equiv\frac{\langle \left|Q_J^1-Q_J^2\right |\rangle}{\langle \left|Q_J^1+Q_J^2\right |\rangle} \equiv \frac{\langle Q^{(-)} \rangle }{\langle Q^{(+)} \rangle}, \label{eq:Asy} \end{equation} where $\langle Q\rangle$ denotes the average value of the quantity $Q$ and $Q^{(\pm)}=|Q_J^1\pm Q_J^2|$, with $Q_J^{1,2}$ is the jet charge of the leading and subleading jets, respectively. Therefore, we could expect that this asymmetry would be close to one for the signal $H\to gg$, while it would be larger than one for the backgrounds, {\it e.g.,} $H\to b\bar{b}, H\to VV^*$ with $V=W, Z$. \section{The Jet Charge} The jet charge can be defined as the $p_T$ weighted sum of the electric charge of the jet constituents~\cite{Field:1977fa,Krohn:2012fg,Waalewijn:2012sv}, \begin{equation} Q_J=\frac{1}{(p_T^J)^\kappa}\sum_{i\in {\rm jet}}Q_i(p_T^i)^\kappa,\quad \kappa>0, \end{equation} where $p_T^J$ is the transverse momentum of the jet, $p_T^i$ and $Q_i$ are the transverse momentum and electric charge of particle $i$ inside the jet. The parameter $\kappa>0$ is used to suppress the contribution from the soft gluon radiation. One important feature of the jet charge is that it could serve well for identifying the charge of the primordial parton of the hard scattering, as result, this observable has been widely discussed in the literature from both the theoretical calculation~\cite{Krohn:2012fg,Waalewijn:2012sv} and experimental measurements~\cite{CMS:2014rsx,ATLAS:2015rlw,CMS:2017yer,CMS:2020plq}. It shows that the theoretical prediction of $Q_J$ at the next-to-leading order accuracy of QCD agrees with the measurements from the ATLAS and CMS Collaborations very well~\cite{ATLAS:2015rlw,CMS:2017yer}. Recently, this observable has been widely used for discriminating the quark jet and gluon jet ~\cite{Fraser:2018ieu,Larkoski:2019nwj,Gianelle:2022unu}, searching for the possible new physics effects~\cite{Chen:2019uar,Li:2021uww,Li:2023tcr}, probing nuclear medium effects in heavy-ion and electron-ion collisions~\cite{Chen:2019gqo,Li:2019dre,Li:2020rqj}, as well as probing the quark flavor structure of the nucleon~\cite{Kang:2020fka,Kang:2021ryr,Lee:2022kdn,Kang:2023ptt}. In this work, we will demonstrate below that the jet charge information could also be used to constrain the $Hgg$ effective coupling in Higgs boson decay and this information would be complementary to that obtained from the jet energy profile and cross section measurements at the lepton collider in determining the $Hgg$ coupling. \section{Collider Simulation} In this section, we perform a detailed Monte Carlo simulation to explore the potential of probing the $Hgg$ coupling through the jet charge asymmetry at the future CEPC with the center-of-mass energy $\sqrt{s}=250~{\rm GeV}$. At the CEPC, the Higgs boson is dominantly produced through the Higgs and $Z$ boson associated production, {\it i.e.,} $e^+e^-\to H Z$. The electroweak and QCD corrections for this process have been widely discussed in recently years~\cite{Gong:2016jys,Sun:2016bel,Chen:2018xau,Li:2020ign,Chen:2022mre}. The preliminary simulations have shown that the cross section of the $ZH$ production at the CEPC could be measured with an uncertainty of $0.51\%$ under the integrated luminosity of $\mathcal{L}=5.6~{\rm ab}^{-1}$~\cite{CEPCStudyGroup:2018ghi}. The production of the millions of the Higgs boson at the CEPC would offer the opportunity for precisely measuring the $Hgg$ coupling directly. The signal we are interested in is Higgs decaying into gluons and $Z$ boson decaying into lepton pairs ($e^+e^-$ and $\mu^+\mu^-$). The major SM backgrounds are $H(\to b\bar{b},c\bar{c})Z$, $Zjj$ and $H(\to VV^*\to 4j)Z$. However, the branching ratio of $gg$ mode (${\rm BR}(H\to g g)=8.6\%$) is much smaller than the $b\bar{b}$ channel (${\rm BR}(H\to b\bar{b})=58.2\%$)~\cite{Workman:2022ynf}, therefore, the flavor tagging technique would be necessary for suppressing the backgrounds from heavy quarks. It shows that the heavy flavor backgrounds can be removed mostly if we require two non-$b$ and $c$ jets in the final state with the identification efficiency of gluon jet $97.2\%$~\cite{Gao:2016jcm}. The background $Zjj$ can also be highly suppressed after we include the kinematic cuts, {\it e.g.,} recoil mass and the polar angle of the Higgs boson~\cite{Chen:2016zpw,CEPCStudyGroup:2018ghi}. As shown in Ref.~\cite{Gao:2016jcm}, after the kinematic cuts and requiring two light jets in the final state, we could get the signal events for the $H\to gg$ with $\kappa_g=1$ is $N_g=3438$ at $\sqrt{s}=250~{\rm GeV}$ with an integrated luminosity of $5.6~{\rm ab}^{-1}$. The background of Higgs decaying into heavy flavor quarks ($H\to b\bar{b},c\bar{c}$) is about $N_{\rm HF}=0.1N_g$, the event number of $Zjj$ is $N_{\rm Zjj}=0.2N_g$, and the background of $H\to VV^*$ is $N_{\rm VV}=0.6~N_g$~~\cite{Gao:2016jcm}. Since the jet charge is a track-based observable, we expect that the jet charge asymmetry of we are considering would be not sensitive to the kinematic cuts in the above analysis and these event numbers will be used for rescaling the statistical error of the jet charge asymmetry and calculating the fractions of the different processes. \begin{figure*} \centering \includegraphics[scale=0.26]{Qgg.pdf} \includegraphics[scale=0.26]{Qbb.pdf} \includegraphics[scale=0.26]{Qcc.pdf} \includegraphics[scale=0.26]{Qww.pdf} \includegraphics[scale=0.26]{Qzz.pdf} \includegraphics[scale=0.26]{Qzjj.pdf} \caption{The jet charge correlations between the leading and subleading jets from the signal and backgrounds with the jet charge parameter $\kappa=0.3$.} \label{Fig:jQ} \end{figure*} Next, we utilize the event generator MadGraph5~\cite{Alwall:2014hca} to generate the signal and backgrounds events at the parton level and pass them to the PYTHIA~\cite{Sjostrand:2014zea,Bierlich:2022pfr} for parton showering and hadronization. We further require the $p_T^j>20~{\rm GeV}$ and $|\eta_j|<4.5$, where $p_T^j$ and $\eta_j$ denotes the transverse momentum and rapidity of the jet, respectively, after we cluster the particles with anti-$k_T$ jet algorithm~\cite{cacciari:2008gp}. Figure~\ref{Fig:jQ} shows the jet charge correlations between the leading and subleading jets from the signal and background processes with the benchmark jet charge parameter $\kappa=0.3$. As we expected that the jet charges are uncorrelated for the signal, but it exhibits a strong correlation for all the backgrounds. Combing the jet charge information, we calculate the jet charge asymmetries for the signal and backgrounds at the $\sqrt{s}=250~{\rm GeV}$ CEPC with the integrated luminosity $\mathcal{L}=5.6~{\rm ab}^{-1}$. A large number of pseudo experiments have been generated by the PYTHIA for estimating the statistical uncertainty of $\overline{A}_Q$, while the systematic errors are expected to be canceled from the jet charge asymmetry definition; see Eq.~\eqref{eq:Asy}. We assume that the statistical error satisfies the Gaussian distribution and could be rescaled based on the event number of the process. It clearly shows that $\overline{A}_Q\sim 1$ for the signal $H\to gg$, while $\overline{A}_Q>1$ for the backgrounds, as we argued before. Note that $\overline{A}_Q$ from the $H\to ZZ^*$ is similar to the $H\to WW^*$, but with a much larger statistical error, as a result, it is not plotted in Fig.~\ref{Fig:AQ}. \begin{figure} \centering \includegraphics[scale=0.4]{AQ.pdf} \caption{The jet charge asymmetries of the signal and backgrounds at the CEPC with $\sqrt{s}=250~{\rm GeV}$ for the integrated luminosity $\mathcal{L}=5.6~{\rm ab}^{-1}$. The systematic uncertainties are assumed to be canceled from the definition.} \label{Fig:AQ} \end{figure} \begin{figure} \centering \includegraphics[scale=0.48]{kg.pdf} \caption{The expected limits on the Higgs gluon effective coupling with the different jet charge parameter $\kappa$ at the CEPC with $\sqrt{s}=250~{\rm GeV}$ for the integrated luminosity $\mathcal{L}=5.6~{\rm ab}^{-1}$ (black points) and $\mathcal{L}=20~{\rm ab}^{-1}$ (blue points).} \label{Fig:kg} \end{figure} Now we combine all the jet charge information to constrain the $Hgg$ coupling. The combined jet charge asymmetry can be written as, \begin{align} \overline{A}_Q^{\rm tot}= & \frac{\sum_i f_i \langle Q^{(-)}\rangle_i }{\sum_i f_i \langle Q^{(+)}\rangle_i} \;, \label{eq:Asy2} \end{align} where $f_i$ denotes the fraction of channel $i$, which was determined by the event numbers after the kinematic cuts. To estimate the event numbers from $H\to b\bar{b}$ and $H\to c\bar{c}$ modes, the mistagging efficiencies of $\epsilon_{b\to j}=8.9\%$ and $\epsilon_{c\to j}=40.7\%$ have been used~\cite{Gao:2016jcm}. We should note that the fractions $f_{gg},f_{VV}\gg f_{Zjj}$, thus, the asymmetry $\overline{A}_Q^{\rm tot}$ would be not sensitive to the Higgs production cross section and total width; see Eq.~\eqref{eq:Asy2}. To estimate the uncertainty of $\kappa_g$ from the $\overline{A}_Q^{\rm tot}$, we use the error propagation equation to calculate the error of $\overline{A}_Q^{\rm tot}$, {\it i.e.,} \begin{equation} \frac{\delta\overline{A}_Q^{\rm tot}}{\overline{A}_Q^{\rm tot}}=\sqrt{\left(\frac{\delta \langle Q^{(-)}\rangle}{\langle Q^{(-)}\rangle}\right)^2+\left(\frac{\delta \langle Q^{(+)}\rangle}{\langle Q^{(+)}\rangle}\right)^2}, \end{equation} where $\delta \langle Q^{(\pm)}\rangle$ is the statistical error of numerator and denominator of $\overline{A}_Q^{\rm tot}$, and \begin{equation} \delta \langle Q^{(\pm)}\rangle=\sqrt{\sum_i f_i^2\left(\delta \langle Q^{(\pm)}\rangle_i\right)^2}. \end{equation} Here $\delta \langle Q^{(\pm)}\rangle_i$ is the statistical error of $\langle Q^{(\pm)}\rangle_i$ of the $i$-th channel. Figure~\ref{Fig:kg} shows the uncertainties of the $Hgg$ coupling modifier $\kappa_g$ at the CEPC with different jet charge parameters at the 68\% confidence level. We note that the typical uncertainty of $\kappa_g$ from the jet charge asymmetry is around 20\% for the $\mathcal{L}=5.6~{\rm ab}^{-1}$ and the conclusion is not sensitive to the jet charge parameter $\kappa$. According to the updated note of CEPC group in Ref.~\cite{CEPCPhysicsStudyGroup:2022uwl}, the integrated luminosity could be upgraded to $20~{\rm ab}^{-1}$ and the error of $\kappa_g$ could be reduced to around 10\%. It is evident that the expected uncertainty of $\kappa_g$ from the jet charge asymmetry would be 3-4 times larger than the measurements from the jet energy profile~\cite{Li:2018qiy,Li:2019ufu} and the signal strength with $H\to gg$~\cite{An:2018dwb}. However, the different features of the jet charges from the signal and backgrounds also suggest that it could be complementary to other methods for determining $\kappa_g$ when we use advanced technologies such as Boosted Decision Tree (BDT) or Machine Learning in experimental analysis, which is however beyond the scope of this work. \section{Conclusions} In this paper, we propose to constrain the $Hgg$ coupling via the jet charge asymmetry $\overline{A}_Q$ from the Higgs boson decay at the future lepton collider. Owing to the jet charges being fully uncorrelated for the signal $H\to gg$, we demonstrated that $\overline{A}_Q\sim 1$, while the charges from the dominated backgrounds are correlated, as a result, we obtain $\overline{A}_Q>1$. Such a different feature can be used to separate the $H\to gg$ from the backgrounds and to constrain the $Hgg$ coupling. It shows that the uncertainty of the coupling modifier $\kappa_g$ from the jet charge information would be much larger than the traditional methods at the CEPC with an integrated luminosity $\mathcal{L}=5.6~{\rm ab}^{-1}$. But we emphasize that the jet charge information is still useful for determining the $\kappa_g$ if we can combine the jet charge information and other kinematic distributions with the BDT or Machine Learning in the analysis. \vspace{3mm} \medskip \noindent{\bf Acknowledgments.} The authors thank Rui Zhang for the helpful discussion. This work is supported by the IHEP under Contract No. E25153U1. \bibliographystyle{apsrev}
\section{Introduction} $\ \ \ \ $In the present paper, we consider the following Cauchy problem for third-order (in time) evolution equations (proposed by Bezerra-Carvalho-Santos \cite{Bezerra-Carvalho-Santos=2022} recently): \begin{align}\label{Eq-Third-PDE} \begin{cases} u_{ttt}+\mathcal{A}u+\eta\mathcal{A}^{\frac{1}{3}}u_{tt}+\eta\mathcal{A}^{\frac{2}{3}}u_t=f(u),&x\in\mathbb{R}^n,\ t>0,\\ u(0,x)=\epsilon u_0(x),\ u_t(0,x)=\epsilon u_1(x),\ u_{tt}(0,x)=\epsilon u_2(x),&x\in\mathbb{R}^n, \end{cases} \end{align} with a positive constant $\eta$ and power nonlinearity $f(u):=|u|^p$ carrying $p>1$, where the operator $\mathcal{A}^{\alpha}$ with fractional Laplacian $\mathcal{A}:=(-\Delta)^{\sigma}$ carrying $\sigma\in(0,\infty)$ is defined via \begin{align*} \mathcal{A}^{\alpha}u=(-\Delta)^{\sigma\alpha}u:=\mathcal{F}^{-1}_{\xi\to x}\big(|\xi|^{2\sigma\alpha}\,\mathcal{F}_{x\to\xi}(u)(t,\xi)\big)\ \ \mbox{with}\ \ \alpha\in[0,1]. \end{align*} In the above model \eqref{Eq-Third-PDE}, $\epsilon>0$ is a positive parameter describing the size of initial data. Note that the settings $\mathcal{A}=(-\Delta)^{\sigma}$ and $f(u)=|u|^p$ will be used throughout this paper unless otherwise specified. Our first purpose is to determine a critical exponent for the nonlinear third-order (in time) evolution equations \eqref{Eq-Third-PDE} with fractional Laplacian $\mathcal{A}=(-\Delta)^{\sigma}$ carrying $\sigma\in(0,\infty)$. Here, the critical exponent means the threshold condition on the exponent $p$ for global (in time) Sobolev solutions and blow-up of local (in time) weak solutions with small data. To be specific, under additional $L^1$ integrable assumptions for initial data, the new critical exponent, which will raise for the nonlinear Cauchy problem \eqref{Eq-Third-PDE} with $\eta\in(1,\infty)$, is \begin{align}\label{Crit} p=p_{\mathrm{crit}}(n,\sigma):=1+\frac{6\sigma}{(3n-4\sigma)_+}\ \ \mbox{for}\ \ 1\leqslant n\leqslant\frac{10}{3}\sigma. \end{align} A further purpose of this work is to derive sharp lifespan estimates for local (in time) solutions to the nonlinear Cauchy problem \eqref{Eq-Third-PDE} with $\eta\in(1,\infty)$, where the lifespan $T_{\epsilon}$ of a solution is defined by \begin{align}\label{Lifespan_Defn} T_{\epsilon}&:=\sup\big\{T>0:\ \mbox{there exists a unique local (in time) solution }u\mbox{ to the nonlinear}\notag\\ &\qquad\qquad\qquad\quad\ \mbox{ Cauchy problem \eqref{Eq-Third-PDE} on }[0,T)\mbox{ with a fixed parameter }\epsilon>0\big\}. \end{align} We will rigorously demonstrate the sharpness of new lifespan estimates \begin{align*} T_{\epsilon}\begin{cases} \simeq C\epsilon^{-\frac{2\sigma}{6\sigma p'-(3n+2\sigma)}}&\mbox{if}\ \ p<p_{\mathrm{crit}}(n,\sigma),\\ \simeq \exp(C\epsilon^{-(p-1)})&\mbox{if}\ \ p=p_{\mathrm{crit}}(n,\sigma),\\ =\infty&\mbox{if}\ \ p>p_{\mathrm{crit}}(n,\sigma), \end{cases} \end{align*} in which $C$ is an independent of $\epsilon$, positive constant. In the last power, we denote by $p'$ H\"older's conjugate of $p>1$ such that $p'=\frac{p}{p-1}$. It is worth mentioning that the corresponding linearized Cauchy problem to \eqref{Eq-Third-PDE} with Sobolev data is local (in time) ill-posedness if $\eta\in(0,1)$ which will be proved in our manuscript. Let us now recall several background related to our model \eqref{Eq-Third-PDE}. First of all, the authors of \cite{Fattorini=1983,Bezerra-Santos=2020} considered approximations of third-order (in time) linear evolution equations \eqref{Eq-Third-PDE} with $\eta=0$ and $f(u)\equiv0$, whose initial data belongs to some separable Hilbert spaces. The work \cite{Bezerra-Carvalho-Santos=2022} characterized the partial scale of the fractional power of order spaces associated with these operators. Later, the recent paper \cite{Bezerra-Carvalho-Santos=2022} found the threshold $\eta=1$ for the stability of the linearized model to \eqref{Eq-Third-PDE} with $f(u)\equiv0$ by analyzing the eigenvalues of its resolvent operator. Furthermore, the authors of \cite{Bezerra-Carvalho-Santos=2022} presented the local (in time) solvability for the boundary value problem to \eqref{Eq-Third-PDE} with $\sigma=1$, $\eta\in(1,\infty)$ as well as continuously differentiable nonlinearity fulfilling the growth condition $|f'(s)|\lesssim 1+|s|^{p-1}$ carrying $1<p<\frac{3n+4}{3n-8}$ when $n\geqslant 3$. Nevertheless, to the best knowledge of author, global (in time) existence or blow-up of solutions to the nonlinear model \eqref{Eq-Third-PDE} are still not clear due to the high-order time-derivative and the nonlocal operator $\mathcal{A}$. More importantly, the critical exponent and sharp lifespan estimates are cutting-edge topics in semilinear evolution equations with power nonlinearity $f(u)=|u|^p$, for example, the well-known Fujita exponent $p_{\mathrm{Fuj}}(n):=1+\frac{2}{n}$ for reaction-diffusion equations \cite{Fujita-1966,Esco-Herr-1991,Esco-Levi-1995,Fuji-Iked-Waka-2020}, classical damped wave equations \cite{Li-Zhou-1995,Todo-Yord-2001,Zhang-2001,Iked-Ogaw-2016,Lai-Zhou=2019,Ebert-Girardi-Reissig=2020} and some wave equations with effective damping \cite{Wakasugi=2012,D'Abbicco-Lucente-Reissig=2013,D'Abbicco-Ebert=2017,Nasc-Palmieri-Reissig=2017} and references therein. These researches motivate us to study the critical exponent and sharp lifespan estimates to the semilinear Cauchy problem \eqref{Eq-Third-PDE} with $f(u)=|u|^p$. Note that the critical exponent $p_{\mathrm{crit}}(n,\sigma)$ proposed in \eqref{Crit} is not a generalization of the Fujita exponent $p_{\mathrm{Fuj}}(n)$. Lastly, we also refer interested readers to another kind of important third-order (in time) PDEs, which is the so-called Jordan-Moore-Gibson-Thompson equation \cite{Kaltenbacher-Lasiecka-Pos-2012,Racke-Said-2020,B-L-2020,Kaltenbacher-Nikolic-2021,Said-2021-Bes} in recent studies of nonlinear acoustics models in thermoviscous flows. To explore the critical exponent for the semilinear Cauchy problem \eqref{Eq-Third-PDE}, we firstly study some stabilities, sharp estimates and asymptotic profiles of solutions to the linearized Cauchy problem \eqref{Eq-Linear-Third-PDE} by applying Fourier analysis in Section \ref{Sec-linear}, where new thresholds $\eta=1$ and $\eta=3$ will be stated (see Figure \ref{imgg}). Then, in Section \ref{Sec-GESDS} by constructing suitable time-weighted Sobolev spaces, we demonstrate the global (in time) existence of small data solution when $p>p_{\mathrm{crit}}(n,\sigma)$. For another, in the case $1<p\leqslant p_{\mathrm{crit}}(n,\sigma)$, every non-trivial weak solution blows up in finite time under a condition for initial data, which will be proved in Section \ref{Sec-Blow-up}. They infer the critical exponent \eqref{Crit}. To derive sharp lifespan estimates for the semilinear Cauchy problem \eqref{Eq-Third-PDE}, we separate our discussion into several cases. The upper bound estimates when $1<p< p_{\mathrm{crit}}(n,\sigma)$ and the sharp lower bound estimates when $1<p\leqslant p_{\mathrm{crit}}(n,\sigma)$ can be obtained by following the proofs in Sections \ref{Sec-GESDS} and \ref{Sec-Blow-up}, separately. With the aim of completing the sharp upper bound estimates in the critical case $p=p_{\mathrm{crit}}(n,\sigma)$, motivated by \cite{Ikeda-Sobajima=2019,Ebert-Girardi-Reissig=2020} for the semilinear classical damped waves, we introduce the test function \eqref{Su01} with suitable scaling due to fractional Laplacian $\mathcal{A}^{\alpha}=(-\Delta)^{\alpha\sigma}$. These results in Section \ref{Sec-Lifespan} conclude the sharpness of lifespan estimates immediately. \medskip \noindent\textbf{Notations:} \medskip $\ \ $Firstly, $c$ and $C$ denote some positive constants, which may be changed from line to line. $B_R$ stands for a ball around the origin with radius $R$ in $\mathbb{R}^n$. We write $f\lesssim g$ if there exists a positive constant $C$ such that $f\leqslant Cg$. Moreover, $f\simeq g$ means that $f\lesssim g$ and $g\lesssim f$, simultaneously. The Japanese bracket is denoted by $\langle x\rangle:=\sqrt{1+|x|^2}$. Additionally, we write $(x)_+:=\max\{x,0\}$, and $\frac{1}{(x)_+}:=\infty$ if $x\leqslant0$. We take $[x]$ to be the integer part of $x\in\mathbb{R}_+$. We define two zones in the Fourier space ($0<\varepsilon_0\ll 1$): \begin{align*} \mathcal{Z}_{\intt}(\varepsilon_0):=\{|\xi|\leqslant\varepsilon_0\}\ \ \mbox{and}\ \ \mathcal{Z}_{\extt}(\varepsilon_0):=\{|\xi|\geqslant \varepsilon_0\}. \end{align*} The corresponding $\mathcal{C}^{\infty}$ cutoff functions $\chi_{\intt}(\xi)$ and $\chi_{\extt}(\xi)$ equipping their supports in the zones $\mathcal{Z}_{\intt}(\varepsilon_0)$ and $\mathcal{Z}_{\extt}(\varepsilon_0/2)$, respectively, so that $\chi_{\extt}(\xi)=1-\chi_{\intt}(\xi)$ for all $\xi \in \mathbb{R}^n$. A given function $g=g(x)$ belongs to the Gevrey-Sobolev space $G^{m,s}$ if there exists parameters $m\in\mathbb{R}_+$ and $s\in\mathbb{R}$ such that (see, for example, \cite{Rodino=1993}) \begin{align*} \exp\left(c\langle \xi\rangle^{\frac{1}{m}}\right)\langle\xi\rangle^s\,\mathcal{F}(g)\in L^2 \end{align*} with a positive constant $c$. Finally, we introduce the Sobolev space with additional $L^1$ integrability to be the initial data space as follows: \begin{align}\label{Data-space-D} \mathcal{B}_{\sigma}:=\big(H^{\frac{4}{3}\sigma}\cap L^1\big)\times \big(H^{\frac{2}{3}\sigma}\cap L^1\big)\times \big(L^2\cap L^1\big) \end{align} with $\sigma\in(0,\infty)$ in general. \section{Main results and their explanations} \subsection{Results and discussions for the critical exponent} $\ \ \ \ $Let us state the global (in time) existence result in the supercritical case $p>p_{\mathrm{crit}}(n,\sigma)$ introduced by \eqref{Crit} with the initial data space \eqref{Data-space-D}. \begin{theorem}\label{Thm-GESDS} Let $\frac{4}{3}\sigma<n\leqslant\frac{10}{3}\sigma$ with $\sigma\in(0,\infty)$. Let us consider the semilinear Cauchy problem \eqref{Eq-Third-PDE} with $\eta\in(1,\infty)$ and $(u_0,u_1,u_2)\in\mathcal{B}_{\sigma}$. Let the exponent $p$ fulfill \begin{align}\label{H1} p_{\mathrm{crit}}(n,\sigma)<p\leqslant \frac{3n}{(3n-8\sigma)_+}. \end{align} Then, there exists a constant $C>0$ and a parameter $0<\epsilon\ll 1$ such that for all $\|(u_0,u_1,u_2)\|_{\mathcal{B}_{\sigma}}\leqslant C$, there is a uniquely determined Sobolev solution \begin{align}\label{Solution-u} u\in\mathcal{C}\big([0,\infty),H^{\frac{4}{3}\sigma}\big). \end{align} Consequently, the lifespan of solutions is given by $T_{\epsilon}=\infty$. Furthermore, the solution satisfies the following estimates: \begin{align*} \|u(t,\cdot)\|_{L^2}&\lesssim \begin{cases} \epsilon\ln (\mathrm{e}+t)\|(u_0,u_1,u_2)\|_{\mathcal{B}_{\sigma}}&\mbox{if}\ \ n=\frac{8}{3}\sigma\ \mbox{when}\ \eta\in(3,\infty),\\ \epsilon (1+t)^{-\frac{3n-8\sigma}{4\sigma}}\|(u_0,u_1,u_2)\|_{\mathcal{B}_{\sigma}}&\mbox{otherwise,} \end{cases} \end{align*} and \begin{align*} \|u(t,\cdot)\|_{\dot{H}^{\frac{4}{3}\sigma}}&\lesssim\epsilon (1+t)^{-\frac{3n}{4\sigma}}\|(u_0,u_1,u_2)\|_{\mathcal{B}_{\sigma}}. \end{align*} \end{theorem} \begin{remark} The restriction $n\leqslant\frac{10}{3}\sigma$ in Theorem \ref{Thm-GESDS} contributes to the lower bound of the exponent $p$ such that $p>p_{\mathrm{crit}}(n,\sigma)$ due to our purpose of the critical exponent. Note that \eqref{H1} is non-empty. Actually, we also can prove global (in time) existence result with other ranges of the parameters $\sigma$, $n$, $p$, e.g. the global (in time) Sobolev solution \eqref{Solution-u} uniquely exists when \begin{align*} p_{\mathrm{crit}}(n,\sigma)<p\leqslant\frac{3n}{(3n-8\sigma)_+}\ \ \mbox{and}\ \ p\geqslant 2, \end{align*} in the case $\frac{4}{3}\sigma<n<4\sigma$ if $\eta\in(1,3]$, in which $p\geqslant 2$ originates from the application of the fractional Gagliardo-Nirenberg inequality (see Subsection \ref{Subsec-GESDS}). Another example for $4\sigma\leqslant n\leqslant\frac{16}{3}\sigma$ will be stated in Remark \ref{Rem-Scrop-02}. However, it is beyond the scope of our manuscript. \end{remark} \begin{remark} By lengthy but straightforward derivations, under the same condition of the exponent $p$ as \eqref{H1}, the regularity of global (in time) solution \eqref{Solution-u} can be improved by \begin{align*} u\in\mathcal{C}\big([0,\infty),H^{\frac{4}{3}\sigma}\big)\cap \mathcal{C}^1\big([0,\infty),H^{\frac{2}{3}\sigma}\big)\cap\mathcal{C}^2\big([0,\infty),L^2\big) \end{align*} with some estimates for time-derivatives of solutions. The further explanation will be shown later in Remark \ref{Rem-Further_regularity}. \end{remark} \begin{remark} Some derived growth/decay rates in Theorem \ref{Thm-GESDS} coincide with those of the corresponding linearized Cauchy problem \eqref{Eq-Linear-Third-PDE} when $\eta\in(1,\infty)$ in Propositions \ref{Prop-(1,3)}-\ref{Prop-(3)}, which verifies the phenomenon of no loss of growth/decay. Note that the solution itself decays polynomially only when $\frac{8}{3}\sigma<n<\frac{10}{3}\sigma$ in Theorem \ref{Thm-GESDS}. Particularly, Proposition \ref{Prop-sharpness-linear} rigorously demonstrates sharpness of the $(L^2\cap L^1)-L^2$ type estimates for the linearized problem \eqref{Eq-Linear-Third-PDE} so that we conjecture the sharpness of some derived estimates in Theorem \ref{Thm-GESDS}. But, there is a logarithmic loss technically for $n=\frac{8}{3}\sigma$ when $\eta\in(3,\infty)$. \end{remark} We now turn our mind to a blow-up result in the subcritical case $p<p_{\mathrm{crit}}(n,\sigma)$ as well as the critical case $p=p_{\mathrm{crit}}(n,\sigma)$ under a sign condition of the third initial data. \begin{theorem}\label{Thm-Blow-up} Let us consider the semilinear Cauchy problem \eqref{Eq-Third-PDE} with $\eta\in(1,\infty)$, $\sigma\in(0,\infty)$, and $u_0,u_1,u_2\in L^1$ such that \begin{align}\label{Sign_Assumption} \int_{\mathbb{R}^n}u_2(x)\mathrm{d}x>0. \end{align} Let the exponent $p$ fulfill $1<p\leqslant p_{\mathrm{crit}}(n,\sigma)$. Then, according to the definition \eqref{Weak_Solution}, every non-trivial local (in time) weak solution for the semilinear model \eqref{Eq-Third-PDE} blows up in finite time. \end{theorem} \begin{remark} The blow-up result still holds when \begin{align*} \int_{\mathbb{R}^n}\left(\eta \mathcal{A}^{\frac{2}{3}}u_0(x)+\eta\mathcal{A}^{\frac{1}{3}} u_1(x)+u_2(x)\right)\mathrm{d}x>0 \end{align*} instead of the single sign condition \eqref{Sign_Assumption}, whereas we suppose that $\mathcal{A}^{\frac{2}{3}}u_0,\mathcal{A}^{\frac{1}{3}} u_1,u_2\in L^1$ with $\mathcal{A}=(-\Delta)^{\sigma}$. Namely, another sign condition of getting the blow-up result with $1<p\leqslant p_{\mathrm{crit}}(n,\sigma)$ even for the failure of \eqref{Sign_Assumption}. The proof is just a slight modification to the left-hand side of \eqref{Blow-up-01}. \end{remark} \begin{remark} Recalling the notation \eqref{Crit}, the condition $1<p\leqslant p_{\mathrm{crit}}(n,\sigma)$ in Theorem \ref{Thm-Blow-up} includes the special case that every non-trivial weak solution blows up with any $p>1$ when $n\leqslant\frac{4}{3}\sigma$ and $\sigma\in(0,\infty)$. This is the reason for the general restriction $n>\frac{4}{3}\sigma$ in the global (in time) existence result from Theorem \ref{Thm-GESDS}. \end{remark} To end this subsection, we analyze the new critical exponent to the Cauchy problem for semilinear third-order (in time) evolution equations \eqref{Eq-Third-PDE}. According to Theorems \ref{Thm-GESDS} and \ref{Thm-Blow-up}, we immediately conclude the critical exponent $p=p_{\mathrm{crit}}(n,\sigma)$ given by \eqref{Crit} when $n\leqslant\frac{10}{3}\sigma$ and $\eta\in(1,\infty)$. The critical exponent for the higher dimensional case, i.e. $n> \frac{10}{3}\sigma$, may be obtained by using more general $L^r-L^q$ estimates, $1\leqslant r\leqslant q\leqslant \infty$, but this task is beyond the scope of this paper. \begin{exam} Let us consider the semilinear problem \eqref{Eq-Third-PDE} with $\sigma=3$ and $\eta\in(1,\infty)$, namely, \begin{align}\label{Example} \begin{cases} u_{ttt}-\Delta^3 u-\eta\Delta u_{tt}+\eta\Delta^2 u_t=|u|^p,&x\in\mathbb{R}^n,\ t>0,\\ u(0,x)=\epsilon u_0(x),\ u_t(0,x)=\epsilon u_1(x),\ u_{tt}(0,x)=\epsilon u_2(x),&x\in\mathbb{R}^n, \end{cases} \end{align} in which the equation can be understood by the heat operator acting on the semilinear structurally damped plate model \cite{Pham-Kainane-Reissig=2015,D'Abbicco-Ebert=2017} as follows: \begin{align*} (\partial_t-\Delta)\big(u_{tt}+\Delta^2 u-(\eta-1)\Delta u_{t}\big)=|u|^p. \end{align*} Combining with Theorems \ref{Thm-GESDS} and \ref{Thm-Blow-up}, we assume the small data with $0<\epsilon\ll 1$ satisfying \begin{align}\label{H2} (u_0,u_1,u_2)\in (H^{4}\cap L^1)\times (H^{2}\cap L^1)\times (L^2\cap L^1) \ \ \mbox{and}\ \ \int_{\mathbb{R}^n}u_2(x)\mathrm{d}x>0. \end{align} Then, the critical exponent for \eqref{Example} is given by \begin{align*} p=p_{\mathrm{crit}}(n,3)=1+\frac{6}{(n-4)_+} \end{align*} when $n=1,\dots,10$ for all $\eta\in(1,\infty)$. \end{exam} \subsection{Results and discussions for sharp lifespan estimates} $\ \ \ \ $As we explained in Theorem \ref{Thm-Blow-up}, under the vital condition $1<p\leqslant p_{\mathrm{crit}}(n,\sigma)$, every non-trivial local (in time) solution blows up in finite time, which motivates us to provide more detailed information of the lifespan $T_{\epsilon}$ defined in \eqref{Lifespan_Defn}. Before investigating lower bound estimates for the lifespan $T_{\epsilon}$, let us define mild solutions to the semilinear Cauchy problem \eqref{Eq-Third-PDE} with $T>0$ for $u\in\mathcal{C}([0,T],H^{\frac{4}{3}\sigma})$ as solutions of the following operator equality: \begin{align}\label{Mild-Solution} u(t,x)=\epsilon\sum\limits_{j=0,1,2}E_j(t,x)\ast_{(x)}u_j(x)+\int_0^tE_2(t-\tau,x)\ast_{(x)}|u(\tau,x)|^p\mathrm{d}\tau \end{align} for $t\in[0,T]$. In the above equation, $E_j(t,x)$ with $j=0,1,2$ are the fundamental solutions to the corresponding linearized Cauchy problem \eqref{Eq-Linear-Third-PDE} with initial data $v_j(x)=\delta_0$ and $v_k(x)=0$ carrying $k\neq j$. Here, $\delta_0$ is the Dirac distribution at $x=0$. Let us introduce by $T_{\epsilon,\mathrm{m}}$ the lifespan of a mild solution $u=u(t,x)$. Then, lower bound estimates of $T_{\epsilon,\mathrm{m}}$ are given by the next theorem. \begin{theorem}\label{Thm-Lifespan-lower} Let $\frac{4}{3} \sigma<n\leqslant\frac{10}{3}\sigma$ if $\eta\in(1,3)\cup(3,\infty)$, and $n\leqslant\frac{10}{3}\sigma$ if $\eta=3$ with $\sigma\in(0,\infty)$. Let us consider the semilinear Cauchy problem \eqref{Eq-Third-PDE} with $\eta\in(1,\infty)$ and $(u_0,u_1,u_2)\in\mathcal{B}_{\sigma}$. Let the exponent $p$ fulfill $2\leqslant p\leqslant p_{\mathrm{crit}}(n,\sigma)$. Then, there exists a constant $\epsilon_1$ such that for any $\epsilon\in(0,\epsilon_1]$, the lifespan $T_{\epsilon,\mathrm{m}}$ of mild solutions from the definition \eqref{Mild-Solution} satisfies \begin{align}\label{Lifespan+Upper+Bound} T_{\epsilon,\mathrm{m}}\geqslant\begin{cases} C \epsilon^{-\frac{2\sigma}{6\sigma p'-(3n+2\sigma)}}&\mbox{if}\ \ p<p_{\mathrm{crit}}(n,\sigma),\\ \exp(C\epsilon^{-(p-1)})&\mbox{if}\ \ p=p_{\mathrm{crit}}(n,\sigma), \end{cases} \end{align} where $C$ is a positive constant independent of $\epsilon$ and depends on $p,n,\sigma,\eta$ as well as $\|(u_0,u_1,u_2)\|_{\mathcal{B}_{\sigma}}$. \end{theorem} \begin{remark} The restriction $n\leqslant\frac{10}{3}\sigma$ contributes to the non-empty set $2\leqslant p\leqslant p_{\mathrm{crit}}(n,\sigma)$ because the lifespan $T_{\epsilon}=\infty$ when $p>p_{\mathrm{crit}}(n,\sigma)$ proposed in Theorem \ref{Thm-GESDS}. Here, the lower bound $p\geqslant 2$, again, comes from the application of the fractional Gagliardo-Nirenberg inequality, which can be improved by using more general $L^r-L^q$ estimates carrying $1\leqslant r\leqslant q\leqslant \infty$. \end{remark} To guarantee sharpness of the derived lifespan estimates \eqref{Lifespan+Upper+Bound}, we have to estimate it from the above side. Therefore, we turn to upper bound estimates for the lifespan $T_{\epsilon,\mathrm{w}}$ of a weak solution in the subsequent theorem. \begin{theorem}\label{Thm-Lifespan-upper} Let us consider the semilinear Cauchy problem \eqref{Eq-Third-PDE} with $\eta\in(1,\infty)$ and initial data satisfying the sign condition \eqref{Sign_Assumption}. \begin{itemize} \item In the subcritical case $1<p<p_{\mathrm{crit}}(n,\sigma)$, assuming $u_0,u_1,u_2\in L^1$ and $\sigma\in(0,\infty)$, the lifespan $T_{\epsilon,\mathrm{w}}$ of weak solutions satisfies \begin{align}\label{Upper-1} T_{\epsilon,\mathrm{w}}\leqslant C \epsilon^{-\frac{2\sigma}{6\sigma p'-(3n+2\sigma)}}. \end{align} \item In the critical case $p=p_{\mathrm{crit}}(n,\sigma)$, assuming $u_0,u_1,u_2\in \mathcal{C}_0^{\infty}$ and $\sigma\in3\mathbb{N}$, the lifespan $T_{\epsilon,\mathrm{w}}$ of weak solutions satisfies \begin{align}\label{Upper-2} T_{\epsilon,\mathrm{w}}\leqslant \exp(C\epsilon^{-(p-1)}). \end{align} \end{itemize} Here, $C$ is a positive constant independent of $\epsilon$ and depends on $p,n,\sigma,\eta$ as well as $\|u_2\|_{L^1}$. \end{theorem} \begin{remark} In the critical case, the technical assumption $\sigma\in3\mathbb{N}$ comes from the treatment of the operator $\mathcal{A}^{\frac{1}{3}}=(-\Delta)^{\frac{1}{3}\sigma}$. The question of sharp upper bound estimates \eqref{Upper-2} when $p=p_{\mathrm{crit}}(n,\sigma)$ for a general parameter $\sigma\in(0,\infty)$ is still open. \end{remark} By the standard density argument (see, for example, \cite[Proposition 3.1]{Ikeda-Wakasugi=2013}), provided that $u$ is a mild solution to the semilinear Cauchy problem \eqref{Eq-Third-PDE}, then $u$ is also a weak solution to it. Therefore, the relation $T_{\epsilon,\mathrm{m}}\leqslant T_{\epsilon}\leqslant T_{\epsilon,\mathrm{w}}$ is valid. Let us summarize the lower bound estimates \eqref{Lifespan+Upper+Bound}, and upper bound estimates \eqref{Upper-1}-\eqref{Upper-2}. We may claim that the sharp lifespan estimates to $T_{\epsilon}$ for local (in time) solutions to the semilinear Cauchy problem \eqref{Eq-Third-PDE} with $p\geqslant 2$ are given by \begin{align*} T_{\epsilon}\simeq\begin{cases} C\epsilon^{-\frac{2\sigma}{6\sigma p'-(3n+2\sigma)}}&\mbox{if}\ \ p<p_{\mathrm{crit}}(n,\sigma),\\ \exp\big(C\epsilon^{-\frac{6\sigma}{(3n-4\sigma)_+}}\big)&\mbox{if}\ \ p=p_{\mathrm{crit}}(n,\sigma),\\ \end{cases} \end{align*} for some parameters $n,\sigma$, with a positive constant $C$ independent of $\epsilon$. \begin{exam} Let us consider the semilinear Cauchy problem \eqref{Example}. Combining with Theorems \ref{Thm-Lifespan-lower} and \ref{Thm-Lifespan-upper}, we assume the small data with $0<\epsilon\ll 1$ satisfying \eqref{H2}, and additionally $\mathcal{C}_0^{\infty}$ regularities with supports for initial data if $p=p_{\mathrm{crit}}(n,3)=1+\frac{6}{(n-4)_+}$. Then, the sharp lifespan estimates for \eqref{Example} with $p\geqslant 2$ are given by \begin{align*} T_{\epsilon}\simeq\begin{cases} C\epsilon^{-\frac{2}{6 p'-(n+2)}}&\mbox{if}\ \ p<1+\frac{6}{(n-4)_+},\\ \exp\big(C\epsilon^{-\frac{6}{(n-4)_+}}\big)&\mbox{if}\ \ p=1+\frac{6}{(n-4)_+},\\ \end{cases} \end{align*} when $n=5,\dots,10$ if $\eta\in(1,3)\cup(3,\infty)$, and $n=1,\dots,10$ when $\eta=3$. \end{exam} \section{Linearized third-order (in time) evolution equations}\label{Sec-linear} $\ \ \ \ $As a preparation to study the semilinear Cauchy problem \eqref{Eq-Third-PDE} and investigate some influence of the parameter $\eta$, in this section, we consider the corresponding linearized third-order (in time) evolution equations with vanishing right-hand side, namely, \begin{align}\label{Eq-Linear-Third-PDE} \begin{cases} v_{ttt}+\mathcal{A}v+\eta\mathcal{A}^{\frac{1}{3}}v_{tt}+\eta\mathcal{A}^{\frac{2}{3}}v_t=0,&x\in\mathbb{R}^n,\ t>0,\\ v(0,x)=v_0(x),\ v_t(0,x)= v_1(x),\ v_{tt}(0,x)=v_2(x),&x\in\mathbb{R}^n, \end{cases} \end{align} where $\mathcal{A}=(-\Delta)^{\sigma}$ with $\sigma\in(0,\infty)$ and $\eta\in(0,\infty)$. In particular, we will introduce two thresholds: $\eta=1$ for the Sobolev stability, and $\eta=3$ for various asymptotic profiles of solutions. One may see the detailed explanations in Remark \ref{Rem-eta=1}, Remark \ref{Rem-eta=3} as well as Figure \ref{imgg} later. \subsection{Stability analysis of Sobolev solutions} $\ \ \ \ $Let us apply the partial Fourier transform with respect to the spatial variables to the linearized Cauchy problem \eqref{Eq-Linear-Third-PDE} to derive \begin{align}\label{Eq-Fourier-Third-PDE} \begin{cases} \widehat{v}_{ttt}+|\xi|^{2\sigma}\widehat{v}+\eta|\xi|^{\frac{2}{3}\sigma}\widehat{v}_{tt}+\eta|\xi|^{\frac{4}{3}\sigma}\widehat{v}_t=0,&\xi\in\mathbb{R}^n,\ t>0,\\ \widehat{v}(0,\xi)=\widehat{v}_0(\xi),\ \widehat{v}_t(0,\xi)= \widehat{v}_1(\xi),\ \widehat{v}_{tt}(0,\xi)=\widehat{v}_2(\xi),&\xi\in\mathbb{R}^n, \end{cases} \end{align} whose characteristic equation \begin{align*} (\lambda+|\xi|^{\frac{2}{3}\sigma})\big(\lambda^2+(\eta-1)|\xi|^{\frac{2}{3}\sigma}\lambda+|\xi|^{\frac{4}{3}\sigma}\big)=0 \end{align*} has the $|\xi|$-dependent roots \begin{align}\label{Characteristic_Roots} \lambda_1=-|\xi|^{\frac{2}{3}\sigma}\ \ \mbox{and}\ \ \lambda_{2,3}=\frac{1}{2}\left(1-\eta\pm\sqrt{\eta^2-2\eta-3}\,\right)|\xi|^{\frac{2}{3}\sigma}. \end{align} Therewith, we may demonstrate the ill-/well-posedness results of Sobolev solutions to the linearized Cauchy problem \eqref{Eq-Linear-Third-PDE} under different size of $\eta$ and regularities of initial data. \begin{prop}\label{Prop-Stable} Let us consider the linearized Cauchy problem \eqref{Eq-Linear-Third-PDE} with $\eta\in(0,\infty)$ as well as $\sigma\in(0,\infty)$. \begin{enumerate}[(1)] \item Assuming the Gevrey-Sobolev regularities for initial data $v_j\in G^{\frac{3}{2\sigma},s+\frac{2(2-j)}{3}\sigma}$ with $j=0,1,2$, there exists a unique Sobolev solution \begin{align}\label{Sobolev-solution} v\in\mathcal{C}\big([0,\infty),H^{s+\frac{4}{3}\sigma}\big)\cap \mathcal{C}^1\big([0,\infty),H^{s+\frac{2}{3}\sigma}\big)\cap \mathcal{C}^2\big([0,\infty),H^{s}\big) \end{align} to the Cauchy problem \eqref{Eq-Linear-Third-PDE} with $\eta\in(0,1)$ for any $s\in[0,\infty)$. However, by assuming any Sobolev regularities for initial data, the Cauchy problem \eqref{Eq-Linear-Third-PDE} with $\eta\in(0,1)$ is ill-posed. \item Assuming the Sobolev regularities for initial data $v_j\in H^{s+\frac{2(2-j)}{3}\sigma}$ with $j=0,1,2$, there exists a unique Sobolev solution \eqref{Sobolev-solution} to the Cauchy problem \eqref{Eq-Linear-Third-PDE} with $\eta=1$ for any $s\in[0,\infty)$. \item Assuming the Sobolev regularities for initial data $v_j\in H^{s+\frac{2(2-j)}{3}\sigma}$ with $j=0,1,2$, there exists a unique Gevrey-Sobolev solution \begin{align*} v\in\mathcal{C}\big([0,\infty),G^{\frac{3}{2\sigma},s+\frac{4}{3}\sigma}\big)\cap \mathcal{C}^1\big([0,\infty),G^{\frac{3}{2\sigma},s+\frac{2}{3}\sigma}\big)\cap \mathcal{C}^2\big([0,\infty),G^{\frac{3}{2\sigma},s}\big) \end{align*} to the Cauchy problem \eqref{Eq-Linear-Third-PDE} with $\eta\in(1,\infty)$ for any $s\in[0,\infty)$. \end{enumerate} \end{prop} \begin{proof} According to the size of $\eta$ and the value of characteristic roots $\lambda_{2,3}$, we will divide our discussion into several cases. To begin with the proof, let us derive representations of solution in the Fourier space with different size of $\eta$.\\ \underline{\bf Representation of solution when $\eta\in(0,3)$:} Because of $\eta^2-2\eta-3<0$ when $\eta\in(0,3)$, by taking $\lambda_{2,3}=\mu_{\mathrm{R}}\pm i\mu_{\mathrm{I}}$ endowed with \begin{align*} \mu_{\mathrm{R}}:=\frac{1}{2}(1-\eta)|\xi|^{\frac{2}{3}\sigma}\begin{cases} >0&\mbox{if}\ \ \eta\in(0,1),\\ =0&\mbox{if}\ \ \eta=1,\\ <0&\mbox{if}\ \ \eta\in(1,3), \end{cases}\ \ \mbox{and}\ \ \mu_{\mathrm{I}}:=\frac{1}{2}\sqrt{3+2\eta-\eta^2}\,|\xi|^{\frac{2}{3}\sigma}, \end{align*} the solution $\widehat{v}=\widehat{v}(t,\xi)$ to the initial value problem \eqref{Eq-Fourier-Third-PDE} can be expressed by \begin{align} \widehat{v}&=\frac{-(\mu_{\mathrm{I}}^2+\mu_{\mathrm{R}}^2)\widehat{v}_0+2\mu_{\mathrm{R}}\widehat{v}_1-\widehat{v}_2}{2\mu_{\mathrm{R}}\lambda_1-\mu_{\mathrm{I}}^2-\mu_{\mathrm{R}}^2-\lambda_1^2}\mathrm{e}^{\lambda_1t}+\frac{(2\mu_{\mathrm{R}}\lambda_1-\lambda_1^2)\widehat{v}_0-2\mu_{\mathrm{R}}\widehat{v}_1+\widehat{v}_2}{2\mu_{\mathrm{R}}\lambda_1-\mu_{\mathrm{I}}^2-\mu_{\mathrm{R}}^2-\lambda_1^2}\cos(\mu_{\mathrm{I}}t)\,\mathrm{e}^{\mu_{\mathrm{R}}t}\notag\\ &\quad+\frac{\lambda_1(\mu_{\mathrm{R}}\lambda_1+\mu_{\mathrm{I}}^2-\mu_{\mathrm{R}}^2)\widehat{v}_0+(\mu_{\mathrm{R}}^2-\mu_{\mathrm{I}}^2-\lambda_1^2)\widehat{v}_1-(\mu_{\mathrm{R}}-\lambda_1)\widehat{v}_2}{\mu_{\mathrm{I}}(2\mu_{\mathrm{R}}\lambda_1-\mu_{\mathrm{I}}^2-\mu_{\mathrm{R}}^2-\lambda_1^2)}\sin(\mu_{\mathrm{I}}t)\,\mathrm{e}^{\mu_{\mathrm{R}}t}\notag\\ &=-\frac{|\xi|^{\frac{4}{3}\sigma}\widehat{v}_0+(\eta-1)|\xi|^{\frac{2}{3}\sigma}\widehat{v}_1+\widehat{v}_2}{(\eta-3)|\xi|^{\frac{4}{3}\sigma}}\mathrm{e}^{-|\xi|^{\frac{2}{3}\sigma}t}\notag\\ &\quad+\frac{(\eta-2)|\xi|^{\frac{4}{3}\sigma}\widehat{v}_0+(\eta-1)|\xi|^{\frac{2}{3}\sigma}\widehat{v}_1+\widehat{v}_2}{(\eta-3)|\xi|^{\frac{4}{3}\sigma}}\cos(C_{\eta}|\xi|^{\frac{2}{3}\sigma}t)\,\mathrm{e}^{\frac{1}{2}(1-\eta)|\xi|^{\frac{2}{3}\sigma }t}\notag\\ &\quad+\frac{\eta|\xi|^{\frac{4}{3}\sigma}\widehat{v}_0+(\eta+1)|\xi|^{\frac{2}{3}\sigma}\widehat{v}_1+\widehat{v}_2}{2C_{\eta}|\xi|^{\frac{4}{3}\sigma}}\sin(C_{\eta}|\xi|^{\frac{2}{3}\sigma}t)\,\mathrm{e}^{\frac{1}{2}(1-\eta)|\xi|^{\frac{2}{3}\sigma }t}\label{B1} \end{align} with the constant $C_{\eta}:=\frac{1}{2}\sqrt{3+2\eta-\eta^2}>0$ as $\eta\in(0,3)$. \\ \underline{\bf Representation of solution when $\eta\in(3,\infty)$:} Due to the pairwise distinct characteristic roots, we may employ the general representation (it also holds for any $\eta\neq 3$) as follows: \begin{align*} \widehat{v}=\widehat{K}_0\widehat{v}_0+\widehat{K}_1\widehat{v}_1+\widehat{K}_2\widehat{v}_2 \end{align*} with the kernels in the Fourier space carrying $k=1,2,3$ such that \begin{align*} \widehat{K}_0:=\sum\limits_{j=1,2,3}\frac{\mathrm{e}^{\lambda_jt}\prod\limits_{k\neq j}\lambda_k}{\prod\limits_{k\neq j}(\lambda_j-\lambda_k)},\ \ \widehat{K}_1:=-\sum\limits_{j=1,2,3}\frac{\mathrm{e}^{\lambda_jt}\sum\limits_{k\neq j}\lambda_k}{\prod\limits_{k\neq j}(\lambda_j-\lambda_k)},\ \ \widehat{K}_2:=\sum\limits_{j=1,2,3}\frac{\mathrm{e}^{\lambda_jt}}{\prod\limits_{k\neq j}(\lambda_j-\lambda_k)}. \end{align*} Remark that \eqref{B1} was deduced by the last kernels associated with the conjugate roots $\lambda_{2,3}$. Combining with the characteristic roots and denoting $D_{\eta}:=\frac{1}{2}\sqrt{\eta^2-2\eta-3}>0$ as $\eta\in(3,\infty)$, which fulfills the relation $D_{\eta}+\frac{1}{2}(1-\eta)<0$, the explicit representation of solution in the Fourier space for $\eta\in(3,\infty)$ is given by \begin{align} \widehat{v}&=\left[\frac{\mathrm{e}^{-|\xi|^{\frac{2}{3}\sigma}t}}{3-\eta}+\frac{\mathrm{e}^{\frac{1}{2}(1-\eta)|\xi|^{\frac{2}{3}\sigma }t}}{2D_{\eta}}\left(\frac{2D_{\eta}-1+\eta}{3-\eta+2D_{\eta}}\mathrm{e}^{D_{\eta}|\xi|^{\frac{2}{3}\sigma }t}+\frac{2D_{\eta}+1-\eta}{3-\eta-2D_{\eta}}\mathrm{e}^{-D_{\eta}|\xi|^{\frac{2}{3}\sigma }t}\right)\right]\widehat{v}_0\notag\\ &\quad+\left[\frac{(\eta-1)\mathrm{e}^{-|\xi|^{\frac{2}{3}\sigma }t}}{(3-\eta)|\xi|^{\frac{2}{3}\sigma }}+\frac{\mathrm{e}^{\frac{1}{2}(1-\eta)|\xi|^{\frac{2}{3}\sigma }t}}{2D_{\eta}|\xi|^{\frac{2}{3}\sigma }}\left(\frac{2D_{\eta}+1+\eta}{3-\eta+2D_{\eta}}\mathrm{e}^{D_{\eta}|\xi|^{\frac{2}{3}\sigma }t}+\frac{2D_{\eta}-1-\eta}{3-\eta-2D_{\eta}}\mathrm{e}^{-D_{\eta}|\xi|^{\frac{2}{3}\sigma }t}\right)\right]\widehat{v}_1\notag\\ &\quad+\left[\frac{\mathrm{e}^{-|\xi|^{\frac{2}{3}\sigma }t}}{(3-\eta)|\xi|^{\frac{4}{3}\sigma }}+\frac{\mathrm{e}^{\frac{1}{2}(1-\eta)|\xi|^{\frac{2}{3}\sigma }t}}{D_{\eta}|\xi|^{\frac{4}{3}\sigma }}\left(\frac{1}{3-\eta+2D_{\eta}}\mathrm{e}^{D_{\eta}|\xi|^{\frac{2}{3}\sigma }t}-\frac{1}{3-\eta-2D_{\eta}}\mathrm{e}^{-D_{\eta}|\xi|^{\frac{2}{3}\sigma }t}\right)\right]\widehat{v}_2.\label{B2} \end{align} \underline{\bf Representation of solution when $\eta=3$:} Finally, the identical characteristic roots $\lambda_1=\lambda_2=\lambda_3=-|\xi|^{\frac{2}{3}\sigma}$ when $\eta=3$ imply \begin{align*} \widehat{v}=\left[\widehat{v}_0+\left(|\xi|^{\frac{2}{3}\sigma}\widehat{v}_0+\widehat{v}_1\right)t+\frac{1}{2}\left(|\xi|^{\frac{4}{3}\sigma}\widehat{v}_0+2|\xi|^{\frac{2}{3}\sigma}\widehat{v}_1+\widehat{v}_2\right)t^2\right]\mathrm{e}^{-|\xi|^{\frac{2}{3}\sigma}t}. \end{align*} It is well-known that the well-posedness of Cauchy problem is determined by the large frequencies part, consequently we may apply the previous representations of solution to get the following pointwise estimates in the Fourier space: \begin{align}\label{Critical-Gevrey-data-01} \chi_{\extt}(\xi)|\widehat{v}|&\lesssim \begin{cases} \chi_{\extt}(\xi)\,\mathrm{e}^{c|\xi|^{\frac{2}{3}\sigma}t}\left(|\widehat{v}_0|+\langle\xi\rangle^{-\frac{2}{3}\sigma}|\widehat{v}_1|+\langle\xi\rangle^{-\frac{4}{3}\sigma}|\widehat{v}_2|\right)&\mbox{if}\ \ \eta\in(0,1),\\ \chi_{\extt}(\xi)\left(|\widehat{v}_0|+\langle\xi\rangle^{-\frac{2}{3}\sigma}|\widehat{v}_1|+\langle\xi\rangle^{-\frac{4}{3}\sigma}|\widehat{v}_2|\right)&\mbox{if}\ \ \eta=1,\\ \chi_{\extt}(\xi)\,\mathrm{e}^{-c|\xi|^{\frac{2}{3}\sigma}t}\left(|\widehat{v}_0|+\langle\xi\rangle^{-\frac{2}{3}\sigma}|\widehat{v}_1|+\langle\xi\rangle^{-\frac{4}{3}\sigma}|\widehat{v}_2|\right)&\mbox{if}\ \ \eta\in(1,3)\cup(3,\infty),\\ \chi_{\extt}(\xi)\,\mathrm{e}^{-c|\xi|^{\frac{2}{3}\sigma}t}\big(|\widehat{v}_0|+t|\widehat{v}_1|+t^2|\widehat{v}_2|\big)&\mbox{if}\ \ \eta=3, \end{cases} \end{align} with some positive constants $c>0$, where we used $y\,\mathrm{e}^{-2y}\lesssim \mathrm{e}^{-y}$. Then, let us discuss the well-posed property in several situations. \begin{description} \item[Case 1: $\eta\in(0,1)$.] If we assume any Sobolev regularities for initial data, due to the exponential growth for large frequencies $\chi_{\extt}(\xi)\exp(c|\xi|^{\frac{2}{3}\sigma}t)$ with $c>0$, the Sobolev solution is instable. It leads to the ill-posedness of the linearized Cauchy problem \eqref{Eq-Linear-Third-PDE}, which exactly coincides with \cite[Theorem 3.1]{Bezerra-Carvalho-Santos=2022}. Nevertheless, by assuming the Gevrey-Sobolev regularities for initial data $v_j\in G^{\frac{3}{2\sigma},s+\frac{2(2-j)}{3}\sigma}$ with $j=0,1,2$, namely, $\exp(c\langle\xi\rangle^{\frac{2}{3}\sigma})\langle\xi\rangle^{s+\frac{2(2-j)}{3}\sigma}\widehat{v}_j\in L^2$, one may arrive at \begin{align}\label{Eq-01} \chi_{\extt}(\xi)\langle\xi\rangle^{s+\frac{2(2-j)}{3}\sigma}\partial_t^j\widehat{v}\in L^2\ \ \mbox{with}\ \ j=0,1,2. \end{align} Hereinafter, the $L^2$ space concerns the variables $\xi$. Thus, the well-posedness result with the Gevrey-Sobolev data can be proved straightforwardly when $\eta\in(0,1)$. \item[Case 2: $\eta=1$.] By taking $v_j\in H^{s+\frac{2(2-j)}{3}\sigma}$, i.e. $\langle\xi\rangle^{s+\frac{2(2-j)}{3}\sigma}\widehat{v}_j\in L^2$, for $j=0,1,2$, we notice that \eqref{Eq-01} still holds, which implies the well-posedness of the Cauchy problem \eqref{Eq-Linear-Third-PDE} when $\eta=1$ with the Sobolev data. \item[Case 3: $\eta\in(1,\infty)$.] Similarly to Case 2, the well-posedness statement for the Sobolev solution is easily achieved by assuming $v_j\in H^{s+\frac{2(2-j)}{3}\sigma}$ with $j=0,1,2$. Furthermore, benefited from the exponential propagator $\chi_{\extt}(\xi)\exp(-c|\xi|^{\frac{2}{3}\sigma}t)$, we may derive \begin{align*} \chi_{\extt}(\xi)\,\mathrm{e}^{c|\xi|^{\frac{2}{3}\sigma}t}\langle\xi\rangle^{s+\frac{2(2-j)}{3}\sigma}\partial_t^j\widehat{v}\in L^2\ \ \mbox{with}\ \ j=0,1,2. \end{align*} It leads to smoothing effect from the Sobolev data to the general Gevrey solution and the well-posedness of the Cauchy problem \eqref{Eq-Linear-Third-PDE} when $\eta\in(1,\infty)$. \end{description} Summarizing the last statements, our proof is totally completed. \end{proof} \begin{remark}\label{Rem-eta=1} By taking the suitably regular Sobolev data, $\eta=1$ is the important threshold for the Sobolev stability to the linearized Cauchy problem \eqref{Eq-Linear-Third-PDE}, in other words, the model is instable when $\eta\in(0,1)$ but stable when $\eta\in[1,\infty)$. We refer to Figure \ref{imgg}. This phenomenon has been found firstly by \cite{Bezerra-Carvalho-Santos=2022} in the semigroup setting. \end{remark} \begin{remark} Let us consider the critical index for the Gevrey data, which is an interesting topic in recent years, e.g. the $G^2$ initial data for the 2D Prandtl equation \cite{Gerard-Dormy=2010,Dietert-Gerard=2019}. According to the first statement of Proposition \ref{Prop-Stable}, we also may show the stability of Sobolev solution even when $\eta\in(0,1)$ with the suitable Gevrey-Sobolev data $v_j\in G^{\rho,s+\frac{2(2-j)}{3}\sigma}$ with $j=0,1,2$ carrying $0<\rho\leqslant \frac{3}{2\sigma}$ due to \eqref{Critical-Gevrey-data-01} and the fact that \begin{align*} \chi_{\extt}(\xi)\exp\left(c|\xi|^{\frac{2}{3}\sigma}t-c|\xi|^{\frac{1}{\rho}}t\right)\lesssim 1\ \ \mbox{only when}\ \ \rho\leqslant\frac{3}{2\sigma}. \end{align*} That is to say, the Sobolev solution to the linearized Cauchy problem \eqref{Eq-Linear-Third-PDE} with $\eta\in(0,1)$ and Gevrey-Sobolev data becomes instable again when the Gevrey index $\rho>\frac{3}{2\sigma}$, which means that $\rho=\frac{3}{2\sigma}$ is the critical index of the Gevrey-Sobolev data. \end{remark} \begin{remark} The Gevrey smoothing effect occurs when $\eta\in(1,\infty)$ from the Sobolev data to the Gevrey-Sobolev solution to the linearized Cauchy problem \eqref{Eq-Linear-Third-PDE}, in which $\sigma=\frac{3}{2}$ is the threshold to distinguish different degree of smoothing effect, namely, there exists a Gevrey solution when $\sigma\in(0,\frac{3}{2})$, an analytic solution when $\sigma=\frac{3}{2}$, and an ultra-analytic solution when $\sigma\in(\frac{3}{2},\infty)$. \end{remark} \subsection{Some sharp estimates and asymptotic profiles of solutions as $\eta\in(1,\infty)$} $\ \ \ \ $In this subsection, we derive some sharp $L^2$ estimates of solutions to the linearized Cauchy problem \eqref{Eq-Linear-Third-PDE} with $L^2$ data or $L^2\cap L^1$ data, which will contribute to the proof of Theorem \ref{Thm-GESDS}. Before doing these, let us state some preliminaries. \begin{lemma}\label{Lem-01} Let $n>-2s$ and $\sigma\in(0,\infty)$. The following estimates hold: \begin{align}\label{Su02} \left\|\chi_{\intt}(\xi)|\xi|^s\mathrm{e}^{-c|\xi|^{\frac{2}{3}\sigma}t}\right\|_{L^2}\lesssim(1+t)^{-\frac{3(2s+n)}{4\sigma}}. \end{align} \end{lemma} \begin{proof} Applying polar coordinates and the change of variable $\omega=r^{\frac{2}{3}\sigma}t$, we directly obtain \begin{align*} \left\|\chi_{\intt}(\xi)|\xi|^s\mathrm{e}^{-c|\xi|^{\frac{2}{3}\sigma}t}\right\|_{L^2}^2&\lesssim\int_0^{\varepsilon_0}r^{2s+n-1}\mathrm{e}^{-2cr^{\frac{2}{3}\sigma}t}\mathrm{d}r\\ &\lesssim t^{-\frac{3(2s+n)}{2\sigma}}\int_0^{\infty}\omega^{\frac{3(2s+n-1)}{2\sigma}}\mathrm{e}^{-2c\omega}\mathrm{d}\omega^{\frac{3}{2\sigma}}\lesssim t^{-\frac{3(2s+n)}{2\sigma}} \end{align*} when $t\in[1,\infty)$ due to $2s+n-1>-1$, and bounded estimates hold for $t\in[0,1]$. Then, our proof is completed. \end{proof} \begin{lemma}\label{Lem-02} Let $n>\frac{4}{3}\sigma$ and $\sigma\in(0,\infty)$. The following estimates hold: \begin{align} \left\|\chi_{\intt}(\xi)|\xi|^{-\frac{4}{3}\sigma}\left(\mathrm{e}^{-|\xi|^{\frac{2}{3}\sigma}t}-\cos(C_{\eta}|\xi|^{\frac{2}{3}\sigma}t)\,\mathrm{e}^{-\frac{1}{2}(\eta-1)|\xi|^{\frac{2}{3}\sigma}t}\right)\right\|_{L^2}&\lesssim (1+t)^{-\frac{3n-8\sigma}{4\sigma}},\label{A1}\\ \left\|\chi_{\intt}(\xi)|\xi|^{-\frac{4}{3}\sigma}\sin(C_{\eta}|\xi|^{\frac{2}{3}\sigma}t)\,\mathrm{e}^{-\frac{1}{2}(\eta-1)|\xi|^{\frac{2}{3}\sigma}t}\right\|_{L^2}&\lesssim (1+t)^{-\frac{3n-8\sigma}{4\sigma}},\label{A2} \end{align} where $\eta\in(1,3)$ and $C_{\eta}>0$. \end{lemma} \begin{proof} According to $1-\cos y=2\sin^2\frac{y}{2}$, we notice \begin{align*} &|\xi|^{-\frac{4}{3}\sigma}\left(\mathrm{e}^{-|\xi|^{\frac{2}{3}\sigma}t}-\cos(C_{\eta}|\xi|^{\frac{2}{3}\sigma}t)\,\mathrm{e}^{-\frac{1}{2}(\eta-1)|\xi|^{\frac{2}{3}\sigma}t}\right)\\ &\qquad=|\xi|^{-\frac{4}{3}\sigma}\mathrm{e}^{-\frac{1}{2}(\eta-1)|\xi|^{\frac{2}{3}\sigma}t}\left(\mathrm{e}^{\frac{1}{2}(\eta-3)|\xi|^{\frac{2}{3}\sigma}t}-1\right)+2|\xi|^{-\frac{4}{3}\sigma}\sin^2\left(\frac{C_{\eta}}{2}|\xi|^{\frac{2}{3}\sigma }t\right)\mathrm{e}^{-\frac{1}{2}(\eta-1)|\xi|^{\frac{2}{3}\sigma}t}\\ &\qquad=\frac{(\eta-3)t}{2|\xi|^{\frac{2}{3}\sigma}}\mathrm{e}^{-\frac{1}{2}(\eta-1)|\xi|^{\frac{2}{3}\sigma}t}\int_0^1\mathrm{e}^{-\frac{1}{2}(3-\eta)|\xi|^{\frac{2}{3}\sigma} t\tau}\mathrm{d}\tau+2t^2\left|\frac{\sin(\frac{C_{\eta}}{2}|\xi|^{\frac{2}{3}\sigma}t)}{|\xi|^{\frac{2}{3}\sigma}t}\right|^2\mathrm{e}^{-\frac{1}{2}(\eta-1)|\xi|^{\frac{2}{3}\sigma}t}. \end{align*} Due to the fact that $|\sin y|\lesssim |y|$, it yields \begin{align*} \mbox{LHS of }\eqref{A1}&\lesssim t\left\|\chi_{\intt}(\xi)|\xi|^{-\frac{2}{3}\sigma}\mathrm{e}^{-c|\xi|^{\frac{2}{3}\sigma}t}\right\|_{L^2}+t^2\left\|\chi_{\intt}(\xi)\mathrm{e}^{-c|\xi|^{\frac{2}{3}\sigma}t}\right\|_{L^2}\lesssim (1+t)^{-\frac{3n-8\sigma}{4\sigma}} \end{align*} with $n>\frac{4}{3}\sigma$, where we applied Lemma \ref{Lem-01} with $s=-\frac{2}{3}\sigma$ and $s=0$. Similarly, \begin{align*} \mbox{LHS of }\eqref{A2}&\lesssim t\left\|\chi_{\intt}(\xi)|\xi|^{-\frac{2}{3}\sigma}\frac{\sin(C_{\eta}|\xi|^{\frac{2}{3}\sigma}t)}{|\xi|^{\frac{2}{3}\sigma}t}\mathrm{e}^{-c|\xi|^{\frac{2}{3}\sigma}t}\right\|_{L^2}\lesssim(1+t)^{-\frac{3n-8\sigma}{4\sigma}}, \end{align*} again with $n>\frac{4}{3}\sigma$. The proof is finished. \end{proof} \begin{lemma}\label{Lem-03} Under the corresponding conditions to those of Lemma \ref{Lem-01} and Lemma \ref{Lem-02}, respectively, all estimates from the above mentioned are sharp for large-time $t\gg1$. \end{lemma} \begin{proof} The upper bounds estimates have been derived in Lemma \ref{Lem-01} as well as Lemma \ref{Lem-02}. For this reason, we just need to get the lower bounds estimates with the same time-dependent coefficients as the upper bounds when $t\gg1$. Again with the variable $\omega=r^{\frac{2}{3}\sigma}t$, we estimate \begin{align*} [\mbox{LHS of }\eqref{Su02}]^2\gtrsim t^{-\frac{3(2s+n)}{2\sigma}}\int_0^{\varepsilon_0^{\frac{2}{3}\sigma}t}\omega^{\frac{3(2s+n)}{2\sigma}-1}\,\mathrm{e}^{-2c\omega}\mathrm{d}\omega\gtrsim t^{-\frac{3(2s+n)}{2\sigma}} \end{align*} for large-time $t\gg1$ such that $\varepsilon_0^{\frac{2}{3}\sigma}t\geqslant 1$, where we shrink the domain $(0,\varepsilon_0^{\frac{2}{3}\sigma}t)$ into $(0,1)$ and used $2s+n>0$ from the assumption of Lemma \ref{Lem-01}. Similarly, we know \begin{align*} [\mbox{LHS of } \eqref{A1}]^2&\gtrsim\int_0^{\varepsilon_0}r^{-\frac{8}{3}\sigma+n-1}\left(\mathrm{e}^{-r^{\frac{2}{3}\sigma}t}-\cos(C_{\eta}r^{\frac{2}{3}\sigma}t)\,\mathrm{e}^{-\frac{1}{2}(\eta-1)r^{\frac{2}{3}\sigma}t}\right)^2\mathrm{d}r\\ &\gtrsim t^{-\frac{3n-8\sigma}{2\sigma}}\int_0^{\varepsilon_0^{\frac{2}{3}\sigma}t}\omega^{\frac{3n-4\sigma}{2\sigma}-1}\omega^{-2}\left(\mathrm{e}^{-\omega}-\cos(C_{\eta}\,\omega)\,\mathrm{e}^{-\frac{1}{2}(\eta-1)\omega}\right)^2\mathrm{d}\omega. \end{align*} Due to the fact that \begin{align*} \lim\limits_{\omega\downarrow 0}\omega^{-1}\left(\mathrm{e}^{-\omega}-\cos(C_{\eta}\,\omega)\,\mathrm{e}^{-\frac{1}{2}(\eta-1)\omega}\right)=\frac{1}{2}(\eta-3)<0, \end{align*} there exists $\varepsilon_0^*>0$ with $0<\omega<\varepsilon_0^*<\varepsilon_0^{\frac{2}{3}\sigma}t$ for $t\gg1$ such that \begin{align*} [\mbox{LHS of } \eqref{A1}]^2&\gtrsim t^{-\frac{3n-8\sigma}{2\sigma}}\int_0^{\varepsilon_0^*}\omega^{\frac{3n-4\sigma}{2\sigma}-1}\mathrm{d}\omega \gtrsim t^{-\frac{3n-8\sigma}{2\sigma}}, \end{align*} where we employed our assumption $3n-4\sigma>0$ in Lemma \ref{Lem-02}. Finally, the same idea leads to \begin{align*} [\mbox{LHS of } \eqref{A2}]^2&\gtrsim t^{-\frac{3n-8\sigma}{2\sigma}}\int_0^{\varepsilon_0^{\frac{2}{3}\sigma}t}\omega^{\frac{3n-4\sigma}{2\sigma}-1}\left|\frac{\sin(C_{\eta}\,\omega)}{C_{\eta}\,\omega}\right|^2\mathrm{e}^{-2c\omega}\mathrm{d}\omega \gtrsim t^{-\frac{3n-8\sigma}{2\sigma}} \end{align*} as $t\gg1$ and $3n-4\sigma>0$. Therefore, our proof is finished. \end{proof} Because of the representations of solutions for different size of $\eta\in(1,\infty)$, we next will state some sharp estimates and asymptotic profiles of solutions in the cases $\eta\in(1,3)$, $\eta\in(3,\infty)$ and $\eta=3$, respectively. We postpone the proof of sharpness for these estimates in Proposition \ref{Prop-sharpness-linear}. Let us recall the data space $\mathcal{B}_{\sigma}$ introduced in \eqref{Data-space-D}. We first study the case $\eta\in(1,3)$. \begin{prop}\label{Prop-(1,3)} Let $n\geqslant1$ and $n>\frac{4}{3}\sigma$ with $\sigma\in(0,\infty)$. Let us consider the linearized Cauchy problem \eqref{Eq-Linear-Third-PDE} with $\eta\in(1,3)$ and $(v_0,v_1,v_2)\in\mathcal{B}_{\sigma}$. The solution fulfills the following estimates: \begin{align} \|v(t,\cdot)\|_{L^2}&\lesssim (1+t)^{-\frac{3n-8\sigma}{4\sigma}}\|(v_0,v_1,v_2)\|_{\mathcal{B}_{\sigma}},\label{C(1,3),L2L1-L2}\\ \|v(t,\cdot)\|_{\dot{H}^{\frac{4}{3}\sigma}}&\lesssim (1+t)^{-\frac{3n}{4\sigma}}\|(v_0,v_1,v_2)\|_{\mathcal{B}_{\sigma}}.\label{C(1,3),HsL1-L2} \end{align} Furthermore, the asymptotic profile when $\eta\in(1,3)$ is described by $w_{(1,3)}=w_{(1,3)}(t,x)$ such that \begin{align*} w_{(1,3)}(t,x)&:=\mathcal{F}_{\xi\to x}^{-1}\left[|\xi|^{-\frac{4}{3}\sigma}\left(-\mathrm{e}^{-|\xi|^{\frac{2}{3}\sigma}t}+\cos(C_{\eta}|\xi|^{\frac{2}{3}\sigma}t)\,\mathrm{e}^{-\frac{1}{2}(\eta-1)|\xi|^{\frac{2}{3}\sigma}t}\right)\right]\frac{v_2(x)}{\eta-3}\\ &\ \quad+\mathcal{F}^{-1}_{\xi\to x}\left[|\xi|^{-\frac{4}{3}\sigma}\sin(C_{\eta}|\xi|^{\frac{2}{3}\sigma}t)\,\mathrm{e}^{-\frac{1}{2}(\eta-1)|\xi|^{\frac{2}{3}\sigma}t}\right]\frac{v_2(x)}{2C_{\eta}} \end{align*} in the sense of refined estimates \begin{align}\label{Refine(1,3)-1} \|v(t,\cdot)-w_{(1,3)}(t,\cdot)\|_{L^2}&\lesssim (1+t)^{-\frac{3n-4\sigma}{4\sigma}}\|(v_0,v_1,v_2)\|_{\mathcal{B}_{\sigma}},\\ \|v(t,\cdot)-w_{(1,3)}(t,\cdot)\|_{\dot{H}^{\frac{4}{3}\sigma}}&\lesssim (1+t)^{-\frac{3n+4\sigma}{4\sigma}}\|(v_0,v_1,v_2)\|_{\mathcal{B}_{\sigma}}.\label{Refine(1,3)-2} \end{align} Assuming $v_0\equiv0\equiv v_1$, the solution fulfills the following bounded estimate: \begin{align}\label{C(1,3),L2-L2} \|v(t,\cdot)\|_{\dot{H}^{\frac{4}{3}\sigma}}\lesssim\|v_2\|_{L^2}. \end{align} \end{prop} \begin{proof} Recalling the representation \eqref{B1} as $\eta\in(1,3)$, we are able to derive \begin{align*} \|\chi_{\intt}(\xi)\widehat{v}(t,\xi)\|_{L^2}&\lesssim\left\|\chi_{\intt}(\xi)\,\mathrm{e}^{-c|\xi|^{\frac{2}{3}\sigma}t}\right\|_{L^2}\|\widehat{v}_0\|_{L^{\infty}}+\left\|\chi_{\intt}(\xi)|\xi|^{-\frac{2}{3}\sigma}\mathrm{e}^{-c|\xi|^{\frac{2}{3}\sigma}t}\right\|_{L^2}\|\widehat{v}_1\|_{L^{\infty}}\\ &\quad+\left\|\chi_{\intt}(\xi)|\xi|^{-\frac{4}{3}\sigma}\left(\mathrm{e}^{-|\xi|^{\frac{2}{3}\sigma}t}-\cos(C_{\eta}|\xi|^{\frac{2}{3}\sigma}t)\,\mathrm{e}^{-\frac{1}{2}(\eta-1)|\xi|^{\frac{2}{3}\sigma}t}\right)\right\|_{L^2}\|\widehat{v}_2\|_{L^{\infty}}\\ &\quad+\left\|\chi_{\intt}(\xi)|\xi|^{-\frac{4}{3}\sigma}\sin(C_{\eta}|\xi|^{\frac{2}{3}\sigma}t)\,\mathrm{e}^{-\frac{1}{2}(\eta-1)|\xi|^{\frac{2}{3}\sigma}t}\right\|_{L^2}\|\widehat{v}_2\|_{L^{\infty}}. \end{align*} With the aid of $s=0,-\frac{2}{3}\sigma$ in Lemma \ref{Lem-01}, \eqref{A1}-\eqref{A2} in Lemma \ref{Lem-02}, as well as the Hausdorff-Young inequality $\|\widehat{v}_j\|_{L^{\infty}}\lesssim\|v_j\|_{L^1}$ with $j=0,1,2$, one may estimate \begin{align*} \|\chi_{\intt}(\xi)\widehat{v}(t,\xi)\|_{L^2}\lesssim (1+t)^{-\frac{3n-8\sigma}{4\sigma}}\|(v_0,v_1,v_2)\|_{L^1\times L^1\times L^1}, \end{align*} with $n>\frac{4}{3}\sigma$. For another, it is clear that \begin{align*} \left\|\chi_{\extt}(\xi)\widehat{v}(t,\xi)\right\|_{L^2}&\lesssim\left\|\chi_{\extt}(\xi)\,\mathrm{e}^{-c|\xi|^{\frac{2}{3}\sigma}t}\left(\widehat{v}_0(\xi)+\langle\xi\rangle^{-\frac{2}{3}\sigma}\widehat{v}_1(\xi)+\langle\xi\rangle^{-\frac{4}{3}\sigma}\widehat{v}_2(\xi)\right)\right\|_{L^2}\\ &\lesssim\mathrm{e}^{-ct}\|(v_0,v_1,v_2)\|_{L^2\times L^2\times L^2}. \end{align*} An application of the Parseval equality associated with the last two estimates completes the proof of \eqref{C(1,3),L2L1-L2}. Concerning the desired estimate \eqref{C(1,3),HsL1-L2}, we follow the analogous method as the above one to get \begin{align*} \|v(t,\cdot)\|_{\dot{H}^{\frac{4}{3}\sigma}}&\lesssim\left\|\chi_{\intt}(\xi)\,\mathrm{e}^{-c|\xi|^{\frac{2}{3}\sigma}t}\right\|_{L^2}\|(v_0,v_1,v_2)\|_{L^1\times L^1\times L^1}\\ &\quad+\left\|\chi_{\extt}(\xi)\,\mathrm{e}^{-c|\xi|^{\frac{2}{3}\sigma}t}\right\|_{L^{\infty}}\|(v_0,v_1,v_2)\|_{H^{\frac{4}{3}\sigma}\times H^{\frac{2}{3}\sigma}\times L^2}\\ &\lesssim (1+t)^{-\frac{3n}{4\sigma}}\|(v_0,v_1,v_2)\|_{L^1\times L^1\times L^1}+\mathrm{e}^{-ct}\|(v_0,v_1,v_2)\|_{H^{\frac{4}{3}\sigma}\times H^{\frac{2}{3}\sigma}\times L^2}, \end{align*} where we applied Lemma \ref{Lem-01} with $s=0$. Furthermore, taking $\hat{v}_0\equiv0\equiv \hat{v}_1$, we can obtain \begin{align*} |\xi|^{\frac{4}{3}\sigma}|\widehat{v}|\lesssim \left(1+|\cos(C_{\eta}|\xi|^{\frac{2}{3}\sigma }t)|+|\sin(C_{\eta}|\xi|^{\frac{2}{3}\sigma }t)|\right)\mathrm{e}^{-c|\xi|^{\frac{2}{3}\sigma}t}|\widehat{v}_2|\lesssim |\widehat{v}_2|, \end{align*} which implies \eqref{C(1,3),L2-L2} immediately. Finally, benefited from the representation \eqref{B1}, we know \begin{align*} |\widehat{v}-\widehat{w}_{(1,3)}|\lesssim\mathrm{e}^{-c|\xi|^{\frac{2}{3}\sigma}t}\left(|\widehat{v}_0|+|\xi|^{-\frac{2}{3}\sigma}|\widehat{v}_1|\right). \end{align*} By applying Lemma \ref{Lem-01} with $s=-\frac{2}{3}\sigma$, the desired refined estimate can be proved directly. \end{proof} \begin{remark} Comparing \eqref{C(1,3),L2L1-L2}, \eqref{C(1,3),HsL1-L2} with \eqref{Refine(1,3)-1} and \eqref{Refine(1,3)-2}, respectively, we notice that the decay rates have been improved $(1+t)^{-1}$ by subtracting the function $w_{(1,3)}(t,\cdot)$ in the $L^2$ and $\dot{H}^{\frac{4}{3}\sigma}$ norms. In other words, the general diffusion-waves function $w_{(1,3)}$ is the asymptotic profile of $v$ to the linearized Cauchy problem \eqref{Eq-Linear-Third-PDE} with $\eta\in(1,3)$. \end{remark} Let us turn to the second situation $\eta\in(3,\infty)$, which will be separated into two results with respect to the size of dimensions. \begin{prop}\label{Prop-(3,infty)} Let $n\geqslant 1$ and $n>\frac{8}{3}\sigma$ with $\sigma\in(0,\infty)$. Let us consider the linearized Cauchy problem \eqref{Eq-Linear-Third-PDE} with $\eta\in(3,\infty)$ and $(v_0,v_1,v_2)\in\mathcal{B}_{\sigma}$. The solution fulfills the estimates \eqref{C(1,3),L2L1-L2}-\eqref{C(1,3),HsL1-L2}. Furthermore, the asymptotic profile when $\eta\in(3,\infty)$ is described by $w_{(3,\infty)}=w_{(3,\infty)}(t,x)$ such that \begin{align*} w_{(3,\infty)}(t,x)&:=\mathcal{F}^{-1}_{\xi\to x}\left[\frac{\mathrm{e}^{-|\xi|^{\frac{2}{3}\sigma }t}}{(3-\eta)|\xi|^{\frac{4}{3}\sigma }}+\frac{\mathrm{e}^{\frac{1}{2}(1-\eta)|\xi|^{\frac{2}{3}\sigma }t}}{D_{\eta}|\xi|^{\frac{4}{3}\sigma }}\left(\frac{\mathrm{e}^{D_{\eta}|\xi|^{\frac{2}{3}\sigma }t}}{3-\eta+2D_{\eta}}-\frac{\mathrm{e}^{-D_{\eta}|\xi|^{\frac{2}{3}\sigma }t}}{3-\eta-2D_{\eta}}\right)\right]v_2(x) \end{align*} in the sense of refined estimates \begin{align*} \|v(t,\cdot)-w_{(3,\infty)}(t,\cdot)\|_{L^2}&\lesssim (1+t)^{-\frac{3n-4\sigma}{4\sigma}}\|(v_0,v_1,v_2)\|_{\mathcal{B}_{\sigma}},\\ \|v(t,\cdot)-w_{(3,\infty)}(t,\cdot)\|_{\dot{H}^{\frac{4}{3}\sigma}}&\lesssim (1+t)^{-\frac{3n+4\sigma}{4\sigma}}\|(v_0,v_1,v_2)\|_{\mathcal{B}_{\sigma}}. \end{align*} Assuming $v_0\equiv0\equiv v_1$, the solution fulfills the estimate \eqref{C(1,3),L2-L2}. \end{prop} \begin{proof} The representation \eqref{B2} shows the pointwise estimates \begin{align} |\widehat{v}|&\lesssim\mathrm{e}^{-c|\xi|^{\frac{2}{3}\sigma}t}\left(|\widehat{v}_0|+|\xi|^{-\frac{2}{3}\sigma}|\widehat{v}_1|+|\xi|^{-\frac{4}{3}\sigma}|\widehat{v}_2|\right),\label{NEW001}\\ |\widehat{v}-\widehat{w}_{(3,\infty)}|&\lesssim\mathrm{e}^{-c|\xi|^{\frac{2}{3}\sigma}t}\left(|\widehat{v}_0|+|\xi|^{-\frac{2}{3}\sigma}|\widehat{v}_1|\right).\notag \end{align} Following similar approaches to those of Proposition \ref{Prop-(1,3)}, we complete the proof. \end{proof} \begin{remark} We observe that the decay rates have been improved $(1+t)^{-1}$ by subtracting the function $w_{(3,\infty)}(t,\cdot)$ in the $L^2$ and $\dot{H}^{\frac{4}{3}\sigma}$ norms. Due to the Fourier multipliers $\exp(\alpha_0|\xi|^{\frac{2}{3}\sigma}t)$ with $\alpha_0=-1$ and $\alpha_0=\frac{1}{2}(1-\eta)\pm D_{\eta}<0$, the general diffusion function $w_{(3,\infty)}$ is the asymptotic profile of $v$ to the linearized Cauchy problem \eqref{Eq-Linear-Third-PDE} with $\eta\in(3,\infty)$. \end{remark} \begin{coro}\label{Coro-New} Let $n\geqslant 1$ and $\frac{4}{3}\sigma<n\leqslant\frac{8}{3}\sigma$ with $\sigma\in(0,\infty)$. Let us consider the linearized Cauchy problem \eqref{Eq-Linear-Third-PDE} with $\eta\in(3,\infty)$ and $(v_0,v_1,v_2)\in\mathcal{B}_{\sigma}$. The solution fulfills the following estimates: \begin{align*} \|v(t,\cdot)\|_{L^2}\lesssim\begin{cases} (1+t)^{-\frac{3n-8\sigma}{4\sigma}}\|(v_0,v_1,v_2)\|_{\mathcal{B}_{\sigma}}&\mbox{if}\ \ \frac{4}{3}\sigma<n<\frac{8}{3}\sigma,\\ \ln(\mathrm{e}+t)\|(v_0,v_1,v_2)\|_{\mathcal{B}_{\sigma}}&\mbox{if}\ \ n=\frac{8}{3}\sigma. \end{cases} \end{align*} \end{coro} \begin{proof} By taking time-derivative to \eqref{B2}, we obtain \begin{align*} |\widehat{v}_t|\lesssim\mathrm{e}^{-c|\xi|^{\frac{2}{3}\sigma}t}\left(|\xi|^{\frac{2}{3}\sigma}|\widehat{v}_0|+|\widehat{v}_1|+|\xi|^{-\frac{2}{3}\sigma}|\widehat{v}_2|\right), \end{align*} which immediately shows \begin{align*} \|v_t(t,\cdot)\|_{L^2}\lesssim(1+t)^{-\frac{3n-4\sigma}{4\sigma}}\|(v_0,v_1,v_2)\|_{\mathcal{B}_{\sigma}} \end{align*} by assuming $n>\frac{4}{3}\sigma$ since Lemma \ref{Lem-01} with $s=-\frac{2}{3}\sigma$. Due to the relation $v(t,x)=\int_0^tv_t(\tau,x)\mathrm{d}\tau+v_0(x)$, one gets \begin{align*} \|v(t,\cdot)\|_{L^2}&\lesssim\int_0^t\|v_t(\tau,\cdot)\|_{L^2}\mathrm{d}\tau+\|v_0\|_{L^2}\lesssim\left(1+\int_0^t(1+\tau)^{-\frac{3n-4\sigma}{4\sigma}}\mathrm{d}\tau\right)\|(v_0,v_1,v_2)\|_{\mathcal{B}_{\sigma}}. \end{align*} From $\frac{4}{3}\sigma<n\leqslant\frac{8}{3}\sigma$, i.e. $0<\frac{3n-4\sigma}{4\sigma}\leqslant 1$, we obtain the desired estimates. \end{proof} \begin{remark} In comparison with the diffusion-waves case $\eta\in(1,3)$, due to the lack of oscillations $\sin(C_{\eta}|\xi|^{\frac{2}{3}\sigma}t)$ and $\cos(C_{\eta}|\xi|^{\frac{2}{3}\sigma}t)$ in the solution formula from the diffusion case $\eta\in(3,\infty)$, we have a logarithmic loss in the limit case $n=\frac{8}{3}\sigma$, but the estimates in Proposition \ref{Prop-(3,infty)} and Corollary \ref{Coro-New} for the remaining case $n\in(\frac{4}{3}\sigma,\frac{8}{3}\sigma)\cup(\frac{8}{3}\sigma,\infty)$ are exactly the same as those of Proposition \ref{Prop-(1,3)}. \end{remark} We focus on the final scenario $\eta=3$. \begin{prop}\label{Prop-(3)} Let $n\geqslant 1$ with $\sigma\in(0,\infty)$. Let us consider the linearized Cauchy problem \eqref{Eq-Linear-Third-PDE} with $\eta=3$ and $(v_0,v_1,v_2)\in\mathcal{B}_{\sigma}$. The solution fulfills the estimates \eqref{C(1,3),L2L1-L2}-\eqref{C(1,3),HsL1-L2}. Furthermore, the asymptotic profile when $\eta=3$ is described by $w_{[3]}=w_{[3]}(t,x)$ such that \begin{align*} w_{[3]}(t,x)&:=\frac{t^2}{2}\mathcal{F}^{-1}_{\xi\to x}\left(\mathrm{e}^{-|\xi|^{\frac{2}{3}\sigma }t}\right)v_2(x) \end{align*} in the sense of refined estimates \begin{align*} \|v(t,\cdot)-w_{[3]}(t,\cdot)\|_{L^2}&\lesssim (1+t)^{-\frac{3n-4\sigma}{4\sigma}}\|(v_0,v_1,v_2)\|_{\mathcal{B}_{\sigma}},\\ \|v(t,\cdot)-w_{[3]}(t,\cdot)\|_{\dot{H}^{\frac{4}{3}\sigma}}&\lesssim (1+t)^{-\frac{3n+4\sigma}{4\sigma}}\|(v_0,v_1,v_2)\|_{\mathcal{B}_{\sigma}}. \end{align*} Assuming $v_0\equiv0\equiv v_1$, the solution fulfills the estimate \eqref{C(1,3),L2-L2}. \end{prop} \begin{proof} From the pointwise estimates \begin{align*} |\widehat{v}|&\lesssim\mathrm{e}^{-c|\xi|^{\frac{2}{3}\sigma}t}\left(|\widehat{v}_0|+t|\widehat{v}_1|+t^2|\widehat{v}_2|\right),\\ |\widehat{v}-\widehat{w}_{[3]}|&\lesssim\mathrm{e}^{-c|\xi|^{\frac{2}{3}\sigma}t}\,\big(|\widehat{v}_0|+t|\widehat{v}_1|\big), \end{align*} we may complete the proof easily by using Lemma \ref{Lem-01}. \end{proof} \begin{remark} Because the disappearance of singularities $|\xi|^{-\frac{2}{3}\sigma}$ and $|\xi|^{-\frac{4}{3}\sigma}$ for small frequencies in the representation of solution when $\eta=3$, we can get rid of the restriction of $n$ with respect to $\sigma$, moreover, the asymptotic profile $w_{[3]}$ does not contain any singular component. \end{remark} \begin{remark}\label{Rem-eta=3} Let us combine Propositions \ref{Prop-(1,3)}-\ref{Prop-(3)} and Corollary \ref{Coro-New}. We realize that the solution to the linearized Cauchy problem \eqref{Eq-Linear-Third-PDE} for $n\geqslant 1$ fulfills the same $(L^2\cap L^1)-L^2$ type estimates \eqref{C(1,3),L2L1-L2}-\eqref{C(1,3),HsL1-L2} and $L^2-L^2$ type estimate \eqref{C(1,3),L2-L2} under the restriction on dimensions \begin{align}\label{Restriction(n,sigma)} \begin{cases} \displaystyle{n>\frac{4}{3}\sigma}&\mbox{if}\ \ \eta\in(1,3),\\[0.5em] n>0&\mbox{if}\ \ \eta=3,\\[0.5em] \displaystyle{n>\frac{4}{3}\sigma \ \mbox{ but }\ n\neq\frac{8}{3}\sigma}&\mbox{if}\ \ \eta\in(3,\infty), \end{cases} \end{align} for any $\sigma\in(0,\infty)$. This phenomenon is caused by \begin{itemize} \item the general diffusion profile $w_{(3,\infty)}(t,x)$ with strong singularity $|\xi|^{-\frac{4}{3}\sigma}$ when $\eta\in(3,\infty)$; \item the general diffusion-waves profile $w_{(1,3)}(t,x)$ with strong singularity $|\xi|^{-\frac{4}{3}\sigma}$ and oscillations $\sin(C_{\eta}|\xi|^{\frac{2}{3}\sigma}t)$ as well as $\cos(C_{\eta}|\xi|^{\frac{2}{3}\sigma}t)$ when $\eta\in(0,3)$; \item the general diffusion profile $w_{[3]}(t,x)$ without any singularity when $\eta=3$. \end{itemize} Namely, $\eta=3$ is the threshold to distinguish different kinds of asymptotic profiles (see Figure \ref{imgg} specifically). Note that different degree of singularities with respect to small $|\xi|$ will be generated by various asymptotic profiles. \begin{figure}[http] \centering \begin{tikzpicture} \draw[thick] (-0.2,0) -- (12,0) node[below] {$\infty$}; \node[left] at (0,-0.2) {{$0$}}; \node[below] at (3,0) {{$1$}}; \node[below] at (7,0) {{$3$}}; \draw [decorate, decoration={brace, amplitude=5pt}] (3,0.5) -- (6.9,0.5); \draw [decorate, decoration={brace, amplitude=5pt}] (7.1,0.5) -- (12,0.5); \draw [decorate, decoration={brace, amplitude=5pt}] (2.9,-0.5)--(0,-0.5) ; \draw [decorate, decoration={brace, amplitude=5pt}] (12,-0.5)--(3.1,-0.5) ; \node[above] at (5,0.8) {with singularity}; \node[above] at (5,1.25) {diffusion-waves profile}; \node[above] at (9.5,1.25) {diffusion profile}; \node[above] at (9.5,0.8) {with singularity}; \node[above] at (7.2,1.8){diffusion profile without singularity}; \node[above] at (1.3,-1.4) {instable (Sobolev data)}; \node[above] at (1.3,-1.85) {stable (Gevrey-Sobolev data)}; \node[above] at (7.8,-1.4) {stable (Sobolev data) with Gevrey smoothing effect}; \node[left] at (-0.5,0) {Size of $\eta$:}; \draw[fill] (-0.2, 0) circle[radius=1pt]; \draw[fill] (3, 0) circle[radius=1pt]; \draw[fill] (7, 0) circle[radius=1pt]; \draw[fill] (12, 0) circle[radius=1pt]; \draw[->] (7,2) -- (7,0.6); \end{tikzpicture} \caption{Two thresholds with respect to $\eta$} \label{imgg} \end{figure} \end{remark} To end this section, we will state that the derived $(L^2\cap L^1)$ type estimates in Propositions \ref{Prop-(1,3)}-\ref{Prop-(3)} are really sharp in the sense of same large-time behaviors for upper bounds estimates and lower bound estimates. The proof is motived by \cite{Ikehata=2014,Ikehata-Takeda=2019}. \begin{prop}\label{Prop-sharpness-linear} Let $n\geqslant 1$ and $\sigma\in(0,\infty)$. Let us consider the linearized Cauchy problem \eqref{Eq-Linear-Third-PDE} with $n>\frac{4}{3}\sigma$ if $\eta\in(1,3)$, $n>0$ if $\eta=3$, $n>\frac{8}{3}\sigma$ if $\eta\in(3,\infty)$, and $(v_0,v_1,v_2)\in\mathcal{B}_{\sigma}$. The solution fulfills the following sharp estimates: \begin{align} \|v(t,\cdot)\|_{L^2}\simeq t^{-\frac{3n-8\sigma}{4\sigma}}\ \ \mbox{and}\ \ \|v(t,\cdot)\|_{\dot{H}^{\frac{4}{3}\sigma}}\simeq t^{-\frac{3n}{4\sigma}}\label{Su05} \end{align} for large-time $t\gg1$ if $P_{v_2}:=\int_{\mathbb{R}^n}v_2(x)\mathrm{d}x\neq0$. \end{prop} \begin{proof} Let us rewrite the asymptotic profiles by \begin{align*} w_{\Xi}(t,x)=\mathcal{L}_{\Xi}(t,x)v_2(x) \end{align*} with $\Xi\in\{(1,3),[3],(3,\infty)\}$. In other words, Propositions \ref{Prop-(1,3)}-\ref{Prop-(3)} have proved \begin{align} \left\|\big(v-\mathcal{L}_{\Xi}v_2\big)(t,\cdot)\right\|_{L^2}\lesssim(1+t)^{-\frac{3n-8\sigma}{4\sigma}-1}\|(v_0,v_1,v_2)\|_{\mathcal{B}_{\sigma}}.\label{Su03} \end{align} By applying the Lagrange theorem \begin{align*} |\mathcal{L}_{\Xi}(t,x-y)-\mathcal{L}_{\Xi}(t,x)|\lesssim|y|\,|\nabla\mathcal{L}_{\Xi}(t,x-\theta_1y)| \end{align*} with $\theta_1\in(0,1)$, we are able to obtain \begin{align*} \|\mathcal{L}_{\Xi}(t,D)v_2(\cdot)-\mathcal{L}_{\Xi}(t,\cdot)P_{v_2}\|_{L^2}&\lesssim\left\|\int_{|y|\leqslant t^{\alpha_1}}\big(\mathcal{L}_{\Xi}(t,\cdot-y)-\mathcal{L}_{\Xi}(t,\cdot)\big)v_2(y)\mathrm{d}y\right\|_{L^2}\\ &\quad+\left\|\int_{|y|\geqslant t^{\alpha_1}}\big(|\mathcal{L}_{\Xi}(t,\cdot-y)|+|\mathcal{L}_{\Xi}(t,\cdot)|\big)|v_2(y)|\mathrm{d}y\right\|_{L^2}\\ &\lesssim t^{\alpha_1}\|\nabla\mathcal{L}_{\Xi}(t,\cdot)\|_{L^2}\|v_2\|_{L^1}+\|\mathcal{L}_{\Xi}(t,\cdot)\|_{L^2}\|v_2\|_{L^1(|x|\geqslant t^{\alpha_1})} \end{align*} with a positive small constant $0<\alpha_1\ll 1$. Due to $v_2\in L^1$ implying $\|v_2\|_{L^1(|x|\geqslant t^{\alpha_1})}=o(1)$, by using Lemmas \ref{Lem-01} and \ref{Lem-02}, we derive \begin{align}\label{Su04} \|\mathcal{L}_{\Xi}(t,D)v_2(\cdot)-\mathcal{L}_{\Xi}(t,\cdot)P_{v_2}\|_{L^2}=o(t^{-\frac{3n-8\sigma}{4\sigma}}) \end{align} as $t\gg1$. According to \eqref{Su03}-\eqref{Su04} and the Minkowski inequality, one claims \begin{align*} \|v(t,\cdot)\|_{L^2}&\gtrsim\|\mathcal{L}_{\Xi}(t,\cdot)\|_{L^2}|P_{v_2}|-\left\|\big(v-\mathcal{L}_{\Xi}P_{v_2}\big)(t,\cdot)\right\|_{L^2}\\ &\gtrsim\|\chi_{\intt}(D)\mathcal{L}_{\Xi}(t,\cdot)\|_{L^2}|P_{v_2}|-o(t^{-\frac{3n-8\sigma}{4\sigma}}) \end{align*} for large-time $t\gg1$. Recalling the representations of $\mathcal{L}_{\Xi}(t,x)$ for $\Xi\in \{(1,3),[3],(3,\infty)\}$, we found that the lower bounds have been derived in Lemma \ref{Lem-03} such that \begin{align*} \|\chi_{\intt}(\xi)\widehat{\mathcal{L}}_{\Xi}(t,\xi)\|_{L^2}\gtrsim t^{-\frac{3n-8\sigma}{4\sigma}}, \end{align*} which immediately leads to \begin{align*} \|v(t,\cdot)\|_{L^2}\gtrsim t^{-\frac{3n-8\sigma}{4\sigma}}|P_{v_2}| \end{align*} for $t\gg1$. Hence, we complete the sharp estimate for the solution itself. By the same philosophy, the sharpness of the second one in \eqref{Su05} can be proved analogously. \end{proof} \begin{remark} Let us consider the general case $\eta\in(1,\infty)$. We find that $\sigma=\frac{3}{8}n$ is the threshold for decay estimates of the solution itself according to \eqref{Su05}. That is to say optimal polynomial decay when $\sigma\in(0,\frac{3}{8}n)$; sharp bounded estimates when $\sigma=\frac{3}{8}n$; optimal polynomial growth when $\sigma\in(\frac{3}{8}n,\infty)$ for the solution itself in the $L^2$ norm. \end{remark} \section{Global (in time) well-posedness for the semilinear Cauchy problem}\label{Sec-GESDS} \subsection{Philosophy and main tools of our approach} $\ \ \ \ $For any $T>0$, when \eqref{Restriction(n,sigma)} holds, let us introduce the evolution spaces of fractional order \begin{align}\label{Evol-Space} X(T):=\mathcal{C}\big([0,T],H^{\frac{4}{3}\sigma}\big)\ \ \mbox{with}\ \ \sigma\in(0,\infty), \end{align} carrying its weighted norm \begin{align}\label{NEW002} \|u\|_{X(T)}:=\sup\limits_{t\in[0,T]}\left((1+t)^{\frac{3n-8\sigma}{4\sigma}}\|u(t,\cdot)\|_{L^2}+(1+t)^{\frac{3n}{4\sigma}}\|u(t,\cdot)\|_{\dot{H}^{\frac{4}{3}\sigma}}\right). \end{align} Note that the remaining case $n=\frac{8}{3}\sigma$ when $\eta\in(3,\infty)$ does not include in \eqref{Restriction(n,sigma)}, which will be discussed in Remark \ref{Rem-spe}. The time-weighted Sobolev norm \eqref{NEW002} is strongly motivated by the sharp $(L^2\cap L^1)-L^2$ type estimates for the linearized Cauchy problem \eqref{Eq-Linear-Third-PDE} with $\eta\in(1,\infty)$, precisely, Propositions \ref{Prop-(1,3)}-\ref{Prop-(3)} and Corollary \ref{Coro-New}. Subsequently, we introduce the operator $\mathcal{N}$ such that \begin{align*} \mathcal{N}:\ u(t,x)\in X(T)\to \mathcal{N}u(t,x):=u^{\lin} (t,x)+u^{\non}(t,x), \end{align*} where $u^{\lin}(t,x) \equiv v(t,x)$ denotes the solution to the corresponding linearized Cauchy problem \eqref{Eq-Linear-Third-PDE} with the size $\epsilon$ for initial data, and $u^{\non}(t,x)$ is defined via \begin{align*} u^{\non}(t,x):=\int_0^tE_2(t-\tau,x)\ast_{(x)}|u(\tau,x)|^p\mathrm{d}\tau, \end{align*} where $E_2=E_2(t,x)$ is the fundamental solution to the linearized Cauchy problem \eqref{Eq-Linear-Third-PDE} with initial data $v_0(x)=v_1(x)=0$ and $v_2(x)=\delta_0$, in which $\delta_0$ is the Dirac distribution at $x=0$ with respect to the spatial variables. Particularly, \begin{align*} \mathcal{F}_{x\to\xi}\big(E_2(t,x)\big)=\widehat{K}_2(t,|\xi|):=\begin{cases} \displaystyle{\sum\limits_{j=1,2,3}\frac{\mathrm{e}^{\lambda_jt}}{\prod\limits_{k=1,2,3,\ k\neq j}(\lambda_j-\lambda_k)}}&\mbox{when}\ \ \eta\neq3,\\[1.6em] \displaystyle{\frac{1}{2}t^2\exp(-|\xi|^{\frac{2}{3}\sigma}t)}&\mbox{when}\ \ \eta=3, \end{cases} \end{align*} with the characteristic roots \eqref{Characteristic_Roots}, which are well-studied in Section \ref{Sec-linear}. When \eqref{Restriction(n,sigma)} holds, a brief summary of Propositions \ref{Prop-(1,3)}-\ref{Prop-(3)} and Corollary \ref{Coro-New} indicates estimates as follows: \begin{align} \|E_2(t,\cdot)\ast_{(x)}g(t,\cdot)\|_{L^2}&\lesssim(1+t)^{-\frac{3n-8\sigma}{4\sigma}}\|g(t,\cdot)\|_{L^2\cap L^1},\label{D1}\\ \|E_2(t,\cdot)\ast_{(x)}g(t,\cdot)\|_{\dot{H}^{\frac{4}{3}\sigma}}&\lesssim(1+t)^{-\frac{3n}{4\sigma}}\|g(t,\cdot)\|_{L^2\cap L^1},\label{D2}\\ \|E_2(t,\cdot)\ast_{(x)}g(t,\cdot)\|_{\dot{H}^{\frac{4}{3}\sigma}}&\lesssim\|g(t,\cdot)\|_{L^2},\label{D3} \end{align} for $\eta\in(1,\infty)$ and dimensions $n$ fulfilling \eqref{Restriction(n,sigma)}. We will demonstrate global (in time) existence and uniqueness of small data Sobolev solutions to the semilinear third-order (in time) evolution equations \eqref{Eq-Third-PDE} with $\eta\in(1,\infty)$ by proving a unique fixed point of the operator $\mathcal{N}$ that says $\mathcal{N}u\in X(T)$ for all $T>0$. Accurately, we will rigorously prove the next two vital estimates uniformly with respect to $T$: \begin{align} \|\mathcal{N}u\|_{X(T)}&\lesssim\epsilon\|(u_0,u_1,u_2)\|_{\mathcal{B}_{\sigma}}+\|u\|_{X(T)}^p,\label{Cruc-01}\\ \|\mathcal{N}u-\mathcal{N}\bar{u}\|_{X(T)}&\lesssim\|u-\bar{u}\|_{X(T)}\big(\|u\|_{X(T)}^{p-1}+\|\bar{u}\|_{X(T)}^{p-1}\big),\label{Cruc-02} \end{align} respectively, under some conditions of the power $p$, with the initial data space $\mathcal{B}_{\sigma}$ defined in \eqref{Data-space-D}. In our desired estimate \eqref{Cruc-02}, $u$ and $\bar{u}$ are two solutions to the semilinear Cauchy problem \eqref{Eq-Third-PDE} with $\eta\in(1,\infty)$. Thus, by assuming $\|(u_0,u_1,u_2)\|_{\mathcal{B}_{\sigma} }\leqslant C$ and a small parameter $0<\epsilon\ll 1$, we may combine \eqref{Cruc-01} with \eqref{Cruc-02} to declare that there exists a global (in time) small data Sobolev solution $u^{*}=u^{*}(t,x)\in X(\infty)$ by using Banach's fixed point theorem. To end this subsection, we recall the fractional Gagliardo-Nirenberg inequality \cite{Hajaiej-Molinet-Ozawa-Wang-2011} that will be applied soon afterwards. \begin{lemma}\label{fractionalgagliardonirenbergineq} Let $p,p_0,p_1\in(1,\infty)$ and $\kappa\in[0,s)$ with $s\in(0,\infty)$. Then, for all $f\in L^{p_0}\cap \dot{H}^{s}_{p_1}$ the following interpolation holds: \begin{equation*} \|g\|_{\dot{H}^{\kappa}_{p}}\lesssim\|g\|_{L^{p_0}}^{1-\beta}\|g\|^{\beta}_{\dot{H}^{s}_{p_1}}, \end{equation*} where $\beta=(\frac{1}{p_0}-\frac{1}{p}+\frac{\kappa}{n})\big/(\frac{1}{p_0}-\frac{1}{p_1}+\frac{s}{n})$ and $\beta\in[\frac{\kappa}{s},1]$. \end{lemma} \subsection{Proof of Theorem \ref{Thm-GESDS}: Global (in time) existence of Sobolev solution}\label{Subsec-GESDS} $\ \ \ \ $First of all, from the third statement of Proposition \ref{Prop-Stable} and some estimates in Propositions \ref{Prop-(1,3)}-\ref{Prop-(3)} as well as Corollary \ref{Coro-New}, we may claim $u^{\lin}\in X(T)$ such that \begin{align}\label{E1} \|u^{\lin}\|_{X(T)}\lesssim \epsilon\|(u_0,u_1,u_2)\|_{\mathcal{B}_{\sigma}}. \end{align} Due to $\mathcal{N}u=u^{\lin}+u^{\non}$, our first goal is to demonstrate \begin{align*} \|u^{\non}\|_{X(T)}\lesssim\|u\|^p_{X(T)}\ \ \mbox{uniformly}\ \ T, \end{align*} under some conditions for the exponent $p$. To do this, we now need to estimate the nonlinearity $|u(\tau,\cdot)|^p$ in the $L^1$ and $L^2$ norms, respectively. Let us apply the fractional Gagliardo-Nirenberg inequality (see Lemma \ref{fractionalgagliardonirenbergineq}) to arrive at \begin{align*} \|\,|u(\tau,\cdot)|^p\|_{L^1}&\lesssim \|u(\tau,\cdot)\|_{L^2}^{(1-\beta_1)p}\|u(\tau,\cdot)\|_{\dot{H}^{\frac{4}{3}\sigma}}^{\beta_1 p}\lesssim(1+\tau)^{-\frac{3n-4\sigma}{2\sigma}p+\frac{3n}{2\sigma}}\|u\|_{X(T)}^p \end{align*} for $\tau\in[0,T]$ with $\beta_1:=\frac{3n}{4\sigma}(\frac{1}{2}-\frac{1}{p})\in[0,1]$, that is $2\leqslant p\leqslant\frac{6n}{(3n-8\sigma)_+}$. Analogously, \begin{align}\label{Nonlinearity-02} \|\,|u(\tau,\cdot)|^p\|_{L^2}&\lesssim \|u(\tau,\cdot)\|_{L^2}^{(1-\beta_2)p}\|u(\tau,\cdot)\|_{\dot{H}^{\frac{4}{3}\sigma}}^{\beta_2 p}\lesssim(1+\tau)^{-\frac{3n-4\sigma}{2\sigma}p+\frac{3n}{4\sigma}}\|u\|_{X(T)}^p \end{align} for $\tau\in[0,T]$ with $\beta_2:=\frac{3n}{4\sigma}(\frac{1}{2}-\frac{1}{2p})\in[0,1]$, that is $1<p\leqslant\frac{3n}{(3n-8\sigma)_+}$. For these reasons, it shows \begin{align}\label{Nonlinearity-01} \|\,|u(\tau,\cdot)|^p\|_{L^2\cap L^1}\lesssim(1+\tau)^{-\frac{3n-4\sigma}{2\sigma}p+\frac{3n}{2\sigma}}\|u\|_{X(T)}^p, \end{align} where we restricted \begin{align}\label{Cond-01} 2\leqslant p\leqslant\frac{3n}{(3n-8\sigma)_+}\ \ \mbox{if}\ \ 1\leqslant n\leqslant \frac{16}{3}\sigma. \end{align} The restriction \eqref{Cond-01} originates from some applications of the Gagliardo-Nirenberg inequality technically. In order to estimate the solution itself in the $L^2$ norm, we apply the derived $(L^2\cap L^1)-L^2$ estimate \eqref{D1} in $[0,t]$ as well as the estimate for power nonlinearity \eqref{Nonlinearity-01} to get \begin{align*} &(1+t)^{\frac{3n-8\sigma}{4\sigma}}\|u^{\non}(t,\cdot)\|_{L^2}\lesssim(1+t)^{\frac{3n-8\sigma}{4\sigma}} \int_0^t(1+t-\tau)^{-\frac{3n-8\sigma}{4\sigma}}(1+\tau)^{-\frac{3n-4\sigma}{2\sigma}p+\frac{3n}{2\sigma}}\mathrm{d}\tau\,\|u\|_{X(T)}^p\\ &\qquad\lesssim \int_0^{t/2}(1+\tau)^{-\frac{3n-4\sigma}{2\sigma}p+\frac{3n}{2\sigma}}\mathrm{d}\tau\,\|u\|_{X(T)}^p+(1+t)^{\frac{9n-8\sigma}{4\sigma}-\frac{3n-4\sigma}{2\sigma}p}\int_{t/2}^t(1+t-\tau)^{-\frac{3n-8\sigma}{4\sigma}}\mathrm{d}\tau\,\|u\|_{X(T)}^p. \end{align*} From the assumption \begin{align}\label{Cond-02} p>p_{\mathrm{crit}}(n,\sigma)=1+\frac{6\sigma}{3n-4\sigma}\ \ \mbox{with}\ \ \frac{4}{3}\sigma<n<4\sigma, \end{align} one derives \begin{align*} -\frac{3n-4\sigma}{2\sigma}p+\frac{3n}{2\sigma}<-1\ \ \mbox{and}\ \ -\frac{3n-8\sigma}{4\sigma}>-1, \end{align*} which lead to \begin{align}\label{E2} (1+t)^{\frac{3n-8\sigma}{4\sigma}}\|u^{\non}(t,\cdot)\|_{L^2}\lesssim\|u\|_{X(T)}^p. \end{align} Associating the conditions \eqref{Cond-01} with \eqref{Cond-02}, we have \begin{align}\label{Cond-03} p_{\mathrm{crit}}(n,\sigma)=\max\big\{2,p_{\mathrm{crit}}(n,\sigma) \big\}<p\leqslant\frac{3n}{(3n-8\sigma)_+} \end{align} by taking $\frac{4}{3}\sigma<n\leqslant\frac{10}{3}\sigma$. Note that the dimension should fulfill \eqref{Restriction(n,sigma)}. Next, we apply the derived $(L^2\cap L^1)-\dot{H}^{\frac{4}{3}\sigma}$ estimate \eqref{D2} in $[0,t/2]$ associated with \eqref{Nonlinearity-01}, and $L^2-\dot{H}^{\frac{4}{3}\sigma}$ estimate \eqref{D3} in $[t/2,t]$ associated with \eqref{Nonlinearity-02} to obtain \begin{align} (1+t)^{\frac{3n}{4\sigma}}\|u^{\non}(t,\cdot)\|_{\dot{H}^{\frac{4}{3}\sigma}}&\lesssim\int_0^{t/2}(1+\tau)^{-\frac{3n-4\sigma}{2\sigma}p+\frac{3n}{2\sigma}}\mathrm{d}\tau\,\|u\|_{X(T)}^p+(1+t)^{\frac{3n}{2\sigma}-\frac{3n-4\sigma}{2\sigma}p}\int_{t/2}^t\mathrm{d}\tau \,\|u\|_{X(T)}^p\notag\\ &\lesssim\|u\|_{X(T)}^p\label{E3} \end{align} under the condition \eqref{Cond-03}. Thus, the combination of \eqref{E1}, \eqref{E2} as well as \eqref{E3} immediately completes \begin{align*} \|u^{\lin}\|_{X(T)}+\|u^{\non}\|_{X(T)}\lesssim \epsilon\|(u_0,u_1,u_2)\|_{\mathcal{B}_{\sigma}}+ \|u\|_{X(T)}^p, \end{align*} namely, the derivation of the crucial estimate \eqref{Cruc-01}. With the aim of proving \eqref{Cruc-02}, we notice that \begin{align*} \|\mathcal{N}u-\mathcal{N}\bar{u}\|_{X(T)}=\Big\| \int_0^tE_2(t-\tau,\cdot)\ast_{(x)}\big(|u(\tau,\cdot)|^p-|\bar{u}(\tau,\cdot)|^p\big)\,\mathrm{d}\tau \Big\|_{X(T)}. \end{align*} Thanks to H\"older's inequality, one gets \begin{align*} \|\,|u(\tau,\cdot)|^p-|\bar{u}(\tau,\cdot)|^p\|_{L^m}\lesssim\|u(\tau,\cdot)-\bar{u}(\tau,\cdot)\|_{L^{mp}}\big(\|u(\tau,\cdot)\|^{p-1}_{L^{mp}}+\|\bar{u}(\tau,\cdot)\|^{p-1}_{L^{mp}}\big), \end{align*} with $m=1,2$. Finally, employing the fractional Gagliardo-Nirenberg inequality to estimate three terms on the right-hand side of the previous inequality, we are able to derive our desired estimate \eqref{Cruc-02}. Then, our proof is finished. \begin{remark}\label{Rem-Scrop-02} Concerning another case \begin{align*} p>\max\left\{\frac{9n-8\sigma}{2(3n-4\sigma)_+},p_{\mathrm{crit}}(n,\sigma) \right\}\ \ \mbox{and}\ \ 2\leqslant p\leqslant\frac{3n}{(3n-8\sigma)_+}, \end{align*} we can also prove \eqref{E2} for $4\sigma\leqslant n\leqslant\frac{16}{3}\sigma$ because \begin{align*} (1+t)^{\frac{9n-8\sigma}{4\sigma}-\frac{3n-4\sigma}{2\sigma}p}\int_{t/2}^t(1+t-\tau)^{-\frac{3n-8\sigma}{4\sigma}}\mathrm{d}\tau\lesssim 1. \end{align*} However, it does not imply the lower bound with the critical exponent $p_{\mathrm{crit}}(n,\sigma)$, and the general global (in time) existence result is beyond the scope of the present paper. \end{remark} \begin{remark}\label{Rem-spe} For $n=\frac{8}{3}\sigma$ when $\eta\in(3,\infty)$, we just need to modify the norm \eqref{NEW002} by \begin{align*} \|u\|_{X(T)}:=\sup\limits_{t\in[0,T]}\left([\ln(\mathrm{e}+t)]^{-1}\|u(t,\cdot)\|_{L^2}+(1+t)^2\|u(t,\cdot)\|_{\dot{H}^{\frac{4}{3}\sigma}}\right) \end{align*} motivated from Corollary \ref{Coro-New}. At this time, the estimate \eqref{D1} will be changed into \begin{align*} \|E_2(t,\cdot)\ast_{(x)}g(t,\cdot)\|_{L^2}\lesssim \ln (\mathrm{e}+t)\|g(t,\cdot)\|_{L^2\cap L^1} \end{align*} for $n=\frac{8}{3}\sigma$ when $\eta\in(3,\infty)$. Again, by applying Proposition \ref{fractionalgagliardonirenbergineq}, we arrive at \begin{align*} \|\,|u(\tau,\cdot)|^p\|_{L^2\cap L^1}&\lesssim [\ln(\mathrm{e}+\tau)]^2(1+\tau)^{-2(p-2)}\|u\|_{X(T)}^p,\\ \|\,|u(\tau,\cdot)|^p\|_{L^2}&\lesssim [\ln(\mathrm{e}+\tau)](1+\tau)^{-2(p-1)}\|u\|_{X(T)}^p, \end{align*} under the restriction \eqref{Cond-01}. Then, with the same procedure as the above one, we also can demonstrate \eqref{Cruc-01} provided that the exponent $p$ satisfies \eqref{Cond-03}. \end{remark} \begin{remark}\label{Rem-Further_regularity} Providing that one is interested in the regularities of global (in time) solutions $u$, under the same conditions as those in Propositions \ref{Prop-(1,3)}-\ref{Prop-(3)} and Corollary \ref{Coro-New}, if \eqref{Restriction(n,sigma)} holds, the following estimates for the linearized Cauchy problem \eqref{Eq-Linear-Third-PDE} can be proved easily: \begin{align*} \|\partial_t^jv(t,\cdot)\|_{L^2}&\lesssim(1+t)^{-j-\frac{3n-8\sigma}{4\sigma}}\|(v_0,v_1,v_2)\|_{\mathcal{B}_{\sigma}},\\ \|\partial_t^jv(t,\cdot)\|_{\dot{H}^{\frac{2}{3}\sigma(2-j)}}&\lesssim(1+t)^{-\frac{3n}{4\sigma}}\|(v_0,v_1,v_2)\|_{\mathcal{B}_{\sigma}}, \end{align*} with $j=0,1,2$, which is a generalization of Propositions \ref{Prop-(1,3)}-\ref{Prop-(3)}. Hence, we may introduce the solution space \begin{align*} Y(T):=\mathcal{C}\big([0,T],H^{\frac{4}{3}\sigma}\big)\cap \mathcal{C}^1\big([0,T],H^{\frac{2}{3}\sigma}\big)\cap\mathcal{C}^2\big([0,T],L^2\big) \end{align*} for $T>0$ and any $\sigma\in(0,\infty)$, equipped the time-weighted Sobolev norm \begin{align*} \|u\|_{Y(T)}:=\sup\limits_{t\in[0,T]}\left(\,\sum\limits_{j=0,1,2}(1+t)^{j+\frac{3n-8\sigma}{4\sigma}}\|\partial_t^ju(t,\cdot)\|_{L^2}+(1+t)^{\frac{3n}{4\sigma}}\sum\limits_{j=0,1}\|\partial_t^ju(t,\cdot)\|_{\dot{H}^{\frac{2}{3}\sigma(2-j)}}\right). \end{align*} By repeating some analogous procedure as we have treated $\|u^{\non}(t,\cdot)\|_{L^2}$ and $\|u^{\non}(t,\cdot)\|_{\dot{H}^{\frac{4}{3}\sigma}}$ in Subsection \ref{Subsec-GESDS}, we may demonstrate \eqref{Cruc-01}-\eqref{Cruc-02} in $Y(T)$ instead of $X(T)$. Namely, by lengthy but straightforward computations, under the same condition of the exponent $p$ and regularities for small initial data, there is a uniquely determined Sobolev solution $u\in Y(\infty)$ to the third-order (in time) evolution equations \eqref{Eq-Third-PDE} with $\eta\in(1,\infty)$. Furthermore, the solution satisfies the following estimates: \begin{align*} \|\partial_t^ju(t,\cdot)\|_{L^2}&\lesssim \epsilon(1+t)^{-j-\frac{3n-8\sigma}{4\sigma}}\|(u_0,u_1,u_2)\|_{\mathcal{B}_{\sigma}},\\ \|\partial_t^ju(t,\cdot)\|_{\dot{H}^{\frac{2}{3}\sigma(2-j)}}&\lesssim \epsilon(1+t)^{-\frac{3n}{4\sigma}}\|(u_0,u_1,u_2)\|_{\mathcal{B}_{\sigma}}, \end{align*} with $j=0,1,2$. \end{remark} \section{Blow-up for the semilinear Cauchy problem}\label{Sec-Blow-up} \subsection{Preliminary with fractional Laplacian} $\ \ \ \ $Before proving blow-up of weak solutions to the semilinear problem \eqref{Eq-Third-PDE} with fractional Laplacian, let us recall some auxiliary lemmas derived in \cite{Dao-Reissig=2020,D'Abbicco-Fujiwara=2021}. \begin{lemma} \label{lemma2.1} Let $q>n$ and $\sigma\in(0,\infty)$. Setting $\tilde{\sigma}=\sigma-[\sigma]$, then it holds \begin{align*} |(-\Delta)^{\sigma}\langle x\rangle^{-q}|\lesssim\langle x\rangle^{-q_{\sigma}}\ \ \mbox{for}\ \ x\in\mathbb{R}^n, \end{align*} where $q_{\sigma}=q+2\sigma$ if $\sigma$ is an integer, or $q_{\sigma}=n+2\tilde{\sigma}$, otherwise. \end{lemma} \begin{lemma} \label{lemma2.2} Setting $\phi(x):= \langle x\rangle^{-q}$ and $\phi_R(x):= \phi(R^{-1}x)$ for any $R>0$, then it holds \begin{equation*} (-\Delta)^\gamma (\phi_R)(x)= R^{-2\gamma} \big((-\Delta)^\gamma \phi \big)(R^{-1}x) \end{equation*} for any number $\gamma\geqslant 0$. \end{lemma} Let us define some test functions with suitable scale that strongly relies on the new adjoint operator of \eqref{Eq-Third-PDE}, i.e. \begin{align*} -\partial_t^3+\mathcal{A}+\eta\mathcal{A}^{\frac{1}{3}}\partial_t^2-\eta\mathcal{A}^{\frac{2}{3}}\partial_t. \end{align*} For one thing, we set $\varphi(x):=\langle x\rangle^{-n-2s_{\sigma}}$, where $s_{\sigma}\in(0,1)$ is chosen as an arbitrary constant if $\sigma\in\mathbb{N}$, and as a small constant satisfying $s_{\sigma}\in(0,\sigma-[\sigma])$ if $\sigma\in\mathbb{R}_+\backslash\mathbb{N}$. For another, we introduce $\zeta\in\mathcal{C}^{\infty}$ with its support $\zeta(t)\subset[0,1]$ such that $\zeta(t)=1$ if $t\in[0,\frac{1}{2}]$, non-increasing, and $\zeta(t)=0$ if $t\in[1,\infty)$. Eventually, we put new test functions \begin{align*} \varphi_R(x):=\langle R^{-1}K^{-1}x\rangle^{-n-2s_{\sigma}}\ \ \mbox{and}\ \ \zeta_R(t):=\zeta(R^{-\frac{2}{3}\sigma}t) \end{align*} with a suitable constant $K\geqslant 1$ and a sufficiently large parameter $R\gg1$. \subsection{Proof of Theorem \ref{Thm-Blow-up}: Blow-up of weak solutions} $\ \ \ \ $To begin with the proof, according to the nonlinearity, let us introduce \begin{align*} I_{R}:=\int_0^{\infty}\int_{\mathbb{R}^n}|u(t,x)|^p\varphi_R(x)\zeta_R(t)\mathrm{d}x\mathrm{d}t. \end{align*} Assume by contradiction that $u=u(t,x)$ is a global (in time) weak solution to the semilinear Cauchy problem \eqref{Eq-Third-PDE} with a general parameter $\eta\in(0,\infty)$. Thus, it holds that \begin{align} &\epsilon\int_{\mathbb{R}^n}\left(\eta u_0(x)\mathcal{A}^{\frac{2}{3}}\varphi_R(x)+\eta u_1(x)\mathcal{A}^{\frac{1}{3}}\varphi_R(x)+u_2(x)\varphi_R(x)\right)\mathrm{d}x+I_R\notag\\ &\qquad=\int_0^{\infty}\int_{\mathbb{R}^n}u(t,x)\left(-\partial_t^3+\mathcal{A}+\eta\mathcal{A}^{\frac{1}{3}}\partial_t^2-\eta\mathcal{A}^{\frac{2}{3}}\partial_t\right)\big(\varphi_R(x)\zeta_R(t)\big)\mathrm{d}x\mathrm{d}t,\label{Weak_Solution} \end{align} carrying $\mathcal{A}=(-\Delta)^{\sigma}$ with $\sigma\in(0,\infty)$, that is, the solution $u$ has such properties that all the integrals are well-defined for $R>0$. In the first integral of \eqref{Weak_Solution}, the operator $\mathcal{A}^{\alpha}$ acting on the test function $\varphi_R(x)$ only occurs for the initial data $u_0(x),u_1(x)$, which leads to $R^{-\frac{4}{3}\sigma}$ as well as $R^{-\frac{2}{3}\sigma}$, respectively. It avoids sign conditions for $u_0(x)$ and $u_1(x)$ later by taking $R\gg1$. Applying H\"older's inequality, and taking $K=1$, we may estimate \begin{align} &\epsilon\int_{\mathbb{R}^n}\left(\eta u_0(x)\mathcal{A}^{\frac{2}{3}}\varphi_R(x)+\eta u_1(x)\mathcal{A}^{\frac{1}{3}}\varphi_R(x)+u_2(x)\varphi_R(x)\right)\mathrm{d}x+I_R\notag\\ &\qquad\lesssim\int_0^{\infty}\int_{\mathbb{R}^n}\left|u(t,x)\left(-\partial_t^3+\mathcal{A}+\eta\mathcal{A}^{\frac{1}{3}}\partial_t^2-\eta\mathcal{A}^{\frac{2}{3}}\partial_t\right)\big(\varphi_R(x)\zeta_R(t)\big)\right|\mathrm{d}x\mathrm{d}t\notag\\ &\qquad\lesssim R^{-2\sigma}\int_0^{R^{\frac{2}{3}\sigma}}\int_{\mathbb{R}^n}|u(t,x)|\varphi_R(x)\big(|\zeta_R'''(t)|+|\zeta_R(t)|+|\zeta_R''(t)|+|\zeta_R'(t)|\big)\mathrm{d}x\mathrm{d}t\notag\\ &\qquad\lesssim R^{-2\sigma}I_R^{\frac{1}{p}}\left(R^{n+\frac{2}{3}\sigma}\int_{\mathbb{R}^n}\langle\tilde{x}\rangle^{-n-2s_{\sigma}}\mathrm{d}\tilde{x}\right)^{\frac{1}{p'}}\notag\\ &\qquad\lesssim R^{\frac{3n+2\sigma}{3p'}-2\sigma}I_R^{\frac{1}{p}},\label{Blow-up-01} \end{align} where we employed Lemmas \ref{lemma2.1} and \ref{lemma2.2} to treat the nonlocal terms. From the condition \begin{align*} 1<p<p_{\mathrm{crit}}(n,\sigma)=\frac{3n+2\sigma}{(3n-4\sigma)_+}\ \ \mbox{that is}\ \ \frac{1}{p'}<\frac{6\sigma}{3n+2\sigma}, \end{align*} we know $R^{\frac{3n+2\sigma}{3}-2\sigma p'}\to0$ while $R\to\infty$. Then, recalling the crucial estimate \eqref{Blow-up-01} with Young's inequality, we state the contradiction as follows: \begin{align}\label{E4} 0\leqslant \lim\limits_{R\to\infty}I_R\lesssim \lim\limits_{R\to\infty}\left(R^{\frac{3n+2\sigma}{3}-2\sigma p'}-\epsilon\int_{\mathbb{R}^n}u_2(x)\varphi_R(x)\mathrm{d}x\right)<0, \end{align} thanks to the sign assumption \eqref{Sign_Assumption}. Therefore, it implies that any non-trivial weak solution may blow up in finite time. To more accurately describe the blow-up time for this weak solution, we take \begin{align*} R\uparrow T_{\epsilon,\mathrm{w}}^{\frac{3}{2\sigma}}\ \ \mbox{with}\ \ \sigma\in(0,\infty) \end{align*} in \eqref{E4}. Consequently, a contradiction immediately occurs provided that \begin{align*} T_{\epsilon,\mathrm{w}}^{\frac{3}{2\sigma}\left(\frac{3n+2\sigma}{3}-2\sigma p'\right)}\leqslant C_{u_2}\epsilon, \end{align*} which leads to \begin{align}\label{Upper-Subcrit} T_{\epsilon,\mathrm{w}}\leqslant C\epsilon^{-\frac{2\sigma}{6\sigma p'-(3n+2\sigma)}}\ \ \mbox{if}\ \ 1<p<p_{\mathrm{crit}}(n,\sigma). \end{align} It completes the proof of upper bound estimates for the lifespan in the subcritical case, namely, the first subcase of Theorem \ref{Thm-Lifespan-upper}. Turning to the critical case $p=p_{\mathrm{crit}}(n,\sigma)$, we first deduce that $I_R$ is uniformly bounded, namely, $u\in L^p([0,\infty)\times\mathbb{R}^n)$. Moreover, from \eqref{Blow-up-01} associated with Young's inequality, we claim \begin{align*} \lim\limits_{R\to\infty}\int_0^{\infty}\int_{\mathbb{R}^n}u(t,x)\left(-\partial_t^3+\eta\mathcal{A}^{\frac{1}{3}}\partial_t^2-\eta\mathcal{A}^{\frac{2}{3}}\partial_t\right)\big(\varphi_R(x)\zeta_R(t)\big)\mathrm{d}x\mathrm{d}t=0 \end{align*} because of $\zeta_R(t)\equiv1$ when $t\in[0,\frac{1}{2}R^{\frac{2}{3}\sigma}]$. It follows that \begin{align*} 0\leqslant \lim\limits_{R\to\infty}I_R&=\lim\limits_{R\to\infty}\int_0^{\infty}\int_{\mathbb{R}^n}u(t,x)\left(-\partial_t^3+\eta\mathcal{A}^{\frac{1}{3}}\partial_t^2-\eta\mathcal{A}^{\frac{2}{3}}\partial_t\right)\big(\varphi_R(x)\zeta_R(t)\big)\mathrm{d}x\mathrm{d}t\\ &\quad+\lim\limits_{R\to\infty}\int_0^{\infty}\int_{\mathbb{R}^n}u(t,x)\mathcal{A}\varphi_R(x)\zeta_R(t)\mathrm{d}x\mathrm{d}t-\epsilon\lim\limits_{R\to\infty}\int_{\mathbb{R}^n}u_2(x)\varphi_R(x)\mathrm{d}x \\ &\quad-\epsilon\lim\limits_{R\to\infty}\int_{\mathbb{R}^n}\left(\eta u_0(x)\mathcal{A}^{\frac{2}{3}}\varphi_R(x)+\eta u_1(x)\mathcal{A}^{\frac{1}{3}}\varphi_R(x)\right)\mathrm{d}x\\ &\lesssim K^{n-2\sigma p'}-\epsilon\lim\limits_{R\to\infty}\int_{\mathbb{R}^n}u_2(x)\varphi_R(x)\mathrm{d}x, \end{align*} in which the term with $K$ comes from the nonlocal term without time-derivative $\mathcal{A}\varphi_R(x)$ thanks to Lemma \ref{lemma2.2}. Finally, the contradiction occurs for taking sufficient large $K\gg1$, due to \eqref{Sign_Assumption} and $n-2\sigma p'=-\frac{2}{3}\sigma<0$ in the critical case $p=p_{\mathrm{crit}}(n,\sigma)$. We postpone the lifespan estimates from the above side in the next section due to its challenge. Our proof on blow-up of solutions is complete. \section{Sharp lifespan estimates for the semilinear Cauchy problem}\label{Sec-Lifespan} \subsection{Proof of Theorem \ref{Thm-Lifespan-lower}: Lower bound estimates for the lifespan}\label{Subsec-Lower} $\ \ \ \ $We will use some notations from Section \ref{Sec-GESDS}, particularly, the evolution space $X(T)$ introduced in \eqref{Evol-Space}. In order to derive lower bound estimates for the lifespan, we will deduce a new nonlinear inequality with time-dependent coefficients instead of \eqref{Cruc-01} because of $1<p\leqslant p_{\mathrm{crit}}(n,\sigma)$. Let us consider the dimension fulfills the condition \eqref{Restriction(n,sigma)}, and the remaining case for $n=\frac{8}{3}\sigma$ when $\eta\in(3,\infty)$ can be treated similarly by following Remark \ref{Rem-spe}. Thanks to the definition of mild solutions in \eqref{Mild-Solution}, we may represent and estimate local (in time) mild solutions to \eqref{Eq-Third-PDE} straightforwardly. According to the derived estimates \eqref{Nonlinearity-01} in Section \ref{Sec-GESDS}, one arrives at \begin{align*} (1+t)^{\frac{3n-8\sigma}{4\sigma}}\|u(t,\cdot)\|_{L^2}&\lesssim\epsilon\|(u_0,u_1,u_2)\|_{\mathcal{B}_{\sigma}} +\int_0^{t/2}(1+\tau)^{-\frac{3n-4\sigma}{2\sigma}p+\frac{3n}{2\sigma}}\mathrm{d}\tau\,\|u\|_{X(T)}^p\\ &\quad+(1+t)^{1+\frac{3n}{2\sigma}-\frac{3n-4\sigma}{2\sigma}p}\|u\|_{X(T)}^p, \end{align*} due to $n<4\sigma$ and the restriction \eqref{Cond-01} from some applications of the fractional Gagliardo-Nirenberg inequality. Moreover, the condition \eqref{Restriction(n,sigma)} for the sharp estimates of solutions to the linearized Cauchy problem should be guaranteed. Let us denote the growth function \begin{align*} L(t):=\begin{cases} (1+t)^{1+\frac{3n}{2\sigma}-\frac{3n-4\sigma}{2\sigma}p}&\mbox{if}\ \ 1<p<p_{\mathrm{crit}}(n,\sigma),\\ \ln(\mathrm{e}+t)&\mbox{if}\ \ p=p_{\mathrm{crit}}(n,\sigma). \end{cases} \end{align*} Since $-\frac{3n-4\sigma}{2\sigma}p+\frac{3n}{2\sigma}=-1$ if $p=p_{\mathrm{crit}}(n,\sigma)$, we can obtain \begin{align*} (1+t)^{\frac{3n-8\sigma}{4\sigma}}\|u(t,\cdot)\|_{L^2}\lesssim\epsilon\|(u_0,u_1,u_2)\|_{\mathcal{B}_{\sigma}} +L(t)\|u\|_{X(T)}^p, \end{align*} and, analogously, \begin{align*} (1+t)^{\frac{3n}{4\sigma}}\|u(t,\cdot)\|_{\dot{H}^{\frac{4}{3}\sigma}}\lesssim\epsilon\|(u_0,u_1,u_2)\|_{\mathcal{B}_{\sigma}} +L(t)\|u\|_{X(T)}^p. \end{align*} Recalling the definition of $X(T)$ in \eqref{Evol-Space}, the next crucial nonlinear inequality holds: \begin{align}\label{Cruc-03} \|u\|_{X(T)}\leqslant C_0\epsilon+C_1L(t)\|u\|_{X(T)}^p, \end{align} where $C_0,C_1$ are two positive constants independent of $\epsilon,T$, providing that \begin{align*} 2\leqslant p\leqslant\min\left\{p_{\mathrm{crit}}(n,\sigma),\frac{3n}{(3n-8\sigma)_+} \right\}=p_{\mathrm{crit}}(n,\sigma). \end{align*} The above minimal competition trivially holds when $n\leqslant\frac{8}{3}\sigma$, and \begin{align*} 1+\frac{6\sigma}{3n-4\sigma}=p_{\mathrm{crit}}(n,\sigma)\leqslant\frac{3n}{3n-8\sigma}\ \ \mbox{when}\ \ \frac{8}{3}\sigma<n\leqslant\frac{10}{3}\sigma. \end{align*} Note that from Section \ref{Sec-GESDS}, we restricted the uniform estimate $L(t)\lesssim 1$ in the supercritical case $p>p_{\mathrm{crit}}(n,\sigma)$ to ensure global (in time) existence of solutions. Let us now introduce \begin{align*} T^*:=\sup\big\{T\in[0,T_{\epsilon,\mathrm{m}})\ \ \mbox{such that}\ \ \mathcal{G}(T):=\|u\|_{X(T)}\leqslant M\epsilon \big\} \end{align*} with a sufficient large constant $M>0$ to be fixed later, which means $\mathcal{G}(T^*)\leqslant M\epsilon$. Plugging this upper bound into \eqref{Cruc-03} with $T=T^*$, we claim \begin{align*} \mathcal{G}(T^*)\leqslant C_0\epsilon+C_1L(T^*)\mathcal{G}(T^*)^p\leqslant \epsilon\left(C_0+C_1M^{p}\epsilon^{p-1}L(T^*)\right). \end{align*} By choosing a large constant $M$ such that \begin{align*} M>4C_0\ \ \mbox{as well as}\ \ 4C_1M^{p-1}\epsilon^{p-1}L(T^*)<1, \end{align*} we may have $\mathcal{G}(T^*)<\frac{M}{2}\epsilon$. Due to the fact that $\mathcal{G}(T)$ is a continuous function for any $T\in(0,T_{\epsilon,\mathrm{m}})$, nevertheless, the last estimate verifies that there exists a time $T_0\in(T^*,T_{\epsilon,\mathrm{m}})$ such that $\mathcal{G}(T_0)\leqslant M\epsilon$. It contradicts to the definition of $T^*$, i.e. the supremum of time for $\mathcal{G}(T)\leqslant M\epsilon$. Namely, we need to propose the reverse relation as follows: \begin{align}\label{E5} 4C_1M^{p-1}\epsilon^{p-1}L(T^*)\geqslant 1. \end{align} Consequently, according to \eqref{E5} and the expression of $L(T^*)$ with $T^*\leqslant T_{\epsilon,\mathrm{m}}$, the maximum time of local (in time) existence for mild solutions can be estimated from the below side such that \begin{itemize} \item when $1<p<p_{\mathrm{crit}}(n,\sigma)$, it holds \begin{align*} T_{\epsilon,\mathrm{m}}\geqslant C\epsilon^{-\frac{p-1}{-\frac{3n-4\sigma}{2\sigma}p+1+\frac{3n}{2\sigma}}}=C\epsilon^{-\frac{2\sigma}{6\sigma p'-(3n+2\sigma)}}, \end{align*} where we used H\"older's conjugate $p'=\frac{p}{p-1}$; \item when $p=p_{\mathrm{crit}}(n,\sigma)$, it holds \begin{align*} T_{\epsilon,\mathrm{m}}\geqslant \exp(C\epsilon^{-(p-1)}). \end{align*} \end{itemize} In conclusion, we have achieved our aim of lower bound estimates of the lifespan. \subsection{Proof of Theorem \ref{Thm-Lifespan-upper}: Upper bound estimates for the lifespan}\label{Subsec-Upper} $\ \ \ \ $Note that the lifespan in the subcritical case $1<p<p_{\mathrm{crit}}(n,\sigma)$ has been estimated in \eqref{Upper-Subcrit}. For this reason, we will concentrate on upper bound estimates for the lifespan $T_{\epsilon,\mathrm{w}}$ in the critical case $p=p_{\mathrm{crit}}(n,\sigma)$ only. Nevertheless, the proof associated with new test functions is quite different from the one of Theorem \ref{Thm-Blow-up}, and upper bound estimates for the lifespan in the critical case is always a delicate part (for example, the semilinear classical damped waves \cite{Lai-Zhou=2019}). Throughout this subsection, we clarify $p=p_{\mathrm{crit}}(n,\sigma)$ in all statements. Let us define the size of supports for initial data $u_j\in\mathcal{C}_0^{\infty}$ via \begin{align*} r_0:=\max\Big\{|x|:\ x\in \bigcup\limits_{j=0,1,2}\mathrm{supp}\,u_j(x) \Big\}. \end{align*} Different from those in the proof of Theorem \ref{Thm-Blow-up}, we now introduce the $\mathcal{C}_0^{\infty}$ test function $\chi=\chi(\tau)$ and the $L^{\infty}$ cutoff function $\chi^*=\chi^*(\tau)$ as follows: \begin{align*} \chi(\tau):=\begin{cases} 1&\mbox{if}\ \ \tau\in[0,\frac{1}{2}],\\ \mbox{decreasing}&\mbox{if}\ \ \tau\in(\frac{1}{2},1),\\ 0&\mbox{if}\ \ \tau\in[1,\infty), \end{cases} \ \ \mbox{and}\ \ \chi^*(\tau):=\begin{cases} 0&\mbox{if}\ \ \tau\in[0,\frac{1}{2}),\\ \chi(\tau)&\mbox{if}\ \ \tau\in[\frac{1}{2},\infty). \end{cases} \end{align*} For a large parameter $R\in(0,\infty)$, we may define \begin{align}\label{Su01} \psi_R(t,x):=\left[\chi\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right)\right]^m\ \ \mbox{and}\ \ \psi^*_R(t,x):=\left[\chi^*\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right)\right]^m \end{align} with a suitable parameter $m>2\sigma$ that will be chosen later. Let us multiply the test function $\psi_R(t,x)$ on the both sides of the equation in \eqref{Eq-Third-PDE}, and then integrate the resultant over $\mathbb{R}^n$ to deduce \begin{align}\label{E6} \int_{\mathbb{R}^n}|u(t,x)|^p\psi_R(t,x)\mathrm{d}x&=\int_{\mathbb{R}^n}u(t,x)\left(-\partial_t^3+\mathcal{A}+\eta\mathcal{A}^{\frac{1}{3}}\partial_t^2-\eta\mathcal{A}^{\frac{2}{3}}\partial_t\right)\psi_R(t,x)\mathrm{d}x\notag\\ &\quad+\frac{\mathrm{d}^3}{\mathrm{d}t^3}\int_{\mathbb{R}^n}u(t,x)\psi_R(t,x)\mathrm{d}x+\eta\frac{\mathrm{d}^2}{\mathrm{d}t^2}\int_{\mathbb{R}^n}u(t,x)\mathcal{A}^{\frac{1}{3}}\psi_R(t,x)\mathrm{d}x\notag\\ &\quad+\eta\frac{\mathrm{d}}{\mathrm{d}t}\int_{\mathbb{R}^n}u(t,x)\mathcal{A}^{\frac{2}{3}}\psi_R(t,x)\mathrm{d}x-3\frac{\mathrm{d}}{\mathrm{d}t}\int_{\mathbb{R}^n}u_t(t,x)\psi_{R,t}(t,x)\mathrm{d}x\notag\\ &\quad-2\eta\frac{\mathrm{d}}{\mathrm{d}t}\int_{\mathbb{R}^n}u(t,x)\mathcal{A}^{\frac{1}{3}}\psi_{R,t}(t,x)\mathrm{d}x, \end{align} in which we denoted $\psi_{R,t}(t,x):=\partial_t\psi_R(t,x)$. Before constructing a nonlinear differential inequality, we need to estimate time-derivatives and fractional Laplacians acting on the test function from the first term on the right-hand side of \eqref{E6}. A straightforward computation yields \begin{align*} \psi_{R,ttt}(t,x)&=m(m-1)(m-2)R^{-3}\left[\chi\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right)\right]^{m-3}\left[\chi'\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right)\right]^3\\ &\quad+3m(m-1)R^{-3}\left[\chi\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right)\right]^{m-2}\chi'\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right)\chi''\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right)\\ &\quad+mR^{-3}\left[\chi\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right)\right]^{m-1}\chi'''\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right). \end{align*} From the settings that $\chi\in\mathcal{C}_0^{\infty}([0,\infty))$, $|\chi(\tau)|\leqslant 1$ and \begin{align*} 0<\left|\chi^{(k)}\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right)\right|\lesssim 1\ \ \mbox{for}\ \ \frac{R}{2}<t+|x|^{\frac{2}{3}\sigma}<R \end{align*} with $k=1,2,3$, we may claim \begin{align*} |\psi_{R,ttt}(t,x)|\lesssim R^{-3}\left[\chi^{*}\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right)\right]^{m-3}=R^{-3}[\psi_R^*(t,x)]^{\frac{m-3}{m}}. \end{align*} To control the terms $(-\Delta)^{q\sigma}\psi_R(t,x)$ with $q=\frac{1}{3},\frac{2}{3},1$, motivated by \cite[Lemma 3.3]{Dao-Reissig=2019}, we first apply the derivative of composed function with any multi-index $\alpha$ to obtain \begin{align*} \left|\partial_x^{\alpha}\chi\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right)\right|&\lesssim\sum\limits_{k=1}^{|\alpha|}\chi^{(k)}\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right)\sum\limits_{|\gamma_1|+\cdots+|\gamma_k|=|\alpha|}\left|\partial_x^{\gamma_1}\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right)\right|\cdots\left|\partial_x^{\gamma_k}\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right)\right|\\ &\lesssim\sum\limits_{k=1}^{|\alpha|}\chi^{(k)}\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right)|x|^{\frac{2}{3}\sigma k-|\alpha|}R^{-k}\\ &\lesssim R^{-1}|x|^{\frac{2}{3}\sigma-|\alpha|}, \end{align*} where we employed $\tau=t+|x|^{\frac{2}{3}\sigma}\leqslant R$, otherwise $\chi^{(k)}(\tau)=0$ for $k=1,\dots,|\alpha|$. Note that in the last chain, we took $k=1$ due to $|x|^{\frac{2}{3}\sigma}\leqslant R$. From the assumption $\sigma\in3\mathbb{N}$ implying $q\sigma\in\mathbb{N}$, a further application of such rule shows \begin{align*} |(-\Delta)^{q\sigma}\psi_R(t,x)|&\lesssim\sum\limits_{k=1}^{2q\sigma}\left[\chi\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right)\right]^{m-k}\sum\limits_{|\gamma_1|+\cdots+|\gamma_{k}|=2q\sigma}\left|\partial_x^{\gamma_1}\chi\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right)\right|\cdots\left|\partial_x^{\gamma_k}\chi\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right)\right|\\ &\lesssim\sum\limits_{k=1}^{2q\sigma}\left[\chi^*\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right)\right]^{m-k}|x|^{\frac{2}{3}\sigma k-2q\sigma}R^{-k}\\ &\lesssim R^{-3q}\left[\chi^*\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right)\right]^{m-2q\sigma}=R^{-3q}[\psi_R^*(t,x)]^{\frac{m-2q\sigma}{m}}, \end{align*} where we employed $\frac{R}{2}\leqslant |x|^{\frac{2}{3}\sigma}\leqslant R$ again in the last line. Therefore, by an analogous way, one has \begin{align*} |(-\Delta)^{\sigma}\psi_R(t,x)|&\lesssim R^{-3}[\psi_R^*(t,x)]^{\frac{m-2\sigma}{m}},\\ |(-\Delta)^{\frac{2}{3}\sigma}\psi_{R,t}(t,x)|&\lesssim R^{-3}[\psi_R^*(t,x)]^{\frac{m-\frac{4}{3}\sigma-1}{m}},\\ |(-\Delta)^{\frac{1}{3}\sigma}\psi_{R,tt}(t,x)|&\lesssim R^{-3}[\psi_R^*(t,x)]^{\frac{m-\frac{2}{3}\sigma-2}{m}}. \end{align*} The summary of last estimates with $\sigma\in3\mathbb{N}$ indicates \begin{align*} \left|\left(-\partial_t^3+\mathcal{A}+\eta\mathcal{A}^{\frac{1}{3}}\partial_t^2-\eta\mathcal{A}^{\frac{2}{3}}\partial_t\right)\psi_R(t,x)\right|\lesssim R^{-3}[\psi_R^*(t,x)]^{1-\frac{2\sigma }{m}}. \end{align*} For this reason, let us integrate \eqref{E6} over $(0,T_{\epsilon,\mathrm{w}})$ to get \begin{align*} &\int_0^{T_{\epsilon,\mathrm{w}}}\int_{\mathbb{R}^n}|u(t,x)|^p\psi_R(t,x)\mathrm{d}x\mathrm{d}t\lesssim R^{-3}\int_0^{T_{\epsilon,\mathrm{w}}}\int_{\mathbb{R}^n}|u(t,x)|[\psi_R^*(t,x)]^{1-\frac{2\sigma}{m}}\mathrm{d}x\mathrm{d}t\\ &\qquad+\int_{\mathbb{R}^n}\big(u_{tt}(t,x)\psi_R(t,x)+2u_t(t,x)\psi_{R,t}(t,x)+u(t,x)\psi_{R,tt}(t,x)\big)\mathrm{d}x\Big|_{t=0}^{t=T_{\epsilon,\mathrm{w}}}\\ &\qquad+\int_{\mathbb{R}^n}\big(\eta u_{t}(t,x)\mathcal{A}^{\frac{1}{3}}\psi_{R}(t,x)+\eta u(t,x)\mathcal{A}^{\frac{1}{3}}\psi_{R,t}(t,x)\big)\mathrm{d}x\Big|_{t=0}^{t=T_{\epsilon,\mathrm{w}}}\\ &\qquad+\int_{\mathbb{R}^n}\big(\eta u(t,x)\mathcal{A}^{\frac{2}{3}}\psi_{R}(t,x)-3u_t(t,x)\psi_{R,t}(t,x)-2\eta u(t,x)\mathcal{A}^{\frac{1}{3}}\psi_{R,t}(t,x)\big)\mathrm{d}x\Big|_{t=0}^{t=T_{\epsilon,\mathrm{w}}}. \end{align*} Without loss of generality, we assume the lifespan fulfilling \begin{align*} \sqrt{T_{\epsilon,\mathrm{w}}}>R_0:=\sqrt{2}r_0^{\frac{1}{3}\sigma} \end{align*} so that concerning $R\in[R_0^2,T_{\epsilon,\mathrm{w}})$ we notice \begin{align*} \frac{T_{\epsilon,\mathrm{w}}+|x|^{\frac{2}{3}\sigma}}{R}\geqslant 1\ \ \mbox{for}\ \ x\in\mathbb{R}^n,\ \ \mbox{and}\ \ \frac{|x|^{\frac{2}{3}\sigma}}{R}\leqslant\frac{r_0^{\frac{2}{3}\sigma}}{R_0^2}=\frac{1}{2}\ \ \mbox{for}\ \ x\in B_{r_0}. \end{align*} For these settings, we know $\partial_t^k\psi_R(T_{\epsilon,\mathrm{w}},x)=0$ with $k=0,1,2$ for $x\in\mathbb{R}^n$, moreover, $\psi_R(0,x)=1$ and $\partial_t^k\psi_R(0,x)=0$ with $k=1,2$ for $x\in B_{r_0}$. Benefited from the support conditions for initial data in a ball $B_{r_0}$, it leads to \begin{align}\label{E7} &\epsilon\int_{\mathbb{R}^n}u_2(x)\mathrm{d}x+\int_0^{T_{\epsilon,\mathrm{w}}}\int_{\mathbb{R}^n}|u(t,x)|^p\psi_R(t,x)\mathrm{d}x\mathrm{d}t\notag\\ &\qquad\lesssim R^{-3}\int_0^{T_{\epsilon,\mathrm{w}}}\int_{\mathbb{R}^n}|u(t,x)|[\psi_R^*(t,x)]^{1-\frac{2\sigma}{m}}\mathrm{d}x\mathrm{d}t\notag\\ &\qquad\lesssim R^{(1+\frac{3n}{2\sigma})\frac{1}{p'}-3}\left(\int_0^{T_{\epsilon,\mathrm{w}}}\int_{\mathbb{R}^n}|u(t,x)|^p[\psi_R^*(t,x)]^{p-\frac{2\sigma p}{m}}\mathrm{d}x\mathrm{d}t\right)^{\frac{1}{p}}, \end{align} in which we used H\"older's inequality associated with \begin{align*} \mathrm{supp}\,\psi^*_R(t,x)\subset\left([0,R]\times B_{R^{\frac{3}{2\sigma}}}\right)\backslash\left\{(t,x):\ t+|x|^{\frac{2}{3}\sigma}\leqslant\tfrac{R}{2} \right\}. \end{align*} Let us now introduce the auxiliary functional \begin{align*} Y_p(R):=\int_0^Ry_p(r)r^{-1}\mathrm{d}r\ \ \mbox{with}\ \ y_p(r):=\int_0^{T_{\epsilon,\mathrm{w}}}\int_{\mathbb{R}^n}|u(t,x)|^p[\psi_r^*(t,x)]^{p-\frac{2\sigma p}{m}}\mathrm{d}x\mathrm{d}t. \end{align*} By letting $\tau=\frac{1}{r}(t+|x|^{\frac{2}{3}\sigma})$ as a new integral variable, according to the support condition and non-increasing property of $\chi(\tau)$, we are able to derive \begin{align*} Y_p(R)&=\int_0^R\left(\int_0^{T_{\epsilon,\mathrm{w}}}\int_{\mathbb{R}^n}|u(t,x)|^p[\psi_r^*(t,x)]^{p-\frac{2\sigma p}{m}}\mathrm{d}x\mathrm{d}t\right)r^{-1}\mathrm{d}r\\ &\leqslant\int_0^{T_{\epsilon,\mathrm{w}}}\int_{\mathbb{R}^n}|u(t,x)|^p\left(\int_{(t+|x|^{\frac{2}{3}\sigma})/R}^{\infty}\,[\chi^*(\tau)]^{(m-2\sigma)p}\tau^{-1}\mathrm{d}\tau\right)\mathrm{d}x\mathrm{d}t\\ &\leqslant\int_0^{T_{\epsilon,\mathrm{w}}}\int_{\mathbb{R}^n}|u(t,x)|^p\sup\limits_{r\in(0,R)}\left[\chi^*\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{r}\right)\right]^{(m-2\sigma)p}\int_{1/2}^{1}\tau^{-1}\mathrm{d}\tau\mathrm{d}x\mathrm{d}t\\ &\leqslant\ln 2\int_0^{T_{\epsilon,\mathrm{w}}}\int_{\mathbb{R}^n}|u(t,x)|^p\left[\chi^*\left(\tfrac{t+|x|^{\frac{2}{3}\sigma}}{R}\right)\right]^{(m-2\sigma)p}\mathrm{d}x\mathrm{d}t \end{align*} since $m>2\sigma$. Using $\chi^*(\tau)\leqslant \chi(\tau)$, it holds \begin{align}\label{E8} Y_p(R)&\lesssim\int_0^{T_{\epsilon,\mathrm{w}}}\int_{\mathbb{R}^n}|u(t,x)|^p[\psi_R(t,x)]^{p-\frac{2\sigma p}{m}}\mathrm{d}x\mathrm{d}t=\int_0^{T_{\epsilon,\mathrm{w}}}\int_{\mathbb{R}^n}|u(t,x)|^p\psi_R(t,x)\mathrm{d}x\mathrm{d}t \end{align} by choosing $m>\max\{2\sigma,n+\frac{2}{3}\sigma \}$ because of the critical case $p=p_{\mathrm{crit}}(n,\sigma)$ in our consideration. Recalling $Y'_p(R)=y_p(R)R^{-1}$, and combining with \eqref{E7} as well as \eqref{E8} so far we arrive at \begin{align}\label{E9} \left(\epsilon\int_{\mathbb{R}^n}u_2(x)\mathrm{d}x+Y_p(R)\right)^p\lesssim y_p(R)=R\,Y'_p(R) \end{align} for $R\in[R_0^2,T_{\epsilon,\mathrm{w}})$. Indeed, taking an integration over $[R_0,R]$ in \eqref{E9}, we have \begin{align}\label{G1} Y_p(R)\gtrsim\epsilon^{p_{\mathrm{crit}}(n,\sigma)}\left|\int_{\mathbb{R}^n}u_2(x)\mathrm{d}x\right|^p\int_{R_0}^R r^{-1}\mathrm{d}r\geqslant C_{u_2,p}\,\epsilon^{p_{\mathrm{crit}}(n,\sigma)}\ln R \end{align} under the sign condition \eqref{Sign_Assumption}. Another viewpoint of \eqref{E9} indicates \begin{align*} \frac{\mathrm{d}}{\mathrm{d}R}\left[\frac{1}{1-p}[Y_p(R)]^{1-p}\right]=[Y_p(R)]^{-p}\,Y'_p(R)\gtrsim R^{-1}. \end{align*} The integration of the last inequality over $[\sqrt{R},R]$ gives \begin{align}\label{G2} \ln R\lesssim\frac{1}{p-1}\left([Y_p(\sqrt{R})]^{1-p}-[Y_p(R)]^{1-p}\right)\lesssim [Y_p(\sqrt{R})]^{1-p_{\mathrm{crit}}(n,\sigma)}. \end{align} Remember that $p_{\mathrm{crit}}(n,\sigma)>1$. We combine \eqref{G1} and \eqref{G2} to deduce \begin{align*} \ln R\lesssim C\epsilon^{p_{\mathrm{crit}}(n,\sigma)(1-p_{\mathrm{crit}}(n,\sigma))}(\ln R)^{1-p_{\mathrm{crit}}(n,\sigma)}, \end{align*} as a consequence, \begin{align*} \ln\sqrt{T_{\epsilon,\mathrm{w}}}=\lim\limits_{R\uparrow\sqrt{T_{\epsilon,\mathrm{w}}}}\ln R\leqslant C\epsilon^{-(p_{\mathrm{crit}}(n,\sigma)-1)}. \end{align*} Finally, taking the action of the exponential function provides the completeness of our proof. \section*{Acknowledgments} The author was partially supported by the National Natural Science Foundation of China under Grant No. 12171317.
\section{Introduction} \begin{figure}[t] \vskip 0.0in \begin{center} \centerline{\includegraphics[width=\columnwidth] {img/REaLTabFormer_Final_EQ4.pdf}} \caption{ Illustration of the REaLTabFormer model. The left block shows the non-relational tabular data model using GPT-2 with a causal LM head. In contrast, the right block shows how a relational dataset's child table is modeled using a sequence-to-sequence (Seq2Seq) model. The Seq2Seq model uses the observations in the parent table to condition the generation of the observations in the child table. The trained GPT-2 model on the parent table, with weights frozen, is also used as the encoder in the Seq2Seq model.} \label{fig:realtabformer-model} \end{center} \vskip -0.3in \end{figure} Tabular data is one of the most common forms of data. Many datasets from surveys, censuses, and administrative sources are provided in this form. These datasets may contain sensitive information that cannot be shared openly \citep{abdelhameed2018privacy}. Even when statistical disclosure methods are applied, they may remain vulnerable to malicious attacks \citep{cheng2017enterprise}. As a result, their dissemination is restricted and the data have limited utility \citep{o2015individual}. Differential privacy methods \citep{ji2014differential}, homomorphic encryption approaches \citep{aslett2015review,wood2020homomorphic}, or federated machine learning \citep{yang2019federated,lin2021privacy} may be implemented, allowing insights from sensitive data to be accessible to researchers. Synthetic tabular data with similar statistical properties as the real data offer an alternative, offering more value especially in granular and segmentation analyses. To comply with data privacy requirements, the generative models that produce these synthetic data must provide guarantees that “data copying” does not happen \citep{meehan2020non,carlini2023extracting}. Formally, tabular data is a collection of observations (rows) $o_i$ that may or may not be independent. A single observation in a tabular data $\mathbf{T}$ with $n$ columns is defined by $o_i = [x_{i1}, x_{i2}, ..., x_{ij}, ..., x_{in}]$, and $j$ indicating the $j^{th}$ column. We refer to tabular data having observations independent of each other as \textbf{non-relational tabular data}. Tabular data having observations related to each other are referred to as \textbf{relational tabular data}. Relational datasets have at least one pair of tabular data files with a one-to-many mapping of observations between the parent table and the child table, respectively, linked by a unique identifier. In the context of a relational dataset, a \textbf{parent table} is a non-relational tabular data, whereas the \textbf{child table} is a relational tabular data. Relational tabular databases model the logical partitioning of data and prevent unnecessary duplication of observations from the parent to child tables \citep{jatana2012survey}. Despite its ubiquity, limited work has been done in generating synthetic relational datasets. This may be due to the challenging nature of modeling the complex relationships within and across tables. The field of synthetic data generation has seen significant development in recent years \citep{gupta2016synthetic,abufadda2021survey,hernandez2022synthetic,figueira2022survey}. Generative models have become mainstream with the advent of synthetic image generation models such as DALL-E \citep{ramesh2021zero}, and most recently, ChatGPT. While generative models for images and text are common, models for producing synthetic tabular data are comparatively limited despite their multiple possible applications. Synthetic tabular data can contribute to addressing data privacy issues and data sparseness \citep{appenzeller2022privacy}. They can help to make sensitive data accessible to researchers \citep{goncalves2020generation}, and to fill gaps in data availability for counterfactual research and agent-based simulations \citep{fagiolo2019validation}, and for synthetic control methods \citep{abadie2015comparative}. Further value can be derived from tabular data by building predictive models using machine learning \citep{shwartz2022tabular}. These predictive models can infer variables of interest in the data that may otherwise be expensive to collect or correspond to some success metrics that can guide business decisions. Synthetic data produced by deep learning models have been shown to perform well in predictive modeling tasks. This extends the utility of real-world data that may otherwise be unused due to privacy concerns. This paper introduces the \textbf{REalTabFormer}, a transformer-based framework for generating non-relational tabular data and relational datasets. It makes the following contributions: \vspace{-5pt} \paragraph{Unified framework} The REalTabFormer uses an autoregressive (GPT-2) transformer to model non-relational tabular data for modeling and generating parent tables. It then models and generates observations in the child table using the sequence-to-sequence (Seq2Seq) \citep{yun2019transformers} framework. The encoder network uses the pre-trained weights of the network for the parent table, contextualizing the input for generating arbitrary-length data corresponding to observations in a child table, via the decoder network. \vspace{-5pt} \paragraph{Strategies for privacy-preserving training} Synthetic data generation models must not only be able to generate realistic data but also implement safeguards to prevent the model from ``memorizing" and copying observations in the training data during sampling. We use the \textit{distance to closest record} (DCR), a data-copying measure, and \textit{statistical bootstrapping} to detect overfitting during training robustly. We introduce \textit{target masking} for regularization to reduce the likelihood of training data being replicated by the model. \vspace{-5pt} \paragraph{Open-sourced models} We publish the REaLTabFormer models as an open-sourced Python package. Install the package using: \hspace{0.1cm} \texttt{pip install realtabformer}.\footnote{\href{https://github.com/avsolatorio/REaLTabFormer}{\url{https://github.com/avsolatorio/REaLTabFormer}}} \vspace{-5pt} \paragraph{Comprehensive evaluation} We evaluate the performance of our models on a variety of real-world datasets. We use open-sourced state-of-the-art models as baselines to assess the performance of REaLTabFormer in generating non-relational and relational tabular datasets. Our experiments demonstrate the effectiveness of the REaLTabFormer model for non-relational tabular data, beating current state-of-the-art in machine learning tasks for large datasets. We further demonstrate that the synthesized observations for the child table generated by the REaLTabFormer capture relational statistics more accurately than the baseline models. \vspace{-2pt} \section{Related Work} \label{relatedwork} Recent advances in deep learning, such as generative adversarial networks \citep{park2018data,xu_modeling_2019,zhao2021ctab}, autoencoders \citep{li2019evaluating,xu_modeling_2019,darabi2021synthesising}, language models \citep{borisov_language_2022}, and diffusion models \citep{kotelnikov2022tabddpm} have been applied to synthetic non-relational tabular data generation. These papers demonstrate deep learning models' capacity to produce more realistic data than traditional approaches such as Bayesian networks \citep{xu_modeling_2019}. On the other hand, generative models for relational datasets are limited \citep{patki_synthetic_2016,gueye2022row}. Existing models are based on Hierarchical Modeling Algorithms \citep{patki_synthetic_2016} where traditional statistical models, Gaussian Copulas, are used to learn the joint distributions for each and across tables. While these models can synthesize data, the quality of the generated data does not accurately capture the nuanced conditions within and across tables (Fig.~\ref{fig:rossmann-date-sales} and Fig.~\ref{fig:airbnb-device_type-age_group}). \citet{padhi_tabular_2021} presented TabGPT for generating synthetic transactional data. They showed that autoregressive transformers, particularly GPT, can synthesize arbitrary-length data. One limitation of TabGPT is that one has to train independent models to produce transactions for each user. This becomes impractical for real-world applications. Our work generalizes the use of GPT by proposing a sequence-to-sequence framework for generating arbitrary-length synthetic data conditioned on an input. \section{REaLTabFormer} \label{realtabformer} REaLTabFormer is a transformer-based framework for generating non-relational tabular data using an autoregressive model and relational tabular data using a sequence-to-sequence (Seq2Seq) architecture. The framework also consists of strategies for encoding tabular data (Section \ref{tabdataencoding}), a statistical method to detect overfitting (Section \ref{overfitting}), and a constrained sampling strategy during generation. Details of the framework are described in this section. First, we present our proposed models to synthesize realistic relational datasets. Next, we outline and describe the data processing applied to the tabular data as input for training the models. We then discuss solutions to improve our model's training and sampling process. \subsection{The REaLTabFormer Models} \paragraph{Parent table model} To generate synthetic observations for a non-relational tabular data $\mathbf{T}$, we model the conditional distribution of columnar values in each row of the data. Consider a single observation $o_i = [x_{i1}, x_{i2}, ..., x_{ij}, ..., x_{in}]$ in $\mathbf{T}$ as defined earlier. We treat $o_i$ as a sequence with potential dependencies across values $x_{ij}$, similar to a sentence in a text. This re-framing provides us with a framework to learn the conditional distribution $x_{ij} \sim P(X|x_{i1}, x_{i2}, ..., x_{ij-1})$ and sequentially generate the next values in the sequence, eventually generating the full observation \citep{jelinek1985markov,bengio2000neural}. We use an autoregressive model to learn this distribution, Fig.~\ref{fig:realtabformer-model}. In the context of relational datasets, we use this approach to generate synthetic observations for the parent table $\mathbf{T_0}$. We extend this formulation to generate the child table $\mathbf{T'}$---a relational tabular data---associated with the parent table $\mathbf{T_0}$. \vspace{-5pt} \paragraph{Child table model} The extension is established by introducing a context learned by an encoder network from observations in $\mathbf{T_0}$. Instead of generating $o_i$ in $\mathbf{T'}$ independently, we concatenate the child table observations related to the same observation in $\mathbf{T_0}$. This forms an arbitrary-length sequence $s_i = [o_i^1, o_i^2, ..., o_i^n]$, where $n$ is the number of related observations in $\mathbf{T'}$. We propose to model the generation of $s_i$ given an observation in $\mathbf{T_0}$ as $x_{ij}^n \sim P(X|o_i^1, ...,x_{i1}^n, x_{i2}^n, ..., x_{ij-1}^n, C_k)$, where $C_k$ is a context captured from a related observation in the parent tabular data $\mathbf{T_0}$. We also use the same network trained on the parent table, \textbf{with weights frozen}, as the Seq2Seq model's encoder. This choice is expected to speed up the training process since only the cross-attention layer and the decoder network are needed to be trained for the child table model. The encoder network is assumed to have learned the properties of the parent table and will transfer this information to the decoder without further fine-tuning its weights, Fig~\ref{fig:realtabformer-model}. \begin{figure}[t] \begin{center} \centerline{\includegraphics[width=\columnwidth]{img/rossmann/Date_Sales-test_data.pdf}} \caption{Graph of the daily mean of the \texttt{Sales} variable computed from the original Rossmann dataset (blue), synthetic data produced by REaLTabFormer (orange), and data generated by SDV (green). The REaLTabFormer closely captures the seasonality in the data compared with the HMA model from the SDV.} \vskip -0.4in \label{fig:rossmann-date-sales} \end{center} \end{figure} \paragraph{GPT-2: an autoregressive transformer} Previous works have shown that transformer-based autoregressive models can capture the conditional distribution of sequential data very well \citep{radford_language_2019,padhi_tabular_2021}. REaLTabFormer uses the GPT-2 architecture---a transformer-decoder architecture designed for autoregressive tasks---as its base model. We adopt the same architecture for all GPT-2 instances in the framework for simplicity. The GPT-2 architecture used in the REaLTabFormer has 768-dimensional embeddings, 6 decoder layers, and 12 attention heads---a set of parameters similar to DistilGPT2. We use the implementation from the HuggingFace transformers library \citep{wolf_transformers_2020}. \newcommand{\unskip\ \vrule\ }{\unskip\ \vrule\ } \begin{figure*} \centering \includegraphics[width=0.38\textwidth]{img/airbnb/AIRBNB_device_type-age_group_real-notbold-annotated.pdf} \includegraphics[width=0.29\textwidth]{img/airbnb/AIRBNB_device_type-age_group_sdv-notbold-annotated.pdf} \includegraphics[width=0.27\textwidth]{img/airbnb/AIRBNB_device_type-age_group_rtf-notbold-annotated.pdf} \vskip 0.05in \caption{Joint distributions of the \texttt{age\_group} variable in the parent table and the \texttt{device\_type} in the child table of the Airbnb test dataset (left), the SDV (middle), and the REalTabFormer (right). The plots show that the REaLTabFormer can synthesize values across the domain of the variables, while SDV learned only two device types out of thirteen. The REaLTabFormer also generalized and imputed age values for users with ``iPodtouch" device (red box). This device type group has missing values for age in the original data.} \label{fig:airbnb-device_type-age_group} \end{figure*} \vspace{-2pt} \subsection{Tabular Data Encoding} \label{tabdataencoding} The GReaT model that uses pretrained large language models (LLMs) proposed by \citet{borisov_language_2022} offers insight into the minimal data processing requirements for language models in generating tabular data. There is, however, the potential for optimization in using autoregressive language models for this task, as the fine-tuning process of a large pretrained model incurs computational costs. Particularly, LLMs are trained on a large vocabulary where most of the tokens are not needed for generating the tabular data at hand. These unnecessary tokens increase the model's computational requirements and prolong training and sampling times. To improve the efficiency of our model, we adopt a fixed-set vocabulary as initially proposed by \citet{padhi_tabular_2021}. Generating a fixed vocabulary for each column in the tabular data offers various advantages in training performance and sampling. One of the main advantages is being able to filter irrelevant tokens when generating values for a specific column. This directly contributes to efficiency in sampling by reducing the chances of generating invalid samples. Our model performs minimal transformation of the raw data. First, we identify the various data types for each column in the data. We then perform a series of data processing specific to the column and data type. Notably, we adopt a fully text-based strategy in handling numerical values. These transformations produce a transformed tabular data used to train the model. \citet{borisov_language_2022} showed that variable order has an insignificant impact on language models, so we did not apply variable permutation. We discuss the processing for each data type in Appendix~\ref{appendix:raw-data-processing}. \vspace{-4pt} \paragraph{Training data for the parent table} The GPT-2 model we use requires a set of token ids as input. To generate these sequences of token ids, we first create a vocabulary. This vocabulary maps the unique tokens in each column to a unique token id. Then, for each row in the modified data, we apply the mapping in the vocabulary to the tokens. This produces a list of token ids for each row of the data. The model is then trained on an autoregressive task wherein the target data corresponds to the right-shifted tokens of the input data. \vspace{-4pt} \paragraph{Training data for the child table} We concatenate the transformed observations corresponding to related rows in the child table. A special token is added before and after the set of tokens representing an individual observation. In this form, the data we use to train the Seq2Seq model contains input-output pairs. An input value contains a fixed-length array of token ids representing the observation in the parent table. The input is similar to the input used in the parent table model. An arbitrary-length array with the concatenated token ids for each related observation in the child table represents the output value. The number of related observations that can be modeled is limited by computational resources. \subsection{REaLTabFormer Training and Sampling} Deep learning models for generative tasks face challenges of overfitting the data resulting in issues such as data-copying \citep{meehan2020non,carlini2023extracting}. Furthermore, observations generated by generative models for tabular data could face issues of validity and inconsistency. These issues in the generated samples impact the efficiency of the generative process. Our proposed framework addresses the aforementioned issues by, (i) introducing a robust statistical method to monitor overfitting, and (ii) target masking to further reduce the risk of data copying. To improve the rate of producing valid observations by the model, we also implement a constrained generation strategy during the sampling stage. \subsubsection{Target masking} \label{targetmasking} Data copying is a critical issue for deep learning-based generative tabular models as it can expose and compromise sensitive information in the training data. To mitigate data-copying, we introduce \textbf{target masking}. Target masking is a form of regularization aimed at minimizing the likelihood of records in the training data being ``memorized" and copied by the generative model. Unlike the token masking introduced in BERT \citep{devlin2018bert}, where input tokens are masked and the model is expected to predict the correct token, target masking implements random replacement of the target or label tokens with a special mask token. This artificially introduces missing values in the data. We intend for the model to learn the masks instead of the actual values. During the sampling stage, we then restrict the mask token generation, forcing the model to fill the value with a valid token probabilistically. Notably, even when the model learns to copy the input-output pair, the learned output corresponds to the masked version of the input. Therefore, when we process the output, the probabilistic nature of replacing the mask token reduces the likelihood of generating the training data. The mask rate parameter controls the proportion of the tokens that are masked. We use a mask rate of $10\%$ in our experiments. \subsubsection{Overfitting assessment} \label{overfitting} Applying deep learning models to small datasets may easily result in overfitting. This may cause privacy-related issues when the model generates observations that are copied from the training data. Knowing when the model overfits the data is also crucial when the purpose is to generate diverse out-of-sample data. An overfitted model tends to generate samples generally closer to the training data, thereby limiting the generalization capacity of the model. While the former issue can be resolved by post-generation filtering, the latter must be detected during the model training. Taking hold-out data to detect overfitting is a common strategy in machine learning. Unfortunately, this strategy could result in the premature termination of model training. It may also penalize a model based only on a small subset of the data \citep{blum1999beating}. The training procedures of existing state-of-the-art models do not explicitly check for overfitting \citep{xu_modeling_2019,borisov_language_2022,kotelnikov2022tabddpm}. We propose and describe below an empirical statistical method to inform the generative model when overfitting happens. The method allows for the full data to be used in the training without the need for a hold-out set. The design of the method is expected to also help prevent data copying and the production of data that is riskily close to the training data. \vspace{-2pt} \paragraph{Distance to closest record} We use the distance to the closest record (DCR) \citep{park2018data} to measure the similarity of synthetic samples to the original data. The DCR is evaluated by taking a specified distance metric $L$ between the training data $T_r$ and the generated data $G$. We then find the smallest distance for each record. Consider the distance matrix between $T_r$ and $G$, \vspace{-5pt} \begin{equation} \mathbf{D} = L(T_r, G) \vspace{-3pt} \end{equation} The minimum value in each row $i$ of $\mathbf{D}$ is the minimum distance of the $i^{th}$ record in the training data with respect to all records in the generated data. We denote this set of minimum values as $\vec{d_i}$. The minimum value in each column $j$ of $\mathbf{D}$ is the minimum distance of the $j^{th}$ record in the generated data with respect to all records in the training data. We denote this set of minimum values as $\vec{d_j}$. We then take $\vec{d_g} = [\vec{d_i}, \vec{d_j}]$ as the distribution of distances to closest records between the training data and the generated data. We define the quantity \vspace{-5pt} \begin{equation} \label{eq:dcr} \vec{d} = [\vec{d_i}, \vec{d_j}] \vspace{-3pt} \end{equation} as the distance to closest record distribution for some $T_r$ and some arbitrary sample. We also derive the DCR between the train dataset and some hold-out data $T_h$. Let us denote this distribution of distances as $\vec{d_h}$. We use the distributions $\vec{d_g}$ and $\vec{d_h}$ in our proposed non-parametric method. \input{tables/results_ml_efficiency.tex} \vspace{-2pt} \paragraph{Quantile difference ($\mathbf{Q_\delta}$) statistic} Two samples from a similar distribution should, on average, have approximately the same values at each quantile of the distribution. To detect whether two samples come from different distributions, we define a set of quantiles over which we compare the two samples. For each quantile in the set, we find the value at the given quantile in one sample and measure the proportion of the values in the other sample that are below it. If the distributions are similar, the proportion should be close to the given quantile, for all quantiles being tested. Formally, let $S_h$ and $S_g$ having $m$ and $n$ observations, respectively, be two samples being compared. Let $Q$ be a set of $N$ quantiles, and $q \in Q$ is a specific quantile in the set. Consider $v_q$ as the value in $S_h$ at quantile $q$. Then, we compute the value \vspace{-5pt} \begin{equation} \label{eq:pq} p_q = \frac{\sum_{x \in S_g} [x \leq v_q]}{n} \vspace{-4pt} \end{equation} where $p_q$ is the proportion of values in $S_g$ that are less than or equal to $v_q$. We define a statistic \vspace{-5pt} \begin{equation} Q_\delta = \frac{1}{N} \sum_{q} (p_q - q) \vspace{-4pt} \end{equation} This formulation has similarities with the Cramer-von Mises $\omega^2$ criterion, but the $Q_\delta$ statistic has one key difference: the asymmetry of the statistic. This stems from the fact that the choice of which sample is considered as $S_h$---the distribution from which $v_q$ is identified---matters. Since we are averaging over the quantiles, this statistic may not yield conclusive guidance for distributions with cumulative distribution functions (CDFs) intersecting at some quantile. Nonetheless, this statistic works best in detecting the dissimilarity of the two samples at the left tail of the distribution which matters most for our purpose. This is because the distributions we are comparing are the DCRs. We want to detect when the distance between the sample and the training data is significantly closer to zero than expected. We use the $Q_\delta$ statistic as the basis for detecting overfitting. The threshold against which this statistic will be compared during training is produced through an empirical bootstrapping over random samples from the training data. The details of the bootstrapping method are explained next. \vspace{-5pt} \paragraph{$\mathbf{Q_\delta}$ statistic threshold via bootstrapping} We use three hyperparameters in estimating the threshold that will signal when overfitting occurs during training. First, a sample proportion $\rho$ corresponds to a fraction of the training data. This fraction will be randomly sampled during the bootstrapping and evaluation phases of the generative model training. Second, the $\alpha$ value for choosing the critical threshold for the bootstrap statistic. Third, we specify a bootstrap round $\mathbf{B}$ corresponding to the number of times we compute the $Q_\delta$ statistic between three random samples---two, each of size $\rho$, and the rest having size $1 - 2\rho$ of the training data. Formally, for a given training data $T_r$ with $N$ observations, we define a bootstrap method to generate a confidence interval for the $Q_\delta$ statistic specific to the tabular data at hand. For each bootstrap round $b \in B$, we take three random samples $S_{tr}$, $S_h$, and $S_g$, without replacement. $S_h$ and $S_g$ are each of size $\rho N$, while $S_{tr}$ contains $(1 - 2\rho) N$ samples. We compute the DCR distributions $\vec{d_g}$ and $\vec{d_h}$ for the two samples $S_h$ and $S_g$, respectively, relative to sample $S_{tr}$. We then compute the $Q_\delta$ statistic between $\vec{d_g}$ and $\vec{d_h}$, where we take $\vec{d_h}$ as the distribution from which we compute the value $v_q$ in Equation \ref{eq:pq}. We store the statistic computed across the bootstrap rounds. We use the specified $\alpha$ to get the cutoff value that will be used as the statistic threshold. We use this threshold $Q_\delta^\prime$ during training to compare the $Q_\delta$ statistic derived from the generated samples by the model. We set $\rho=0.165$, $\alpha=0.95$, and $\mathbf{B}=500$ in our experiments. \vspace{-5pt} \paragraph{Early stopping with $\mathbf{Q_\delta^\prime}$} Our training procedure is paused at each epoch that is a multiple of $E$. We generate data from the model during these epochs. The generated data has size $S_g$. We then take two mutually exclusive random samples from the training data, without replacement, to represent $S_{tr}$ and $S_h$. We compute the $Q_\delta^e$ for this epoch based on the samples generated and drawn. Then, we compare this statistic to the previously computed threshold $Q_\delta^\prime$. We continue training the model if $Q_\delta^e < Q_\delta^\prime$. We save a checkpoint of this model. We terminate the model training when $Q_\delta^e > Q_\delta^\prime$ for $X$ consecutive epochs. We then load the checkpoint for the most recent model that satisfied the condition $Q_\delta^e < Q_\delta^\prime$. In our experiments, we set $E=5$ as the period of our overfitting evaluation and $X=2$ as our grace period before training termination. \subsubsection{Sampling} The models we use build each observation sequentially, one token at a time. We leverage the structure of our data processing to optimize the generation of samples from the trained models. Using a vocabulary specific to a column in the input data allows us to implement a constrained generation of tokens for each column. We track the token ids that form the domain of each column during the generation of the vocabulary using a hash map. Based on this, the tokens that are invalid for the columns will not be considered for generation in the timestep representing the column. This strategy allows for efficient sampling wherein the likelihood of generating an invalid sample is close to zero. In our experiments, $\ll 1\%$ invalid samples are generated during the sampling phase. \input{tables/relational_ld_results.tex} \section{Experiments and Results} This section outlines the evaluation process we conducted to quantify the performance of the proposed REaLTabFormer framework compared with baseline models. We first demonstrate that the performance of the model we use to generate the parent tables, and non-relational tabular data in general, compares with or exceeds the performance of state-of-the-art models in real-world tabular data generation tasks measured by the machine learning efficacy metric. We also use the discriminator measure to quantify how realistic the samples generated by each model are. We proceed to model real-world relational datasets and show, quantitatively using logistic detection, that the synthetic data produced by the REaLTabFormer are more realistic and accurate. \subsection{Data} \label{data} We use a collection of real-world datasets, listed in Table~\ref{tab:data-summary}, commonly used in previous works for non-relational tabular data generation \citep{xu_modeling_2019,zhao2021ctab,gorishniy2021revisiting,borisov_language_2022,kotelnikov2022tabddpm}. These datasets differ with respect to the number of observations, ranging from 768 up to 197,080 observations. There is also variation in the number of variables they contain, ranging from 8 to 50 numerical variables and 0 up to 8 categorical variables. The datasets cover regression, binary, and multi-class classification prediction tasks. \begin{figure}[ht] \vskip 0.1in \begin{center} \centerline{\includegraphics[width=\columnwidth]{img/rossmann/StoreType_Sales-rev-all.pdf}} \caption{Summary of the average ``Sales" variable in the child table of the Rossmann dataset grouped by ``StoreType" variable in the parent table. The values shown are from the original data (blue), synthetic data produced by REaLTabFormer (orange), and data generated by SDV (green). This graph shows that REaLTabFormer captures the inter-table variations and relationships well.} \label{fig:rossmann-storetype-sales} \end{center} \vskip -0.1in \end{figure} We use two real-world datasets to compare the performance of the REaLTabFormer on modeling relational tabular data compared with the baseline. These datasets are the Rossmann dataset and the Airbnb dataset used in prior work on synthetic relation data generation \citep{patki_synthetic_2016}. \subsection{Baseline models} \paragraph{Non-relational tabular data} We use models that apply different deep learning architectures for generating non-relational tabular data as baselines to compare the REaLTabFormer model with. The TVAE is based on variational autoencoder \citep{xu_modeling_2019}, the CTABGAN+ on GAN architecture \citep{zhao2022ctab}, the Tab-DDPM on diffusion \citep{kotelnikov2022tabddpm}, and GReaT uses pretrained LLM \citep{borisov_language_2022}. \paragraph{Relational datasets} Models for generating relational datasets are limited. \citet{gueye2022row} published work on using GAN for relational datasets but no open-sourced implementation is available. We choose to limit our baselines to open-sourced models; hence, we only use the Hierarchical Modeling Algorithm (HMA) available in the Synthetic Data Vault (SDV) as our baseline \citep{patki_synthetic_2016}. \subsection{Generative models training} The GReaT model was trained for 100 epochs for each data. The parameters for the TVAE, CTABGAN+, and Tab-DDPM models had been tuned for the predictive task itself using the real validation data from \citet{kotelnikov2022tabddpm}. For the relational datasets, we trained the HMA model as prescribed in the SDV documentation. In contrast, the REaLTabFormer model was not tuned against any of the machine learning tasks. The model solely relied on the overfitting metric discussed in Section \ref{overfitting}. We used the same parameters for the different datasets to test how the REaLTabFormer performs ``out-of-the-box". \subsection{Measures and Results} We select the following measures to quantify the quality and utility of the generated samples by the generative models. \paragraph{Machine Learning (ML) efficacy} The machine learning (ML) efficacy \citep{xu_modeling_2019,kotelnikov2022tabddpm,borisov_language_2022} measures the potential utility of the synthetic data to supplant the real data for machine learning tasks, in particular, training a prediction model. The ML efficacy reported by \citet{borisov_language_2022} in their work used ML models that were not fine-tuned. \citet{kotelnikov2022tabddpm} showed that the ML efficacy computed from models that are not fine-tuned may show spurious results. They instead optimized the ML models---CatBoost \citep{prokhorenkova2018catboost}---they used in reporting the ML efficacy. This approach is closer to what researchers are expected to do in the real world, therefore, we adopt these tuned models in our experiments. We generate a validation set from the generative models to signal the early-stopping condition during the ML model training. This is in contrast with the method used by \citet{kotelnikov2022tabddpm} where they still relied on the real validation data for the early-stopping of the ML model. We report the macro average F1 score \citep{opitz2019macro} for classification tasks and the $R^2$ metric for regression tasks. Our results presented in Table~\ref{tab:mle-dm-results} (MLE) show that REaLTabFormer, despite not being fine-tuned, produces ML efficacy scores that are the best or second-best compared with the baselines. This demonstrates that REaLTabFormer can be used, ``out-of-the-box", to generate synthetic data with state-of-the-art performance in machine learning tasks. The FB comments dataset, where REaLTabFormer obtained the best performance, is the largest dataset tested and has the largest number of columns. Training the GReaT model on this dataset yielded impractical runtime so no result is reported. This supports our view that using LLM trained on a large vocabulary, containing a majority of irrelevant tokens, limits the efficiency of the model. \vspace{-5pt} \paragraph{Discriminator measure} We adopt the discriminator measure \citep{borisov_language_2022} to quantify whether the data generated by a model is easily distinguishable from real data. A dataset is made by combining an equal number of real and synthetic data. Real observations in this dataset are labeled as “1” and synthetic observations are labeled as “0”. Similar to \citet{borisov_language_2022}, we train a random forest model to predict the labels given an observation. A held-out dataset containing a combination of synthetic samples and real test data is then used to report the final measure. An accuracy that is closer to 50\% implies better synthetic data quality since the discriminative model is not able to distinguish the real from the synthetic observations. We report our results in Table~\ref{tab:mle-dm-results} (DM). The DM measure shows that the Tab-DDPM has the most indistinguishable synthetic data. Nonetheless, REaLTabFormer, without the need for tuning, has DM measures that are close to the Tab-DDPM. This suggests that the synthetic data produced by a diffusion-based model and REaLTabFormer are realistic compared with the other baselines. \vspace{-2pt} \paragraph{Logistic Detection} For relational datasets, we use logistic detection (LD) \citep{fisher2019machine,gueye2022row} to quantify the quality of the parent, child, and merged tables generated by REaLTabFormer compared with the HMA model. We evaluate ROC-AUC scores averaged over (N=3) cross-validation folds, \vspace{-10pt} \begin{equation} \mu_{\mathrm{RA}} = \frac{1}{N}\sum_{i=1}^N \max (0.5, \mathrm{ROC-AUC}) \times 2 - 1 \vspace{-5pt} \end{equation} The value reported is $LD=100 \times (1 - \mu_{\mathrm{RA}})$, where scores range from 0 to 100, and scores closer to 100 imply better synthetic data quality. We use random forest in measuring the logistic detection instead of the standard logistic regression model. The random forest model captures non-linearity in the data well than logistic regression \citep{couronne2018random}, reducing the likelihood of spurious results. We report the results in Table~\ref{tab:relational-ld-results}. Additional LD results using logistic regression are shown in Table~\ref{tab:relational-ld-logistic-results}. The REaLTabFormer model produces significantly higher-quality synthetic data than the HMA model across the datasets tested. The high values of LD for the child and the merged tables highlight the ability of REaLTabFormer to accurately synthesize relational datasets in comparison with the leading baseline. The LD metric shows that data generated by SDV for the Airbnb child table is entirely distinguishable from the real data. The quantitative results are supported by relational statistics computed from synthetic datasets produced by REaLTabFormer and the HMA model: \cref{fig:rossmann-date-sales,fig:airbnb-device_type-age_group,fig:rossmann-storetype-sales}. \section{Conclusion} We presented REaLTabFormer, a framework capable of generating high-quality non-relational tabular data and relational datasets. This work extends the application of sequence-to-sequence models to modeling and generating relational datasets. We introduced target masking as a component in the model to mitigate data-copying and safeguarding from potentially sensitive data leaking from the training data. We proposed a statistical method and the $Q_\delta$ statistic for detecting overfitting in model training. This statistical method may be adapted to other generative model training. We showed that our proposed model generates realistic synthetic tabular data that can be a proxy for real-world data in machine learning tasks. REaLTabFormer's ability to model relational datasets accurately compared with existing open-sourced alternative contributes to solving existing gaps in generative models for realistic relational datasets. Finally, this work can be extended and applied to data imputation, cross-survey imputation, and upsampling for machine learning with imbalanced data. A BERT-like encoder can be used instead of GPT-2 with the REaLTabFormer for modeling relational datasets. We also see opportunities to improve privacy protection strategies and the development of more components like target masking embedded into synthetic data generation models to prevent sensitive data exposure. \pagebreak \section{REaLTabFormer Python Package} We publish the REaLTabFormer as a package on PyPi. We show below how the model can be easily trained on any tabular dataset, loaded as a Pandas DataFrame. \vspace{-5pt} \subsection{Non-relational tabular model} \label{appendix:python-non-relational} Use the following snippet to fit the REaLTabFormer on a non-relational tabular dataset. One can control the various hyper-parameters of the model and the fitting method, e.g., the number of bootstrap rounds \texttt{num\_bootstrap}, the fraction of training data \texttt{frac} used to generate the $\mathbf{Q}_\delta$ statistic, etc. Keyword arguments for the HuggingFace transformers \texttt{Trainer} class can also be passed as \texttt{**kwargs} when initializing the model. \begin{minted}[ frame=lines, framesep=2mm, bgcolor=BrickRed!2, baselinestretch=1.2, fontsize=\scriptsize, xleftmargin=10pt, numbersep=5pt, linenos ]{python} # pip install realtabformer import pandas as pd from realtabformer import REaLTabFormer # NOTE: Remove any unique identifiers in the # data that you don't want to be modeled. df = pd.read_csv("foo.csv") # Non-relational or parent table. rtf_model = REaLTabFormer( model_type="tabular", gradient_accumulation_steps=4) # Fit the model on the dataset. # Additional parameters can be # passed to the `.fit` method. rtf_model.fit(df) # Save the model to the current directory. # A new directory `rtf_model/` will be created. # In it, a directory with the model's # experiment id `idXXXX` will also be created # where the artefacts of the model will be stored. rtf_model.save("rtf_model/") # Generate synthetic data with the same # number of observations as the real dataset. samples = rtf_model.sample(n_samples=len(df)) # Load the saved model. The directory to the # experiment must be provided. rtf_model2 = REaLTabFormer.load_from_dir( path="rtf_model/idXXXX") \end{minted} \vspace{-10pt} \subsection{Non-relational tabular model} REaLTabFormer for relational databases requires a two-phase training. First, the model for the parent table is trained as a non-relational tabular data, then saved. Second, we pass the path of the saved parent model when creating the REaLTabFormer instance for the child model to be used as its encoder, then train. Generate synthetic samples from the parent table and use as input to the trained child model to generate the synthetic relational observations. \begin{minted}[ frame=lines, framesep=2mm, bgcolor=BrickRed!2, baselinestretch=1.2, fontsize=\scriptsize, xleftmargin=10pt, numbersep=5pt, linenos ]{python} # pip install realtabformer import os import pandas as pd from realtabformer import REaLTabFormer pdir = Path("rtf_parent/") parent_df = pd.read_csv("foo.csv") child_df = pd.read_csv("bar.csv") join_on = "unique_id" # Make sure that the key columns in both the # parent and the child table have the same name. assert ((join_on in parent_df.columns) and (join_on in child_df.columns)) # Non-relational or parent table. Don't include the # unique_id field. parent_model = REaLTabFormer(model_type="tabular") parent_model.fit(parent_df.drop(join_on, axis=1)) parent_model.save(pdir) # # Get the most recently saved parent model, # # or a specify some other saved model. # parent_model_path = pdir / "idXXX" parent_model_path = sorted([ p for p in pdir.glob("id*") if p.is_dir()], key=os.path.getmtime)[-1] child_model = REaLTabFormer( model_type="relational", parent_realtabformer_path=parent_model_path, output_max_length=None, train_size=0.8) child_model.fit( df=child_df, in_df=parent_df, join_on=join_on) # Generate parent samples. parent_samples = parent_model.sample(len(parend_df)) # Create the unique ids based on the index. parent_samples.index.name = join_on parent_samples = parent_samples.reset_index() # Generate the relational observations. child_samples = child_model.sample( input_unique_ids=parent_samples[join_on], input_df=parent_samples.drop(join_on, axis=1), gen_batch=64) \end{minted} \vspace{-10pt} \paragraph{Acknowledgments} This project was supported by the “Enhancing Responsible Microdata Access to Improve Policy and Response in Forced Displacement Situations” project funded by the World Bank-UNHCR Joint Data Center on Forced Displacement (JDC) – KP-P174174-GINP-TF0B5124. We also thank Patrick Brock for providing insightful comments. The findings, interpretations, and conclusions expressed in this paper are entirely those of the authors. They do not necessarily represent the views of the International Bank for Reconstruction and Development/World Bank and its affiliated organizations, or those of the Executive Directors of the World Bank or the governments they represent. \pagebreak \section{Introduction} \begin{figure}[t] \vskip 0.0in \begin{center} \centerline{\includegraphics[width=\columnwidth] {img/REaLTabFormer_Final_EQ4.pdf}} \caption{ Illustration of the REaLTabFormer model. The left block shows the non-relational tabular data model using GPT-2 with a causal LM head. In contrast, the right block shows how a relational dataset's child table is modeled using a sequence-to-sequence (Seq2Seq) model. The Seq2Seq model uses the observations in the parent table to condition the generation of the observations in the child table. The trained GPT-2 model on the parent table, with weights frozen, is also used as the encoder in the Seq2Seq model.} \label{fig:realtabformer-model} \end{center} \vskip -0.3in \end{figure} Tabular data is one of the most common forms of data. Many datasets from surveys, censuses, and administrative sources are provided in this form. These datasets may contain sensitive information that cannot be shared openly \citep{abdelhameed2018privacy}. Even when statistical disclosure methods are applied, they may remain vulnerable to malicious attacks \citep{cheng2017enterprise}. As a result, their dissemination is restricted and the data have limited utility \citep{o2015individual}. Differential privacy methods \citep{ji2014differential}, homomorphic encryption approaches \citep{aslett2015review,wood2020homomorphic}, or federated machine learning \citep{yang2019federated,lin2021privacy} may be implemented, allowing insights from sensitive data to be accessible to researchers. Synthetic tabular data with similar statistical properties as the real data offer an alternative, offering more value especially in granular and segmentation analyses. To comply with data privacy requirements, the generative models that produce these synthetic data must provide guarantees that “data copying” does not happen \citep{meehan2020non,carlini2023extracting}. Formally, tabular data is a collection of observations (rows) $o_i$ that may or may not be independent. A single observation in a tabular data $\mathbf{T}$ with $n$ columns is defined by $o_i = [x_{i1}, x_{i2}, ..., x_{ij}, ..., x_{in}]$, and $j$ indicating the $j^{th}$ column. We refer to tabular data having observations independent of each other as \textbf{non-relational tabular data}. Tabular data having observations related to each other are referred to as \textbf{relational tabular data}. Relational datasets have at least one pair of tabular data files with a one-to-many mapping of observations between the parent table and the child table, respectively, linked by a unique identifier. In the context of a relational dataset, a \textbf{parent table} is a non-relational tabular data, whereas the \textbf{child table} is a relational tabular data. Relational tabular databases model the logical partitioning of data and prevent unnecessary duplication of observations from the parent to child tables \citep{jatana2012survey}. Despite its ubiquity, limited work has been done in generating synthetic relational datasets. This may be due to the challenging nature of modeling the complex relationships within and across tables. The field of synthetic data generation has seen significant development in recent years \citep{gupta2016synthetic,abufadda2021survey,hernandez2022synthetic,figueira2022survey}. Generative models have become mainstream with the advent of synthetic image generation models such as DALL-E \citep{ramesh2021zero}, and most recently, ChatGPT. While generative models for images and text are common, models for producing synthetic tabular data are comparatively limited despite their multiple possible applications. Synthetic tabular data can contribute to addressing data privacy issues and data sparseness \citep{appenzeller2022privacy}. They can help to make sensitive data accessible to researchers \citep{goncalves2020generation}, and to fill gaps in data availability for counterfactual research and agent-based simulations \citep{fagiolo2019validation}, and for synthetic control methods \citep{abadie2015comparative}. Further value can be derived from tabular data by building predictive models using machine learning \citep{shwartz2022tabular}. These predictive models can infer variables of interest in the data that may otherwise be expensive to collect or correspond to some success metrics that can guide business decisions. Synthetic data produced by deep learning models have been shown to perform well in predictive modeling tasks. This extends the utility of real-world data that may otherwise be unused due to privacy concerns. This paper introduces the \textbf{REalTabFormer}, a transformer-based framework for generating non-relational tabular data and relational datasets. It makes the following contributions: \vspace{-5pt} \paragraph{Unified framework} The REalTabFormer uses an autoregressive (GPT-2) transformer to model non-relational tabular data for modeling and generating parent tables. It then models and generates observations in the child table using the sequence-to-sequence (Seq2Seq) \citep{yun2019transformers} framework. The encoder network uses the pre-trained weights of the network for the parent table, contextualizing the input for generating arbitrary-length data corresponding to observations in a child table, via the decoder network. \vspace{-5pt} \paragraph{Strategies for privacy-preserving training} Synthetic data generation models must not only be able to generate realistic data but also implement safeguards to prevent the model from ``memorizing" and copying observations in the training data during sampling. We use the \textit{distance to closest record} (DCR), a data-copying measure, and \textit{statistical bootstrapping} to detect overfitting during training robustly. We introduce \textit{target masking} for regularization to reduce the likelihood of training data being replicated by the model. \vspace{-5pt} \paragraph{Open-sourced models} We publish the REaLTabFormer models as an open-sourced Python package. Install the package using: \hspace{0.1cm} \texttt{pip install realtabformer}.\footnote{\href{https://github.com/avsolatorio/REaLTabFormer}{\url{https://github.com/avsolatorio/REaLTabFormer}}} \vspace{-5pt} \paragraph{Comprehensive evaluation} We evaluate the performance of our models on a variety of real-world datasets. We use open-sourced state-of-the-art models as baselines to assess the performance of REaLTabFormer in generating non-relational and relational tabular datasets. Our experiments demonstrate the effectiveness of the REaLTabFormer model for non-relational tabular data, beating current state-of-the-art in machine learning tasks for large datasets. We further demonstrate that the synthesized observations for the child table generated by the REaLTabFormer capture relational statistics more accurately than the baseline models. \vspace{-2pt} \section{Related Work} \label{relatedwork} Recent advances in deep learning, such as generative adversarial networks \citep{park2018data,xu_modeling_2019,zhao2021ctab}, autoencoders \citep{li2019evaluating,xu_modeling_2019,darabi2021synthesising}, language models \citep{borisov_language_2022}, and diffusion models \citep{kotelnikov2022tabddpm} have been applied to synthetic non-relational tabular data generation. These papers demonstrate deep learning models' capacity to produce more realistic data than traditional approaches such as Bayesian networks \citep{xu_modeling_2019}. On the other hand, generative models for relational datasets are limited \citep{patki_synthetic_2016,gueye2022row}. Existing models are based on Hierarchical Modeling Algorithms \citep{patki_synthetic_2016} where traditional statistical models, Gaussian Copulas, are used to learn the joint distributions for each and across tables. While these models can synthesize data, the quality of the generated data does not accurately capture the nuanced conditions within and across tables (Fig.~\ref{fig:rossmann-date-sales} and Fig.~\ref{fig:airbnb-device_type-age_group}). \citet{padhi_tabular_2021} presented TabGPT for generating synthetic transactional data. They showed that autoregressive transformers, particularly GPT, can synthesize arbitrary-length data. One limitation of TabGPT is that one has to train independent models to produce transactions for each user. This becomes impractical for real-world applications. Our work generalizes the use of GPT by proposing a sequence-to-sequence framework for generating arbitrary-length synthetic data conditioned on an input. \section{REaLTabFormer} \label{realtabformer} REaLTabFormer is a transformer-based framework for generating non-relational tabular data using an autoregressive model and relational tabular data using a sequence-to-sequence (Seq2Seq) architecture. The framework also consists of strategies for encoding tabular data (Section \ref{tabdataencoding}), a statistical method to detect overfitting (Section \ref{overfitting}), and a constrained sampling strategy during generation. Details of the framework are described in this section. First, we present our proposed models to synthesize realistic relational datasets. Next, we outline and describe the data processing applied to the tabular data as input for training the models. We then discuss solutions to improve our model's training and sampling process. \subsection{The REaLTabFormer Models} \paragraph{Parent table model} To generate synthetic observations for a non-relational tabular data $\mathbf{T}$, we model the conditional distribution of columnar values in each row of the data. Consider a single observation $o_i = [x_{i1}, x_{i2}, ..., x_{ij}, ..., x_{in}]$ in $\mathbf{T}$ as defined earlier. We treat $o_i$ as a sequence with potential dependencies across values $x_{ij}$, similar to a sentence in a text. This re-framing provides us with a framework to learn the conditional distribution $x_{ij} \sim P(X|x_{i1}, x_{i2}, ..., x_{ij-1})$ and sequentially generate the next values in the sequence, eventually generating the full observation \citep{jelinek1985markov,bengio2000neural}. We use an autoregressive model to learn this distribution, Fig.~\ref{fig:realtabformer-model}. In the context of relational datasets, we use this approach to generate synthetic observations for the parent table $\mathbf{T_0}$. We extend this formulation to generate the child table $\mathbf{T'}$---a relational tabular data---associated with the parent table $\mathbf{T_0}$. \vspace{-5pt} \paragraph{Child table model} The extension is established by introducing a context learned by an encoder network from observations in $\mathbf{T_0}$. Instead of generating $o_i$ in $\mathbf{T'}$ independently, we concatenate the child table observations related to the same observation in $\mathbf{T_0}$. This forms an arbitrary-length sequence $s_i = [o_i^1, o_i^2, ..., o_i^n]$, where $n$ is the number of related observations in $\mathbf{T'}$. We propose to model the generation of $s_i$ given an observation in $\mathbf{T_0}$ as $x_{ij}^n \sim P(X|o_i^1, ...,x_{i1}^n, x_{i2}^n, ..., x_{ij-1}^n, C_k)$, where $C_k$ is a context captured from a related observation in the parent tabular data $\mathbf{T_0}$. We also use the same network trained on the parent table, \textbf{with weights frozen}, as the Seq2Seq model's encoder. This choice is expected to speed up the training process since only the cross-attention layer and the decoder network are needed to be trained for the child table model. The encoder network is assumed to have learned the properties of the parent table and will transfer this information to the decoder without further fine-tuning its weights, Fig~\ref{fig:realtabformer-model}. \begin{figure}[t] \begin{center} \centerline{\includegraphics[width=\columnwidth]{img/rossmann/Date_Sales-test_data.pdf}} \caption{Graph of the daily mean of the \texttt{Sales} variable computed from the original Rossmann dataset (blue), synthetic data produced by REaLTabFormer (orange), and data generated by SDV (green). The REaLTabFormer closely captures the seasonality in the data compared with the HMA model from the SDV.} \vskip -0.4in \label{fig:rossmann-date-sales} \end{center} \end{figure} \paragraph{GPT-2: an autoregressive transformer} Previous works have shown that transformer-based autoregressive models can capture the conditional distribution of sequential data very well \citep{radford_language_2019,padhi_tabular_2021}. REaLTabFormer uses the GPT-2 architecture---a transformer-decoder architecture designed for autoregressive tasks---as its base model. We adopt the same architecture for all GPT-2 instances in the framework for simplicity. The GPT-2 architecture used in the REaLTabFormer has 768-dimensional embeddings, 6 decoder layers, and 12 attention heads---a set of parameters similar to DistilGPT2. We use the implementation from the HuggingFace transformers library \citep{wolf_transformers_2020}. \newcommand{\unskip\ \vrule\ }{\unskip\ \vrule\ } \begin{figure*} \centering \includegraphics[width=0.38\textwidth]{img/airbnb/AIRBNB_device_type-age_group_real-notbold-annotated.pdf} \includegraphics[width=0.29\textwidth]{img/airbnb/AIRBNB_device_type-age_group_sdv-notbold-annotated.pdf} \includegraphics[width=0.27\textwidth]{img/airbnb/AIRBNB_device_type-age_group_rtf-notbold-annotated.pdf} \vskip 0.05in \caption{Joint distributions of the \texttt{age\_group} variable in the parent table and the \texttt{device\_type} in the child table of the Airbnb test dataset (left), the SDV (middle), and the REalTabFormer (right). The plots show that the REaLTabFormer can synthesize values across the domain of the variables, while SDV learned only two device types out of thirteen. The REaLTabFormer also generalized and imputed age values for users with ``iPodtouch" device (red box). This device type group has missing values for age in the original data.} \label{fig:airbnb-device_type-age_group} \end{figure*} \vspace{-2pt} \subsection{Tabular Data Encoding} \label{tabdataencoding} The GReaT model that uses pretrained large language models (LLMs) proposed by \citet{borisov_language_2022} offers insight into the minimal data processing requirements for language models in generating tabular data. There is, however, the potential for optimization in using autoregressive language models for this task, as the fine-tuning process of a large pretrained model incurs computational costs. Particularly, LLMs are trained on a large vocabulary where most of the tokens are not needed for generating the tabular data at hand. These unnecessary tokens increase the model's computational requirements and prolong training and sampling times. To improve the efficiency of our model, we adopt a fixed-set vocabulary as initially proposed by \citet{padhi_tabular_2021}. Generating a fixed vocabulary for each column in the tabular data offers various advantages in training performance and sampling. One of the main advantages is being able to filter irrelevant tokens when generating values for a specific column. This directly contributes to efficiency in sampling by reducing the chances of generating invalid samples. Our model performs minimal transformation of the raw data. First, we identify the various data types for each column in the data. We then perform a series of data processing specific to the column and data type. Notably, we adopt a fully text-based strategy in handling numerical values. These transformations produce a transformed tabular data used to train the model. \citet{borisov_language_2022} showed that variable order has an insignificant impact on language models, so we did not apply variable permutation. We discuss the processing for each data type in Appendix~\ref{appendix:raw-data-processing}. \vspace{-4pt} \paragraph{Training data for the parent table} The GPT-2 model we use requires a set of token ids as input. To generate these sequences of token ids, we first create a vocabulary. This vocabulary maps the unique tokens in each column to a unique token id. Then, for each row in the modified data, we apply the mapping in the vocabulary to the tokens. This produces a list of token ids for each row of the data. The model is then trained on an autoregressive task wherein the target data corresponds to the right-shifted tokens of the input data. \vspace{-4pt} \paragraph{Training data for the child table} We concatenate the transformed observations corresponding to related rows in the child table. A special token is added before and after the set of tokens representing an individual observation. In this form, the data we use to train the Seq2Seq model contains input-output pairs. An input value contains a fixed-length array of token ids representing the observation in the parent table. The input is similar to the input used in the parent table model. An arbitrary-length array with the concatenated token ids for each related observation in the child table represents the output value. The number of related observations that can be modeled is limited by computational resources. \subsection{REaLTabFormer Training and Sampling} Deep learning models for generative tasks face challenges of overfitting the data resulting in issues such as data-copying \citep{meehan2020non,carlini2023extracting}. Furthermore, observations generated by generative models for tabular data could face issues of validity and inconsistency. These issues in the generated samples impact the efficiency of the generative process. Our proposed framework addresses the aforementioned issues by, (i) introducing a robust statistical method to monitor overfitting, and (ii) target masking to further reduce the risk of data copying. To improve the rate of producing valid observations by the model, we also implement a constrained generation strategy during the sampling stage. \subsubsection{Target masking} \label{targetmasking} Data copying is a critical issue for deep learning-based generative tabular models as it can expose and compromise sensitive information in the training data. To mitigate data-copying, we introduce \textbf{target masking}. Target masking is a form of regularization aimed at minimizing the likelihood of records in the training data being ``memorized" and copied by the generative model. Unlike the token masking introduced in BERT \citep{devlin2018bert}, where input tokens are masked and the model is expected to predict the correct token, target masking implements random replacement of the target or label tokens with a special mask token. This artificially introduces missing values in the data. We intend for the model to learn the masks instead of the actual values. During the sampling stage, we then restrict the mask token generation, forcing the model to fill the value with a valid token probabilistically. Notably, even when the model learns to copy the input-output pair, the learned output corresponds to the masked version of the input. Therefore, when we process the output, the probabilistic nature of replacing the mask token reduces the likelihood of generating the training data. The mask rate parameter controls the proportion of the tokens that are masked. We use a mask rate of $10\%$ in our experiments. \subsubsection{Overfitting assessment} \label{overfitting} Applying deep learning models to small datasets may easily result in overfitting. This may cause privacy-related issues when the model generates observations that are copied from the training data. Knowing when the model overfits the data is also crucial when the purpose is to generate diverse out-of-sample data. An overfitted model tends to generate samples generally closer to the training data, thereby limiting the generalization capacity of the model. While the former issue can be resolved by post-generation filtering, the latter must be detected during the model training. Taking hold-out data to detect overfitting is a common strategy in machine learning. Unfortunately, this strategy could result in the premature termination of model training. It may also penalize a model based only on a small subset of the data \citep{blum1999beating}. The training procedures of existing state-of-the-art models do not explicitly check for overfitting \citep{xu_modeling_2019,borisov_language_2022,kotelnikov2022tabddpm}. We propose and describe below an empirical statistical method to inform the generative model when overfitting happens. The method allows for the full data to be used in the training without the need for a hold-out set. The design of the method is expected to also help prevent data copying and the production of data that is riskily close to the training data. \vspace{-2pt} \paragraph{Distance to closest record} We use the distance to the closest record (DCR) \citep{park2018data} to measure the similarity of synthetic samples to the original data. The DCR is evaluated by taking a specified distance metric $L$ between the training data $T_r$ and the generated data $G$. We then find the smallest distance for each record. Consider the distance matrix between $T_r$ and $G$, \vspace{-5pt} \begin{equation} \mathbf{D} = L(T_r, G) \vspace{-3pt} \end{equation} The minimum value in each row $i$ of $\mathbf{D}$ is the minimum distance of the $i^{th}$ record in the training data with respect to all records in the generated data. We denote this set of minimum values as $\vec{d_i}$. The minimum value in each column $j$ of $\mathbf{D}$ is the minimum distance of the $j^{th}$ record in the generated data with respect to all records in the training data. We denote this set of minimum values as $\vec{d_j}$. We then take $\vec{d_g} = [\vec{d_i}, \vec{d_j}]$ as the distribution of distances to closest records between the training data and the generated data. We define the quantity \vspace{-5pt} \begin{equation} \label{eq:dcr} \vec{d} = [\vec{d_i}, \vec{d_j}] \vspace{-3pt} \end{equation} as the distance to closest record distribution for some $T_r$ and some arbitrary sample. We also derive the DCR between the train dataset and some hold-out data $T_h$. Let us denote this distribution of distances as $\vec{d_h}$. We use the distributions $\vec{d_g}$ and $\vec{d_h}$ in our proposed non-parametric method. \input{tables/results_ml_efficiency.tex} \vspace{-2pt} \paragraph{Quantile difference ($\mathbf{Q_\delta}$) statistic} Two samples from a similar distribution should, on average, have approximately the same values at each quantile of the distribution. To detect whether two samples come from different distributions, we define a set of quantiles over which we compare the two samples. For each quantile in the set, we find the value at the given quantile in one sample and measure the proportion of the values in the other sample that are below it. If the distributions are similar, the proportion should be close to the given quantile, for all quantiles being tested. Formally, let $S_h$ and $S_g$ having $m$ and $n$ observations, respectively, be two samples being compared. Let $Q$ be a set of $N$ quantiles, and $q \in Q$ is a specific quantile in the set. Consider $v_q$ as the value in $S_h$ at quantile $q$. Then, we compute the value \vspace{-5pt} \begin{equation} \label{eq:pq} p_q = \frac{\sum_{x \in S_g} [x \leq v_q]}{n} \vspace{-4pt} \end{equation} where $p_q$ is the proportion of values in $S_g$ that are less than or equal to $v_q$. We define a statistic \vspace{-5pt} \begin{equation} Q_\delta = \frac{1}{N} \sum_{q} (p_q - q) \vspace{-4pt} \end{equation} This formulation has similarities with the Cramer-von Mises $\omega^2$ criterion, but the $Q_\delta$ statistic has one key difference: the asymmetry of the statistic. This stems from the fact that the choice of which sample is considered as $S_h$---the distribution from which $v_q$ is identified---matters. Since we are averaging over the quantiles, this statistic may not yield conclusive guidance for distributions with cumulative distribution functions (CDFs) intersecting at some quantile. Nonetheless, this statistic works best in detecting the dissimilarity of the two samples at the left tail of the distribution which matters most for our purpose. This is because the distributions we are comparing are the DCRs. We want to detect when the distance between the sample and the training data is significantly closer to zero than expected. We use the $Q_\delta$ statistic as the basis for detecting overfitting. The threshold against which this statistic will be compared during training is produced through an empirical bootstrapping over random samples from the training data. The details of the bootstrapping method are explained next. \vspace{-5pt} \paragraph{$\mathbf{Q_\delta}$ statistic threshold via bootstrapping} We use three hyperparameters in estimating the threshold that will signal when overfitting occurs during training. First, a sample proportion $\rho$ corresponds to a fraction of the training data. This fraction will be randomly sampled during the bootstrapping and evaluation phases of the generative model training. Second, the $\alpha$ value for choosing the critical threshold for the bootstrap statistic. Third, we specify a bootstrap round $\mathbf{B}$ corresponding to the number of times we compute the $Q_\delta$ statistic between three random samples---two, each of size $\rho$, and the rest having size $1 - 2\rho$ of the training data. Formally, for a given training data $T_r$ with $N$ observations, we define a bootstrap method to generate a confidence interval for the $Q_\delta$ statistic specific to the tabular data at hand. For each bootstrap round $b \in B$, we take three random samples $S_{tr}$, $S_h$, and $S_g$, without replacement. $S_h$ and $S_g$ are each of size $\rho N$, while $S_{tr}$ contains $(1 - 2\rho) N$ samples. We compute the DCR distributions $\vec{d_g}$ and $\vec{d_h}$ for the two samples $S_h$ and $S_g$, respectively, relative to sample $S_{tr}$. We then compute the $Q_\delta$ statistic between $\vec{d_g}$ and $\vec{d_h}$, where we take $\vec{d_h}$ as the distribution from which we compute the value $v_q$ in Equation \ref{eq:pq}. We store the statistic computed across the bootstrap rounds. We use the specified $\alpha$ to get the cutoff value that will be used as the statistic threshold. We use this threshold $Q_\delta^\prime$ during training to compare the $Q_\delta$ statistic derived from the generated samples by the model. We set $\rho=0.165$, $\alpha=0.95$, and $\mathbf{B}=500$ in our experiments. \vspace{-5pt} \paragraph{Early stopping with $\mathbf{Q_\delta^\prime}$} Our training procedure is paused at each epoch that is a multiple of $E$. We generate data from the model during these epochs. The generated data has size $S_g$. We then take two mutually exclusive random samples from the training data, without replacement, to represent $S_{tr}$ and $S_h$. We compute the $Q_\delta^e$ for this epoch based on the samples generated and drawn. Then, we compare this statistic to the previously computed threshold $Q_\delta^\prime$. We continue training the model if $Q_\delta^e < Q_\delta^\prime$. We save a checkpoint of this model. We terminate the model training when $Q_\delta^e > Q_\delta^\prime$ for $X$ consecutive epochs. We then load the checkpoint for the most recent model that satisfied the condition $Q_\delta^e < Q_\delta^\prime$. In our experiments, we set $E=5$ as the period of our overfitting evaluation and $X=2$ as our grace period before training termination. \subsubsection{Sampling} The models we use build each observation sequentially, one token at a time. We leverage the structure of our data processing to optimize the generation of samples from the trained models. Using a vocabulary specific to a column in the input data allows us to implement a constrained generation of tokens for each column. We track the token ids that form the domain of each column during the generation of the vocabulary using a hash map. Based on this, the tokens that are invalid for the columns will not be considered for generation in the timestep representing the column. This strategy allows for efficient sampling wherein the likelihood of generating an invalid sample is close to zero. In our experiments, $\ll 1\%$ invalid samples are generated during the sampling phase. \input{tables/relational_ld_results.tex} \section{Experiments and Results} This section outlines the evaluation process we conducted to quantify the performance of the proposed REaLTabFormer framework compared with baseline models. We first demonstrate that the performance of the model we use to generate the parent tables, and non-relational tabular data in general, compares with or exceeds the performance of state-of-the-art models in real-world tabular data generation tasks measured by the machine learning efficacy metric. We also use the discriminator measure to quantify how realistic the samples generated by each model are. We proceed to model real-world relational datasets and show, quantitatively using logistic detection, that the synthetic data produced by the REaLTabFormer are more realistic and accurate. \subsection{Data} \label{data} We use a collection of real-world datasets, listed in Table~\ref{tab:data-summary}, commonly used in previous works for non-relational tabular data generation \citep{xu_modeling_2019,zhao2021ctab,gorishniy2021revisiting,borisov_language_2022,kotelnikov2022tabddpm}. These datasets differ with respect to the number of observations, ranging from 768 up to 197,080 observations. There is also variation in the number of variables they contain, ranging from 8 to 50 numerical variables and 0 up to 8 categorical variables. The datasets cover regression, binary, and multi-class classification prediction tasks. \begin{figure}[ht] \vskip 0.1in \begin{center} \centerline{\includegraphics[width=\columnwidth]{img/rossmann/StoreType_Sales-rev-all.pdf}} \caption{Summary of the average ``Sales" variable in the child table of the Rossmann dataset grouped by ``StoreType" variable in the parent table. The values shown are from the original data (blue), synthetic data produced by REaLTabFormer (orange), and data generated by SDV (green). This graph shows that REaLTabFormer captures the inter-table variations and relationships well.} \label{fig:rossmann-storetype-sales} \end{center} \vskip -0.1in \end{figure} We use two real-world datasets to compare the performance of the REaLTabFormer on modeling relational tabular data compared with the baseline. These datasets are the Rossmann dataset and the Airbnb dataset used in prior work on synthetic relation data generation \citep{patki_synthetic_2016}. \subsection{Baseline models} \paragraph{Non-relational tabular data} We use models that apply different deep learning architectures for generating non-relational tabular data as baselines to compare the REaLTabFormer model with. The TVAE is based on variational autoencoder \citep{xu_modeling_2019}, the CTABGAN+ on GAN architecture \citep{zhao2022ctab}, the Tab-DDPM on diffusion \citep{kotelnikov2022tabddpm}, and GReaT uses pretrained LLM \citep{borisov_language_2022}. \paragraph{Relational datasets} Models for generating relational datasets are limited. \citet{gueye2022row} published work on using GAN for relational datasets but no open-sourced implementation is available. We choose to limit our baselines to open-sourced models; hence, we only use the Hierarchical Modeling Algorithm (HMA) available in the Synthetic Data Vault (SDV) as our baseline \citep{patki_synthetic_2016}. \subsection{Generative models training} The GReaT model was trained for 100 epochs for each data. The parameters for the TVAE, CTABGAN+, and Tab-DDPM models had been tuned for the predictive task itself using the real validation data from \citet{kotelnikov2022tabddpm}. For the relational datasets, we trained the HMA model as prescribed in the SDV documentation. In contrast, the REaLTabFormer model was not tuned against any of the machine learning tasks. The model solely relied on the overfitting metric discussed in Section \ref{overfitting}. We used the same parameters for the different datasets to test how the REaLTabFormer performs ``out-of-the-box". \subsection{Measures and Results} We select the following measures to quantify the quality and utility of the generated samples by the generative models. \paragraph{Machine Learning (ML) efficacy} The machine learning (ML) efficacy \citep{xu_modeling_2019,kotelnikov2022tabddpm,borisov_language_2022} measures the potential utility of the synthetic data to supplant the real data for machine learning tasks, in particular, training a prediction model. The ML efficacy reported by \citet{borisov_language_2022} in their work used ML models that were not fine-tuned. \citet{kotelnikov2022tabddpm} showed that the ML efficacy computed from models that are not fine-tuned may show spurious results. They instead optimized the ML models---CatBoost \citep{prokhorenkova2018catboost}---they used in reporting the ML efficacy. This approach is closer to what researchers are expected to do in the real world, therefore, we adopt these tuned models in our experiments. We generate a validation set from the generative models to signal the early-stopping condition during the ML model training. This is in contrast with the method used by \citet{kotelnikov2022tabddpm} where they still relied on the real validation data for the early-stopping of the ML model. We report the macro average F1 score \citep{opitz2019macro} for classification tasks and the $R^2$ metric for regression tasks. Our results presented in Table~\ref{tab:mle-dm-results} (MLE) show that REaLTabFormer, despite not being fine-tuned, produces ML efficacy scores that are the best or second-best compared with the baselines. This demonstrates that REaLTabFormer can be used, ``out-of-the-box", to generate synthetic data with state-of-the-art performance in machine learning tasks. The FB comments dataset, where REaLTabFormer obtained the best performance, is the largest dataset tested and has the largest number of columns. Training the GReaT model on this dataset yielded impractical runtime so no result is reported. This supports our view that using LLM trained on a large vocabulary, containing a majority of irrelevant tokens, limits the efficiency of the model. \vspace{-5pt} \paragraph{Discriminator measure} We adopt the discriminator measure \citep{borisov_language_2022} to quantify whether the data generated by a model is easily distinguishable from real data. A dataset is made by combining an equal number of real and synthetic data. Real observations in this dataset are labeled as “1” and synthetic observations are labeled as “0”. Similar to \citet{borisov_language_2022}, we train a random forest model to predict the labels given an observation. A held-out dataset containing a combination of synthetic samples and real test data is then used to report the final measure. An accuracy that is closer to 50\% implies better synthetic data quality since the discriminative model is not able to distinguish the real from the synthetic observations. We report our results in Table~\ref{tab:mle-dm-results} (DM). The DM measure shows that the Tab-DDPM has the most indistinguishable synthetic data. Nonetheless, REaLTabFormer, without the need for tuning, has DM measures that are close to the Tab-DDPM. This suggests that the synthetic data produced by a diffusion-based model and REaLTabFormer are realistic compared with the other baselines. \vspace{-2pt} \paragraph{Logistic Detection} For relational datasets, we use logistic detection (LD) \citep{fisher2019machine,gueye2022row} to quantify the quality of the parent, child, and merged tables generated by REaLTabFormer compared with the HMA model. We evaluate ROC-AUC scores averaged over (N=3) cross-validation folds, \vspace{-10pt} \begin{equation} \mu_{\mathrm{RA}} = \frac{1}{N}\sum_{i=1}^N \max (0.5, \mathrm{ROC-AUC}) \times 2 - 1 \vspace{-5pt} \end{equation} The value reported is $LD=100 \times (1 - \mu_{\mathrm{RA}})$, where scores range from 0 to 100, and scores closer to 100 imply better synthetic data quality. We use random forest in measuring the logistic detection instead of the standard logistic regression model. The random forest model captures non-linearity in the data well than logistic regression \citep{couronne2018random}, reducing the likelihood of spurious results. We report the results in Table~\ref{tab:relational-ld-results}. Additional LD results using logistic regression are shown in Table~\ref{tab:relational-ld-logistic-results}. The REaLTabFormer model produces significantly higher-quality synthetic data than the HMA model across the datasets tested. The high values of LD for the child and the merged tables highlight the ability of REaLTabFormer to accurately synthesize relational datasets in comparison with the leading baseline. The LD metric shows that data generated by SDV for the Airbnb child table is entirely distinguishable from the real data. The quantitative results are supported by relational statistics computed from synthetic datasets produced by REaLTabFormer and the HMA model: \cref{fig:rossmann-date-sales,fig:airbnb-device_type-age_group,fig:rossmann-storetype-sales}. \section{Conclusion} We presented REaLTabFormer, a framework capable of generating high-quality non-relational tabular data and relational datasets. This work extends the application of sequence-to-sequence models to modeling and generating relational datasets. We introduced target masking as a component in the model to mitigate data-copying and safeguarding from potentially sensitive data leaking from the training data. We proposed a statistical method and the $Q_\delta$ statistic for detecting overfitting in model training. This statistical method may be adapted to other generative model training. We showed that our proposed model generates realistic synthetic tabular data that can be a proxy for real-world data in machine learning tasks. REaLTabFormer's ability to model relational datasets accurately compared with existing open-sourced alternative contributes to solving existing gaps in generative models for realistic relational datasets. Finally, this work can be extended and applied to data imputation, cross-survey imputation, and upsampling for machine learning with imbalanced data. A BERT-like encoder can be used instead of GPT-2 with the REaLTabFormer for modeling relational datasets. We also see opportunities to improve privacy protection strategies and the development of more components like target masking embedded into synthetic data generation models to prevent sensitive data exposure. \pagebreak \section{REaLTabFormer Python Package} We publish the REaLTabFormer as a package on PyPi. We show below how the model can be easily trained on any tabular dataset, loaded as a Pandas DataFrame. \vspace{-5pt} \subsection{Non-relational tabular model} \label{appendix:python-non-relational} Use the following snippet to fit the REaLTabFormer on a non-relational tabular dataset. One can control the various hyper-parameters of the model and the fitting method, e.g., the number of bootstrap rounds \texttt{num\_bootstrap}, the fraction of training data \texttt{frac} used to generate the $\mathbf{Q}_\delta$ statistic, etc. Keyword arguments for the HuggingFace transformers \texttt{Trainer} class can also be passed as \texttt{**kwargs} when initializing the model. \begin{minted}[ frame=lines, framesep=2mm, bgcolor=BrickRed!2, baselinestretch=1.2, fontsize=\scriptsize, xleftmargin=10pt, numbersep=5pt, linenos ]{python} # pip install realtabformer import pandas as pd from realtabformer import REaLTabFormer # NOTE: Remove any unique identifiers in the # data that you don't want to be modeled. df = pd.read_csv("foo.csv") # Non-relational or parent table. rtf_model = REaLTabFormer( model_type="tabular", gradient_accumulation_steps=4) # Fit the model on the dataset. # Additional parameters can be # passed to the `.fit` method. rtf_model.fit(df) # Save the model to the current directory. # A new directory `rtf_model/` will be created. # In it, a directory with the model's # experiment id `idXXXX` will also be created # where the artefacts of the model will be stored. rtf_model.save("rtf_model/") # Generate synthetic data with the same # number of observations as the real dataset. samples = rtf_model.sample(n_samples=len(df)) # Load the saved model. The directory to the # experiment must be provided. rtf_model2 = REaLTabFormer.load_from_dir( path="rtf_model/idXXXX") \end{minted} \vspace{-10pt} \subsection{Non-relational tabular model} REaLTabFormer for relational databases requires a two-phase training. First, the model for the parent table is trained as a non-relational tabular data, then saved. Second, we pass the path of the saved parent model when creating the REaLTabFormer instance for the child model to be used as its encoder, then train. Generate synthetic samples from the parent table and use as input to the trained child model to generate the synthetic relational observations. \begin{minted}[ frame=lines, framesep=2mm, bgcolor=BrickRed!2, baselinestretch=1.2, fontsize=\scriptsize, xleftmargin=10pt, numbersep=5pt, linenos ]{python} # pip install realtabformer import os import pandas as pd from realtabformer import REaLTabFormer pdir = Path("rtf_parent/") parent_df = pd.read_csv("foo.csv") child_df = pd.read_csv("bar.csv") join_on = "unique_id" # Make sure that the key columns in both the # parent and the child table have the same name. assert ((join_on in parent_df.columns) and (join_on in child_df.columns)) # Non-relational or parent table. Don't include the # unique_id field. parent_model = REaLTabFormer(model_type="tabular") parent_model.fit(parent_df.drop(join_on, axis=1)) parent_model.save(pdir) # # Get the most recently saved parent model, # # or a specify some other saved model. # parent_model_path = pdir / "idXXX" parent_model_path = sorted([ p for p in pdir.glob("id*") if p.is_dir()], key=os.path.getmtime)[-1] child_model = REaLTabFormer( model_type="relational", parent_realtabformer_path=parent_model_path, output_max_length=None, train_size=0.8) child_model.fit( df=child_df, in_df=parent_df, join_on=join_on) # Generate parent samples. parent_samples = parent_model.sample(len(parend_df)) # Create the unique ids based on the index. parent_samples.index.name = join_on parent_samples = parent_samples.reset_index() # Generate the relational observations. child_samples = child_model.sample( input_unique_ids=parent_samples[join_on], input_df=parent_samples.drop(join_on, axis=1), gen_batch=64) \end{minted} \vspace{-10pt} \paragraph{Acknowledgments} This project was supported by the “Enhancing Responsible Microdata Access to Improve Policy and Response in Forced Displacement Situations” project funded by the World Bank-UNHCR Joint Data Center on Forced Displacement (JDC) – KP-P174174-GINP-TF0B5124. We also thank Patrick Brock for providing insightful comments. The findings, interpretations, and conclusions expressed in this paper are entirely those of the authors. They do not necessarily represent the views of the International Bank for Reconstruction and Development/World Bank and its affiliated organizations, or those of the Executive Directors of the World Bank or the governments they represent. \pagebreak
\section{Signal Analysis} \label{sec:analysis} \begin{figure*}[ht] \captionsetup{font=footnotesize,labelfont=bf,width=1\linewidth} \setlength{\belowcaptionskip}{-5pt} \centering \subfloat[0-8 kHz]{ \includegraphics[scale=0.3]{figs/pspec/wall-noinsul-0-8kHz.png} \label{fig:pspec_plots-a} } \subfloat[6-7 kHz]{ \includegraphics[scale=0.3]{figs/pspec/wall-noinsul-6-7kHz.pdf} \label{fig:pspec_plots-b} } \subfloat[7-8 kHz]{ \includegraphics[scale=0.3]{figs/pspec/wall-noinsul-7-8kHz.pdf} \label{fig:pspec_plots-c} } \caption{Power spectrum graphs of the wake word from each command audio sample that showed injection success (blue) and failure (red) in the across-wall scenario (without insulation).} \label{fig:pspec_plots} \end{figure*} In order to improve our understanding of why certain speech samples were successfully injected across the barriers we investigated what frequencies were most affected by the barriers and whether we could identify certain frequency characteristics in our command audio samples that may explain the different levels of success. \noindent \textbf{Power Spectrum} We generated power spectrum graphs that overlay the spectrums for each of the command audio samples, isolating the wake word specifically, in order to compare frequency distributions and identify specific characteristics. We chose to investigate the wake word portion of the commands because 1) command injection cannot occur unless the wake word is successfully issued, and 2) the injection attack experiment results showed greater success/failure distinction, for the wake word, between different speakers. In Figure \ref{fig:pspec_plots} we show the power spectrums of the wake word portion of the command audio samples for each individual TTS speaker. In the graphs, the solid blue lines indicate power spectrums of speaker samples that were successful at injection, while the red dashed lines indicate power spectrums of speaker samples that were not successful. From these graphs, we identify certain frequency characteristics that are consistent among the successful samples. Figure \ref{fig:pspec_plots-a} shows the full power spectrum of frequencies from 0 to 8 kHz. Looking at this graph we find there are certain frequencies in the upper range that have consistencies between the successful and failing samples. Figures \ref{fig:pspec_plots-b} \& \ref{fig:pspec_plots-c} show power spectrums that zoom into the frequency ranges of 6 to 7 kHz and 7 to 8 kHz, respectively. In these graphs we can identify five different frequency ranges (6.08-6.22 kHz, 6.32-6.82 kHz, 6.93-7.04 kHz, 7.21-7.30 kHz, and 7.34-7.69 kHz) where we find that all samples that showed successful injection have stronger frequencies in these ranges than the samples that were not successful. While more sophisticated exploration is needed to make final conclusions, we have a few hypotheses about why certain audio samples performed better than others. First, it is possible that audio samples that showed greater success utilized more bass in the part of the wake word that are required for recognition. Therefore, as the audio passes through the physical barriers and those components of the audio are strengthened, the audio maintains a higher potential for successful recognition. Second, voice detection is trained to differentiate human speech from environmental noise and the highest frequency range captured (6-8 kHz) may be unique to human speech played through a loudspeaker, and less likely to occur naturally in an environment. Lastly, there are certain consonants that are important for speech intelligibility that appear in the upper frequency range (~2-4 kHz) when recorded by a microphone~\cite{mic_univ}. The difference in frequency power within this range could also attribute to why some audio samples remain more intelligible (i.e., the samples with greater variance of power within that range). \section{Attack \& Threat Model} \label{sec:attacks} In this section we define three BarrierBypass attacks based on different types of barriers (Door, Window, Wall), depicted in Figure~\ref{fig:scenario_fig}, as well as describe our threat model. \subsection{Barrier-Based Attacks} \noindent \textbf{Across-Door Attack:} The first barrier that we consider is a standard interior door. We define the \textit{across-door} attack to represent all situations where an attacker may attempt to inject a command to a victim's VA that is located across an interior door. If the door is locked, hindering the attacker from gaining direct access into the room, there is still the potential for the attacker to issue a command across the door barrier in order to achieve their goal (i.e., unlock the door's smart lock or control some other connected smart device). In this situation, the gap that exists between the bottom of the door and the floor can be considered a vulnerability that may be exploited by this attack. The presence of a small gap will significantly increase the audio propagation in the room and increase the potential for attack success. \noindent \textbf{Across-Window Attack:} The next barrier that we consider is a standard window. We define the \textit{across-window} attack to represent the more likely attack situation that an attacker is attempting to issue a command from outside the victim's home or office. Often the attacker will have no access to desired space, or even to an adjacent room, so issuing a command through a window may be their only option. Again, if the user can issue a command from this location, they may be able to gain access by issuing commands to other smart devices that are linked to the voice assistant (i.e., smart locks on the doors, smart garage door). The window used in our experiments was a builder's grade, double-pane window that was located on the balcony of a third floor apartment. \noindent \textbf{Across-Wall Attack:} The last barrier that we consider in this study is an interior wall. We define the \textit{across-wall} attack to represent the situations where an attacker may be in an adjoining room. This would be a common barrier for attackers in adjacent living arrangements such as apartment complexes, dorm rooms, or hotels. An attacker could easily set up the speaker equipment for their attack in their own space next door and not be disturbed. To allow for greater experimental control, we decided to simulate the across-wall scenario using a soundproof box and wall inserts that we constructed. We consider two typical constructions of interior walls that are still present today 1) without insulation and 2) with insulation. The details on the construction of the soundproof box and the wall inserts are provided in Sections \ref{subsec:soundproof_box} and \ref{subsec:wall_inserts}, respectively. \subsection{Threat Model} \label{subsec:threatmodel} In our threat model, the attacker does not need prior knowledge of the target VA device or its settings. Through a process of initial testing with different wake words, an attacker can learn what device is in the victim space and how to activate it (e.g., the Amazon Echo only has four possible wake word settings so each could be tested). Also, depending on the placement of the target device, the attacker could look through a window of the target room (either in person or automated with a camera) and identify the device that is being used. The attacker is equipped with a portable loudspeaker device that is pre-loaded with some voice commands that they would like to issue. The command audio can be recorded by the attacker themselves, generated using Text-to-Speech software, sourced from publicly accessible repositories of human speech samples, or recorded/synthesized samples of the victim's voice. Since modern voice assistants are not voice specific by default, the attacker does not necessarily need command audio that is in the victim's voice, making this attack easier to conduct. In fact, the attacker can run initial testing in their own space to identify a particular voice sample that performs the best for targeting a specific voice assistant device or passing through a specific barrier. BarrierBypass is designed as an untargeted attack that can be executed independent of the victim. The attacker can use any speech audio so there is no dependence on acquiring the user's speech. Therefore, the same attack setup can also be launched against many different victims successively in a short period of time. There is also a lot of freedom for the attack to target any available barrier separating them from the victim voice assistant (i.e., they can issue the command across all available windows or walls). In particular, the attack could launch BarrierBypass remotely using a drone device equipped with a loudspeaker. The drone can fly around to inject the command audio and could target all the windows in a home and even multiple homes (i.e., an entire street or neighborhood) and "leave" the scene very quickly if they suspect detection. They could also target apartments/condos in a high-rise building by flying the drone up to a window. Drones can be purchased cheaply and can come already equipped with a speaker~\cite{drone_speaker1} for \$150, or the speaker device can be purchased by itself for \$50~\cite{drone_speaker2} and attached to any drone. While the BarrierBypass attack is fully functional as an untargeted attack, there is some potential for a more targeted approach against a specific victim. Using a replay or synthesis attack, an attacker can fool speaker recognition on a virtual assistant device and achieve even more severe attack capabilities. While BarrierBypass is intended to be launched when the user is not home, there are some scenarios where it can be launched with the victim present in the space. Because the command audio loses a lot of power and becomes quieter as it passes through a physical barrier, there is potential for the injected command to go unnoticed. In some cases the victim may be occupied doing some task or activity that may draw their attention away from their voice assistant (i.e., taking a shower, napping, watching TV in another room). During these times, the attack can still launch the attack successfully while avoiding detection. Since the goal of the attack is to issue a command, we consider both parts of a voice assistant command audio, the wake word and the command itself. We recognize that wake word injection is foremost crucial for the attack because it activates the device to accept commands. Additionally, injecting the wake word alone can open up new attack possibilities. When a voice assistant is woken up, a recording is made that is sent over the internet for processing and is typically stored in a command history log. Therefore, an attacker could inject the wake word with the intent of allowing the device to make an unauthorized recording of the audio in the space (i.e., user speech, audio from a television, music playing). The attacker may then compromise the online repository of VA recordings to learn private user information. \textit{While we evaluate the BarrierBypass attack on voice assistant devices, it is important to note that the attack is applicable to any voice controllable system.} \section{Background} \label{sec:background} \subsection{Sound Passage Through Barriers} As sound waves hit a physical barrier, they will lose energy and attenuate as they pass through the solid material. This occurs because the sound is either reflected off of the material (causing echo) or absorbed by it. Therefore, sounds on one side of a barrier played at a particular loudness (decibel) level, will be quieter when heard or recorded on the other side because the decibels are reduced. The transmission loss of sound across a barrier can be affected by many factors attributed to the barrier's material and construction. Thickness, density, and air space within the barrier are all factors that can either increase or decrease the level of sound transmission. For example, in double paned windows, thicker glass and greater air space in the middle are desired to optimize sound blockage~\cite{stc_window}. A barrier's ability to block sound is measured using different rating values such as Sound Transmission Class (STC) and Noise Reduction Coefficient (NRC). We provide further detail on these values and what they represent in the following subsections. \begin{figure*}[ht] \captionsetup{font=footnotesize,labelfont=bf,width=0.8\linewidth} \centering \includegraphics[scale=0.50]{figs/scenario_fig.pdf} \caption{The BarrierBypass attack in the three barrier-based scenarios that we explore in our study including the (a) window barrier, (b) door barrier, and (c) wall barrier. The attacker is located on one side of the barrier, either in person such as an adjoining room or remotely using a drone, and attempts to inject an audible command to control the voice assistant located on the other side.} \label{fig:scenario_fig} \end{figure*} \subsection{Rating Values for Sound Propagation} \noindent \textbf{Sound Transmission Class:} Sound Transmission Class (STC) is an established rating system for how much sound is blocked by a particular assembly~\cite{stc}. It is an integer rating that roughly equates to the dB reduction in sound across a particular barrier. For example, a wall that reduces a 100 dB noise on one side, to a 60 dB noise on the other side would have an STC rating of 40. It is the most commonly used metric in the US for describing sound blockage potential and allows for direct comparison between different products (i.e., walls, doors, windows, etc.) and manufacturers. Specifically, the STC rating is calculated as the average noise blockage, in dB, for 18 different frequency values and has a logarithmic scale. This rating is based on the ASTM E413-16 standard~\cite{stc_standard}. Since our work is mostly concerned with the amount of sound that is able to persist through a barrier and into the space on the other side, the STC rating is most relevant. The STC ratings for the different barrier setups that we consider include: STC of 20 for the door-barrier~\cite{stc_door}, STC of around 33 for the window-barrier~\cite{stc_window}, and STCs of 30 and 34 for the wall-barrier without insulation and with insulation, respectively. We will revisit these values later on when interpreting our experimental results. \noindent \textbf{Noise Reduction Coefficient:} The Noise Reduction Coefficient (NRC) measures the amount of noise that a material absorbs~\cite{nrc}. Where the STC is a rating that describes how much noise can pass through a barrier, the NRC describes the amount of noise that is left within a space. Therefore, two materials with the same NRC does not imply that the same amount of noise is transmitted through the other side for each of them. NRC values are on a scale of 0 to 1, where 0 indicates the material will reflect back all of the sound that hits it, and a value of 1 indicates that all of the sound is absorbed by the material (e.g., none of it is reflected back). The NRC provides a single-value approximation of the noise absorption of a material by averaging the sound absorption coefficient values at four 1/3 octave frequencies (250, 500, 1000 and 2000 hertz) and is rounded to the nearest 0.05 increment. This rating is based on the ASTM C423-17 standard~\cite{nrc_standard}. \section{Conclusions and Future Work} \label{sec:conclusion} In this work, we present the BarrierBypass attack that issues audible voice commands to smart speakers across physical barriers. Our attack demonstrates the settings in which clean command injection can be successful and what barrier types are at risk. This attack can be launched in person or remotely via drones or other controlled devices, and allow an attacker to gain full control over a victim's VA device when the device is placed near a barrier and the scenario allows for loud command audio to be played. Compared to other command injection attacks, BarrierBypass exploits the lack of speaker verification present on modern smart speaker devices and bypasses physical barriers that would hinder other types of attacks. We evaluated the attack in multiple settings that test different command audio SPL levels and distances. Our experiments tested three different barrier-based attack scenarios using two live implementations of smart speaker devices and demonstrate that 100\% wake word and command injection accuracy can be achieved when selecting the highest performing speaker samples and under certain conditions. \section{\textcolor{red}{Drone-based Attack}} \label{sec:drone} \textcolor{red}{In this section, we demonstrate that the BarrierBypass attack can be launched \textit{remotely} via drone technology. Videos of the successful drone attack can be found on our website: \url{https://sites.google.com/view/barrierbypass}} \subsection{\textcolor{red}{Equipment}} \textcolor{red}{We utilized two drone models in our experiments. The first drone was a Toys-Sky S167 Quadcopter (``S167'')}~\cite{S167} \textcolor{red}{equipped with an SRS-XB2 Bluetooth speaker. The second drone was the Holy Stone HS700 (``HS700'')}~\cite{HS700} \textcolor{red}{equipped with an Anker Soundcore Bluetooth speaker. For all experiments we used a digital sound level meter to ensure the command audio played was at the correct volume. Additionally, we measured the loudness of each drone when it was turned on and prepared for flight (e.g., volume of the drones when the propellers were spinning). The S167 has an operating volume of 85 dB, and the HS700 has an operating loudness of 73 dB. Our experiments compromised simulated attacks targeting an Amazon Echo Dot 2 and Google Home smart speaker.} \subsection{\textcolor{red}{Experimental Design}} \textcolor{red}{Our first set of experiments utilized the S167 drone and demonstrated attacks targeting the Echo Dot smart speaker. Because of its louder volume during operation, we found that the command audio had to be increased from what was determined in prior experiments (without a drone). We recorded command injection success when the audio was played at 90 and 95 dB. The remaining experiments utilized the quieter HS700 drone and targeted both an Echo Dot and Google Home smart speaker. For all experiments, the drones were attached to the Bluetooth speakers, turned on and placed on the opposite side of the window from the smart speakers (Figure}~\ref{fig:drone_exp}). \textcolor{red}{In these experiments we recorded command injection success when the audio was played at 85 dB (the same dB level used in earlier experiments without a drone). For all experiments we utilized the three TTS command samples that proved to have the highest performance from our earlier experiments in the Across-Window scenario (i.e., TTS-M1, TTS-M2 and TTS-F2). For each combination of audio sample and SPL, we attempted the command injection attack 10 times and recorded the number of successes.} \subsection{\textcolor{red}{Results}} Table~\ref{tab:drone_results} \textcolor{red}{depicts the results for each of the scenarios tested. Firstly, we found that using a drone with an operating loudness of 85 dB (S167) required command audio be played at 90+ dB. Specifically, at 90 dB we observed command injection success only up to 50\%. However, increasing the command audio to 95 dB allowed us to observe attack success up to 100\%. Since the operating loudness of the S167 was equal to the volume of audio used in our original experiments, the command audio in the presence of the drone had to be increase by at least 5 dB to overcome the added noise and achieve an SNR closer to 1.0 for successful command injection.} \textcolor{red}{For our remaining experiments using the HS700 drone with a much lower operating loudness level, we observed high rates of command injection success, similar to what was observed in prior experiments when no drone was used. Because the operating loudness of the HS700 is only 73 dB, the 85 dB command audio level was not hindered by the added noise because it maintained a similarly high SNR. When targeting the Echo Dot, we observed attack success up to 100\%. And when targeting the Google Home we observed attack success up to 90\%.} \begin{figure}[h] \captionsetup{font=footnotesize,labelfont=bf,width=0.9\linewidth} \centering \includegraphics[width=0.85\linewidth]{figs/drone_attack.pdf} \caption{\textcolor{red}{Image of drone attack simulated in our experimentation.}} \label{fig:drone_exp} \end{figure} \section{Introduction} \label{sec:intro} As voice assistant (VA) devices such as Amazon Echo and Google Home smart speakers are approaching ubiquity, we are forced to become more aware of the inherent security risks associated with these devices. VA devices typically act as a central hub of control for a multitude of connected smart devices such as smart locks, lights, cameras, thermostats, appliances, and garage doors. Each of these devices can be controlled in some way by issuing voice commands to the VA device. But these commands also introduce new types of risks. The ability to control such devices with vocal commands opens up a lot of attack possibilities that did not exist before. Among the different types of attacks that can be performed, the potential for home/office/hotel/dorm intrusion is one of the most severe and threatening. Media coverage on this subject reveals the growing concern for the security vulnerabilities in a smart home environment~\cite{rambus,byteant,trendmicro,bobvilla,techspective}. While much of the concern is centered around the vulnerability to hacking that comes with connecting a multitude of devices, many professionals agree, for the purposes of home intrusion, there is a very low chance that an attacker would attempt to perform complex hacking as opposed to simply brute forcing there way in~\cite{wirecutter}. However, the ability to issue simple vocal commands to a voice assistant in order to control a lock or door is one vulnerability that requires no hacking and could potentially be favored by attackers who want to gain access to a space. Aside from commands being accidentally issued through television advertisements~\cite{broadcom,lifehacker,inc}, in an ISTR special report from Symantec, the author discusses the "mischievous man next door attack" which involves a neighbor issuing voice assistant commands either with ultrasonic frequencies, or by waiting until you leave and simply shouting a command through the door~\cite{symantec}. The report touches on the significant security risk that is introduced if you have smart locks or a garage door that can be controlled by your voice assistant because it would allow an attacker to gain entry into your home. While home invasion is a serious concern when a command injection attack is possible, it is important to note that there are many other scenarios that can cause harm if an attacker can control the smart devices of a home. For example, turning on the stove can cause a gas leak or become a fire hazard. Another form of command injection attack that has emerged in academia in recent years is hidden voice commands that obfuscate command audio so it is unrecognizable to humans, but recognizable by VA devices. However, hidden voice command attacks have limited applicability and their accuracy is generally low. They are also very sensitive to noise because of how specially they are crafted to begin with. Also, even after the past several years of research on these attacks \cite{Abdullah2021FaultIOA}, the vendors have not really come up with defenses to such attacks. This is perhaps because the vendors are likely ignoring them as being rather impractical or uneventful. Indeed, the recent work by Abdullah et al.~\cite{Abdullah2021FaultIOA} revealed that many of the hidden voice command attacks presented in research are not truly feasible in real-world settings due to their low accuracy and lack of transferability to different systems. Another recent work on command injection by Sugawara et al.~\cite{Sugawara2020LightCL} introduces the LightCommands attack which uses laser-based injection of the audio signal. The main drawbacks to this attack are that it requires a line of sight, is very complicated to setup/launch, and can be error prone. In this paper, we aim to address most of the aforementioned problems with the existing voice command injection attacks from the literature or practice. We focus on an attack model, BarrierBypass, in which a loudspeaker issues \textit{clean vocal commands} --- through a physical barrier --- to a voice assistant or other voice controllable technology that is located inside a home, office, or hotel room. While this attack model eliminates many of the complications of hidden command injection, it does introduce its own limitations. For example, because this attack injects clean commands and requires louder volumes, the attack would likely only be launched in certain scenarios such as when the user is not present in the space (such as during work hours). We consider three different barrier types which serve as the entry points for the attacker to inject such out-of-sight voice commands: \vspace{-2mm} \begin{enumerate}[wide] \item \textit{\textbf{Window Barrier}}: The attacker injects a command through a window to target a voice assistant in the room. The attacker can launch this attack in-person or remotely-controlled via drone technology which can target multiple homes in a neighborhood or even high rise buildings with condos or offices. We demonstrate the feasibility of both attack scenarios in this work. \item \textit{\textbf{Door Barrier}}: The attacker injects a command through a door that connects to the space with the victim voice assistant. This barrier is likely most susceptible due to the \textit{thin gap} beneath the door above the flooring which is sufficient for the sound waves to pass into the space easily. \item \textit{\textbf{Wall Barrier}}: The attacker is located in an adjacent space and injects a command through an interior wall. This barrier is applicable to housing setups such as dorms, hotels, or apartments where adjacent units share a wall. \end{enumerate} \textit{Is issuing voice assistant commands across a physical barrier possible? What types of barriers can be attacked? How can such an attack be achieved and what particular settings are required in order to bypass the barrier? What are the limitations of this attack?} These are the main research questions that we consider during this work and seek to answer. We perform extensive experimentation to evaluate the BarrierBypass attack in different parameter settings such as command audio loudness and location of the voice assistant device to determine when this type of command injection attack is possible in a real-world scenario. To our knowledge, a broad study on the voice assistant command injection attack, across physical barriers, has yet to be conducted in academia. This work demonstrates when the BarrierBypass attack is practical and it can be used to inform future research directions on the subject. \noindent \textbf{{Main Contributions and Results:}} We summarize our key contributions and results below: \noindent \textbf{\textit{(1).\ Design of Clean Voice Barrier-based Attacks:}} We designed three different barrier-based command injection attacks to represent common materials/objects that may act as a physical barrier between an attacker and the victim's voice assistant during a command injection attack. Specifically, we define the BarrierBypass attack in the \textit{across-door}, \textit{across-window}, and \textit{across-wall} scenarios and assess the effect of each barrier type on the attack's success. We present an attack that circumvents the sophistication and complexity of hidden voice command or laser-based command attacks, achieving the same goal with high accuracy in certain scenarios. \noindent \textbf{\textit{(2).\ Measurement Study Evaluating the Effect of Multiple Parameters:}} We present a measurement study and conduct an array of experiments to evaluate the effect of different barriers, under different attack settings, on command injection attack success. We test different speakers, loudness levels, voice assistant models (Amazon Echo Dot 2 and Google Home mini), device distances from the barriers, and observe the effect of different across-wall constructions (with and without insulation). BarrierBypass is able to achieve 100\% injection accuracy for both the wake word and command under certain conditions and selecting the highest performing speaker. \noindent \textbf{\textit{(3).\ Demonstration of Drone-based Attack:}} We utilized two drone models equipped with Bluetooth speakers to demonstrate the potential for executing the BarrierBypass attack via drones. Our experimental simulations of the attack reveal high command injection success when using a drone that has a low operating loudness, or when the command audio is increased by 10 dB to compensate for a higher operating loudness. \noindent \textbf{\textit{(4).\ Informed Suggestions to Increase Attack Robustness and Defense Potential:}} Compiling the knowledge gained from our multiple experiments and attack demonstrations, we devise a set of suggestions that could be applied by an attacker in order to improve the potential for this attack under realistic conditions. Conversely, this information can be used to inform defensive mechanisms. \section{Appendix} \subsection{Additional Images} \label{app-imgs} \begin{figure}[h] \centering \begin{minipage}{0.35\textwidth} \raggedright \captionsetup{font=footnotesize,labelfont=bf} \centering \subfloat[No Insulation]{ \includegraphics[scale=0.0335]{figs/wall-noinsulation.jpg} } \subfloat[Insulated]{ \includegraphics[scale=0.032]{figs/wall-insulated.jpg} } \caption{Inserts constructed for the Wall-Barrier.} \label{fig:inserts} \end{minipage}% \begin{minipage}{0.65\textwidth} \raggedleft \captionsetup{font=footnotesize,labelfont=bf} \subfloat[Soundproof Box]{ \includegraphics[scale=0.0305]{figs/soundproof-box.jpg} \label{subfig:box} } \hspace{0mm} \subfloat[Box Layers]{ \includegraphics[scale=0.165]{figs/sb-layers.pdf} \label{subfig:layers} } \subfloat[Experiment Aerial View]{ \includegraphics[scale=0.15]{figs/sb-aerialView.pdf} \label{subfig:exp_aerial} } \caption{Images of soundproof box construction and experimental setup.} \label{fig:sp-box} \end{minipage} \end{figure} \subsection{Additional Tables} \label{app-tables} \begin{table*}[h] \captionsetup{font=footnotesize,labelfont=bf} \centering \caption{Wake Word injection success rates, for attacking the Amazon Echo Dot 2, for each Barrier scenario. *Table is condensed to include only rows that showed some injection success.} \includegraphics[scale=0.66]{figs/alexa_results_ww.pdf} \label{tab:alexa-attack-results_ww} \end{table*} \begin{table*}[h] \captionsetup{font=footnotesize,labelfont=bf} \centering \caption{Wake Word injection success rates, for attacking the Google Home mini, for each Barrier scenario. *Table is condensed to include only rows that showed some injection success.} \includegraphics[scale=0.66]{figs/google_results_ww.pdf} \label{tab:google-attack-results_ww} \end{table*} \end{document} \section{Methodology} \label{sec:methodology} \subsection{Experimentation} \label{subsec:exps} \noindent \textbf{Parameters:} To generalize the results from our experimental attack simulations, we consider multiple parameters and values. Aside from the three types of barriers and different setups for each, we also test VA command audio samples from Male and Female speakers that are generated using text-to-speech or recorded from live human speakers. We consider different loudness levels for the injected audio including 65 dB to represent normal conversational loudness, 75 dB to represent loud speech, and even 85 dB for very loud audio achievable using a loudspeaker device. We tested different distances of the VA device from the barrier including 0.1 and 0.5 meters for the across-window attack, and 0.1, 0.5, 1, 2, and 4 meters for the across-door attack. Lastly, we ran experiments using two different types of VA smart speakers. \noindent \textbf{Experimental Setup:} For each experiment we recreate a realistic attack setup with the portable loudspeaker placed on one side of the barrier (attacker side), and the target smart speaker on the other side of the barrier (victim side) at certain distances. We ensure that the loudspeaker and smart speaker devices are aligned directly across from each other with the loudspeaker facing the barrier. We use the digital sound level meter on the attacker side to set the SPL of the command audio from the loudspeaker to the appropriate loudness. As a representative example of a command an attacker may attempt to issue, we selected the single-word, "Disarm" command. We consider the scenario where an attacker may be attempting to enter a victim's home and needs to disable the security system that is linked to their smart home environment (i.e., smart speakers). However, we believe our results are representative of other types of single-word commands. For each experimental parameter setting, we attempted the attack 10 times and recorded the number of successful injections of the wake word and the command portions. With 12 speaker samples, 3 SPL levels, 10 barrier/distance combinations, and 2 smart speaker devices, conducted a total of 7,200 attack simulations as part of our evaluation. \noindent \textbf{Command Audio Samples:} We created a set of command audio samples consisting of both Text-to-Speech (TTS) samples and recordings of Live Human (LH) speakers saying the single-word command, ``Hey Google/Alexa, Disarm''. This command represents an attacker's attempt to turn off a user's home security system so that the attacker may gain access. We do not make any claims that our results are representative of other single-word commands, but we do believe that more complex commands would make the attack more difficult. Specifically, we use samples from three Male speakers (M1-M3) and three Female speakers (F1-F3), for both sample types, for a total of 12 different speaker samples. The TTS samples were generated using a free online text-to-speech generator~\cite{tts_site}, and the LH speech samples were recorded directly from volunteers. Prior to our experimentation, we confirmed that all of the command audio samples that we collected achieved 100\% recognition success in the non-malicious setting (when there is no ambient noise or physical barriers present). \noindent \textbf{Equipment:} In our experiments we use a cheap and low-end Sony SRS-XB2 portable loudspeaker to play the command audio. Notably, more powerful speakers can improve attack success. For the victim voice assistant, we use both the Amazon Echo Dot 2 and Google Home mini smart speakers. In order to ensure the command audio was played at the correct sound pressure level (SPL) we use a Rolls SLM305 digital sound level meter. Additionally, we built our own soundproof box and wall inserts for the across-wall scenario. \subsection{Soundproof Box} \label{subsec:soundproof_box} For the across-wall attack, we construct a soundproof box in order to self contain the experiments in a highly controlled space that allows us to test different wall constructions. This approach allows to select specific building materials with sound blockage ratings that we know beforehand and to ensure that the command audio is only able to reach the VA device by passing through the wall. We found this approach easier than attempting to learn what materials were used in the walls of a real environment. To build the soundproof box (pictured in Appendix Figure \ref{subfig:box}) we followed the instructions outlined in \cite{soundproof_box}. We lined a cardboard box with foam board using 3M Super77 Spray Adhesive. Next, we added a layer of 1/4'' thick Dynamat Dynaliner (Self-Adhesive Sound Deadener). Lastly we added a layer of 3'' Acoustic Foam Egg Crate Panels using Auralex Foamtak adhesive spray. The different layers of the soundproof box are shown in Appendix Figure \ref{subfig:layers}. \subsection{Wall Inserts} \label{subsec:wall_inserts} To experiment with different across-wall barriers, we constructed two wall inserts to fit inside the soundproof box, pictured in Appendix Figure~\ref{fig:inserts}. These inserts are constructed to the exact measurements that allow the insert to fit inside the soundproof box with a tight seal around all edges. Appendix Figure \ref{subfig:exp_aerial} shows the setup for the across-wall attack experiments. The inserts were built with and without insulation~\cite{soundproofing_walls_ceiling}. Both inserts have a 2"x4" wood frame and are encased in 5/8" drywall panels that are cut to the exact dimensions of the frame. One of the inserts contains R13 Fiberglass insulation inside the stud frame, while the other insert was left empty. The stud frames were connected using 1 1/2" wood screws, and the drywall was attached with drywall glue and screws. \section{Related Work} \label{sec:relatedwork} \noindent \textbf{Replay Attacks:} Among all the spoofing attacks against VA systems, replay attacks are the most accessible to the adversary since it simply involves recording a victim's voice commands with a handy recording device and replaying the commands for the attack. Existing studies have shown that such attacks are effective against state-of-the-art speaker verification systems~\cite{Ergunay2015OnTV, Delgado2021ASVspoof2A}, under scenarios of replaying over the internet or within the physical space of the victim. Other than directly replaying the recorded speech, recent studies also reveal the potential ways of enhancing the stealthiness and effectiveness of the attack. VMask~\cite{Zhang2020VoiceprintMA} designed adversarial machine learning techniques to generate subtle perturbations to make any recorded speech pass speaker verification systems. To improve the stealthiness, Guo~\textit{et al.}~\cite{Guo2021ADM} exploited a loudspeaker array to make the sound emission focus on the microphone of the VA system, thereby hiding the attack sound from the user. To bypass existing defense schemes, Yoon~\textit{et al.}~\cite{Yoon2020ANR} leveraged a mouth simulator instead of a loudspeaker to replay the recorded speech. However, in terms of command injection attacks against smart speaker devices, replay attacks using commands in the victim's voice are not always necessary. Many of the current VA devices available (such as those used in our study) do not employ strict speaker verificatio. If the audio is understandable via speech recognition, the device will execute any command that is given which is a characteristic we exploit in BarrierBypass. \noindent \textbf{Laser-based Injection:} In addition to replay attacks, laser-based injection has also been utilized for signal and command injection targeting smart speakers. Recently, Light Commands~\cite{Sugawara2020LightCL} has brought up a new security issue, which is a new class of signal injection attacks targeted on microphones of the smart speakers by physically converting a light signal to sound signal. The attacker can inject arbitrary audio signals to a target microphone by aiming a specially designed amplitude-modulated light at the microphone’s aperture. By means of Light Commands~\cite{Sugawara2020LightCL}, the attacker can obtain control over some commodity smart speakers, such as Amazon’s Alexa, Apple’s Siri, and Google Assistant, at distances up to 110m, which provide a brand new perspective for attacking smart speakers. One drawback to this form of attack is that it requires a direct line-of sight between the attacker and victim's device. Therefore, simply closing the blinds or moving your device to a location out of view will thwart this attack. Our BarrierBypass attack does not require this line of sight and is much more accurate in practical settings. \noindent \textbf{Ultrasonic/Hidden Audio Injection:} In addition to conventional attacks through replaying human-sounding speech, researchers also show the potential of generating unintelligible or even inaudible attack sounds. Particularly, DolphinAttack~\cite{Yan2021TheFO} modulates the recorded voice commands onto the ultrasonic frequency range, which is inaudible to human hearing but can be demodulated by the microphone due to their non-linearity. Hidden voice attacks~\cite{Carlini2016HiddenVC, Abdullah2019PracticalHV} convert recorded speech into obfuscated voice commands, which are recognizable to the speech recognition models while remaining unintelligible to humans. Recent studies also demonstrate the possibilities of embedding such commands into background music~\cite{Yuan2018CommanderSongAS} or the audio channel of video streams~\cite{Zhou2019HiddenVC}. By combining hidden voice commands with live speech, the hybrid commands can even bypass the state-of-the-art defense schemes~\cite{Wu2021HVACEC}. While hidden voice commands introduce new approaches to evade detection, they are often very complicated to produce and are not feasible for real-world attack settings. Our attack does not obfuscate the command itself, but rather injects the clear-text command through a barrier. Hidden voice commands are obfuscated commands and hence they are often misrecognized or not effective. In a recent work by Abdullah et al.~\cite{Abdullah2021FaultIOA}, the authors survey current research works that present hidden voice command type attacks and demonstrate through experimentation that most of them will not be successful when launched against real-world systems. In this work we evaluate BarrierBypass against live implementations of VA devices and bypass real barriers with greater ease and feasibility than hidden voice commands. \section{Attack Results} \label{sec:results} \begin{table*}[ht] \captionsetup{font=footnotesize,labelfont=bf} \centering \caption{Command injection success rates, for attacking the Amazon Echo Dot 2, for each Barrier scenario. *Table is condensed to include only rows that showed some injection success.} \vspace{-2mm} \includegraphics[scale=0.58]{figs/alexa_results_cmd.pdf} \label{tab:alexa-attack-results_cmd} \end{table*} \begin{table*}[ht] \captionsetup{font=footnotesize,labelfont=bf} \centering \caption{Command injection success rates, for attacking the Google Home mini, for each Barrier scenario. *Table is condensed to include only rows that showed some injection success.} \vspace{-2mm} \includegraphics[scale=0.58]{figs/google_results_cmd.pdf} \label{tab:google-attack-results_cmd} \end{table*} In this section we report the BarrierBypass attack results from our experiments. We recorded and present both wake word and command injection success for all audio samples. Appendix Tables \ref{tab:alexa-attack-results_ww} \& \ref{tab:google-attack-results_ww} show the \textit{wake word} injection rates for the Amazon Echo Dot and Google Home mini smart speakers, respectively. And Tables \ref{tab:alexa-attack-results_cmd} \& \ref{tab:google-attack-results_cmd} show the \textit{command} injection rates. The values represent the percentage of successful injection out of 10 attempts. We present results for the standard implementation of BarrierBypass using non-specific voice audio for command injection, and discuss our investigation of the targeted implementation for fooling speaker recognition. To save space, we condensed the tables to include only the rows that showed instances of injection success. Therefore, any command SPLs or distances tested that were not included in these tables had no injection success for any of the speaker samples. \subsection{Standard BarrierBypass:} \noindent \textbf{Across-Wall Attack:} (Amazon Echo Dot 2) From our experiments for the across-wall attack, we observe that both wake word and command injection success was only possible when the audio was played at the loudest SPL level, 85 dB, when attacking the Amazon Echo Dot 2 device. If we compare the average injection success rates for both types of speakers for the across-wall attack with no insulation, we get 22\% success for the live speaker samples, and 50\% success for the TTS samples. And if we look at the across-wall attack with insulation we find that the wake word injection success completely diminishes to 0\% for the live speakers, and slightly decreases to 47\% for the TTS speakers. Comparing the injection success averages from the command injection results we see a similar trend. With no insulation, the live speaker samples have average injection success of 15\% and the TTS speaker have 38\%. And when insulation is added we again find the live speaker sample injection success drops to 0\% and the TTS speaker samples slightly decreases to 35\%. However, part of our threat model is that the attacker can perform preliminary testing and select the best performing command sample to launch their attack. \textbf{\textit{Choosing sample TTS-M1, the attack achieves 100\% success rates for wake word and command injection, at 85 dB for both types of walls, when targeting the Echo Dot .}} (Google Home mini) For the Google Home mini we observed wake word and command injection success at 75 dB and 85 dB, and much greater success rates overall compared to the Amazon Echo Dot 2. Again, comparing the average wake word injection success rates for both types of speakers we find at 75 dB the average live speaker sample success is 95\%, outperforming the average TTS sample success of 68\%. At 85 dB, both live speaker and TTS samples achieve 100\% wake word injection success. When insulation is added the average success rates slightly decrease. At 75 dB, the live speaker and TTS sample success rates decrease to 85\% and 57\%, respectively. And at 85 dB the success rates decrease from 100\% for both speaker types with live speaker samples achieving 93\% and TTS samples achieving 72\%. Like the Amazon Echo Dot 2 results, we see a large decrease in command injection success compared to the wake word injection. At 75 dB, the live speaker samples had 0\% command injection success, and the TTS samples had 17\% command injection success. When the audio was played at 85 dB these average success rates increase to 60\% and 67\% for the live speaker and TTS samples, respectively. When the insulation was added, we see very similar success rates at the 75 dB level of 0\% and 18\% for live speakers and TTS samples, respectively. However, at 85 dB, we see a decrease in injection success (compared to no insulation) with live speaker samples dropping to 28\% and TTS samples dropping to 52\%. \textbf{\textit{Choosing sample TTS-F3 or TTS-M1 achieves 100\% success rates for injecting the wake word at both SPL levels, and TTS-M1 achieves 100\% success for injecting the command at both SPL levels, when targeting the Google Home.}} \noindent \textbf{Across-Window Attack:} In the across-window attack we observed injection success at 0.1 meters. Increasing the distance to 0.5 and 1 meter completely diminished injection success for all speaker samples and audio SPL levels. For both smart speakers we observed injection success at 75 dB and 85 dB for the wake word, and at 85 dB for the command. (Amazon Echo Dot 2) At 75 dB we observe no wake word injection success for the live speaker samples, and only two instances of injection success (3\% average) for the TTS samples. When the audio was increased to 85 dB the average success rates increased to 15\% for the live speaker samples and 48\% for the TTS samples. No wake command injection success was observed at the 75 dB level, but at 85 dB we observed one instance of successful injection (2\% average) for the live speaker samples. The TTS samples showed greater success with an average of 28\% command injection success. \textbf{\textit{Selecting sample TTS-F2 or TTS-M1 allows the attack to achieve 100\% success rates for injecting the wake word at the 85 dB SPL level, and keeping TTS-F2 achieves 90\% success for injecting the command at the 85 dB SPL level, targeting the Amazon Echo Dot.}} (Google Home mini) In the results for the Google Home mini we observed nearly identical wake word injection success rates for the live speaker and TTS samples at both the 75 dB and 85 dB SPL levels. At 75 dB the live speaker samples had no wake word injection success and the TTS samples had only one instance of success (2\% average). When the SPL level was increased to 85 dB, both the live speaker samples and TTS samples showed an average of 78\% wake word injection success. Looking at the success rates for command injection, we find that the TTS samples were more successful. The live speakers samples had an average command injection success rate of 5\% while the TTS samples achieved 28\%. \textbf{\textit{Selecting any of the samples LS-F1, LS-F3, LS-M1, LS-M2, TTS-F2 or TTS-F3 achieves 100\% success rates for injecting the wake word at the 85 dB SPL level, and sticking with the TTS-F2 sample achieves 100\% success for injecting the command at the 85 dB SPL level, targeting the Google Home.}} \begin{table}[ht] \captionsetup{font=footnotesize,labelfont=bf} \centering \caption{Command injection success rates observed during the drone experiments.} \includegraphics[scale=0.35]{figs/drone_results.pdf} \label{tab:drone_results} \end{table} (Drone Attack) Table~\ref{tab:drone_results} depicts the results for each drone-based scenario tested. Firstly, we found that using a drone with an operating loudness of 85 dB (S167) required command audio be played at 90+ dB. Specifically, at 90 dB we observed command injection success only up to 50\%. However, increasing the command audio to 95 dB allowed us to observe attack success up to 100\%. Since the operating loudness of the S167 was equal to the volume of audio used in our original experiments, the command audio in the presence of the drone had to be increase by at least 5 dB to overcome the added noise and achieve an SNR closer to 1.0 for successful command injection. For our remaining experiments using the HS700 drone with a much lower operating loudness level, we observed high rates of command injection success, similar to what was observed in prior experiments when no drone was used. Because the operating loudness of the HS700 is only 73 dB, the 85 dB command audio level was not hindered by the added noise because it maintained a similarly high SNR. When targeting the Echo Dot, we observed attack success up to 100\%. And when targeting the Google Home we observed attack success up to 90\%. \noindent \textbf{Across-Door Attack:} In the across-door attack we observed wake word and command injection success rates at both the 75 dB and 85 dB SPL levels for most of the distances tested. Compared to other barriers, the results confirm that the door is easiest to compromise. (Amazon Echo Dot 2) For the live speaker samples, we observed wake word injection success at the 75 dB for the 0.1-meter distance only, achieving an average of 60\% injection success. At all other distances there was no wake word injection success at 75 dB. When the audio was raised to 85 dB, we observed a greater range of success across the different distances tested. On average, the live speaker samples achieved 97\%, 80\%, 62\%, and 12\% wake word injection success for the 0.1, 0.5, 1, and 2-meter distances, respectively. In comparison, the TTS samples showed greater success for both SPL levels and all distances. At 75 dB, the TTS samples achieved average wake word injection success rates of 55\%, 37\%, 30\%, and 17\% for the 0.1, 0.5, 1, and 2-meter distances, respectively. And at 85 dB, we observe wake word injection success rates of 100\% for 0.1 and 0.5 meters, and 88\%, 80\%, and 50\% for 1, 2, and 4-meter distances. Looking at the results for command injection we again find decreased success rates compared to the wake word. For the live speaker samples we did not observe any command injection success at the 75 dB SPL level. At 85 dB, we observe average success rates of 85\%, 38\%, 23\% and 3\% for the 0.1, 0.5, 1, and 2-meter distances, respectively. Like the wake word results, we found that the TTS samples performed better for command injection. At 75 dB we observed average command injection success rates of 25\%, 20\%, and 3\% for the 0.1, 0.5, and 1-meter distances, respectively. And when the audio was raised to 85 dB, we observed average success rates of 87\%, 85\%, 75\%, 68\%, and 28\% for the 0.1, 0.5, 1, 2, and 4-meter distances, respectively. While multiple speaker samples showed very high success rates at certain SPL levels and distances, there are two samples that outperformed the rest. \textbf{\textit{By choosing TTS-M1 the attack can achieve 100\% success at both SPL levels up to 2 meter distances, and achieves 90\% success at the 4-meter distance. And choosing TTS-M1 or TTS-M2 for command injection allows the attack to achieve up to 100\% success rates at the 75 dB SPL level of distances up to 0.5 meters. When the SPL level is increased to 85 dB, the attack can achieve 100\% success for distances up to 2 meters, and 80\% success at 4 meters when launching the attack against the Amazon Echo Dot.}} (Google Home mini) We observed greater wake word injection success with the Google Home mini. For both 75 dB and 85 dB levels we see instances of wake word injection success at all distances that were tested. At 75 dB, the live speaker samples achieved average injection success rates of 85\%, 52\%, 53\%, 13\%, and 8\% for the 0.1, 0.5, 1, 2, and 4-meter distances, respectively. The TTS samples showed similar success rates of 67\%, 53\%, 30\%, 33\%, and 3\% for the 0.1, 0.5, 1, 2, and 4-meter distances, respectively. When the audio was increased to 85 dB, the average success rates increased. The live speaker samples achieved 100\% success for the 0.1, 0.5, and 1-meter distances, and achieved 78\% and 53\% for the 2 and 4-meter distances, respectively. The TTS samples achieved 100\% success for the 0.1 and 0.5-meter distances, and 98\%, 83\%, and 42\% success at 1, 2, and 4-meter distances. For command injection, we observed a decrease in the average success rates for both speaker types. However, instances of success were still observed for both the 75 dB and 85 dB SPL levels for distances up to 2 meters. At 75 dB, the average command injection success rates for the live speaker samples were 18\%, 17\%, 15\%, and 10\% for the 0.1, 0.5, 1, and 2-meter distances. The TTS samples had less success at the larger distances and only achieved accuracies of 35\% and 7\% for the 0.1 and 0.5-meter distances. When the audio was played at 85 dB, both speaker types showed command injection success at all distances. The live speaker samples achieved average success rates of 65\%, 23\%, 22\%, 17\%, and 13\% for the 0.1, 0.5, 1, 2, and 4-meter distances, respectively. The TTS samples outperformed the live speaker samples at the shorter distances achieving success rates of 95\%, 52\%, 37\%, 10\%, and 8\% for the 0.1, 0.5, 1, 2, and 4-meter distances, respectively. \textbf{\textit{Choosing LS-M1, LS-M2, TTS-F1, or TTS-F3 will allow the attack to achieve 100\% success for wake word injection at both SPL levels up to 2-meter distances. At the 4-meter distance the attack can achieve 50\% and 100\% accuracy at the 75 and 85 dB levels, respectively. And isolating LS-M2 for command injection allows the attack to achieve up to 100\% success for both SPL levels up to 0.5 meters. At the 75 dB SPL level the attack can achieve 90\% and 60\% success for the 1 and 2-meter distances, respectively. And when the SPL level is raised to 85 dB the attack can achieve 100\% success at distances up to 2 meters and 80\% success at 4 meters when attacking the Google Home.}} \subsection{Targeted BarrierBypass} \noindent \textbf{Replay Attack:} To investigate the potential for BarrierBypass to launch a replay attack across physical barriers, we performed a set of experiments using three speaker samples in the across-door attack setup. Specifically, we trained a voice profile for the LS-M1 speaker on both the Amazon Echo Dot 2 and Google Home mini. We recorded samples of the command "Alexa/Hey Google, what's my name?" from the live speakers LS-M1 and LS-M2, as well as a generated samples of the command using the text-to-speech speaker TTS-M1. We selected these speakers because they all achieved 100\% wake word and command recognition in the across-door attack. Playing each command audio at 85 dB we recorded the number of times out of 10 attempts that the voice assistant identified the trained speaker's voice. We found that the Amazon Echo Dot 2 was 100\% accurate at identifying the trained speaker and denying the other speakers. For the Google Home mini we observed the device was 80\% accurate at identifying the trained speaker, and 100\% accurate at not identifying the untrained speakers. These experiments demonstrated that 1) speaker recognition can identify a valid user without a barrier present, 2) it will still accept a command from a random speaker (e.g., from attacker) across a barrier, and 3) it can identify a replayed voice of the valid user across a barrier. \noindent \textbf{Synthesis Attack:} Synthesis attacks generate fake speech using a model trained on an original voice such that the synthesized voice matches the original. We performed another side investigation to observe the potential for successful synthesis attacks through physical barriers. We used the voice synthesis model SV2TTS~\cite{jemine2021RealTVC} from \cite{jia2018TransferLF} to generate the "Alexa/Hey Google, what's my name?" command in a live speakers voice. That same live speaker trained voice profiles on Amazon Echo Dot 1 and Google Home smart speakers. In the across-door attack setup, we played the synthesized command at 85 dB and recorded the number of times out of 10 attempts that the voice assistants identified the synthesized audio as coming from the legitimate user. We found that the synthesized commands were 100\% successful at fooling the speaker recognition function on both of the smart speakers. This further broadens the threat level and devastating potential of the BarrierBypass attack because it demonstrates that fake commands synthesized in a user's voice are sufficient enough to fool speaker recognition, even across physical barriers. \section{Summary and Discussion} \label{sec:summary} \noindent \textbf{Amazon vs. Google Observations:} We observed some interesting trends between the two smart speaker devices that were used. Since Amazon and Google have their own speech processing services, it is reasonable to assume that different types of speaker samples will show different levels of success. If we consider the average wake word injection rates for both speaker types against the Amazon Echo Dot 2, we find that the TTS samples outperformed the live speaker recorded samples in all but one of the scenarios (Across-Door, 0.1 meters, 75 dB). Similarly, we find that the TTS samples outperformed the live speaker samples for command injection in all scenarios. This indicates that TTS samples are more effective for launching the BarrierBypass attack against Amazon devices. Another interesting observation that became apparent when comparing the injection success rates was that wake word injection was consistently more successful when attacking the Google Home mini device. By averaging the success rate of all speaker samples for each scenario, we find that there was more success at injecting the wake word to the Google device than the Amazon device across all scenarios that were tested. We also observed through our experiments that the Google device had significantly more instances of mis-recognized commands compared to the Amazon device. At lower SPL levels or larger distances where the Amazon device would simply disregard the audio that it heard, the Google device would make some attempt at recognition and provide some type of response, although often incorrect. Lastly, our work demonstrates the feasibility of BarrierBypass when launched in scenarios without environmental noise. Naturally, this would be the most ideal setting to launch the attack and ensure no other audio in the environment interferes with the injection of the command. However, we believe that some environmental noise may be manageable and still allow for a successful attack. With the inbuilt noise cancellation capabilities of modern day VA devices, any environmental noise that is quieter than the injected command audio (after it passes through the barrier) will likely be filtered out by the device and the command will still be recognized. \noindent \textbf{Sound Rating Values:} We compare our observed results to the known Sound Transmission Class (STC) and Noise Reduction Coefficient (NRC) values for each of the barriers that we tested. We chose these rating values because they are both based on ASTM standards. If we consider the STC values for each of the barriers, we can see that our results are inline with the known values (33 for across-window, 30/34 for across-wall, and 20 for across-door). Now if we look at the NRC values for the different barrier materials, we find that both glass and gypsum board (i.e., drywall) have NRC values of 0.05 and wood has an NRC value of 0.10-0.15. All of these values are very low on the [0,1] scale indicating that none of the materials reflect much of the command audio back. \noindent \textbf{Drone-based Attack:} Our drone experiments clearly demonstrate the feasibility of launching the BarrierBypass with drones. Specifically, an attacker could utilize a drone with a low operating loudness that does not impact the required SPL of the command audio to be injected. And by selecting the best performing command audio samples they may achieve up to 100\% command injection success. This method of launching the attack provides an attacker the benefits of remote command injection and the ability to target multiple (potential) victim devices in the same area without having to physically relocate or move their attack setup. Additionally, an attacker could utilize the Wi-Peep~\cite{hurley2022} exploit to initially locate the location of the target device before launching the attack. \noindent \textbf{Improving Attack Robustness:} From our experimental and analysis results we have deduced a few ways to increase the robustness of the BarrierBypass attack. First, while our results at 85 dB demonstrate the feasibility of the attack, using even louder command audio will increase the chances of attack success. An attacker can launch the BarrierBypass attack while the person is away from the home or they are in a situation where the loud audio will not cause detection. Higher volumes outside should not cause a problem, especially in scenarios with high rise buildings. An attacker could also plant a small wireless speaker onto a door or window that they could use to inject a command remotely. These devices can be very small and cheap~\cite{mpspeaker}, allowing the attacker to remain discrete. Learning the type of voice assistant device that the user has before launching the attack would also help improve the chances of success. Our results demonstrate that different speaker types can have different levels of effectiveness for different devices. As a general observation, using TTS speaker samples would likely be the most effective for the BarrierBypass attack. Our analysis revealed that samples with stronger frequencies in the upper range are the most successful, so specifically choosing TTS samples that contain these qualities will improve attack success. \noindent \textbf{Limitations:} The results that we observed for the BarrierBypass attack are somewhat limited to the particular settings that we controlled in our experiments. Firstly, all of our experiments were conducted in quiet spaces where the only audio present was played from the loudspeaker device for the purposes of the attack. In a real-world scenario it is likely that there are other sources of noise in the environment which would affect the overall success of this attack. Second, since our attack uses plain, audible commands for the injection, the BarrierBypass attack is dependent on the user being away from the device and in another area. Otherwise they would easily recognize the command injection attempt. Lastly, as our results demonstrated, there is a distance requirement between the victim's device and the barrier (in the across-wall and across-window scenarios) for the attack to be successful at the SPL levels we tested. While louder command audio would surely increase the attack range, it also increases the chance of discovery. Therefore, the BarrierBypass attack is limited to scenarios where the victim's device is in close proximity to the barrier being targeted. \noindent \textbf{Potential Defenses:} The potential defenses against the BarrierBypass attack are largely based on hindering the physical phenomenon that would allow command audio to bypass physical barriers. One potential defense against our attack would be to use materials with higher STC and NRC values. To defend against the attack presented in this work, an STC of 50 or higher would be required. This can be achieved using concrete masonry walls, doubling the layers of drywall, or using specialized materials such as sound deadening paint or noise blocking curtains. Another potential defense is placing the smart speaker device at the furthest location from any accessible barriers. We demonstrate that distances of 4 meters become difficult for the attack even for an interior door. Another solution is to build a machine learning classifier that can differentiate between audio played through a barrier and audio played normally. As our analysis demonstrated, there are certain frequencies that are affected/blocked by the different barrier types. Blue et al.~\cite{blue_hello} achieve this effect by identifying sub-bass over-excitation which is a characteristic of audio played from loudspeaker devices and is not present in human speech. This would also be effective against BarrierBypass because as the command audio passes through the physical barrier, the bass/sub-bass components of the audio will become stronger. Another solution presented by Blue et al.~\cite{blue_2MA} could also be effective at identifying the BarrierBypass attack. In their 2MA work, the authors present a two microphone authentication solution that provides source localization by determining the direction of arrival. This approach, combined with a predetermined knowledge of the VA devices placement, could be used to identify when a command is coming from the other side of a barrier.
\section{Introduction} As people's personal and professional lives increasingly depend on the Internet, the threat of network surveillance has become particularly salient. To combat this threat, many users utilize privacy-enhancing tools such as Tor to protect themselves. Accordingly, Tor has surged in popularity, recording millions of users each day \cite{metrics, measurement}. Tor operates by encrypting traffic and routing it through a series of volunteer-run relays, ensuring that no single entity can observe both entry and exit traffic \cite{Dingledine2004}. The encryption strategy, known as onion routing, is characterized by messages encapsulated by multiple layers of encryption. Each successive Tor relay then strips a layer of encryption from the message and forwards it to the revealed destination \cite{onions}. While data sent through Tor may be secure, the frequency and timing of the associated network traffic may be used by traffic analysis techniques. These techniques include website fingerprinting \cite{Herrmann2009, Panchenko2011, Wang2013, Cai2014, Wang2014a, Hayes2015, Abe2016, Wang2016, Panchenko2017, Rimmer2018, Sirinam2018, Rahman2019, Bhat2019, triplet, Oh2019} and end-to-end flow correlation \cite{Raymond2001, Levine2004, ye2005, schmatikov2006, raptor, deepcorr, dcf}, which have been thoroughly discussed in past literature. Researchers have demonstrated that both can be carried out effectively. In a website fingerprinting (WF) attack, an adversary between the user and the first Tor relay records the timing and volume information of the Tor traffic and determines which website the user is visiting. Because this attack requires only a passive, local adversary, it is particularly threatening to user privacy. Alternatively, in the flow correlation (FC) attack setting, the adversary records traffic metadata as it both enters and exits the Tor network. Then, the adversary attempts to correlate associated entry and exit flows to determine both the origin and destination of the traffic. This attack is explicitly mentioned in early literature; however, security against end-to-end attacks is difficult for low-latency anonymity networks and an explicit non-goal of the original Tor design \cite{Dingledine2004}. A variety of traffic analysis defenses have been proposed to prevent website fingerprinting and flow correlation \cite{Wright2009, Luo2011, Cai2012, Cai2014, Juarez2015, Wang2017, Gong2020, banp, holland2022, machines, surakav}. These defenses typically operate by either delaying traffic or by padding with `dummy' traffic, obfuscating the relationship between the defended traffic and the associated website or exit flow. However, many defenses require either additional infrastructure or a prohibitive amount of latency or bandwidth overhead. While padding-only defenses may still incur some delay when widely deployed on Tor, as shown in past work \cite{paddingonly}, we avoid explicitly delaying packets, as excessively increasing Tor latency is discouraged by Tor developers \cite{padding}. Accordingly, we aim to design an effective website fingerprinting and flow correlation defense that uses \textit{only} dummy traffic. The most recent and effective website fingerprinting and flow correlation attacks use deep neural networks (DNNs) to classify and link Tor traffic. DNNs are vulnerable to adversarial examples \cite{dnn}, which are intentionally crafted inputs that `trick' a DNN into misclassifying that input. As a result, it may appear that adversarial techniques could be used to design a traffic analysis defense. However, adapting adversarial techniques for traffic analysis is not as straightforward as it may initially appear. First, the defense must operate while the traffic is being sent and without knowledge of future traffic, while the attacker can collect the relevant data for later analysis. Second, the attacker will likely have access to the defense and can re-train the attack on a representative `defended' dataset. In other words, the attacker model is not a static model targetable by adversarial perturbations; instead, it can adapt and retrain based on Tor's choice of traffic analysis defense. Thus, the defense must act in an unpredictable manner that resists adversarial retraining. Previous work on using adversarial methods for traffic analysis defense has achieved a degree of success \cite{surakav, Rahman2021, banp}. However, these defenses either require knowledge of future traffic, struggle to prevent adversarial retraining, or delay traffic. Finally, the defense needs to be attack model-agnostic. For example, a defense model tailored to resist DNN-based attacks may not remain robust against alternate approaches, such as those that use support vector machines. To overcome these challenges, we present a novel approach, called DeTorrent, to generate traffic padding strategies that defend Tor traffic. Inspired by generative adversarial networks (GANs) \cite{gan}, the core of the defense consists of a pair of competing neural networks that aim to either disguise or identify Tor traffic. More specifically, the `generator' takes random noise as input and then schedules when and how many dummy packets should be sent. Then, the `discriminator' (or attacker) attempts to demonstrate that it can accurately identify the defended Tor traffic. Because the generator's loss function is minimized when preventing the attacker from being able to identify the traffic, it is incentivized to generate effective padding strategies. Most importantly, those strategies are designed for resistance to adversarial retraining, as the generator and discriminator are trained in tandem. Furthermore, to simulate the generator's real-time decision-making, we implement the generator as a long short-term memory (LSTM) neural network \cite{lstm}. An LSTM is a type of recurrent neural network (RNN) that can be used to make repeated decisions while maintaining a state to store historical information. In the defense, the LSTM outputs how many dummy packets should be sent at each time step. Because the LSTM has feedback connections, it can generate this padding pattern while considering the previously monitored traffic. Once the generator is trained, it can be used to make effective real-time dummy padding insertion strategies. To test the effectiveness of the DeTorrent defense, we evaluate its ability to reduce the accuracy of state-of-the-art website fingerprinting and flow correlation attacks. We find that it outperforms comparable defenses in both types of attacks while using similar bandwidth overhead. To illustrate, DeTorrent reduced closed-world Tik-Tok attack accuracy from 93.4\% to 32.9\%, which is 9.5\% better than the next best defense. Additionally, DeTorrent reduces DeepCoFFEA's true positive rate to .30 for a $10^{-4}$ false positive rate, which is less than half of FRONT's TPR at .63. It does this while adding a bandwidth overhead of 98.9\% in the WF setting and 97.3\% in the FC setting. To make our approach deployable, we provide a full implementation of the DeTorrent defense as a Tor pluggable transport and evaluate its performance against Tor live traffic. We further show the transferability of DeTorrent's padding strategies by training on one dataset partition and testing on another, leading to a minimal drop in performance of only .7\%. Overall, DeTorrent demonstrates that a reasonable degree of traffic analysis defense can be achieved while only adding dummy traffic. \section{Background and Related Work} \subsection{Website Fingerprinting} \begin{figure} \centering \includegraphics[scale=.7]{tor_diagram.pdf} \caption{WF Attack on Tor} \label{fig:tor_wf} \end{figure} \begin{figure} \centering \includegraphics[scale=.6]{fc_diagram.pdf} \caption{FC Attack on Tor} \label{fig:tor_fc} \end{figure} \subsubsection{Threat Model} In the WF attack model, shown in figure \ref{fig:tor_wf}, we assume that the adversary is a \textit{passive} eavesdropper \textit{local} to the client. Accordingly, this adversary can observe traffic between the Tor client and entry node but does not modify that traffic. We also assume that this adversary knows the IP address of the user and is trying to determine which website the user is visiting. \subsubsection{Attacks} While data sent through Tor is encrypted, traffic metadata such as packet timing and direction may indicate the destination of a user's traffic. Hintz et al. were the first to demonstrate the risk of WF attacks using file transfer sizes to distinguish web pages \cite{Hintz2002}. Tor was initially thought to be WF-resistant due to its use of constant-sized cells and inherent network delays. However, researchers later began using packet volume and timing metadata to conduct the attack against Tor traffic \cite{Cai2012, Panchenko2011}. Later improvements came in the form of dataset collection and feature engineering \cite{Wang2013}, the use of more effective machine learning techniques such as k-nearest neighbors and random forests \cite{Wang2014a, Hayes2015}, and the use of the cumulative representation of the traces \cite{Panchenko2017}. More recent techniques leveraged deep neural networks to substantially increase WF attack performance \cite{Sirinam2018, Rahman2019, Oh2019, triplet}. Most importantly, Deep Fingerprinting by Sirinam et al. \cite{Sirinam2018} managed to defeat the WTF-PAD defense while pushing closed-world accuracy above 98\%. Then, Rahman et al. \cite{Rahman2019} added timing information to the Deep Fingerprinting architecture to develop the Tik-Tok attack, further increasing performance with especially strong results against the Walkie-Talkie defense \cite{Rahman2019}. Due to the success of the convolutional neural network architecture used by Deep Fingerprinting, we use it as the basis of DeTorrent's embedder and discriminator, with some modifications described in appendix \ref{ssec:architecture}. While some recent attacks focused on outside sources of information to reduce false positives \cite{oracle} or training WF attacks in more challenging and data-limited settings \cite{triplet, gandalf}, we use the Deep Fingerprinting and Tik-Tok attacks to benchmark our defenses as they represent versatile state-of-the-art attacks that have proven to be effective against WF defenses. \subsubsection{Defenses} WF defenses alter web traffic to reduce the attacker's ability to identify the website a user is vising. Some early defense designs, such as BuFLO and Tamaraw, operate by sending packets at a set rate and inserting dummy packets when no real data is available, making traffic associated with different websites look identical \cite{Dyer2012, Cai2014a, Cai2014}. However, these defenses incur prohibitively high latency and bandwidth overheads. Another defense, RegulaTor \cite{holland2022}, also aims to regularize traffic to prevent accurate classification. However, it operates with a more reasonable overhead by sending real traffic `surges' in standardized bursts, decreasing the amount of information leaked. Because these defenses delay traffic, they are not used for comparison in this paper. Other defenses operate by transforming traffic such that it appears to be associated with a different website or groups of websites, thus tricking the WF attacker. These techniques include Traffic Morphing \cite{Wright2009}, Decoy pages \cite{Panchenko2011}, Supersequence \cite{Wang2014a} and Glove \cite{Nithyanand2014}. Additionally, the Walkie-Talkie defense \cite{Wang2017} modifies the browser to operate in half-duplex mode while modifying burst sequences of upload and download traffic to match that of another website. However these defenses have either been broken by WF attacks or require additional infrastructure or information about traffic associated with other web pages; as a result, we do not evaluate them in this paper. Additional latency overhead is harmful to the user experience, so some defenses have taken the approach of avoiding traffic delays. WTF-PAD \cite{Juarez2015} uses adaptive padding and distributions of typical inter-packet delays to fill the large gaps in traffic that may leak information about the trace destination. FRONT \cite{Gong2020}, on the other hand, focuses dummy padding on the beginning of the trace while randomizing dummy packet volume and timing information. Additionally, the Spring and Interspace \cite{machines} defenses operate using the Tor circuit padding framework \cite{padding}, which defines state machines controlling when dummy traffic should be inserted. The state machines are designed using genetic algorithms with a fitness function based on the defense's ability to minimize the maximum recall of the Deep Fingerprinting attack. Because these defenses have reasonable overhead with no added latency, we directly compare them to DeTorrent. Some defenses use adversarial techniques to defend traffic. Mockingbird \cite{Rahman2021} generates adversarial traces that aim to reduce the attacker's adversarial retraining accuracy by randomly perturbing in the space of viable traces. While this approach appears promising, it cannot be implemented live, as it requires knowledge of future traffic. Nasr et al. \cite{banp} proposed a technique using blind adversarial perturbations (BAP) to defeat DNN-based traffic analysis. Essentially, the approach trained DNN adversarial traffic generators that aim to reduce the performance of WF and FC attacks. While it is quite effective against a WF or FC adversary using a static DNN model, we assume in this paper that the attacker will be able to retrain their models once traffic is defended; thus, BAP performance in this paper will likely appear lower than expected. Still, BAP's use of a DNN traffic perturbation generator was influential to DeTorrent's development. Surakav \cite{surakav} uses a Wasserstein GAN \cite{wasserstein} to generate traffic burst volumes for a trace, where a burst is defined as a series of packets going in the same direction. Then, Surakav shapes the real traffic bursts to match that of the generated traffic. While Surakav appears effective, it delays packets while shaping the bursts, so it is not included in our analysis. The TrafficSliver \cite{trafficsliver} and Multihoming \cite{multihoming} defenses split traffic among different guard nodes such that the individual sub-traces are difficult for a WF attacker to classify. Specifically, Multihoming users connect through different access points (such as Wifi and a cellular network) and merge the traffic at a multipath-compatible Tor bridge. Alternatively, TrafficSliver either splits traffic over multiple entry relays and merges traffic at the middle relay or creates multiple circuits and requests different HTTP objects over the circuits. While these defenses appear effective, they do not guard against all attacker types considered in this paper. For example, TrafficSliver does not defend against local attackers who can see outgoing traffic before it is split. Furthermore, Multihoming requires additional infrastructure to function. As a result, traffic-splitting defenses are not used for comparison in this paper. \subsection{Flow Correlation} Early discussion of security concerns in low-latency anonymity networks acknowledged the possibility of timing analysis to correlate flows, determine if two mixes are on the same path, or simply confirm that two users are online at the same time \cite{Raymond2001, Wang2002, Levine2004, Dingledine2004, murdoch2005, overlier2006}. While initial attack formulations included techniques such as `packet counting' \cite{Raymond2001}, later approaches turned to statistical correlation metrics such as the cross-correlation between binned packet volumes \cite{schmatikov2006, Levine2004}, distance functions using mutual information and frequency analysis \cite{ye2005}, or Spearman's rank correlation coefficient \cite{raptor}. Defensive techniques proposed in response include defensive dropping \cite{Levine2004}, adaptive padding \cite{schmatikov2006}, and constant-rate sending \cite{Levine2004}. However, constant-rate sending is costly in terms of bandwidth and latency overhead, while defensive dropping has been proven ineffective \cite{schmatikov2006}. Still, we test the performance of an adaptive padding approach in the flow correlation setting later in this paper. Originally, end-to-end timing correlation was considered feasible for a `global' observer, but perhaps difficult for a more limited adversary \cite{Dingledine2004}. Then, later work introduced the concept of an autonomous system (AS) level adversary \cite{feamster2004}. While these adversaries have a much more limited view of the network, it is still quite possible for multiple nodes to be part of the same administrative domain, especially given that some autonomous systems carry much more traffic than others. This risk is then exacerbated by the existence of Internet exchange points (IXPs), which allow the exchange of traffic between autonomous systems, as well as the possibility of IXP coalitions \cite{johnson2013}. AS-level adversaries may also be able to increase their chances of intercepting traffic through active attacks, such as BGP hijacks and BGP interception \cite{raptor, Tan2016}. As a result, reducing the chance that an adversary is positioned to capture both entry and exit flows is a concern for Tor researchers and developers. In response, several research efforts try to address these problems by improving Tor guard and relay selection \cite{edman2009, Nithyanand2014, akhoondi2012, juen2014, sun2017, Armon2016}. A related threat model is the possibility of an adversary running multiple Tor relays with the expectation that eventually a targeted client will use a controlled relay as both the entry and exit. An adversary running a sizeable portion of the network could even increase their chances by preventing the creation of circuits that they're a part of, but cannot yet compromise \cite{Borisov07}. Currently, the Tor Project's response is to have users re-use entry guards for a set time period to reduce the cumulative risk of eventually choosing a compromised circuit \cite{rotation}. Even if an adversary can capture entry and exit flows, correlating them is nontrivial due to Tor's use of fixed-sized cells and varying circuit conditions that may alter flow characteristics. Furthermore, the base rate fallacy is of particular concern while carrying out a flow correlation attack due to the number of potential flow combinations: to deanonymize a set of $N$ entry and exit flows, $N^2$ possible combinations of flows must be evaluated. This is both computationally and practically difficult, as the number of false positive correlations will likely outnumber the number of true correlations unless the false positive rate is relatively low. However, these challenges have been overcome by recent work by Nasr et al. and Oh et al. with their DeepCorr and DeepCoFFEA attacks \cite{deepcorr, dcf}. DeepCorr first used a deep neural network to learn how Tor circuits transform traffic, correlating flows with a lower false positive rate while using far less data than previous attacks. DeepCoFFEA provides further improvements by training feature embedding networks to represent the entry and exit flows in low-dimensional space such that correlated flows are close to one another. DeepCoFFEA also further reduces the false positive rate by dividing flows into windows and voting across the windows where the window embeddings are similar. These attacks essentially demonstrate that flow correlation is quite feasible for attackers to effectively carry out given the ability to intercept entry and exit flows. Given that DeepCoFFEA is a state-of-the-art flow correlation attack, we use it in this paper to test the performance of various potential flow correlation defenses. \subsection{LSTMs} While RNNs can theoretically consider longer-term input dependencies in sequential data, they suffer from the ``vanishing gradient" problem, where back-propagated gradients tend to either zero or infinity. To address this, LSTMs add a set of ``gates," called the input, output, and forget gates, that regulate information across cell states. Consequently, the LSTM is better able to consider long-term dependencies, giving it a `long short-term memory.' LSTMs also support the use of irregularly-spaced time series of variable length, making them suitable for processing traffic traces. \section{DeTorrent Design} \subsection{Motivation} A major difficulty faced by website fingerprinting defenses is that the attacker likely has access to the defense and defended traffic. Consequently, they can retrain their models or improve their approach to undermine the defense more effectively. To defeat this adversarial training, the most effective defenses have utilized the padding strategies based on a high degree of randomness as demonstrated by FRONT \cite{Gong2020}, Surakav \cite{surakav}, and Mockingbird \cite{Rahman2021}. As a result, it may seem intuitive to use an approach similar to that of a Generative Adversarial Network (GAN) to generate the defended traces and make adversarial retraining less effective. In this setup, the generator is fed random noise as input and trained to maximize the discriminator's loss. This way, the generator learns to insert dummy traffic in a manner that minimizes the discriminator's ability to identify the underlying traffic. However, this approach yields three challenges: representing the trace in a manner that can be used by neural networks, training the generator to make decisions about scheduling dummy traffic, and providing a notion of how well the discriminator can identify the trace. Our approaches for the FC and WF settings vary somewhat, so we now refer to the website fingerprinting version of DeTorrent as WF-DeTorrent and the flow correlation version as FC-DeTorrent. Also, to ensure that DeTorrent is effective against any local adversaries, including the guard relay, we assume that padding will be added between the client and the middle relay. The middle relay will then drop the traffic so that it is not detected at the exit. \subsection{Trace Representation} Representing the trace as a tensor is difficult given that the representations must support being `added' to one another while serving as the output of one neural network and the input of another. This problem is further complicated by the fact that the LSTM generator must output the dummy padding pattern through a series of time steps rather than all at once. Also, because the generator's loss function is written in terms of minimizing the discriminator's performance, it must alter the traffic representation in a differentiable manner in order to use backpropagation to update its weights. In other words, we must be able to backpropagate through the discriminator's output and back to the generator's weights. This prevents us from representing the traffic as a series of packet directions or timestamps, as shown in existing WF attacks such as Deep Fingerprinting \cite{Sirinam2018}. We find the best approach to account for these difficulties is to bin the packets of the trace such that the value of each bin is the volume of download packets sent during a designated time period. This way, the traces can be `defended' by simply adding the tensors together, with addition being a differentiable operation. This representation only considers download packets because the upload traffic is generally both smaller in volume and distributed similarly compared to the download traffic, as discussed in past work \cite{holland2022}. Thus, the upload padding is handled separately and based on observed download traffic, as discussed in Section \ref{ssec:packet_timing}. To reflect the fact that a majority of traffic is sent soon after a webpage is loaded, the bins are spaced evenly on a log scale, allowing for more fine-grained distinction between early traffic. While this representation does lose some information regarding the exact timing of packets and the relative positions of the upload packets, this appears to be minimal compared to the amount of information leaked by the overall distribution and volume of traffic. We test this by running a closed-world WF classification attack on the DF dataset using only the binned representations and find that accuracy remains high at over 90\%. This is further suggested by the success of WF attack CUMUL \cite{Panchenko2017}, which uses the cumulative distribution traces, and the relative success of WF defenses that primarily alter the volume and distribution of traffic (such as FRONT, RegulaTor, and Surakav) \cite{Gong2020, holland2022, surakav}. DeTorrent also obfuscates some of the remaining directional information by sending upload dummy traffic to maintain a consistent download-upload ratio. To preprocess the data, we first shift the traffic so that the binning starts with the 10th packet. This is because the time for the website to begin loading after the first packet is sent is quite variable and likely based on the choice of circuit. However, we can prevent this variability from impacting the trace representations by `subtracting out' the time it takes for the circuit to be constructed and for the web page to begin loading. When DeTorrent is applied to real traffic, it sends additional dummy traffic with inter-packet delays drawn from an exponential distribution with a mean delay of one-tenth of a second. This obfuscates the circuit setup and initial communication with the website while allowing the real traffic to be sent without delay. \subsection{Trace Embedding} A naive implementation of WF-DeTorrent would create loss functions based on the discriminator's ability to classify traces (or correlate flows) and the generator's ability to increase the discriminator's loss. However, this style of training does not lead to an effective defense in the WF setting. This is because the generator is incentivized to defend the traffic in a manner that does not resist retraining, as it is easy to move the trace representation just across the WF discriminator's decision boundary and cause it to misclassify. However, the discriminator can simply retrain to account for the generator's minor perturbations. To provide a better metric for discriminator and generator performance in the WF setting, we chose an approach used by DeepCoFFEA \cite{dcf} and trained an embedder to map traces to a low-dimensional space where trace similarity is measured using Euclidean distance. To train the embedder to provide a useful notion of distance between traces, we use triplet loss, which compares an `anchor' (A) input of a given class to both a `positive' (P) input of the same class and a `negative' (N) input from another class. Triplet loss is minimized when the distance between the anchor and positive embeddings is at least $\alpha$ smaller than the distance between the anchor and negative embeddings, where $\alpha$ is a set slack value. \[\mathcal{L}(A,P,N) = max(||f(A) - f(P)||^2 - ||f(A) - f(N)||^2 + \alpha, 0) \] Once the embedder is trained, the discriminator guesses the embedding of the original traffic while the generator defends the traffic to prevent the discriminator from making accurate guesses. By making accurate guesses, the discriminator indicates that it has enough information to identify the traffic. We find an embedding dimension of 256 works best, though the results are not sensitive to the choice of dimensionality. In the flow correlation setting, the discriminator identifies whether the flow pairs are matched or not. Because this is a binary classification, the problem of short-sighted optimization does not occur, so embedding is not needed. \subsection{Real-time Decisions} While a WF or FC defense could pre-generate padding strategies, it would likely underperform compared to a similar defense that takes into account traffic already sent or received during page load. For example, a real-time defense might decide to extend packet bursts or add fake traffic to traces with low packet volume. Similarly, the generator cannot take the entire trace as input, as the real-world implementation lacks knowledge of traffic that has not yet been sent. To train a generator to make these types of decisions, we implement it as an LSTM where each bin in the trace representation is matched to a time step of the LSTM. This way, the LSTM can take random noise and the number of real packets in the associated bin at each time step, then output the number of dummy packets that should be sent at the \textit{next} time step. This process is shown in Figure \ref{fig:lstm_unrolled}. \begin{figure} \centering \includegraphics[scale=.62]{lstm.pdf} \caption{Unrolled LSTM generator} \label{fig:lstm_unrolled} \end{figure} \subsection{Packet Timing} \label{ssec:packet_timing} \subsubsection{Download padding} While the generator output specifies how many dummy packets to send in each interval, DeTorrent must still specify the exact timing. In both the website fingerprinting and flow correlation settings, the defense emphasizes that bursts of traffic must look realistic such that they are indistinguishable from real traffic. Web browsing traffic is especially burst-heavy with occasional long gaps between bursts, so we choose inter-packet delays from the exponential distribution, as done in some previous works \cite{compressive, watermarking}. The rate, $\lambda$, of the distribution is chosen such that the dummy traffic will on average fill the set bin (e.g. $\lambda$ is set such that the average inter-packet delay will be 1/10th of a second given 10 dummy packets and a bin length of one second). The beginning of the burst is randomly offset within the bin to prevent an attacker from identifying dummy traffic based on bin timing. \subsubsection{Upload padding} As mentioned earlier, Tor upload traffic tends to be distributed similarly in terms of when traffic bursts are sent, but at much lower volumes. As a result, DeTorrent's strategy is to simply add dummy traffic to maintain a set average of download-upload traffic. This achieves two goals: obfuscating much of the upload traffic and preventing the specific interleaving of the upload and download packets from leaking as much information. In fact, past work on Tor information leakage has demonstrated the importance of the upload traffic and interval features in website fingerprinting attacks \cite{Li2018}, further reinforcing the importance of regularizing the relationship between upload and download traffic. To be specific, DeTorrent sends dummy upload packets such that there is, on average, one upload packet for every five download packets. We chose this parameter because the download-upload packet ratio is almost always larger than the datasets used in the paper. This allows for DeTorrent to make nearly all the defended traces have the same download-packet ratio while simply adding upload traffic. To determine how many upload packets need to be added to achieve a given download-upload ratio, we must be able to create frequently updated estimates of the rate at which packets are sent or received. However, this is challenging due to the irregularity of internet traffic and the need for the method to be computationally inexpensive. As a result, we implement a traffic volume estimator that weights recently sent traffic more heavily, making the estimate highly responsive to traffic bursts. Our approach also allows for the volume estimate to decay over time when no real traffic is sent. For a more in-depth explanation of our method of estimating traffic rate, see the appendix section \ref{ssec:timing_details}. Using the frequently updated estimates, DeTorrent sends an upload packet whenever the rate of upload traffic falls below one-fifth of the rate of the download traffic. If the upload traffic rate is larger than one-fifth of the download traffic rate, then no dummy traffic is sent. \section{DeTorrent Training} \begin{figure*} \centering \includegraphics[scale=.75]{wf_training.pdf} \caption{WF-DeTorrent Training} \label{fig:wf_training} \end{figure*} \begin{figure*} \centering \includegraphics[scale=.75]{fc_training.pdf} \caption{FC-DeTorrent Training} \label{fig:fc_training} \end{figure*} \subsection{WF-DeTorrent Training} In the WF setting, the discriminator and embedder are both initialized as convolutional neural networks that take a trace representation as input and output an embedding. The training process, described in algorithm \ref{alg:wf_alg} and illustrated in figure \ref{fig:wf_training}, starts by training the embedder using the previously-described triplet loss method with Euclidean distance. Then, after a random trace is sampled, the generator is fed a tensor containing both random noise and the number of real packets sent at that time step. Next, the generator outputs the proportion of the padding budget, $N_{download}$, to be sent at that time step. Once the final dummy padding volumes are calculated, they are added to the original trace to create a defended trace. Using the defended trace as input, the discriminator outputs a prediction of the embedding of the \textit{original} trace, indicating that it can accurately identify it. The discriminator's loss is computed as the distance between its prediction and the true embedding of the original trace. So, given original trace $x$ and noise $z$: \[ l_d(x, z) = -l_g(x, z) = || D(x + G(z || x)) - E(x)|| \] Note that the generator only uses the traffic volume information of the current bin at each time step, and that `+' indicates a bin-wise addition of the traces. Also, we can use the $N_{download}$ value to tune the amount of overhead DeTorrent uses. In the training loop, once the loss is computed and the discriminator's weights are updated, the noise is re-sampled and the same trace is defended again by the generator. This time the process is similar, but the generator's loss is computed as the negative of the discriminator's loss. \begin{algorithm} \caption{WF-DeTorrent Training} \begin{algorithmic} \STATE $E \leftarrow$ embedder model \STATE $G \leftarrow$ generator model \STATE $D \leftarrow$ discriminator model \STATE $D_{train} \leftarrow$ training data \STATE $\mathcal{L}_e \leftarrow$ embedder loss \STATE $\mathcal{L}_g \leftarrow$ generator loss \STATE $\mathcal{L}_d \leftarrow$ discriminator loss \STATE $N_e \leftarrow$ number of epochs to train embedder \STATE $N_{adv} \leftarrow$ number of epochs to train generator and discriminator \STATE $m \leftarrow$ size of generator input vector \STATE \FORALL{epoch in $N_e$} \FORALL{batch $b_i$ in $D_{train}$} \STATE sample anchors, positives from selected classes \STATE sample anchors, negatives from different classes \STATE anchor\_emb $\leftarrow E($anchor$)$ \STATE positive\_emb $\leftarrow E($positive$)$ \STATE negative\_emb $\leftarrow E($negative$)$ \STATE $\mathcal{L}_e \leftarrow \frac{1}{|b_i|}\sum_{A,P,N \in b_i} max(||E(A) - E(P) ||^2 - ||E(A) - E(N)||^2 + \alpha, 0)$ \STATE Update $E(x)$ weights to minimize $\mathcal{L}_e$ \ENDFOR \ENDFOR \STATE \FORALL{epoch in $N_{adv}$} \FORALL{batch $b_i$ in $D_{train}$} \STATE sample trace from $D_{train}$ \STATE sample noise $z_i,...,z_{m-1}$ from $\mathcal{N}(0,1)$ \STATE $\mathcal{L}_d = \frac{1}{|b_i|} \sum_{x \in b_i} || D(x + G(z_i,...,z_{m-1} || x)) - E(x)||$ \STATE Update $D$ to minimize $\mathcal{L}_d$ \STATE \STATE sample noise $z_i,...,z_{m-1}$ from $\mathcal{N}(0,1)$ \STATE $\mathcal{L}_g \leftarrow -\frac{1}{|b_i|} \sum_{x \in b_i} || D(x + G(z_i,...,z_{m-1} || x)) - E(x)||$ \STATE Update $G$ to minimize $\mathcal{L}_g$ \ENDFOR \ENDFOR \end{algorithmic} \label{alg:wf_alg} \end{algorithm} \subsection{FC-DeTorrent Training} The setup for FC-DeTorrent is similar in the sense that it consists of an LSTM generator `defending' traffic, which is then used as input to a CNN discriminator, as shown in figure \ref{fig:fc_training}. However, here there is no embedder, as the generator directly minimizes the discriminator's ability to determine whether a given pair of flows is matched. As described in algorithm \ref{alg:fc_alg}, the training process starts by sampling entry and exit pairs. For each pair, there is a 50\% likelihood they will be matched, as they may represent the entry and exit flows for the same traffic. Otherwise, they are unmatched. Then noise is sampled randomly and fed into the generator along with the number of real packets at each time step for the \textit{entry} flow. Once the generator has output the proportion of the dummy download traffic to send at each time step and multiplied it by $N_{download}$, it is added to the original entry flow traffic. This traffic is used as input to the discriminator, which tries to predict whether the defended entry and original exit are matched. Note that the entry is defended because dummy traffic can be sent between the client and a relay in the Tor network; however, this cannot be done between Tor and the target website. After making a batch of predictions, the discriminator's binary cross entropy loss is computed and its weights are updated to minimize the loss. For entry flow e, exit flow x, and noise $z$ : \[ l_d(e, x, z) = y \log D(e + G(z||e), x) + (1-y)\log(1-D(e + G(z||e), x)) \] Next, the noise is re-sampled and the generator again outputs a padding defense which is added to the real traffic to create a defended trace. The discriminator then takes the defended trace and original exit and predicts if they are matched. This time, however, the weights of the generator are updated to maximize the discriminator's loss, thus incentivizing strategies that make it more difficult to correlate the matched entry and exit pairs. Like in the WF setting, the generator only has access to the current traffic volume at each step, and the generator's output is scaled to achieve a specific bandwidth overhead. \begin{algorithm} \caption{FC-DeTorrent Training} \begin{algorithmic} \STATE $G \leftarrow$ generator model \STATE $D \leftarrow$ discriminator model \STATE $D_{train} \leftarrow$ training data \STATE $\mathcal{L}_g \leftarrow$ generator loss \STATE $\mathcal{L}_d \leftarrow$ discriminator loss \STATE $N_{adv} \leftarrow$ number of epochs to train generator and discriminator \STATE $m \leftarrow$ size of generator input vector \STATE $bs \leftarrow$ batch size \STATE \FORALL{epoch in $N_{adv}$} \FORALL{batch $b_i$ in $D_{train}$} \STATE sample $entry, exit$ pairs (half matched) from $D_{train}$ \STATE sample noise $z_i,...,z_{m-1}$ from $\mathcal{N}(0,1)$ \STATE $\mathcal{L}_d = \frac{1}{bs} \sum_{entry, exit \in D_{train}} l_d(entry, exit, z_i,...,z_{m-1})$ \STATE Update $D$ to minimize $\mathcal{L}_d$ \STATE \STATE sample noise $z_i,...,z_{m-1}$ from $\mathcal{N}(0,1)$ \STATE $\mathcal{L}_g = \frac{1}{bs} \sum_{entry, exit \in D_{train}} l_d(entry, exit, z_i,...,z_{m-1})$ \STATE Update $G$ to minimize $\mathcal{L}_g$ \ENDFOR \ENDFOR \end{algorithmic} \label{alg:fc_alg} \end{algorithm} \section{Experiment Details} \subsection{Datasets} The BigEnough dataset, referred to here as `BE,' was collected for a Systemization of Knowledge paper on website fingerprinting defenses \cite{evaluation} by Matthews et al. The BE collection methodology was based on that of Pulls for the GoodEnough dataset \cite{machines}. The BE dataset contains three modes based on the Tor Browser security configurations: Standard, Safer, and Safest. However, in this paper we use only the default standard mode. Most importantly, the BE dataset considers 95 websites represented by 10 subpages which are each crawled 20 times, resulting in 19,000 traces. Including subpages increases the realism of the dataset compared to past datasets, which simplistically models traffic as always visiting the home page of a given website. The Open PageRank Initiative \cite{pagerank} top website list was used to select the most popular websites. The BigEnough dataset also includes Tor log information needed to properly simulate the Spring and Interspace defenses for comparison. We use the website fingerprinting dataset by Sirinam et. al, originally collected to demonstrate the Deep Fingerprinting attack \cite{Sirinam2018}, to evaluate defense performance against an attacker able to compile a large and robust dataset. The dataset was collected by visiting the home pages of the Alexa top 100 websites 1,250 times each using ten local machines. The crawl was done in batches to account for both long and short-term variance following the methodology described by Wang et al. \cite{Wang2013}. After filtering, we are left with a dataset with 1000 instances of 95 websites, which we refer to as `DF.' To test the flow correlation defense performance, we use the dataset collected by Oh et al., referred to here as `DCF,' to demonstrate the effectiveness of the DeepCoFFEA attack \cite{dcf}. Their dataset collection methodology was based on that of the DeepCorr technique by Nasr et al. \cite{deepcorr}, though with some changes. Specifically, they used a web crawler along with a physical machine to collect the entry flows and a proxy server to collect the exit flows. Over 60,000 Alexa websites were crawled in over 1,000 batches with the first 60 seconds of each flow being recorded. Oh et al. also collected packets at the Ethernet layer rather than at the IP layer to better represent the data that would be seen by an adversary. Additionally, the DCF dataset removes flows with less than 70 packets total or with a window packet count of less than 10. While the original dataset includes 42,489 flow pairs, we use 20,000 in our experiments. To evaluate the DeTorrent pluggable transport defense, we visit each website in the Alexa top 250 \cite{alexa} 100 times over two weeks in September 2022. To collect the dataset, we use two instances of Tor Browser Crawler \cite{crawler} running Tor Browser version 11.0.15 along with two bridges running Tor version 0.4.7.8. We refer to this dataset as `PT.' \subsection{WF Attack Details} \label{ssec:wf_details} We used open-source code associated with WTF-PAD \cite{wtfpadcode}, Interspace \cite{pullscode}, Spring \cite{pullscode}, FRONT \cite{frontcode}, and BAP \cite{bapcode} to generate the defended datasets for each defense. Then, to test the robustness of WF-DeTorrent and comparable defenses, we test the defense's ability to resist state-of-the-art attacks. For the website fingerprinting setting, we use the Tik-Tok and Deep Fingerprinting attacks. These attacks are based on the same CNN architecture, though Tik-Tok uses packet timing information, allowing it to achieve somewhat higher accuracy. We use the default parameters with the exception that we run the Tik-Tok and Deep Fingerprinting attacks for 100 epochs with a patience value of 10. This ensures that training does not stop early on the BE dataset, which is much smaller than the DF dataset and thus has much smaller epochs. We also increased the attack input size from 5,000 to 10,000 to account for the increased traffic volume observed in the BE, DCF, and PT datasets (compared to the DF dataset). To fairly compare WF-DeTorrent to defenses such as FRONT and WTF-PAD, we scale the bandwidth overhead to roughly match the overhead used by WF-DeTorrent. To scale FRONT, we simply increase the upload and download volume parameters $N_s$ and $N_c$. To scale WTF-PAD using the distributions released in the original paper, we scale the timestamps of the datasets, use the WTF-PAD simulator to insert the dummy padding, and then re-scale the timestamps to match the original trace lengths. This strategy is used in past literature \cite{machines} and is necessary due to the smaller inter-packet delays seen in more recently collected datasets. Also, note that the Spring and Interspace defenses are only simulated on the BigEnough dataset, as their simulator requires Tor logs that are not present in the DF dataset. To simulate BAP, we train the timing and direction perturbation attacks against Var-CNN as indicated by the source code shared by the authors. We also set the $\alpha$ parameter to tune the volume of the perturbations. The specific overheads and defense parameters are shown in table \ref{tab:df_overhead} and table \ref{tab:be_overhead}. The default Spring and Interspace defenses use a comparable amount of bandwidth overhead. Because the output of the circuit padding simulator \cite{pullscode} contains unrealistically precise timing information, we round the timestamps of the defended dataset to the nearest hundredth of a second. To simulate WF-DeTorrent on a dataset, we must take steps to prevent it from being able to defend traces that it witnesses during training: this might allow it to memorize effective defense strategies and perform unrealistically well. So, we partition each dataset $n$-ways, where $n-2$ partitions are used for training, one is used for validation, and the other is used to simulate WF-DeTorrent and output the defended traces. Then, we rotate which partitions are used for training, evaluation, and output so that each partition is a test set exactly once, creating the defended dataset. To make clear and comprehensible comparisons between the website fingerprinting defenses, we test them in the closed-world setting where the attacker simply needs to determine which website a trace is associated with. We also make assumptions about the adversary's ability. These include that the adversary can determine the beginning and end of the page load, that the user visits the home page of each website, and that the adversary can create a dataset that accurately represents the target's unique network conditions. These assumptions favor the attacker, so we expect real-world website fingerprinting to be at least as difficult as our results would indicate. Still, we find this setting to be useful in terms of comparing different WF defenses. \subsection{FC Attack Details} In the flow correlation setting, we use the DCF dataset and the DeepCoFFEA attack with default parameters to test the defenses. 10,000 flows from the dataset are used for training and 10,000 are used for testing. We train DeepCoFFEA for 1,500 epochs, as this tends to lead to the highest attack performance. To simulate BAP in the FC setting, we train it to generate perturbations using the DeepCorr attack provided in the open-source BAP implementation \cite{banp}. We also set the $\alpha$ parameter to determine the volume of the traffic perturbations. For FRONT, we set the $N_s$ and $N_c$ parameters to achieve a comparable level of bandwidth overhead. To set the WTF-PAD overhead, we scale the timestamps of the DCF dataset, use the normal\_rcv distributions as specified in the original paper, and then re-scale the timestamps to match the original. The specific parameter and bandwidth overhead value for the defenses are as shown in table \ref{tab:dcf_overhead}. We don't use the Spring or Interspace defenses in the FC setting, as they require Tor log information that the DCF dataset does not contain. To prevent WF-DeTorrent from having the unfair advantage of being able to train the generator and discriminator on the same dataset that it defends, we use the dataset partitioning method described in section \ref{ssec:wf_details}. \section{Website Fingerprinting Results} \begin{table*}[] \centering \begin{tabular}{p{2cm}||p{2cm}|p{7cm}} \hline Defenses & Bandwidth OH & Parameters\\ \hline WTF-PAD & 86.1\% & normal\_rcv, scaled 2x\\ FRONT & 90.2\% & $N_s = N_c = 1700, W_{min}=1, W_{max}=14$\\ BAP & 90.2\% & $\alpha=2000, \sigma=0, \mu=0$\\ WF-DeTorrent & 88.8\% & $N_{download}=1500$\\ \hline \end{tabular} \vspace{5pt} \captionsetup{justification=centering,margin=2cm} \caption{Defense Overheads and Parameters on DF} \label{tab:df_overhead} \end{table*} \begin{table*}[t] \centering \begin{tabular}{p{2cm}||p{2cm}|p{7cm}} \hline Defenses & Bandwidth OH & Parameters\\ \hline WTF-PAD & 86.8\% & normal\_rcv, scaled 6x\\ BAP & 94.4\% & $\alpha = 5000, \sigma=0, \mu=0$\\ Spring & 102.7\% & see \cite{machines}\\ Interspace & 96.7\% & see \cite{machines}\\ FRONT & 95.0\% & $N_s = N_c = 4000, W_{min}=1, W_{max}=14$\\ WF-DeTorrent & 98.9\% & $N_{download}=3000$\\ \hline \end{tabular} \vspace{5pt} \captionsetup{justification=centering,margin=2cm} \caption{Defense Overheads and Parameters on BE} \label{tab:be_overhead} \end{table*} \begin{table*}[t] \centering \begin{tabular}{p{2.5cm}||p{2cm}|p{2cm}} \hline Defenses & Tik-Tok & DF\\ \hline \hline Undefended & 97.7\% & 98.1\%\\ BAP & 94.4\% & 86.8\%\\ WTF-PAD & 92.1\% & 90.3\%\\ FRONT & 85.2\% & 79.7\%\\ WF-DeTorrent & 79.5\% & 74.5\%\\ \hline \end{tabular} \vspace{5pt} \captionsetup{justification=centering,margin=2cm} \caption{Closed-World Accuracy on DF} \label{tab:df_accuracy} \end{table*} \begin{table*}[t] \centering \begin{tabular}{p{2.5cm}||p{2cm}|p{2cm}} \hline Defenses & Tik-Tok & DF\\ \hline \hline Undefended & 93.4\% & 94.3\%\\ BAP & 92.4\% & 94.3\%\\ WTF-PAD & 62.4\% & 59.7\%\\ Spring & 51.4\% & 46.8\%\\ Interspace & 44.9\% & 38.1\%\\ FRONT & 42.4\% & 41.2\%\\ WF-DeTorrent & 32.9\% & 30.0\%\\ \hline \end{tabular} \vspace{5pt} \captionsetup{justification=centering,margin=2cm} \caption{Closed-World Accuracy on BE} \label{tab:be_accuracy} \end{table*} \begin{table*}[] \centering \begin{tabular}{p{2cm}||p{2cm}|p{7cm}} \hline Defenses & Bandwidth OH & Parameters\\ \hline WTF-PAD & 98.6\% & normal\_rcv, scaled 3.2x\\ BAP & 96.6\% & $\alpha = 4000, \sigma=0, \mu=0$\\ FRONT & 97.9\% & $N_s = N_c = 3400, W_{min}=1, W_{max}=14$\\ FC-DeTorrent & 97.3\% & $N_{download}=3200$\\ \hline \end{tabular} \vspace{5pt} \captionsetup{justification=centering,margin=2cm} \caption{Defense Overheads on DCF} \label{tab:dcf_overhead} \end{table*} \subsection{Simulated} Defense performance on the BE dataset is shown in table \ref{tab:be_accuracy}. On the BE dataset, we find that WF-DeTorrent reduces both the Tik-Tok and DF attacks to the lowest accuracy at 32.9\% and 30.0\% respectively. Because WF-DeTorrent is trained to `trick' the discriminator into outputting inaccurate embeddings of the target traffic by making traffic from different webpages indistinguishable, we believe it is able to effectively mask the differences between many of the subpages. Thus, the WF attacks are usually unable to uniquely identify a given subpage in the BE dataset. FRONT is the next-best performing defense with Tik-Tok and DF accuracies of 42.4\% and 41.2\%. FRONT likely performs well because the inherent randomness in the shape and volume of the dummy packet distribution makes training the WF attacks more difficult. This effect appears exacerbated by the fact that the BE dataset is relatively small and distributes the instances for each website across ten subpages; as a result, the convolutional neural network used by Tik-Tok and DF may struggle to generalize well enough to recognize the dummy traffic distribution. WTF-PAD provides a moderate amount of defense by masking the large inter-packet delays, which allow for the traces to be more easily identified. However, WTF-PAD does not focus on obfuscating the more general aspects of the traces, such as the total volume or distribution of traffic throughout the trace. Thus, many of the traces can still be correctly classified. The Spring defense outperforms WTF-PAD, showing that an `evolved' circuit padding defense can be somewhat effective. However, the Spring defense strategy is relatively consistent across traces, allowing for a DNN to effectively learn how to classify the defended traces. The Interspace defense, on the other hand, is `probabilistically defined,' in the sense that it is initialized with one of a set of possible padding strategies at the client and relay. Interspace also randomizes the parameters for the length and inter-arrival time distributions. As a result, Interspace is significantly more effective than its Spring counterpart BAP provides little defense against the Tik-Tok and DF attacks. This is likely because the BAP perturbation generator is trained to reduce the accuracy of a \textit{static} attacker that cannot retrain. In this setting, the WF attacks can retrain so that they are mostly unaffected by the BAP defense. Defense results on the DF dataset are shown in table \ref{tab:df_accuracy}. In terms of performance, the order of defenses is the same except that we are unable to evaluate Spring and Interspace, which require Tor logs to simulate. In general, the defenses did not reduce the accuracy nearly as much. However, this is likely due to the inherent difficulty of defending the DF dataset, which has 1000 instances for each class, allowing for the deep-learning based WF attacks to better train and generalize. The DF dataset also uses only the home pages of the websites, meaning there is less variety in the traces associated with a given class. This especially reduces the effectiveness of defenses that utilize randomized dummy packet distributions, such as DeTorrent and FRONT. We believe that this is because this makes it much less likely that the defended trace for one class will be `confused' with the trace of another class. \subsection{Real-world Implementation} \label{ssec:real_implementation} To demonstrate the practicality of the DeTorrent defense, we implement it as a pluggable transport \cite{pt}. Pluggable transports (PTs) transform traffic between the client and a Tor bridge \cite{bridge}, which is a Tor relay that is not publicly listed. PTs are frequently used for censorship circumvention due to their ability to obfuscate traffic characteristics. We implemented DeTorrent on top of the WFPadTools framework \cite{wfpadtools}, which extends the Obfsproxy PT \cite{obfsproxy} while adding functionality for common anti-traffic analysis strategies. Then, we crawl a set of popular websites through the pluggable transport to test current website fingerprinting defenses against the collected packet traces. To test the transferability of the defense, the DeTorrent download padding distribution is determined using a generator trained using the BE dataset and scaled to achieve a specific bandwidth overhead. As a result, the generator is not fine-tuned to current internet traffic. However, since DeTorrent's defense performance transfers well to different settings and sets of websites, we find that defense performance remains high, reducing Tik-Tok to a 21.5\% accuracy with an 88.8\% bandwidth overhead. \subsection{Overhead-performance Trade-off} In order to fully evaluate the relationship between DeTorrent's performance and bandwidth overhead, we tested its ability to defend traffic in the BE dataset against the Tik-Tok attack for a variety of download volume ($N_{download}$) parameter choices. We varied $N_{download}$ from 1000 to 7000 while keeping the upload traffic ratio constant, resulting in overhead that varied from about 40\% to about 210\%, as shown in figure \ref{fig:tradeoff}. Tik-Tok attack accuracy was 52.8\% for the lowest bandwidth setting and was reduced to 20.8\%. We also find that increasing DeTorrent's bandwidth budget initially improves its performance significantly, but is later subject to decreasing returns. To be specific, increasing $N_{download}$ from 1000 to 3000 decreases Tik-Tok performance by about 19.1\%, while increasing $N_{download}$ from 5000 to 7000 only further decreases it by 4.9\%. This is likely due to the difficulty of defending particularly unique and high-volume traces, as they are difficult to defend with a moderate overhead defense. \begin{figure} \centering \includegraphics[scale=.55]{tradeoff.pdf} \caption{DeTorrent Overhead vs. Performance} \label{fig:tradeoff} \end{figure} \section{Flow Correlation Results} \begin{figure}[!t] \centering \includegraphics[scale=.55]{detorrent_fc.pdf} \caption{Flow correlation defense performance against DeepCoFFEA. Note that lower TPR implies a better defense.} \label{fig:fc_performance} \end{figure} To ensure a fair comparison between the chosen defenses, we scale them to operate with comparable bandwidth overhead, as shown in table \ref{tab:dcf_overhead}. Also, one of the main challenges of the flow correlation setting is achieving a high enough true positive rate without allowing the number of false positives to outnumber the true positives. As a result, it is most sensible to evaluate flow correlation defenses by comparing their true positive and false positive rates at various DeepCoFFEA correlation thresholds; this is illustrated in figure \ref{fig:fc_performance}. In terms of reducing DeepCoFFEA's performance, FC-DeTorrent far outperforms the compared defenses, as shown in figure \ref{fig:fc_performance}. While other defenses allow a high true positive rate for associated false positive rates of as little as $10^{-3}$, FC-DeTorrent noticeably reduces DeepCoFFEA's true positive rate for all but the highest associated false positive rates. For a $10^{-4}$ false positive rate, FC-DeTorrent reduced DeepCoFFEA's true positive rate to .30, compared to about .63 for FRONT. For a $10^{-5}$ false positive rate, the true positive rates are about .13 for FC-DeTorrent, .34 for FRONT, and .42 for WTF-PAD. FC-DeTorrent performance is likely due to its ability to learn how to pad entry flows such that they are easily confused with non-associated entry flows, thus confusing the discriminator. Also, FC-DeTorrent's defense advantage over the alternate FC defenses is significantly larger than WF-DeTorrent's advantage in the WF setting: we believe that this is because FC-DeTorrent can directly train against the discriminator, while WF-DeTorrent must rely on the embedder to provide a rough estimate of discriminator performance. FRONT provides a reasonable degree of FC defense, likely because it's randomized and because it sends traffic according to the Rayleigh distribution, which mimics the distribution of real traffic. As a result, the defended entry traffic associated with a given exit flow is likely to look similar to other defended entry flows, making the association more difficult. However, FRONT's use of the Rayleigh distribution makes the padding somewhat predictable, as the amount of padding will always increase until it peaks and will then slowly taper off. As a result, DeepCoFFEA is able to learn how to effectively ignore much of the padding, assuming it has enough training data. WTF-PAD obfuscated some of the inter-packet delays that DeepCoFFEA uses to identify traffic; as a result, it provides some defense as well. Still, WTF-PAD does not consider the more coarse features of the traffic, such as the total traffic volume or the sizes of the largest traffic bursts. As a result, DeepCoFFEA is still able to correlate many of the flows defended by WTF-PAD. Because BAP was trained to provide adversarial perturbations against a static model, the DeepCoFFEA feature embedders can effectively retrain against the BAP-defended dataset. As a result, BAP's performance is lower than that of other defenses. \section{Transferability} \subsection{Across Different Datasets} It is important to ensure that DeTorrent is able to effectively defend traffic with different characteristics than traffic in the training datasets. Otherwise, DeTorrent's performance may degrade rapidly over time or while defending new websites. Accordingly, we test DeTorrent's transferability by conducting two separate experiments. In the first experiment, we train the real-world pluggable transport version of WF-DeTorrent using the BE dataset, which was collected in a different setting and time period. Then, we test if WF-DeTorrent is still able to effectively defend the traffic against a WF attack. In the second experiment, we train WF-DeTorrent on traces associated with one set of websites, then test the defense on traces associated with a \textit{different} set. In the first experiment, we find that the WF-DeTorrent pluggable transport performance is high, as described in section \ref{ssec:real_implementation}, indicating that the padding strategy is still effective. This is despite WF-DeTorrent's models being trained on a dataset collected with a different methodology, during a different time period, and while recording Tor cells rather than packets. In the second experiment, we partition the BE dataset so that the first partition contains 20 instances of 10 subpages of 50 of the websites, while the second partition contains the same number of instances of the other 45 websites. We refer to the first partition as BE-1 and the second partition as BE-2. Then, we train the WF-DeTorrent defense using only the BE-1 dataset and simulate the defense on BE-2 (which does not contain any traces \textit{or} websites that WF-DeTorrent was trained on). We find that the defense drops Tik-Tok's accuracy to 40.3\%, showing that the defense was effective. Also, note that the higher attack accuracy is likely because the attacker is only choosing from 50 websites, rather than 95. To set a baseline for how well WF-DeTorrent performs when training and testing on the same dataset, we both train and test it on BE-2. We find that it decreases Tik-Tok's performance to 39.6\%. Because this accuracy is only .7\% lower than the accuracy found when WF-DeTorrent was trained on BE-1, we conclude that the WF-DeTorrent framework generalizes well and does not simply memorize fine-grained patterns in the training data. Accordingly, we expect the defense provided by WF-DeTorrent to be highly transferable. \subsection{Against Different Attacks} In this paper, we describe two different training frameworks with one defending against website fingerprinting and the other defending against flow correlation. However, one might like to defend against both types of attacks. To test how DeTorrent's performance against one attack transfers to the other, we test how well WF-DeTorrent functions in the FC setting and vice versa. To train the WF and FC DeTorrent models, we use the BE and DCF datasets respectively. It should also be noted that WF-DeTorrent and FC-DeTorrent are trained on entirely different datasets collected using different methodologies and at different points in time. As a result, the models used in these experiments are unlikely to be fine-tuned in terms of defense performance, and the above results should be taken as a lower bound of what performance is possible. We find that FC-DeTorrent provides some defense in the WF setting, though its performance is degraded. To be specific, it reduces Tik-Tok performance on the BE dataset to 45.8\%. This represents a 12.9\% increase in Tik-Tok accuracy, putting it behind FRONT and Interspace in terms of performance, though it still outperforms BAP, WTF-PAD, and Spring. On the other hand, WF-DeTorrent performs only slightly worse than FC setting, with TPR of about .32 for a FPR of $10^{-4}$ and about TPR of .58 for a $10^{-3}$, compared to WF-DeTorrent's TPRs of .30 and .57 respectively. Therefore, we find that WF-DeTorrent is transferable in the sense that it functions as an effective defense in both the WF and FC settings; accordingly, it may be a reasonable choice for users concerned about both types of attacks. \section{Conclusion and Future Work} In this paper, we present the padding-only traffic analysis defense DeTorrent, which uses competing neural networks to generate defense strategies resistant to adversarial retraining. To train the defense generator to make real-time decisions, we implement it as an LSTM that takes into account live traffic patterns. We describe how we represent the trace as a tensor and use an embedder to create a useful notion of distance between traces, allowing for more effective training in the WF setting. To test WF-DeTorrent's defense performance, we compare it to other padding-only defenses scaled to use similar bandwidth overhead. In the closed-world WF attack on the BE dataset, we find that it outperforms comparable defenses with a 9.5\% larger accuracy reduction than the next best defense. It also reduces the accuracy by 60.5\% compared to the undefended traffic, indicating its ability to defend against state-of-the-art WF attacks. Similarly, we find that FC-DeTorrent reduces the true positive rate of the flow correlation attack DeepCoFFEA at the $10^{-4}$ false positive rate threshold to just .30 compared to about .63 for the next best defense. Furthermore, we test the real-world DeTorrent implementation against live traffic and find that it achieves similar success, reducing Tik-Tok attack performance against the PT dataset to just 21.5\%. Overall, the results show that DeTorrent can both defend against traffic analysis attacks and be deployed practically. Future work may include experimenting with alternate neural network architectures, testing how delaying packets might improve defense performance, and implementing DeTorrent using Tor's circuit padding framework. \begin{acks} We'd like to thank Nate Matthews for sharing the BigEnough dataset and for his work on tor-crawler-pluggable, which we used to collect the PT dataset. This work was funded by a 3M fellowship and NSF grant 1815757. \end{acks} \bibliographystyle{ACM-Reference-Format}
\section*{Supplementary Material} \section{Natural units} In the main text and this Supplemental Material, physical quantities are normalized using natural units, in terms of the particle density $\rho_p$, buoyancy-reduced gravity $\tilde g$, and median grain diameter $d$. For example, velocities are normalized by $\sqrt{\tilde gd}$. \section{Numerical sand transport models} The paper presents data from grain-scale discrete-element-method (DEM) simulations with the numerical models of Ref.~\cite{Duranetal12} (modified as described in Ref.~\cite{PahtzDuran17}) and Ref.~\cite{Kamathetal22}. Both models couple a continuum description of Reynolds-averaged aerodynamics with a discrete element method for the grain motion under gravity, buoyancy, and wind drag. The drag force is given by $\bm{F_d}=\frac{\pi}{8s}C_d|\bm{u_r}|\bm{u_r}$, where $\bm{u_r}$ is the fluid-grain-velocity difference and \begin{equation} C_d=\left(\sqrt[m]{\frac{Re_c}{|\bm{u_r}|/\nu}}+\sqrt[m]{C_d^\infty}\right)^m \end{equation} the drag coefficient, with $[Re_c,C_d^\infty,m]=[24,0.5,2]$ in Ref.~\cite{Duranetal12} and $[Re_c,C_d^\infty,m]=[32,1,1.5]$ in Ref.~\cite{Kamathetal22}. Spherical grains ($10^4{-}10^5$) with mild polydispersity are confined in a quasi-two-dimensional \cite{Duranetal12} domain of length $\Delta_x\approx10^3$ and width $\Delta_y=1$ or three-dimensional domain of length $\Delta_x=200$ and width $\Delta_y=8$ \cite{Kamathetal22}, with periodic boundary conditions in the flow and lateral directions, and interact via normal repulsion and tangential friction. The grain layer at the bottom is glued to the ground. The upper boundary of the simulation domain is reflective but in practice never reached by transported grains. The Reynolds-averaged Navier-Stokes equations are combined with a semiempirical mixing-length closure, \begin{equation} \frac{dl_m}{dz}=\kappa\left[1-\exp\left(-\sqrt{\frac{u_xl_m}{R_c\nu}}\right)\right], \label{lm} \end{equation} where $l_m(z)$ is the height-dependent mixing length, $\kappa=0.4$ is the von K\'arm\'an constant, $u_x(z)$ the flow velocity field, and $R_c=7$. It ensures a smooth hydrodynamic transition from high to low particle concentration near the bed surface and recovers the mean turbulent flow velocity profile in the absence of transport. The model of Ref.~\cite{Kamathetal22} allows to toggle between Eq.~(\ref{lm}) and a ``fully rough'' velocity profile, which neglects the bare viscous contribution to the wind shear stress against the turbulent contribution. Thereby, a simplified mixing length closure, $l_m=\kappa(z-z_s)$, becomes admissible, where $z_s$ is the uppermost height at which all particles move with a velocity smaller than $10\%$ of the wind shear velocity $u_\ast$. The integration of the velocity profile starts at $z=z_s+z_0$, where $z_0=1/30$ is the surface roughness. For $z\leq z_s+z_0$, $u_x(z)=0$. \section{Calculation of physical quantities from the simulation data} \subsection{Local averages} Exploiting the spatial homogeneity of the simulation, we calculate the particle volume ($V_p$)-weighted average of a particle property $A_p$ over all particles within an infinitesimal vertical layer $(z,z+dz)$ and over all time steps after reaching the steady state as \cite{PahtzDuran18b} \begin{equation} \langle A\rangle(z)=\sum_{z_p\in(z,z+dz)}V_pA_p/\sum_{z_p\in(z,z+dz)}V_p. \end{equation} \subsection{Particle volume fraction} The particle volume fraction $\varphi$ is the total particle volume per simulation box volume $\Delta_x\times\Delta_y\times(z,z+dz)$ \cite{PahtzDuran18b}: \begin{equation} \varphi(z)=\frac{1}{\Delta_x\Delta_ydz}\sum_{z_p\in(z,z+dz)}V_p. \end{equation} Note that the $\varphi$-values obtained from the quasi-two-dimensional simulations [Figs.~3(b) and 3(d)] are slightly different from those for three-dimensional systems (e.g., $\varphi$ is slightly smaller for a random closed packing). We expect that the relative deviations between quasi-two-dimensional and three-dimensional simulations are even smaller for $\varphi$-ratios such as in Eq.~(3). \subsection{Sand transport rate} The sand transport rate $Q$ is the total sand momentum per unit area of the bed and calculated as \begin{equation} Q=\int_{-\infty}^\infty\varphi\langle v_x\rangle\mathrm{d}z. \end{equation} \subsection{Granular stresses} The granular shear stress $\tau_g$ and pressure $p_g$ are calculated as \cite{PahtzDuran18b} \begin{align} \tau_g&=\tau_g^k+\tau_g^c, \\ p_g&=\varphi\langle v_z^2\rangle p_g^k+p_g^c, \end{align} where $\tau_g^k\equiv\sigma_{xz}^k=-\varphi\langle c_zc_x\rangle$ and $p_g^k\equiv-\sigma_{zz}^k=\varphi\langle c_z^2\rangle$, with $\bm{c}=\bm{v}-\langle\bm{v}\rangle$ the fluctuation velocity, are the shear and normal components, respectively, of the kinetic granular stress. Furthermore, denoting the contact force applied by grain $q$ on grain $p$ as $\mathbf{F}^{pq}$ (defining $\mathbf{F}^{pp}\equiv0$), the structural granular stress components $\tau_g^c\equiv\sigma_{xz}^c$ and $p_g^c\equiv-\sigma_{zz}^c$ are calculated as \cite{PahtzDuran18b} \begin{align} \tau_g^c&=-\frac{1}{2\Delta_x\Delta_y}\sum_{z_p\in(z,z+dz)}\sum_qF_x^{pq}(z_p-z_q)l^{dz}_{pq}, \\ p_g^c&=\frac{1}{2\Delta_x\Delta_y}\sum_{z_p\in(z,z+dz)}\sum_qF_z^{pq}(z_p-z_q)l^{dz}_{pq}, \end{align} where $l^{dz}_{pq}$ the length fraction of the line connecting $z_p$ and $z_q$ that is contained in the interval $(z,z+dz)$. \subsection{Bed surface} The rebound height $z=0$, which serves as a pertinent mechanical definition of the notion of a ``bed surface'', is defined as the elevation at which $p_g^k\mathrm{d}\langle v_x\rangle/\mathrm{d}z$ is maximal: \begin{equation} \left[p_g^k\frac{\mathrm{d}\langle v_x\rangle}{\mathrm{d}z}\right]_{z=0}=\max\left(p_g^k\frac{\mathrm{d}\langle v_x\rangle}{\mathrm{d}z}\right). \label{bedsurface} \end{equation} It is motivated by the balance equation \cite{Pahtzetal15a} \begin{equation} -\frac{\mathrm{d}\varphi\langle c_z^2c_x\rangle}{\mathrm{d}z}=p_g^k\frac{\mathrm{d}\langle v_x\rangle}{\mathrm{d}z}-\varphi\langle a_xc_z\rangle-\varphi\langle a_zc_x\rangle, \end{equation} where $\bm{a}$ is the acceleration due to fluid-particle interactions, gravity, and contact forces, and $\bm{c}$ denotes the fluctuation velocity introduced above. Here $-\varphi\langle c_z^2c_x\rangle$ corresponds to the flux, $p_g^k\mathrm{d}\langle v_x\rangle/\mathrm{d}z$ to the production rate, and $\varphi\langle a_xc_z\rangle+\varphi\langle a_zc_x\rangle$ to the dissipation rate, respectively, of the kinetic fluctuation energy density $-\varphi\langle c_zc_x\rangle$. Since grain-bed rebounds produce strong correlations between the horizontal and vertical grain velocities, the maximum of $p_g^k\mathrm{d}\langle v_x\rangle/\mathrm{d}z$ corresponds to an effective rebound elevation \cite{PahtzDuran18b}. This definition provides the crucial link between saltation and bed mechanics and thereby establishes a one-to-one mapping between trajectory-based aeolian saltation models and simulations that explicitly resolve the granular bed. Note that, as a slight improvement beyond Ref.~\cite{PahtzDuran18b}, we insist that only the kinetic part of $p_g$ is used to calculate the rebound height in Eq.~(\ref{bedsurface}). This leads to a universal focal point at $\varphi_f\equiv\varphi(z\approx-0.72)\approx0.1$, intuitively consistent with the picture of grain reflection at $z\approx-\lambda$. \section{Approximate analytical solution of trajectory equations} \label{TrajectoryEquations} In this section, we present an approximate solution of Eqs.~(2a)-(2c), which will be used in the minimal model introduced in Section~\ref{MinimalModel}. \subsection{Impact velocity as a function of lift-off velocity} For a given wind velocity profile $u_x(z)$, the $i$-th grain's impact velocity $\bm{v}_\downarrow^i$ as a function of its lift-off velocity $\bm{v}_\uparrow^i$ can be calculated from Eqs.~(2a) and (2b) approximately as \cite{Pahtzetal21} \begin{subequations} \begin{align} v_{\downarrow z}^i&=-v_s-v_sW_0\left(-e^{-1-h^i/v_s^2}\right), \label{vz} \\ v_{\downarrow x}^i&\simeq v_{\uparrow x}^i+\frac{v_{\uparrow z}^i-v_{\downarrow z}^i}{v_s+v_{\uparrow z}^i}[u_x(\overline{z}_\ast^i)-v_{\uparrow x}^i], \label{vx} \end{align} \end{subequations} where $W_0$ denotes the principal branch of the Lambert-$W$ function, $\overline{z}_\ast^i$ is the $i$-th grain's characteristic transport height (a certain weighted average of $z^i$ \cite{Pahtzetal21}), and $h^i$ its hop height. They are calculated as \begin{align} \overline{z}_\ast^i&=-(v_s+v_{\uparrow z}^i)v_{\downarrow z}^i-v_sv_{\uparrow z}^i, \\ h^i&= v_sv_{\uparrow z}^i-v_s^2\ln(1+v_{\uparrow z}^i/v_s). \end{align} The approximation made in Eq.~(\ref{vx}), which assumes that $u_x[z^i(t)]$ changes much more slowly with time $t$ during the $i$-th grain's trajectory than $e^{t/v_s}$ (Eq.~(E2) in Ref.~\cite{Pahtzetal21}), is nearly exact for the log-like fully rough wind velocity profiles considered in Eq.~(2c). \subsection{Wind velocity profile} For $v_{\uparrow z}^i\lesssim v_s$, which holds for all our minimal model solutions, the difference between the $i$-th grain's downward and upward streamwise velocity $\Delta v_x^i(z)$ is approximately proportional to the vertical velocity difference $\Delta v_z^i(z)$ (Appendix). Approximating $\Delta v_z^i(z)$ to leading order in $v_{\uparrow z}^i/v_s$, the granular shear stress profile corresponding to the $i$-th trajectory is therefore given by \begin{equation} \begin{split} \tau_g^i(z)&\approx\tau_g^i(0)f_g(z/h^i),\quad\text{with} \\ f_g(X)&\equiv\sqrt{1-X}\times\Theta\left(1-X\right), \end{split} \label{taug} \end{equation} where $\tau_g^i(0)=\phi^i(v_{\downarrow x}^i-v_{\uparrow x}^i)$ and $\Theta$ denotes the Heaviside step function. When sorting the $N$ trajectories in ascending order of their hop heights ($h^1\leq h^2\dots\leq h^N$) and defining $h^0\equiv0$ and $\epsilon^i\equiv\tau_g^i(0)/\tau$, then the ratio between granular and wind shear stress $\tau_g(z)/\tau$ for elevations $h^{j-1}\leq z\leq h^j$ can be further approximated as \begin{equation} \frac{\tau_g(z)}{\tau}\approx\sum_{i=j}^N\epsilon_i\sqrt{1-\frac{z}{h^i}}=\epsilon\left\langle\sqrt{1-\frac{z}{h^i}}\right\rangle_\epsilon\approx\epsilon\sqrt{1-\frac{z}{h}}, \label{taug2} \end{equation} where $\epsilon\equiv\sum_{i=j}^N\epsilon^i$, $h\equiv1/\langle(h^i)^{-1}\rangle_\epsilon$, with $\langle\cdot\rangle_\epsilon\equiv\frac{1}{\epsilon}\sum_{i=j}^N\cdot \,\epsilon^i$ the epsilon-weighted average over the trajectories $i=j,\dots,N$. In terms of the resulting wind velocity profile, we numerically confirmed that the combination of all of the above approximations leading to Eq.~(\ref{taug2}) typically cause deviations of less than $5\%$ from the exact solution even when $v_{\uparrow z}^i$ is on the order of $v_s$. These approximations have the advantage that they allow for an analytical solution of Prandtl's mixing length closure $\kappa^2(z+z_0)^2u_x^\prime|u_x^\prime|=u_\ast^2[1-\tau_g(z)/\tau]$. For elevations $h^{j-1}\leq z\leq h^j$, it reads \begin{widetext} \begin{equation} \begin{split} u_x(z)&\approx\frac{u_\ast}{\kappa}\left\{\Re\left[f_u(h,z)\right]-\Im\left[f_u(h,z)\right]\right\}+u_x(h_{j-1}),\quad\text{with} \\ f_u(h,z)&\equiv\left[4\sqrt{1-\epsilon f_g(z^\prime/h)}-2\sqrt{1+\epsilon\sqrt{2-f_g^2(z_0/h)}}\atanh\left(\frac{\sqrt{1-\epsilon f_g(z^\prime/h)}}{\sqrt{1+\epsilon\sqrt{2-f_g^2(z_0/h)}}}\right)\right. \\ -2&{\left.\sqrt{1-\epsilon\sqrt{2-f_g^2(z_0/h)}}\atanh\left(\frac{\sqrt{1-\epsilon f_g(z^\prime/h)}}{\sqrt{1-\epsilon\sqrt{2-f_g^2(z_0/h)}}}\right)\right]^{z^\prime=z}_{z^\prime=h^{j-1}}+\ln\left(\frac{z+z_0}{h+z_0}\right)\times\Theta\left(\frac{z}{h}-1\right).} \label{ux} \end{split} \end{equation} \end{widetext} Using Eq.~(\ref{ux}), starting with the solution for $j=1$, the entire wind velocity profile can be analytically integrated, provided the grain trajectories and their vertical fluxes are known. \section{Minimal model} \label{MinimalModel} Our minimal saltation model considers two grain trajectories: high-energy \textit{saltons} (superscript $s$) that rebound indefinitely and eject low-energy \textit{reptons} (superscript $r$) upon impact with the bed. For simplicity, saltons are thus never captured by the bed, while reptons are captured after their first and only hop. The outcome of the grain-bed collisions is described by the static-bed splash function of Ref.~\cite{Beladjineetal07} (see below), optionally improved by Eq.~(4) to account for cooperative splash in the upgraded version of the model. \subsection{Salton rebounds} The rebound velocity $\bm{v}_{\uparrow}^s$ for a given impact velocity $\bm{v}_{\downarrow}^s$ of saltons is assumed to be equal to its experimentally measured average value, which can be empirically described by \begin{subequations} \begin{align} |\bm{v}_\uparrow^s|/|\bm{v}_\downarrow^s|&=A+Bv_{\downarrow z}^s/|\bm{v}_\downarrow^s|, \label{e} \\ -v_{\uparrow z}^s/v_{\downarrow z}^s&=A/\sqrt{-v_{\downarrow z}^s/|\bm{v}_\downarrow^s|}-B, \label{ez} \end{align} \end{subequations} where $A=0.87$ and $B=0.72$. Equation~(\ref{ez}) is a slight modification of the original empirical law given in Ref.~\cite{Beladjineetal07}. It reproduces the measurements \cite{Pahtzetal21} and, in contrast to the original law, respects the asymptotic scaling for small impact angles derived in Ref.~\cite{Lammeletal17}. \subsection{Grain ejection} The number $N_e^{\rm stat}=\phi^r/\phi^s$ of ejected reptons per impacting salton and their velocity $\bm{v}^r$ on a quiescent bed are assumed to be equal to their experimentally measured average values. Reference~\cite{Beladjineetal07} provided several empirical laws for these quantities, some in terms of the average impact and ejection velocities, others in terms of the average impact and ejection energies. Since static-bed splash is probably an energy balance problem \cite{Lammeletal17}, we choose the energy-based laws that are consistent with the assumption that the total ejection energy $N_e^{\rm stat}\bm{v}_\uparrow^{r2}$ is proportional to the rebound energy lost in the bed $\bm{v}_\downarrow^{s2}-\bm{v}_\uparrow^{s2}$: \begin{subequations} \begin{align} N_e^{\rm stat}&=13\left(1-\frac{\bm{v}_\uparrow^{s2}}{\bm{v}_\downarrow^{s2}}\right)\max\left(\frac{|\bm{v}_\downarrow^s|}{40}-1,0\right), \label{Ne0} \\ \bm{v}_\uparrow^{r2}&=0.038(\bm{v}_\downarrow^{s2}-\bm{v}_\uparrow^{s2})/N_e^{\rm stat}, \label{ve} \\ v_{\uparrow z}^{r2}/\bm{v}_\uparrow^{r2}&=30/38. \end{align} \end{subequations} When cooperative splash is considered, the corrected number $N_e$ of ejected reptons per salton impact is calculated from $N_e^{\rm stat}$ using Eqs.~(3) and (4). However, the calculation of $\bm{v}_\uparrow^{r2}$ does not change (i.e., $N_e^{\rm stat}$ in Eq.~(\ref{ve}) is not replaced by $N_e$). \subsection{Steady state condition} \label{SteadyStateCondition} In a multi-species trajectory-based model, the rare capture of saltons (the highest-energy grains) in the bed is, in the steady state, compensated by the promotion of a small fraction of reptons (the lowest-energy grains ejected by saltons) into saltons \cite{Andreotti04}, which is known as the replacement capacity condition \cite{Duranetal11}. Repton promotion is understood to be a dynamic process: the reptons gain hop by hop more and more energy, and this also decreases little by little their capture probability. For our minimalistic description, we neglect the capture of saltons and assume that reptons are always captured to keep the number of grain trajectories at $2$. However, this simplification causes the final system of equations (Section~\ref{SystemEquations}) to be underdetermined, resulting in a continuous phase space of steady-state solutions. We therefore need an additional selection criterion for a discrete subset of viable solutions, analogous to the replacement capacity condition in more realistic multi-species systems. If reptons were allowed to perform multiple hops (contrary to our model assumption), it would mean that they would just fail to be promoted into saltons. To mimic this constraint, we require that the rebound energy of reptons in their (artificially suppressed) second hop would equal their ejection energy [cf. Eq.~(\ref{e})]: \begin{equation} |\bm{v}_\uparrow^r|/|\bm{v}_\downarrow^r|=R(A+Bv_{\downarrow z}^r/|\bm{v}_\downarrow^r|), \label{R} \end{equation} with $R=1$. \subsection{Solutions of system of minimal model equations} \label{SystemEquations} The trajectory equations of Section~\ref{TrajectoryEquations} combined with the above boundary and steady-state conditions, optionally improved by Eq.~(4) to account for cooperative splash, constitute a closed system of equations, which we solve with an optimization algorithm. For given values of the control parameters $s$ and $v_s$, this system predicts two solutions when the wind shear stress $\tau$ is larger than a certain value $\tau_c(s,v_s)$: one corresponding to a saturated [inset of Fig.~4(a)] and one to an undersaturated steady state [upper inset of Fig.~4(b)]. When successively increasing $\tau$ from $0$ to $\tau_c(s,v_s)$, we observe two alternative scenarios (Fig.~\ref{Scenarios}). For the conditions $v_s^2 \in \{10^3,10^4\}$, both solutions simultaneously emerge (and coincide) at $\tau=\tau_c$. When crossing $\tau_c$, the transport rate $Q$ jumps from zero to the finite value $Q(\tau_c)$, implying that $\tau_c$ is larger than the transport threshold $\tau_t$ (e.g., Fig.~\ref{SteadyStates}), defined as the extrapolated value of $\tau$ at which $Q$ would vanish \cite{PahtzDuran18a}. For atmospheres with $v_s^2 \in \{10^5,10^6\}$, first the undersaturated state emerges at $\tau_t^{\rm uns}<\tau_c$ and then the saturated one at $\tau_t^{\rm sat}=\tau_c$, for both states without jumps in $Q$. Hence, $\tau_t^{\rm sat}$ and $\tau_t^{\rm uns}$ are the distinct transport thresholds of the saturated and undersaturated solution, respectively. In the main text, the symbol `$\tau_t$' should be interpreted in the context of whether the undersaturated ($\tau_t=\tau_t^{\rm uns}$) or saturated state ($\tau_t=\tau_t^{\rm sat}$) is discussed. \begin{figure}[tb] \includegraphics{FigS1.pdf} \caption{Two alternative scenarios of the emergence of the saturated and undersatured steady states predicted by the minimal model (see Section~\ref{SystemEquations}).} \label{Scenarios} \end{figure} \begin{figure}[tb] \includegraphics{FigS2.pdf} \caption{Exemplary continuous phase lines of steady states allowed by the minimal model ($s=4^6\cdot10^2$ and $v_s^2=10^3$). For wind shear stress $\tau>\tau_c(s,v_s)$, the steady-state condition $R=1$ selects two steady-state solutions. The solution corresponding to the smaller value of the vertical salton flux $\phi^s$ is the saturated solution. It is stable against small perturbations along the phase line as $\mathrm{d}R/\mathrm{d}{\phi^s}<0$. The solution corresponding to the larger value of $\phi^s$ is the undersaturated, unstable ($\mathrm{d}R/\mathrm{d}{\phi^s}>0$) solution.} \label{SteadyStates} \end{figure} \begin{figure}[tb] \includegraphics{FigS3.pdf} \caption{Exemplary stability analysis for the salton trajectory ($s=4^4\cdot10^3$, $v_s^2=10^4$, and $\tau=8\tau_t$). Each steady state from the continuous phase line parametrized by $R$ (cf. Fig.~\ref{SteadyStates}) exhibits a certain impact velocity $|\bm{v}_\downarrow^s|$, characteristic transport height $\overline{z}_\ast^s$ of saltons, and associated mean wind velocity $u_x(\overline{z}_\ast^s)$ required to sustain it (black line). For the wind velocity profile of the saturated steady state (blue circle), $u_x(\overline{z}_\ast^s)$ (blue line) remains below (above) the black line for a positive (negative) perturbation of $|\bm{v}_\downarrow^s|$, keeping the salton trajectory stable. The opposite situation occurs for the undersaturated steady state (filled red circle) and its wind velocity profile (red line). Its salton trajectory is unstable and pulled towards a distant attractor (open red circle).} \label{TrajectoryStability} \end{figure} \subsection{Stability of model solutions} In order to analyze the stability of the two solutions, it is necessary to deactivate the steady-state condition and treat $R$ in Eq.~(\ref{R}) as a variable in the resulting continuous phase lines of steady states (Fig.~\ref{SteadyStates}). It describes how much salton capture is compensated by repton promotion, i.e., $R>1$ corresponds to net production and $R<1$ to a net loss of saltons. Hence, the function $R(\phi^s)$ does not only provide the two solutions corresponding to the steady-state condition ($R=1$) but also their stability against small perturbations along the phase line of steady states. Since $\mathrm{d}R/\mathrm{d}{\phi^s}<0\,(>0)$ for $\tau>\tau_c$, the (under)saturated solution at large (small) $|\bm{v}_{\downarrow}^s|$ and small (large) $\phi_s$ is (un)stable. This is underscored by the following argument, venturing beyond the steady-state solutions of our minimal saltation model. Consider a test salton that does not feed back onto the considered steady state of the minimal saltation model. In the (under)saturated case this trajectory is (un)stable against small perturbations (Fig.~\ref{TrajectoryStability}). Unfortunately, these model implications seem to be at odds with our observation of apparently stable undersaturated steady states for certain conditions in the DEM simulations. To resolve the apparent contradiction, one would need to consider perturbations beyond the realm of steady states in a more consistent manner. This would require an elaborate analysis of the temporal response of the coupled fluid-particle system driven by fluid drag, salton capture, and repton promotion. Our simplistic two-species approximation is insufficient for such formal analysis, since repton promotion and salton capture are effectively encoded in the function $R(\phi^s)$ but not resolved in time. In the following, we give a flavor of how the dynamics of these processes can potentially stabilize the (nominally unstable) undersaturated state. First, notice that, for perturbations of the undersaturated state along the phase line, increments of the salton velocity are only allowed in unison with a decrement of the salton vertical flux $\phi^s$. This is an unrealistic perturbation scenario, since capture of saltons is a result of their deceleration, not acceleration. On the one hand, if we only increment the velocity of the saltons, independent of $\phi^s$, their general tendency to further accelerate (Fig.~\ref{TrajectoryStability}) is counteracted by a stronger increase of the wind-grain momentum transfer as compared to perturbations along the phase line. This is due to the increase of the repton vertical flux $\phi^r$, which dominates the overall momentum extraction from the wind. The effect is particularly pronounced in the undersaturated state, where $|\bm{v}_{\downarrow}^s|$ is typically close to the critical value $40$ in Eq.~(\ref{Ne0}), where $N_e$ vanishes. On the other hand, if we only decrement $\phi^s$, independent of the salton velocity, salton capture is counteracted by a weakening of the wind-grain momentum transfer, enhancing the promotion of reptons into saltons. Again, this effect is particularly pronounced in the undersaturated state, where repton promotion occurs very rapidly, since the ratio between the salton and repton energies is close to unity, much smaller than in the saturated state. Taken together, these stabilizing effects of the wind-grain momentum transfer make it plausible that the undersaturated state may actually be stable against small perturbations for certain (if not all) conditions. In this case, the disparity of the two states would arguably increase with the density ratio $s$, in line with the observation that the undersaturated state occurs in the DEM simulations for the tested initial conditions only for large $s$.
\section{Introduction} \noindent The (generalized) augmented Lagrangian duality theory is a powerful tool for solving nonconvex constrained optimization problems. Instead of tackling directly the constrained (primal) problem, we can recover the primal solution by solving the dual problem. This is particularly useful when the dual problem is easier to solve than the primal one. This is the case in the augmented Lagrangian duality framework. The dual problem is obtained from the Lagrangian function, which is a function that incorporates both the objective function and the information on the constraints. \emph {Strong duality\index{strong duality}} (i.e., when the primal and dual problems have the same optimal value) is a basic requirement when using a duality framework. For nonconvex problems, however, a positive gap may exist between the primal and dual optimal values when the classical Lagrangian is used. The augmented Lagrangian duality~\cite{RockWets,RYlagrType}, on the other hand, will have zero duality gap even in the nonconvex case, and will allow us to recover the solutions of the original (nonconvex) problem. We describe next the origins and up-to-date development of augmented Lagrangians. \noindent The {\em linear augmented Lagrangian} as introduced in \cite[Chapter 11]{RockWets} is the sum of the classical Lagrangian and an augmenting term; in other words, it is the sum of the objective function, a linear term and an augmenting term. The {\em sharp Lagrangian}, introduced in \cite[Example 11.58]{RockWets}, is a linear augmented Lagrangian which adds to the classical linear term any norm function. The theory of Lagrangian duality is an active area of research, see, e.g., \cite{Bur2011,B2017,BKpenalty,BKpenaltypara,BYZ2017,HY2003,HY2005,NO2008,WYY2012,ZY2008,ZY2004,ZY2006,ZY2009,ZY2012}. In particular, \cite{ZY2006} and \cite{ZY2009} are for infinite dimensional settings. Dolgopolik in \cite{Dol2018} and \cite{Dol20182} gives an excellent introduction on different types of Lagrangians and their applications in solving various kinds of problems. More general types of Lagrangian function have been studied in \cite{BY2011} and more recently in \cite{BKP2021}. Our aim is to provide a primal--dual framework for the infinite dimensional setting using a general, although simple enough, Lagrangian. Our duality scheme is paired with an algorithmic framework, the Deflected Subgradient Method (DSG). Several works exist that use DSG algorithm within a similar primal--dual framework. Hence we make a comparison among these works and ours in terms of the range of applications (in finite or infinite dimensions), the Lagrangian, and the convergence results. Since some level of dual convergence is studied in all these works, we will rather focus on primal convergence results. Gasimov~\cite{Gdsg} proposed a deflected subgradient algorithm which uses the sharp Lagrangian, where the augmenting function is a norm, to solve finite dimensional optimization problems. This method has the desirable property that it generates a dual sequence with a strict improvement of the dual values in each iteration (dual strict improvement). It uses a Polyak-type step-size which requires the knowledge of the optimal dual value. One should note however that this knowledge can be difficult to obtain in practice, especially for non-convex problems. The analysis in Gasimov~\cite{Gdsg} establishes only convergence of the sequence of dual values to the optimal value. It goes without saying that primal convergence is probably the most important feature of any primal--dual scheme, but unfortunately this is not studied in \cite{Gdsg}. Indeed, the example given by Burachik et al.~in~\cite[Example 1]{BGKIdsg} shows that the primal sequence in~\cite{Gdsg} may not converge to the primal solution. Later on, using the same primal--dual framework as~\cite{Gdsg}, the works \cite{BGKIdsg,BKMinexact2010,BIMdsg} developed further results on the step-size and convergence results. In~\cite{BGKIdsg}, Burachik, Gasimov, Ismayilova and Kaya, establish the convergence of an \emph{auxiliary primal sequence} for the Polyak-type step-sizes. In~\cite{BIMdsg} Burachik, Iusem and Melo propose an \emph{inexact version} of the DSG algorithm and prove \emph{auxiliary primal convergence} for inexact iterations. Burachik, Kaya and Mammadov~\cite{BKMinexact2010} devise an inexact version of the methods in~\cite{BGKIdsg,Gdsg} and show that the same convergence properties can be preserved when there is a level of inexactness in the solution of the subproblems. Burachik, Iusem and Melo~\cite{BIMdsg} use the sharp Lagrangian, and propose two choices of step-sizes which are independent of the optimal value. They establish primal convergence with these step-sizes, even for the case when the dual solution set is empty. Hence we will adopt these types of step-sizes for our work to inherit the nice primal convergence properties for our algorithm. These four works above, namely \cite{Gdsg,BGKIdsg,BIMdsg,BKMinexact2010}, are for the finite dimensional setting. Let us now recall the ones that apply to infinite dimensions, which will constitute the main motivation of the present paper. Burachik, Iusem and Melo~\cite{BIMinexact2013} use a general type of augmented Lagrangian, which includes the Lagrangians used by the four previous works as particular cases. They extend the analysis in~\cite{BIMdsg} to the infinite dimensional setting. Namely, the primal problems are defined in a reflexive Banach space and the constraint functions are defined in a Hilbert space. They also use an inexact version of the DSG algorithm as in~\cite{BIMdsg}, and establish both the primal and dual convergence by adopting the types of step-sizes in~\cite{BIMdsg}. Burachik and Kaya \cite{BKdsg}, and later Burachik, Freire and Kaya \cite{BFK2014}, incorporated a scaling symmetric matrix $A$ in the linear term of the Lagrangian in finite dimensions. This general type of augmented Lagrangian will be the focus of the present paper, since it provides a level of generality that allows, e.g., the full theoretical analysis of the penalty case, i.e., when $A$ is taken as the zero matrix. The type of Lagrangian we focus on is an extension of the one in \cite{BFK2014,BKdsg} to infinite dimensions. It is associated with the following infinite dimensional equality constrained problem: \begin{equation}\label{eq:generalPr} \min_{x\in X} \varphi(x)\;\;\;\; {\rm s.t. } \;\;\;\; h(x)=0\,, \end{equation} where $X$ is a reflexive Banach space, $\varphi:X\to\mathbb{R}\cup\{\infty\}$ is lower semi-continuous; and $h:X\to\mathbb{R}^m$ is continuous. The Lagrangian $l:X\times\mathbb{R}^m\times\mathbb{R}_+\to\mathbb{R}$ is defined as \begin{equation}\label{eq:generalLagrn} l(x,y,c):=\varphi(x)-\langle Ay,h(x)\rangle+ c\,\sigma(h(x))\,, \end{equation} where $x\in X$, $y\in\mathbb{R}^m$, $c\in [0,\infty)$, $A:\mathbb{R}^m\to \mathbb{R}^m$\!,\! is a continuous map, and $\sigma:\mathbb{R}^m\to\mathbb{R}_+$ verifies $\sigma(x)=0$ if and only if $x=0$ (see Definition \ref{def:basic} for more details). The sharp Lagrangian is a particular case of the general Lagrangian defined in~\eqref{eq:generalLagrn} when $A$ is the identity map and the penalty function $\sigma$ is any norm in $\mathbb{R}^m$. Moreover, the linear term reduces to the classical penalty function when $A$ is zero ~\cite{BKdsg,CC2010}. The numerical experiments in \cite{BKdsg} demonstrate that choosing suitable $A$ or $\sigma$ for various classes of problems can improve the computational performance. In~\cite{BKdsg}, the exact version of the DSG algorithm is utilized and both auxiliary and primal convergence results for the Polyak-type step-size are obtained. Our analysis is inspired by~\cite{BKMinexact2010} in designing our inexact DSG algorithm and establishing the convergence results. Our results extend those in \cite{BKMinexact2010} in the following ways. \begin{itemize} \item[(i)] Our Lagrangian \eqref{eq:generalLagrn} has a general map $A$, which includes the identity and the zero map as particular cases. The case $A$ the identity matrix is studied in \cite{BKMinexact2010}, while the case $A=0$ is new. This opens the way for the analysis and implementation of penalty methods. \item[(ii)] We establish strong duality for our very general type of Lagrangian. In particular, the function $\sigma$ we consider may not be coercive (see Definition \ref{def:assumptions_sigma}(a') and Theorem \ref{th:StrongDual}). \end{itemize} Regarding the study of the theoretical properties of our primal-dual setting, we point out that the proof of strong duality provided in \cite{BR2007} would cover our case. However, we provide our own proof here, because our type of Lagrangian allows us to provide a result which requires weaker assumptions (see more details in the paragraph right before Lemma~\ref{lem:seq_Lagrn}). In Section~\ref{ssec:PD} we show that our infinite dimensional framework (i) has no duality gap, and (ii) has a dual problem which is convex hence we can solve it using the techniques in convex analysis \cite{Pol1997,Ber1999,Nes2004}. In particular, the algorithm we introduce here can be seen as an epsilon-subgradient algorithm applied to the maximization of the dual function (see Remark \ref{rem:eps-sub}). \noindent The paper is organized as follows. In Section~\ref{sec:Pre}, we give the preliminaries mainly on functional analysis, which help in building our primal--dual framework and establishing our convergence results. In Section~\ref{ssec:PD}, we give our primal--dual framework and its important assumptions. In particular, we will respond to the two questions above in this section, where we show the properties of this framework and give the related proofs. In Section~\ref{sec:DSG}, we state the DSG algorithm. We provide two choices of the step-size and establish the convergence results for both of the choices. Our conclusion is given in Section \ref{sec:conclusion}. \section{Preliminaries}\label{sec:Pre} We provide in this chapter some functional analysis tools for future use. Most of these results can be found in the text books of functional analysis such as those by Brezis~\cite{Brezis} and Kreyszig~\cite{Kreyszig}. We use Brezis's book on Functional Analysis~\cite{Brezis} as our main reference, and provide our own proof for results which are either not included in \cite{Brezis} or hard to track down elsewhere. The results we list here will be used in proving the properties of the primal--dual framework, as well as in establishing convergence results of the DSG algorithm. Let $X$ be a reflexive Banach space, $X^*$ its topological dual (i.e., the set all continuous linear functionals from $X$ to $\mathbb{R}$), and $H$ a Hilbert space. We denote by $\langle \cdot, \cdot \rangle$ both the duality product in $X\times X^*$ and the scalar product in $H$. We denote by $\|\cdot\|$ the norm, where the same notation will be used for the norm both in $X$ and $H$. We use the notation $\mathbb{R}_{++}$ for the positive real numbers, $\mathbb{R}_{+\infty}:=\mathbb{R}\cup\{+\infty\}$ (sometimes $\mathbb{R}_{\infty}$ for short) and $\overline{\mathbb{R}}:=\mathbb{R}_{+\infty}\cup\{-\infty\}$. Given a function $g:X\to \overline{\mathbb{R}}$, define the {\em effective domain\index{effective domain}} of $g$ as ${\rm dom\,} g:=\{x\in X\::\: g(x)< +\infty\}$. We say that $g$ is {\em proper}\index{proper} if $g(x)>-\infty$ and ${\rm dom\,} g\neq \emptyset$. Recall that the set ${\rm epi\,} g :=\{(x,t)\in X\times \mathbb{R}\::\: g(x)\le t\}$ is the {\em epigraph of}\index{epigraph} $g$, and that the set $lev_{g}(\alpha):= \{x\in X\::\: g(x)\le \alpha\}$ is the $\alpha$-{\em level set of}\index{level set} $g$. Let $Y$ be a Banach space and consider a map $F:X\to Y$, the {\em graph of $F$}\index{graph} is the set $G(F):=\{(x,v)\in X\times Y\::\: v=F(x)\}$. Given $C\subset X$, the {\em indicator function of $C$}\index{indicator function} is defined as $\delta_C(v):=0$ if $v\in C$ and $+\infty$ otherwise. If $C=\{z\}$ is a singleton, we denote $\delta_{\{z\}}=:\delta_z$. \subsection{Functional Analysis Tools} The topology induced by the norm (in $X$ or $H$), is called the {\em strong} topology. The weak topology in $X$ (weak topology in $H$) is the coarsest topology that makes all elements of $X^*$ (all elements of $H^*=H$) continuous. \begin{definition}[definitions related with the weak topology]\hfill\break \label{def:w-closed set} Let $X$ be a Banach space, and $H$ a Hilbert space. \begin{itemize} \item[(a)] Let $K\subset X$. We say that $K$ is {\em weakly closed in $X$}\index{weakly closed} when it is closed w.r.t. the weak topology in $X$. \item[(b)] We say that a function $h:X\to H$ is {\em weak-weak continuous}\index{weak-weak continuous} when $h^{-1}(U)\subset X$ is weakly open in $X$ for every $U\subset H$ weakly open in $H$. \item[(c)] We say that a function $h:X\to H$ is {\em weak-strong continuous}\index{weak-strong continuous} when $h^{-1}(U)\subset X$ is weakly open in $X$ for every $U\subset H$ strongly open in $H$. Strong-strong\index{strong-strong continuity} and strong-weak continuity\index{strong-weak continuity} are defined similarly. \item[(d)] We say that a function $\varphi:X\to\mathbb{R}_{+\infty}$ is {\emph {weakly lower semi-continuous}} \index{weakly lower semi-continuous} (\emph {w-lsc}) when it is lsc w.r.t. the weak topology in $X$. Namely, when $epi\; \varphi$ is w-closed. \end{itemize} \end{definition} We recall next some well-known facts from functional analysis. \medskip \begin{fact}\label{lem:Weakly Closed} Let $X$ be a Banach space, $H$ be a Hilbert space. Assume that $K\subset X$ is nonempty. The following hold. If $K\subset X$ is weakly compact, then it is weakly closed. \end{fact} \medskip In most of what follows, when a topological property is mentioned by its own, this means that the property holds w.r.t. the strong (i.e., the norm) topology. For instance, if we write ``$A$ is closed", we mean ``$A$ is {\sc strongly} closed". If a property holds w.r.t. the weak topology, we will mention the term ``weak" (or ``weakly") explicitly (e.g., weakly closed, weakly compact, etc.). \medskip It is well-known that, in any metric space, compactness is equivalent to sequential-compactness. To clarify what the situation is for the case of the weak topology in a Banach space $X$, we recall the following definitions. \begin{definition}[weak compactness; sequential compactness; coercive] \hfill\break \label{def:weakly_compact_coercive} Let $X$ be a Banach space, $A\subset X$ and $\varphi : X\to \mathbb{R}_{+\infty}$. \begin{itemize} \item[(a)] The set $A$ is {\em weakly-compact}\index{weakly-compact} when its weak closure, denoted as ${\overline{A}}^w$, is compact w.r.t the weak topology. \item[(b)] A set $A\subset X$ is {\em sequentially-compact}\index{sequentially-compact} (respectively, {\em weakly sequentially-compact}) when every sequence $\{x_n\}\subset A$ has a subsequence converging strongly (respectively, weakly) to a limit in $A$. \item[(c)] The function $\varphi : X\to \mathbb{R}_{+\infty}$ is {\em coercive}\index{coercive} when $\lim_{\|x\|\to \infty} \varphi(x)=+\infty$. \end{itemize} \end{definition} \medskip The equivalence between compactness and sequential-compactness in normed spaces allows the use of sequences when dealing with compact sets in $X$. To be able to deal with weakly compact sets in $X$ in terms of sequences, we recall the following classical well-known result, which is \cite[Problem 10(3), p. 448]{Brezis}. \begin{theorem}[Eberlein-Smulian]\label{th:ES} Let $E$ be a Banach space and let $A\subset E$. Set $B:={\overline{A}}^w$ (i.e., $B$ is the weak closure of $A$). The following statements are equivalent. \begin{itemize} \item[(i)] $B$ is weakly compact. \item[(ii)] $B$ is weakly sequentially-compact. \end{itemize} \end{theorem} Next we quote results that connect boundedness, closedness and compactness both in strong and weak topologies. The next result, a corollary of Bourbaki-Alaoglu's theorem, is \cite[Corollary 3.22]{Brezis}. This result is a consequence of a separation result for convex sets, together with Bourbaki-Alaoglu's theorem. \begin{theorem}\label{th:BA1} Let $E$ be a reflexive Banach space. Let $K\subset E$ be a bounded, closed, and convex subset of $E$. Then $K$ is weakly compact. \end{theorem} \begin{corollary}\label{cor:CCB} If $X$ is a Banach space, then every weakly compact set is closed and bounded. \end{corollary} \medskip We quote next a result on sequential compactness that holds in reflexive Banach spaces. \begin{theorem}\label{th:3.18} Assume that $X$ is a reflexive Banach space and let $\{x_n\}$ be a bounded sequence in $X$. Then there exists a subsequence $\{x_{n_k}\}\subset \{x_n\}$ that converges in the weak topology. \end{theorem} In our analysis, we will consider level sets of w-lsc functions. For future use, we prove below a property that directly follows from the results quoted above. This property is well-known, but hard to track down as stated below. So we provide the proof here for convenience of the reader. \begin{corollary}\label{cor:coer} Let $X$ be a reflexive Banach space and assume that $\varphi: X\to \mathbb{R}_{+\infty}$ is w-lsc. The function $\varphi$ is coercive if and only if all its level sets are weakly compact. In this situation, all the level sets are closed and bounded. \end{corollary} \begin{proof} Assume first that $\varphi$ is coercive and fix $\alpha\in \mathbb{R}$. We need to show that $lev_{\varphi}(\alpha)$ is weakly compact. By Eberlein-Smulian theorem, which is Theorem \ref{th:ES}, it is enough to show that $lev_{\varphi}(\alpha)$ is weakly sequentially compact. This means that every sequence in $lev_{\varphi}(\alpha)$ contains a subsequence weakly convergent to a limit, and this limit belongs to $lev_{\varphi}(\alpha)$. Indeed, take a sequence $\{x_k\}\subset lev_{\varphi}(\alpha)$. Since $\varphi$ is coercive this sequence is bounded, and by Theorem \ref{th:3.18} there exists a subsequence $\{x_{n_k}\}$ converging weakly to some $x\in X$. Since $\varphi$ is w-lsc, we can write \[ \varphi(x)\le \liminf_{k\to \infty} \varphi(x_{n_k})\le \alpha, \] where the last inequality holds because $x_{n_k}\in lev_{\varphi}(\alpha)$ for all $k$. This implies that $x\in lev_{\varphi}(\alpha)$. Hence, the level sets $lev_{\varphi}(\alpha)$ are weakly sequentially compact. By Eberlein-Smulian theorem, they are weakly compact. Conversely, assume that $lev_{\varphi}(\alpha)$ is weakly compact for every $\alpha\in \mathbb{R}$. To show that $\varphi$ is coercive, it is enough to show that $lev_{\varphi}(\alpha)$ is bounded. This follows directly from Corollary \ref{cor:CCB}, which states that any weakly compact set must be bounded. Hence every level set $lev_{\varphi}(\alpha)$ is bounded and $\varphi$ is coercive. The last statement in the corollary is a direct consequence of Corollary \ref{cor:CCB}. \end{proof} \medskip The next result is crucial in establishing the well-definedness of the algorithm we will present in section \ref{sec:DSG}. The result we quote below is \cite[Proposition 3.1.15]{BI}. \begin{theorem}\label{th:existence} Let $E$ be any topological space, and let $\varphi : E\to \mathbb{R}_{+\infty}$ be a proper function which is lsc (w.r.t. the topology of $E$). If $A\subset E$ is compact and such that ${\rm dom\,} \varphi \cap A\neq \emptyset$, then $\varphi$ is bounded below on $A$ and it attains its minimum on $A$, which is finite. \end{theorem} \section{Primal and Dual Problems}\label{ssec:PD} \subsection{Theoretical Framework} The primal--dual framework we present here extends the one studied in~\cite{BKdsg,BFK2014} to the infinite dimensional setting. A particular case of our duality framework is the sharp Lagrangian in finite dimensions, as studied in~\cite{BGKIdsg,BKMinexact2010,BIMdsg,Gdsg}. The sharp Lagrangian has as augmenting term any norm, which motivates the terminology ``sharp". In infinite dimensions, Burachik, Iusem and Melo~\cite{BIMinexact2013} propose a related Lagrangian framework. The Lagrangian proposed in \cite{BIMinexact2013} uses a penalty function $\sigma(\cdot)$ with the same properties we study here, but the difference with our type of Lagrangian is in the linear term. Namely, our Lagrangian includes a map $A$ in the linear term, opening the way to the consideration of penalty methods for the particular case in which $A=0$. The framework in \cite{BIMinexact2013} deals with the case in which $A$ equals the identity map. Even though some of our proofs are similar to those in \cite{BIMinexact2013}, extra care is needed due to the presence of a general map~$A$. Since the identity map satisfies all the assumptions we make on the map $A$, all the results in \cite{BIMinexact2013} can be deduced from our analysis. We use a different and more involved method of proof for obtaining the main result in this chapter, namely, the strong duality property. Let $X$ be a reflexive Banach space, and $\varphi:X\to \mathbb{R}_{\infty}$ be a proper function. We consider the primal optimization problem \begin{equation*} (P)\qquad{\rm min}\;\;\!\varphi(x)\;\; {\rm s.t. }\,\,x\ \text{in }X. \end{equation*} Following \cite[Section 2.2]{BR2007}, we embed problem $(P)$ into a family of parametrized problems by means of a function that coincides with the objective function when the parameter is zero. The tool we use is defined next. \begin{definition}\label{def:PF} A {\em dualizing parameterization} for $(P)$ is a function $f:X\times H\to \bar{\mathbb{R}}$ that verifies $f(x,0)=\varphi(x)$ for all $x\in X$. The {\em perturbation function} induced by this dualizing parameterization is defined as $\beta :H\to \bar{\mathbb{R}}$ such that \begin{equation}\label{prel:eq1} \beta(z):=\inf_{x\in X} f(x,z). \end{equation} \end{definition} The next definition, which is \cite[Definition 5.1]{BR2007}, will be a basic assumption for the dualizing parametrizations. It uses the concepts of weakly open and weakly compact sets. We recalled the latter concept in Definition \ref{def:weakly_compact_coercive}(a). Recall also that a set is weakly open set when its complement is weakly closed (see Definition \ref{def:w-closed set}(a)). \medskip \begin{definition}\label{level-f} A function $f:X\times H\rightarrow \bar{\mathbb{R}}$ is said to be {\em weakly level-compact} if for each $\bar{z}\in H$ and $\alpha \in \mathbb{R}$ there exist a weakly open neighbourhood $U \subset H$ of $\bar{z}$, and a weakly compact set $B\subset X$, such that \[ lev_{z,f}(\alpha):=\{x \in X: f(x,z)\leq \alpha \} \subset B\;\; \mbox{for all}\; z \in U.\] In other words, there exist sets $U\subset H$ weakly open and $B\subset X$ weakly compact, such that $\bar{z} \in U$ and we have \[ \bigcup_{z\in U} lev_{z,f}(\alpha):=\{x \in X: f(x,z)\leq \alpha\,\,\, \forall z\in U\} \subset B.\] \end{definition} If the duality parameterization is weakly-level compact, the corresponding perturbation function is {\em sequentially weak-lsc}. Before establishing this fact, we recall next the definition. \begin{definition}[sequentially weak-lsc function] \hfill\break \label{def:seq-w-lsc} Let $\theta :H\rightarrow \mathbb{R}_{+\infty}$. We say that $\theta$ is {\em sequentially weakly lsc} if the following property holds. \[ \hbox{If }u_n\rightharpoonup u, \hbox{ then } \theta(u)\le \liminf_{n\to \infty} \theta(u_n). \] \end{definition} \begin{remark}[weak-lsc vs. sequentially weak-lsc]\hfill\break \label{rem:w_lsc} \rm In finite dimensions, or more generally in any metric space, there is no difference between semicontinuity and its sequential version. In an infinite dimensional Hilbert space, however, weak lsc as given in Definition \ref{def:w-closed set}(d) is more restrictive than its sequential version. In the former, the liminf inequality in Definition \ref{def:seq-w-lsc} must hold for any net weakly converging to a limit. Since a sequence is a particular case of a net, weak lsc implies sequential weak-lsc, and the converse, in general, does not hold. Indeed, while Definition \ref{def:w-closed set}(d) corresponds to weak closedness of the epigraph, Definition \ref{def:seq-w-lsc} corresponds to the latter set merely being sequentially weakly closed. \end{remark} We will use the following type of functions for constructing our Lagrangian function. \begin{definition}[augmenting function] \hfill\break \label{def:assumptions_sigma} A function $\sigma :H\rightarrow \mathbb{R}_{+\infty}$ is an {\em augmenting function} if the following properties hold. \begin{itemize} \item[(a)] The function $\sigma$ is proper, w-lsc and coercive (see Definitions \ref{def:w-closed set}(d) and \ref{def:weakly_compact_coercive}(c)). \item[(a')] The function $\sigma$ is proper, w-lsc, and satisfies the following condition: There exists $K_{\sigma}>0$ s.t. the set \[ lev_{\sigma}(K_{\sigma})=\{z\in H\::\: \sigma(z)\le K_{\sigma}\}, \] is bounded. We call this type of $\sigma$ {\em conditionally coercive}. \item[(b)] It holds that $\sigma(0)=0$ and $\displaystyle\operatornamewithlimits{argmin}_z\sigma(z)=\{0\}$. \end{itemize} \end{definition} In what follows, we always assume that the function $\sigma$ used in the Lagrangian satisfies the assumptions of Definition \ref{def:assumptions_sigma}, either with (a) or (a'). Note that condition (a) (coercivity), is strictly stronger than (a') (conditional coercivity). If we are able to relax the requirements on $\sigma$ and just require conditional coercivity for $\sigma$, we will make it clear in our proofs. Otherwise, we may simply say that $\sigma$ is as in Definition \ref{def:assumptions_sigma}(a). It is the less restrictive assumption on $\sigma$ the one we will use in our proof of strong duality. Before doing this, we proceed to establish the announced sequential w-lsc for the perturbation function. \begin{proposition}[sequential w-lsc of $\beta$]\hfill\break \label{Prop:lsc_perturb} Let $f:X \times Z \to \overline{\mathbb{R}}$ be weakly lower semicontinuous and weakly level-compact. Then the function $\beta$ defined by \eqref{prel:eq1} is sequentially-weakly lower semicontinuous. \end{proposition} \begin{proof} Assume that $\beta$ is not sequentially weakly lower semicontinuous. This implies that there is a point $u$, a sequence $\{u_n\}_{n\in \mathbb{N}}$, and $\varepsilon>0$ such that \begin{itemize} \item[(i)] $u_n\rightharpoonup u$, \item[(ii)]$ \liminf_n \beta(u_n) < \beta(u) - \varepsilon.$ \end{itemize} By weak-level compactness of $f$, there exists a weak neighborhood $W$ of $u$ such that the set \[ \{x\in X\::\: f(x,z)\le \beta(u) - \varepsilon\}\subset B \text{ for all } z\in W, \] where $B$ is weakly compact in $X$. By (i), there exists $n_0\in \mathbb{N}$ such that $u_n\in W$ for all $n\ge n_0$. Therefore, for all $n\ge n_0$ we have that \[ \{x\in X\::\: f(x,u_n)\le \beta(u) - \varepsilon\}\subset B. \] Calling $\tilde F(x):=\sup_{n\ge n_0} f(x,u_n)$, this implies that \begin{equation}\label{set wc} L:=lev_{\tilde F}(\beta(u) - \varepsilon)=\{x\in X\::\: \tilde F(x)\le \beta(u) - \varepsilon\}\subset B. \end{equation} Since $f(\cdot,v)$ is w-lsc for all $v\in H$, we deduce that $\tilde F$ is w-lsc too. Hence, the set $L$ is weakly closed. Since $L$ is a weakly closed subset of a weakly compact set, it is weakly compact. We can apply now Eberlein-Smulian Theorem (Theorem \ref{th:ES}), to deduce that $L$ is weakly sequentially compact. By (ii) and the definition of liminf we can write \[ \beta(u) - \varepsilon> \sup_{k\in \mathbb{N}} \inf_{n\ge k} \beta(u_n)\ge \inf_{n\ge n_0} \beta(u_n). \] Take now $n_1\ge n_0$ such that for all $k\ge n_1$ we have \[ \beta(u) - \varepsilon- 1/k>\inf_{n\ge n_0} \beta(u_n)=\inf_{n\ge n_0}\inf_{x\in X} f(x,u_n), \] where we used the definition of $\beta$ in the equality. Define now $\tilde G(x):=\inf_{n\ge n_0} f(x,u_n)$, so the above expression becomes \[ \beta(u) - \varepsilon- 1/k>\inf_{n\ge n_0} \beta(u_n)=\inf_{x\in X} \inf_{n\ge n_0} f(x,u_n)=\inf_{x\in X} \tilde G(x), \] which holds for all $k\ge n_1$. Fix now an index $k\ge n_1$. By definition of infimum we can find $x_k\in X$ such that $\tilde G(x_k)= \inf_{n\ge n_0} f(x_k,u_n)< \beta(u) - \varepsilon- 1/k$. Using a similar argument again for this fixed $k\ge n_1$, we can find $n_k\ge n_0$ and $u_{n_k}$ s.t. $f(x_k,u_{n_k})< \beta(u) - \varepsilon- 1/k$. Doing this for every $k\ge n_1$ and using the fact that $u_{n_k}\in W$ for all $k$ we deduce that the obtained sequence $(x_k)$ is contained in the sequentially compact set $L$. Thus there exists a subsequence of $(x_k)$ which is weakly convergent to a limit $\hat x\in L$. For simplicity, we still denote this weakly convergent sequence by $(x_k)$. So we can assume that $x_k\rightharpoonup \hat x\in L$. Since $(u_{n_k})\subset (u_n)$ we have that $u_{n_k} \rightharpoonup u$. By w-lsc of $f$ and the definition of $\beta$ we obtain \[ \beta(u)\le f(\hat x,u)\le \liminf_k f(x_{k},u_{n_k})\le \liminf_k \beta(u) - \varepsilon- 1/k= \beta(u) - \varepsilon, \] a contradiction. Therefore, $\beta$ must be sequentially weakly lsc. \end{proof} \bigskip We present next the basic assumptions we need for the map $A$ (one of these involves the augmenting function $\sigma$ as in Definition \ref{def:assumptions_sigma}). Assume that map $A:H\to H$ verifies the following properties: \begin{itemize} \item [${\bf\hypertarget{A0}{(A_0)}}$] $\sigma(z)\geq \|A(z)\|$, for all $z\in H$. \item [${\bf\hypertarget{A1}{(A_1)}}$] For every $y\in H$, the function $\langle A(\cdot), y \rangle$ is w-usc (i.e., $-\langle A(\cdot), y \rangle$ is w-lsc for every $y\in H$). \end{itemize} \begin{remark}[Assumptions $\bf (A_0)$--$\bf (A_1)$]\hfill\break \label{rem:assumption_A} \rm \begin{itemize} \item[(i)] By Definition~\ref{def:assumptions_sigma} (b), ${\bf\hyperlink{A0}{(A_0)}}$ trivially implies that $A(0)=0$. This assumption will be used in Proposition~\ref{prop:dualProperty}(iii) to derive the weak duality property. Assumption ${\bf\hyperlink{A0}{(A_0)}}$ is also important in obtaining a non-decreasing property of the dual function, as we will see in Proposition~\ref{prop:dualProperty}(ii). \item[(ii)] ${\bf\hyperlink{A1}{(A_1)}}$ plays a role in obtaining the strong duality for our primal--dual framework in Lemma \ref{lem:seq_Lagrn} and Theorem~\ref{th:StrongDual}. \end{itemize} \end{remark} We next list more assumptions on our primal--dual framework. \begin{itemize} \item[\hypertarget{H0}{(H0)}] The objective function $\varphi: X\to \mathbb{R}_{+\infty}$ is proper and w-lsc. \item[\hypertarget{H1}{(H1)}] The function $\varphi$ has weakly compact level sets. \item[\hypertarget{H2}{(H2)}] The dualizing parameterization $f$ is proper (i.e., ${\rm dom\,} f\neq \emptyset$ and $f(x,z)>-\infty,$ \,$\forall \, (x,z)\in X\times H$), w-lsc and weakly level-compact (see Definition \ref{level-f}). \end{itemize}\medskip We define next the problem dual to $(P)$, via our augmented Lagrangian function. \begin{definition}[augmented Lagrangian and associated dual problem] \hfill\break \label{def:basic} With the notation of Problem $(P)$, let \begin{itemize} \item[(a)] $f$ be a dualizing parameterization as in Definition \ref{def:PF}, satisfying assumption {\rm \hyperlink{H2}{(H2)}}, \item[(b)] $A:H\to H$ be a function verifying the assumptions ${\bf\hyperlink{A0}{(A_0)}}$--${\bf\hyperlink{A2}{(A_1)}}$. \item[(c)] $\sigma$ be an augmenting function as in Definition \ref{def:assumptions_sigma}, with (a') instead of (a). \end{itemize} The {\em augmented Lagrangian} for Problem $(P)$ is defined as \begin{equation}\label{eq:Lagrn} \ell(x,y,c):=\inf_{z\in H}\{f(x,z)-\langle A(z),y\rangle + c\sigma(z)\}. \end{equation} The {\em dual function} $q:H\times \mathbb{R}_+\to\mathbb{R}_{-\infty}$ is defined as \begin{equation} \label{eq:dual_function} q(y,c):=\inf_{x\in X} \ell(x,y,c). \end{equation} The \emph{dual problem} of $(P)$ is given by \begin{equation*}\label{eq:D_probm} (D) \qquad {\rm maximize}\;\;\! q(y,c) \;\; {\rm s.t. }\,\, (y,c)\in H\times \mathbb{R}_+. \end{equation*} Denote by $\displaystyle M_P:=\inf_{x\in X}\varphi(x)$ and by $\displaystyle M_D:=\sup_{(y,c)\in H\times \mathbb{R}_+}q(y,c)$ the optimal values of the primal and dual problem, respectively. The primal and dual solution sets are denoted by $S(P)$ and $S(D)$, respectively. \end{definition} \medskip \begin{remark}[finite primal value for Problem $(P)$] \hfill\break \rm By definition of duality parameterization and assumption \hyperlink{H0}{(H0)}, we have that $\varphi$ is proper, so by Definition \ref{def:PF}, the following holds \begin{equation} \label{eq:primal_perturb} M_P=\beta(0)<+\infty. \end{equation} \end{remark} \subsection{Properties of the Primal--Dual Setting}\label{sec:PD properties} We next present some basic properties of the dual function given in Definition \ref{def:basic}. \begin{proposition}[properties of the dual function] \hfill\break \label{prop:dualProperty} Let $q$ be the dual function which is defined in \eqref{eq:Lagrn}. The following facts hold. \begin{itemize} \item[(i)] The dual function $q$ is concave and weakly upper-semicontinuous {\rm (w-usc)}. \item[(ii)] If $c \geq c_1$ then $q(y,c) \geq q(y,c_1)$ for all $y \in H$. In particular, if $(y,c_1)$ is a dual solution, then also $(y,c)$ is a dual solution for all $c\geq c_1$. \item[(iii)] Assume ${\bf\hyperlink{A0}{(A_0)}}$ holds. The weak duality property holds for the $(P)-(D)$ primal -- dual framework, i.e. \[ M_D= \sup_{(y,c)\in H\times \mathbb{R}_+ }q(y,c)\le \inf_{x\in X}\varphi(x)=M_P, \] where $\varphi$ verifies {\rm \hyperlink{H0}{(H0)}}, and $q$ is as in Definition~\ref{def:basic}. \end{itemize} \end{proposition} \medskip \begin{proof} \noindent(i) We show that $q$ is w-usc and concave simultaneously. By \eqref{eq:dual_function}, $q$ is the infimum of a family of w-usc and concave functions. Indeed, define $\psi_{xz}:H\times\mathbb{R}\to\mathbb{R}$, as $\psi_{xz}(y,c):=f(x,z)-\langle A(z),y\rangle + c\sigma(z)$. Then $\psi_{xz}$ is w-continuous and concave (actually affine), w.r.t. the variable $(y,c)$. Now the concavity and weak-upper semicontinuity of $q$ follow from \eqref{eq:dual_function}. We now proceed to show (ii). The fact that $q(y,\cdot)$ is non-decreasing follows directly from the definition and the fact that $\sigma(z)\ge 0$. Let now $(y,c_1)\in S(D)$. So $q(y,c_1)=M_D$. For every $c\ge c_1$ we use the non-decreasing property to write \[ M_D\ge q(y,c)\ge q(y,c_1)=M_D, \] so $q(y,c)=M_D$ for all $c\ge c_1$. Let us now show (iii). Using equations~\eqref{eq:Lagrn} and \eqref{eq:dual_function}, we have that \begin{equation}\label{eq:weak_dual} \begin{array}{rcl} M_D=\displaystyle \sup_{(y,c)\in H\times \mathbb{R}_+ }q(y,c) &=& \displaystyle\sup_{(y,c)\in H\times \mathbb{R}_+ }\inf_{x\in X} \inf_{z\in H} \{f(x,z)-\langle A(z),y\rangle + c\sigma(z)\}\\ [3mm] &=& \displaystyle\sup_{(y,c)\in H\times \mathbb{R}_+ }\inf_{z\in H} \{\inf_{x\in X} f(x,z)\} -\langle A(z),y\rangle + c\sigma(z)\\ [3mm] &=& \displaystyle\sup_{(y,c)\in H\times \mathbb{R}_+ }\inf_{z\in H} \{\beta(z)-\langle A(z),y\rangle + c\sigma(z)\} \\ [3mm] &\le & \displaystyle\sup_{(y,c)\in H\times \mathbb{R}_+ }\{\beta(0)-\langle A(0),y\rangle + c\sigma(0)\}=\beta(0) \\ [3mm] &&\\ &=& \displaystyle \inf_{x\in X} \varphi(x) = M_P, \end{array} \end{equation} where we used the definition of $\beta$ (see Definition \ref{def:PF}) in the fourth equality. We also used the fact that $A(0)=0$ (which holds by $(A_0))$ and the fact that $\sigma(0)=0$ (see Remark~\ref{rem:assumption_A}(i) and Definition~\ref{def:assumptions_sigma}(b)). \end{proof} \medskip We note that the result above only requires for $\sigma$ to verify property (b) in Definition~\ref{def:assumptions_sigma}. \medskip We now proceed to establish the zero duality gap property for our primal dual setting. Burachik and Rubinov show strong duality for very general primal -- dual frameworks in \cite{BR2007}. In their analysis, they use \emph{abstract convexity}\index{abstract convexity} tools~\cite{Rub2000}. Even though we can deduce the zero duality gap property as a consequence of their analysis, we prefer to prove this fact directly here. We do this because one of the assumptions used in \cite{BR2007} can be relaxed in our setting. Namely, we can replace the assumption of w-lsc of $\beta$ (used in \cite{BR2007}) by just {\em sequential}-w-lsc of $\beta$. Recall that the latter property holds for our function $\beta$, as established in Proposition \ref{Prop:lsc_perturb}. \medskip \begin{lemma}[properties of the Lagrangian approximation]\hfill\break \label{lem:seq_Lagrn} Consider the primal problem (P) and its dual problem (D). Assume that {\rm\hyperlink{H0}{(H0)}--\hyperlink{H2}{(H2)}}, ${\bf\hyperlink{A0}{(A_0)}}$ and ${\bf\hyperlink{A1}{(A_1)}}$ hold. Assume that the augmenting function $\sigma$ verifies Definition \ref{def:assumptions_sigma}(a')(b). Suppose that there exists some $(\bar y,\bar c)\in H\times \mathbb{R}_+$ such that $q(\bar y,\bar c)>-\infty$. For $n\in \mathbb{N}$, define $\gamma_n:H\to \mathbb{R}_{-\infty}$ as \[ \gamma_n(z):=\beta(z)-\langle A(z),\bar y\rangle+n\sigma(z). \] There exists a sequence $(v_n)\subset H$ with the following properties. \begin{itemize} \item[(i)] There exists $n_0\in \mathbb{N}$ such that \begin{equation}\label{eq:s1} \gamma_n(v_n)=\inf_{z\in H} \gamma_n(z),\,\,\forall \, n\ge n_0. \end{equation} \item[(ii)] The sequence $(v_n)\subset H$ verifying \eqref{eq:s1} is bounded and converges weakly to zero. \end{itemize} \end{lemma} \begin{proof} Take $(\bar y,\bar c)\in H\times \mathbb{R}_+$ as given in the assumption of the theorem. Let $\bar n:= [\bar c]+1$ where $[\cdot]$ denotes the integer part (or floor) of a real number. Then $\bar n\in \mathbb{N}$ and since $q(\bar y,\cdot)$ is increasing we have that $q(\bar y,\bar n)\ge q(\bar y,\bar c)>-\infty$. For any $n\in \mathbb{N}$, denote by $s(n):=\inf_{z\in H} \gamma_n(z)$. Since $q(\bar y,\bar n)>-\infty$ there exists $r_0\in \mathbb{R}$ such that \[ r_0< q(\bar y,\bar n)= \inf_{z\in H} \beta(z) -\langle A(z),\bar y\rangle+\bar n\sigma(z)=s(\bar n), \] which, together with the fact that $(s(n))$ is an increasing sequence, yields $s(n)>r_0$ for all $n\ge \bar n$. From now on, we consider the sequence $(s(n))$ for $n\ge \bar n$. Observe that this sequence $(s(n))$ is monotone increasing, bounded below by $r_0$ and bounded above by $\beta(0)=M_P$. Indeed, the monotonicity property follows from Proposition \ref{prop:dualProperty}(ii). The statement on the upper bound follows directly from the definition of $s(\cdot)$. Namely, for every $n\ge \bar n$ we have that $s(n)\le \gamma_n(0)=\beta(0)$, where we used assumption ${\bf(A_0)}$ and the fact that $\sigma(0)=0$. Altogether, the latter properties imply that the sequence $(s(n))$ converges (increasingly) to a limit $\bar s\le \beta(0)$. \noindent Proof of (i). Fix $n\ge \bar n$, we have that \[ s(n)+1/k >s(n)= \inf_{z\in H} \gamma_n(z), \] for every $k> \bar n$. The definition of infimum allows us to find $v^k_n\in H$ such that \begin{equation}\label{eq:s1a} 0\le \gamma_n(v^k_n) - s(n)<1/k, \end{equation} where we used the definition of $s(\cdot)$ in the first inequality. For every $k> \bar n$, we use the definition of $s(\bar n)$ to write \begin{equation}\label{eq:s1b} s(\bar n)\le \gamma_{\bar n}(v^k_n)= \gamma_{k}(v^k_n)+(\bar n -k) \sigma(v^k_n), \end{equation} which re-arranges as \begin{equation}\label{eq:s1e} (k-\bar n)\sigma(v^k_n)\le \gamma_{k}(v^k_n)-s(\bar n). \end{equation} By \eqref{eq:s1a} and the established properties of the sequence $(s(n))$, we know that \begin{equation}\label{eq:s1d} \gamma_{n}(v^k_n)<s(n)+1/k\le \bar s +1/k < \bar s +1, \end{equation} for all $k>\bar n$. Using \eqref{eq:s1d} in \eqref{eq:s1e}, and re-arranging the resulting expression we obtain \begin{equation}\label{eq:s1c} \sigma(v^k_n)\le \dfrac{ (\bar s - s(\bar n)) +1 }{(k-\bar n)}, \end{equation} where we also used the fact that $k> \bar n$. Take now $k_0:= \bar n + \dfrac{ (\bar s - s(\bar n)) +1 }{ K_{\sigma}}$, where $K_{\sigma}>0$ is as in Definition \ref{def:assumptions_sigma}(a'). Then it is direct to check that \[ \sigma(v^k_n)\le \dfrac{ (\bar s - s(\bar n)) +1 }{(k-\bar n)}<K_{\sigma}, \] for all $k\ge k_0$. Now Definition \ref{def:assumptions_sigma}(a') implies that the set \[ T:=\{v^k_n \::\: n\ge \bar n, k\ge k_0\}, \] is bounded. In particular, for a fixed $n\ge \bar n$ the sequence $(v^k_n)_{k\ge k_0}$ is bounded and hence it has a subsequence that converges weakly to some $v_n\in H$. To keep notation simple, we still denote the weakly convergent subsequence by $(v^k_n)_{k\ge k_0}$. By Proposition \ref{Prop:lsc_perturb}, we know that $\beta$ is sequentially-w-lsc. By ${\bf\hypertarget{A1}{(A_1)}}$ and Definition \ref{def:assumptions_sigma}(a'), $-\langle A(\cdot),\bar y\rangle$ and $\sigma$ are w-lsc (and hence sequentially-w-lsc), we deduce that $\gamma_n$ is sequentially-w-lsc. Using the sequential w-lsc of $\gamma_n$ and the first inequality in \eqref{eq:s1d} we can write \[ \gamma_n(v_n)\le \liminf_{k\to \infty} \gamma_{k}(v^k_n)\le \liminf_{k\to \infty} s(n)+1/k=s(n)\le \gamma_n(z), \] for every $z\in H$ and every fixed $n\ge \bar n$. The last inequality in the expression above follows from the definition of $s(\cdot)$. Statement (i) now follows with $n_0:=\bar n$, by taking $z=v_n$ in the above expression. \noindent Proof of (ii). Take now the sequence $(v_n)$ defined in part (i). Note that the set $T$ defined in part (i) is bounded, so there exists a closed ball $B_0$ such that $T\subset B_0$. By Theorem \ref{th:BA1}, $B_0$ is weakly compact (and by Fact \ref{lem:Weakly Closed} weakly closed). This implies that the weak closure of $T$ must be contained in $B_0$. Namely, \[ {\overline{T}}^w\subset \overline{B_0}^w=B_0, \] showing that $\overline{T}^w$is bounded. By construction (see proof of (i)), every $v_n$ is a weak limit of a sequence in $T$, so we deduce that \[ (v_n)\subset {\overline{T}}^w\subset B_0, \] showing that $(v_n)$ is bounded. Thus the boundedness statement in (ii) holds. Let us proceed to show now that the sequence $(v_n)$ converges weakly to zero. To prove this fact, we will show that every weakly convergent subsequence must converge to zero. If the latter is true, zero is the only weak accumulation point, so the whole sequence must weakly converge to zero. We have just established that $(v_n)$ is bounded, so by Theorem \ref{th:3.18}, it has weakly convergent subsequences. Take any such subsequence, denoted by $(v_{n_j})_{j\in \mathbb{N}}$, converging weakly to some $v$. Since $(v_{n_j})\subset (v_n)$ and $n\ge \bar n$, we can take ${n_j}>\bar n$. Following the same steps as in \eqref{eq:s1b}-\eqref{eq:s1c} with $k={n_j}>\bar n$ and $v_{n_j}$ in place of $v_n^k$ we have that \[ \sigma(v_{n_j})\le \dfrac{ (\bar s - s(\bar n)) +1 }{(n_j-\bar n)}, \] with $n_j\to \infty$. By the w-lsc of $\sigma$ we can write \[ 0\le \sigma(v)\le \liminf_{j\to \infty} \sigma(v_{n_j})\le \liminf_{j\to \infty}\frac{ (\bar s - s(\bar n)) +1 }{(n_j-\bar n)}=0, \] so $\sigma(v)=0$ and the assumptions on $\sigma$ yield $v=0$. This shows that every weak accumulation point of $(v_n)$ must be equal to zero, and hence the whole sequence converges weakly to zero, completing the proof of (ii). \end{proof} We are now ready to establish the strong duality property of our primal-dual framework. \begin{theorem}[strong duality for $(P)$--$(D)$ framework] \hfill\break \label{th:StrongDual} Consider the primal problem (P) and its dual problem (D). Assume that {\rm\hyperlink{H0}{(H0)}--\hyperlink{H2}{(H2)}}, ${\bf\hyperlink{A0}{(A_0)}}$ and ${\bf\hyperlink{A1}{(A_1)}}$ hold. Assume that the augmenting function $\sigma$ verifies Definition \ref{def:assumptions_sigma}(a')(b). Suppose that there exists some $(\bar y,\bar c)\in H\times \mathbb{R}_+$ such that $q(\bar y,\bar c)>-\infty$. Then the zero-duality-gap property holds, i.e. $M_P=M_D$. \end{theorem} \begin{proof} Recall that weak duality (i.e., that $M_D\le M_P$) holds in our setting, as established earlier in Proposition~\ref{prop:dualProperty}(iii). Hence, we only need to prove that $M_D\ge M_P$. By Lemma \ref{lem:seq_Lagrn}(i), we can take a sequence $(v_n)$ verifying \eqref{eq:s1}. Our first step is to show the following inequality. \begin{equation}\label{eq:MD1} M_D\ge \liminf_{n} \gamma_n(v_n), \end{equation} where $\gamma_n$ and $v_n$ are as in Lemma \ref{lem:seq_Lagrn}. Using $n_0$ as in Lemma \ref{lem:seq_Lagrn}(i) and the definition of $M_D$, we have that \begin{equation}\label{eq:strong_dual1} \begin{array}{rcl} M_D &=& \displaystyle\sup_{(y,c)\in H\times \mathbb{R}_+ }\inf_{z\in H} \{\beta(z)-\langle A(z),y\rangle + c\sigma(z)\} \\[3mm] &\ge& \displaystyle\inf_{z\in H} \{\beta(z)-\langle A(z),\bar y\rangle + n\sigma(z)\} \\[3mm] &=& \displaystyle \{\beta(v_n)-\langle A(v_n),\bar y\rangle + n\sigma(v_n)\}= \gamma_n(v_n), \end{array} \end{equation} where we used the fixed choice of $(y,c):=(\bar y,n)$ with $n>n_0$ in the inequality, fact \eqref{eq:s1} in the second equality, and the definition of $\gamma_n$ in the last one. Inequality \eqref{eq:MD1} now follows by taking $\liminf$ in \eqref{eq:strong_dual1}. Using \eqref{eq:MD1}, the definition of $\gamma_n$ and the properties of $\liminf$ we deduce that \begin{equation} \label{eq:strong_dual2} \begin{array}{rcl} M_D &\ge & \liminf_{n} \gamma_n(v_n)\\[3mm] &= &\liminf_{n}\beta(v_n)+ \,\left[-\langle A(v_n),\bar y\rangle + n\sigma(v_n)\right]\\[3mm] &\ge & \liminf_{n}\beta(v_n) + \liminf_{n} \left[ -\langle A(v_n),\bar y\rangle + n\sigma(v_n) \right]\\[3mm] &\ge &\liminf_{n}\beta(v_n) + \liminf_{n} \left[-\langle A(v_n),\bar y\rangle \right] \\[3mm] &\ge & \beta(0)+0=\beta(0)=M_P, \end{array} \end{equation} where we used the fact that $ n\sigma(v_n)\ge 0$ in the third inequality. In the last inequality we used Lemma \ref{lem:seq_Lagrn}(ii), namely the fact that $(v_n)$ converges weakly to zero and the fact that $A(0)=0$. More precisely, using the (sequential) w-lsc of the functions $\beta$ and $-\langle A(\cdot),\bar y\rangle$, we obtain \[ \liminf_{n} \left[-\langle A(v_n),\bar y\rangle \right]\ge -\langle A(0),\bar y\rangle=0, \] and \[ \liminf_{n}\beta(v_n)\ge \beta(0). \] Both facts were used in the last inequality of \eqref{eq:strong_dual2}. Since we already have that $M_D\le M_P$, we have thus established that $M_P=M_D$. \end{proof} \begin{definition}[superdifferential of a concave function] \hfill\break \label{rSupDiff} Let $H$ be a Hilbert space and $g:H\to \mathbb{R}_{-\infty}$ be a concave function. Take $r\geq 0$. The $r$-superdifferential of $g$ at $w_0\in {\rm dom}(g):=\{w\in H\::\: g(w)>-\infty\}$ is the set $\partial_r g(w_0)$ defined by \[\partial_r g(w_0):=\{v\in H : g(w)\leq g(w_0) + \langle v,w-w_0 \rangle + r, \;\;\forall v \in H\}. \] \end{definition} \begin{definition}[approximations for the primal--dual and Lagrangian] \hfill\break \label{def:aprrox_Lagn} We say that \begin{itemize} \item[(i)] $x_*\in X$ is an $\epsilon$-optimal primal solution\index{$\epsilon$-optimal primal solution} of $(P)$ if $\varphi(x_*)\leq M_P+\epsilon$ \item[(ii)] $(y_*,c_*)\in H\times\mathbb{R}_+$ is an $\epsilon$-optimal dual solution\index{$\epsilon$-optimal primal solution} if $q(y_*,c_*)\geq M_D-\epsilon$. \item[(iii)] For $r\ge 0$ define the set \begin{equation}\label{eq:aproxvalue} X_r(y,c):=\{(x,z) \in X\times H: f(x,z)-\langle A(z),y\rangle + c\sigma(z) \leq q(y,c)+r\}, \end{equation} which contains all $r$-minimizers of the augmented Lagrangian. \item[(iv)] Fix $(w,c)\in H\times\mathbb{R}_+$ and define $\Phi_{(w,c)}:X\times H\to\ \bar{\mathbb{R}}$ as \begin{equation}\label{eq:ee1} \Phi_{(w,c)}(x,z):= f(x,z)-\langle A(z),w\rangle + c\sigma(z). \end{equation} \end{itemize} \end{definition} \begin{remark}[the dual set of the approximation for the Lagrangian]\hfill \break \rm\label{step1a} By definition of $q$ as an infimum, for every $r>0$ and every $(y,c)$ such that $q(y,c)>-\infty$, there exists $(x,z)$ such that $f(x,z)-\langle A(z),y\rangle + c\sigma(z)< q(y,c)+r$. Therefore, for every $r>0$ and every $(y,c)$ such that $q(y,c)>-\infty$, we have that $X_r(y,c)$ is nonempty. \end{remark} The result below extends \cite[Proposition 3.1, parts (i) and (iii)]{BIMinexact2013}, where the particular case in which $A=I$, the identity map in $H$, is considered. Since the proof follows, mutatis mutandis, the same steps as those in \cite[Proposition 3.1, parts (i) and (iii)]{BIMinexact2013}, we omit it. \begin{proposition}\label{gradz0} If $(\hat{x},\hat{z}) \in X_r(\hat{y},\hat{c})$, then the following facts hold.\\ \noindent i) For all $r\ge0$, $(-A(\hat{z}),\sigma(\hat{z})) \in \partial_rq(\hat{y},\hat{c})$.\\ \noindent ii) If $M_D\le M_P$ and $\hat z=0$, then $\hat x$ is a $r$-optimal primal solution, and $(\hat y,\hat c)$ is a $r$-optimal dual solution. In particular, if $r\le\epsilon$, then $\hat x$ is a $\epsilon$-optimal primal solution, and $(\hat y,\hat c)$ is a $\epsilon$-optimal dual solution. \end{proposition} \medskip {\bf From now on we assume that the hypotheses of Theorem~\ref{th:StrongDual} are verified, and hence we have $M_P=M_D$.} \medskip The following result establishes several properties of the primal--dual solution sets, as well as compactness properties of the level sets of the function $\Phi_{(y,c)}$ defined in \eqref{eq:ee1}. The techniques of the proof for parts (i), (ii), the non-emptiness of the set in \eqref{eq:LS}, and (iiiA) are standard, and can be found in \cite[Lemma 3.1]{BIMinexact2013}. Hence we will omit their proofs. The proof of part (iiiB), however, is new because the coercivity assumption on $\sigma$, which is used in \cite{BIMinexact2013}, is relaxed to the weaker version of Definition \ref{def:assumptions_sigma} with condition (a'). Hence we present here the proof of this part. \medskip \begin{theorem}[the compact level set of the Lagrangian]\hfill \break \label{th:compact_level_set_Lagrangian} Consider the primal problem (P) and its dual problem (D). Suppose that {\rm\hyperlink{H0}{(H0)}--\hyperlink{H2}{(H2)}}, ${\bf\hyperlink{A0}{(A_0)}}$ and ${\bf\hyperlink{A1}{(A_1)}}$ hold. The following statements hold. \begin{itemize} \item[(i)] The set $S(P)\neq \emptyset$ and $M_P\in \mathbb{R}$. \item[(ii)] Let $({\hat y},\hat c)\in H\times \mathbb{R}_+$ be such that $q({\hat y},\hat c)>-\infty$ and consider the set \[ T:=\{ (w,c)\in H\times \mathbb{R}_+\::\: c>\hat c+\|w-{\hat y}\|\}. \] Then, \begin{itemize} \item[(iiA)] $T\subset {\rm dom\,} q$, i.e., $q(w,c)>-\infty$ for every $(w,c)\in T$. \item[(iiB)] If $({\hat y},\hat c)\in S(D)$ then $T\subset S(D)$. \end{itemize} \item[(iii)] For every $s\ge M_P$, and every $(w,c)\in H\times \mathbb{R}_+$, the level set \begin{equation}\label{eq:LS} lev_{\Phi_{(w,c)}}(s)=\{(x,z)\in X\times H:\Phi_{(w,c)}(x,z)= f(x,z)-\langle A(z),w\rangle +c\sigma(z)\leq s\}, \end{equation} is not empty. \begin{itemize} \item[(iiiA)] Let $({\hat y},\hat c)$ be as in (ii) and assume that $\sigma$ verifies Definition \ref{def:assumptions_sigma} with condition (a). Then the level set in \eqref{eq:LS} is weakly-compact for every $(w,c)\in T$. In this situation, there exists $(\tilde{x},\tilde{z})$ such that \begin{equation}\label{Lem:eq2} q(w,c)=f(\tilde{x},\tilde{z}) -\langle A(\tilde{z}),w \rangle + c\sigma(\tilde{z}). \end{equation} \item[(iiiB)] Let $({\hat y},{\hat c})$ be as in (ii) and assume that $\sigma$ verifies Definition \ref{def:assumptions_sigma} with condition (a'). Define the set \[ \tilde T(s):=\{ (w,c)\in H\times \mathbb{R}_+\::\: c> {\hat c}+ \left( \frac{s-q({\hat y},{\hat c})}{K_{\sigma}} \right)+\|w-{\hat y}\|\}\subset T, \] where $K_{\sigma}>0$ is as in Definition \ref{def:assumptions_sigma}(a'). Then the level set in \eqref{eq:LS} is weakly-compact for every $(w,c)\in \tilde T(s)$. In this situation, there exists $(\tilde{x},\tilde{z})$ such that \eqref{Lem:eq2} holds. \end{itemize} \end{itemize} \end{theorem} \begin{proof} The proof of parts (i), (ii), the non-emptiness of the set in \eqref{eq:LS}, and (iiiA) are similar to \cite[Lemma 3.1]{BIMinexact2013}. We proceed to establish (iiiB). Note first that $\tilde T(s)\subset T$ because $\left( \frac{s-q({\hat y},{\hat c})}{K_{\sigma}} \right)\ge 0$. Indeed, note that $s\ge M_P=M_D\ge q({\hat y},{\hat c})$ and $K_{\sigma}>0$. It remains to show that $lev_{\Phi_{(w,c)}}(s)$ is weakly compact under the assumptions given in (iiiB). Namely, we need to show that the level set in \eqref{eq:LS} is weakly compact for every $(w,c)\in \tilde T(s)$. By Theorem \ref{th:ES}, it is enough to show that the set $lev_{\Phi_{(w,c)}}(s)$ is weekly sequentially compact. The latter means that every sequence contained in $lev_{\Phi_{(w,c)}}(s)$ has a weakly convergent subsequence, and that the limit of the weakly convergent subsequence belongs to $lev_{\Phi_{(w,c)}}(s)$. Take a sequence $\{(x_k,z_k)\}\subset lev_{\Phi_{(w,c)}}(s)$. We start by showing that $\{z_k\}$ has a weakly convergent subsequence. Indeed, by definition of $lev_{\Phi_{(w,c)}}(s)$ we have \[ \begin{array}{rcl} s &\geq& f(x_k,z_k)-\langle A(z_k),w \rangle + c\sigma(z_k) \\[2.mm] &=& f(x_k,z_k)-\langle A(z_k),{\hat y} \rangle + {\hat c} \sigma(z_k)+\langle A(z_k),{\hat y}-w \rangle+(c-{\hat c})\sigma(z_k)\\[2.mm] &\ge& f(x_k,z_k)-\langle A(z_k),{\hat y} \rangle + {\hat c} \sigma(z_k)-\|A(z_k)\|\|{\hat y}-w\|+(c-{\hat c})\sigma(z_k)\\[2.mm] &\geq& q({\hat y},{\hat c}) + (c-{\hat c}-\|w-{\hat y}\|)\sigma(z_k), \end{array} \] where we used Cauchy-Schwarz in the second inequality and the definition of $q$ and $(A_0)$ in the third one. Since $\tilde T(s)\subset T$ and $(w,c)\in \tilde T(s)$ we have that $(w,c)\in T$ and hence $(c-{\hat c}-\|w-{\hat y}\|)>0$. The fact that $q({\hat y},{\hat c})>-\infty$, together with the properness of $\varphi$ imply that $q({\hat y},{\hat c})\in \mathbb{R}$. Altogether, we can re-arrange the last expression to obtain $$ \sigma(z_k)\leq \frac{s-q({\hat y},{\hat c})}{c-{\hat c}-\|w-{\hat y}\|}=:M(c). $$ Since $s\ge M_P=M_D\ge q({\hat y},{\hat c})$ we have that $M(c)\ge 0$. We will use now the fact that $(w,c)\in \tilde T(s)$. Indeed, this assumption implies that \[ c>\frac{s-q({\hat y},{\hat c})}{K_{\sigma}} + {\hat c}+\| w-{\hat y} \|. \] Under this assumption on $(w,c)$ it direct to check that $M(c)<K_{\sigma}$. By Definition \ref{def:assumptions_sigma}(a'), the sequence $\{z_k\}$ is bounded and hence it has a weakly convergent subsequence. Without loss of generality, we can assume that the whole sequence $\{z_k\}$ converges weakly to some $\bar{z}$. Now we proceed to find a subsequence of $\{x_k\}$ which is weakly convergent. Indeed, using the fact that $\{(x_k,z_k)\}\subset lev_{\Phi_{(w,c)}}(s)$ we can write \begin{equation}\label{levelboundequation} f(x_k,z_k)\le s+\langle A(z_k),w \rangle - c\sigma(z_k) \le s+ \|w\| \|A(z_k)\| \le s+ \|w\| \sigma(z_k)\le s+ \|w\| M(c)=: \tilde{\alpha} \end{equation} for some $\tilde{\alpha}\in \mathbb{R}$ (note that $(w,c)\in \tilde T(s)$ is fixed). By weak level compactness of $f$ (see Definition \ref{level-f}), there exists a weakly compact set $B\subset X$ and a weakly open neighbourhood $U$ of $\bar{z}$ such that \[ \displaystyle \bigcup_{z\in U} lev_{z,f}(\tilde{\alpha})\subset B, \] where $lev_{z,f}(\tilde{\alpha}):=\{x\in X \::\: f(x,z)\le \tilde{\alpha}\}$. Since $\{z_k\}$ converges weakly to $\bar{z}$ and $U$ is weakly open, there exists a $k_0$ such that $z_k\in U$ for all $k>k_0$. Using \eqref{levelboundequation} we deduce that \[ \{x_k\}_{k>k_0}\subset \bigcup_{k>k_0}\{x\in X\::\: f(x,z_k)\le \tilde{\alpha}\}\subset B. \] Consequently, $\{x_k\}_{k>k_0}\subset B$ and since $B$ is weakly compact, there exists a subsequence of $\{x_k\}_{k>k_0}$ which converges weakly to some $\bar x$. Altogether, we have established that $\{(x_k,z_k)\}$ has a weakly convergent subsequence $\{(x_{k_j},z_{k_j)}\}$, with limit $(\bar x, \bar z)$. Recall that $f$ and $\sigma$ are w-lsc, and the function $\langle A(\cdot), w\rangle $ is w-usc. Therefore, $-\langle A(\cdot), w\rangle $ is w-lsc. Altogether, the function $\Phi_{(w,c)}$ given by \eqref{eq:ee1} is w-lsc. For the weakly convergent subsequence $\{(x_{k_j},z_{k_j})\}$ we can write \[ \Phi_{(w,c)}(\bar x,\bar z)\le \liminf_{j\to \infty} \Phi_{(w,c)}(x_{k_j},z_{k_j})\le s, \] where the last inequality follows from the assumption that $\{(x_k,z_k)\}\subset lev_{\Phi_{(w,c)}}(s)$. Hence, we have proved that the weak limit $(\bar x,\bar z)$ belongs to $lev_{\Phi_{(w,c)}}(s)$, and so the latter set is weakly compact, as claimed. We proceed now to prove the last statement in (iiiB), which requires the existence of $(\tilde x, \tilde z)$ as in \eqref{Lem:eq2} . We note first that, by (ii) and the properness of $\varphi$, $q(w,c)\in \mathbb{R}$ for every $(w,c)\in T$, and hence the same holds for every $(w,c)\in \tilde T(s)$. To establish the equality in \eqref{Lem:eq2}, we need to show that the infimum corresponding to the value $q(w,c)$ is actually attained. We claim that the equality in \eqref{Lem:eq2} follows from the fact that \begin{equation}\label{claim1} \operatornamewithlimits{argmin}_{(x,z)\in X\times H} \Phi_{(w,c)}(x,z)\neq \emptyset. \end{equation} Indeed, assume that \eqref{claim1} holds and take $(\tilde{x},\tilde{z})\in \operatornamewithlimits{argmin}_{(x,z)\in X\times H} \Phi_{(w,c)}(x,z)$. Thus, \begin{equation}\label{mini} q(w,c)=\inf_{(x,z)\in X\times H} \Phi_{(w,c)}(x,z)=\Phi_{(w,c)}(\tilde{x},\tilde{z})= f(\tilde{x},\tilde{z}) -\langle A(\tilde{z}),w \rangle + c\sigma(\tilde{z}), \end{equation} where we used the definitions of $q$ and $\Phi_{(w,c)}$, and the assumption on $(\tilde{x},\tilde{z})$. Therefore, the equality in \eqref{Lem:eq2} will hold if we prove \eqref{claim1}. We know that the set in \eqref{eq:LS} is nonempty, and we proved already that it is weakly compact. With the notation of Theorem \ref{th:existence}, set $E:=X\times H$, and consider in $E$ the weak topology, set $\varphi:=\Phi_{(w,c)}$ and $K:=lev_{\Phi_{(w,c)}}(s)$. It holds by definition of level set that $lev_{\Phi_{(w,c)}}(s)\subset {\rm dom\,} \Phi_{(w,c)}$. Altogether, we have that \[ {\rm dom\,} \Phi_{(w,c)}\cap lev_{\Phi_{(w,c)}}(s) = lev_{\Phi_{(w,c)}}(s)\neq \emptyset, \] where the non-emptiness follows from the first statement in part (iii). Since $\Phi_{(w,c)}$ is w-lsc, all the assumptions of Theorem \ref{th:existence} hold and therefore $\Phi_{(w,c)}$ is bounded below over the set $lev_{\Phi_{(w,c)}}(s)$ and attains its minimum over this set. This establishes \eqref{claim1}, and the proof of the theorem is complete. \end{proof} \section{Deflected Subgradient Algorithm (DSG)}\label{sec:DSG} The following notation will be used throughout the paper. \[ \begin{array}{l} q_{k} :=q(y_{k},c_{k}),\\ \bar{q}:=q(\bar{y},\bar{c}), \end{array} \] where $(\bar{y},\bar{c})$ represents a dual solution, so $\bar{q}=q(\bar{y},\bar{c})=M_D=M_P\ge q_k$ for every $k$. \subsection{Definition and Convergence Analysis} In this section, we define the (DSG) algorithm and establish its convergence properties. We start by defining the Deflected Subgradient Algorithm (DSG). \begin{algorithm}\label{alg:DSG} \begin{quote}\rm {\bf Deflected Subgradient Algorithm (DSG)} {\bf Step $0$}. Choose $(y_0,c_0)\in H\times \mathbb{R}_+$ such that $q(y_0,c_0)>-\infty$, and exogenous parameters $\epsilon>0$ (a prescribed tolerance), $\delta < 1$, $\{\alpha_k\} \subset (0,\alpha)$ for some $\alpha>0$, and $\{r_k\}\subset\mathbb{R}_+ $ such that $r_k\rightarrow 0$. Let $k:=0$. \noindent {\bf Step $1$}. (Subproblem and Stopping Criterion) $a)$ Find $(x_k,z_k) \in X_{{r}_{k}}(y_k,c_k)$, $b)$ if $z_k=0$ and $r_k \leq\epsilon$ stop, $c)$ if $z_k=0$ and $r_k> \epsilon$, then $r_k:=\delta r_k$ and go to $(a)$, $d)$ if $z_k \neq 0$ go to Step $2$. \noindent {\bf Step $2$}. (Selection of the stepsize and Updating the Variables) Consider $s_k>0$ a stepsize and define $y_{k+1}:=y_k - s_kA(z_k)$, $c_{k+1}:= c_k + (\alpha_k+1)s_k\sigma(z_k)$, $k:=k+1$, go to Step $1$. \end{quote} \end{algorithm} \begin{remark}\rm Note that, when $A=0$, DSG becomes a classical penalty method. For $A:=I$ the identity map in $H$, we recover IMSg Algorithm defined in \cite[Section 3]{BIMinexact2013}. \end{remark} \begin{remark}\rm \label{Rem:sigma coercive} By Remark \ref{step1a}, when $r_k>0$, there exists $(x_k,z_k)\in X_{r_k}(y_k,c_k)$ as in Step 1(a), showing that the inexact version of the algorithm is always well defined. When $r_k=0$ for all $k$ we obtain the exact version, which stops at the first $k$ for which $z_k=0$. The well-definedness of the exact version is shown below in Proposition \ref{exactDSG}. In the latter result, we give conditions under which Step 1(a) of the exact version can be performed. Our analysis includes a choice of $\sigma$ either as in part (a) or as in part (a'), of Definition \ref{def:assumptions_sigma}. \begin{remark}\label{rem:eps-sub}\rm Using Proposition \ref{gradz0}, we see that Step 2 in Algorithm \ref{alg:DSG} is nothing but an epsilon subgradient step for the maximization of the dual function. \end{remark} \begin{remark}\rm If $z_k\in N(A)$, then $y_{k+1}=y_k$ and $c_{k+1}>c_k$. Therefore $y_k$ is not updated in this case. The situation in which $z_k\in N(A)$ does not pose a problem in terms of convergence. Indeed, our results hold for $A=0$, so that $N(A)=X$. \end{remark} \end{remark} We establish next properties that hold for every stepsize $s_k>0$ and for every $\alpha_k\in (0,\alpha)$. The proof of the equivalence between statements (a) and (b) is standard, and, with minimal changes, follows the same steps of \cite[Proposition 3.1(ii)]{BIMinexact2013}. We include its short proof here, however, because the expressions involved in the proof will often be used in later results. \begin{proposition}[Characterization of dual convergence]\label{dualSeq} \noindent Let $\{(x_k,z_k)\}$ and $\{(y_k,c_k)\}$ be the sequences generated by {\rm DSG}, and assume that ${\bf (A_0)}$ holds. The following statements are equivalent. \begin{itemize} \item[(a)] The dual sequence $\{(y_k,c_k)\}$ is bounded. \item[(b)] $\sum_{k} s_k\sigma(z_k) < +\infty.$ \item[(c)] The dual sequence $\{(y_k,c_k)\}$ converges strongly to a limit. \item[(d)] The sequence $\{c_k\}$ is Cauchy. \item[(e)] The sequence $\{c_k\}$ is bounded. \end{itemize} Furthermore, if $\{c_k\}$ is bounded, then $\{y_k\}$ is also bounded. \end{proposition} \begin{proof} Using ${\bf (A_0)}$ and the definition of $\{y_k\}$, we obtain \begin{equation}\label{eqdualseq1} \|y_{k+1}-y_0\|\le \sum_{j=0}^k \|y_{j+1}-y_j\|= \sum_{j=0}^k s_j \|A(z_j)\|\le \sum_{j=0}^k s_j \sigma(z_j). \end{equation} On the other hand, by definition of $\{c_k\}$ we have \begin{equation} \label{eqdualseq2} c_{k+1} - c_0 = \sum_{j=0}^kc_{j+1}-c_j=\sum_{j=0}^k (\alpha_j + 1)s_j\sigma(z_j)\le (\alpha + 1)\sum_{j=0}^k s_j\sigma(z_j), \end{equation} where we used the fact that $\alpha_k<\alpha$ for every $k$. We prove first the equivalence between (a) and (b). If (b) holds, then \eqref{eqdualseq1} and \eqref{eqdualseq2} readily yield (a). Conversely, assume that (a) holds. Using the left hand side of \eqref{eqdualseq2} and (a) gives the existence of $M>0$ such that \begin{equation} \label{eqdualseq3} M\ge c_{k+1} - c_0 = \sum_{j=0}^kc_{j+1}-c_j=\sum_{j=0}^k (\alpha_j + 1)s_j\sigma(z_j)\ge \sum_{j=0}^k s_j\sigma(z_j), \end{equation} where we used the fact that $\alpha_j>0$ for all $j$. Since the inequality above holds for all $k$, we must have $\sum_{k}^{\infty} s_k\sigma(z_k) \le M$ and we deduce (b). Let us now show that (a) is equivalent to (c). Clearly (c) implies (a), so it is enough to show that (a) implies (c). Assume that (a) holds. Then the sequence $\{c_k\}$ is bounded. Since it is strictly increasing, it must be convergent. In particular, this implies that the sequence $\{c_k\}$ is Cauchy. We will show now that $\{y_k\}$ is also Cauchy with respect to the norm. Indeed, for every $k,j\in \mathbb{N}$ we can write \begin{equation} \label{eqdualseq4} c_{k+j} - c_k = \sum_{l=k}^{k+j-1} c_{l+1}-c_l=\sum_{l=k}^{k+j-1} (\alpha_l + 1)s_l\sigma(z_l)\ge \sum_{l=k}^{k+j-1} s_l\sigma(z_l) \ge \| y_{k+j} - y_k\|, \end{equation} where we used again the fact that $\alpha_j>0$ for all $j$ in the first inequality. The last inequality is obtained as in \eqref{eqdualseq1}, but with $k+j-1$ in place of $k$ and $k$ in place of $0$. Since $\{c_k\}$ is Cauchy, then for all $j\in \mathbb{N}$ we have \begin{equation} \label{eqdualseq5} 0= \lim_{k\to\infty} c_{k+j} - c_k\ge \lim_{k\to\infty}\| y_{k+j} - y_k\|\ge 0, \end{equation} so $\{y_k\}$ is also Cauchy as claimed. Our claim is true and since $H$ is complete, the sequence $\{y_k\}$ strongly converges to a limit $\bar y$. Altogether, $\{(y_k,c_k)\}$ is strongly convergent, so (a) implies (c). Since (c) implies (d), to complete the proof it is enough to show that (d) implies (c). This is achieved in a similar way as in (a) implies (c). Indeed, if $\{c_k\}$ is Cauchy, then by \eqref{eqdualseq5} we deduce that $\{y_k\}$ is also Cauchy, and hence by completeness of $H\times \mathbb{R}$, we deduce that (c) holds. We clearly have that (d) implies (e). If (e) holds, then by \eqref{eqdualseq2} and \eqref{eqdualseq1} we must have $\{y_k\}$ also bounded, hence (a) holds. The proof is complete. \medskip \end{proof} \medskip The next result establishes the well-definedness of the algorithm, namely that the minimization performed in Step 1 has a solution. We establish this fact either when $\sigma$ is coercive or when it is as in Definition \ref{def:assumptions_sigma}(a'). The proof of part (i) in the next result follows the steps of \cite[Proposition 3.2]{BIMinexact2013}, so we omit its proof. Part (ii) uses the weaker assumption on $\sigma$, namely conditional coercivity. \begin{proposition}[Well-definedness of DSG]\label{exactDSG} Consider $s\ge M_P$, $({\hat y},{\hat c})$, and the sets $T,\tilde T(s)$ as in Theorem \ref{th:compact_level_set_Lagrangian}. \begin{itemize} \item[(i)] Assume that $\sigma$ verifies Definition \ref{def:assumptions_sigma}(a). Take $y_0:={\hat y}$ and $c_0>{\hat c}$. Then, the dual sequence $\{(y_k,c_k)\}$ generated by the exact version of DSG with $(y_0,c_0)$ is well-defined. Namely, the set \[ X(y_k,c_k)\\:=\{(x,z) \in X\times H: f(x,z)-\langle A(z),y_k\rangle + c_k\sigma(z) = q(y_k,c_k)\}, \] is nonempty for all $k\ge0$. \item[(ii)] Assume that $\sigma$ verifies Definition \ref{def:assumptions_sigma}(a'). Take $y_0:={\hat y}$ and $c_0>{\hat c} +\frac{s-q({\hat y}, {\hat c})}{K_{\sigma}}$. Then the same conclusion in (i) holds. \end{itemize} In particular, as long as $(y_0,c_0)$ is chosen as in (i) or (ii) for the corresponding type of $\sigma$, we will have that the exact version of DSG is well defined; that is to say, for all $k\ge1$, there exists $(x_k,z_k)\in X\times H$ satisfying $ q(y_k,c_k)=[f(x_k,z_k)-\langle A(z_k),y_k\rangle + c_k\sigma(z_k)]\in \mathbb{R}$ for every $k\ge 1$. \end{proposition} \begin{proof} (i) Similar to \cite[Proposition 3.2]{BIMinexact2013}. (ii) By assumption $(y_0,c_0)\in \tilde T(s)$, we know by Theorem \ref{th:compact_level_set_Lagrangian}(iiiB) that there exists $(x_0,z_0)\in X(y_0,c_0)$. If $z_0=0$ the algorithm stops at $k=0$ and the claim in (ii) holds for the single iterate $(y_0,c_0)$. Assume that $k\ge 1$ (i.e., the algorithm does not stop at $k=0$ and hence $z_0\not=0$). Let us show that $(y_k,c_k)\in \tilde T(s)$ for every $k\ge 1$. From \eqref{eqdualseq1}, we have $\sum_{j=0}^{k-1} s_j \sigma(z_j)\ge \|y_{k}-y_0\|$ and from \eqref{eqdualseq2} we have $ c_{k} - c_0 =\sum_{j=0}^{k-1} (\alpha_j + 1)s_j\sigma(z_j)$. Altogether, we have \[ \begin{array}{rcl} c_k&=&c_0+\sum_{j=0}^{k-1}(\alpha_j + 1)s_j\sigma(z_j) \ge c_0+ \|y_{k}-y_0\|+\sum_{j=0}^{k-1}\alpha_j s_j\sigma(z_j)\\ &&\\ &&>c_0+ \|y_{k}-y_0\|>({\hat c} +\dfrac{s-q({\hat y}, {\hat c})}{K_{\sigma}})+ \|y_{k}-y_0\|, \end{array} \] where the first strict inequality follows from the fact that $z_j\not=0$ (equivalently, $\sigma(z_j)\not=0$) for every $0\le j\le k-1$ (otherwise the algorithm would have stopped at some $j< k$), and the second strict inequality uses the definition of $c_0$. Therefore, $(y_k,c_k)\in \tilde T(s)$ for every $k\ge 1$ and the result follows from Theorem \ref{th:compact_level_set_Lagrangian}(iiiB).The last assertion of the proposition follows directly from (i) and (ii). \end{proof} \bigskip Part (a) of the following result is proved for $A=I$ and $\sigma$ coercive in \cite[Lemma 3.2]{BIMinexact2013}, and establishes the boundedness of the sequences $\{z_k\}$ and $\{\sigma(z_k)\}$ without any additional assumptions on the parameters of DSG. Since the proof for the case involving the map $A$ and $\sigma$ as in Definition \ref{def:assumptions_sigma}(a) follows the same steps as the ones in \cite[Lemma 3.2]{BIMinexact2013}, we omit its proof, and analyze below the case for $\sigma$ conditionally coercive. \begin{proposition}\label{sigma_k bounded} Assume that ${\bf (A_0)}$ holds and that $z_0\not=0$. Fix $\tilde r$ an upper bound of $\{r_k\}$. \begin{itemize} \item[(a)] If $\sigma$ is as in Definition \ref{def:assumptions_sigma}(a) and $(y_0,c_0)$ in DSG Algorithm is taken as in Proposition \ref{exactDSG}(i), then the sequences $\{z_k\}$ and $\{\sigma(z_k)\}$ are bounded. \item[(b)] If $\sigma$ is conditionally coercive with constant $K_{\sigma}$ and $(y_0,c_0)$ in DSG Algorithm is taken as in Proposition \ref{exactDSG}(ii). Then, the sequence $\{\sigma(z_k)\}$ is bounded. Furthermore, if the parameters $\alpha_0,\, s_0$ in DSG are chosen such that \begin{equation}\label{eq:K} \alpha_0 s_0 >\frac{M_P-q(y_0,c_0)+\tilde r}{K_{\sigma}\,\sigma(z_0)}, \end{equation} then $\{z_k\}$ is bounded. \end{itemize} \end{proposition} \begin{proof} (a) Similar to \cite[Lemma 3.2]{BIMinexact2013}. Let us prove the first statement in (b), namely the boundedness of $\{\sigma(z_k)\}$. If the algorithm stops at iteration $k_0$, then the sequences $\{\sigma(z_k)\}$ and $\{z_k\}$ are finite and therefore bounded. Indeed, in the latter case, the sequence either stops (if $r_{k_0}\le \epsilon $), or it goes into a finite inner loop until $r_{k_0}\le \epsilon $. In either case, the sequences $\{z_k\}$ and $\{\sigma(z_k)\}$ are finite and their boundedness trivially holds. Hence, it is enough to assume that Step 2 is visited at every $k\ge 0$ and hence $z_k\neq 0$ for every $k\ge 0$. Call $a_0:= \alpha_0 s_0\sigma(z_0)>0$. From \eqref{eqdualseq1} we deduce for all $k\geq 1$, \[ \begin{array}{rcl} c_{k}-c_0&=&\sum_{l=0}^{k-1} (\alpha_l + 1)s_l\sigma(z_l)= \sum_{l=0}^{k-1} s_l\sigma(z_l) + \sum_{l=0}^{k-1} \alpha_l s_l \sigma(z_l)\\ &&\\ &&\ge \sum_{l=0}^{k-1} s_l\sigma(z_l) + \alpha_0 s_0\sigma(z_0)\ge \sum_{l=0}^{k-1} s_l\| Az_l \| + \alpha_0 s_0\sigma(z_0)\\ &&\\ &&\ge \|y_k - y_0 \| + \alpha_0 s_0\sigma(z_0)=\|y_k-y_0\| +a_0, \end{array} \] where we used ${\bf (A_0)}$ in the second inequality, \eqref{eqdualseq1} in the last one, and the definition of $a_0$ in the last equality. Re-arrange this expression to obtain \begin{equation}\label{ee7} c_k - c_0 - \|y_k-y_0\| \geq a_0. \end{equation} By Proposition \ref{gradz0}(i), we know that $(-A(z_k),\sigma(z_k)) \in \partial_{r_k} q(y_k,c_k)$. Use the subgradient inequality to write, for every $k$, \[ \begin{array}{rcl} -\infty< q_0=q(y_0,c_0)&\leq& q(y_k,c_k) + \langle -A(z_k),y_0-y_k\rangle +(c_0-c_k)\sigma(z_k) + r_k \\[3mm] &\leq& q_k + \|A(z_k)\|\|y_k-y_0\| + (c_0-c_k)\sigma(z_k) +r_k \\[3mm] &\leq& q_k + \sigma(z_k)\left(\|y_k-y_0\| + c_0 - c_k\right) + \tilde{r} \\[3mm] &\leq& q_k - a_0\sigma(z_k) + \tilde{r}\le q_k + \tilde{r}, \end{array} \] where we used Cauchy-Schwarz inequality, ${\bf (A_0)}$, and \eqref{ee7}. The above expression yields the boundedness of $\{\sigma(z_k)\}$. Indeed, it re-arranges to \[\sigma(z_k)\leq \frac{M_D-q_0 +\tilde{r}}{a_0}:=b.\] Hence $\sigma(z_k)\leq b$ for all $k$ and the proof of the first statement is complete. Let us prove now that, if \eqref{eq:K} holds, then we also have that $\{z_k\}$ is bounded. Indeed, \eqref{eq:K} directly implies that $a_0=\alpha_0 s_0\sigma(z_0) >\frac{M_D-q_0 +\tilde{r}}{K_{\sigma}}$ and hence the above expression becomes \[ \sigma(z_k)\leq \frac{M_D-q_0 +\tilde{r}}{a_0} <K_{\sigma}, \] which implies that $\{z_k\}$ is bounded by definition of $K_{\sigma}$. The proof is complete. \end{proof} \medskip We show next that, if an iterate generated by DSG is a dual solution, then the exact version of DSG must stop, either at the current iteration or at the next one. This result holds for either type of $\sigma$. \begin{proposition}\label{prop:dualsol} Assume that ${\bf (A_0)}$ holds and assume DSG has $r_k=0$ for all $k$. If the $k$th DSG iterate is a dual solution, then either $z_k=0$ or $z_{k+1}=0$. Consequently, in this situation DSG will stop at iteration $k$ or $k+1$. \end{proposition} \begin{proof} Assume that, at iteration $k$, we have that $(y_k,c_k)\in S(D)$. This means that $q_k=q(y_k,c_k)=M_D$. It is enough to prove that, if $z_k\neq 0$, then $z_{k+1}=0$. Assume that $z_k\neq 0$, by ${\bf (A_0)}$, we clearly have that \begin{equation}\label{prop:eq1} \sigma({z}_k) \sigma({z}_{k+1}) -\|A{z}_k \|\,\|A {z}_{k+1} \|\ge 0. \end{equation} Take $({x}_{k+1}, {z}_{k+1})\in X(y_{k+1},c_{k+1})$. With the notation of DSG, denote $\varepsilon_k:=\alpha_k s_k$. Using the fact that $(y_k,c_k)\in S(D)$ and the definitions of $q$ and $({x}_{k+1}, {z}_{k+1})$, we can write \[ \begin{array}{rcl} M_D\ge q_{k+1}&=&f({x}_{k+1}, {z}_{k+1})-\langle A {z}_{k+1},y_{k+1} \rangle + c_{k+1} \sigma({z}_{k+1}) \\ &&\\ &=& f({x}_{k+1}, {z}_{k+1})-\langle A {z}_{k+1},y_{k}-s_k Az_k \rangle + (c_{k} +(s_k+\varepsilon_k)\sigma({z}_k)) \sigma({z}_{k+1})\\ &&\\ &=& f({x}_{k+1}, {z}_{k+1})-\langle A {z}_{k+1},y_{k}\rangle +s_k \langle A {z}_{k+1}, Az_k \rangle + (c_{k} +(s_k+\varepsilon_k)\sigma({z}_k)) \sigma({z}_{k+1})\\ &&\\ &\ge & \left[ f({x}_{k+1}, {z}_{k+1})-\langle A {z}_{k+1},y_{k} \rangle + c_{k} \sigma({z}_{k+1})\right] + s_k \left(\sigma({z}_k) \sigma({z}_{k+1}) - \| A{z}_k\|\, \|A {z}_{k+1}\| \right)\\ &&\\ && +\varepsilon_k \sigma({z}_k)\sigma({z}_{k+1})\ge q_k +\varepsilon_k \sigma({z}_k)\sigma({z}_{k+1})=M_D +\varepsilon_k \sigma({z}_k)\sigma({z}_{k+1}), \end{array} \] where we used the definition of DSG in the third equality. We also used \eqref{prop:eq1} and the definition of $q_k$ in the second to last inequality. This shows that $\varepsilon_k \sigma({z}_k)\sigma({z}_{k+1})\le 0$. Since both $\varepsilon$ and $\sigma({z}_k)$ are assumed to be positive, we must have $\sigma({z}_{k+1})=0$ and hence $z_{k+1}=0$. \end{proof} \medskip The following theorem states that DSG guarantees a monotonic increase of the dual function. If the initial iterate is taken as in Theorem \ref{th:compact_level_set_Lagrangian}, we know that the algorithm is well defined for either type of $\sigma$ (coercive or conditionally coercive). Assuming this is the case, the proof of the result below follows similar steps to those in \cite[Theorem 3.1]{BIMinexact2013} and hence are omitted. \begin{theorem}\label{increase} Assume that {\rm DSG} generates an infinite sequence $\{(y_k,c_k)\}$ and that for every $k$, $(y_k,c_k)$ is not a dual solution. Then $q(y_{k+1},c_{k+1})>q(y_k,c_k)$. \end{theorem} \begin{proof} Similar to \cite[Theorem 3.1]{BIMinexact2013}. \end{proof} From now on, we assume that $z_k\neq0$ for all $k$. In other words, we assume that the method generates an infinite sequence. We will also assume that the initial iterate and parameters are chosen so that, for either type of $\sigma$, the previous results and properties hold. The technical result below has a proof similar to the one in \cite[Lemma 3.3]{BIMinexact2013} and hence is omitted. \begin{lemma}\label{estimate} Consider the sequences $\{(x_k,z_k)\}$, $\{(y_k,c_k)\}$ generated by {\rm DSG} algorithm. \begin{itemize} \item [{\rm(a)}] The following estimates hold for all $k\geq 1$ \begin{eqnarray} \label{lemequat1} f(x_k,z_k)-\langle A(z_k),y_0\rangle&\leq& q_k +r_k,\;\mbox{and}\\[3mm] \label{lemequat2} \sigma(z_k)\sum_{j=0}^{k-1}\alpha_js_j\sigma(z_j)&\leq& q_k-q_0+r_k. \end{eqnarray} \item [{\rm(b)}] Assume that the dual solution set $S(D)$ is nonempty. If $(\bar{y},\bar{c})\in S(D)$ then for all $k$, \begin{equation}\label{lemequat3} \|y_{k+1}-\bar{y}\|^2 \leq \|y_k-\bar{y}\|^2 + 2s_k\sigma(z_k)\left[\frac{s_k\sigma(z_k)}{2} + \displaystyle\frac{q_k-\bar{q}+r_k}{\sigma(z_k)} + \bar{c}-c_k \right]. \end{equation} \end{itemize} \end{lemma} \begin{proof} Similar to \cite[Lemma 3.3]{BIMinexact2013}. \end{proof} The following result holds for either type of $\sigma$. The only new result involved in its proof is the fact that, for $\sigma$ conditionally coercive, strong duality holds. Again, due to the similarity of the proof techniques with \cite[Lemma 3.4]{BIMinexact2013}, we omit its proof here. \begin{lemma}\label{zPrimalCvg}If the sequence $\{z_k\}$ converges weakly to $0$, then $\{q_k\}$ converges to $\bar{q}$, the primal sequence $\{x_k\}$ is bounded, and all its weak accumulation points are primal solutions. \end{lemma} \begin{proof} Similar to \cite[Lemma 3.4]{BIMinexact2013}. \end{proof} \subsection{Algorithm DSG-1}\label{ssec:alg1} We consider in this section the stepsize similar to the one given in \cite[Algorithm 1]{BIMinexact2013}, and use it for our particular scheme. The difference is the use of the function $A$ in the choice of the stepsize (see the definition of $\eta_k$ below). Take two parameters $\beta>\eta>0$. We consider the step size \begin{equation}\label{sk_DSG1} s_k\in [\eta_k,\beta_k], \end{equation} where $\eta_k:=\min\{\eta,\|A(z_k)\|+\|z_k\|\}$ and $\beta_k:=\max\{\beta,\sigma(z_k)+\|z_k\|\}$. With this choice of $s_k$, we denote the DSG~algorithm as DSG-1. \begin{remark}\rm If ${\bf (A_0)}$ holds, then \[\eta_k\leq \|A(z_k)\|+\|z_k\| \leq \sigma(z_k)+\|z_k\|\leq\beta_k, \] where first and last inequalities use the definition of $\eta_k,\beta_k$. The second inequality holds by ${\bf (A_0)}$. Note that, a constant stepsize for all iterations is admissible. \end{remark} \noindent The next theorem only requires a $\sigma$ which satisfies the following property: \begin{equation}\label{prop} \hbox{ if } \sigma(w_k)\downarrow 0 \hbox{ then }\{w_k\} \hbox{ bounded.} \end{equation} Its proof considers two possible cases, according to whether the dual sequence $(y_k,c_k)$ is bounded or not. The case of an unbounded sequence has a proof similar to the one \cite[Theorem 3.2]{BIMinexact2013}, and hence is omitted. The case of bounded dual sequence $(y_k,c_k)$ is slightly different because of our different type of stepsize, so we provide it here. \begin{theorem}\label{primalCvg1} Assume that $\sigma$ is an augmenting function verifies that if $\sigma(w_k)\downarrow 0$, then $\{w_k\}$ bounded, and assume that $M_P=M_D$. Consider the primal sequence $\{x_k\}$ generated by {\rm DSG-1}. Take the parameter sequence $\{\alpha_k\}$ satisfying $\alpha_k\ge\bar \alpha$ for all $k$ and some $\bar \alpha>0$. Then $\{x_k\}$ is bounded, all its weak accumulation points are primal solutions, and $\{q_k\}$ converges to the optimal value $M_P$. \end{theorem} \begin{proof} Take the dual sequence $\{(y_k,c_k)\}$ generated by DSG-1. If $\{(y_k,c_k)\}$ is unbounded, then the proof is similar to the corresponding part of \cite[Theorem 3.2]{BIMinexact2013}. We proceed to consider the case in which $\{(y_k,c_k)\}$ is bounded. By Proposition \ref{dualSeq} $(i)$, $\sum_k s_k\sigma(z_k)<\infty$. In particular, $\{s_k\sigma(z_k)\}$ converges to $0$. On the other hand, from $s_k\ge\min\{\eta,\|A(z_k)\|+\|z_k\|\}$, we obtain \[ s_k\sigma(z_k)\geq \min\{\eta\sigma(z_k),(\|A(z_k)\|+\|z_k\|)\sigma(z_k)\} \geq \min\{\eta\sigma(z_k),\|z_k\|\sigma(z_k)\}> 0, \] because $z_k\not=0$ for all $k$. Since $\eta>0$, we conclude that $\{\|z_k\|\}$ converges to $0$ or $\sigma(z_k)$ converges to $0$. We will show that either case implies that $\{z_k\}$ weakly converges to $0$. If $\{\|z_k\|\}$ converges to $0$ then $\{z_k\}$ converges strongly to $0$, and hence weakly to $0$. Alternatively, if $\sigma(z_k)$ converges to $0$, then $\{z_k\}$ is bounded by assumption. Then, there exists a subsequence $\{z_{k_j}\}$ weakly converging to some $\tilde{z}$. From the weak lower semicontinuity of $\sigma(\cdot)$, we have $0\le\sigma(\tilde{z})\le\liminf_{k\to\infty}\sigma(z_{k_j})=0$. Hence $\sigma(\tilde{z})=0$. The properties of $\sigma$ now imply that $\tilde{z}=0$. Therefore, the whole sequence $\{z_k\}$ weakly converges to $0$. Thus, in the case that $\{(y_k,c_k)\}$ is bounded, the results follows from Lemma \ref{zPrimalCvg} and the zero duality gap property $\bar q=M_P$. \end{proof} The following corollary holds because a conditionally coercive $\sigma$ induces strong duality and also verifies \eqref{prop}. \begin{corollary} If $\sigma$ verifies Definition \ref{def:assumptions_sigma}(b) with either (a) or (a'), then the conclusion of Theorem \ref{primalCvg1} holds. \end{corollary} \begin{proof} Since a conditionally coercive $\sigma$ verifies \eqref{prop}, the same holds for a coercive $\sigma$. By Theorem \ref{th:StrongDual}, strong duality holds. So we are in conditions of Theorem \ref{primalCvg1}. \end{proof} Theorem \ref{primalCvg1} above establishes primal convergence results for DSG-1, the following theorem establishes a dual convergence result, its proof is identical to \cite[Theorem 3.3]{BIMinexact2013} and hence omitted. \begin{theorem}\label{dualCvg1} If DSG-1 generates an infinite sequence $\{(y_k,c_k)\}$, then every weak accumulation point of $\{(y_k,c_k)\}$, if any, is a dual solution. \end{theorem} \begin{proof} See \cite[Theorem 3.3]{BIMinexact2013}. \end{proof} We know that, when $\{c_k\}$ is bounded, then $\{y_k\}$ bounded by Proposition \ref{dualSeq}. The converse is not necessarily true, and it holds under an additional assumption which requires the sequences $\{r_k\}$ and $\sigma(z_k)$ to decrease at a similar rate. \medskip ${\bf(\Gamma_0)}$: There exists $R>0$ such that $r_k\leq R\sigma(z_k)$ for all $k$, that is $r_k\approx O(\sigma(z_k))$. The proof of the next result is similar to \cite[Lemma 3.5]{BIMinexact2013} and hence omitted. \begin{lemma}\label{ycBounded} Assume that ${\bf(A_0)}$ and ${\bf(\Gamma_0)}$ hold. If the dual solution set is nonempty and $\{y_k\}$ bounded, then $\{c_k\}$ is bounded too. \end{lemma} \begin{proof} Similar to \cite[Lemma 3.5]{BIMinexact2013}. \end{proof} \begin{remark}\rm Lemma \ref{ycBounded} holds under assumptions ${\bf(A_0)}$ and ${\bf(\Gamma_0)}$ in the general framework of DSG, regardless the choice of the stepsize $s_k$. \end{remark} The following result extends \cite[Proposition 3.3]{BIMinexact2013} to our general case, since our function $\sigma$ and our stepsize are different, it requires a slightly different proof. \begin{proposition}\label{seq-dual} Assume that ${\bf(\Gamma_0)}$ holds, and that we are in conditions of Proposition \ref{sigma_k bounded}(a) or (b). Assume also that {\rm DSG-1} generates an infinite dual sequence $\{(y_k,c_k)\}$. If the dual optimal set is nonempty then $\{(y_k,c_k)\}$ is bounded. \end{proposition} \begin{proof} Under the conditions of Proposition \ref{sigma_k bounded}(a) or (b), we have that $\{\sigma(z_k)\}$ and $\{z_k\}$ are bounded, so take $b>0$ such that $\sigma(z_k)+\|z_k\|<b$ for all $k$. By definition, $s_k\le\beta_k\le\max\{\beta,b\}=:\hat b$. In particular, $s_k\sigma(z_k)\le\ b \hat{b}=\bar{b}$ for all $k$. Let $R$ be as in ${\bf(\Gamma_0)}$ and take $(\bar y,\bar c)\in S(D)$. We claim that $\{(y_k,c_k)\}$ is bounded. We will show firstly that $\{c_k\}$ is bounded. Suppose by contradiction that $\{c_k\}$ is unbounded. Thus there exists $k_0$ such that $c_k\ge M:=\frac{\bar b}{2}+R+\bar c$ for all $k\ge k_0$. Observing that $q_k\le\bar q$ and using the estimates in \eqref{lemequat3}, we obtain \begin{equation} \begin{array}{rcl} \|y_{k+1}-\bar{y}\|^2 &\leq& \|y_k-\bar{y}\|^2 + 2s_k\sigma(z_k)\left[\displaystyle\frac{s_k\sigma(z_k)}{2} + \displaystyle\frac{q_k-\bar{q}+r_k}{\sigma(z_k)} + \bar{c}-c_k \right]\\ \\ &\le& \|y_k-\bar{y}\|^2 + 2s_k\sigma(z_k)\left[\displaystyle\frac{\bar b}{2} + \displaystyle\frac{r_k}{\sigma(z_k)} + \bar{c}-c_k \right]\\ &&\\ &\le& \|y_k-\bar{y}\|^2 + 2s_k\sigma(z_k)\left[\displaystyle\frac{\bar b}{2} + R + \bar{c}-c_k \right]\\ &&\\ &\le& \|y_{k}-\bar{y}\|^2 \end{array} \end{equation} for all $k\ge k_0$. It follows that $\{\|y_k-\bar y\|\}$ is a decreasing sequence and hence $\{y_k\}$ is bounded. By Lemma \ref{ycBounded}, this entails a contradiction. Therefore, the dual sequence is bounded. \end{proof} Theorem \ref{dualconv}, which we prove next, establishes strong convergence of the whole dual sequence generated by DSG-1 to a dual solution. Theorem 3.4 in \cite{BIMinexact2013} relies on Fej\'er convergence properties and establishes only weak convergence of the dual sequence. Our proof is inspired by Theorem 5.1 in \cite{BIM2015} and uses the properties of $q$. { \begin{theorem}\label{dualconv} If ${\bf (A_0)}$ holds and the parameter sequence $\{\alpha_k\}$ satisfies that $\alpha_k\ge\bar\alpha$ for all $k$ and some $\bar\alpha>0$, then the following hold.\hfill \begin{itemize} \item[(i)] Assume that $\sigma$ is an augmenting function that verifies \eqref{prop}, and assume that $M_P=M_D$. If the dual sequence generated by {\rm DSG-1} is bounded then $S(D)\neq {\varnothing}$ and the dual sequence converges strongly to a dual solution. \item [(ii)] Assume that ${\bf (\Gamma_0)}$ holds, and that we are in conditions of Proposition \ref{sigma_k bounded}(a) or (b). If $S(D)\neq {\varnothing}$, then the dual sequence generated by {\rm DSG-1} is strongly convergent to some dual solution. \end{itemize} \end{theorem} \begin{proof} (i) Since the dual sequence $\{(y_k,c_k)\}$ is bounded, it converges strongly to some $(\tilde y,\tilde c)$ by Proposition \ref{dualSeq}(a)(c). We only need to prove now that the limit $(\tilde y,\tilde c)\in S(D)$. Indeed, we can write \begin{equation}\label{eq:dualCvg1} M_P=\lim_k q(y_k,c_k)\le q(\tilde y,\tilde c)\le M_P, \end{equation} where the equality follows from Theorem \ref{primalCvg1} and strong duality (see Theorem \ref{th:StrongDual}), note that we can write a limit because the sequence $\{q_k\}$ is increasing. The first inequality follows from the fact that $q$ is weakly (and hence strongly) upper semicontinuous, and the last inequality is a consequence of the fact that $q(\tilde y,\tilde c)\le M_D\le M_P$. Therefore, we showed that $(\tilde y,\tilde c)\in S(D)$ and the proof of (i) is complete. We now show (ii). Since the dual set is non-empty, by Proposition \ref{seq-dual}, the dual sequence $\{(y_k,c_k)\}$ is bounded. By (i), we have $\{(y_k,c_k)\}$ converges strongly to some $(\tilde y,\tilde c)\in S(D)$. \end{proof} \medskip The following straightforward corollary characterizes the existence of dual solutions. \begin{corollary}\label{boundedDualIFF} If ${\bf (A_0)}$ and ${\bf (\Gamma_0)}$ hold, and that we are in conditions of Proposition \ref{sigma_k bounded}(a) or (b). Assume that $\alpha_k\ge\bar\alpha>0$ for all $k$. The following statements are equivalent.\hfill \begin{itemize} \item [(a)] The dual sequence generated by {\rm DSG-1} is bounded. \item [(b)] The dual set is not empty. \end{itemize} \end{corollary} \begin{proof} The proof follows directly from the fact that the assumptions ensure that we are in conditions of both parts (i) and (ii) in Theorem \ref{dualconv}. \end{proof} } \subsection{Algorithm DSG-2}\label{sec:alg2} In this section we adopt the same stepsize proposed in \cite[Algorithm 2]{BIMinexact2013}, which ensures that DSG converges in a finite number of steps. We show in this section that these convergence results are preserved when using the map $A$ in the Lagrangian. \noindent Take $\beta>0$ and a sequence $\{\theta_k\} \subset\mathbb{R}_+$ such that $\sum_j\theta_j=\infty$, and $\theta_k\leq\beta$ for all $k$. Consider the step size \begin{equation}\label{sk_DSG2} s_k\in [\eta_k,\beta_k], \end{equation} where $\eta_k:= \theta_k/\sigma(z_k)$ and $\beta_k:= \beta/\sigma(z_k)$. DSG with this stepsize selection is denoted by DSG-2. The following result extends \cite[Theorem 3.5]{BIMinexact2013}. By looking carefully at the proof in \cite[Theorem 3.5]{BIMinexact2013}, it is seen that the assumptions can be weakened by just assuming that $\sigma$ verifies \eqref{prop}. Since the proof is similar to that in \cite[Theorem 3.5]{BIMinexact2013}, we omit it. \begin{theorem}\label{primalCvg} Let $\{(x_k,z_k)\}$ and $\{(y_k,c_k)\}$ be the sequences generated by {\rm DSG-2}. Suppose that the parameter sequence $\alpha_k\ge \bar \alpha>0$. Assume that $\sigma$ verifies \eqref{prop}. Then only one of the following cases occurs:\\ \noindent (a) There exists a $\bar{k}$ such that {\rm DSG-2} stops at iteration $\bar{k}$. As a consequence $x_{\bar{k}}$ and $(y_{\bar{k}},c_{\bar{k}})$ are $\epsilon$-optimal primal and $\epsilon$-optimal dual solutions, respectively. In this situation $\{(y_k,c_k)\}$ must be bounded. \noindent (b) The dual sequence $\{(y_k,c_k)\}$ is unbounded. In this case, $\{z_k\}$ converges weakly to $0$, $\{q_k\}$ converges to $M_P$, the primal sequence $\{x_k\}$ is bounded and all its weak accumulation points are primal solutions. \end{theorem} \begin{proof} Similar to \cite[Theorem 3.5]{BIMinexact2013}. \end{proof} This directly gives the following result. \begin{corollary}\label{boundedDualIFF-2} Let $\{(x_k,z_k)\}$ and $\{(y_k,c_k)\}$ be the sequences generated by {\rm DSG-2}. Suppose that the parameter sequence $\alpha_k\ge \bar \alpha>0$. Assume that $\sigma$ is either coercive or conditionally coercive. Then the conclusion of Theorem \ref{primalCvg} hold. \end{corollary} \begin{proof} The claim follows from the fact that both coerciveness and conditional coerciveness imply condition \eqref{prop}. \end{proof} \section{Acknowledgements} We thank C. Yalcin Kaya for useful discussions on various aspects of the DSG algorithm. \section{Concluding Remarks}\label{sec:conclusion} We provide a detailed analysis of primal-dual problems in infinite dimensions, when the dual problem is obtained by using a Lagrangian that involves a map $A$ in the linear term (see \eqref{eq:Lagrn} in Definition \ref{def:basic}), and an augmenting function which, in some cases, does not need to be coercive (see Definition \ref{def:assumptions_sigma}(a')). For such primal-dual pairs, we establish strong duality. Moreover, we show that the inexact DSG method has the same primal and dual convergence properties as the case when $A$ is the identity map. Namely, we show that every accumulation point of the primal sequence is a primal solution, and that, under certain technical assumptions, the dual sequence converges strongly to a dual solution (see Theorem \ref{dualconv}). Our analysis opens the way for the application of DSG to challenging optimal control problems, which are infinite dimensional optimization problems. It is particularly interesting to apply the results of the present paper to the pure penalty method, i.e., when $A=0$. The latter case is not covered by the results in \cite{BKMinexact2010}. \def$'${$'$}
\section{Introduction} Self-supervised learning (SSL) \cite{he2020momentum}\cite{he2022masked} has shown impressive potential in various vision tasks and applications, owing to increasingly available data and advancing hardware. SSL extracts semantically rich information from large-scale unlabelled data and delivers a foundation model (e.g., \cite{bao2021beit}, \cite{devlin2018bert}) whose representations can be transferred for downstream tasks. Among the blossom of self-supervised learning methods, there are two dominant branches: contrastive learning and masked image modelling. Contrastive learning (e.g., \cite{chen2020simple}, \cite{he2020momentum}) enables the unsupervised learning by maximizing the agreement between two different augmented views from the same input. The key is to introduce reliable and challenging data augmentations that encourages semantically meaningful representations. Contrastive learning approaches have demonstrated exceptional results in the past few years, which even surpassed supervised learning algorithms. Recently, masked image modelling (e.g., \cite{xie2022simmim}, \cite{he2022masked}) has become another main paradigm for learning self-supervised vision representations. The idea of masked image modelling stems from the success of masked language pre-training (e.g., \cite{devlin2018bert}, \cite{brown2020language}) in Natural Language Processing. The objective is to reconstruct original images from partially masked inputs. Masked image modelling presents high efficiency under a high mask ratio and achieves superior performance than contrastive learning across various benchmarks (e.g., \cite{deng2009imagenet} \cite{lin2014microsoft}). However, both contrastive learning and masked image modelling suffer from their own limitations. Contrastive learning relies heavily on data augmentations and requires additional techniques such as memory bank \cite{wu2018unsupervised}, momentum encoder \cite{he2020momentum}, and stop-gradient \cite{chen2021exploring}. In \cite{chen2021empirical}, the authors also pointed out the necessity to freeze the patch embedding layer when training with vision transformers \cite{dosovitskiy2020image}. Additionally, the quality of negative samples \cite{robinson2020contrastive} is also critical for contrastive learning. As for masked image modelling, it optimizes a pixel-level objective, which gains low-level representation and knowledge from the images. Therefore, such pre-training lacks of high-level representation, especially the semantic meanings behind the images. Recent studies \cite{chung2021w2v} \cite{huang2022contrastive} \cite{mishra2022simple} \cite{zhou2022mimco} \cite{yao2022masked} attempt to combine the power of contrastive learning and masked modelling, yielding promising results. They suggest that both paradigms are complementary with each other and can deliver stronger representations when they are combined into a unified framework. Furthermore, integrating two paradigms into one framework introduces higher computational cost, which requires extensive resources (e.g., hundreds of GPU hours, enormous memory capacity, and excessive storage requirements). It is also not energy-efficient to training different frameworks from the scratch as they all tend to require large training epochs but the resulting difference in the performance is often negligible. In this work, we introduce \textbf{MOMA}, which integrates knowledge from pre-trained contrastive learning (i.e., \textbf{MO}co) and masked image modelling (i.e., \textbf{MA}sked autoencoder) through knowldge distillaiton \cite{hinton2015distilling}. There are three options presented in MOMA: (1) Distil from pre-trained MoCo to pre-trained MAE. (2) Distil from pre-trained MAE to pre-trained MoCo. (3) Distil from both pre-trained MoCo and MAE to a random initialized student model. We feed the original image to the teacher model and pass masked or intensively augmented samples to the student model. The learning objective is straightforward, which aligns the representations from normalized teacher outputs and reconstructed student outputs. This design leads to a simple and efficient framework for combining both contrastive learning and masked modelling. MOMA can accept an extremely high mask ratio during training, which leads to lower computational cost and faster training speed. Instead of training from the scratch, MOMA fully uses the pre-trained checkpoints from existing state-of-the-art paradigms. It enables MOMA to achieve excellent performance within only limited number of training epochs, which saves computation,energy and achieves competitive performance across different tasks. Additionally, it does not require a sophisticated design for knowledge distillation objectives as it directly aligns the representations from teacher and student. Finally, MOMA makes it possible to extract a more compact and lightweight model that fuses the power of different self-supervised learning paradigms. The proposed work enables new framework and mechanisms to utilize large-scale self-supervised models effectively and perform transfer in an energy-efficient manner. \section{Related Work} \begin{figure}[H] \vskip 0.2in \centering \includegraphics[width=0.35\textwidth,height=4.5cm]{moco.png} \caption{\textbf{Momentum Contrast (MoCo).} MoCo \protect\cite{he2020momentum} is one of the state-of-the-art method in contrastive learning. It proposed a siamese network structure, where the overall objective is to minimize the contrastive loss (maximizing the agreement) between the main encoder and the momentum encoder.} \label{fig:moco} \vskip -0.2in \end{figure} \textbf{Contrastive Learning.} This branch of self-supervised learning approaches stems from the idea of instance discrimination \cite{wu2018unsupervised}, which treats each sample as a class. Each sample goes through strong data augmentation operations. The augmented views from the same instance are positive pairs, whereas the augmented views from different instances are negative pairs. The learning is enabled by maximizing the agreement between positive samples (or disagreement between negative pairs). Memory bank is one of the critical components in this process, which ensures the diversity of negative samples. MoCo \cite{he2020momentum} (see \textbf{Figure \ref{fig:moco}}) introduced a momentum component (updated by exponential moving average) in the framework, which further improves the performance of siamese learning network. SimCLR \cite{chen2020simple} showed that non-linear projector, large batch size and stronger combinations of data augmentation operations are critical for the performance in contrastive learning. Later, the improved version of MoCo \cite{chen2020improved} \cite{chen2021empirical} and SimCLR \cite{chen2020big} further improved the benchmarks by integrating each other's techniques and adopting larger vision transformers \cite{dosovitskiy2020image}. SwAV \cite{caron2020unsupervised} introduced clustering into the framework, which eases the requirements for large number of negative samples. BYOL \cite{grill2020bootstrap} applied an additional predictor after the projector in the contrastive learning framework and showed that the method could achieve excellent results without negative samples. DINO \cite{caron2021emerging} further improved the BYOL's idea and incorporated self-distillation. Simsiam \cite{chen2021exploring} introduced stop-gradient operation, demonstrating that prevention of the mode collapse is the essential part of contrastive learning. \begin{figure}[H] \vskip 0.2in \centering \includegraphics[width=0.4\textwidth,height=5cm]{mae.png} \caption{\textbf{Masked AutoEncoder (MAE).} MAE \protect\cite{he2022masked} is a powerful masked image modelling method which was proposed recently. It masks large portion of the image and applies asymmetric encoder-decoder network to restruct the original image. Its simple design leads to fast and effective self-supervised representation learning} \label{fig:mae} \vskip -0.2in \end{figure} \begin{figure*}[t] \vskip 0.2in \centering \includegraphics[width=0.75\textwidth,height=5cm]{moma_frame.png} \caption{\textbf{Overview of MOMA.} During distillation, the teacher model is frozen without gradient update and the student is updated through gradient. In the single teacher setting, the knowldge is either distilled from a MAE to a MoCo or the reverse direction. In the multiple teachers setting, knowledge from MoCo and MAE is distilled to a randomly initialized student.} \label{fig:moma_pic} \vskip -0.2in \end{figure*} \textbf{Masked Image Modelling.} The early work \cite{pathak2016context} introduced inpainting as a pretext task for self-supervised learning, which reconstructs corrupted inputs for self-supervised learning. iGPT \cite{chen2020generative} performed reconstruction on corrupted images, following the auto-regressive approach described in GPT \cite{brown2020language}. In contrast, BEiT \cite{bao2021beit} followed a BERT \cite{devlin2018bert} style pre-training paradigm, which recovered the masked images tokens in an autoencoding manner. It adopts a pre-trained tokenizer in the framework to transform input images into visual tokens. MAE \cite{he2022masked} (see \textbf{Figure \ref{fig:mae}}) and SimMIM \cite{xie2022simmim} are two concurrent works that present an end-to-end framework with asymmetric encoder-decoder architecture, and they adopted a high mask ratio to boost the computational efficiency. The idea is simple and straightforward, where the masking strategy can be as simple as random masking. In MAE, the encoder took unmasked patches and the decoder reconstructed the original images based on encoded visible tokens and masked tokens. The result surpassed the previous state-of-the-arts presented by contrastive learning. Moreover, the latter supports both vision transformers \cite{dosovitskiy2020image} and hierarchical vision transformers (Swin \cite{liu2021swin}). MaskFeat \cite{wei2022masked} applied masks on the histogram of gradient (HOG) features and reconstructed those features to enable learning. \textbf{Combining Two Paradigms.} Recent work attempted to combine the power of contrastive learning and masked image modelling. SIM \cite{tao2022siamese} incorporated masking as part of the data augmentation operations into the contrastive learning framework. iBOT \cite{zhou2021ibot} adopted a siamese network structure as contrastive learning and minimize the distance between the masked branch and the unmasked branch. MimCo \cite{zhou2022mimco} tried to improve the linear separability of masked image modelling by introducing a two-stage pre-training methods that includes contrastive learning and masked image modelling. CAN \cite{mishra2022simple} applied mask on both branches in siamese network and optimized an InfoNCE loss \cite{oord2018representation}, a reconstruction loss, and a denoising loss. CMAE \cite{huang2022contrastive} computed a reconstruction loss and a contrastive loss based on the decoder's outputs between the online branch and the target branch. MACRL \cite{yao2022masked} proposed an asymmetric siamese network structure, which applied masks on the online branch and passed the original images into the target momentum branch (both encoder and the projector). The framework optimized a contrastive objective based on the encoded representations and a reconstruction objective based on the decoded outputs. \textbf{Knowledge Distillation.} The idea is proposed in \cite{hinton2015distilling}, which introduced a way to transfer knowledge from a well-trained teacher model to a more compact or compressed student model. Existing methods also attempted to utilize knowledge distillation as part of the self-supervised learning framework. MVP \cite{wei2022mvp} and MaskDistill \cite{peng2022unified} include a CLIP \cite{radford2021learning} as the teacher to guide self-supervise learned features. Teacher with high capacity and rich representation leads to stronger students. dMAE \cite{bai2022masked} presented masked knowledge distillation on the intermediate features between student and teacher. The method optimized a mask reconstruction loss and a $L_1$ distillation loss. dBOT \cite{liu2022exploring} introduced multi-stage masked knowledge distillation from itself. Between stages, the teacher is re-initialized with the student weights with exponential moving average and student is randomly initialized. With bootstrapped teachers, dBOT can achieve better performance than the existing baseline. \begin{figure*}[t] \vskip 0.2in \centering \includegraphics[width=0.7\textwidth,height=5.5cm]{moma_detail.png} \caption{\textbf{Distillation Procedure of MOMA.} MOMA follows asymmetric siamese network structure. The teacher takes the original image (or optionally strong augmented image) and the student takes masked image (or with optionally extra strong data augmentations). The objetive is to align the outputs between normalized teacher representation and projected student representation.} \label{fig:moma_detail} \vskip -0.2in \end{figure*} \section{Approach} \subsection{Preliminary} \textbf{Momentum Contrast} Our work borrows some of the insights from the state-of-the-art contrastive learning method MoCo v3 \cite{chen2021empirical}. The ideas of MoCo is shown below: \begin{equation} \mathcal{L}_{MoCo}=-\log \frac{\exp \left(q \cdot k_{+} / \tau\right)}{\sum_{i=0}^K \exp \left(q \cdot k_i / \tau\right)} \label{eq:moco} \end{equation} where $q$ is encoded query from the main encoder and $k$ is the encoded key from the other branch's momentum encoder. The framework minimizes the $\mathcal{L}_{MoCo}$ where query is supposed to be similar to positive keys (i.e., $k_{+}$) and dissimilar to all other (negative) keys. The siamese network architecture of teacher and student works in the similar way as the momentum setup in MoCo, where there is a frozen teacher branch and an updating student branch. However, the objective is to minimize the Smooth $L_1$ loss between the two branches rather than the traditional contrastive loss \cite{oord2018representation}. Moreover, we utilize the strong data augmentation operations mentioned in MoCo, including combinations of Gaussian blurring, solarization, colour jittering, and grey scaling. Such augmentation methods encourage model to learn invariant features that are more robust and generalizable. Furthermore, we adopt large batch size (i.e., 4096) as suggested by MoCo, enabling diverse feature sets and representations learning. \textbf{Masked AutoEncoder} Masked AutoEncoder \cite{he2022masked} is the dominant approach in visual pre-training, surpassing the performance of contrastive learning with less computational requirements. MAE adopts asymmetric encoder-decoder architecture, where the encoder takes visible tokens (randomly masked out from the original inputs) and the decoder processes the encoded representation and the masked tokens to reconstruct the original inputs. The objective is shown below: \begin{equation} \mathcal{L}_{MAE}=\mathcal{L}\left(\mathcal{D}_\theta \circ \mathcal{E}_\theta \left(\mathbf{x} \odot \mathcal{M}\right), \mathbf{x}\right) \label{eq:mim} \end{equation} where $\mathcal{E}$ and $\mathcal{D}$ are the encoder and decoder, respectively. $\mathcal{M}$ stands for the random mask applied on the input $x$. It applies random masking with high mask ratio (e.g., 75\%) which saves huge computation for its encoder. In our work, we apply random masking to the inputs as well, with similar or even higher mask ratio. Additionally, the mask is not limited to the student branch, but also eligible for the teacher(s) branch. By applying masks for both teachers and student, we enable efficient training for multiple teachers and scale our framework effectively. Different from the original MAE, our target is not to reconstruct the pixel values of original images, but to align the features for the teacher(s) and student. Therefore, we don't have the decoder component for the teacher and student, which further saves the computation. Furthermore, feature alignment encourages the model to maintain high level semantical inforamtion rather than pixel level reconstruction. \subsection{Overview of MOMA} \textbf{Teacher.} We utilized publicly available checkpoints from pre-trained MoCo \cite{chen2021empirical} and MAE \cite{he2022masked}. We used the ViT-Base model, which is a 12-layer vision transformer \cite{dosovitskiy2020image} with 12 attention heads for most of our experiments. We also use the ViT-Large model (i.e., 24-layer,16 heads, and 1024 embedding size) to further boost the performance. There are three different settings for the teacher. In the single-teacher setup, we either used a pre-trained MoCo model or a pre-trained MAE as the teacher. We utilized both pre-trained MoCo and pre-trained MAE as teachers for the multi-teacher setup. The weights are frozen for all layers in the teacher model. \textbf{Student.} We adopted different settings for single-teacher and multi-teacher setups.In single-teacher distillation, a pre-trained MAE is the student model when the pre-trained MoCo is the teacher. On the other hand, a pre-trained MoCo will be treated as the student if the pre-trained MAE is the teacher model. Therefore, in the single-teacher setup, the student model has the sizes limited by those pre-trained checkpoints (i.e., ViT-Base). In the multi-teacher setup, we used a random initialized vision transformer as the student. As the student is randomly initialized, we can use model of arbitrary size. By default, we adopted a 12-layer 12-head vision transformer for fair comparison with the single-teacher setup. In practice, we are able to use more compact and lightweight student for more efficient processing and storage, such as ViT-Small (i.e., 12-layer, 12-head, 384 embedding dim). \textbf{Figure \ref{fig:moma_pic}} provides an overview of MOMA framework and illustrates the single-teacher and multiple-teacher setups. \textbf{Distillation Procedure.} For the teacher(s), a normalization layer will be applied after the inputs go through the transformer layers. We incorporated Layer Normalization \cite{ba2016layer} to produce the normalized features as it is the de-facto choice for vision transformers. For the student model, there is a non-linear projection head following the transformer layers. The projection head is a fast and lightweight single linear layer, which projects the learned features from the student, and matches the dimension with the teacher. During training, only the student model is active and the teacher model is frozen without any gradient update. The knowledge distillation is achieved by aligning the outputs from teacher(s) and the student branches. We applied a Smooth $L_1$ loss for training the framework. In practice, we can distill from a larger teacher model (e.g., ViT-Base, ViT-Large) to a smaller student model (e.g., ViT-Base, ViT-Small) to achieve good performance and computational efficiency. The distillation procedure of MOMA is displayed in \textbf{Figure \ref{fig:moma_detail}}. \subsection{Single Teacher} The general procedure of single teacher distillation is shown below: \begin{equation} \mathcal{L}_{Single}={Smooth}\mathcal{L}_{1}\left(\mathcal{P} \circ \mathcal{S}\left(\mathbf{x} \odot \mathcal{M}\right), \mathbf{N}\circ\mathcal{T}\left(\mathbf{x}\right)\right) \label{eq:single} \end{equation} where $\mathcal{N}$ is the normalization, $\mathcal{P}$ is the projector, $\mathcal{M}$ denotes the mask. $\mathcal{T} and \mathcal{S}$ refer to the teacher and student, respectively. If the teacher or student takes samples with strong data augmentations, we can replace $\mathbf{x}$ with $\mathbf{x}_{aug}$ in the above formula. \textbf{MoCo to MAE.} In this setup, a pre-trained MoCo model is treated as the teacher and a pre-trained MAE model is treated as a student. During the forward pass, original images are fed into the teacher model, which go through the attention blocks and the normalization layer. Masked images are fed into the student, saving the computational cost (i.e., smaller portion of total inputs) and making the learning more challenging. The masked ratio can be even higher than the original configuration described in MAE \cite{he2022masked} (e.g., 75\%). There is another option to feed in strong augmented samples (as described in MoCo\cite{chen2021empirical}) into the student model. The reason for this setup is that we want to force the student to perform the learning task which its teacher was previously pre-trained on (i.e., MoCo is pre-trained on strong augmented samples). \textbf{MAE to MoCo.} This is the reverse setup compared to the "MoCO to MAE" settings, where the teacher is a pre-trained MAE and the student is a pre-trained MoCo. The teacher model processes the original images and the student model takes the masked inputs with high mask ratio. Since the teacher model's pre-training is masked image modelling already (no strong augmentation used in teacher's pre-training), we did not apply strong augmentation for the student model. \subsection{Multiple Teachers.} The distillation procedure for multiple teachers is shown as follows: \begin{equation} \begin{split} \mathcal{L}_{Multi} = \alpha \times {Smooth}\mathcal{L}_{1}\left(\mathcal{P} \circ \mathcal{S}\left(\mathbf{x} \odot \mathcal{M}\right), \mathbf{N}\circ\mathcal{T}_{MAE}\left(\mathbf{x}\right)\right) \\ + \beta \times {Smooth}\mathcal{L}_{1}\left(\mathcal{P} \circ \mathcal{S}\left(\mathbf{x} \odot \mathcal{M}\right), \mathbf{N}\circ\mathcal{T}_{MoCo}\left(\mathbf{x}\right)\right) \label{eq:mul} \end{split} \end{equation} where $\mathcal{T}_{MAE}$ and $\mathcal{T}_{MoCo}$ denote the MAE teacher and MoCo teacher, respectively. The remaining notations follow the same convention as the single teacher setup. In this setup, we adopted two pre-trained teacher models: a MoCo and a MAE. We set the student model to be a randomly initialized vision transformer, but it is also possible to use a pre-trained student model. During the distillation, original images are passed to the teacher models and their own normalization layers. Two extracted representations are obtained from the teachers. As for the student model, we feed two sets of inputs: strong augmented samples, and masked samples. The design consideration follows the idea of the single-teacher setup, where we encourage the student model to perform the same learning task as its teacher(s) was previously pre-trained on. Therefore, we also obtain two extracted representations from the student model. The learning objective is to minimize the distance between the representations from the teachers and the student, which is shown in \textbf{Equation}. We distill from two ViT-Base teachers into a ViT-Base student. In practice, we can use more lightweight student model such as ViT-Small. \section{Experiments} \subsection{ImageNet-1K Results} We perform the knowledge distillation as a self-supervised pre-training on ImageNet-1K \cite{deng2009imagenet} dataset. It contains 1.2 million images, where the input size is set to $224 \times 224$ and there are 1,000 classes in total (class information is not used during the knowledge distillation / pre-training). We utilized patch size of 16 for ViT-Small (12-layer/6-head), ViT-Base (12-layer/12-head), and ViT-large (24-layer/16-head) model; therefore, the total token size is 196. \textbf{Batch Size.} Although we utilized the pre-trained weights from MoCo v3 \cite{chen2021empirical}, our framework is not based on contrastive learning. Therefore, there is no need for large batch size. According to the setup in MoCo v3 and MAE \cite{he2022masked}, both adopted a batch size of 4,096. Therefore, we use batch size 4,096 by default during the pre-training stage. For fine-tuning, we adopted a batch size of 1,024. \textbf{Data Augmentation.} During pre-training, we applied random resize crop and random horizontal clip for the original samples and the randomly masked samples. For the strong augmented samples, we followed the procedure described in MoCo v3 \cite{chen2021empirical} and BYOL \cite{grill2020bootstrap}, where additional color jittering, grey scaling, gaussian blurring, and solarization were adopted. In fine-tuning, we utilized random resize crop, Autoaugment \cite{cubuk2018autoaugment}, and Cutmix \cite{devries2017improved}. \textbf{Optimizer.} Following the setup in MoCo v3 \cite{chen2021empirical} and MAE \cite{he2022masked}, we adopted AdamW \cite{loshchilov2017decoupled} for pre-training, fine-tuning. A cosine annealing scheduler \cite{loshchilov2016sgdr} is applied for all optimizers with 5 warm up epochs. \textbf{Pre-training.} By default, we train the distillation framework in the pre-training stage for 100 epochs with 20 warm up epochs. We adopt a learning rate of 1.5e-4, weight decay rate of 0.05, and $\beta_1, \beta_2$ of 0.9, 0.95. We employed a extremely high mask ratio of 90\%. \textbf{Fine-tuning.} The weight obtained from the pre-training stage is tuned end-to-end with the ground-truth labels. We adopted a learning rate of 1.5e-3, a weight decay rate of 0.05, and $\beta_1, \beta_2$ of 0.9, 0.999. We trained for 100 epochs with 5 warm up epochs. \textbf{Main Results.} As we can see from the \textbf{Table \ref{tab:image1kft}}, our methods outperform the existing self-supervised learning approaches on ImageNet. It adopts a ViT-Large from MAE as teacher and a ViT-Base from MoCo as the student. Comparing to those methods, MOMA utilizes much less training epochs, which is much more computationally efficient and energy-saving. Moreover, it adopted extremely high mask ratio (i.e., 90\%) to further boost the performance and efficiency, which is much higher than the original MAE setup (i.e., 75\%). Furthermore, it show better results than the supervised training counterpart, which is trained for 300 epochs. \begin{table} \centering \caption{\textbf{Fine-tuning accuracy on ImageNet-1K.} All methods use ViT-Base model.} \vskip 0.15in \begin{tabular}{lrr} \toprule Method & Epochs & Top-1 Acc (\%)\\ \midrule Sup. \cite{touvron2021training} & 300 & 81.8 \\ MAE \cite{he2022masked} & 1600 & 83.6 \\ MoCo v3 \cite{chen2021empirical} & 300 & 83.2 \\ SimMIM \cite{xie2022simmim} & 800 & 83.8 \\ BEiT \cite{bao2021beit} & 800 & 83.2 \\ MOMA & 100 & 84.2 \\ \bottomrule \end{tabular} \label{tab:image1kft} \vskip -0.1in \end{table} \subsection{Ablation Study} \textbf{Distillation Options.} We evaluate the effect of different distillation methods. As we can see from \textbf{Table \ref{tab:disopt}}, using a MoCo pre-trained model as the teacher and a MAE pre-trained model as the student yields the best results. Comparing with distilling from MAE to MoCo, MoCo teacher achieves better results because our proposed distillation approach is built upon masked image modelling. Therefore, a contrastive learning-based teacher helps compensate for the semantic and high level knowledge. Still, Masked image modelling teacher advances the overall performance. The reason is that our framework performs masked modelling on feature-level semantic information (i.e., align the representations from teacher and student), rather than pixel-level construction. Therefore, our propose method enjoys both low-level and high-level knowledge. However, as the model scales, MAE pre-trained model shows significant better finetune performance over MoCo pre-trained model. Therefore, for teacher of size ViT-Large, we adopted MAE pre-trained models as the teacher for better performance. As for the multiple teachers setup, it does not perform as good as the single teacher setup. Moreover, multiple teachers increases the computational burden during the pre-training. The current strategy for learning from multiple teacher is averaging the alignment loss from both teachers. We can possibly improve the performance by applying a weighted average with learnable parameters. It is preferred less than the single-teacher setup due to the computation trade-off. \begin{table} \centering \caption{\textbf{Comparison of fine-tuning accuracy on ImageNet-1K from different distillation options.} All methods use ViT-Base model unless otherwise stated. Both teacher (s) and student are ViT-Base model. Mask ratio is 90\% for all entries.} \vskip 0.15in \begin{tabular}{lr} \toprule Method & Top-1 Acc (\%)\\ \midrule MAE to MoCo & 83.7 \\ MoCo to MAE & 84.0 \\ Multi & 83.4 \\ \bottomrule \end{tabular} \label{tab:disopt} \vskip -0.1in \end{table} \textbf{Model Size.} We estimate how the size of teacher model and student model affect the performance. As shown in \textbf{Table \ref{tab:dissize}}, all teacher models are MAE pre-trained and all student models are MoCo pre-trained. We can see that larger teacher and larger student lead to better performance, which is understandable as larger models have larger capacity. Furthermore, small student can achieve comparable performance after distillation from the larger teacher, leading to parameter-efficient models. The lightweight student models saves storage and computation power, with acceptable trade-off over the performance. \begin{table} \centering \caption{\textbf{Comparison of fine-tuning accuracy on ImageNet-1K for different model size.} All methods use ViT-Base model unless otherwise stated. All teacher models are MAE pre-trained, all students are MoCo pre-trained. Mask ratio is 90\% for all entries.} \vskip 0.15in \begin{tabular}{lr} \toprule Method & Top-1 Acc (\%)\\ \midrule Large to Base & 84.2 \\ Large to Small & 80.8 \\ Base to Base & 83.7 \\ Base to Small & 78.6 \\ \bottomrule \end{tabular} \label{tab:dissize} \vskip -0.1in \end{table} \textbf{Mask Ratio.} For the mask ratio, we evaluate with different mask proportion. The results are shown in \textbf{Table \ref{tab:disratio} }. According to the results, we can see that as the mask ratio increases, the performance first improves then drops. When mask ratio is low, the learning task is easy and the student does not learn enough information. A higher mask ratio within a reasonable range makes the learning task more challenging and forces the model to extract more information from the data. However, when the mask ratio exceeds some specific threshold, the model losses too much information from the original data and the performance begins to degrade. As we can see, the proposed MOMA adopts much higher mask ratio than the original MAE, enabling faster and more efficient learning. \begin{table} \centering \caption{\textbf{Comparison of fine-tuning accuracy on ImageNet-1K for different mask ratio.} All methods use ViT-Base model for both teacher and student, which distill from pre-trained MoCo to pre-trained MAE.} \vskip 0.15in \begin{tabular}{lr} \toprule Mask Ratio & Top-1 Acc (\%)\\ \midrule 75\% & 83.4 \\ 80\% & 83.7 \\ 85\% & 83.8 \\ 90\% & 84.0 \\ 95\% & 83.6 \\ \bottomrule \end{tabular} \label{tab:disratio} \vskip -0.1in \end{table} \textbf{Further Considerations.} By default, we pre-trained our framework for 100 epochs, which is significantly less epochs compared to the existing approaches and computationally efficient. In the experiment, we also tested the extreme case, where we only pre-trained the distillation model for 50 epochs. By halving the training epochs, we saw a performance degradation of around 1.6\%, which is still acceptable. This is critical when computational resource is limited and we need to consider the performance and cost trade-off. Moreover, we investigated the effect of data augmentation. By default, strong data augmentation operations from MoCo is only applied for the MoCo teacher and MAE student setup. Applying strong data augmentation for MAE teacher is not useful as MAE teacher is never trained on such augmented samples, so it will not yield meaningful representations. We attempted to remove the strong data augmentation for MoCo teacher and observed a performance degradation of 1.3\%. This suggests that effective data augmentation for MoCo Pre-trained teacher is necessary and can boost performance. Furthermore, we explored the stop gradient operation used in MoCo. By default, we did not apply any stop gradient operation for the patch embedding in both the teacher and student models (unlike MoCo v3, where the patch embedding is frozen) for all our experiments. We attempted to use stop gradient operation for the student in our framework, and this did not lead to a significant change in the performance. The results indicate that stop-gradient / patch frozen is not necessary for our proposed framework. We also investigated whether the frameworks could be further accelerated by feeding masked inputs into the teacher model. However, masking the teacher branch led to significant performance degradation, compromising the overall performance of the framework. Therefore, it is critical to feed the unmasked image for the teachers to give effective guidance for the student model. \subsection{Transfer Learning on Downstream Task} \textbf{Semantic Segmentation.} We evaluated the proposed framework on downstream segmentation tasks using the ADE20K \cite{zhou2019semantic} dataset with UperNet \cite{xiao2018unified} framework. ADE20K contains 25K images in 150 classes, and we utilized images of size $512 \times 512$. We fine-tuned the pre-trained models (already finetuned on ImageNet-1K) for 160K steps on ADE20K. The pre-trained model is delivered using ViT-Large MAE as the teacher and ViT-Base MoCo as the student. By default, we used a batch size of 16, weight decay of 0.05, the layer decay rate of 0.65, and learning rate of 1e-4. According to the results shown in \textbf{Table \ref{tab:disseg}}, our proposed method outperforms the other methods, presenting great ability in the downstream task. \begin{table} \centering \caption{\textbf{Comparison of semantic segmentation performance on ADE20K.} All methods use ViT-Base model. The MoCo v3 entry uses the results in \protect\cite{tao2022siamese}. } \vskip 0.15in \begin{tabular}{lr} \toprule Method & mIoU (\%)\\ \midrule Sup. \cite{liu2021swin} & 46.6 \\ MAE \cite{he2022masked} & 48.1\\ MoCo v3 \cite{chen2021empirical} & 47.3 \\ MOMA & 48.6 \\ \bottomrule \end{tabular} \label{tab:disseg} \vskip -0.1in \end{table} \textbf{Classification Task.} We explored the transfer learning ability on image classification tasks. We adopted two smaller datasets, CIFAR-10 \cite{krizhevsky2009learning} and CIFAR-100 \cite{krizhevsky2009learning}. Both of them have 60,000 training (50,000 training and 10,000 testing) of size $32 \times 32$. CIFAR-10 has 10 classes and CIFAR-100 has 100 classes. We follow the fine-tuning procedure described in \cite{dosovitskiy2020image} and \cite{chen2021empirical}. The results are shown in \textbf{Table \ref{tab:discls}}. As we can see from the results, the proposed method (i.e., ViT-Large MAE Teacher and ViT-Base MoCo Student) achieves superior or competitive results among all the methods, showing great performance for transfer learning. \begin{table} \centering \caption{\textbf{Comparison of transfer learning accuracy (\%) on downstream datasets.} All methods use ViT-Base model. Thd random initialization and supervised learning entries are from \protect\cite{dosovitskiy2020image}} \vskip 0.15in \begin{tabular}{lrr} \toprule Method & CIFAR-10 & CIFAR-100\\ \midrule Random Init. &77.8 & 48.5\\ Sup. & 98.1 & 87.1\\ MAE & 99.1 & 91.6\\ MoCo v3 &98.9 & 90.5\\ MOMA & 99.2 & 91.4 \\ \bottomrule \end{tabular} \label{tab:discls} \vskip -0.1in \end{table} \section{Conclusion} Self-supervised learning has achieved exceptional results in various tasks, where contrastive learning and masked image modelling are the two mainstream approaches. However, they usually require high computational resources in addition to their individual limitations. The two methods are complementaty to each other and can be combined effecitvely to leverage their respective strength. To this end, we proposed MOMA, which distills knowledge from self-supervised pre-trained models in a self-supervised manner. MOMA fuses knowldge from contrastive learning and masked image modelling pre-trained models, yielding more powerful, compact and semantically meaningful representations. The proposed method achieves competitive results across different vision datasets and tasks. Additionally, MOMA requires significantly less training epochs compared to the existing self-supervised learning approaches. Furthermore, extremely high mask ratio enables the proposed framework to be fast and efficient, saving computational resource and energy. We hope our work can inspire future studies on how to effectively utilize self-supervised learning in an effective and efficient way.
\section{Introduction} Rare-earth monopnictides (RE-Vs), with simple rock-salt crystal structure composed of two interpenetrating face-centered cubic ($fcc$) sublattices (Figure~\ref{fig1}a), are fully compensated semimetals with electron pockets centered at three X points and two hole pockets at $\Gamma$, as shown in Figure~\ref{fig1}b for LaSb. RE-V thin films have been epitaxially grown on III-V semiconductors \cite{palmstrom1988epitaxial, buehl2010growth, kawasaki2013surface} and sought as structurally perfect (defect-free) epitaxial contacts \cite{palmstrom1988epitaxial,hanson2006eras}, as nanoparticles embeded in III-Vs for thermoelectrics, infrared and terahertz generation and detection \cite{liu2011properties,kawasaki2011local,kawasaki2013size, lu2014self,bomberger2017overview,krivoy2018rare}. Some members of this material family display interesting properties such as extremely large magneto-resistance and non-trivial topological phase including a recently observed unusual magnetic splitting phenomenon \cite{tafti2016resistivity,zeng2016LaSbcompensated,wu2016asymmetric,nayak2017multiple,lou2017evidenceLaBi,kuroda2018experimentalCePn,schrunk2022emergence}. The relatively small overlap in energy between the electron and hole pockets have led researchers to expect that this overlap could be lifted and a band gap would ultimately be opened in structures with reduced dimension such as nanoparticles or thin films due to the quantum confinement effect (QCE). So far, this has not been realized, and the reasons for it have remained unknown \cite{allen1990magneto,kawasaki2011local,kawasaki2013size}. Using first-principles calculations for free standing slabs of LaSb (taken as an example, here) we show that the overlap in energy between the electron pockets lying in the film-plane directions (X$_x$ and X$_y$) and the hole pockets at $\Gamma$ indeed decreases upon dimensional reduction in thin films, but the electron pocket along the film-plane normal direction, at X$_z$, which is projected onto ${\overline{\Gamma}}$ in the 2D Brillouin zone (BZ) of the thin film, remains. This direction dependent behavior is attributed to the directional nature of the electron pocket wavefunctions, originating from the rare-earth 5$d$ orbitals, which maintains the metallic character in thin films. However, for films that are 7 or less monolayers (ML) thick, we show that orbital-selective QCE may ultimately lead to an inverted band gap which produces helical spin-momentum locked edge states in quasi 2D nanoribbons. Calculations of the $\mathbb{Z}_2$ invariant, spin-resolved local density of states (LDOS), and spatial distribution of wavefunctions associated with edge modes confirm the non-trivial topology in the electronic structure of these ultra-thin films. This material system provides a novel platform for realizing the intrinsic quantum spin Hall (QSH) insulator phase in experiment different from the two well-known examples of semiconductor quantum wells \cite{bernevig2006quantum,konig2007quantum} and monolayer transition metal dichalcogenides \cite{qian2014quantum, tang2017quantum, fei2017edge, wu2018observation}, as well as some other recent proposals \cite{tang2014stable,liu2017van,kandrai2020signature}. \begin{figure} \includegraphics[width=1\textwidth]{Figures/Figure1.png} \caption{\label{fig1}Electronic structure of a typical semimetallic RE-V. (a) Conventional rock-salt crystal structure, the green and cyan arrows representing the unit vectors of bulk primitive unit cell and tetragonal unit cell, respectively, (b) Fermi surface of the primitive bulk semimetallic RE-V featuring two hole pockets at ${\Gamma}$ and three equivalent electron pockets at X points, (c) 3D BZ of RE-V $fcc$ crystal structure and its projection on (001) plane (yellow plane) and also shown is the 3D BZ of the tetragonal unit cell (right square green prism inside the BZ of the primitive $fcc$); orbital-resolved band structure of semimetallic RE-V using (d) primitive unit cell, (e) 4-atom tetragonal unit cell at $k_z=0$, more bands observed than that of the primitive unit cell due to band folding phenomenon; visualization of the wavefunctions of the electron pockets centered at (f) X$_x$, (g) X$_y$, and (h) X$_z$ (yellow and cyan lobes represent $+$ and $-$ sign of the wavefunctions, respectively).} \end{figure} The calculated lattice parameter of LaSb is 6.547 \AA~and 6.518 \AA~using the DFT-GGA and the HSE06 hybrid functional, respectively, both in good agreement with previous calculations \cite{Shoaib2020} and the experimental value of 6.488 \AA~\cite{chua1974simple} which is adopted in this study. The computed band structure of primitive bulk LaSb is shown in Figure~\ref{fig1}d. There are three electron pockets (denoted by $\alpha$ centered at X$_x$, X$_y$, and X$_z$) from bands derived mainly from La 5$d$ orbitals, and two hole pockets ($\beta$ and $\delta$ centered at $\Gamma$) from bands derived from Sb 4$p$ orbitals, crossing the Fermi level, leading to full compensation, i.e., the total numbers of electrons and holes are equal. This overlap is overestimated in DFT-GGA, resulting in an artificially higher carrier concentration compared to experimental values, while HSE06 gives carrier concentration in better agreement with experiments \cite{Shoaib2020}. As can be seen in Figure~\ref{fig1}b, the electron pockets are highly anisotropic with each ellipsoid's semi-major axis pointing along the corresponding Cartesian axis, and the semi-minor axis being perpendicular to it. The hole pockets, however, are more isotropic with an inner spherical-like pocket $\beta$ and an outer warped double pyramid pocket $\delta$. Therefore, we expect that the electron pockets will be more sensitive to QCE upon dimensional reduction in thin films than the hole counterparts. The effect of quantum confinement on the electron pockets can be understood by inspecting the single-particle wavefunctions at the three X points shown in Figure~\ref{fig1}f-h. At X$_x$ (X$_y$), the wavefunction is composed of La $d_{yz}$ ($d_{xz}$) orbital (see details on projected band structure in Figure S1), resulting in a low dispersion along the semi-major axis $\Gamma-$X$_x$ ($\Gamma-$X$_y$) in reciprocal space because the orbital interaction occurs along the direction normal to their charge distribution as evidenced in Figure~\ref{fig1}f(g). Meanwhile, the same band has a higher dispersion along the perpendicular direction, i.e., the electron pocket's semi-minor axis X$-$W thanks to the orbital interaction happening in the plane of their distribution ($yz$ and $xz$ planes for pockets at X$_x$ and X$_y$, respectively). At X$_z$, on the other hand, the wavefunction is composed of La $d_{xy}$ orbital, i.e., lying in the $xy$ plane with small overlap along the [001] or $z$ direction (Figure~\ref{fig1}h). Therefore, we anticipate that QCE in [001] oriented thin films will affect mostly the electron pockets whose wavefunctions are largely distributed in the planes normal to the film plane, i.e., the pockets centered at X$_x$ and X$_y$; the electron pocket at X$_z$ will be marginally affected by the QCE because the corresponding wavefunction is spreading in the plane of the film \cite{chang2009fundamental,sohn2021observation}. This can be checked by examining the band structure of thin free-standing slabs. To understand the electronic structure of [001] oriented films, we first discuss the band structure of LaSb in the tetragonal unit cell, with two formula units, at $k_z=0$, as shown in Figure~\ref{fig1}e which has similar symmetry to that of the (001) films, i.e., we can build a (001) film unit cell from the tetragonal unit cell. Its corresponding BZ is highlighted by the green right square prism inside the BZ of the $fcc$ primitive cell in Figure~\ref{fig1}c. The electron pocket at $\Gamma$, overlapping in momentum and energy with the hole pockets, corresponds to the pocket at X$_z$ due to the folding of the BZ along $k_z$ (see details from projected band structure in Figure S2). It can also be viewed as the projection on the $k_x$-$k_y$ plane of the ellipsoid along $k_z$ in the Fermi surface of the primitive cell (Figure~\ref{fig1}b). Note that the overlap and crossing of electron and hole pockets near $\Gamma$ in Figure~\ref{fig1}e is a consequence of having a larger unit cell compared to the primitive cell. Otherwise, they would open an anti-crossing gap in the presence of spin orbit coupling (SOC). In fact, the electron pocket at X$_z$ and hole pockets at $\Gamma$ belong to distinct symmetry irreducible representations (irreps), and therefore, the interaction between them is prohibited by symmetry, i.e., the C$_4$ rotation operation along $\Gamma-$X$_z$\cite{kim2018nearly,li2015gdn}. However, for finite thickness films along [001], this symmetry is lifted, and the overlap in both energy and momentum becomes viable \cite{li2015gdn}. At the M point, there are two electron bands with different dispersion: the lower dispersion band composed of La $d_{xz}$, originally from the pocket at X$_y$, with the dispersion along the semi-major axis $\Gamma-$X$_y$, and the higher dispersion counterpart originating from the projection of the semi-minor axis X$_x-$W$_z$ of the pocket at X$_x$ from the adjacent BZ (the path highlighted in blue in Figure~\ref{fig1}c). To summarize, the three electron pockets of the bulk in primitive unit cell form are residing in two locations of the tetragonal unit cell BZ: X$_z$ at $\Gamma$, X$_x$ and X$_y$ at M, which would ultimately determine the effect of size quantization upon dimensional reduction. \begin{figure} \centering \includegraphics[width=1.0\textwidth]{Figures/Figure2.png} \caption{\label{fig2}Electronic structure of freestanding films LaSb with the thickness of (a) 15-ML, (b) 9-ML, (c) 7-ML, (d) 5-ML, (e) 3-ML, (f) 1-ML. Due to the orbital-selective QCE on the electron pockets at $\overline{\rm M}$ and $\overline{\Gamma}$, a phase transition from topologically trivial semimetal in 15-ML film to non-trivial insulator in 7-, 5-, 3-ML films and eventually trivial insulator in 1-ML film can be observed.} \end{figure} The electronic band structure of a free standing slab with 15 MLs is shown in Figure~\ref{fig2}a, along $\overline{\rm M}-\overline{\Gamma}-\overline{\rm X}$, where $\overline{\rm M}$ can be viewed as the projection of the two high symmetry points X$_y$ and X$_x$ (from the adjacent BZ), $\overline{\Gamma}$ is the projection of $\Gamma$ and X$_z$, and $\overline{\rm X}$ is the projection of the L points onto the 2D BZ of the thin films (Figure~\ref{fig1}c). We note that the electron pocket at $\overline{\rm M}$ (corresponding to X$_x$ and X$_y$) is shifted upwards in energy while the electron pocket at $\overline{\Gamma}$ (projected from X$_z$) remains nearly unchanged. At the $\overline{\rm M}$ point, there are two sets of electron pocket sub-bands with quite different dispersion: one set having low dispersion (high effective mass) while the other set exhibiting large dispersion (low effective mass). This can be understood from the orbital character of the bands (Figure S3) and the directional nature of their interaction as analyzed above for the M point of the tetragonal unit cell case. The low dispersion set of sub-bands stems from the La $d_{xz}$ orbital interaction taking place along the semi-major axis $\Gamma-$X$_y$. Meanwhile, the high dispersion set of sub-bands originates from the semi-minor axis X$_x-$W$_z$ due to the in-plane interaction of La $d_{yz}$, resulting in a stronger interaction and hence a smaller effective mass. The gaps at the X$_x$ and X$_y$ points in the bulk transfer to the gap at the $\overline{\rm M}$ point of the film. At $\overline{\Gamma}$, however, electron pockets overlaps with hole pockets, maintaining the semimetallic phase at this thickness of the film. In addition, the energy separation of the sub-bands at $\overline{\rm M}$ is associated with the dispersion, or effective mass, of the electron band at X$_x$ (X$_y$). Consequently, this energy separation is larger than that between the sub-bands of the electron pockets at $\overline{\Gamma}$ due to QCE; the latter is associated with the coupling of the $d_{xy}$ orbitals in the film plane, hence less affected by QCE. The electronic structure of the 9-ML thick slab is shown in Figure~\ref{fig2}b, indicating a semimetal on the brink of having the electron pocket at $\overline{\rm M}$ above the Fermi level. For the 7-ML and 5-ML thick slabs, Figures~\ref{fig2}c,d show that the electron pockets at $\overline{\rm M}$ are above the Fermi level due to the QCE, and inverted band gaps at $\overline{\Gamma}$ are opened in the presence of SOC, indicating the emergence of a 2D (or quasi 2D) QSH phase \cite{kane2005quantum,sheng2005nondissipative,bernevig2006quantum}. The gaps at $\overline{\rm M}$ and at $\overline{\Gamma}$ are enlarged in the 3-ML thick film (Figure~\ref{fig2}e). At the ultimate limit of 1-ML thick, LaSb film becomes a normal insulator thanks to the QCE lifting up the overlap (at $\overline{\Gamma}$) between the projected electron pocket from $X_z$ and hole pockets, leading to a normal band ordering (Figure~\ref{fig2}f). \begin{figure*} \centering \includegraphics[width=1.0\textwidth]{Figures/Figure3.png} \caption{\label{fig3}Signature of the QSH insulating phase in 3-ML thick film. (a) 2D BZ of the thin film and 1D BZ of the ribbon made of the film (blue line) with periodic direction along $x$, (b) projected band structure around the Fermi level (set at 0 eV) exhibiting an inverted band gap at $\overline{\Gamma}$, (c) electronic structure of the ribbon made from the 3-ML thick film obtained from $ab$ $initio$ calculations using openMX showing the presence of edge states crossing at Fermi level as highlighted by red lines in the inset, (d) LDOS of a semi-infinite wide ribbon made from the 3-ML thick LaSb obtained from Wannier orbital-based TB Hamiltonian and the spin-polarized LDOS of the edge states shown in the inset, (e) Wannier charge center evolution of the 3-ML thick LaSb freestanding film displaying the non-trivial topological property as the red dashed reference line crossing the evolution line (represented by filled navy blue circles) an odd number of time.} \end{figure*} As mentioned above, the electronic structure of LaSb films evolves from a semimetal with trivial topology to a non-trivial insulator as the film thickness decreases down to a few MLs. The topologically non-trivial electronic structure follows a band inversion, as shown in Figure~\ref{fig3}b for the case of 3-ML thick film. To confirm the topological non-triviality, we calculated the $\mathbb{Z}_2$ topological invariant using the Fu-Kane formula \citep{fu2007topological} as well as the Fukui-Hatsugai method \citep{fukui2005chern}, obtaining $\mathbb{Z}_2=1$. The non-trivial topological nature is further corroborated by following the evolution of the Wannier charge center (WCC) as a function of momentum, shown in Figure~\ref{fig3}e, which essentially displays the non-trivial topology as the red-dashed reference line cutting through the WCC evolution line an odd number of times. Furthermore, based on the bulk-boundary correspondence, we expect edge states of the QSH insulator to show the spin-momentum locking behavior \cite{kane2005quantum}. We searched for the presence of spin-polarized edge modes associated with the non-trivial topology by calculating the band structure of a nanoribbon made from the 3-ML film. We find that the nanoribbon must be at least 50 MLs wide ($\sim$16 nm) to avoid interactions between the two opposite edges of the ribbon. The electronic structure of the 3-ML thick, 50-ML wide nanoribbon is shown in Figure~\ref{fig3}c, where the edge states cross at the four-fold degenerate Dirac point $\overline{\overline{\Gamma}}$, represented by a pair of red lines in the vicinity of $\overline{\overline{\Gamma}}$ in the inset. The corresponding spin-resolved LDOS in Figure~\ref{fig3}d, obtained by the iterative Green function method \cite{sancho1985highly} for a semi-infinite structure, and the spatial distribution of spin-resolved wavefunctions of edge states shown in Figure S4, clearly demonstrate the helical spin-momentum locking of the edge modes, thus confirming the presence of the QSH phase in the 3ML-thick film. For 7-ML or 5-ML thick films, there are two set of band inversions (see Figure S5a,e), thus no time-reversal symmetry-protected edge states are expected, i.e., spin scattering from spin up to spin down channels on the same edge is possible \cite{qi2010quantum,maciejko2011quantum}. Therefore, they are classified as trivial insulators with the topological invariant $\mathbb{Z}_2=0$ \cite{}. However, one pair of the inverted bands can be removed when a small biaxial tensile strain is applied to films deposited on an appropriately chosen substrate. Such an approach has been investigated theoretically \cite{khalid2020trivial} and recently demonstrated experimentally in the case of RE-Vs grown on III-V substrates \cite{inbar2022strain}. This biaxial (or epitaxial) strain allows to selectively lift the overlap between one pair of electron and hole sub-bands, resulting in an odd number of band inversions, so that a QSH phase can also be realized in 5-ML and 7-ML thick films (see Figure S5c,d,h). When taking a closer look at the thickness-dependence of the electronic structure of the thin films, there is a striking difference between films having even and odd number of monolayers (Figure~\ref{fig4} and Figure S6), particularly near the Fermi level. As the thickness of the film decreases, the QCE becomes stronger, resulting in gradually larger sub-band. The QCE also affects the size of the gap at the $\overline{\rm M}$ and $\overline{\Gamma}$ points. Thinner films with an odd number of MLs show larger gaps with decreasing film thickness. The same trend is seen for films with an even number of MLs. Remarkably, the gap at $\overline{\Gamma}$ oscillates when going from an even to an odd number of ML, as detailed in Figure~\ref{fig4} for the bands around $\overline{\Gamma}$. The gap is essentially zero for films having an even number of MLs but becomes sizable for films with an odd number of MLs. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{Figures/Figure4.png} \caption{\label{fig4}Electronic structures in the proximity of the $\overline{\Gamma}$ point of LaSb freestanding thin films with an even/odd number of MLs. Red dashed and blue lines indicate bands without and with SOC, respectively. Irreps of relevant bands are denoted by capitalized Greek letters.} \end{figure} This oscillation in the gap size of the thin films with even and odd number of MLs can be explained by the difference in their symmetry. The films having an odd number of MLs belong to a symmorphic symmetry group (space group number 123 with point group $P4/mmm$) while the films with an even number of MLs possess a nonsymmorphic symmetry group (space group number 129 with point group $P4/nmm$). This leads to a distinction in the symmetry of the bands around the Fermi levels as shown in Figure~\ref{fig4}e,f taking 3-ML and 2-ML films as examples. For the 3-ML film, one electron band and two hole bands overlap in the proximity of $\overline{\Gamma}$, leading to a band inversion at $\overline{\Gamma}$ in the absence of SOC (represented by red dashed lines). Crucially, one of the hole bands has the same symmetry as that of the electron band (irrep $\Sigma_2$, Figure~\ref{fig4}e), leading to a gap opening due to their mutual interaction. However, the other hole band with a different irrep ($\Sigma_1$) does not interact with the electron counterpart, resulting in a semimetallic phase with a degeneracy of the two hole bands at the $\overline{\Gamma}$ point. This inverted band gap semimetal with a degenerate point at the zone center is similar to bulk HgTe \cite{bernevig2006quantum}. The degeneracy in bulk HgTe is protected by its crystal symmetry and is stable even in the presence of SOC; it is only lifted and a tiny gap opens when the bulk crystal symmetry is broken, i.e., in the thin film structure (quantum well). For the 3-ML LaSb film, however, the degeneracy is not stable under the influence of SOC since it is from the original degeneracy of the top two hole bands at the X$_z$ point of the bulk when not taking SOC into consideration. As a consequence, when turning on SOC, a sizeable inverted gap comparable to the SOC splitting between $\beta$ and $\delta$ bands at the bulk X point is observed. On the other hand, for the 2-ML system the two hole bands and the electron band have different symmetries, characterized by irreps $\Sigma_1$, $\Sigma_2$, and $\Sigma_4$, respectively (Figure~\ref{fig4}f). Therefore, in the absence of SOC, those bands would cross if they were overlapping in energy since their interactions are prohibited by symmetry (as in the case of 4ML-thick film shown in Figure~\ref{fig4}d). When SOC is turned on, the highest hole band and the electron band overlap in energy, leading to a SOC-induced gap opening. However, this gap is tiny since the SOC plays a role as a small perturbation, the relevant orbitals interaction is not allowed by symmetry. A similar argument can be applied to understand the sizeable inverted gap in the other films with odd numbers of MLs such as the 5-ML and 7-ML, as well as the observed essentially zero gaps in the films with an even number of MLs such as the 4-ML and 6-ML films. The effects discussed here are expected to occur for all materials in the family of RE-Vs with RE=La,..., Lu and V=As, Sb, Bi since they have the same crystal structure and similar orbital composition of the bands. Note, however, that some of the Bi-based compounds already show non-trivial topology in the 3D bulk due to the crossing of the Bi 6$p$ and the rare-earth 5$d$ bands near the X point \cite{lou2017evidenceLaBi,nayak2017multiple}. The As- and Sb-based compounds are all topologically trivial semimetals, and hence are all expected to become topologically non-trivial when made as few monolayers thick, [001] oriented ultra-thin films. Apart from the case of La-, Y-, and Lu-based compounds, where the RE $f$ orbitals are completely empty or filled, other RE-Vs exhibit magnetic ordering at low temperatures, opening an avenue to combining non-trivial topology with spin magnetism, potentially leading to novel phenomena such as the emergence of 2D antiferromagnetic topological insulators \cite{niu2020antiferromagnetic, liang2022approaching, xu2022evolution}, the quantum anomalous Hall effect in Chern insulators \cite{inoue2019band}, and Fermi arcs due to an unusual magnetic splitting \cite{schrunk2022emergence}. Experiments have already demonstrated the epitaxial growth of RE-Vs thin films on conventional III-V substrates, down to few MLs thick. Scanning tunneling spectroscopy measurements on GdSb/GaSb has explored the possibility of turning GdSb semimetal into a semiconductor in ultra-thin films, yet failing \cite{inbar2022epitaxial,inbar2022strain}. The authors, however, were not searching for edge states at that time. We also argue that the presence of metallic interface states at the interface with III-Vs \cite{chatterjee2021controlling} might impose difficulties in identifying the spin-momentum locked states and that perhaps a different substrate with different bonding at the interface might be required. In the case of LaSb, we propose the use of rock-salt MgTe, CaTe, or SrTe for which interface metallic states would be mitigated, facilitating the observation of the spin-momentum locked edge states. In conclusion, we have investigated the electronic structure of non-magnetic RE-V thin films at various thicknesses using first-principles calculations employing the hybrid functional HSE06, taking LaSb as a case study. The quantum confinement in thin films along [001] has dissimilar effects on the electron pockets centered at equivalent X points at the zone edges owing to their orbital composition. The directional nature of the wavefunction associated with the electron pocket at X$_z$ point, distributed mainly in the film plane with weak out-of-plane interactions, makes this pocket resistant to finite size effects, leading to an inverted band gap opening in the limit of very thin films. Interestingly, at the limit of 3-ML, we have observed the emergence of a QSH insulating phase characterized by the non-trivial $\mathbb{Z}_2$ topological invariant and the presence of helical spin-momentum locked edge states. Similar observation can be seen for 5-ML and 7-ML films with an applied small biaxial tensile strain. Our results indicate that this effect is general for the RE-Vs, with a possibly interesting combination of 4$f$ magnetism with topological band structures in ultrathin films. \section{Computational methods} First-principles calculations based on density functional theory \cite{Hohenberg1964, KohnSham1965} as implemented in the VASP code \cite{kresse1996efficient} have been performed for structural optimization and electronic structure calculation. The screened hybrid exchange-correlation functional of Heyd-Scuseria-Ernzerhof (HSE06) \cite{hse06-2003,hse06} was employed in all cases except the calculations of the electronic structures of nanoribbons because these calculations required very large unit cells. In that case, the generalized gradient approximation (GGA) functional of Perdew–Burke-Ernzerhof (PBE) \cite{Perdew1996-PBE,Perdew1997-PBE-Erratum} was used instead. A plane-wave basis set with up to kinetic cutoff energy of 400 eV, and 12$\times$12$\times$12 $k$-point mesh for bulk LaSb and 10$\times$10$\times$1 $k$-point mesh for thin films were used, respectively. Due to large unit cell sizes of the LaSb nanoribbons, first-principles calculations searching for the presence of edge states were performed using the OpenMX code \cite{Ozaki2003,Ozaki2004,Ozaki2005} with a localized basis set. The symmetry irreducible representations (irreps) of electronic bands were determined using the irvsp code \cite{gao2021irvsp}. Maximally localized Wannier functions (MLWFs) based effective Hamiltonian were constructed by the Wannier90 code \cite{pizzi2020wannier90} using La $d$ and Sb $p$ as projectors. Edge state spectra were then obtained by using the surface Green function for semi-infinite systems \cite{sancho1985highly} as implemented in WannierTools \cite{wu2018wanniertools}. \begin{acknowledgement} This research was supported by the NSF through the UD-CHARM University of Delaware Materials Research Science and Engineering Center (No. DMR-2011824). It made use of the computing resources provided by the Extreme Science and Engineering Discovery Environment (XSEDE), supported by the National Science Foundation grant number ACI-1053575. \end{acknowledgement} \begin{suppinfo} Additional details are available on orbital-resolved (projected) band structures of LaSb primitive unit cell, 4-atoms tetragonal unit cell, free standing slab with 15-ML thick; spatial distribution of spin-resolved wavefunctions of edge states in 3-ML thick, 50-ML wide LaSb ribbon; the evolution of the topology of electronic structures in LaSb thin films having 5-ML and 7-ML thick under biaxial tensile strain; and electronic band structure of even and odd number of ML in the whole Brillouin zone. This material is available free of charge via the ACS Publications website at DOI: http://pubs.acs.org. \end{suppinfo}
\section{Introduction} \label{sec:intro} The latest generation of ground-based astronomical surveys aim to capture exposures of large swathes of the night sky to advance our understanding of astronomy~\citet{ivezic2019lsst}. Processing pipelines for these surveys will have to address the presence of unwanted atmospheric blur. \textit{Deconvolution}, the process of removing this blur, is complicated by the high level of noise in the exposures, their high dynamic range, and the presence of artifacts and obstructions in the image. We tackle the specific problem of multi-frame astronomical image reconstruction, which entails combining multiple blurry, ground-based astronomical exposures in order to produce a single, sharp image of the night sky. Previous approaches to address the problem include lucky imaging~\citet{tubbs2003lucky}, coadding~\citet{annis2014sloan}, maximum likelihood estimation~\citet{schulz1993multiframe, zhulina2006multiframe}, and streaming methods~\citet{harmeling2009online, harmeling2010multiframe, hirsch2011online, lee2017robust, lee2017streaming}. We develop a novel unsupervised, multi-frame method inspired by deep generative priors, outlined in Section~\ref{sec:model}. \section{Model and Approach} \label{sec:model} We begin by describing the model for our approach. Given a sample of observations $y\!\equiv\!\{y^{(1)}, y^{(2)}, \dots, y^{(n)}\}$, we model each observation $y^{(t)}$ as the convolution of a common latent image $x$ with a point-spread function (PSF) $f^{(t)}$, plus an additive error term $\eta^{(t)}$. We highlight that the PSFs and error terms can vary from exposure to exposure. While photon counts in the raw exposures follow a Poisson distribution, the large number of photons allows us to model the sky-subtracted images as a Gaussian with zero mean and variances $v^{(t)}$, which are usually given to the user in astronomical imaging pipelines. Thus, our model for each pixel value in each exposure, denoted $y^{(t)}_{ij}$, is \begin{equation} \label{eq:model_exposures} y^{(t)}_{ij} = \left[f^{(t)} \!* x\right]_{ij} + \eta^{(t)}_{ij}, \quad \textrm{where}\quad \eta^{(t)}_{i j} \sim N\left(0, v^{(t)}_{ij}\right) . \end{equation} One could attempt to find the latent image $x$ (and the PSFs $f\!\equiv\!\{f^{(1)}, f^{(2)}, \dots, f^{(n)}\}$ if they are unknown) as \textit{maximum likelihood estimates} (MLE) of the model above. However, such methods often fail to form meaningful estimates~\citet{schulz1993multiframe, zhulina2006multiframe}. We thus operate under a Bayesian framework, and solve for $x$ and $f$ as \textit{maximum a posteriori} (MAP) estimates \begin{equation} \label{eq:map_estimate} \Hat{x}, \Hat{f} = \underset{x, f}{\mathrm{argmax}} \ \ln p(y \mid x, f) + \ln p(x, f) . \end{equation} Note that $p(y \mid x, f)$ is the conditional distribution of the exposures $y$ given the latent image $x$ and PSFs $f$, which is the Gaussian distribution from~\eqref{eq:model_exposures}. Meanwhile, $p(x, f)$ is a prior distribution on the latent image and PSFs, for which a handcrafted regularization prior such as the total variation norm might traditionally be used. However, one can impose an effective regularizing prior through the structure of an untrained, generative neural network, i.e., a so-called \textit{deep generative prior}~\citet{ulyanov2018deep}. Inspired by this approach, we develop an unsupervised multi-frame method for deconvolving astronomical images. Our approach is an extension of the flash-no flash method for image-pair restoration in~\citet{ulyanov2018deep}, to the setting of multi-frame image reconstruction. In our framework, we encode the latent image $x$ as a \textit{function} of the multiple exposures $y\!\equiv\!\{y^{(1)}, y^{(2)}, \dots, y^{(n)}\}$. We parametrize this function via a neural network with learnable parameters $\theta$ and denote it by $F_{\theta}$. We then decode the latent image $x = F_{\theta}(y)$ by convolving it with $n$ convolutional filters $f\!\equiv\!\ \{f^{(1)}, f^{(2)}, \dots, f^{(n)}\}$ in order to produce reconstructions of our input exposures, denoted by $\Hat{y}\!\equiv\!\{\Hat{y}^{(1)}, \Hat{y}^{(2)}, \dots, \Hat{y}^{(n)}\}$ where $\Hat{y}^{(t)} = f^{(t)} * F_{\theta}(y)$. The convolutional filters $f$ could be the PSFs corresponding to each exposure if these are known, otherwise they could be additional learnable parameters of the network. We refer the reader to Figure~\ref{fig:network_architecture} for additional details about the network's architecture. To tune the parameters of our network, we minimize the Huber loss between our network's inputs and outputs (scaled by their corresponding standard deviations), i.e., \begin{equation} \label{eq:loss_network} \theta^* = \underset{\theta}{\mathrm{argmin}} \sum_{t=1}^n \sum_{i,j} L_{\delta} \left(\frac{y_{ij}^{(t)}}{\sqrt{v_{ij}^{(t)}}}, \frac{\left[ f^{(t)} * F_\theta(y) \right]_{ij}}{\sqrt{v_{ij}^{(t)}}}\right) , \end{equation} where the Huber loss is applied pixel-wise and is defined as \begin{equation} \label{eq:huber_loss} L_{\delta}(y, \Hat{y}) \coloneqq \begin{cases} \frac{1}{2} \left(y - \Hat{y} \right)^2 & \text{ for } | y - \hat{y} | \leq \delta , \\ \delta \left( | y - \Hat{y} | - \frac{1}{2} \delta \right) & \text{ otherwise. } \end{cases} \end{equation} We typically set $\delta = 1$ in our experiments. Note that the Huber loss behaves like the mean squared error but is more resistant to outliers, which makes our recovered latent image $\Hat{x}$ and reconstructions $\Hat{y}$ robust to heavy-tailed noise or saturated pixels in the exposures. For emphasis, we highlight that the deconvolved latent image $\Hat{x}$ is computed via a forward pass through the trained encoder part of our network, i.e., \begin{equation} \label{eq:latent_image_forward_pass} \Hat{x} = F_{\theta^*}(y). \end{equation} \begin{figure}[ht] \centering \includegraphics[width=0.95\linewidth]{P11_1.eps} \caption{Network architecture. We extract and combine multi-scale information from the exposures via various convolutional layers. All input exposures first pass through several depth-wise convolution layers in parallel. The output channels are concatenated, and a pointwise convolution completes the ``encoder" part of our network to produce the latent image $x$. Desired constraints, such as non-negativity of pixel values in $x$, are enforced by applying a ReLU activation. We then ``decode" $x$ via a final 2D convolutional layer in order to produce the reconstructions.} \label{fig:network_architecture} \end{figure} \section{Results} \label{sec:results} We tested our method on a set of $33$ exposures from the Hyper Suprime-Cam telescope, which are closest in quality to imaging data from the upcoming Rubin Observatory. We compare the latent image $\Hat{x}$ obtained using our approach with a ``naive" co-add of the exposures, calculated by taking their sample mean. Results in Figure~\ref{fig:comparison_nn_coadd} demonstrate a significant improvement in the quality of the reconstruction obtained via our approach. \begin{figure}[ht] \centering \includegraphics[width=0.32\linewidth]{P11_6.eps} \includegraphics[width=0.32\linewidth]{P11_2.eps} \includegraphics[width=0.32\linewidth]{P11_3.eps} \includegraphics[width=0.32\linewidth]{P11_7.eps} \includegraphics[width=0.32\linewidth]{P11_4.eps} \includegraphics[width=0.32\linewidth]{P11_5.eps} \caption{Comparison: Selected cutouts from a raw exposure (left) vs. the ``sample mean" co-add (middle) vs. a restored image $\Hat{x}$ from our approach (right). Our method produces a physically meaningful restored latent image of the night sky which is suitable for photometry. Pixels in the sky background have zero intensity, with only minor speckles of noise appearing around bright objects, unlike the co-add where noise is uniformly present across the image. Moreover, our method successfully deblurs a wide array of sources, resulting in e.g. galaxy shapes being visibly more well-defined, and large blurry stars appearing as well resolved point sources.} \label{fig:comparison_nn_coadd} \end{figure} \section{Conclusion and Future Work} \label{sec:conclusion} We have introduced a novel method for multiframe astronomical image deconvolution based on deep generative priors. The key to our method lies in encoding the latent image of the sky as a function of the multiple observed ground-based exposures, and parametrizing this function via a convolutional neural network. Preliminary results on imaging data from the Hyper Suprime-Cam telescope yield physically meaningful restorations that are suitable for photometry. As future work, we plan to extend our approach to perform image reconstruction with observations from several color or frequency bands. Another natural extension involves adapting our model so that it learns a super-resolved latent image in which one obtains sub-pixel detail in galaxies and stars, thus enabling improved photometry.
\section{Introduction}\label{sec1} An $[s,k]$ linear code $\mathcal{C}$ is called a Euclidean linear complementary dual (LCD for short) code if $\mathcal{C}\cap\mathcal{C}^{\perp_{E}}=\lbrace 0_{s}\rbrace$, where $\mathcal{C}^{\perp_{E}}$ is the Euclidean dual code of $\mathcal{C}$ and $0_{s}$ is the zero vector of length $s$. LCD codes were introduced by Massey \cite{Massey1992}, where LCD codes were shown to provide an optimum linear coding solution for the two-user binary adder channel and applied to the nearest-neighbor decoding problem. Moreover, in \cite{Massey1992} it was proved that asymptotically good LCD codes exist. In recent years, there has been an increasing interest in LCD codes for both theoretical and practical reasons (see \cite{Carlet2016,Carlet2019,Araya2019,Araya2020,Araya2020-2}). In particular, Carlet and Guilley showed in \cite{Carlet2016} that LCD codes are important in information protection and armoring implementations against side-channel attacks and fault non-invasive attacks. An important problem is to determine the largest minimum weight among all $[s,k]$ codes in a certain class of codes from a given pair $(s,k)$. Coding theory has also been developed with respect to alternative metrics. One of those metrics is the Niederreiter Rosenbloom-Tsfasman (NRT for short) metric which was introduced in \cite{NRT} to model transmission over a set of parallel channels subject to fading. Independently, Niederreiter \cite{H.Niederreiter} pursued a maximization problem in finite vector spaces which turned out to be equivalent to coding theory problems in Niederreiter Rosenbloom-Tsfasman metric spaces, as was shown by Brualdi, Graves, and Lawrence \cite{brualdi}. The NRT metric is more appropriate for the correction of random errors that occur with high probability in the first coordinates. Since its definition several coding-theoretic questions with respect to the Niederreiter Rosenbloom-Tsfasman metric have been investigated, such as bounds \cite{BargAndPurka,Quistorff}, weight distribution and MacWilliams Identities \cite{DS,Sharma,Siap}, self-dual codes \cite{Marka,InvariantSantos}, MDS codes \cite{4,MDS_Dougherty,Skriganov2001uniform-distributions}, burst error enumeration \cite{Jain,I.Siap}, BCH codes \cite{Zhou}, and decoding \cite{Ozen, Nielsen,FractionalNRTSantos}. Recently, Heqian, Guangkui, and Wei defined NRT-LCD codes in \cite{H.Xu}. In the same paper, the basic conditions for an NRT metric code be NRT-LCD are studied. The aim of this paper is to study $LCD[n\times s,k]$ which is the maximum of the possible minimum NRT distance among all binary $[n\times s,k]$ NRT-LCD codes $\mathcal{C}\subseteq M_{n,s}(\mathbb{F}_{2})$. This paper is organized as follows. Section \ref{Preliminaries} contains some basic facts and definitions about codes in the Niederreiter Rosenbloom-Tsfasman metric space and NRT-LCD codes. In Section \ref{1xs}, we study $LCD[1\times s,k]$. In Section \ref{nx2}, we present a linear programming bound for NRT-LCD codes in $M_{n,2}(\mathbb{F}_{2})$ and study $LCD[n\times 2,2]$. Finally, in Section \ref{constructions}, we present a new construction of binary NRT-LCD codes in $M_{1,s}(\mathbb{F}_{2})$ and a new construction of binary NRT-LCD codes in $M_{n,s}(\mathbb{F}_{2})$. \section{Preliminaries}\label{Preliminaries} \subsection{Niederreiter Rosenbloom-Tsfasman metric codes} Let $M_{n,s}(\mathbb{F}_{q})$ denote the set of all $n\times s$ matrices over the finite field $\mathbb{F}_q$. Given a matrix $v=[v_{i,j}]_{n\times s}\in M_{n,s}(\mathbb{F}_{q})$, we write $v=[v_1;v_2;\ldots;v_n]$ or $v=[w_{1}\mid w_{2}\mid\cdots\mid w_{s}]$, where $v_{i}=[v_{i,1},\ldots,v_{i,s}]$ is the $i$-th row of $v$, and $w_{j}=[w_{1,j},w_{2,j},\ldots;w_{n,j}]$ is the $j$-th column of $v$. The Niederreiter-Rosenbloom-Tsfasman (for short, NRT) weight of $v$ is given by \begin{equation} \rho(v)=\sum_{i=1}^{n}\rho(v_{i}) \end{equation} where, \begin{eqnarray} \rho(v_{i})&=\left\lbrace\begin{array}{cl} \max\left\lbrace j:v_{i,j}\neq 0\right\rbrace&\text{if}\ v_{i}\neq 0\\ 0&\text{if}\ v_{i}=0. \end{array}\right. \end{eqnarray} \noindent for $i=1,2,\ldots,n$. The NRT metric is defined by $d_{N}(u,v)=\rho(u-v)$, where $u,v\in M_{n,s}(\mathbb{F}_{q})$. We note that for $s=1$, that is, for $v\in M_{n,1}\cong\mathbb{F}^{n}_{q}$ the NRT metric becomes the usual Hamming metric. Given a subset $\mathcal{C}\subseteq M_{n,s}(\mathbb{F}_{q})$ the minimum NRT distance of $\mathcal{C}$ is defined by: \begin{equation} d_{N}(\mathcal{C})=\min\left\lbrace d_{N}(v,u):d_{N}(v,u)\neq 0\right\rbrace. \end{equation} We sometimes write $d_{N}$ rather than $d_{N}(\mathcal{C})$ if the code is clear from the context. Given $\mathcal{C}\subseteq M_{n,s}(\mathbb{F}_{q})$ it is easy to check that $d_{H}(\mathcal{C})\leq d_{N}(\mathcal{C})$, where $d_{H}$ is the minimum Hamming distance of $\mathcal{C}$. \begin{definition} An $[n\times s,k,d_{N}]$ NRT metric code is a linear subspace $\mathcal{C}\subseteq M_{n,s}(\mathbb{F}_{q})$ of dimension $k$ and minimum NRT distance $d_{N}$. \end{definition} Note that the minimum distance of NRT metric code $\mathcal{C}\subseteq M_{n,s}(\mathbb{F}_{q})$ is given by $d_{N}(\mathcal{C})=\min\lbrace\rho(v):v\in\mathcal{C},v\neq 0\rbrace$. Moreover, we have the following singleton bound for $[n\times s,k,d_{N}]$ NRT metric codes \begin{equation}\label{Singletonbound} d_{N}(\mathcal{C})\leq ns-k+1. \end{equation} An NRT metric code with $d_{N}(\mathcal{C})=ns-k+1$ is called maximum distance separable code. \subsection{Niederreiter-Rosenbloom-Tsfasman LCD codes} Niederreiter-Rosenbloom-Tsfasman linear complementary dual (NRT-LCD) codes were defined in \cite{H.Xu}. In order to study NRT-LCD codes, we introduce the following definitions. \begin{definition} The dual code $\mathcal{C}^{\perp_{N}}$ of an $[n\times s,k,d_{N}]$ NRT metric code $\mathcal{C}$ is defined as $$\mathcal{C}^{\perp_{N}}=\lbrace u\in M_{n,s}(\mathbb{F}_{q})\mid\langle u,v\rangle_{N}=0\text{ for all } v\in\mathcal{C}\rbrace,$$ where for $u=[u_1;\ldots;u_{n}],v=[v_{1};\ldots;v_{n}]\in M_{n,s}(\mathbb{F}_{q})$ \begin{equation} \langle u,v\rangle_{N}=\sum_{i=1}^{n}\langle u_{i},v_{i}\rangle_{N}\text{, }\langle u_{i},v_{i}\rangle_{N}=\sum_{j=1}^{s}u_{i,j}u_{i,s-j+1}. \end{equation} \end{definition} \begin{definition}(\cite{H.Xu}) An $[n\times s,k,d_{N}]$ NRT metric code $\mathcal{C}$ is called \textit{NRT linear complementary dual code (NRT-LCD code for short)} if $\mathcal{C}\cap\mathcal{C}^{\perp_{N}}=\lbrace 0\rbrace$. \end{definition} \begin{definition}(\cite{Marka}) Let $A=\left[a_{ij}\right]\in M_{k,s}(\mathbb{F}_{q})$. The flip of $A$ is defined by $flip(A)=[a_{il}]$, where $l=s-j+1$ for $1\leq i\leq k$ and $1\leq j\leq s$. The transpose of $flip(A)$ is denoted by $A^{\circ}$. \end{definition} \begin{definition}(\cite{InvariantSantos}) Let $A=[A_{1}\mid A_{2}\mid\cdots\mid A_{n}]\in M_{k,ns}(\mathbb{F}_{q})$, where $A_{i}$ is a $k\times s$ matrix for $i=1,2,\ldots,n$. The ordered flip of $A$ is defined by \begin{equation*} Oflip(A)=[flip(A_{1})\mid flip(A_{2})\mid\cdots\mid flip(A_{n})]. \end{equation*} The transpose of $Oflip(A)$ is denoted by \begin{equation} A^{\dag}=[Oflip(A)]^{T}=\left[\begin{array}{c} A^{\circ}_{1}\\ A^{\circ}_{2}\\ \vdots\\ A^{\circ}_{n} \end{array}\right]. \end{equation} Note that, if $n=1$ then, $A^{\dag}=A^{\circ}$. \end{definition} \begin{example} Let $A\in M_{3,4}(\mathbb{F}_{q})$ be any matrix given by \begin{equation*} A=\left[\begin{array}{cccc} a_{1,1}&a_{1,2}&a_{1,3}&a_{1,4}\\ a_{2,1}&a_{2,2}&a_{2,3}&a_{2,4}\\ a_{3,1}&a_{3,2}&a_{3,3}&a_{3,4} \end{array}\right]. \end{equation*} Then, $flip(A)$ and $A^{\circ}$ are given by \begin{equation*} flip(A)=\left[\begin{array}{cccc} a_{1,4}&a_{1,3}&a_{1,2}&a_{1,1}\\ a_{2,4}&a_{2,3}&a_{2,2}&a_{2,1}\\ a_{3,4}&a_{3,3}&a_{3,2}&a_{3,1} \end{array}\right]\text{, }A^{\circ}=\left[\begin{array}{ccc} a_{1,4}&a_{2,4}&a_{3,4}\\ a_{1,3}&a_{2,3}&a_{3,3}\\ a_{1,2}&a_{2,2}&a_{3,2}\\ a_{1,1}&a_{2,1}&a_{3,1} \end{array}\right]. \end{equation*} Let $A\in M_{3,4}(\mathbb{F}_{q})$ be any matrix write as \begin{equation*} A=\left[\begin{array}{cc|cc} a_{1,1}&a_{1,2}&a_{1,3}&a_{1,4}\\ a_{2,1}&a_{2,2}&a_{2,3}&a_{2,4}\\ a_{3,1}&a_{3,2}&a_{3,3}&a_{3,4} \end{array}\right]. \end{equation*} Then, $Oflip(A)$ and $A^{\dag}$ are given by \begin{equation*} Oflip(A)=\left[\begin{array}{cc|cc} a_{1,2}&a_{1,1}&a_{1,4}&a_{1,3}\\ a_{2,2}&a_{2,1}&a_{2,4}&a_{2,3}\\ a_{3,2}&a_{3,1}&a_{3,4}&a_{3,3} \end{array}\right]\text{, }A^{\dag}=\left[\begin{array}{ccc} a_{1,2}&a_{2,2}&a_{3,2}\\ a_{1,1}&a_{2,1}&a_{3,1}\\ \hline a_{1,4}&a_{2,4}&a_{3,4}\\ a_{1,3}&a_{2,3}&a_{3,3} \end{array}\right]. \end{equation*} \end{example} In \cite{MarceloStandard}, Muniz proved that the generator matrix of an $[n\times s,k]$ NRT metric code $\mathcal{C}\subseteq M_{n,s}(\mathbb{F}_{q})$ is equivalent to an NRT-metric code with a special generator matrix. \begin{theorem}\label{marceloS}(\cite{MarceloStandard}, Theorem 3.5). Let $\mathcal{C}\subseteq M_{n,s}(\mathbb{F}_{q})$ be an $[n\times s,k]$ NRT-metric code. Then $\mathcal{C}$ is equivalent to a code that has a generator matrix \begin{equation} G=[G_{1}\mid G_{2}\mid\cdots\mid G_{n}], \end{equation} where \begin{itemize} \item[i)] The nonzero rows of $G_{1}$ are distinct canonical vectors, arranged in order of increasing NRT weight. \item[ii)] $G$ is in the \textit{block echelon form}, i.e., if the last $t$ rows of $G_i$ are zero, then the last $t$ rows of $G_{1},\ldots,G_{i-1}$ are also zero. \end{itemize} \end{theorem} Niederreiter-Rosenbloom-Tsfasman Linear complementary dual codes were characterized in terms of generator matrix by Heqian, Guangkui, and Wei in \cite{H.Xu}. \begin{lemma}\label{GGo}(\cite{H.Xu}) Let $\mathcal{C}$ be an $[n\times s,k,d_{N}]$ NRT metric code. Let $G\in M_{k,ns}(\mathbb{F}_{q})$ be a generator matrix of $\mathcal{C}$ write as \begin{equation} G=[G_{1}\mid G_{2}\mid\cdots\mid G_{n}], \end{equation} where $G_{i}\in M_{k,s}(\mathbb{F}_{q})$ for $i=1,2,\ldots,n$. Then $\mathcal{C}$ is an NRT-LCD if and only if $GG^{\dag}$ is nonsingular. \end{lemma} \begin{example} Let $\mathcal{C}$ be the binary $[1\times 4,2]$ code generate by \begin{equation*} G=\left[\begin{array}{cccc} 1&0&1&1\\ 0&1&1&1 \end{array}\right]. \end{equation*} If $\mathcal{C}$ is considered as a linear code in the Hamming metric space $\mathbb{F}^{4}_{2}$. It can be check that $GG^{T}$ is nonsingular and then $\mathcal{C}$ is an Euclidean LCD code. However, $GG^{\dag}=0$ is singular. By Lemma \ref{GGo}, $\mathcal{C}$ is not an NRT-LCD code. \end{example} \begin{example} Let $\mathcal{C}$ be the binary $[1\times 4,2]$ code generate by \begin{equation*} G=\left[\begin{array}{cccc} 1&0&0&0\\ 0&0&1&1 \end{array}\right]. \end{equation*} If $\mathcal{C}$ is considered as a linear code in the Hamming metric space $\mathbb{F}^{4}_{2}$. It can be check that $GG^{T}=\left[\begin{array}{cc} 1&0\\ 0&0 \end{array}\right]$ and $GG^{T}$ is singular. That is, $\mathcal{C}$ is not an Euclidean LCD code. However, $GG^{\circ}=\left[\begin{array}{cc} 0&1\\ 1&0 \end{array}\right]$ and $GG^{\circ}$ is nonsingular. By Lemma \ref{GGo}, $\mathcal{C}$ is an NRT-LCD code. \end{example} \begin{definition} Let $n,s,k$ be positive intergers. We define \begin{equation} LCD[n\times s,k]:=\max\lbrace d_{N}\mid\text{ there exist a binary $[n\times s,k]$ NRT-LCD code $\mathcal{C}\subseteq M_{n,s}(\mathbb{F}_{2})$}\rbrace. \end{equation} \end{definition} \begin{remark} Note that if $s=1$, then $$LCD[n\times 1,k]:=\max\lbrace d_{H}\mid \text{there exist a binary $[n,k]$ LCD Hamming metric code }\mathcal{C}\subseteq\mathbb{F}^{n}_{2}\rbrace.$$ So, we will focus on cases where $s>1$. \end{remark} \section{Elementary bounds on binary NRT-LCD codes in $M_{1,s}(\mathbb{F}_{2})$}\label{1xs} Ozen and Siap in \cite{Ozen}, defined the generator matrix in the standard form for $[1\times s,k,d_{N}]$ NRT-metric codes $\mathcal{C}\subseteq M_{1,s}(\mathbb{F}_{q})$ as the following. \begin{definition}(\cite{Ozen})\label{standard form} Let $\mathcal{C}\subseteq M_{1,s}(\mathbb{F}_{q})$ be an $[1\times s,k,d_{N}]$ NRT-metric code and $G$ the generator matrix of $\mathcal{C}$. Applying certain elementary row operations one can always transform $G$ into the following form: \begin{equation}\label{standardForm} G^{\prime}=\left[\begin{array}{ccccccccccccc} g_{1,1}&\cdots&g_{1,d_{1}-1}&g_{1,d_{1}}&0&\cdots&0&0&0&\cdots&0&\cdots&0\\ g_{2,1}&\cdots&g_{2,d_{1}-1}&0&g_{2,d_{1}+1}&\cdots&g_{1,d_{2}-1}&g_{2,d_{2}}&0&\cdots&0&\cdots&0\\ \vdots&\ddots&\vdots&\vdots&\vdots&\ddots&\vdots&\vdots&\vdots&\vdots&\vdots&\ddots&\vdots\\ g_{k,1}&\cdots&g_{k,d_{1}-1}&0&g_{k,d_{1}+1}&\cdots&g_{k,d_{2}-1}&0&g_{k,d_{2}+1}&\cdots&g_{k,d_{k}}&\cdots&0 \end{array}\right], \end{equation} where $g_{i,d_{i}}=1$, $d_{j,d_{i}}=0$ for $i\neq j$ and $\lbrace d_{1},d_{2},\ldots,d_{k}\rbrace$ is the set of $k$ possible nonzero NRT-weights so that $d_{N}=d_{1}<d_{2}<\ldots<d_{k}$. Any generator matrix of the linear code $\mathcal{C}$ is equivalent to $G^{\prime}$. This $G^{\prime}$ is called the generator matrix in \textit{standard form}. A linear code having $G^{\prime}$ as its generator matrix in standard form is said to be of type $(d_{1},d_{2},\ldots,d_{k})$. \end{definition} \begin{remark} Throughout this paper, we assume that $\mathcal{C}\subseteq M_{1,s}(\mathbb{F}_{q})$ always contains a codeword with full NRT-weight $s$, where $s$ is the length of the code. That is, the type of $\mathcal{C}$ is $(d_{N},d_{2},\ldots,s)$. \end{remark} \begin{lemma} For any $s,k$ greater than zero, \begin{equation} LCD[1\times(s+2),k]\geq LCD[1\times s,k]+1. \end{equation} \end{lemma} \begin{proof} Let $G$ be a generator matrix in the standard form of an $[1\times s,k,d_{N}]$ NRT-LCD code $\mathcal{C}$. Then $GG^{\circ}$ is nonsingular since $\mathcal{C}$ is NRT-LCD. Let $\tilde{G}=\left[\begin{array}{c|c|c} 0&G&e_{k} \end{array}\right]$, where $e^{T}_{k}$ is the given by $e^{T}_{k}=\left[\begin{array}{cccccc} 0&0&\cdots&0&1 \end{array}\right]$. Note that, $\tilde{G}$ is a generator matrix in the standard form of an $[1\times (s+2),k,d_{N}+1]$ NRT-metric code $\tilde{\mathcal{C}}$. Moreover, $$flip(\tilde{G})=\left[\begin{array}{c|c|c} e_{k}&flip(G)&0 \end{array}\right]\text{ and }\tilde{G}^{\circ}=\left[\begin{array}{c} e^{T}_{k}\\ \hline G^{\circ}\\ \hline 0 \end{array}\right].$$ So, \begin{equation} \tilde{G}\tilde{G}^{\circ}=\left[\begin{array}{c|c|c} 0&G&e_{k} \end{array}\right]\left[\begin{array}{c} e^{T}_{k}\\ \hline G^{\circ}\\ \hline 0 \end{array}\right]=GG^{\circ}. \end{equation} Hence $\tilde{G}\tilde{G}^{\circ}$ is nonsingular and $\tilde{G}$ generates an $[1\times (s+2),k,d_{N}+1]$ NRT-LCD code. \end{proof} \begin{proposition} For $s$ odd, and dimension $k=1$ or $k=s-1$ we have: \begin{itemize} \item[i)] $LCD[1\times s,1]=s$; \item[ii)] $LCD[1\times s,s-1]=1$. \end{itemize} \end{proposition} \begin{proof} Singleton bound (\ref{Singletonbound}) says that any $[1\times s,1]$ NRT metric code has minimum distance upper bounded by $s$. We will prove that there exist an $[1\times s,1]$ NRT-LCD code $\mathcal{C}_{1}$ such that $d_{N}(\mathcal{C}_{1})=s$. Let $\mathcal{C}_{1}$ be the binary $[1\times s,1,s]$ NRT metric code with generator matrix given by $$G_{1}=\left[\begin{array}{ccc} 1&\cdots&1 \end{array}\right].$$ Note that $G_{1}^{\circ}=\left[\begin{array}{c} 1\\ \vdots\\ 1\end{array}\right]$. So, $G_{1}G_{1}^{\circ}=1$ since $s$ is odd. That is, $G_{1}G_{1}^{\circ}$ is nonsingular and $\mathcal{C}$ is an $[1\times s,1,s]$ NRT-LCD code. Proving that $LCD[1\times s,1]=s$. Again, Singleton bound (\ref{Singletonbound}) says that any $[1\times s,s-1]$ NRT metric code has minimum distance upper bounded by $2$. We will prove that there exists an $[1\times s,s-1]$ NRT-LCD code $\mathcal{C}_{2}$ such that $d_{N}(\mathcal{C}_{2})=2$. Let $\mathcal{C}_{2}$ be the binary $[1\times s,s-1]$ NRT metric code with generator matrix given by the following standard form generator matrix \begin{equation*} G_{2}=\left[\begin{array}{cccccc} 1&1&0&0&\ldots&0\\ 1&0&1&0&\ldots&0\\ 1&0&0&1&\ldots&0\\ \vdots&\vdots&\vdots&\vdots&\ddots&\vdots\\ 1&0&0&0&\ldots&1\\ \end{array}\right]. \end{equation*} Then, \begin{equation*} G^{\circ}_{2}=\left[\begin{array}{ccccc} 0&0&0&\ldots&1\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ 0&0&1&\ldots&0\\ 0&1&0&\ldots&0\\ 1&0&0&\ldots&0\\ 1&1&1&\ldots&1\\ \end{array}\right]. \end{equation*} We can check that $G_{2}G^{\circ}_{2}$ is nonsingular and $\mathcal{C}_{2}$ is a binary $[1\times s,s-1,2]$ NRT-LCD code. \end{proof} \begin{theorem} If $s$ is even, then there is no binary $[1\times s,1]$ NRT-LCD code. \end{theorem} \begin{proof} Let $\mathcal{C}$ be a binary $[1\times s,1]$ NRT metric code. So, any generator matrix $G$ of $\mathcal{C}$ has the following form \begin{equation*} G=\left[\begin{array}{ccccc} x_1&x_2&\cdots&x_{s-1}&x_s \end{array}\right]. \end{equation*} This implies that, $$G^{\circ}=\left[\begin{array}{l} x_{s}\\ x_{s-1}\\ \vdots\\ x_{2}\\ x_{1} \end{array}\right].$$ \noindent So, \begin{eqnarray*} GG^{\circ} &=&2\sum_{i=1}^{s}x_{i}x_{s-i+1}\\ &=&0. \end{eqnarray*} Proving that there is no binary $[1\times s,1]$ NRT-LCD code. \end{proof} \begin{corollary} If $s$ is even, then there is no binary $[1\times s,s-1]$ NRT-LCD code. \end{corollary} \begin{theorem} There is a binary maximum distance separable $[1\times s,2]$ NRT-LCD code. \end{theorem} \begin{proof} If $\mathcal{C}$ is a binary maximum distance separable code of dimension two, then $d_{N}=s-1$. So, the generator matrix of $\mathcal{C}$ in standard form is \begin{equation*} G=\left[\begin{array}{ccccccc} a_{1,1}&a_{1,2}&a_{1,3}&\cdots&a_{1,s-2}&1&0\\ a_{2,1}&a_{2,2}&a_{2,3}&\cdots&a_{2,s-2}&0&1 \end{array}\right], \end{equation*} where $a_{1,j},a_{2,j}\in\mathbb{F}_{2}$ for $1\leq j\leq s-2$. Then, \begin{equation*} G^{\circ}=\left[\begin{array}{cc} 0&1\\ 1&0\\ a_{1,s-2}&a_{2,s-2}\\ \vdots&\vdots\\ a_{1,3}&a_{2,3}\\ a_{1,2}&a_{2,2}\\ a_{1,1}&a_{2,1} \end{array}\right]. \end{equation*} So, $GG^{\circ}=\left[\begin{array}{cc} A_{1,1}&A_{1,2}\\ A_{2,1}&A_{2,2} \end{array}\right]$, where \begin{itemize} \item[i)] If $s$ is even: $A_{1,1}=A_{2,2}=0$, and \begin{eqnarray*} A_{1,2}&=&a_{1,1}+a_{1,3}a_{2,s-2}+\ldots+a_{1,s-2}a_{2,3}+a_{2,2}\\ A_{2,1}&=&a_{2,2}+a_{2,3}a_{1,s-2}+\ldots+a_{2,s-2}a_{1,3}+a_{1,1}. \end{eqnarray*} Choosing $a_{1,1}=1$, and $a_{i,j}=0$ for $(i,j)\neq (1,1)$, we have that \begin{equation*} G=\left[\begin{array}{ccccccc} 1&0&0&\cdots&0&1&0\\ 0&0&0&\cdots&0&0&1 \end{array}\right] \end{equation*} is the generator matrix of a binary maximum distance separable $[1\times s,2]$ NRT-LCD code, since $GG^{\circ}\left[\begin{array}{cc} 0&1\\ 1&0 \end{array}\right]$. \item[ii)] If $n$ is odd: $A_{1,1}=a_{1,\frac{s+1}{2}}$, $A_{2,2}=a_{2,\frac{s+1}{2}}$, and \begin{eqnarray*} A_{1,2}&=&a_{1,1}+a_{1,3}a_{2,s-2}+\ldots+a_{1,\frac{s+1}{2}}a_{2,\frac{s+1}{2}}+\ldots+a_{1,s-2}a_{2,3}+a_{2,2}\\ A_{2,1}&=&a_{2,2}+a_{2,3}a_{1,s-2}+\ldots+a_{1,\frac{s+1}{2}}a_{2,\frac{s+1}{2}}+\ldots+a_{2,s-2}a_{1,3}+a_{2,2}. \end{eqnarray*} Choosing $a_{1,1}=a_{1,\frac{s+1}{2}}=a_{2,\frac{s+1}{2}}=1$ and $a_{1,j}=a_{2,j}=0$ for all $j\neq\frac{s+1}{2}$, we have that \begin{equation*} G=\left[\begin{array}{ccccccccccc} 1&0&0&\cdots&0&1&0&\cdots&0&1&0\\ 0&0&0&\cdots&0&1&0&\cdots&0&0&1 \end{array}\right] \end{equation*} is the generator matrix of a binary maximum distance separable $[1\times s,2]$ NRT-LCD code, since $GG^{\circ}\left[\begin{array}{cc} 1&0\\ 0&1 \end{array}\right]$. \end{itemize} \end{proof} \begin{corollary} $LCD[1\times s,2]=s-1$ and $LCD[1\times s,s-2]=3$. \end{corollary} \begin{theorem} There is no binary maximum distance separable $[1\times s,3]$ NRT-LCD code for even $s$. \end{theorem} \begin{proof} If $\mathcal{C}$ is a binary maximum distance separable code of dimension 3, then $d_{N}=s-2$. So, the generator matrix of $\mathcal{C}$ in standard form is \begin{equation*} G=\left[\begin{array}{ccccccccc} a_{1,1}&a_{1,2}&a_{1,3}&a_{1,4}&\cdots&a_{1,s-3}&1&0&0\\ a_{2,1}&a_{2,2}&a_{2,3}&a_{2,4}&\cdots&a_{2,s-3}&0&1&0\\ a_{3,1}&a_{3,2}&a_{3,3}&a_{3,4}&\cdots&a_{3,s-3}&0&0&1 \end{array}\right]. \end{equation*} And, \begin{equation*} G^{\circ}=\left[\begin{array}{ccc} 0&0&1\\ 0&1&0\\ 1&0&0\\ a_{1,s-3}&a_{2,s-3}&a_{3,s-3}\\ a_{1,s-4}&a_{2,s-4}&a_{3,s-4}\\ \vdots&\vdots&\vdots\\ a_{1,4}&a_{2,4}&a_{3,4}\\ a_{1,3}&a_{2,3}&a_{3,3}\\ a_{1,2}&a_{2,2}&a_{3,2}\\ a_{1,1}&a_{2,1}&a_{3,1} \end{array}\right]. \end{equation*} So, $GG^{\circ}=\left[\begin{array}{ccc} A_{1,1}&A_{1,2}&A_{1,3}\\ A_{2,1}&A_{2,2}&A_{2,3}\\ A_{3,1}&A_{3,2}&A_{3,3} \end{array}\right]$, where $A_{1,1}=A_{2,2}=A_{3,3}=0$, and \begin{eqnarray*} A_{1,2}=A_{2,1}&=&a_{1,2}+a_{2,3}+\sum_{j=4}^{s-3}a_{1,j}a_{2,s-j+1}\\ A_{1,3}=A_{3,1}&=&a_{1,1}+a_{3,3}+\sum_{j=4}^{s-3}a_{1,j}a_{3,s-j+1}\\ A_{2,3}=A_{3,2}&=&a_{2,1}+a_{3,2}+\sum_{j=4}^{s-3}a_{2,j}a_{3,s-j+1}. \end{eqnarray*} Finally, we can check that $\det(GG^{\circ})=0$. That is, $\mathcal{C}$ is not an $[1\times s,3]$ NRT-LCD code. \end{proof} \begin{theorem} There is a binary maximum distance separable $[1\times s,3]$ NRT-LCD code for odd $s$. \end{theorem} \begin{proof} Let $G$ be the generator matrix of $\mathcal{C}$ in the standard form. That is, \begin{equation*} G=\left[\begin{array}{ccccccccc} a_{1,1}&a_{1,2}&a_{1,3}&a_{1,4}&\cdots&a_{1,s-3}&1&0&0\\ a_{2,1}&a_{2,2}&a_{2,3}&a_{2,4}&\cdots&a_{2,s-3}&0&1&0\\ a_{3,1}&a_{3,2}&a_{3,3}&a_{3,4}&\cdots&a_{3,s-3}&0&0&1 \end{array}\right]. \end{equation*} Then, \begin{equation*} G^{\circ}=\left[\begin{array}{ccc} 0&0&1\\ 0&1&0\\ 1&0&0\\ a_{1,s-3}&a_{2,s-3}&a_{3,s-3}\\ a_{1,s-4}&a_{2,s-4}&a_{3,s-4}\\ \vdots&\vdots&\vdots\\ a_{1,4}&a_{2,4}&a_{3,4}\\ a_{1,3}&a_{2,3}&a_{3,3}\\ a_{1,2}&a_{2,2}&a_{3,2}\\ a_{1,1}&a_{2,1}&a_{3,1} \end{array}\right]. \end{equation*} So, $GG^{\circ}=\left[\begin{array}{ccc} A_{1,1}&A_{1,2}&A_{1,3}\\ A_{2,1}&A_{2,2}&A_{2,3}\\ A_{3,1}&A_{3,2}&A_{3,3} \end{array}\right]$, where $A_{i,i}=a_{i,\frac{s+1}{2}}$ for $i=1,2,3$, and \begin{eqnarray*} A_{1,2}=A_{2,1}&=&a_{1,2}+a_{2,3}+\sum_{j=4}^{s-3}a_{1,j}a_{2,s-j+1}\\ A_{1,3}=A_{3,1}&=&a_{1,1}+a_{3,3}+\sum_{j=4}^{s-3}a_{1,j}a_{3,s-j+1}\\ A_{2,3}=A_{3,2}&=&a_{2,1}+a_{3,2}+\sum_{j=4}^{s-3}a_{2,j}a_{3,s-j+1}. \end{eqnarray*} We can check that $\det(GG^{\circ})=a_{1,\frac{s+1}{2}}a_{2,\frac{s+1}{2}}a_{3,\frac{s+1}{2}}+a_{1,\frac{s+1}{2}}A_{2,3}+a_{2,\frac{s+1}{2}}A_{1,3}+a_{3,\frac{s+1}{2}}A_{1,2}$. So, if we choose, for example, $a_{2,1}=a_{1,\frac{s+1}{2}}=1$, and $a_{i,j}=0$ for all $(i,j)\notin\lbrace (2,1)(1,\frac{s+1}{2})\rbrace$ then \begin{equation*} G=\left[\begin{array}{ccccccccccccc} 0&0&0&0&\cdots&0&1&0&\cdots&0&1&0&0\\ 1&0&0&0&\cdots&0&0&0&\cdots&0&0&1&0\\ 0&0&0&0&\cdots&0&0&0&\cdots&0&0&0&1 \end{array}\right] \end{equation*} is such that $\det(GG^{\circ})=1$. That is, $G$ is the generator matrix of an $[1\times s,3]$ NRT-LCD code. \end{proof} \begin{corollary} If $s$ is odd, then $LCD[1\times s,3]=s-2$ and $LCD[1\times s,s-3]=4$. \end{corollary} In general, we have the following result for $k$ even. \begin{theorem}\label{MDSexistenceforkeven} There is a binary maximum distance separable $[1\times s,k]$ NRT-LCD code for $k$ is even. In other words, if $k$ is even then $LCD[1\times s,k]=s-k+1$. \end{theorem} \begin{proof} Let $\mathcal{C}$ be the binary $[1\times s,k,s-k+1]$ NRT metric code given by the following generator matrix in the standard form \begin{equation} G=\left[\begin{array}{c} e_{1}+e_{s-k+1}\\ e_{2}+e_{s-k+2}\\ \vdots\\ e_{\frac{k}{2}}+e_{s-\frac{k}{2}}\\ e_{s-\frac{k}{2}+1}\\ e_{s-\frac{k}{2}+2}\\ \vdots\\ e_{s-1}\\ e_{s} \end{array}\right], \end{equation} where $e_{i}$ is the $i$-th canonical vector of $\mathbb{F}_{2}^{s}$ for $1\leq i\leq s$. So, \begin{equation} flip(G)=\left[\begin{array}{c} e_{s}+e_{k}\\ e_{s-1}+e_{k-1}\\ \vdots\\ e_{s-\frac{k}{2}+1}+e_{\frac{k}{2}-1}\\ e_{\frac{k}{2}}\\ e_{\frac{k}{2}-1}\\ \vdots\\ e_{2}\\ e_{1} \end{array}\right], \end{equation} and \begin{equation} G^{\circ}=\left[\begin{array}{c|c|c|c|c|c|c|c|c} e^{T}_{s}+e^{T}_{k}&e^{T}_{s-1}+e^{T}_{k-1}&\cdots&e^{T}_{s-\frac{k}{2}+1}+e^{T}_{\frac{k}{2}-1}&e^{T}_{\frac{k}{2}}&e_{\frac{k}{2}-1}&\cdots&e^{T}_{2}&e^{T}_{1} \end{array}\right]. \end{equation} Finally, \begin{equation} GG^{\circ}=\left[\begin{array}{ccccc} 0&0&\cdots&0&1\\ 0&0&\cdots&1&0\\ \vdots&\vdots&\vdots&\vdots&\vdots\\ 0&1&\cdots&0&0\\ 1&0&\cdots&0&0\\ \end{array}\right]. \end{equation} $GG^{\circ}$ is clearly nonsingular. Proving that $\mathcal{C}$ is a binary maximum distance separable $[1\times s,k]$ NRT-LCD code. \end{proof} The case where $s$ and $k$ are odd is described by the following theorem. \begin{theorem}\label{MDSexistenceforskodd} There is a binary maximum distance separable $[1\times s,k]$ NRT-LCD code for $s$ and $k$ odd. In other words, if $s$ and $k$ are odd then $LCD[1\times s,k]=s-k+1$. \end{theorem} \begin{proof} Let $\mathcal{C}$ be the binary $[1\times s,k,s-k+1]$ NRT metric code given by the following generator matrix in the standard form \begin{equation} G=\left[\begin{array}{c} e_{\frac{s+1}{2}}+e_{s-k+1}\\ e_{1}+e_{s-k+2}\\ e_{2}+e_{s-k+3}\\ \vdots\\ e_{\frac{k+1}{2}-1}+e_{s-k+\frac{k+1}{2}}\\ e_{s-k+\frac{k+1}{2}}\\ e_{s-k+\frac{k+1}{2}+1}\\ \vdots\\ e_{s-1}\\ e_{s} \end{array}\right], \end{equation} where $e_{i}$ is the $i$-th canonical vector of $\mathbb{F}_{2}^{s}$ for $1\leq i\leq s$. So, \begin{equation} flip(G)=\left[\begin{array}{c} e_{\frac{s+1}{2}}+e_{k}\\ e_{s}+e_{k-1}\\ e_{s-1}+e_{k-2}\\ \vdots\\ e_{s-\frac{k-3}{2}}+e_{\frac{k+1}{2}}\\ e_{\frac{k+1}{2}-1}\\ e_{\frac{k+1}{2}-2}\\ \vdots\\ e_{2}\\ e_{1} \end{array}\right], \end{equation} and \begin{equation} G^{\circ}=\left[\begin{array}{c|c|c|c|c|c|c|c|c|c} e^{T}_{\frac{s+1}{2}}+e^{T}_{k}&e^{T}_{s}+e^{T}_{k-1}&e^{T}_{s-1}+e^{T}_{k-2}&\cdots&e^{T}_{s-\frac{k-3}{2}}+e^{T}_{\frac{k+1}{2}}&e^{T}_{\frac{k+1}{2}-1}&e_{\frac{k+1}{2}-2}&\cdots&e^{T}_{2}&e^{T}_{1} \end{array}\right]. \end{equation} Finally, \begin{equation} GG^{\circ}=\left[\begin{array}{ccccc} 1&0&\cdots&0&0\\ 0&0&\cdots&0&1\\ 0&0&\cdots&1&0\\ \vdots&\vdots&\vdots&\vdots&\vdots\\ 0&1&\cdots&0&0\\ \end{array}\right]. \end{equation} $GG^{\circ}$ is clearly nonsingular. Proving that $\mathcal{C}$ is a binary maximum distance separable $[1\times s,k]$ NRT-LCD code. \end{proof} \section{Elementary bounds on binary NRT-LCD codes $M_{n,2}(\mathbb{F}_{2})$}\label{nx2} In this section, we prove a condition on the non-existence of binary maximum distance separable $[n\times 2,k]$ NRT-LCD codes. For this purpose, we will consider the Plotkin bound \cite{NRT} for NRT metric codes. \begin{theorem}(\cite{NRT}\label{Plotkin}, Plotkin bound for NRT metric codes). Let $\mathcal{C}$ be an $[n\times s,k,d_{N}]$ NRT metric code such that $d_{N}>ns\delta_{crit}$, where $\delta_{crit}=1-\frac{1}{sq^{s}}\frac{q^{s}-1}{q-1}$. Then, \begin{equation}\label{Plotkin} q^{k}\leq\frac{d_{N}}{d_{N}-ns\delta_{crit}}. \end{equation} \end{theorem} \begin{lemma} $LCD[n\times 2,k]\leq\left(\frac{5}{2^{k}-1}\right)n<2n-k+1$ for $n>\left(\frac{2^{k}-1}{2^{k+1}-7}\right)(k-1)$. \end{lemma} \begin{proof} Let's first prove that $LCD[n\times 2,k]\leq\left(\frac{5}{2^{k}-1}\right)n$. By the Plotkin bound (\ref{Plotkin}), any binary $[n\times 2,k,d_{N}]$ NRT metric code with $d_{N}>2n\delta_{crit}=\frac{5}{4}n$ satisfies \begin{equation} 2^{k}\leq\frac{d_{N}}{d_{N}-\frac{5n}{4}}. \end{equation} Solving for $d_{N}$, we have $d_{N}\leq\left(\frac{5}{2^{k}-1}\right)n$. Therefore any $[n\times 2, k, d_{N}]$ NRT-LCD code must satisfy this inequality. proving that $LCD[n\times 2,k]\leq\left(\frac{5}{2^{k}-1}\right)n$. Now, note that \begin{equation} 2n-k+1-\left(\frac{5}{2^{k}-1}\right)n>0\Longleftrightarrow\left(\frac{2^{k+1}-7}{2^{k}-1}\right)>k-1\Longleftrightarrow n>\left(\frac{2^{k}-1}{2^{k+1}-7}\right)(k-1). \end{equation} Proving that $\left(\frac{5}{2^{k}-1}\right)n<2n-k+1$ if $n>\left(\frac{2^{k}-1}{2^{k+1}-7}\right)(k-1)$. \end{proof} \begin{corollary} Let $n,k$ be positive integers such that $n>\left(\frac{2^{k}-1}{2^{k+1}-7}\right)(k-1)$. Then, there is no binary maximum distance separable $[n\times 2, k]$ NRT-LCD code. \end{corollary} \begin{corollary} Let $n,k$ be positive integers such that $n>\left(\frac{2^{k}-1}{2^{k+1}-7}\right)(k-1)$. Then, $$LCD[n\times 2, k]<2n-k+1.$$ \end{corollary} \begin{theorem} We have the following: \begin{itemize} \item[i)] $LCD[2\times 2,2]=2$; \item[ii)] $LCD[3\times 2,2]=5$; \end{itemize} \end{theorem} \begin{proof} i) Let $\mathcal{C}$ be the binary $[2\times 2, 2]$ NRT metric code given by the following generator matrix \begin{equation*} G=\left[\begin{array}{cc|cc} 1&0&1&1\\ 0&1&1&1 \end{array}\right]. \end{equation*} It is easy to check that $GG^{\dag}$ is non-singular and $d_{N}(\mathcal{C})=2$. Let's prove that there is no binary $[2\times 2,2,3]$ NRT-LCD code. Note that by Theorem \ref{marceloS}, if $\mathcal{C}$ is a binary $[2\times 2, 2]$ NRT metric code, then $\mathcal{C}$ is equivalent to a code with generator matrix given by $G=[G_{1}\mid G_{2}]$, where the nonzero rows of $G_1$ are distinct canonical vectors arranged in order of increasing NRT weight, and $G$ is in the block echelon form. Moreover, the last row of $G_{2}$ is non-zero, since $\dim(\mathcal{C})=2$. If the last row of $G_{1}$ is zero then $\mathcal{C}$ has a codeword with a zero row. That is, in this case $d_{N}(\mathcal{C})\leq 2$. So, the only case that we have to analyze is the case where \begin{equation}\label{Gen22} G=\left[\begin{array}{cc|cc} 1&0&a&b\\ 0&1&c&d \end{array}\right], \end{equation} where $(c,d)\neq (0,0)$. In this case, \begin{equation*} GG^{\dag}=\left[\begin{array}{cc} 0&1+ad+bc\\ 1+ad+bc&0 \end{array}\right] \end{equation*} and the generator matrices $G$ of the form (\ref{Gen22}) such that $GG^{\dag}$ is non-singular are \begin{equation*} \left[\begin{array}{cc|cc} 1&0&1&0\\ 0&1&1&0 \end{array}\right],\left[\begin{array}{cc|cc} 1&0&0&1\\ 0&1&0&1 \end{array}\right],\left[\begin{array}{cc|cc} 1&0&0&0\\ 0&1&1&1 \end{array}\right],\left[\begin{array}{cc|cc} 1&0&0&0\\ 0&1&0&1 \end{array}\right]. \end{equation*} The one can check that those matrices generates $[2\times 2,2]$ NRT-LCD codes with $d_{N}(\mathcal{C})\leq 2$. \noindent ii) Let $\mathcal{C}$ be the binary $[2\times 2,2]$ NRT-metric code with generator matrix given by \begin{equation*} G=\left[\begin{array}{cc|cc|cc} 1&0&1&1&1&1\\ 0&1&0&1&1&0 \end{array}\right]. \end{equation*} It is easy to check that $GG^{\dag}=\left[\begin{array}{cc} 0&1\\ 1&0 \end{array}\right]$. That is, $\mathcal{C}$ is an binary $[3\times 2,2]$ NRT-LCD code. Moreover, \begin{equation*} \mathcal{C}=\left\lbrace\left[\begin{array}{cc} 0&0\\ 0&0\\ 0&0 \end{array}\right],\left[\begin{array}{cc} 1&0\\ 1&1\\ 1&1 \end{array}\right],\left[\begin{array}{cc} 0&1\\ 0&1\\ 1&0 \end{array}\right],\left[\begin{array}{cc} 1&1\\ 1&0\\ 0&1 \end{array}\right]\right\rbrace \end{equation*} and $d_{N}(\mathcal{C})=5$. \end{proof} \begin{corollary}\label{ndif3} There is a binary maximum distance separable $[n\times 2,2]$ NRT-LCD code if and only if $n=3$. \end{corollary} \begin{theorem} Let $n\neq 3$ be a positive integer. Then $$n\leq LCD[n\times 2,2]\leq 2n-1.$$ \end{theorem} \begin{proof} $LCD[n\times 2,2]\leq 2n-1$ by Corollary \ref{ndif3}. Let's check that $LCD[n\times 2,2]\geq n$. Note that, if $n$ is odd, then the binary $[n\times 2, 2]$ NRT-LCD code \begin{equation*} \mathcal{C}=\left\lbrace 0,\left[\begin{array}{c|c} \sum_{i=1}^{n}e^{T}_{i}&0^{T} \end{array}\right],\left[\begin{array}{c|c} 0^{T}&\sum_{i=1}^{n}e^{T}_{i} \end{array}\right],\left[\begin{array}{c|c} \sum_{i=1}^{n}e^{T}_{i}&\sum_{i=1}^{n}e^{T}_{i} \end{array}\right]\right\rbrace. \end{equation*} is such that $d_{N}(\mathcal{C})=n$. Now, if $n$ is even, then the binary $[n\times 2,2]$ NRT-LCD code \begin{equation*} \mathcal{C}=\left\lbrace 0,\left[\begin{array}{c|c} \sum_{i=1}^{n}e^{T}_{i}&0^{T} \end{array}\right],\left[\begin{array}{c|c} 0^{T}&\sum_{i=1}^{n-1}e^{T}_{i} \end{array}\right],\left[\begin{array}{c|c} \sum_{i=1}^{n}e^{T}_{i}&\sum_{i=1}^{n-1}e^{T}_{i} \end{array}\right]\right\rbrace. \end{equation*} is such that $d_{N}(\mathcal{C})=n$. \end{proof} \subsection{A linear programming bound for binary NRT-LCD codes in $M_{n,2}(\mathbb{F}_{2})$} In this section, we present a linear programming bound for binary NRT-LCD codes. We will make use of generalized MacWilliams identity for NRT metric codes. The MacWilliams identity was proven with different approaches in \cite{BargAndPurka, H.Trinker,Siap,DS}. We will present this identity for the case where $s=2$ to suit to the context of the present paper. \begin{definition} Let $v\in M_{n,2}(\mathbb{F}_{2})$ written as $[v_{1};v_{2};\ldots,v_{n}]$, where $v_{i}=[v_{i,1},v_{i,2}]$ for $i=1,\ldots, n$. The shape of $v$ with respect to the NRT weight is an $2$-vector $shape(v)=(e_{1},e_{2})$, where \begin{equation} e_{j}=\mid\lbrace i: 1\leq i\leq n\text{ and }\rho(v_{i})=j\rbrace\mid. \end{equation} Also define $e_{0}=n-\mid shape(v)\mid$, where $\mid shape(v)\mid=e_{1}+e_{2}$. \end{definition} A combinatorial calculation shows that the number og $v\in M_{n,2}(\mathbb{F}_{2})$ such that $shape(e_1,e_{2})$ is given by \begin{equation} \binom{n}{e_{0},e_{1},e_{2}}2^{e_{2}}. \end{equation} Note that, if for $v\in M_{n,2}(\mathbb{F}_{2})$, we define $\mid shape(e)\mid^{\prime}=e_{1}+2e_{2}$, then $\rho(v)=\mid shape(e)\mid^{\prime}$. The shape enumerator of $\mathcal{C}\subseteq M_{n,2}(\mathbb{F}_{2})$ is the polynomial \begin{eqnarray*} H_{\mathcal{C}}(z_{0},z_{1},z_{2})=\sum_{e\in\Delta_{n,2}}\mathcal{A}_{e}z^{e_0}_{0}z^{e_1}_{1}z^{e_2}_{2}, \end{eqnarray*} where $\mathcal{A}_{e}:=\mid\lbrace v\in\mathcal{C}:shape(v)=e\rbrace\mid$ and $\Delta_{n,2}=\lbrace e\in\mathbb{N}^{2}:e_{0}+e_{1}+e_{2}=n\rbrace$. \begin{theorem}(\cite{H.Trinker})\label{MacWilliamsShape} Let $\mathcal{C}\subseteq M_{n,2}(\mathbb{F}_{2})$ be an $[n\times 2,k]$ NRT metric code. Further on let $\left(\mathcal{A}_{e}\right)$ be the shape distribution of $\mathcal{C}$ and $\left(\mathcal{A}^{\prime}_{e}\right)$ be the shape distribution of $\mathcal{C}^{\perp_{N}}$. Then \begin{equation*} \mathcal{A}^{\prime}_{e}=\frac{1}{2^{k}}\sum_{e^{\star}\in\Delta_{n,2}}B_{e}(e^{\star})\mathcal{A}_{e^{\star}}, \end{equation*} where \begin{equation*} B_{e}(e^{\star})=2^{e_{2}}\prod^{2}_{t=1}\left(\sum_{j_{t}=0}^{e_t}(-1)^{j_t}\binom{e^{\star}_{3-t}}{j_{t}}\binom{\sum_{r=0}^{2-t}e^{\star}_{r}-\sum_{r=t+1}^{2}e^{\star}_{r}}{e_{t}-j_{t}}\right). \end{equation*} \end{theorem} Note that if $\mathcal{C}$ is a binary $[n\times 2,k]$ NRT-LCD code and $\mathcal{A}_{e}$ its shape distribution. Let $\mathcal{A}_{e}^{\prime}$ be the shape distribution of its dual code $\mathcal{C}^{\perp_{N}}$. By the definition of NRT-LCD code, if $v\in\mathcal{C}$ then $v\notin\mathcal{C}^{\perp_{N}}$, so \begin{equation}\label{A_e+A_eP} \mathcal{A}_{e}+\mathcal{A}^{\prime}_{e}\leq\binom{n}{e_{0},e_{1},e_{2}}2^{e_{2}}. \end{equation} By the Theorem \ref{MacWilliamsShape}, we have that \begin{equation}\label{A_eP} \mathcal{A}^{\prime}_{e}=\frac{1}{2^{k}}\sum_{e^{\star}\in\Delta_{n,2}}B_{e}(e^{\star})\mathcal{A}_{e^{\star}}. \end{equation} Moreover, since $\dim\mathcal{C}=k$, we have that \begin{equation}\label{2k} 2^{k}=\sum_{e^{\star}\in\Delta_{n,2}}\mathcal{A}_{e^{\star}}. \end{equation} Combining (\ref{A_e+A_eP}), (\ref{A_eP}) and (\ref{2k}). We have the following bound for binary NRT-LCD codes. \begin{theorem} If $\mathcal{C}$ is a binary $[n\times 2,k]$ NRT-LCD code. Then, \begin{equation} 2^{k}\mathcal{A}_{e}\leq\sum_{e^{\star}\in\Delta_{n,2}}\mathcal{A}_{e ^{\star}}\left[\binom{n}{e_{0},e_{1},e_{2}}-B_{e}(e^{\star})\right]. \end{equation} \end{theorem} \section{Constructions}\label{constructions} In this section, we present two new constructions of binary Niederreiter-Rosenbloom-Tsfasman linear complementary dual codes. The first construction (Theorem \ref{construction1}) gives a binary NRT-LCD code in $M_{1,s+2}(\mathbb{F}_{2})$ from a binary NRT-LCD code in $M_{1,s+2}(\mathbb{F}_{2})$, where $s$ is odd. The second construction (Theorem \ref{construction2}) gives a binary NRT-LCD code in $M_{n,s+2}(\mathbb{F}_{2})$, from a binary NRT-LCD code in $M_{1,s}(\mathbb{F}_{2})$, where $s$ and $n$ are odd. \begin{theorem}\label{construction1} Let $\mathcal{C}$ be a binary $[1\times s,k]$ NRT-LCD code with generator matrix \begin{equation} G:=\left[\begin{array}{c} g_{1}\\ g_{2}\\ \vdots\\ g_{k} \end{array}\right]=\left[\begin{array}{cccc} g_{1,1}&g_{1,2}&\ldots&g_{1,s}\\ g_{2,1}&g_{2,2}&\ldots&g_{2,s}\\ \vdots&\vdots&\ddots&\vdots\\ g_{k,1}&g_{k,2}&\ldots&g_{k,s} \end{array}\right]. \end{equation} Let $x=(x_1,x_2,\ldots,x_s)\in\mathbb{F}^{s}_{2}$ and $\mathcal{C}(x)$ be the binary code with the following generator matrix \begin{equation} G(x)=\left[\begin{array}{l|lll|l} 1&x_{1}&\ldots&x_{s}&0\\ \hline \langle x,g_1\rangle_{N}&g_{1,1}&\ldots&g_{1,s}&\langle x,g_1\rangle_{N}\\ \vdots&\vdots&\ddots&\vdots&\vdots\\ \langle x,g_k\rangle_{N}&g_{k,1}&\cdots&g_{k,s}&\langle x,g_k\rangle_{N} \end{array}\right]. \end{equation} If $s$ is odd and $x_{\frac{s+1}{2}}=1$ and $x_{j}=0$ for $ j>\frac{s+1}{2}$. Then, $\mathcal{C}(x)$ is a binary $[1\times (s+2),k+1]$ NRT-LCD code. \end{theorem} \begin{proof} It is clear that $\mathcal{C}(x)$ is a binary $[1\times(s+2),k+1]$ NRT metric code. Note that \begin{equation} G^{\circ}(x)=\left[\begin{array}{l|llll} 0&\langle x,g_1\rangle_{N}&\ldots&\langle x,g_{k-1}\rangle_{N}&\langle x,g_{k}\rangle_{N}\\ \hline x_{s}&g_{2,s}&\ldots&g_{k-1,s}&g_{k,s}\\ x_{s-1}&g_{2,s-1}&\ldots&g_{k-1,s-1}&g_{k,s-1}\\ \vdots&\vdots&\ddots&\vdots&\vdots\\ x_{1}&g_{1,1}&\ldots&g_{k-1,1}&g_{k,1}\\ \hline 1&\langle x,g_{1}\rangle_{N}&\cdots&\langle x,g_{k}\rangle_{N}&\langle x,g_{k}\rangle_{N} \end{array}\right]. \end{equation} Thus, \begin{equation*} G(x)G^{\circ}(x)=\left[\begin{array}{c|c} \langle x,x\rangle_{N}&\textbf{0}\\ \hline &\multirow{2}{2cm}{$GG^{\circ}$}\\ \textbf{0}^{T}& \\ \end{array}\right],\text{ where }\textbf{0}=(0,0,\ldots,0)\in\mathbb{F}^{k}_{2}.\\ \end{equation*} Note also that $\langle x,x\rangle_{RT}=\left(x_{\frac{s+1}{2}}\right)^2=1$. That is, $G(x)G^{\circ}(x)$ is nonsigular. Proving that $\mathcal{C}(x)$ is a binary $[1\times(s+2),k+1]$ NRT-LCD code. \end{proof} \begin{theorem}\label{construction2} Let $\mathcal{C}$ be a binary $[1\times s,k]$ NRT-LCD code with generator matrix \begin{equation} G:=\left[\begin{array}{c} g_{1}\\ g_{2}\\ \vdots\\ g_{k} \end{array}\right]=\left[\begin{array}{cccc} g_{1,1}&g_{1,2}&\ldots&g_{1,s}\\ g_{2,1}&g_{2,2}&\ldots&g_{2,s}\\ \vdots&\vdots&\ddots&\vdots\\ g_{k,1}&g_{k,2}&\ldots&g_{k,s} \end{array}\right]. \end{equation} Let $x=(x_1,x_2,\ldots,x_s)\in\mathbb{F}^{s}_{2}$, and $\mathcal{C}(x)$ be the binary $[1\times(s+2),k+1]$ NRT code with the following generator matrix \begin{equation} G(x)=\left[\begin{array}{l|lll|l} 1&x_{1}&\ldots&x_{s}&0\\ \hline \langle x,g_1\rangle_{N}&g_{1,1}&\ldots&g_{1,s}&\langle x,g_1\rangle_{N}\\ \vdots&\vdots&\ddots&\vdots&\vdots\\ \langle x,g_k\rangle_{N}&g_{k,1}&\cdots&g_{k,s}&\langle x,g_k\rangle_{N} \end{array}\right]. \end{equation} If $s$ and $n$ are odd, $x_{\frac{s+1}{2}}=1$ and $x_{j}=0$ for $ j>\frac{s+1}{2}$. Then, the code $\mathcal{C}_{n}(x)$ generated by \begin{equation} G_{(n)}:=G(x,x,\ldots,x)=[G(x)\mid G(x)\mid\cdots\mid G(x)] \end{equation} is a binary $[n\times(s+2),k+1]$ NRT-LCD code. \end{theorem} \begin{proof} It is clear that the length of $\mathcal{C}_{n}(x)$ is a binary $[n\times (s+2),k+1]$ NRT metric code. Note that \begin{equation} G_{(n)}^{\dag}=\left[\begin{array}{c} G^{\circ}(x)\\ G^{\circ}(x)\\ \vdots\\ G^{\circ}(x) \end{array}\right]. \end{equation} Thus, \begin{eqnarray*} G_{(n)}G^{\dag}_{(n)}&=&G(x)G^{\circ}(x)+G(x)G^{\circ}(x)+\cdots+G(x)G^{\circ}(x)\\ &=&G(x)G^{\circ}(x) \end{eqnarray*} since $n$ is odd. So, $G_{(n)}G^{\dag}_{(n)}$ is nonsingular. Proving that $\mathcal{C}_{n}(x)$ is a binary $[1\times(s+2),k+1]$ NRT-LCD code. \end{proof} \section{Conclusion} In this paper, we studied the maximum minimum distance of a binary NRT-LCD code. In particular, we proved the existence of binary maximum distance separable $[1\times s, k]$ NRT-LCD codes for the cases where $k$ is even or $s$ and $k$ are odd. We derived conditions on $n$ for the existence of binary $[n\times 2,k]$ NRT-LCD codes. Finally, we present a linear programming bound for binary $[n\times 2,k]$ NRT-LCD codes and two new constructions. It would be interesting to find construction methods of maximum distance separable codes with small hulls for the parameters that we can not construct maximum distance separable NRT-LCD code.
\section{Introduction} \label{sec:intro} Bismuth Germanium Oxide ($\rm Bi_4 Ge_3 O_12$, BGO) crystal is a scintillation material that is widely used as a detector in particle physics and astrophysics. Some of the advantages are rich light yield and large atomic number to enhance detection efficiency of high energy photons. It is also suitable for calorimeter~\cite{DAMPE:2017fbg, BGO-OD:2019utx}. Recently, rare-event searches, such as dark matter~\cite{JLTP2008, CORON20091393} and coherent elastic neutrino-nucleus scattering~\cite{BIASSONI2012151} have been conducted using BGO crystal. In the events of nuclear recoil with lower energy, it should be considered with light emission quench of the recoil energy. The yield of scintillation light for deposited energy of recoil nuclei in the inorganic crystal is generally smaller than that for deposited energy of recoil electrons. A ratio of the visible energy $E_{\rm vis}$ to the energy of recoil nuclei $E_{\rm R}$ is called quenching factor ($QF$). It is defined as: \begin{eqnarray} QF=E_{\rm vis}/E_{\rm R}, \end{eqnarray} where $QF$ depends on the material and energy of recoil nuclei. In the scintillating bolometric techniques at 20~mK, the $QF$ was determined to be 12–15\% for several dozen keV in BGO crystals, which is the ratio of the relation between light yield and heat signals for gamma-ray and nuclear recoil events~\cite{CEBRIAN200297, CORON20091393, CORON2004159}. In this study, we have reported a method to measure the $QF$ for oxygen recoil in BGO crystal using monoenergetic neutron irradiation that is capable of expanding the recoil energy up to MeV scale of recoil energy. The rest of the article is organized as follows. In Sec.~\ref{sec:exp}, we have briefly described the experimental setup and detector calibration. In Sec.~\ref{sec:sim}, we have explained the details of simulation and compared the results with that of the measured spectrum. Analysis of the proposed method and summary of results for $QF$ are shown in Sec.~\ref{sec:ana} and \ref{sec:result}, respectively. Finally, we have presented the conclusion. \section{Experiment} \label{sec:exp} \subsection{Setup} To measure the $QF$ of BGO, we have performed an experiment with accelerator-based neutron facility at the National Institute of Advanced Industrial Science and Technology (AIST), Japan~\cite{AIST.2009}. Figure~\ref{fig:beamtest} shows the graphical and schematic view of our experimental setup. The monoenergetic neutrons are produced by deuterium interacting with a titanium-tritium target (for 14.8~MeV) and titanium-deuterium target (for 3 MeV) through the process of T($d,n$)$^4$He and $d$($d,n$)$^3$He, respectively. The neutron fluence is a few hundred $\rm cm^{-2}$. To monitor the 14.8~MeV neutron fluence, the associated alpha particles produced by T($d,n$)$^4$He toward 90.7$^{\circ}$ and 131.9$^{\circ}$ are collimated with tantalum and detected by silicon surface barrier detectors (SSBD). To monitor the 3.0~MeV neutron fluence, a proton recoil is detected by a 0.5~mm thick polyethylene disk mounted SSBD. A BGO detector is placed at the center of the deuterium beamline at a distance of 1~m from the Ti-T (Ti-D) target and liquid scintillation (LS) detector is placed at a distance of 1~m from the BGO detector by changing the scattering angle $\theta$ defined in Fig.~\ref{fig:beamtest}. The BGO detector is set to measure the quenching factor for nuclei recoiled by neutrons and LS detector is set to detect the neutrons scattered from the BGO detector. The energy of recoil nucleus is correlated with the neutron scattering angles by a function given by: \begin{eqnarray} E_{\rm R} = E_{\rm n} \left\{ 1 - \left(\frac{m_{\rm n} \cos\theta + \sqrt{m_{\rm N}^2 - m_{\rm n}^2 \sin^2\theta }}{m_{\rm n} + m_{\rm N}}\right)^2 \right\}, \end{eqnarray} where $E_{\rm n}$ is the energy of the incident neutron, and $E_{\rm n}$ and $E_{\rm N}$ are neutron and nuclei mass, respectively. We have measured the $QF$ for various energies of recoil nuclei. The energies are selected by changing the position of the LS detector at different angles with respect to the BGO detector. \begin{figure}[htbp] \centering \includegraphics[width=\textwidth] {Fig1.eps} \caption{\label{fig:beamtest} Graphical view (top) and schematic view (bottom) of setup for neutron irradiation at AIST, Japan. The neutron scattering angle $\theta$ is varied up to 90$^{\circ}$. } \label{figure.setup} \end{figure} \subsection{Detector configuration} We have used a BGO scintillation detector composed of a BGO crystal (density of 7.13~g/cm$^3$) with depth and radius of 2~inches each. It is connected to phototubes (R6231-100, Hamamatsu) on both sides and photo-shielded by aluminized Mylar and black sheet. Typically, 1,000~photons/MeV of light yield is achieved for the energy deposition of charged particles. To identify the neutron scattering events, we have used a liquid scintillation detector. It consists of a vessel with depth and radius of 3 inches each filled with a liquid scintillator (BC501A, Bicron) and phototube (9822B, ET Enterprises) connected to the window of the vessel. \subsection{Front-end electronics and data acquisition} The front-end electronics is shown in Fig.~\ref{fig:electronics}. The waveforms of analog signals are recorded by the flash ADC when both BGO and LS detectors detect signals. The coincidence signals from both phototubes on the BGO detector are required to suppress dark noise and lower the threshold to the level below 1~p.e. for each phototube. Therefore, these thresholds are set to a voltage of 0.5~p.e. equivalent. The width of coincidence signal is set to 200~ns. A trigger signal is generated by the coincidence signals from the BGO and LS detectors. The trigger is fed to the flash ADC (DRS4, PSI) and the waveform of analog signals from these detectors are stored with a precision of 14~bits ADC for a particular pulse height and 0.7~GSPS sampling rate for a full range of 1463~ns. \begin{figure}[htbp] \centering \includegraphics[width=0.9\textwidth] {Fig2.eps} \caption{\label{fig:electronics} Schematic diagram of front-end electronics and data acquisition. } \end{figure} \subsection{Calibration and performance check} \label{sec:calibration} Typical waveforms of the signals are displayed in Fig.~\ref{fig:waveform}. The waveform of PMT 1 and 2 of the BGO detector are shown by shifting +400~mV and +200~mV in this figure, respectively. The expected energy of the recoil nuclei signals is as low as a few dozen to several hundred keV. With such a low energy, the waveform looks like a jagged line made of several single photoelectron signals following the time distribution of an exponential function with a decay constant of 300~ns. The energy deposit in the BGO scintillator is evaluated with the cumulative charge of two PMTs that is an integration of the waveforms from 143 to 1463~ns. The waveform of the LS detector is indicated by shifting 0~mV in Fig.~\ref{fig:waveform}. As most of the signal is distributed between 0–571~ns and the peak width is narrow ($\sim$30~ns), the charge is calculated with an integration window of 0–571 ns. However, the waveform overlapping with the other neutron signals was not observed in this experiment. The arrival time difference $dt$ is calculated as $dt=t_{LS} - t_{BGO}$ where $t_{LS}$ is the rise time of the waveform from the LS detector and $t_{BGO}$ is an average of the rise times for two phototubes of the BGO detector. The rise time is defined as a time when an absolute voltage is over one-third of the pulse height from the baseline. \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth] {Fig3.eps} \caption{\label{fig:waveform} Typical waveforms of the phototubes from the BGO and liquid scintillation detectors. } \end{figure} The energy calibration for the BGO detector has been performed by using various gamma-ray sources for $\mathcal{O}(10)\sim\mathcal{O}(100)$~keV scale, including $^{57}$Co (47 and 122~keV), $^{133}$Ba (31, 81, and 356~keV), $^{137}$Cs (32 and 662~keV), and $^{241}$Am (16.1 and 59.5~keV). We have determined the calibration coefficient as $(1.788\pm0.001)\times10^2~{\rm keV_{ee}/nC}$ \footnote{${\rm keV_{ee}}$ is a unit of visible energy assuming energy deposition of electrons in the scintillation detectors.} by a linear fit to the relation between the sum of the integrated charges from two phototubes on both ends of the BGO crystal and gamma-ray energy as shown in Fig.~\ref{fig:ene.calib}~(a). The energy resolution for deposited energy $E_{\rm vis}$ is evaluated as shown in Fig.~\ref{fig:ene.calib}~(b). The resolution curve is consistent with an inversely proportional function $\sqrt{E_{\rm vis}}$. These indicate the energy threshold of $\sim$7~${\rm keV_{ee}}$ and lower limit of the energy peak at 16~${\rm keV_{ee}}$ with a resolution of 38\%. \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth] {Fig4.eps} \caption{\label{fig:ene.calib} Relation between the integrated charge of the signal waveform and energy for BGO detector (a). The evaluated energy resolution as a function of visible energy (b). Open circles are data and red lines are a fit function. Temperature has been stable at 18~$^\text{o}\rm C$ during the measurement. } \end{figure} The timing resolution of our detector is evaluated with $^{22}$Na source by applying its positron annihilation gamma rays. The result is shown in Fig.~\ref{fig:time.reso}. It was observed that the timing resolution worsens at lower $\rm keV_{ee}$ as expected, and the resolution is estimated by the exponential fit in the energy region less than $\mathcal{O}(100)~\rm {keV}_{ee}$. \begin{figure}[htbp] \centering \includegraphics[width=0.5\textwidth] {Fig5.eps} \caption{\label{fig:time.reso} Timing resolution as a function of visible energy. Black open circles are the data. Red line is a fit result by a function composed of exponential and constant terms. } \end{figure} \subsection{Energy and intensity of irradiated neutrons} Energy of the irradiated neutrons are monitored by the $^3$He detector in a polyethylene Bonner sphere placed at the same position as the BGO detector at a distance of 1 m away from the beam target. Figure~\ref{fig:beam.energy} shows the monitored energy spectra of neutrons generated from ${\rm T}(d,n)^{4}{\rm He}$ and $d(d,n)^{3}{\rm He}$ reactions. The measured spectrum has been adopted in the simulation as the initial neutron energy distributions. \begin{figure}[htbp] \centering \includegraphics[width=\textwidth] {Fig6.eps} \caption{ Neutron energy spectra for $d(d,n)^{3}{\rm He}$ (left) and ${\rm T}(d,n)^{4}{\rm He}$ (right) reactions. } \label{fig:beam.energy} \end{figure} The intensity of irradiated neutrons is relevant to a ratio of the number of signal events to the accidental coincident background. To evaluate the impact, we have measured two different intensities $\rm{\sim670}$ and $\rm{\sim200}~cm^{-2}~s^{-1}$ for the neutron energy of 14.8~MeV. For 3~MeV neutron irradiation, we have considered the data with the neutron intensity of $\rm{\sim100}~cm^{-2}~s^{-1}$. \section{Monte Carlo Simulation} \label{sec:sim} In this study, we have performed Monte Carlo simulation using GEANT4 toolkit~\cite{GEANT4} (Geant4.9.6p04 + G4NDL4.2) and compared the results with that of the experiment. Geometric configuration of the experimental hall was reproduced in the simulation with a beam pipe, detector stage, wall, mesh floor, and ceiling in AIST. The neutrons were irradiated to the detector composed of phototubes, BGO crystal, and liquid scintillator. The detector response was simulated based on the measured energy resolution described in Sec.~\ref{sec:calibration}. The neutron dataset of ENDF-VIII.0 model was adopted for the simulation. Model dependence of the cross sections for elastic and inelastic scattering of oxygen, germanium, and bismuth is negligible while determining $QF$ in this study. The neutron energy distribution shown in Fig.~\ref{fig:beam.energy} was used as the input to the simulation. In this study, the energy of recoil nuclei is determined by the scattering angle of neutrons. Therefore, bias of the scattering angle $\theta$ due to the secondary scattering in other materials surrounding the detectors causes a shift of the recoil energy, thus resulting in the variation of the measured $QF$. In addition, width of the initial neutron energy causes variation in the energy of recoil nuclei $E_R$ in the detector. These effects were evaluated and accounted for as systematic uncertainty on the dependence of $E_R$ in the $QF$measurement. Details of the systematic uncertainty will be explained in Sec.~\ref{sec.sys}. \section{Analysis} \label{sec:ana} This section presents the procedural analysis on various factors, such as systematic uncertainty, $QF$, energy distribution, and difference between neutron and gamma rays. Elastic scattering events have been selected based on the criteria of neutron identification in the LS detector and relative timing cuts for the BGO and LS detectors. To evaluate net signal events, contamination of the background events was evaluated from the off-time coincidence sample and compared with the events in the signal time window after normalization. Then, the $QF$ was determined by a ratio of the measured peak energy to the estimation of recoil energy. \subsection{Discrimination of neutron and gamma ray} Neutrons and gamma rays are discriminated by the signal waveforms of the LS detector and are known as pulse shape discrimination (PSD). Figure~\ref{figure.PSDs} shows the relation between ${total}$ and ${slow}/{total}$ for neutron energies of 3 and 14.8~MeV where ${total}$ and ${slow}$ are the integrated charges of the waveform in the nominal time window and shorter time window, respectively. The latter starts 21 ns later. The neutron-like and gamma-like events are distributed in isolation. The boundaries are represented as red lines as shown in Fig.~\ref{figure.PSDs} to discriminate between the two events. \begin{figure}[htbp] \centering \includegraphics[width=\textwidth] {Fig7.eps} \caption{ Relation between $total$ and $slow/total$ for neutron energies of 3.0 and 14.8~MeV. Color at the pixel indicates the count number of events. Red lines are the boundaries to discriminate neutron and gamma-ray events. } \label{figure.PSDs} \end{figure} \subsection{Neutron time of flight} Figure~\ref{figure.time.diff} shows the distributions of the arrival time difference ($dt$) when the LS detector is set at $\theta=90^{\circ}$ and the detectors are irradiated to neutrons with $E_n=3~\rm MeV$. The peak value is obtained at approximately 0 ns due to gamma rays induced by inelastic scattering of neutrons in the BGO crystal. After the PSD cut, the remaining peak is identified at approximately 40~ns. Since the scattered neutrons have $\sim$3.0~MeV of kinetic energy and distance between BGO and LS is 1~m, $\sim$50~ns of additional time than gamma rays is required to reach the LS detector after being scattered in the BGO detector. However, a flat component of $dt$ indicates the existence of accidental coincidence of neutrons in the BGO and LS detectors. \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth] {Fig8.eps} \caption{ Distributions of arrival time difference ($dt$) for $E_n=3~\rm MeV$ and $\theta=90^{\circ}$. Black open and red filled histograms distributions before and after the PSD cut are applied to select neutron-like events, respectively. On-time window is set from $+5$ to $+45$~ns and the off-time window is set from $-200$ to $0$~ns and from $+50$ to $+100$~ns. } \label{figure.time.diff} \end{figure} \subsection{Energy distribution in BGO} Significant improvement in performance was recorded in the $dt$ distributions of the neutron-like events in various configurations. The signal window was set from $+5$ to $+45$~ns (on-time) to include the elastic scattering events. The background events due to the accidental coincidence were evaluated with two time-windows set at both sides of on-time window; that is, one from $-200$ to 0~ns and the other from $+50$ to $+100$~ns (off-time). These time windows are set for $E_n=3.0~\rm MeV$ while in the case of $E_n=14.8~\rm MeV$, the on-time window was set from $-40$ to $+30$~ns, and the off-time window was set at both sides as $-200$ to $-40$~ns and $+30$ to $+100$~ns, respectively. The number of events in the off-time sample was normalized by the ratio of the ranges of on-time to off-time windows for a comparison with the on-time sample. Figure~\ref{figure.BGO.ene.spectrum} shows the energy distributions from on-time and off-time samples observed in the BGO detector. We found a significantly excess value with a peak at approximately $E_{\rm vis}=40~\rm keV_{ee}$, which is due to oxygen recoil. For $E_n=3.0~\rm MeV$ and $\theta=90^{\circ}$, the recoil energy of oxygen nuclei was calculated as $E_R = 334 \pm 17~\rm keV$ where the uncertainty includes the width of the neutron energy and range of the scattering angle due to the finite size of the BGO crystal and LS container. \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth] {Fig9.eps} \caption{\label{fig:ene.distribution} Energy distributions from on-time (black dots) and off-time (blue shade histogram) sample for $E_n=3.0~\rm MeV$ and $\theta=90^{\circ}$ (top panel). Bottom panel is the residual with a Gaussian fit represented by the red dashed line. } \label{figure.BGO.ene.spectrum} \end{figure} \subsection{Quenching factor determination} $QF$ is defined as $QF=E_{\rm vis} / E_R$. The visible energy for the recoil oxygen is given as $E_{\rm vis}=38.5\pm1.3~\rm keV_{ee}$ from the Gaussian fit to the peak. Then, $QF$ was evaluated to be $(11.5\pm0.4)\times10^{-2}$ from the value of $E_R = 334~\rm keV$ for a configuration of $E_n=3.0~\rm MeV$ and $\theta=90^{\circ}$. Further, we have performed another approach to determine the $QF$ more precisely. The measured energy spectra in the on-time sample were fitted by a combination of the simulated energy distribution for oxygen recoil and background distribution in the off-time sample with three free parameters: 1) normalization factor for the simulated energy distribution for oxygen recoil; 2) $QF$ value to change the energy scale of simulation; and 3) normalization factor for the off-time distribution. The minimum $\chi^2$ value, $\chi^2/dof = 25.4/37$, was obtained with $QF = (11.49^{+0.59}_{-0.41})\times10^{-2}$ in the fit for $E_R = 334~\rm keV$. The value of minimum $\chi^2$ is consistent with the best fit value of $QF$. Figure 10 shows the fit results for five configurations that generate different energies for recoil oxygen: a) $E_n=3.0~\rm MeV$, $\theta=58^{\circ}$, and $E_R=163~\rm keV$, b) $E_n=3.0~\rm MeV$, $\theta=90^{\circ}$, and $E_R=334~\rm keV$, c) $E_n=14.8~\rm MeV$, $\theta=60^{\circ}$, and $E_R=899~\rm keV$, d) $E_n=14.8~\rm MeV$, $\theta=75^{\circ}$, and $E_R=1305~\rm keV$, e) $E_n=14.8~\rm MeV$, $\theta=90^{\circ}$, and $E_R=1726~\rm keV$. Quenching factors are determined by analyzing the fit to each distribution. The observed spectra in the on-time sample are in good agreement with the combination of off-time data and simulated spectrum for the recoil oxygen nuclei if the quenching factors are applied. \begin{figure}[htbp] \centering \includegraphics[width=\textwidth] {Fig10.eps} \caption{\label{fig:QF} Fit results for five different configurations. Neutron energy $E_n$ and angle of the LS detector $\theta$ are specified in each plot. Black dots are the on-time data overlaid with the off-time data (blue dashed-line), simulated energy distribution for elastic scattering scaled by the best fit value of $QF$ (green dotted line), and combination of off-time data and simulated spectrum (red solid lines). Simulated spectra and off-time data are normalized with the best fit parameters. } \label{figure.fit.result} \end{figure} \subsection{Systematic uncertainties} \label{sec.sys} In this study, we have considered systematic uncertainties to determine the $QF$ of oxygen recoil energy. The main sources of uncertainties are off-time window selection and energy linearity. For the former source, the variation of $QF$ was evaluated with the off-time window expanded by a factor of $\sim2$ and was computed as 0.87\% in the setup of $\theta=90^{\circ}$ in $E_n=3.0~\rm MeV$. For the latter source, the uncertainty was estimated from the fit error in the calibration (see Fig.~\ref{fig:ene.calib}) as 6.8\% in the same setup. Uncertainties for the other setups of $\theta$ and $E_n$ were estimated using this approach. It was observed that the total systematic uncertainties in the $QF$ measurement were comparable to the statistical uncertainties for all setups. In addition, the uncertainties in the recoil energy ($E_R$) were also accounted. As the main sources, uncertainties due to the detector volume and initial neutron energy width were estimated with simulation. For the setup of $\theta=90^{\circ}$ in $E_n=3.0~\rm MeV$, total uncertainty on $E_R$ was evaluated as $\pm17$~keV for 334~keV. Systematic uncertainties for all setups are summarized in Table~\ref{tab:QF.result}. \section{Results} \label{sec:result} The measured $QF$ values and uncertainties are summarized in Table~\ref{figure.QF.as.function} and also shown in Fig. 11 as a function of nuclear recoil energy ($E_R$). The energy dependence of $QF$, especially the increase at lower energy, was clearly observed. \begin{figure}[htbp] \centering \includegraphics[width=0.8\textwidth] {Fig11.eps} \caption{\label{fig:QF} Quenching factor as a function of oxygen recoil energy. Black dots are the data with the statistical uncertainties (black bar) and systematic uncertainties (red band). } \label{figure.QF.as.function} \end{figure} \begin{table}[htbp] \center \caption{ Summary of quenching factor measurements for oxygen recoil in BGO crystals. The scattering angle $\theta$, initial neutron energy $E_{\rm n}$, and recoil energy $E_{\rm R}$ are listed with the measured values of the visible energy $E_{\rm vis}$ and quenching factor $QF$ for oxygen nuclei. } \begin{tabular}{ccccc} \hline $E_{\rm n}$~(MeV) &$\theta$~(deg.) &$E_{\rm R}$~(keV) & $E_{\rm vis}~(\rm keV_{ee})$ & $QF\times10^2$\\ \hline 3.0 & $58\pm1$ & $163\pm11$ & 25.2$\pm$2.4 & $15.12^{+1.74}_{-1.32}(\rm stat.)\pm1.87(\rm syst.)$ \\ & $90\pm1$ & $334\pm17$ & 38.6$\pm$5.8 & $11.49^{+0.59}_{-0.41}(\rm stat.)\pm0.79(\rm syst.)$ \\ 14.8 & $60\pm1$ & $899\pm46$ & 76.9$\pm$1.1 & $8.60^{+0.10}_{-0.16}(\rm stat.)\pm0.31(\rm syst.)$ \\ & $75\pm1$ & $1305\pm53$ & 96.6$\pm$2.1 & $7.78^{+0.24}_{-0.27}(\rm stat.)\pm0.49(\rm syst.)$\\ & $90\pm1$ & $1726\pm58$ & 116.9$\pm$10.2 & $6.91^{+0.22}_{-0.21}(\rm stat.)\pm0.24(\rm syst.)$\\ \hline \end{tabular} \label{tab:QF.result} \end{table} \section{Conclusion} \label{sec:Conclusion} In this study, we conducted an experiment to measure the $QF$ of recoil energy for oxygen nuclei in BGO scintillators by the irradiation of monochromatic neutrons. The $QF$ measured at different nuclei recoil energies was in the range of 163–1726~keV and the significant energy dependence was confirmed. \acknowledgments This work is supported by the Neutron measurement consortium for Underground Physics and JSPS KAKENHI Grants Grant-in-Aid for Scientific Research (C) No. 20K03998 and Grant-in-Aid for Scientific Research on Innovative Areas 19H05808. We would like to thanks to National Institute of Advanced Industrial Science and Technology (AIST), Japan for providing the well-controlled neutron irradiation.
\section{Introduction} \label{sec:intro} Document binarization is the task of classifying each pixel in a document image into either foreground text or background. As an essential pre-processing step, its result significantly impacts the performance of many document analysis tasks, including optical character recognition (OCR) \cite{Bhunia_2021_CVPR}, document layout analysis \cite{Arroyo_2021_CVPR} and page segmentation \cite{Tran2016}, especially on heavily degraded document images such as the historical document images. These documents usually suffer from multiple degradations, including bleed-through, smear, broken holes, crease, faint ink and uneven strokes. The main challenge of document binarization is to extract fine stroke edges in such degraded document images. The different fonts, writing materials and character sizes in the documents make the extraction more challenging \cite{Kligler_2018_CVPR, Rowley-Brooke_2013_CVPR, yang2023novel}. \begin{figure}[!htbp] \centering \begin{subfigure}{0.49\linewidth} \includegraphics[width=\columnwidth]{img/ori_2017_1} \caption{Original image} \end{subfigure} \begin{subfigure}{0.49\linewidth} \includegraphics[width=\columnwidth]{img/gt_2017_1} \caption{Ground-truth} \end{subfigure} \begin{subfigure}{0.49\linewidth} \includegraphics[width=\columnwidth]{img/jia_2017_1} \caption{Jia \cite{Jia2018}} \end{subfigure} \begin{subfigure}{0.49\linewidth} \includegraphics[width=\columnwidth]{img/suh_2017_1} \caption{Suh \cite{Suh2022}} \end{subfigure} \begin{subfigure}{0.49\linewidth} \includegraphics[width=\columnwidth]{img/our_2017_1} \caption{GDB} \end{subfigure} \begin{subfigure}{0.49\linewidth} \includegraphics[width=\columnwidth]{img/gating_2017_1} \caption{learned gating values} \label{fig:start} \end{subfigure} \caption{The effectiveness of gated convolutions. White pixels are appropriately classified background, whereas black pixels are correctly classified text. Text pixels classified as background are highlighted in \textcolor{red}{red}, whereas background pixels classified as text are highlighted in \textcolor{blue}{blue}. Same for the following Figures. Benefiting from the precise extraction of stroke edge features by the gating mechanism, GDB has sharper and more precise stroke edges. } \label{fig:DIBCO2013_9} \end{figure} Generally, the state-of-the-art methods can be divided into two categories \cite{Suh2022}. The first class of methods \cite{FarrahiMoghaddam2012, Lelore2013, Jia2018} are based on the adaptive threshold. They often utilize edge detection, background estimation, and histogram analysis as the basic steps. The second class of methods \cite{Souibgui2022, Zhao2019, Suh2022} are mainly based on fully convolutional networks. For document binarization, the stroke edge has been exploited as a powerful text indication to calculate the threshold \cite{Lelore2013, Jia2018}. Due to various types of degradation, stroke edges may not be accurately detected. In complex backgrounds, the noise with high gradient variation can easily be detected as stroke edges, whereas the edges of faint ink strokes or uneven pen strokes are often missed. In \cite{Lu2010, Ntirogiannis2014, Jia2018}, the extraction of stroke edges relies on the performance of background estimation, which leads to a large number of errors on low-quality backgrounds, such as the DIBCO'19 dataset \cite{Pratikakis2019}. The existing FCN-based methods \cite{Souibgui2022, Zhao2019, Suh2022, He2021} utilize vanilla convolutions for binarization, where the stroke edges are treated equally with the surrounding features within their receptive fields. This deprives the network of specific attention to stroke edges. Furthermore, all existing deep learning-based methods do not sufficiently supervise the extraction of stroke edges through the boundary-related information of the strokes. Considering these problems, inspired by the characteristics of gated convolutions, we transform the extraction of stroke edges as the learning of gating values. We apply gated convolutions to selectively extract the features of strokes with different attention. Gated convolutions \cite{takikawa2019, Li2020, Wang2021b} have achieved promising performance in semantic segmentation. During the propagation of features, gated convolutions distinguish between valid and invalid information by the learned gating values. Gated convolutions lead to a “boundary-sensitive” network by feeding the priori mask and edge map. As shown in \cref{fig:DIBCO2013_9}, the learned gating values (\cref{fig:start}) focus on the stroke edges, which allows the stroke edge features to be extracted and supervised efficiently during training. The gatings filter out noisy features except the stroke edges. Thus, GDB extracts stroke edges more accurately at the pixel level compared to the state-of-the-art methods \cite{Jia2018, Souibgui2022}. In this paper, we propose an end-to-end gated convolutions-based network (GDB) for document binarization, which is designed with a coarse-to-refine generator and two discriminators. Firstly, we train a coarse sub-network with an extra edge branch to get more precise feature maps by feeding the priori mask and edge. To overcome the limitation of the receptive field, a multi-scale operation combining local and global features is processed in parallel. Secondly, we cascade a refinement sub-network to integrate the benefits of the coarse sub-network outputs at multiple scales by gated convolutions. To demonstrate the effectiveness of our proposed methods, we have conducted comprehensive experiments on ten Document Image Binarization Contest (DIBCO) datasets from 2009 to 2019\cite{Gatos2009, Pratikakis2010, Pratikakis2011, Pratikakis2012, Pratikakis2013, Ntirogiannis2014a, Pratikakis2016, Pratikakis2017, Pratikakis2018, Pratikakis2019} based on four metrics, F-Measure (FM), pseudo-FMeasure (p-FM) \cite{Ntirogiannis2013}, Peak Signal to Noise Ratio (PSNR), and Distance Reciprocal Distortion Metric (DRD) \cite{Lu2004}. Experimental results show that our proposed methods outperform the state-of-the-art methods in terms of all metrics on average and achieve top ranking on six benchmark datasets. In summary, the contributions of our paper are as follows: \begin{itemize} \setlength{\itemsep}{0pt} \setlength{\parsep}{0pt} \setlength{\parskip}{0pt} \item We transform the extraction of text in degraded document images into the learning of gating values in gated convolutions. We demonstrate that learning of gating values can be weakly guided by feeding a priori mask and edge map, which improves the performance of stroke extraction. \item We propose a multi-branch gated convolutional generative adversarial network (GDB) for document binarization. By exploring the gated convolutions, our model generates refined stroke edges by adjusting mask and edge maps. An additional edge branch is proposed to focus on processing the edge information. The proposed method achieves better performance on average over the all (H-) DIBCO datasets compared to the state-of-the-art methods. \item We show that the learned gating values gate the propagation of different stroke features, contirbuting to the fine extraction of stroke edges and the suppression of background noises. \end{itemize} \section{Related work}\label{sec:relate} \subsection{Gated convolutions} Gated convolutions have been widely explored in semantic segmentation \cite{takikawa2019, Li2020, Wang2021b}, image generation \cite{van2016}, image inpainting \cite{Yu2019} and many other tasks \cite{Srivastava2015, dauphin2017, Cao2019}. For example, Takikawa \etal \cite{takikawa2019} propose a novel two-stream architecture with a new type of gate for semantic segmentation that use the higher-level features in the classical stream to gate the lower-level features in the shape stream. In \cite{Li2020}, Gated Full Fusion (GFF) is proposed for semantic segmentation that uses gating to selectively fuse features from different layers to make sufficient use of valid information. In \cite{Wang2021b}, Wang \etal propose a novel module Gated ScaleTransfer Operation (GSTO) that enhances the performance of extracting scale-aware multi-scale features in semantic segmentation. To solve the inability of vanilla convolution to differentiate between valid and invalid pixels, Yu \etal \cite{Yu2019} utilize gated convolutions for image inpainting with a free-form mask. Document binarization aims to use two shades of grey to differentiate between text and background, which resembles the goal of semantic segmentation. In our case, we utilize gated convolutions with noisy mask and edge as input to refine the extraction of stroke edges and to remove various types of noise from the background. \subsection{Document binarization} Generally, document binarization methods can be divided into two types \cite{He2021, Suh2022}: traditional threshold-based algorithms and deep-learning-based methods. \begin{figure*}[!htbp] \centering \includegraphics[width=0.8\linewidth]{img/model} \caption{The architecture of the proposed GDB for document image binarization.} \label{fig:fig_overview} \end{figure*} \textbf{Traditional threshold-based algorithms} Otsu's method \cite{Otsu1979} computes the global threshold on the whole document images, while the local threshold methods, including Niblack \cite{niblack1985introduction} and Sauvola \cite{Sauvola2000}, compute the pixel-wise threshold based on statistical information of a local patch. In \cite{Lu2010}, the local threshold is calculated based on the detected text stroke edges by background estimation. AdOtsu \cite{FarrahiMoghaddam2012} introduces an adaptive form of Otsu's method to differentiate between text and background by the estimated background map. Howe \cite{Howe2013} introduces an automatic technique for tuning the parameters of the binarization algorithms. Jia \etal \cite{Jia2016, Jia2018} utilize the structural symmetric pixels on the background compensation image to compute the local threshold in the neighborhood. These traditional methods require certain empirical parameters, which limits their generalization and performance on low-quality document images. \textbf{Deep-learning-based methods} Full Convolutional Networks (FCNs) have been widely explored in document binarization. Tensmeyer and Martinez \cite{Tensmeyer2017} apply a novel FCN architecture which combines multiple scales for document binarization. DeepOtsu \cite{He2019} iteratively removes background noise and extracts strokes with recurrent refinement and stack refinement. Zhao \etal \cite{Zhao2019} propose a two-stage cascaded conditional generative adversarial network based on Pix2Pix \cite{Isola2018}. He and Schomaker \cite{He2021} propose a cascaded T-shaped network termed CT-Net to learn both document enhancement and binarization tasks. In \cite{KhamekhemJemni2022}, a handwritten text recognizer is integrated with the architecture of cGANs in order to exploit text semantic information. In \cite{Suh2022}, Suh \etal proposes a two-stage colour-independent generative adversarial network based on EfficientNet \cite{tan2019efficientnet} for document image enhancement. \section{Method}\label{sec:proposed} The overall architecture of GDB is shown in \cref{fig:fig_overview}. GDB is designed with a coarse-to-refine generator and two discriminators. The generator contains a multi-branch coarse sub-network $G_{C}$ and a refinement sub-network $G_R$. Firstly, $G_C$ takes as input three images ($I_{p}$, $I_{m}$, $I_{e}$) where $I_{p}$ is the patch cropped from the original image, $I_{m}$ is the noisy mask generated by Otsu's method \cite{Otsu1979} and $I_{e}$ is the edge gradient map generated by Sobel edge detector \cite{sobel19683x3}. The two upsampling branches predict the mask $O_{m}^{C}$ and edge $O_{e}^{C}$, respectively. Additionally, a multi-scale operation that combines local and global features predicts the global mask $O_{gm}^{C}$ in parallel. Secondly, $G_R$ takes as input four images ($I_{grey}$, $O_{m}^{C}$, $O_{e}^{C}, O_{gm}^{C}$), where $I_{grey}$ is the grey scale of $I_{p}$, and then predicts the finer binarization results with sharp edges. The generated masks from the two stages are then fed into their corresponding discriminators and discriminated from the real ones. \subsection{Gated Convolutional Layer} Compared to vanilla convolutions, gated convolutions multiply a weight at different spatial locations of the feature maps in different channels based on the input mask (grey-scale map), which can distinguish foreground pixels from background pixels. This mechanism can dynamically update the mask during the training process and guide the effect of image generation with an extra edge channel (grey-scale map). Gated convolutions can be formulated as, \begin{gather} \alpha_{Gating}^{x,y} =W_{g} \otimes I \notag \\ O_{Features}^{x,y} =W_{f} \otimes I \\ O^{x,y} = \sigma(\alpha_{Gating}^{x,y})\odot \phi(O_{Features}^{x,y}) \notag \end{gather} where $W_{g}$, $W_{f}$ are two different learnable convolution filters, $\sigma$ is the sigmoid activation function, $\phi$ can be any non-linear activation functions, such as ReLU, ELU and LeakyReLU. GDB is a fully gated convolutional network. For degraded document images, their masks and edges can be easily obtained from traditional algorithms. Our goal is to utilize noisy masks and edges to weakly guide the feature extraction of coarse sub-network by gating values. In the second stage, the stroke edges can be finer extracted, and the background noise can be better suppressed by the input of cleaner masks and edges generated from stage one. \begin{figure*}[!htbp] \centering \includegraphics[width=\linewidth]{img/gating_values_.png} \caption{The visualization of learned gating values. (b), (c) and (d) are the learned gating values. The figure does not show the multi-scale operation, the edge branch, the connections between layers and the discriminators for simplicity.} \label{fig:lgv} \end{figure*} Each gating value is between zero and one, representing the degree of attention paid to the pixel values at different spatial locations in the feature map. \cref{fig:lgv} provides a visualization of learned gating values. Each saliency map representing the gating values can emphasize different areas of the feature map where the region of interest has higher gating values. For example, saliency map 7 concerns the text area, while saliency map 8 from the same layer focuses on the bleed-through noise. Ideally, each saliency map consists of only zeros and ones to distinguish between two distinct areas, but there is ambiguity in the learned gating values. For example, the bleed-through noise and the text have relatively high gating values in the saliency map 3. However, provided the background or text gating values are closer to one than the noise, the noise can be effectively suppressed, even if the learned gating values are ambiguous. This is because only features with gating values closer to one are retained when passing through the deep networks. As shown in \cref{fig:lgv}, the bleed-through noise is less significant than the text or the background in each saliency map. Therefore, the deeper the layer from which the learned gating values come, the less noise there is. We convert the learned gated values in the penultimate layer of the network into a grayscale map. As shown in \cref{fig:lgv}, the learned gating values gate different features. Gating (b) focuses on extracting stroke edges, which gates the propagation of stroke edge features. Gating (c) filters out the bleed-through noise by setting its gating values close to 0. Gating (d) can be interpreted as the semantic segmentations of text and background. It is worth noting that the gating values have not been supervised during training except for the priori information in the input (mask and edge). \subsection{Multi-branch coarse sub-network} Our multi-branch coarse sub-network is designed like an encoder-decoder FCN. For encoding, the input ($I_{p}$, $I_{m}$, $I_{e}$) is encoded by four gated convolutional layers and several gated residual blocks modified from residual blocks \cite{He2016}. For decoding, two branches share the same architecture with five up-sampling gated deconvolutional layers. The encoder and decoder are cascaded with four skip connections to improve the connectivity. The outputs $O_{m}^{C}$ and $O_{e}^{C}$ can be seen as an enhanced version of $I_{m}$ and $I_{e}$. Local prediction with small patches has many limitations. When there is a large area of continuous noise in the document image, background pixels are sometimes misclassified as text pixels due to the limitation of the receptive field. It has been demonstrated that combining local and global features can improve the effect of noise suppression \cite{Vo2018, Zhao2019, He2021, Suh2022}. Inspired by this, we resize the full document image to 256 $\times$ 256. The mask $I_{fm}$ and the edge $I_{fe}$ are obtained in the same way through the resized full image $I_{f}$. As shown at the bottom of \cref{fig:fig_overview}, the multi-branch coarse sub-network similarly processes the input ($I_{f}$, $I_{fm}$, $I_{fe}$) in parallel. Next, the predicted mask $O_{fm}^{C}$ is resized to the same size as the original image and then cropped according to the given (x,y) coordinates to get the global mask patch $O_{gm}^{C}$ that includes the global information. \subsection{Refinement sub-network} Owing to the lack of multi-scale fusion and sufficient supervision, the coarse sub-network confronts the issue of the background noise not being eliminated, resulting in the predicted image including the remains of crude strokes or some piece of the noise in the input mask $I_{m}$ and edge $I_{e}$. Thus, we cascade a refinement sub-network to solve this problem. The task of our refinement network is to learn to integrate the benefits of stage 1 outputs at multiple scales. We utilize dilated convolutions to enlarge the receptive fields. The coarse sub-network and the refinement sub-network have similar inputs, except that the former contains an RGB patch while the latter is grey-scale. In both stages, the mask and edge are used as additional information to enhance the binarization performance. The closer the input mask and edge are to the real ones, the more precisely the network can predict the binarization results. As the refinement sub-network takes mask and edge cleaned by the coarse sub-network as input, its encoder can be less affected by noise. As a result, it can eliminate the noise and restore the strokes effectively. \subsection{Discriminator} Two discriminators $D_{C}$ and $D_{R}$ corresponding to the two stages share the same architecture, similar to SN-PatchGAN \cite{Yu2019}. Owing to the training instability of GANs, SN-GAN \cite{Miyato2018} applies the spectral normalization to the training process of GANs, so that the discriminator satisfies the Lipschitz constraint, limiting the drastic changes of its parameters. PatchGAN \cite{Isola2018} only penalizes structure at the scale of patches. SN-PatchGAN combines these two technologies in one. We stack six convolutions to capture the features of Markovian patches \cite{Isola2018}. The discriminator input is the 4-channel concatenation of a degraded document image and the paired binary image. \subsection{Loss functions} Given the original image, the patch $I_{p}$, the mask $I_{m}$ and edge $I_{e}$, the coarse sub-network and the refinement sub-network respectively predict $O_{m}^{C}$, $O_{e}^{C}$, $O_{fm}^{C}$ and $O_{m}^{R}$, where $O_{m}^{R}$ is the final binarization result. The ground truth ($T_{f}$, $T_{f_{r}}$, $T_{m}$, $T_{e}$) where $T_{f}$ is the ground truth of the full binarization map (1 for text and 0 for background), $T_{f_{r}}$ is resized to 256*256 of $T_{f}$, $T_{m}$ is the patch cropped from $T_{f}$ and $T_{e}$ is the result of Sobel edge detection of $T_{m}$. In the multi-scale operation, the mask $O_{\hat{fm}}^{C}$ with the original size is also penalized. We train our GDB on the combination of dice loss, binary cross-entropy loss, $\mathcal{L}_{1}$ loss and adversarial loss. For the simplicity of the formula, the coarse sub-network inputs $I^{C}, I_{f}^{C}$, the outputs $O$ and the ground truth $T$ are set respectively to \{$I_{p}, I_{m}, I_{e}$\}, \{$I_{f}, I_{fm}, I_{fe}$\}, \{$O_{m}^{C}, O_{e}^{C}, O_{\hat{fm}}^{C}, O_{m}^{R}$\} and \{$T_{m}, T{e}, T_{f}, T_{m}$\}. Due to the imbalance of training samples, we utilize dice loss to handle cases where texts only take up a small portion of the patch. We use the binary cross-entropy loss jointly for the training stability. The dice loss and the binary cross-entropy loss are defined as follows: \begin{equation} \mathcal{L}_{dice} = \sum_{i}^{4} \lambda_{i} \bigg [ 1- \frac{2 \sum_{j}^{N} O_{i}^{j} T_{i}^{j}}{\sum_{j}^{N} (O_{i}^{j})^{2}+\sum_{j}^{N} (T_{i}^{j})^{2}} \bigg ] \end{equation} \begin{equation} \begin{aligned} \mathcal{L}_{bce} & = - \frac{1}{N} \sum_{i}^{4} \lambda_{i} \bigg [ \sum_{j}^{N} T_{i}^{j} \log \left(O_{i}^{j}\right) \\ &+ \left(1 - T_{i}^{j}\right) \log \left(1 - O_{i}^{j}\right) \bigg ] \end{aligned} \end{equation} where $N$ is the number of pixels. \{$\lambda_{i}$\} are set respectively to \{1,1,1,2\}. When the patch is pure background, we flip the text and background pixel values to prevent dice loss without passing the gradient back. We further use $\mathcal{L}_{1}$ loss to reduce the generation ambiguity and force the pixel level consistency, which is defined as follows, \begin{equation}\label{loss:L1} \mathcal{L}_{1} = \sum_{i}^{4} \lambda_{i} \| O_{i} - T_{i} \|_{1} \end{equation} For adversarial loss, We utilize the same hinge loss \cite{Yu2019} to penalize Markovian patches, which is defined as follows. \begin{equation}\label{eq:g} \mathcal{L}_{G}(z; \theta_{G})=-\mathbb{E}_{z \sim \mathbb{P}_{z}(z)}\left[D(G(z))\right] \end{equation} \begin{equation}\label{eq:d} \begin{aligned} \mathcal{L}_{D}(z, x; \theta_{D}) &= \mathbb{E}_{x \sim \mathbb{P}_{\text {data }}(x)}[\operatorname{ReLU}(1-D(x))] \\ &+\mathbb{E}_{z \sim \mathbb{P}_{z(z)}}[\operatorname{ReLU}(1+D(G(z)))] \end{aligned} \end{equation} where $G$ is the generator, $D$ is the discriminator, z is the input of $G$ and x is the real image. \begin{align} \label{loss:GC} \mathcal{L}_{G_{C}} &= \mathcal{L}_{G}(I^{C}; \theta_{G_{C}}) + \mathcal{L}_{G}(I_{f}^{C}; \theta_{G_{C}}) \\ \label{loss:GR} \mathcal{L}_{G_{R}} &= \mathcal{L}_{G}((I^{C},I_{f}^{C}); (\theta_{G_{C}}, \theta_{G_{R}})) \\ \mathcal{L}_{D_{C}} & = \mathcal{L}_{D}(I^{C}, T_{m};\theta_{D_{C}}) \notag \\ \label{loss:DC} &+ \mathcal{L}_{D}(I_{f}^{C}, T_{fm};\theta_{D_{C}}) \\ \label{loss:DR} \mathcal{L}_{D_{R}} &= \mathcal{L}_{D}((I^{C},I_{f}^{C}), T_{m};\theta_{D_{R}}) \\ \label{loss:adv} \mathcal{L}_{adv} &= \mathcal{L}_{G_{C}} + 2\mathcal{L}_{G_{R}} \end{align} where $G_{C}$ is the multi-branch coarse sub-network, $G_{R}$ is the refinement sub-network, $D_{C}$ and $D_{R}$ are the corresponding discriminators. The total loss of the generator can be written as, \begin{equation}\label{loss:total} \mathcal{L}_{total} = \lambda_{d}\mathcal{L}_{dice} + \lambda_{b}\mathcal{L}_{bce} + \lambda_{\mathcal{L}_{1}}\mathcal{L}_{1} + \lambda_{a}\mathcal{L}_{adv} \end{equation} where $\lambda_{d}$, $\lambda_{b}$, $\lambda_{\mathcal{L}_{1}}$ and $\lambda_{a}$ are the weights to balance the dice, binary cross-entropy, $L1$ and adversarial loss, which are set to 1, 1, 10 and 0.1, respectively. Different from Zhao \etal \cite{Zhao2019} and Suh \etal \cite{Suh2022}, which require training two generators separately, our training process is end-to-end. \section{Experiment}\label{sec:ex} \subsection{Datasets and evaluation metrics}\label{metrics} We evaluated our proposed method on ten public datasets from the document image binarization competitions: DIBCO'09 \cite{Gatos2009}, H-DIBCO'10 \cite{Pratikakis2010}, DIBCO'11 \cite{Pratikakis2011}, H-DIBCO'12 \cite{Pratikakis2012},DIBCO'13 \cite{Pratikakis2013}, H-DIBCO'14 \cite{Ntirogiannis2014a}, H-DIBCO'16 \cite{Pratikakis2016}, DIBCO'17 \cite{Pratikakis2017}, H-DIBCO'18 \cite{Pratikakis2018}, DIBCO'19 \cite{Pratikakis2019}. The training set also includes document images from the Bickley Diary dataset \cite{Deng2010}, Persian Heritage Image Binarization Dataset (PHIDB) \cite{Nafchi2013}, the Synchromedia Multispectral dataset (S-MS) \cite{Hedjam2015}. Inspired by \cite{Zhao2019, He2021}, all other datasets are utilized for training when evaluating a specific (H-)DIBCO dataset. We adopt four widely used evaluation metrics \cite{Zhao2019,Jia2018,He2021,Suh2022,Pratikakis2019} including: (1) F-Measure (FM); (2) pseudo-FMeasure (p-FM) \cite{Ntirogiannis2013}; (3) Peak Signal to Noise Ratio (PSNR) that measures similarity between two images; (4) Distance Reciprocal Distortion Metric (DRD) \cite{Lu2004} for evaluation of the visual distortion in binary images. We computed these metric scores fairly using the official evaluation tool of the competition. \subsection{Ablation study}\label{sec:input} In this section, we conduct the ablation experiments on all (H-)DIBCO datasets to verify the benefits of different components of GDB: Gated convolution (GC), multi-scale operation (MO), refinement sub-network (RN), edge branch (EB) and input mask and edge (ME). \Cref{table:ablation} shows the average results for the 136 documents in the ten (H-)DIBCO datasets. \Cref{fig:abl} shows several qualitative examples. \begin{table}[!htbp] \centering \renewcommand{\tablename}{Table} \caption{Ablation study and average results on (H-)DIBCO datasets from 2009 to 2019. MO: Multi-scale operation. ME: Input mask and edge. GC: Gated convolution. RN: Refinement sub-network. CN: Coarse sub-network. EB: Edge branch. IO: Iterative operation. The best score is shown in \textbf{bold}.} \label{table:ablation} \resizebox{\columnwidth}{15mm}{ \begin{tabular}{ccccc} \hline Method & FM & p-FM & PSNR & DRD \\ \hline RN w (MO + ME + EB) & 87.73 & 91.86 & 19.23 & 4.25 \\ RN w (GC + MO + EB) & 87.99 & 90.32 & 19.64 & 4.11 \\ CN w (GC + MO + ME + EB) & 89.78 & 91.21 & 19.08 & 4.50 \\ RN w (GC + MO + ME) & 88.96 & 91.18 & 20.10 & 3.47 \\ RN w (GC + ME + EB) & 90.89 & 92.84 & 20.03 & 3.33 \\ RN w (GC + MO + ME + EB) & \textbf{91.16} & \textbf{93.06} & \textbf{20.20} & \textbf{3.24} \\ *RN w (GC + MO + ME + EB + IO) & 91.21 & 93.07 & 20.22 & 3.21 \\ \hline Note: * results do not participate in rankings. \\ \end{tabular}} \end{table} \begin{figure}[!htbp] \centering \begin{subfigure}{0.23\columnwidth} \begin{minipage}[t]{\columnwidth} \centering \includegraphics[width=\columnwidth]{img/abl_ori_2017_1} \includegraphics[width=\columnwidth]{img/abl_ori_2019_3} \end{minipage} \caption{} \end{subfigure} \begin{subfigure}{0.23\columnwidth} \begin{minipage}[t]{\columnwidth} \centering \includegraphics[width=\columnwidth]{img/abl_gt_2017_1} \includegraphics[width=\columnwidth]{img/abl_gt_2019_3} \end{minipage} \caption{} \label{sub:b} \end{subfigure} \begin{subfigure}{0.23\columnwidth} \begin{minipage}[t]{\columnwidth} \centering \includegraphics[width=\columnwidth]{img/abl_normal_2017_1} \includegraphics[width=\columnwidth]{img/abl_normal_2019_3} \end{minipage} \caption{} \label{sub:c} \end{subfigure} \begin{subfigure}{0.23\columnwidth} \begin{minipage}[t]{\columnwidth} \centering \includegraphics[width=\columnwidth]{img/abl_orionly_2017_1} \includegraphics[width=\columnwidth]{img/abl_orionly_2019_3} \end{minipage} \caption{} \label{sub:d} \end{subfigure} \hskip 0.5\columnwidth \begin{subfigure}{0.23\columnwidth} \begin{minipage}[t]{\columnwidth} \centering \includegraphics[width=\columnwidth]{img/abl_corase_2017_1} \includegraphics[width=\columnwidth]{img/abl_corase_2019_3} \end{minipage} \caption{} \label{sub:e} \end{subfigure} \begin{subfigure}{0.23\columnwidth} \begin{minipage}[t]{\columnwidth} \centering \includegraphics[width=\columnwidth]{img/abl_edge_2017_1} \includegraphics[width=\columnwidth]{img/abl_edge_2019_3} \end{minipage} \caption{} \label{sub:edge} \end{subfigure} \begin{subfigure}{0.23\columnwidth} \begin{minipage}[t]{\columnwidth} \centering \includegraphics[width=\columnwidth]{img/abl_local_2017_1} \includegraphics[width=\columnwidth]{img/abl_local_2019_3} \end{minipage} \caption{} \label{sub:f} \end{subfigure} \begin{subfigure}{0.23\columnwidth} \begin{minipage}[t]{\columnwidth} \centering \includegraphics[width=\columnwidth]{img/abl_global_2017_1} \includegraphics[width=\columnwidth]{img/abl_global_2019_3} \end{minipage} \caption{} \label{sub:g} \end{subfigure} \caption{Binarization results of two example images in DIBCO'17 and DIBCO'19. (a) Original image, (b) Ground-truth, (c) RN w (MO + ME + EB), (d) RN w (GC + MO + EB), (e) CN w (GC + MO + ME + EB), (f) RN w (GC + MO + ME), (g) RN w (GC + ME + EB), (h) RN w (GC + MO + ME + EB). MO: Multi-scale operation. ME: Input mask and edge. GC: Gated convolution. EB: Edge branch. RN: Refinement sub-network. CN: Coarse sub-network.} \label{fig:abl} \end{figure} \textbf{Gated convolutions} GDB with GC performs better on all four metrics than without GC. It indicates that replacing the vanilla convolutional layers with the gated convolutional layers can extract text features and suppress the background noise more effectively. GDB without GC (\cref{sub:c}) extracts the edge of the text incompletely, whereas GDB with GC (\cref{sub:g}) extracts the stroke edges more accurately and obtains binarization results of higher quality. \textbf{Multi-scale operation} The performance of GDB can be enhanced by combining the local and global predicted results. In \cref{sub:g}, the bleed-through noise of large independent background areas is effectively suppressed by applying multi-scale feature fusion. The reason is that in a local image patch, pixels are more likely to be classified as text the darker they are compared to their surroundings (\cref{sub:f}), while the pixels of bleed-through noise are easily classified as background rather than text. \textbf{Refinement sub-network} It is beneficial to cascade a refinement sub-network after the coarse sub-network for document binarization according to the results in the third and penultimate rows of \cref{table:ablation}. The refinement sub-network leads in all four metrics more than the coarse sub-network. The refinement sub-network (\cref{sub:g}) provides finer pen strokes and less noise overall than the coarse sub-network (\cref{sub:e}). \textbf{Edge branch} The edge branch can supervise the extraction of stroke edges and avoid incorrect, excessive extraction of stroke edges. GDB with EB classifies stroke edges more accurately at the pixel level. \textbf{Input mask and edge} On the one hand, this operation adds priori information to our model. On the other hand, the mask and edge can effectively guide the gated convolutions to change the gating values. It can be said that the input mask and edge are complementary to gated convolutions. \Cref{fig:abl} shows some qualitative results. We can notice that the input and output of the coarse sub-network have the same pattern, except for the original patch. We utilize the output of our coarse sub-network as input for iterative operation (IO) similarly to \cite{He2019}. As shown in the last two rows of \cref{table:ablation}, GDB achieves better performance in all four metrics after one round of iteration. This indicates that the input mask and edge guide feature extraction by gated convolutions. However, the effect of binarization does not improve after two or more iterative operations because no iterative training is performed. In the next section, we compare GDB(RN) with (GC + ME + EB) and GDB(RN) with (GC + MO + ME + EB) to other state-of-the-art methods, representing the local and global prediction results, respectively. \subsection{Comparison with state-of-the-art methods and best competition system} \begin{table*}[!htbp] \centering \renewcommand{\tablename}{Table} \caption{Evaluation results for different binarization methods over all ten (H-)DIBCO datasets(best values are highlighted in \textcolor{red}{red}, second best are highlighted in \textcolor{blue}{blue}. MO: Multi-scale operation.} \label{table:sota} \resizebox{0.9\textwidth}{78mm}{ \begin{tabular}{ccccccccccc} \hline \multicolumn{2}{c}{Competition} & Otsu \cite{Otsu1979} & Sauvola \cite{Sauvola2000} & \begin{tabular}[c]{@{}c@{}}Best\\ Competition\\ System\end{tabular} & Howe \cite{Howe2013} & Jia\cite{Jia2018} & cGANs \cite{Zhao2019} & Suh \cite{Suh2022} & \begin{tabular}[c]{@{}c@{}} Ours\\w/o MO\end{tabular} & \begin{tabular}[c]{@{}c@{}} Ours\\w MO\end{tabular} \\ \hline \multirow{4}{*}{DIBCO'09} &FM &78.6 &85.37 &91.24 &94.04 &93.17 &\textcolor{blue}{94.1} &93.28 &93.56 &\textcolor{red}{94.79} \\ &p-FM &80.53 &89.08 &- &95.06 &\textcolor{blue}{95.32} &95.26 &94.94 &94.88 &\textcolor{red}{96.36} \\ &PSNR &15.31 &16.37 &18.66 &20.43 &19.44 &20.3 &19.74 &\textcolor{blue}{20.44} &\textcolor{red}{20.68} \\ &DRD &22.57 &7.08 &- &2.1 &2.29 &\textcolor{blue}{1.82} &2.79 &2.48 &\textcolor{red}{1.7} \\ \hline \multirow{4}{*}{H-DIBCO'10} &FM &85.43 &75.18 &91.50 &93.59 &91.75 &94.03 &93.92 &\textcolor{red}{95.45} &\textcolor{blue}{95.19} \\ &p-FM &90.64 &84.08 &- &94.81 &95.36 &95.39 &96.53 &\textcolor{red}{97.43} &\textcolor{blue}{96.62} \\ &PSNR &17.52 &15.94 &19.78 &21.08 &19.84 &21.12 &21.18 &\textcolor{red}{22.31} &\textcolor{blue}{21.98} \\ &DRD &4.05 &7.22 &- &1.72 &2.17 &1.58 &1.50 &\textcolor{red}{1.21} &\textcolor{blue}{1.32} \\ \hline \multirow{4}{*}{DIBCO'11} &FM &82.1 &82.14 &88.74 &90.79 &91.65 &\textcolor{blue}{93.81} &93.44 &\textcolor{red}{94.64} &93.44 \\ &p-FM &85.96 &87.7 &- &92.28 &95.56 &95.7 &\textcolor{blue}{96.18} &\textcolor{red}{96.74} &95.82 \\ &PSNR &15.72 &15.65 &17.97 &19.01 &18.88 &\textcolor{blue}{20.26} &19.97 &\textcolor{red}{20.74} &20.1 \\ &DRD &8.95 &8.5 &5.36 &4.46 &2.66 &\textcolor{blue}{1.81} &1.93 &\textcolor{red}{1.66} &2.25 \\ \hline \multirow{4}{*}{H-DIBCO'12} &FM &75.07 &81.56 &92.85 &93.73 &92.96 &94.96 &94.5 &\textcolor{blue}{95.39} &\textcolor{red}{95.8} \\ &p-FM &78.14 &87.35 &- &94.24 &95.76 &96.15 &\textcolor{red}{97.36} &96.63 &\textcolor{blue}{97.03} \\ &PSNR &15.03 &16.88 &21.80 &21.85 &20.43 &21.91 &21.78 &\textcolor{blue}{22.31} &\textcolor{red}{22.62} \\ &DRD &26.46 &6.46 &2.66 &2.1 &2.3 &\textcolor{blue}{1.55} &1.73 &1.59 &\textcolor{red}{1.32} \\ \hline \multirow{4}{*}{DIBCO'13} &FM &80.04 &82.71 &92.70 &91.34 &93.28 &\textcolor{blue}{95.28} &94.75 &\textcolor{red}{95.86} &95.19 \\ &p-FM &83.43 &87.74 &94.19 &91.79 &96.58 &96.47 &\textcolor{blue}{97.2} &\textcolor{red}{97.22} &96.37 \\ &PSNR &16.63 &17.02 &21.29 &21.29 &20.76 &22.23 &21.79 &\textcolor{red}{22.89} &\textcolor{blue}{22.58} \\ &DRD &10.98 &7.64 &3.10 &3.18 &2.01 &\textcolor{blue}{1.39} &1.66 &\textcolor{red}{1.27} &1.78 \\ \hline \multirow{4}{*}{H-DIBCO'14} &FM &91.62 &84.7 &\textcolor{blue}{96.88} &96.49 &94.89 &96.41 &96.19 &\textcolor{red}{97.58} &96.66 \\ &p-FM &95.69 &87.88 &97.65 &97.38 &\textcolor{blue}{97.68} &97.55 &97.13 &\textcolor{red}{98.27} &97.26 \\ &PSNR &18.72 &17.81 &22.66 &22.24 &20.53 &22.12 &21.77 &\textcolor{red}{23.74} &\textcolor{blue}{23.13} \\ &DRD &2.65 &4.77 &\textcolor{blue}{0.90} &1.08 &1.5 &1.07 &1.14 &\textcolor{red}{0.72} &1.21 \\ \hline \multirow{4}{*}{H-DIBCO'16} &FM &86.59 &84.64 &88.72 &87.47 &90.01 &\textcolor{red}{91.66} &\textcolor{blue}{91.11} &89.94 &90.41 \\ &p-FM &89.92 &88.39 &91.84 &92.28 &93.72 &94.58 &\textcolor{red}{95.22} &94.6 &\textcolor{blue}{94.7} \\ &PSNR &17.79 &17.09 &18.45 &18.05 &19.0 &\textcolor{red}{19.64} &\textcolor{blue}{19.34} &18.9 &19.0 \\ &DRD &5.58 &6.27 &3.86 &5.35 &4.03 &\textcolor{red}{2.82} &\textcolor{blue}{3.25} &3.55 &3.34 \\ \hline \multirow{4}{*}{DIBCO'17} &FM &77.73 &77.11 &91.04 &90.1 &85.66 &90.73 &90.95 &\textcolor{blue}{91.33} &\textcolor{red}{94.32} \\ &p-FM &77.89 &84.1 &92.86 &90.95 &88.3 &92.58 &\textcolor{blue}{94.65} &93.84 &\textcolor{red}{96.58} \\ &PSNR &13.85 &14.25 &18.28 &\textcolor{blue}{18.52} &16.4 &17.83 &18.4 &18.34 &\textcolor{red}{20.04} \\ &DRD &15.54 &8.85 &3.40 &5.12 &7.67 &3.58 &\textcolor{blue}{2.93} &3.24 &\textcolor{red}{1.79} \\ \hline \multirow{4}{*}{H-DIBCO'18} &FM &51.45 &67.81 &88.34 &80.84 &76.05 &87.73 &\textcolor{red}{91.86} &90.78 &\textcolor{blue}{91.09} \\ &p-FM &53.05 &74.08 &90.24 &82.85 &80.36 &90.6 &\textcolor{red}{96.25} &94.25 &\textcolor{blue}{94.57} \\ &PSNR &9.74 &13.78 &19.11 &16.67 &16.9 &18.37 &\textcolor{red}{20.03} &19.68 &\textcolor{blue}{19.92} \\ &DRD &59.07 &17.69 &4.92 &11.96 &8.13 &4.58 &\textcolor{red}{2.6} &3.14 &\textcolor{blue}{3.07} \\ \hline \multirow{4}{*}{DIBCO'19} & FM & 47.83 & 51.73 & 72.88 & 48.20 & 55.87 & 62.33 & 70.64 & \textcolor{red}{73.88} & \textcolor{blue}{73.51} \\ & p-FM & 45.59 & 55.15 & 72.15 & 48.37 & 56.28 & 62.89 & 70.80 & \textcolor{red}{74.96} & \textcolor{blue}{74.81} \\ & PSNR & 9.08 & 13.72 & 14.48 & 11.38 & 11.34 & 12.43 & 14.72 & \textcolor{blue}{14.80} & \textcolor{red}{14.96} \\ & DRD & 109.46 & 13.83 & 16.24 & 36.03 & 43.81 & 17.65 & \textcolor{red}{9.75} & \textcolor{blue}{10.41} & 10.75 \\ \hline \multirow{4}{*}{\begin{tabular}[c]{@{}l@{}}The Mean Values\\ \quad of 136 images\end{tabular}} & FM & 74.22 & 75.98 & 88.59 & 84.68 & 84.92 & 88.64 & 89.92 & \textcolor{blue}{90.89} & \textcolor{red}{91.16} \\ & p-FM & 76.27 & 81.25 & - & 85.84 & 87.73 & 90.18 & 92.40 & \textcolor{blue}{92.84} & \textcolor{red}{93.06} \\ & PSNR & 14.54 & 15.65 & 18.93 & 18.63 & 17.88 & 19.17 & 19.53 & \textcolor{blue}{20.03} & \textcolor{red}{20.20} \\ & DRD & 30.36 & 9.06 & - & 8.80 & 9.69 & 4.53 & \textcolor{blue}{3.29} & 3.33 & \textcolor{red}{3.24} \\ \hline \multirow{4}{*}{\begin{tabular}[c]{@{}l@{}}The Mean Values\\ \quad of 10 DIBCO\end{tabular}} & FM & 75.65 & 77.30 & 89.49 & 86.66 & 86.53 & 90.10 &91.06 & \textcolor{blue}{91.84} & \textcolor{red}{92.04} \\ & p-FM & 78.08 & 82.56 & - &88.00& 89.49 & 91.72 & 93.63 &\textcolor{blue}{93.88} & \textcolor{red}{94.01} \\ & PSNR & 14.94 & 15.85 & 19.25 &19.05 & 18.35 &19.62 & 19.87 & \textcolor{blue}{20.41 }&\textcolor{red}{20.50} \\ & DRD & 26.53 & 8.83 & - &7.31 &7.66 & 3.78 & \textcolor{blue}{2.93} &\textcolor{blue}{2.93} & \textcolor{red}{2.85} \\ \hline \end{tabular}} \end{table*} \begin{figure}[!htbp] \centering \begin{subfigure}{0.3\columnwidth} \begin{minipage}[t]{\columnwidth} \centering \includegraphics[width=\columnwidth]{img/2010_H10_ori} \includegraphics[width=\columnwidth]{img/2011_PR8_ori} \includegraphics[width=\columnwidth]{img/2017_12_ori} \end{minipage} \caption{Original image} \end{subfigure} \begin{subfigure}{0.3\columnwidth} \begin{minipage}[t]{\columnwidth} \centering \includegraphics[width=\columnwidth]{img/2010_H10_gt} \includegraphics[width=\columnwidth]{img/2011_PR8_gt} \includegraphics[width=\columnwidth]{img/2017_12_gt} \end{minipage} \caption{Ground-truth} \end{subfigure} \begin{subfigure}{0.3\columnwidth} \begin{minipage}[t]{\columnwidth} \centering \includegraphics[width=\columnwidth]{img/2010_H10_otsu} \includegraphics[width=\columnwidth]{img/2011_PR8_otsu} \includegraphics[width=\columnwidth]{img/2017_12_otsu} \end{minipage} \caption{Otsu \cite{Otsu1979}} \end{subfigure} \hskip 0.5\columnwidth \begin{subfigure}{0.3\columnwidth} \begin{minipage}[t]{\columnwidth} \centering \includegraphics[width=\columnwidth]{img/2010_H10_sa} \includegraphics[width=\columnwidth]{img/2011_PR8_sa} \includegraphics[width=\columnwidth]{img/2017_12_sa} \end{minipage} \caption{Sauvola \cite{Sauvola2000}} \end{subfigure} \begin{subfigure}{0.3\columnwidth} \begin{minipage}[t]{\columnwidth} \centering \includegraphics[width=\columnwidth]{img/2010_H10_howe} \includegraphics[width=\columnwidth]{img/2011_PR8_howe} \includegraphics[width=\columnwidth]{img/2017_12_howe} \end{minipage} \caption{Howe \cite{Howe2013}} \end{subfigure} \begin{subfigure}{0.3\columnwidth} \begin{minipage}[t]{\columnwidth} \centering \includegraphics[width=\columnwidth]{img/2010_H10_jia} \includegraphics[width=\columnwidth]{img/2011_PR8_jia} \includegraphics[width=\columnwidth]{img/2017_12_jia} \end{minipage} \caption{Jia \cite{Jia2018}} \end{subfigure} \hskip 0.5\columnwidth \begin{subfigure}{0.3\columnwidth} \begin{minipage}[t]{\columnwidth} \centering \includegraphics[width=\columnwidth]{img/2010_H10_suh} \includegraphics[width=\columnwidth]{img/2011_PR8_suh} \includegraphics[width=\columnwidth]{img/2017_12_suh} \end{minipage} \caption{Suh \cite{Suh2022}} \end{subfigure} \begin{subfigure}{0.3\columnwidth} \begin{minipage}[t]{\columnwidth} \centering \includegraphics[width=\columnwidth]{img/2010_H10_ours0} \includegraphics[width=\columnwidth]{img/2011_PR8_ours0} \includegraphics[width=\columnwidth]{img/2017_12_ours0} \end{minipage} \caption{Ours w/o MO} \end{subfigure} \begin{subfigure}{0.3\columnwidth} \begin{minipage}[t]{\columnwidth} \centering \includegraphics[width=\columnwidth]{img/2010_H10_ours1} \includegraphics[width=\columnwidth]{img/2011_PR8_ours1} \includegraphics[width=\columnwidth]{img/2017_12_ours1} \end{minipage} \caption{Ours w MO} \end{subfigure} \caption{Binarization results of three representative document images. From top to bottom, the images are from H-DIBCO'10, DIBCO'11, and DIBCO'17. MO: Multi-scale operation.} \label{fig:DIBCO2010-2011} \end{figure} The proposed methods are evaluated on the ten (H-)DIBCO datasets and compared with traditional binarization methods including Otsu \cite{Otsu1979}, Sauvola \cite{Sauvola2000}, Howe \cite{Howe2013}, Jia \etal \cite{Jia2018}, reproducible deep-learning-based methods including cGANs \cite{Zhao2019}, and Suh \etal \cite{Suh2022} and best score per metric for any submission on each year, named best competition system. For a fair comparison, we use the publicly available source codes provided by the authors. \Cref{table:sota} shows the quantitative evaluation results on the ten (H-)DIBCO datasets. On DIBCO'09, DIBCO'17, and the average of all ten datasets, GDB with MO achieves the best results than other state-of-the-art methods in terms of all four metrics. On H-DIBCO'10, DIBCO'11, DIBCO'13, and H-DIBCO'14, GDB without MO provides the best scores. On DIBCO'19, GDB without MO performs the best in terms of FM and p-FM but ranks second in PSNR and DRD. Each benchmark dataset focuses differently on different noises. The average results demonstrate the robustness of GDB against various noises. The coarse sub-network misclassifies some faint stroke edges as background based on the edge maps, which leads to relatively mediocre performance of GDB on H-DIBCO'16 and H-DIBCO'18. \Cref{fig:DIBCO2010-2011} shows the binarization results of three representative document images containing three common degradations of uneven strokes, faint ink, and bleed-through. From top to bottom, the images are from H-DIBCO'10, DIBCO'11, and DIBCO'17. Due to the uneven intensity of text, the low-intensity text is easily recognized as background in a global field of view. Thus, GDB without MO can retain more text and extract strokes more finely than GDB with MO, especially at the end of the strokes. Howe \cite{Howe2013}, and Suh \etal \cite{Suh2022} also do not sufficiently keep the low-intensity text. Jia \cite{Jia2018} does an excellent job of preserving large areas of low-intensity text but needs to delineate the stroke edges sharply. Suh \etal \cite{Suh2022} can effectively remove the text-like background noise but still keeps a small amount of high-intensity bleed-through noise. GDB with MO shows the best performance in eliminating bleed-through noise. \Cref{fig:DIBCO2019} shows the binarization results on DIBCO’19. DIBCO'19 is a chanllenging dataset in which handwritten papyri images suffer from severe degradations, including broken holes, misplaced fibres, noisy margins, uneven distribution and text smudges. The traditional methods \cite{Otsu1979, Sauvola2000, Howe2013, Jia2018} do not effectively remove alien lines from the background and do not accurately extract the strokes from the document. The cGANs \cite{Zhao2019} removes the bleed-through noise better than the traditional methods but still suffers from the loss of text and the inclusion of alien lines. GDB provides relatively clean binarization results, where large areas of bleed-through noise in the background is effectively suppressed. For the papyri images, the performances of traditional methods are unacceptable. A large number of pixels are misclassified. Deep learning methods cannot binarize the papyri images well because the papyri images only appear in DIBCO'19. (the top two submissions in DIBCO'19 are traditional methods). Text is efficiently classified by cGANs \cite{Zhao2019}, but the torn margin of the papyri and the edge of the broken holes are also preserved. Compared to cGANs \cite{Zhao2019}, the GDB suppresses edge noise better. \begin{figure} \centering \begin{subfigure}{0.3\columnwidth} \includegraphics[width=\columnwidth]{img/2019_9_ori} \includegraphics[width=\columnwidth]{img/2019_13_ori} \caption{Original image} \end{subfigure} \begin{subfigure}{0.3\columnwidth} \includegraphics[width=\columnwidth]{img/2019_9_gt} \includegraphics[width=\columnwidth]{img/2019_13_gt} \caption{Ground-truth} \end{subfigure} \begin{subfigure}{0.3\columnwidth} \includegraphics[width=\columnwidth]{img/2019_9_otsu} \includegraphics[width=\columnwidth]{img/2019_13_otsu} \caption{Otsu \cite{Otsu1979}} \end{subfigure} \hskip 0.5\columnwidth \begin{subfigure}{0.3\columnwidth} \includegraphics[width=\columnwidth]{img/2019_9_sa} \includegraphics[width=\columnwidth]{img/2019_13_sa} \caption{Sauvola \cite{Sauvola2000}} \end{subfigure} \begin{subfigure}{0.3\columnwidth} \includegraphics[width=\columnwidth]{img/2019_9_howe} \includegraphics[width=\columnwidth]{img/2019_13_howe} \caption{Howe \cite{Howe2013}} \end{subfigure} \begin{subfigure}{0.3\columnwidth} \label{fig:2019_9_f} \includegraphics[width=\columnwidth]{img/2019_9_jia} \includegraphics[width=\columnwidth]{img/2019_13_jia} \caption{Jia \cite{Jia2018}} \end{subfigure} \hskip 0.5\columnwidth \begin{subfigure}{0.3\columnwidth} \includegraphics[width=\columnwidth]{img/2019_9_cgan} \includegraphics[width=\columnwidth]{img/2019_13_cgan} \caption{cGANs \cite{Zhao2019}} \end{subfigure} \begin{subfigure}{0.3\columnwidth} \includegraphics[width=\columnwidth]{img/2019_9_ours0} \includegraphics[width=\columnwidth]{img/2019_13_ours0} \caption{Ours w/o MO} \end{subfigure} \begin{subfigure}{0.3\columnwidth} \includegraphics[width=\columnwidth]{img/2019_9_ours1} \includegraphics[width=\columnwidth]{img/2019_13_ours1} \caption{Ours w MO} \end{subfigure} \caption{Binarization results on DIBCO'19. MO: Multi-scale operation.} \label{fig:DIBCO2019} \end{figure} \section{Conclusions}\label{sec:con} In this paper, we propose a document binarization method termed GDB. Our proposed method focuses on the extraction of sharp stoke edges. By applying gated convolutions, We transform text extraction into the learning of gating values. We demonstrate that the learning process of gating values can be weakly guided by feeding a priori mask and edge map. We show that the learned gating values have different regions of interest, which can gate the propagation of stroke edge features and effectively suppress noisy features. We add an edge branch to supervise the extraction of stroke edges. We evaluated the GDB over ten (H-)DIBCO benchmark datasets. The experimental results show that the GDB achieves state-of-art performance benefitting from the different components of GDB. {\small \bibliographystyle{ieee_fullname}
\section{Introduction} \label{sec_intro} This work presents a new change detection system for Performance Measurement (PM) data. The PM system collects thousands of metrics from each cell, quantifying different aspects of the cell's performance, including voice quality indicators, throughput, latency, radio signal strength, interference, etc. The volume of this data is so large that it is not currently feasible for network operators to monitor all of it. As a result, it often happens that when they make changes to the network configuration, they create a negative impact on some subsystems without realizing it. Alternately, the configuration change may actually have some positive impact that the operators are not aware of, leading them to erroneously roll back the configuration change. Our goal is to develop a system which will monitor PM data and detect all impacts of configuration changes on the system. In this work, we address this task by adapting a modern self-supervised representation learning method \cite{dino}, originally developed to deal with large, unlabelled image datasets, to the problem of detecting impacts of configuration changes on PM data. We focus on change, as opposed to anomaly detection. The difference is that change detection focuses on stable changes in operating characteristics, while anomaly detection usually strives to detect outliers, or individual highly unusual data points. This distinction is of great importance to network operators, as transient unusual behaviors are, by definition, self-correcting and therefore do not require any corrective action on the operator's part. On the other hand, when a stable change is detected, it means the cell has begun to operate in a new way, and corrective action may be required. In order to meet the practical application requirements, the monitoring solution should be: \begin{itemize} \item Scalable: In order to obtain complete monitoring coverage over all of the subsystems reported on by PM data, it is critical to detect changes in a large number of metrics. Therefore, the computational complexity of the change detector should scale linearly with the number of metrics. \item Generalizable: RANs usually include hardware from multiple vendors, which also experiences constant software upgrades that modifies the list of recorded PM metrics. The solution should be able to adapt to these changes with minimal expert intervention. \end{itemize} To address these requirements, we monitor individual metrics, as opposed to looking at pair correlations of metrics, which experience polynomial computing resource demand growth \cite{cellpad}. This way we can monitor all (usually thousands of) metrics that are being recorded at cell level, which enables deeper insight into the diagnostics of the problem related to the detected change. We also point out that when previously co-evolving metrics experience decorrelation, at least one of them experiences a change and thus we expect our method to detect it. Regarding generalizability requirements, previous approaches (see Section \ref{sec_ad_related_work}) operate over a small set of expert selected metrics, which can vary across vendors and software updates. Our solution looks at {\it all} the recorded PM metrics and thus is resilient to such modifications and does not require expert intervention. Due to a lack of publicly available datasets for this task, we developed our own. This dataset is based on a proprietary, system-level RAN simulator originally developed and validated to study network parameter optimization \cite{slsstart,slsend}. To summarize, the main contributions of this paper are as follows: \begin{itemize} \item We bring attention to the problem of monitoring the network for behavior changes associated with frequent (order of a week) heterogeneous system parameter changes at cell level. \item We suggest a scalable and generalizable self-supervised learning framework that leverages self-attention and self-distillation for metric-level change detection. \item To evaluate performance on this task, we develop a dataset grounded in real RAN historical observations. \item We show superior detection capabilities of our method compared to the current state of the art across non-ML and ML approaches. \end{itemize} The rest of the paper is organized as follows: in Section \ref{related_work} we describe previous work related to detecting changes in cellular network metrics. In Section \ref{sec_cpds} we describe in detail the three change point detectors compared in this paper, including our own proposed method. In Section \ref{sec_dataset} we describe the process used for generating the dataset. In Section \ref{sec_comparison} we present a comparison of the performance of the methods introduced in Section \ref{sec_cpds} on the dataset from Section \ref{sec_dataset}. In Section \ref{sec_conclusion} we summarize the work and provide concluding remarks. \section{Related Work} \label{related_work} In this section, we first discuss work on anomaly detection in cellular networks, then review advances in existing approaches for change detection. \subsection{Anomaly Detection in Cellular Networks} \label{sec_ad_related_work} Approaches for anomaly detection in cellular networks vary widely in scope, ranging from detecting anomalies observable in individual KPIs \cite{barreto20053G, qin2018sqoe}, to the multivariate case using multiple KPIs \cite{ciocarlie2013}, or detecting network-level anomalies, taking into account the interconnected structure of the network \cite{chaparro2015detecting, yang2022dynamic}. In this paper we focus on the first one. Anomalies at the KPI level manifest themselves as irregularities in the signal. They can be of short (pointwise) or long lasting (e.g., pattern change in signal's periodicity or amplitude) nature \cite{lai2021revisiting}. Often the causes of these types of behavior are different, which motivates the introduction of a special taxonomy (``change detection''), especially as the latter can be more harmful to the network as it indicates significant shift. The work we found on anomaly detection in cellular networks does not explicitly make such a distinction. We improve on it and also extend to RAN applications the advances of the Change Point Detection field of research, which we briefly review in the next sub-section. Approaches for anomaly detection applied to cellular networks span across a wide range: clustering algorithms, such as Self-Organizing Maps \cite{barreto20053G}; ensembling of classification and regression based methods, such as SVM and ARIMA \cite{ciocarlie2013}; correlation and functional analysis \cite{munoz2016}; thresholding and range-based rules \cite{qin2018sqoe}; generative adversarial networks \cite{ad-gan-lstm}; and convolutional (CNNs) and recurrent neural networks, such as LSTMs \cite{rnncnn, ad-lstm}. \cite{ad-cell-survey} presents a more in depth survey of the existing work in anomaly detection for cellular networks. To the best of our knowledge, our approach is the first to make use of the transformer self-attention architecture \cite{transformer} for cellular network anomaly detection. Most of the work on anomaly detection in RANs uses supervised learning. This requires tedious manual labeling of the datasets and also specifying the types of anomaly classes \cite{cellpad, rnncnn}. Some attempts to address the labeling challenge by using semi-supervised learning can be found in \cite{ad-semi-supervised-matlab}. To the best of our knowledge, we are the first to address both challenges by using self-supervised learning \cite{ssl-vision}, which requires no labels and no prior knowledge on the possible types of anomalies present in the data. \subsection{Change Detection} There is a large body of work on the theoretical and practical aspects of change detection. The problem of changepoint detection as the segmentation of the timeseries into segments delimited by the changepoints, thus finding the in-between regions of the changes rather than the points of change themselves, by using the Matrix Profile of the timeseries to detect pattern consistency is formulated in FLUSS and its variant FLOSS \cite{gharghabi2017matrix}. Probabilistic approaches such as BOCPD \cite{bocpd} formulate the problem as estimating a probability distribution over the amount of time since the last changepoint, known as the ``run length". Non-parametric methods such as \cite{matteson2014nonparametric} are based on statistical two-sample testing, samples are deemed anomalous if the test statistic exceeds a specific threshold. KL-CPD \cite{chang2019kernel} extends the kernel changepoint detection non-parametric approach introduced in \cite{harchaoui2008kernel} to allow for deep kernels learnt from data. A common underlying paradigm in many learning and non-learning based approaches slides consecutive non-overlapping half-windows over the timeseries and quantifies the mismatch between the left half-window and the right half-window, as they should most differ when the point between the two half-windows is a changepoint. This paradigm is particularly common among unsupervised deep learning approaches, e.g. \cite{betsi}. One of the most recent instantiations of this approach is TIRE \cite{de2021change}, which we use as a ML baseline, see Section \ref{subsection_TIRE}. In a recent survey and benchmarking of changepoint detection methods \cite{nonmlcpdsreview}, the authors observe that: first, there is no single Change Point Detector (CPD), which performs best on all datasets, which highlights domain specifics; second, such classical non-ML CPD as Binseg \cite{binseg} performs consistently better across a wide range of datasets compared even to some ML methods, which is the reason we choose as a non-ML baseline, see Section \ref{subsection_binseg}. \section{Change detectors} \label{sec_cpds} In this section we introduce in more details the non-ML (Binseg) and ML (TIRE) baselines, as well as our method (TREX-DINO). \subsection{Binseg} \label{subsection_binseg} Binseg \cite{binseg} is a sequential algorithm, which consecutively splits timeseries into two windows and calculates the gain obtained from the introduction of this separation by evaluating the difference of the cost function calculated on the original window and the two derived ones. This allows to associate specific gain with every (potential change) point of the timeseries. We later use these values as a threshold of the Binseg CPD algorithm in the binary classification problem, see Section \ref{sec_comparison} for more details. \subsection{TIRE} \label{subsection_TIRE} TIRE \cite{de2021change} uses a pair of autoencoders, one in the time domain and one in the frequency domain over consecutive windows of the timeseries to detect changepoints. In order to do so, TIRE learns representations that combine a reconstruction objective and a time-invariant, similarity minimization objective between successive windows. Once the representations are learned, they are used in a window based CPD. Specifically, two sliding windows (backward and forward looking) are used to decide whether the point in the middle is a change point. The similarity measure between data in the sliding windows is computed by applying the cosine distance between their respective projections into the representation space: \begin{equation} d(x, y) = 1 - \frac{\sum_{k=1}^{K}{g(x)^{(k)} g(y)^{(k)}}} {\sqrt{\sum_{k=1}^{K}{{g(x)^{(k)}}^{2}}} \sqrt{\sum_{k=1}^{K}{{g(y)^{(k)}}^{2}}}}, \label{eq:distance} \end{equation} where $x$ and $y$ are datapoints in the corresponding windows; $g$ is the learned representation, and $K$ is the dimensionality of the representation space. Application of this sliding window procedure yields a new timeseries, $d$. In order to extract change points, $d$ is first filtered, then a peak finding procedure is applied to the result. \subsection{TREX-DINO} We propose to learn representations from large, unlabelled datasets using self supervision and transformers, a learning paradigm which has recently enabled impressive performance in natural language processing \cite{bert} and computer vision \cite{vit}. Our method, dubbed TREX-DINO (Timeseries REpresentation eXtraction using DIstillation with NO labels), is an extension of DINO \cite{dino}, a method originally proposed for self-supervised representation learning on images. At a high level, the self-supervised learning objective encourages the model to project multiple random augmentations of the same timeseries into similar representations, while augmentations of different timeseries are encouraged to have different representations. This is achieved using a knowledge distillation \cite{distillation} style student-teacher learning modality. However, instead of having a fixed teacher, we periodically update the teacher weights using an exponential moving average of the student weights. This effectively implements a form of model ensembling in the teacher, akin to Polyak-Ruppert averaging ~\cite{polyak1992acceleration, ruppert1988efficient}. The student network is trained to match the teacher's distribution over the dimensions of the learned representation using a cross entropy loss. Given a network $g$, input timeseries $x$, the size of the representation $K$, and a temperature parameter $\tau$ which controls the sharpness of the distribution, the probability $P$ over the dimensions of the representation is given by: \begin{equation} P(x)^{(i)} = \frac{exp(g(x)^{(i)} / \tau)}{\sum_{k=1}^{K} exp(g(x)^{(k)}/\tau)}. \end{equation} In the standard knowledge distillation setup, the optimization objective would be given by \begin{equation} \min_{\theta_s} H(P_t(x), P_s(x)), \end{equation} where $\theta_s$ are the parameters of the student network and $H$ is the cross-entropy loss. However, in order to adapt this to the self-supervised setting, DINO first defines the set $V$, which consists of different augmentations of the same timeseries. Critically, two of the items in $V$, $x_1^g$ and $x_2^g$, are so called ``global'' views. These are large crops of the original timeseries, which include most of it. The rest of the augmentations of $x$ in $V$ feature ``local'' crops, which remove a larger fraction of the original timeseries. This style of augmentation is known in the computer vision literature as ``multi-crop" \cite{multi-crop}. The teacher is then used to compute representations for the global views only, while the student computes representations for all of them. In other words, we aim to optimize the following optimization objective: \begin{equation} \min_{\theta_s} \sum_{x \in \{x_1^g, x_2^g\}} \sum_{x' \in V, x` \neq x} H(P_t(x), P_s(x')). \end{equation} The weights of the teacher, $\theta_t$, are updated from those of the student using the following update rule ($\lambda$ is a hyperparameter): \begin{equation} \theta_t = \lambda\theta_t + (1-\lambda)\theta_s. \end{equation} Collapse (i.e. the network learning to embed all of the timeseries into exactly the same representation) is avoided by centering the outputs of the teacher network, $g_t(x) = g_t(x) + c$, where the center, $c$, is dynamically adjusted as follows ($m$ is a hyperparameter, $B$ is the batch size): \begin{equation} c = mc + (1-m) \frac{1}{B} \sum_{i=1}^{B}g_t(x_i). \end{equation} See \cite{dino} for a more complete treatment of the approach. DINO was originally targeted at images and implemented using a vision transformer (ViT) \cite{vit}. In order to adapt this method to the timeseries case, some modifications were needed. First, we adapted the ViT to accept timeseries as input. The ViT architecture splits images into patches, each of which are passed through a convolutional layer and flattened to create a series of tokens which are used as input to the transformer. TREX-DINO adapts these from 2-dimensional convolutions, appropriate for images, to 1-dimensional ones better suited to timeseries. We keep the channel dimension, so TREX-DINO supports multi-dimensional timeseries, although in this paper we focus on the single dimensional case. Furthermore, DINO augmentations include color jittering, Gaussian blur, and solarization, as well as multi-crop. TREX-DINO keeps the Gaussian blur and multi-crop, but replaces color jittering and solarization with additive Gaussian noise. Once the representations are learned, they are used to detect changes using the sliding window method as outlined in Section \ref{subsection_TIRE}. \section{Dataset} \label{sec_dataset} One can observe variance in CPDs performance on timeseries of various origin \cite{nonmlcpdsreview}, which is due to data peculiarities pertinent to each domain (e.g., seasonality, recording periodicity and length, change type and their occurrence frequency). This is the main reason that domain specific task data is of primary importance for evaluating the performance of proposed methods. In this paper we used a proprietary System Level Simulator (SLS) \cite{slsstart,slsend}, which was specifically developed for studying effects of system parameter changes on cellular network performance, and is based on real-world RAN data. It models traffic in RANs for specific site configuration architectures. We utilize the one schematically depicted in Fig. \ref{fig_hex7}. \begin{figure}[htbp] \begin{center} \includegraphics[width=0.7\columnwidth]{assets/hex7_UEs.png} \end{center} \caption{A schematic illustration of an SLS environment that consists of 7 sites, which are serving a number of active and idle User Equipments (UEs).} \label{fig_hex7} \end{figure} Every site operates over 4 frequency bands in each of 3 non-overlapping sectors. UEs are initially uniformly distributed across all sites and randomly walk with constant velocity, or stay in one place. They contribute to the traffic load of the network by downloading files in a stochastic manner. This process is modelled to reproduce historically observed RAN data scenarios, with UE behavior parameters varying accordingly throughout the day \cite{slsstart,slsend}. Cells transmitting data to UEs also have realistic system parameters preset, but these do not automatically vary with time. The main focus of this paper is to detect changes in network operations by monitoring PM data. Each of the cells records 28 various timeseries. They include Key Performance Indicators (KPIs) closely monitored by network operators, e.g. down-link throughput, as well as metrics commonly used in literature for modeling of RAN performance, e.g. physical resource block usage and number of active UEs. All aforementioned timeseries are hand picked by experts and are often transformed using domain knowledge, e.g. throughput is a ratio of the radio link data and delay. As discussed in Section \ref{sec_intro}, we seek a generalizable approach to RAN monitoring, and thus we also include in our analysis an extensive list of low level subsystem metrics, e.g. the number of successful handovers, treating them all on par. In addition to the aforementioned variability coming from historical RAN data UE parameters, our dataset includes two additional degrees of freedom. First, infrequent system parameter changes. Those affect SLS parameters describing cell subsystems. This is done to model RAN performance improvement/degradation due to endogenous, e.g. Configuration Management (CM) changes, and exogenous, e.g. hardware failures, causes that represent interest to the network operators. Second, pseudo-random changes. These affect UE dynamics and are useful for verifying stability of the network operations and enriching the dataset with realistic variance. The main difference between our dataset and previous applications of SLS are as follows: \begin{itemize} \item We are not interested in the dynamics of individual UEs it can provide, because for privacy and technical reasons it is easier to get access to aggregated over UEs PM data to base our change detection on. \item For accurately modeling diverse traffic scenarios, SLS uses multiple historical network observations from field deployments, which have finite (maximum week-long) recording length. ML and especially deep learning methods that we propose to use (transformers) extract features without human engineering effort. In order to do it efficiently they need to have access to a large corpus of data, e.g. to have enough historical information to detect lasting operating modes and changes between them. For that reason, we produce samples of our dataset by concatenating week-long outputs of SLS data. \end{itemize} Here is the detailed procedure that we use to construct a sample of the dataset. We run week-long SLS simulations for the network described in Fig. \ref{fig_hex7} with combinations of 5 different system parameter sets and 10 various seeds. We then choose a pair of distinct system parameter changes, $\kappa$, and seeds, $\rho$, to concatenate week-long timeseries, $\tilde x$, into four week-long samples, $\hat x$: \begin{equation} \hat x^m_{t}(\rho_{r_1}, \kappa_{k_1}) = \begin{cases} \tilde x^m_{t}(\rho_{r_1}, \kappa_{k_1})& \text{if} \, t \in [0, 168),\\ \tilde x^m_{t-168}(\rho_{r_2}, \kappa_{k_1})& \text{if} \, t \in [168, 336),\\ \tilde x^m_{t-336}(\rho_{r_1}, \kappa_{k_2})& \text{if} \, t \in [336, 504),\\ \tilde x^m_{t-504}(\rho_{r_2}, \kappa_{k_2})& \text{if} \, t \in [504, 672), \end{cases}\, \end{equation} where $\tilde x^m_t(\rho_r, \kappa_k)$ represents time $t$ (in hours) metric $m$ recording of the week-long simulation ran with seed $r$ and system parameters set $k$, and subscripts indicate whether subscribed variables have equal values. Finally, we preprocess the constructed timeseries, $\hat x$, to smooth the data and make it suitable for use in neural networks by the standard procedure of using logarithmic transformation, removing the mean, and scaling to unit variance \cite{scikit-learn, paszke2017automatic}, to obtain our dataset, $x$. One can see examples of the resulting timeseries, $x$, in Fig. \ref{fig_timeseries}. \begin{figure}[htbp] \begin{center} \includegraphics[width=0.8\columnwidth]{assets/run_id_1_discrete.png} \includegraphics[width=0.8\columnwidth]{assets/run_id_1_continuous.png} \end{center} \caption{Examples of discrete (top) and continuous (bottom) timeseries data created using SLS. The color coding indicates distinct system parameters sets.} \label{fig_timeseries} \end{figure} Timeseries pattern changes like the ones in Fig. \ref{fig_timeseries} have no ``drop'' \cite{cellpad}, but clearly indicate a shift in operating characteristics caused by a modification of a system parameter that network operators are interested in learning about. We include them to highlight new types of domain specific anomalies that are of particular relevance in telecom. To create a test set of labels to evaluate CPDs' performance and understanding that system parameters switch might not affect every metric, we manually verified timeseries by leveraging the knowledge of the dataset construction (location of the change point and week-long nature of the subsegments), by clustering samples using week-over-week statistics, and keeping for validation samples only from those clusters that clearly had a present or absent mode of operations change, which resulted in 78455 samples without pattern changes and 14301 samples with it. \section{Performance Evaluation} \label{sec_comparison} In this section, we evaluate performance of CPDs described in Section \ref{sec_cpds} using the dataset presented in Section \ref{sec_dataset}. In order to simplify the comparison, we evaluate performance on a binary classification task where competing algorithms must identify whether a changepoint is present in the timeseries. We use the Binseg implementation by Truong et al. from \cite{ruptures} with RBF cost function \cite{rbf-cost}. TIRE and TREX-DINO were both trained on a randomly selected half of the dataset and tested all together with Binseg on the other half. Hyperparameters' values used for training TIRE and TREX-DINO were based on \cite{de2021change,dino}. Specifically, for TIRE, we used 3 parallel autoencoders in both timeseries and frequency domains; for the DINO subpart of TREX-DINO, we used 12 self-attention heads with embedding dimensions size of 768, Gaussian noise with standard deviation of 0.3, and Gaussian blur with kernel standard deviation uniformly distributed in the \mbox{[0.1, 2.]} range and applied on average in half of the augmentation calls. The only parameter that we set manually based on the domain specifics was the half window size of 168 (equals $24\times7$). In effect, this biases the system to perform week over week comparisons, which is a common practice among telecommunications operators in their assessments. Another important hyperparameter present in all compared models is the detection threshold: timeseries with predicted value above it are considered to have a change point. Instead of using the validation set to tune it for every method, we chose to compare methods numerically at their top performance and visually over the entire range of the values: this provides more robustness due to the narrow peak shape of some of the performance curves. Due to the different nature of the algorithms and thus resulting threshold values, we plot curves after uniform normalization to the $[0, 1]$ range. \begin{figure}[htbp] \begin{center} \includegraphics[width=0.9\columnwidth]{assets/f1.png} \end{center} \caption{Differential comparison of CPDs' performance as a function of normalized detection threshold.} \label{fig_f1} \end{figure} The F1 curves for the three methods are shown in Figure \ref{fig_f1}. The maximum F1 scores and the area under precision-recall curve (PR AUC) attained by each method are shown in Table \ref{tab_f1}. In addition to achieving the highest max F1 score of the three, TREX-DINO also attains a high F1 score over a much wider range of normalized threshold values, indicating that it is less sensitive to the choice of the threshold. This is also reflected in its superior PR AUC score. \begin{table}[htbp] \caption{Aggregate comparison of CPDs using F1 max and PR AUC.} \begin{center} \begin{tabular}{|c|c|c|c|} \hline \textbf{Metric}&\textbf{Binseg}&\textbf{TIRE}&\textbf{TREX-DINO (ours)}\\ \hline \textbf{F1 score} & 0.80 & 0.87 {(+9\%)} & {\bf 0.90 {(+13\%)}}\\ \hline \textbf{PR AUC} & 0.82 & 0.91 {(+11\%)} & {\bf 0.97 {(+18\%)}}\\ \hline \textbf{Rank}& Baseline & Better & Best\\ \hline \end{tabular} \label{tab_f1} \end{center} \end{table} \section{Conclusion} \label{sec_conclusion} In this paper, we discussed the importance of monitoring RANs for frequent change detection and proposed a novel change point detector to address this problem. In the face of the lack of public benchmarks devoted to this task, we developed a dataset that reproduces the challenges that plague RAN operators on a daily basis. Experiments demonstrated the superior performance of our approach compared to existing methods. We are confident that our framework, proven in the fields of computer vision and natural language processing and based on a self-supervised transformer architecture with self-distillation, will continue to show good performance characteristics in real world RAN applications. In order to present changes detected at metric level over hundreds of thousands of RAN devices to human network operators for actionable outcomes, one needs to aggregate them into meaningful events that share the same root cause. We leave results of our research effort applied in this direction for future publication. However, the foundation of any such aggregation scheme must necessarily be accurate change detection at the metric level, which is the problem that is best addressed by our method, TREX-DINO. \section*{Acknowledgment} The authors thank Ekram Hossain, Perouz Taslakian, Amal Feriani, and Bassem Maraach for useful discussions. \bibliographystyle{IEEEtran} \maxpage[Pre-bibliography document length limit exceeded]{6}
\part{Appendix} \parttoc \section{Theoretical results} \subsection{The Wasserstein distance between Gaussian distribution } \begin{theorem}[The Wasserstein distance between Gaussian distribution ] \label{theorem:Wasserstein-Gaussian} Given two Gaussian measures, $P^0 = N(\mu_0, \Sigma_0)$ and $P^1 = N(\mu_1, \Sigma_1)$. The $L^2$-Wasserstein distance between them is given by \begin{equation}\small \begin{aligned} W^2_2(P^0, P^1) = & \|\mu_0 - \mu_1 \|^2 + tr(\Sigma_0) + tr(\Sigma_1) \\ &- 2 tr (\sqrt{\Sigma_0^{1/2} \Sigma_1 \Sigma_0^{1/2}}) \end{aligned} \end{equation} \label{theorem:w_gaussian} \end{theorem} The proof largely depends on a summary of \cite{givens1984class_Gaussian_W_dist}, as well as. We recall the theorem. Given two Gaussian measures, $P^0 = N(\mu_0, \Sigma_0)$ and $P^1 = N(\mu_1, \Sigma_1)$. The $L^2$-Wasserstein distance between them is given by \begin{equation} \begin{aligned} W^2_2(P^0, P^1) = & \|\mu_0 - \mu_1 \|^2 + tr(\Sigma_0) + tr(\Sigma_1) - 2 tr (\sqrt{\Sigma_0^{1/2} \Sigma_1 \Sigma_0^{1/2}}) \end{aligned} \end{equation} Given two distributions $P^0 = N(\mu_0, \Sigma_0)$ and $P^1 = N(\mu_1, \Sigma_1)$, one can first reduce to the centered case $\mu_0 = \mu_1 = 0$. Next, let $X \sim P^0$ and $Y \sim P^1$ and if $(X, Y)$ is a random vector of $\mathbb{R}^n \times \mathbb{R}^n$ with covariance matrix \begin{equation*} \Gamma = \begin{bmatrix} \Sigma_0 & C \\ C^\top & \Sigma_1 \end{bmatrix} \end{equation*} then the quantity \begin{equation*} \mathbb{E}[ \| X - Y \|^2_2] = Tr (\Sigma_0 + \Sigma_1 - 2 C) \end{equation*} depends only on $\Gamma$. Also, when $P^0 = N(0, \Sigma_0)$ and $P^1 = N(0, \Sigma_1)$, one can restrict the infimum which defines $W_2$ to run over $W_2$ to run over Gaussian laws $N(0, \Gamma)$ on $\mathbb{R}^n \times \mathbb{R}^n$ with covariance matrix $\Gamma$ structured above. Here the constrain on $C$ is the Schur complement constraint $\Sigma_0 - C \Sigma^{-1}_1 C^\top \succeq 0.$ Thus, the minimization of the function $C \mapsto -2 Tr(C)$ leads to the result. \subsection{Transport map between Gaussian measures } \begin{proposition}[Optimal transport map between Gaussian measures, adopted from ~\cite{knott1984optimal_GD_map}, Example 1.7~\cite{mccann1997convexity}] Given the two Gaussian distributions defined in theorem (\ref{theorem:w_gaussian}), define a symmetric positive matrix $T$ and a corresponding linear map $\mathcal{T} : \mathcal{X} \mapsto \mathcal{X}$ \begin{equation}\small \begin{aligned} \mathcal{T}(x) = \mu_1 + T (x - \mu_0), { {} where }\\ T = \Sigma_1^{1/2}(\Sigma_1^{1/2}\Sigma_0\Sigma_1^{1/2})^{-1/2}\Sigma_1^{1/2} \end{aligned} \end{equation} Then, $\mathcal{T}$ is the optimal map such that $P^1 = T\#P^0$. \end{proposition} Hence we obtain a closed-form map and that leads to an explicit form of the geodesic interpolation among two Gaussian distributions, as: \begin{equation}\small \begin{aligned} {T}^{G,xy}_{t}: = \nonumber \begin{cases} {T}^{G,x}_{t}(x^0) &= ( 1 - t ) x^0 + \mathcal{T} (x^0), \\ {T}^{G,y}_{t}(y^0) &= \begin{cases} y^0, { {} } 0 < t < 0.5, \\ -y^0, { {} } 0.5 < t < 1. \end{cases} \end{cases} \end{aligned} \end{equation} Here the interpolation of $y^0$ means we will always label a sample as $-1$ or $1$, which allows us to proceed to the analysis under the classification error. Given the two Gaussian distributions defined in theorem (\ref{theorem:w_gaussian}), define a symmetric positive matrix $T$ and a corresponding linear map $\mathcal{T} : \mathcal{X} \mapsto \mathcal{X}$ \begin{equation}\small \begin{aligned} \mathcal{T}(x) = \mu_1 + T (x - \mu_0), { {} where }\\ T = \Sigma_1^{1/2}(\Sigma_1^{1/2}\Sigma_0\Sigma_1^{1/2})^{-1/2}\Sigma_1^{1/2} \nonumber \end{aligned} \end{equation} Then, $\mathcal{T}$ is the optimal map such that $P^1 = T\#P^0$. Check the optimal transport map from $N(\mu_0, \Sigma_0)$ to $N(\mu_1, \Sigma_1)$, again assume $\mu_0= \mu_1 = 0$ for simplicity, one may define the random column vectors $X \sim N(\mu_0, \Sigma_1)$ and $Y = T X$ and write \begin{equation} \begin{aligned} \nonumber \mathbb{E} (YY^\top) &= T \mathbb{E} (XX^\top)T^\top \\ &= \Sigma_0^{-1/2}(\Sigma^{1/2}_1 \Sigma_2 \Sigma^{1/2}_0)^{1/2} (\Sigma^{1/2}_1 \Sigma_2 \Sigma^{1/2}_0)^{1/2} \Sigma_0^{-1/2} \\ &= \Sigma_1 \end{aligned} \end{equation} To show the map is optimal, one may use \begin{equation} \begin{aligned} \nonumber \mathbb{E}(\| X - Y\|^2_2) &= \mathbb{E} (\|X \|^2_2) + \mathbb{E} (\| Y \|^2_2) - 2 \mathbb{E} (<X, Y>) \\ &= Tr(\Sigma_0) + Tr(\Sigma_1) - 2 \mathbb{E}(<X, TX>) \\ &= Tr(\Sigma_0) + Tr(\Sigma_1) - 2 Tr(\Sigma_0 T) \end{aligned} \end{equation} and one can observe that by the cyclic property of the trace \begin{equation} Tr(\Sigma_0 T) = Tr((\Sigma^{1/2}_1 \Sigma_2 \Sigma^{1/2}_0)^{1/2}) \nonumber \end{equation} Moreover, for the interpolation Geodesic, the following result holds. \begin{proposition}[Interpolation between Gaussian distributions~\citep{mccann1997convexity} example 1.7] Given the two Gaussian distributions defined in theorem (\ref{theorem:w_gaussian}), respectively. A constant speed geodesic is defined by the the path $(G^g_t)_{t \in [0, 1]}$, such that $\forall t \in [0, 1]$, and $G^g_t:= N(m_t, \Sigma_t)$ is given by \begin{equation} \begin{aligned} & m_t = (1 - t) \mu_1 + t \mu_2, \\ &\Sigma_t = ((1 - t) Id + t T) \Sigma_1 ((1 - t) Id + t T) \end{aligned} \end{equation} where $T= \Sigma_1^{1/2}(\Sigma_1^{1/2}\Sigma_0\Sigma_1^{1/2})^{-1/2}\Sigma_1^{1/2}$. \end{proposition} We have illustrated that the Wasserstein barycenter, on the geodesic, of two Gaussian distributions is still a Gaussian distribution and admits an explicit form. \begin{equation} \begin{aligned} \text{where, } & T^x_t(x) =(1 -t) x+ t T^x (x), \\ & T^y_t(y) =(1 - t) y+ t T^y (y) \end{aligned} \end{equation} \subsection{The effect of the regularization} Recall that the geodesic regularization term is \begin{equation} \begin{aligned} \text{Reg}^{T^{xy}}_{l}(f_\theta) = \int_{t=0}^1 \left| \frac{d}{dt} \int_{\mathcal{X} \times \mathcal{Y}} l ( f_\theta(T^x_t(x), T^y_t(y)) d P^0(x,y) \right| dt \end{aligned} \end{equation} Recall the classifier to be $f_\theta(x) = \langle \theta, x \rangle = \theta^\top x$, and the loss to be $l(f(x), y) = -y f(x)$, Consider the following minimization problem \begin{equation} \min_{f \in \mathcal{H}} \mathbb{E}_{(x,y) \sim P_{all}} [l(f(x), y)] + \frac{\lambda_1}{2} \text{Reg}^{T^{xy}}_{l}(f_\theta) \end{equation} Proof. The problem above can be written as follows \begin{equation} \min_{\theta \in \mathbb{R}^d} \mathcal{L}(\theta) = - ( \langle \theta, \mu_1 - \mu_0 \rangle ) + \lambda_1 \text{Reg}(\theta) \end{equation} And under the above setting, we have \begin{equation} \begin{aligned} \text{Reg}^{T^{xy}}_{l}(f_\theta) &= \int_{t=0}^1 \left| \frac{d}{dt} \int_{\mathcal{X} \times \mathcal{Y}} l ( f_\theta(T^x_t(x), T^y_t(y)) d P^0(x,y) \right| dt \\ &= \int_{t=0}^1 \left| \frac{d}{dt} \mathbb{E}_{x_0. y_0 \sim P^0(x,y)} [ l ( f_\theta(T^x_t(x), T^y_t(y)) ] \right| dt \\ &= \int_{t=0}^1 \left| \frac{d}{dt} \mathbb{E}_{x_0. y_0 \sim P^0(x,y)} [ - T^y_t (y_0) \langle \theta, T^x_t(x_0) \rangle ] \right| dt \\ &\text{Recall the parameterization of the map as interpolation, as e.q., \ref{eq:adv_da_geo_interpolate}, } \\ \end{aligned} \end{equation} Here, using the dominated convergence theorem. Also, use the closed form interpolation $T^x_t(x_0) = (1-t)x_0 + t\hat{T}(x_0)$, and $T^y_t(y_0) = 2t-1$ ($y_0 = -1$ and $y_1 = 1$), the above equation turns into \begin{equation} \begin{aligned} &= \int_{t=0}^1 \left| \mathbb{E}_{x_0. y_0 \sim P^0(x,y)} [ -2 \langle \theta, T^x_t(x_0) \rangle - (2t-1) \langle \theta, \hat{T}(x_0) - x_0 \rangle ] \right| dt \\ \end{aligned} \end{equation} Since we have closed-form expression for the geodesic as $\mathbb{E}_{x_0 \sim P^0} [T^t(x_0)] = (2t-1)\mu$ and $\mathbb{E}_{x_0 \sim P^0}[\hat{T}(x_0) - x_0] = 2 \mu$, then \begin{equation} \begin{aligned} &= \int_{t=0}^1 \left| -2 (2t-1) \theta^\top \mu - 2(2t-1) \theta^\top \mu \right| dt = \int_{t=0}^1 \left| 4(1-2t) \theta^\top \mu \right| dt = 2 | \theta^\top \mu | \end{aligned} \end{equation} Then, the objective becomes \begin{equation} \min_\theta \mathcal{L}(\theta) := - \langle \theta, \mu \rangle + \frac{\lambda_1}{2} | \langle \theta, \mu \rangle |^2 + \frac{\lambda_2}{2} \| \theta\|^2_2 \label{eq:geo_reg_objective} \end{equation} Setting the first-order derivative to be zero, we obtain the solution \begin{equation} \begin{aligned} \nabla_\theta \mathcal{L}(\theta) &= - \mu + \lambda_1 \mu \otimes \mu \theta + \lambda_2 \theta = 0, \\ \theta^* &= (\lambda_1 \mu \otimes \mu + \lambda_2 I_m)^{-1} \mu \end{aligned} \end{equation} From Eq. (\ref{eq:geo_reg_objective}), we can see that geodesic regularization is a data-adaptive regularization that smooths the classifier according to the distribution of original data. \subsection{ Proof of Proposition~\ref{prop:DRO-geodesic}} \label{subsec:proof of prop DRO-Geodesic} \paragraph{Assumptions and generalisation} Without loss of generalisation, we assume $\sigma=1$ and $\mu=(1,0,\ldots,0)$, with $1$ at the first coordinate and $0$ elsewhere. Thus $\|\mu\|=1$. Since $\eta(x|y=-1), \eta(x|y=1)$ are both Gaussian, assume $\eta(x|y=-1)\sim N(\psi_{-1},\Sigma_{-1})$ and $\eta(x|y=1)\sim N(\psi_1,\Sigma_1)$. Let $u_1,\ldots,u_d$ be the eigenvalues of $\Sigma_0$ Following Theorem~\ref{theorem:Wasserstein-Gaussian}, we have \begin{equation}\small \begin{aligned} W^2_2(N_d(\psi_1,\Sigma_1), N_d(\mu,\mathbb{I})) &= \|\psi_1 - \mu \|^2 + tr(\Sigma_1) + d - 2 tr ({\Sigma_1}^{1/2}) \\ &= \|\psi_1 - \mu \|^2 +\sum_{i=1}^d\left(\sqrt{u_i}-1\right)^2 \end{aligned} \end{equation} Similarly, \begin{equation}\small \begin{aligned} W^2_2(N_d(\psi_{-1},\Sigma_{-1}), N_d(-\mu,\mathbb{I})) = \|\psi_{-1} + \mu \|^2 +\sum_{i=1}^d\left(\sqrt{v_i}-1\right)^2, \end{aligned} \end{equation} where $\{v_i\}_{1}^d$ are the eigenvalues of $\Sigma_{-1}$. By linearity property of Gaussian distributions $\eta(X|Y=y) \sim N(\psi_y,\Sigma_y)$ implies, $\alpha'X+\beta|Y=y \sim N(\alpha'\psi_y + \beta,\alpha'\Sigma_y\alpha)$. Therefore, \begin{eqnarray} \mathbb{E}_{(X,Y) \sim \eta(X|Y)\nu(Y)}l(f_{(\alpha, \beta)}(X),Y)\propto P_{N(0,1)}\left(Z_1<-\dfrac{(\alpha'\psi_1 +\beta)}{\sqrt{\alpha'\Sigma_1\alpha}}\right)+P_{N(0,1)}\left(Z_{-1}>-\dfrac{(\alpha'\psi_{-1} +\beta)}{\sqrt{\alpha'\Sigma_{-1}\alpha}}\right), \end{eqnarray} where $Z_1=\dfrac{\alpha'(X - \psi_1)}{\sqrt{\alpha'\Sigma_{1}\alpha}} \biggr|Y=1 \sim N(0,1)$ if $X|Y=1 \sim N(\psi_1,\Sigma_1)$ and \\$Z_{-1}=\dfrac{\alpha'(X - \psi_{-1})}{\sqrt{\alpha'\Sigma_{-1}\alpha}}\biggr|Y=-1 \sim N(0,1)$ if $X|Y=-1 \sim N(\psi_{-1},\Sigma_{-1})$. The LHS of Eq.~\eqref{eq: maxinf-gaussian-geodesic} becomes \begin{eqnarray} \label{eq: maxinf-gaussian-geodesic_2} & \max_{(\psi_1,\psi_{-1},\Sigma_1,\Sigma_{-1})\in B_{\epsilon}(\mu) } \inf_{\alpha, \beta}P_{N(0,1)}\left(Z_1<-\dfrac{(\alpha'\psi_1 +\beta)}{\sqrt{\alpha'\Sigma_1\alpha}}\right)+P_{N(0,1)}\left(Z_{-1}>-\dfrac{(\alpha'\psi_{-1} +\beta)}{\sqrt{\alpha'\Sigma_{-1}\alpha}}\right), \end{eqnarray} where, $B_{\epsilon}(\mu)=\{(\psi_1,\psi_{-1},\Sigma_1,\Sigma_{-1}): \|\psi_{-1} + \mu \|^2 +\sum_{i=1}^d\left(\sqrt{v_i}-1\right)^2 \leq \epsilon^2, \|\psi_{1} - \mu \|^2 +\sum_{i=1}^d\left(\sqrt{u_i}-1\right)^2 \leq \epsilon^2\}$ $\{u_i\}_1^d$ are eigenvalues of $\Sigma_{-1}$, and $\{u_i\}_1^d$ are eigenvalues of $\Sigma_{-1}$. \paragraph{Step 1:} First, we show the proof under the assumption $\Sigma_1=\Sigma_{-1}=\Sigma$. Fixing $\psi_1,\psi_{-1}, \Sigma$ so that $\psi_1,\psi_{-1}, \Sigma, \Sigma \in B_{\epsilon}(\mu)$ and setting derivative to $0$ of \begin{eqnarray} \label{eq: maxinf-gaussian-geodesic_3} P_{N(0,1)}\left(Z_1<-\dfrac{(\alpha'\psi_1 +\beta)}{\sqrt{\alpha'\Sigma\alpha}}\right)+P_{N(0,1)}\left(Z_{-1}>-\dfrac{(\alpha'\psi_{-1} +\beta)}{\sqrt{\alpha'\Sigma\alpha}}\right) \end{eqnarray} w.r.t $\beta$ yields either (i) $\alpha'\psi_1 +\beta=\alpha'\psi_{-1} +\beta$, or (ii) $\alpha'\psi_1 +\beta=-(\alpha'\psi_{-1} +\beta)$. Setting derivative of \eqref{eq: maxinf-gaussian-geodesic_3} w.r.t $\alpha$ to $0$ yields $\psi_1=\psi_{-1}$, which clearly is a contradiction for $\epsilon<1$. Considering (ii) above yields $\beta=-\alpha'(\psi_{-1} + \psi_1 )/2$. Then Eq.~\eqref{eq: maxinf-gaussian-geodesic_3} leads to \begin{eqnarray} \label{eq: maxinf-gaussian-geodesic_4} & P_{N(0,1)}\left(Z>\dfrac{\alpha'(\psi_1 -\psi_{-1})}{2\sqrt{\alpha'\Sigma\alpha}}\right)+P_{N(0,1)}\left(Z<-\dfrac{\alpha'(\psi_1 -\psi_{-1})}{2\sqrt{\alpha'\Sigma\alpha}}\right) \nonumber\\ &=2P_{N(0,1)}\left(Z>\dfrac{\alpha'(\psi_1 -\psi_{-1})}{2\sqrt{\alpha'\Sigma\alpha}}\right). \end{eqnarray} The RHS above is minimized w.r.t $\alpha$ when $\dfrac{\alpha'(\psi_1 -\psi_{-1})}{2\sqrt{\alpha'\Sigma\alpha}}$ is maximized. A simple calculation shows that this is achieved for $\alpha=\dfrac{\tilde{a}\Sigma^{-1}}{\sqrt{\tilde{a}'\Sigma^{-1}\tilde{a}}}$, where $\tilde{a}= (\psi_1 -\psi_{-1})$. This gives $\dfrac{\alpha'(\psi_1 -\psi_{-1})}{\sqrt{\alpha'\Sigma\alpha}}= {\sqrt{\tilde{a}'\Sigma^{-1}\tilde{a}}}$. For a given $\Sigma$, this is minimized (and equivalently Eq.~\eqref{eq: maxinf-gaussian-geodesic_3} is maximised) when $ (\psi_1 -\psi_{-1})/2$ is in the direction of the largest eigenvector of $\Sigma$, say $v_1$, and $\tilde{a}'\Sigma^{-1}\tilde{a}=\|\psi_1 -\psi_{-1}\|^2 /v_1$. Notice that since the other eigenvalues do not affect the choice of $(\psi_1 -\psi_{-1})$, based on the constraints $\|\psi_{-1} + \mu \|^2 +\sum_{i=1}^d\left(\sqrt{v_i}-1\right)^2 \leq \epsilon^2$ and $\|\psi_{1} + \mu \|^2 +\sum_{i=1}^d\left(\sqrt{v_i}-1\right)^2 \leq \epsilon^2$, where $v_i$ are the ordered eigenvalues of $\Sigma$, we can assume all other eigenvalues to be $1$ without affecting the value in the RHS of Eq.~\eqref{eq: maxinf-gaussian-geodesic_4}. Let the largest eigenvalue of $\Sigma$ be $(1+\delta)^2$. Then based on the constraints $\|\psi_1 -\psi_{-1}\|^2 /v_1$ is minimized when $\psi_1=-\psi_{-1}$ and they are concurrent with $\mu$ and $-\mu$. Based on the constraints, this yields, \begin{eqnarray} \sqrt{\|\psi_1 -\psi_{-1}\|^2 /v_1}= 2(1-\sqrt{\epsilon^2-\delta^2})/(1+\delta), \end{eqnarray} which is an increasing function of $\delta$ and is minimised at $\delta=1$, which implies $\Sigma=\mathbb{I}$, and $\psi_1=(1-\epsilon)\mu$, $\psi_{-1}=(1-\epsilon)-\mu$, which are the geodesic optimizers. Therefore, \begin{eqnarray} & \max_{\tilde{A}(\nu_{\mu},\epsilon)} \inf_{\alpha, \beta} \mathbb{E}_{(X,Y) \sim \eta(X|Y)\nu(Y)}l(f_{(\alpha, \beta)}(X),Y) = \nonumber \\ & \mathbb{E}_{(X,Y) \sim \nu_{(1-\epsilon)\mu}(X|Y)\nu(Y)}l(f_{(\mu, 0)}(X),Y). \end{eqnarray} where $\tilde{A}(\nu_{\mu},\epsilon)= \{\eta(X|Y): \eta(\cdot|Y) $ is Gaussian, $ W(\eta(X|Y),\nu_{\mu}(X|Y)) \leq \epsilon, \ \forall Y\in \{-1,1\}$, $Cov(\eta(\cdot|Y=1))=Cov(\eta(\cdot|Y=-1))\}$ \paragraph{Step 2:} Next, we use the result in Step 1 to show the remaining. Therefore, consider the situation where we do not restrict to $\Sigma_1=\Sigma_{-1}$. Set $\Sigma^0_1=\Sigma^0_{-1}=\mathbb{I}$, $\psi^0_1=(1-\epsilon)\mu$, $\psi^0_{-1}=-(1-\epsilon)\mu$, $\alpha_0=(1-\epsilon)\mu$, $\beta_0=0$. Also, let \begin{eqnarray} F(\psi_1,\psi_{-1},\Sigma_1,\Sigma_{-1},\alpha,\beta):=\mathbb{E}_{(X,Y) \sim \eta(X|Y)\nu(Y)}l(f_{(\alpha, \beta)}(X),Y), \end{eqnarray} where $\eta(X|Y=1)\sim N(\psi_1,\Sigma_1)$, $\eta(X|Y=-1)\sim N(\psi_{-1},\Sigma_{-1})$. Note that $F(\psi^0_1,\psi^0_{-1},\Sigma^0_1,\Sigma^0_{-1},\alpha_0,\beta_0)={E}_{(X,Y) \sim \nu_{(1-\epsilon)\mu}(X|Y)\nu(Y)}l(f_{(\mu, 0)}(X),Y)$. From \textbf{Step 1 } of the proof, we have shown that, $F(\psi^0_1,\psi^0_{-1},\Sigma^0_1,\Sigma^0_{-1},\alpha,\beta) \geq F(\psi^0_1,\psi^0_{-1},\Sigma^0_1,\Sigma^0_{-1},\alpha_0,\beta_0)$. Now, we claim it is enough to show $F(\psi_1,\psi_{-1},\Sigma_1,\Sigma_{-1},\alpha_0,\beta_0) \leq F(\psi^0_1,\psi^0_{-1},\Sigma^0_1,\Sigma^0_{-1},\alpha_0,\beta_0)$ for $\psi_1,\psi_{-1},\Sigma_1,\Sigma_{-1} \in {A}(\nu_{\mu},\epsilon)$, since then \begin{eqnarray} & &\max_{\tilde{A}(\nu_{\mu},\epsilon)} inf_{\alpha,\beta}F(\psi^0_1,\psi^0_{-1},\Sigma^0_1,\Sigma^0_{-1},\alpha,\beta) \nonumber \\ &\geq &inf_{\alpha,\beta}F(\psi^0_1,\psi^0_{-1},\Sigma^0_1,\Sigma^0_{-1},\alpha,\beta) \nonumber \\ &\geq &F(\psi^0_1,\psi^0_{-1},\Sigma^0_1,\Sigma^0_{-1},\alpha_0,\beta_0) \nonumber \\ &\geq &\max_{\tilde{A}(\nu_{\mu},\epsilon)} F(\psi_1,\psi_{-1},\Sigma_1,\Sigma_{-1},\alpha_0,\beta_0) \nonumber \\ &\geq & inf_{\alpha,\beta} \max_{\tilde{A}(\nu_{\mu},\epsilon)} F(\psi^0_1,\psi^0_{-1},\Sigma^0_1,\Sigma^0_{-1},\alpha,\beta) \end{eqnarray} and we know that \begin{eqnarray} inf_{\alpha,\beta} \max_{A(\nu_{\mu},\epsilon)} F(\psi^0_1,\psi^0_{-1},\Sigma^0_1,\Sigma^0_{-1},\alpha,\beta) \geq \max_{A(\nu_{\mu},\epsilon)} inf_{\alpha,\beta}F(\psi^0_1,\psi^0_{-1},\Sigma^0_1,\Sigma^0_{-1},\alpha,\beta) \end{eqnarray} This would imply that \begin{eqnarray} inf_{\alpha,\beta} \max_{A(\nu_{\mu},\epsilon)} F(\psi^0_1,\psi^0_{-1},\Sigma^0_1,\Sigma^0_{-1},\alpha,\beta) &=& \max_{A(\nu_{\mu},\epsilon)} inf_{\alpha,\beta}F(\psi^0_1,\psi^0_{-1},\Sigma^0_1,\Sigma^0_{-1},\alpha,\beta) \nonumber \\ &=& {E}_{(X,Y) \sim \nu_{(1-\epsilon)\mu}(X|Y)\nu(Y)}l(f_{(\mu, 0)}(X),Y) \end{eqnarray} and complete the proof. Now, \begin{eqnarray} F(\psi_1,\psi_{-1},\Sigma_1,\Sigma_{-1},\alpha_0,\beta_0)=P\left(Z<\dfrac{\mu'\psi_{-1}}{\sqrt{\mu'\Sigma_{-1}\mu}}\right) +P\left(Z> \dfrac{\mu'\psi_1}{\sqrt{\mu'\Sigma_{-1}\mu}}\right). \end{eqnarray} Since the constraints in $A(\nu_{\mu},\epsilon)$ are separate and symmetric with respect to $\psi_1,\Sigma_{1}$ and $\psi_{-1},\Sigma_{-1}$ respectively, and standard Normal distribution is symmetric. Therefore the max of $F(\psi_1,\psi_{-1},\Sigma_1,\Sigma_{-1},\alpha_0,\beta_0)$ over $A(\nu_{\mu},\epsilon)$ is attained when $\psi_{-1}=-\psi_1$ and $\Sigma_1=\Sigma_{-1}$. The remainder follows from \textbf{Step 1}. \subsection{Error probabilities in closed form (Definition~\ref{definition:classification_error_prob})} \paragraph{Standard accuracy probability.} The standard accuracy probability is given as \begin{equation} \mathbb{P}_{x \sim D} (f_\theta(x) = y) = 1 - \mathbb{P}_{x \sim D} (y x^\top \theta < 0) = 1 - Q\left(\frac{\mu^\top \theta}{ \sigma \| \theta \|} \right) \end{equation} where $Q(x) = \frac{1}{\sqrt{2 \pi}} \int^\infty_x e^{- t^2 / 2} dt$. \paragraph{$l_\infty^\epsilon$ robust accuracy.} The $l_{\infty}^\epsilon$ robust accuracy is given as: \begin{align} \inf_{\|v \|_\infty < \epsilon} \mathbb{P}_{x \sim D} (f_\theta(x) = y) &= 1 - \mathbb{P}_{x \sim D}\left( \inf_{\|v \|_\infty < \epsilon} \left\{ y \cdot (x + v)^\top \theta \right\} <0 \right) \nonumber \\ &= 1 - Q\left( \frac{\mu^\top \theta}{\sigma \| \theta \|} - \frac{\epsilon \| \theta \|_1}{\sigma \| \theta \|} \right) \end{align} \paragraph{$l_2^{\sigma_s}$ smoothed classifier for certifiable robust accuracy.} It is the accuracy probability from a $N(0, \sigma_s^2 I)$ smoothed classifier: \begin{align} \mathbb{P}_{x \sim D, \delta \sim N(0, \sigma_s^2 I)} (f_\theta(x + \delta) = y) \end{align} The above probability involves two random variables $x(y) \sim D$ and $\delta \sim N(0, \sigma_s^2 I)$, which are independent of each other. This addition is considered as the convolution of two pdfs. Since $D$ is a mixture of Gaussian and $\delta$ subjects to a Gaussian, there is a closed form \begin{align} D^* = N(\mu, \sigma^2 I) \ast N(0, \sigma_s^2 I) = N(\mu, \sigma^2 + \sigma_s^2 I) \end{align} Thus, the certifiable robust accuracy in this setting is equivalent to the standard accuracy probability from a convoluted dataset. \begin{align} \mathbb{P}_{x \sim D^*} (f_\theta(x) = y) = 1 - Q\left(\frac{\mu^\top \theta}{ (\sigma + \sigma_s) \| \theta \|} \right) \end{align} \subsection{Provable improvement from data augmentation (Theorem~\ref{theorem:Data_aug_Gaussian})} \begin{proof} We divide the proof into several steps as follows: \paragraph{Step 1:} The distribution of original data $(X,Y)$ is iid with $X|Y \sim N (y\mu, \sigma^2 I)$. Thus, from Eq.(10) and (11) in~\cite{carmon2019unlabeled_imp_rob}, we have \begin{align} \mathbb{PE}^{p, \epsilon}_a(f_\theta) = Q\left(\dfrac{\mu^T\theta}{\sigma \|\theta\|} - \dfrac{\epsilon\sqrt{d}}{\sigma}\right), ~\text{where} ~ Q(x)= \dfrac{1}{2\pi}\int_x^{\infty} e^{-z^2/2} \mathrm{d}z. \end{align} Let $\alpha(n_0,n_1)$ be used to denote $n_1/(n_0+n_1)$. Additionally, let $\hat{{\theta}}_{n_1}=\dfrac{\left(\sum_{i=1}^{n_1}\tilde{Y}_i \tilde{X}_i \right)}{n_1 }$. \paragraph{Step 2:} Note that $ \mathbb{PE}^{p, \epsilon}_a(f_{\hat{\theta}_{n_0}}) \geq \mathbb{PE}^{p, \epsilon}_a(f_{\hat{\theta}_{n_0,n_1}}) $ holds as long as $\dfrac{\mu^T\hat{\theta}_{n_0}}{\|\mu\| \|\hat{\theta}_{n_0}\|} \leq \dfrac{\mu^T\hat{\theta}_{n_0,n_1}}{\|\mu\| \|\hat{\theta}_{n_0,n_1}\|}$. This is what we will show. \paragraph{Step 3:} Let $\hat{\theta}_{n_1}\in \{x: \|x-t\mu\| \leq A_3:= t \log(n_1)/n_1\} $. Also assume: \begin{align} & \hat{\theta}_{n_0}\in \{x:A_1:=(t+n_0)/\sqrt{n_1} \leq \|x-\mu\| A_2:=\log(n_1)\} \cap \{x: \mu^T(x) /\|x\| \\ & \leq \sqrt{\|\mu\|^2- ((t+n_0)/\sqrt{n_1})^2\} \}} \end{align} We show that in this case $\dfrac{\mu^T\hat{\theta}_{n_0}}{\|\mu\| \|\hat{\theta}_{n_0}\|} \leq \dfrac{\mu^T\hat{\theta}_{n_0,n_1}}{\|\mu\| \|\hat{\theta}_{n_0,n_1}\|}$. Indeed, \begin{eqnarray}\small \dfrac{\mu^T\hat{\theta}_{n_0}}{\|\mu\| \|\hat{\theta}_{n_0}\|} &\leq& \cos(\pi/2-\arcsin (A_1/\|\mu\|)) \nonumber \\ &<& \cos\left(\pi_2-\arcsin\left(\dfrac{n_1A_3 +n_0A_2}{n_1t\|\mu\|+n_0\|\mu\|}\right)\right) \nonumber\\ &<& \dfrac{(n_1t\mu+n_0\mu)^T\hat{\theta}_{n_0,n_1}}{\|n_1t\mu+n_0\mu\| \|\hat{\theta}_{n_0,n_1}\|} \\ &=& \dfrac{\mu^T\hat{\theta}_{n_0,n_1}}{\|\mu\| \|\hat{\theta}_{n_0,n_1}\|}. \end{eqnarray} The first inequality holds by Cauchy-Schwartz, while the second inequality holds by substituting values of $A_1,A_2$ and $A_3$ (note that $n_1A_3+n_0A_2 \leq (n_1t +n_0)A_1$) combined with the facts that $tN_1 +n_0 >\sqrt{N_1} \log(N_1)$ and $f(n)=tn +n_0 -\sqrt{n} \log(n)$ is monotonically increasing in $n$. Note that $\hat{\theta}_{n_0,n_1}=\alpha(n_0,n_1)\hat{\theta}_{n_1}+(1-\alpha(n_0,n_1))\hat{\theta}_{n_0}$. Moreover, $\hat{\theta}_{n_1}$ and $\hat{\theta}_{n_0} $ follow $\hat{\theta}_{n_1} \sim N(t\mu,\sigma^2 I_d/n_1)$ and $\hat{\theta}_{n_0} \sim N(\mu,\sigma^2 I_d/n_0)$, independently. The third inequality therefore holds because $\|y-t\mu\|\leq A_3$ and $\|x-\mu\| \leq A_2$ implies $\|\alpha(n_0,n_1)y+(1-\alpha(n_0,n_1))x- \alpha(n_0,n_1)t\mu+(1-\alpha(n_0,n_1))\mu\| \leq \alpha(n_0,n_1)A_3+(1-\alpha(n_0,n_1))A_2$. Therefore, $P\left(\dfrac{\mu^T\hat{\theta}_{n_0}}{\|\mu\| \|\hat{\theta}_{n_0}\|} \leq \dfrac{\mu^T\hat{\theta}_{n_0,n_1}}{\|\mu\| \|\hat{\theta}_{n_0,n_1}\|}\right) \geq P(\hat{\theta}_{n_1}\in \{x: \|x-t\mu\| \leq A_3:= t \log(n_1)/n_1\}) \times P(\hat{\theta}_{n_0}\in \{x:A_1:=(t+n_0)/\sqrt{n_1} \leq \|x-\mu\| \leq A_2:=\log(n_1)\} \cap \{x: \mu^T(x) /\|x\| \leq \sqrt{\|\mu\|^2- ((t+n_0)/\sqrt{n_1})^2\} \}})$. The result now holds true by simple variable transformations. \end{proof} \section{Additional intuition \& related works} \subsection{Related works} Recent studies have shown that data augmentation, including potentially unlabelled data, improves adversarial robustness, both empirically and theoretically. A line of study is rigorously explaining how the adversarial robustness is affected by the sample size \cite{schmidt2018adversarially} where unlabeled or out-of-distribution data are helpful~\citep{carmon2019unlabeled_imp_rob,deng2021improving_ood_data_rob_gaussian_mix,dan2020sharp_rob_gaussian,bhagoji2019lower_adv_ot}. Although conventional data augmentation techniques (such as random flips, rotations, or clips)~\citep{howard2013some_data_aug,he2015convolutional_data_aug} have remarkable standard learning performance, is not until recently that researchers started to investigate how data augmentation can improve deep learning robustness~\citep{volpi2018generalizing_data_aug_dro,Ng2020SSMBASM,rebuffi2021data_aug_rob_deepmind}. Among them, Mixup~\citep{zhang2018mixup}, which interpolates training samples via convex combinations, is shown to improve both the robustness and generalization theoretically~\citep{zhang2021mix_rob_gen}. A few studies have already explored the usage of optimal transport (OT) ideas within mixup. PuzzelMix~\citep{kim2020_puzzlemix} aligns saliency regions of images with a masked optimal transport. The idea of augmentation with saliency is extended in recent works~\citep{kim2021_co-mixup}. OT also helps align feature tensors in high-dimensional vector space~\citep{venkataramanan2022alignmix}, while this method also requires autoencoder models to capture reasonable representations, they perform barycentric projection (linear map) and implicitly restrict the interpolation manifold. The idea of barycenter is also used in AutoMix~\citep{zhu2020_automix_optransmix}, which relies on a barycenter generator. \subsection{Intuitions} The recently proposed idea of randomized smoothing~\citep{pmlr-v97-cohen19c} provides a certifiably robust classifier on $\ell_2$-perturbations. This notion is desirable as it not only offers a provable guarantee of the robustness of deep neural networks but also can be obtained in a relatively computationally-efficient fashion. To improve the robustness, multiple approaches have been proposed to facilitate the training of base classifiers that could have better certified robustness. In addition to different regularization methods~\citep{Zhai2020MACER,jeong2020consistency,li2018certified_renyi}, the pioneering work adopted Gaussian data augmentation~\citep{pmlr-v97-cohen19c} to pursue smoothness, augmenting more complicated smoothing distribution~\citep{li2021tss_TSS}, adversarial samples~\citep{salman2019provably}, and mixing adversarial samples with original samples~\citep{jeong2021smoothmix} are all promising methods. We can illustrate our intuitions as follows: {(1)} Instead of the datapoint-specific adversarial perturbations that are aimed to attack one specific sample, the directed augmented data distribution can be considered as universal perturbations~\citep{moosavi2019robustness} that cause label change for a set of samples from the perturbed distribution $\mathcal{U}_P$. {(2)} Such perturbation matches the global manifold structure of the dataset~\citep{greenewald2021_kmixup}, therefore promoting a smoother decision boundary. {(3)} It is shown in~\cite{wei2020theoretical_expansion} that this augmentation strategy improves the expansion of the neighborhood of class-conditional distributions. This formulation allows us to employ the results from OT theories~\citep{villani2009optimal} and Wasserstein Barycenter~\citep{agueh2011barycenters} thus firmly estimating the perturbed distribution $\mathcal{U}_P$. {(4)} Apart from most data augmentation techniques that improve the generalization by creating samples that are likely to cover the testing distribution. Our argumentation promotes the inter-class behavior~\citep{tokozume2017learning_between_class} and potentially enlarges the ratio of the between-class distance to the within-class variance~\citep{fisher1936use}, or Fisher's criterion. \subsection{Mixture of distributions} \paragraph{Mixture of distributions in classification} While it is challenging to specify a general distribution family for $\mathcal{U}_P$ to enable robust training, we further look into the structure of the joint data distribution $\mathcal{P}^{all}_{x,y}$. Considering a $k$-class classification problem, it is natural to view the data distribution as a mixture of subpopulation distributions \begin{align}\small \mathcal{P}^{all}_{x,y} = \sum_{i=1}^k w_k P_k(X, Y), \end{align} where each mixture $P_k(X, Y)$ stands for an individual class~\citep{carmon2019unlabeled_imp_rob,zhai2019adversarially_rob_gaussian,dan2020sharp_rob_gaussian}. In such a case, we can utilize the geometric structure underneath the training data to specify the adversarial distribution and improve the model's robustness, especially when differentiating subpopulation distributions. \subsection{Connection to Mixup } Let us define $x \in \mathcal{X}$ to be input data and $y \in \mathcal{Y}$ to be the output label. Let $(X_0,Y_0)\sim P^0_{x,y}$ and $(X_1,Y_1)\sim P^1_{x,y}$ be two distributions on $\mathcal{X} \times \mathcal{Y}$. We may also allow $Y_1=1$ a.s. $P^1_{x,y}$ and $Y_0=0$ a.s. $P^0_{x,y}$.For brevity, we use $P^i_{x,y}$ and $P^i$ interchangeably. For the mixup setting~\citep{kim2020_puzzlemix}, the goal is to optimize a loss function as follows: \begin{eqnarray} \min_{f} \mathbb{E}_{(X_0,Y_0) \sim P^0_{x,y},(X_1,Y_1)\sim P^1_{x,y}} \mathbb{E}_{ \lambda\sim q} (l(f(h_{\lambda}(X_0,X_1)),e_{\lambda}(Y_0,Y_1))) \end{eqnarray} where the label mixup function is $e_{\lambda}(y_0,y_1) = (1-\lambda)y_0 + \lambda y_1$. Input mixup uses $h_{\lambda}(x_0,x_1) = (1-\lambda)x_0+\lambda x_1$, and $q$ is the distribution of $\lambda$ considered. Here conventional mixup~\citep{zhang2018mixup} considers the linear interpolation of independently sampled data. However, we feel this may be too restrictive in nature, since this may lead to the creation of samples that may not contribute in situations when the task is binary classification. In that respect, consider the following minimization problem instead, \begin{eqnarray} \min_f \mathbb{E}_{ t\sim q} \mathbb{E}_{(X_0,X_1,Y_0,Y_1) \sim \tilde{\pi} } \nonumber \left[ l(f(h_{t}(X_0,X_1)), e_{t}(Y_0,Y_1) \right], \end{eqnarray} where $\tilde{\pi}(x_0,x_1,y_0,y_1)=$ $\tilde{\pi}_x((x_0,x_1)|(y_0,y_1)) \times \tilde{\pi}_y((y_0,y_1))$, with $\tilde{\pi}_x((\cdot,*)|(y_0,y_1)) $ being the optimal transport coupling between the conditional distributions $P^0(\cdot|y_0)$ and $P^1(\cdot|y_1)$, while $\tilde{\pi}_y((\cdot,\cdot))$ is the optimal transport coupling between the marginal distributions of $Y_0$ and $Y_1$. It is easy to see that under the existence of unique Monge maps in-between marginal and conditional distributions of $Y_0, Y_1$ and $X_0|Y_0,X_1|Y_1$ respectively, this is equivalent to solving the following optimization problem. \begin{eqnarray} \label{eq:connect} \min_f \mathbb{E}_{ t\sim q} \mathbb{E}_{(x,y) \sim \mu^{\{P_0,P_1\}}_{t} }\left[ l(f(x), y) \right] \end{eqnarray} where Eq.\eqref{eq:barycenter} $\mu^{\{P_0,P_1\}}_{t} = \min_\mu U^{N=2}_{wb}(\mu) := \min_\mu (1-t) W (\mu, P^0) + tW(\mu, P^1)$ and $W(\cdot,*)$ is the Wasserstein metric. \subsection{A more general problem formulation: multi-marginal optimal transport} We restrict the adversarial distribution family to be the geodesic interpolations between individual subpopulation distributions. Thus eq.(\ref{eq:eq1_dro}) becomes \begin{align} \min_{f} \max_\alpha \mathbb{E}_{x, y \sim U^{wb}(\alpha) } \left[ l(f(x), y) \right] \label{eq:adv_w_bc} \end{align} where $U^{wb}(\alpha )= \arg \min_U \frac{1}{K} \sum_i \alpha_i W (U, P_i)$ is the Wasserstein barycenter, in other words, the interpolation of subpopulation distributions. In addition, with a predictive function $f$, we can consider a dynamic metric, \textit{geodesic loss}, $\text{R}^{\text{geo}}_f$ that measures the change of its performance with the criteria function $l$ while \textit{gradually interpolating} among subpopulation distributions $\{P_i\}_{i=1}^K$. This metric is thus a continuous function of $\alpha$, where \begin{equation}\small \text{R}^{\text{geo}}_f (\alpha) = \mathbb{E}_{x, y \sim U^{wb}(\alpha)} \left[l ( f(x), y) \right] \end{equation} The geodesic loss $\text{R}^{\text{geo}}_f$ provides us a new lens through which we can measure, interpret, and improve a predictive model's robustness from a geometric perspective. \section{Algorithm \& Computation } \begin{algorithm}[H]\small \centering \caption{Sinkhorn Barycenter}\label{alg:} \begin{algorithmic}[1] \STATE \textbf{Input}: Empirical distributions $\alpha_1,\alpha_2$, cost matrix $\mathbf{C}$, $\mathbf{K} = exp (- \mathbf{C} / \epsilon)$. \STATE \textbf{Output}: debiased barycenters $\alpha_{S_\epsilon}$ \STATE Initialize scalings $(b_1, b_2) ,d$ to $\mathbf{1}$. \WHILE{not converge} \FOR{$k=1$ to $2$} \STATE $a_k \xleftarrow{} \left( \alpha_k / \mathbf{K} n_k \right)$ \ENDFOR \STATE $\alpha \xleftarrow{} d \odot \sum_{k=1}^K (\mathbf{K}^\top a_k)^{w_k}$ \FOR{$k=1$ to $2$} \STATE $b_k \xleftarrow{} \left( \alpha / \mathbf{K}^\top \alpha_k \right)$ \ENDFOR \STATE $d \xleftarrow{} \sqrt{ d \odot (\alpha \mathbf{K} d)}$ \ENDWHILE \end{algorithmic} \end{algorithm} In practice, we only observe discrete training samples that represent an empirical distribution of $P_i$ and $P_j$. Consider $\mathbf{X}_i = \{\mathbf{x}^i_l\}_{l=1}^{n_i}$ and $\mathbf{X}_j = \{\mathbf{x}^j_l\}_{l=1}^{n_j}$ are two set of features from class $i$ and $j$ respectively. The empirical distributions are written as $\hat{P}_i = \sum_{l=1}^{n_i} p_l^i \delta_{x^i_l}$ and $\hat{P}_j = \sum_{l=1}^{n_j} p_l^j \delta_{x^j_l}$ where $\delta_{x}$ is the Dirac function at location $x \in \Omega$, $p_l^i$ and $p_l^j$ are probability mass associated to the sample. Then the Wasserstein distance, between empirical measures $\hat{P}_i$ and $\hat{P}_j$ becomes \begin{equation}\small W(\hat{P}_i, \hat{P}_j) = \inf_{\pi \in \hat{\Pi}} \sum_{l=1,k=1}^{n_i, n_j} c(\mathbf{x}^i_l, \mathbf{x}^j_k) \pi_{l,k} + H(\pi), \end{equation} where $\hat{\Pi}:= \{\pi \in (\mathbb{R}^+)^{n_i \times n_j} | \pi \mathbf{1}_{n_j} = \mathbf{1}_{n_i} /n_i, \pi^\top \mathbf{1}_{n_i} = \mathbf{1}_{n_j} /n_j \}$ with $\mathbf{1}_n$ a length $n$ vector of ones, $H(\cdot)$ is the negative entropy regularizer for us to utilize the Sinkhorn algorithm. $c(x, y)$ is the ground cost function that specifies the actual cost to transport the mass, or probability measure, from position $x$ to $y$. Most studies merely use $l_2$ norm as the ground metric as there are a lot of desirable properties, such as the linear barycentric projection~\citep{villani2009optimal} used in other OT-based mixup methods~\cite{venkataramanan2022alignmix}. \paragraph{Computation concerns: batch OT and entropic OT} Discrete optimal transport involves a linear program that has an $O(n^3)$ complexity. Hence, the potential computation issues can not be ignored. First of all, we adopted the celebrated entropic optimal transport~\citep{cuturi2013sinkhorn} and used the Sinkhorn algorithm to solve for OT objectives and Barycenters~\citep{janati2020debiased_barycenter} (algorithm 2). The Sinkhorn algorithm has a $O(n \log n)$ complexity, thus it can ease the computation burden. In addition, the pairwise Wasserstein distance can be precomputed and stored. Last but not least, we follow the concept of minibatch optimal transport~\citep{fatras2021minibatch_OT} where we sample a batch of samples from each condition during the data augmentation procedure. Whereas minibatch OT could lead to non-optimal couplings, our experimental results have demonstrated that our data augmentation is still satisfactory. \paragraph{Data augmentation } In our work, we focus on studying the advantages and limitations brought by certain data augmentation algorithm $\mathcal{A}: \mathcal{X} \mapsto \mathcal{X}$ such that $\mathcal{A}_\# P^0_{X, Y} = P^1_{X, Y}$, where $A_\# \mu = \nu$ denotes that $\nu$ is the pushfoward measure of $\mu$ by $A$. Under this notation, a data augmentation algorithm is a transport map that transforms the original data distribution $P^0_{X, Y}$ towards the augmentation distribution $P^1_{X, Y}$. In practice, the estimation of such a transport map is challenging. Nevertheless, we can assume the access to the distribution $P^1_{X,Y}$ and augmented data samples $\{ \Tilde{x}_i, \Tilde{y}_i \}_{i=1}^{n_1} \sim P^1_{X,Y}$. Consider a supervised learning algorithm $T(\cdot, \cdot): (\mathcal{X} \times \mathcal{X}) \mapsto \Theta$ that maps a dataset to a model parameter $\theta$. The standard training process relies on the raw dataset $\hat{\theta}_{n_0} = T(X, Y)$ while data augmentation provides additional dataset and $\Tilde{\theta}_{n_0 + n_1} = T([X, Y], [\Tilde{X}, \Tilde{Y}])$. \section{Additional Experimental Results} \subsection{Experiments on MNIST dataseet} \begin{table}[htp]\small \centering \caption{Certified accuracy on MNIST dataset. } \vspace{-5pt} \begin{adjustbox}{width=0.99\linewidth} \input{tables/mnist} \end{adjustbox} \label{table:mnist} \end{table} In Table~\ref{table:mnist}, we show the comparison results on the MNIST dataset with certified accuracy at various radii, and the comparison results on the CIFAR-10 dataset are shown in Table~\ref{table:cifar10}. We set our results \textbf{bold-faced} whenever the value improves the Gaussian baseline and \underline{underlines} whenever the value improves the best among the considered baselines. As shown in Table~\ref{table:mnist}, our method can significantly improve the certified test accuracy compared with Gaussian \cite{pmlr-v97-cohen19c} on the MNIST dataset, and also outperforms existing methods, i.e., SmoothAdv \citep{salman2019provably}, MACER \citep{Zhai2020MACER}, Consistency \citep{jeong2020consistency}, and SmoothMix \citep{jeong2021smoothmix}. The important characteristic of our method is the robustness under larger noise levels. Our method achieved the highest certified test accuracy among all the noise levels when the radii are large, i.e., radii 0.50-0.75 under noise level $\sigma=0.25$, radii 0.75-1.75 under noise level $\sigma=0.50$, and radii 1.50-2.75 under noise level $\sigma=1.00$, which clearly demonstrated the effectiveness of our data augmentation method, as the robustness improvement under large noise level is more critical~\cite{cohen2019certified_cert_rob}. We also combined our method with SmoothAdv and SmoothMix to evaluate whether our data augmentation method can provide additive improvements. As shown in Table~\ref{table:mnist}, we find that by combing our data augmentation mechanism, the performance of previous SOTA methods can be even better, which demonstrates the effectiveness of our method, and can be easily used as an add-on mechanism for many other algorithms to improve learning robustness. \subsection{More ablation studies} \paragraph{Comparison on training batch size} We show the performance comparison for different training batch sizes on the MNIST dataset. \begin{table}[H]\small \centering \caption{Comparison of different training batch with VAE on the MNIST dataset of certified accuracy at various radii (noise level $\sigma=0.5$).} \vspace{0.03in} \begin{adjustbox}{width=0.9\linewidth} \input{tables/batch} \end{adjustbox} \end{table} \paragraph{Comparison on augmentation batch size $b_n$} We show the performance comparison for different augmentation batch sizes on the MNIST dataset. \begin{table}[H]\small \centering \caption{Comparison of different augmentation batch size $b_n$ with VAE on the MNIST dataset of certified accuracy at various radii (noise level $\sigma=0.5$).} \vspace{0.03in} \begin{adjustbox}{width=0.99\linewidth} \input{tables/aug_batch} \end{adjustbox} \end{table} \paragraph{Influence of magnificent coefficient $m_a$} The comparison results of different magnificent coefficient $m_a$ with corresponding certified accuracy at various radii are shown in Table~\ref{table:mag_coe}. \begin{table}[H]\small \centering \caption{Comparison of different magnificent coefficients $m_a$ on the MNIST dataset of certified accuracy at various radii. (noise level $\sigma=0.5$)} \vspace{0.03in} \begin{adjustbox}{width=0.99\linewidth} \input{tables/mag_coe} \end{adjustbox} \label{table:mag_coe} \end{table} \paragraph{Influence of ot\_lbd} The comparison results of different ot\_lbd with corresponding certified accuracy at various radii are shown in Table~\ref{table:ot_lbd}. \begin{table}[H]\small \centering \caption{Comparison of different ot\_lbd on the MNIST dataset of certified accuracy at various radii. (noise level $\sigma=0.5$)} \vspace{0.03in} \begin{adjustbox}{width=0.99\linewidth} \input{tables/ot_lbd} \end{adjustbox} \label{table:ot_lbd} \end{table} \paragraph{Influence of ot\_t} The comparison results of different ot\_t with corresponding certified accuracy at various radii are shown in Table~\ref{table:ot_t}. \begin{table}[H]\small \centering \caption{Comparison of different ot\_t on the MNIST dataset of certified accuracy at various radii. (noise level $\sigma=0.5$)} \vspace{0.03in} \begin{adjustbox}{width=0.99\linewidth} \input{tables/ot_t} \end{adjustbox} \label{table:ot_t} \end{table} \subsection{More experimental results} \paragraph{Influence of VAE training} The training protocol for VAE can also affect performance. We adopted different VAE training mechanisms and computed the corresponding certified accuracy at various radii, which is shown in Table~\ref{table:vae_train}. \begin{table}[H]\small \centering \caption{Comparison of different VAE training methods on the CIFAR-10 dataset of certified accuracy at various radii.} \vspace{0.03in} \begin{adjustbox}{width=0.99\linewidth} \input{tables/vae_training} \end{adjustbox} \label{table:vae_train} \end{table} \paragraph{Influence of the hidden size $z$ in VAE} More ablation study results on the hidden size $z$ in VAE on the CIFAR-10 dataset are shown in Table~\ref{table:more_z}. \begin{table}[H]\small \centering \caption{Comparison of different hidden sizes $z$ in VAE on the CIFAR-10 dataset of certified accuracy at various radii.} \vspace{0.03in} \begin{adjustbox}{width=0.99\linewidth} \input{appendix/cifar_z} \end{adjustbox} \label{table:more_z} \end{table} \paragraph{Influence of $t$ on MNIST dataset} More ablation study results of different ot\_t with PCA and VAE on the MNIST dataset are shown in the following tables. \begin{table}[H]\small \centering \caption{Comparison of different $t$ with PCA on the MNIST dataset of certified accuracy at various radii (without mixing label, noise level $\sigma=0.25$).} \vspace{0.03in} \begin{adjustbox}{width=0.99\linewidth} \input{appendix/no_mixY_PCA_0.25} \end{adjustbox} \label{table:more_ot_t_PCA} \end{table} \begin{table}[H]\small \centering \caption{Comparison of different $t$ with VAE on the MNIST dataset of certified accuracy at various radii (without mixing label, noise level $\sigma=0.25$).} \vspace{0.03in} \begin{adjustbox}{width=0.99\linewidth} \input{appendix/no_mixY_VAE_0.25} \end{adjustbox} \label{table:more_ot_t_VAE} \end{table} \begin{table}[H]\small \centering \caption{Comparison of different $t$ with PCA on the MNIST dataset of certified accuracy at various radii (without mixing label, noise level $\sigma=0.5$).} \vspace{0.03in} \begin{adjustbox}{width=0.99\linewidth} \input{appendix/no_mixY_PCA_0.5} \end{adjustbox} \end{table} \begin{table}[H]\small \centering \caption{Comparison of different $t$ with VAE on the MNIST dataset of certified accuracy at various radii (without mixing label, noise level $\sigma=0.5$).} \vspace{0.03in} \begin{adjustbox}{width=0.99\linewidth} \input{appendix/no_mixY_VAE_0.5} \end{adjustbox} \end{table} \begin{table}[H]\small \centering \caption{Comparison of different $t$ with PCA on the MNIST dataset of certified accuracy at various radii (without mixing label, noise level $\sigma=1.0$).} \vspace{0.03in} \begin{adjustbox}{width=0.99\linewidth} \input{appendix/no_mixY_PCA_1.0} \end{adjustbox} \end{table} \begin{table}[H]\small \centering \caption{Comparison of different $t$ with VAE on the MNIST dataset of certified accuracy at various radii (without mixing label, noise level $\sigma=1.0$).} \vspace{0.03in} \begin{adjustbox}{width=0.99\linewidth} \input{appendix/no_mixY_VAE_1.0} \end{adjustbox} \end{table} \section{Introduction} Deep neural networks (DNNs) have shown tremendous success in an increasing range of domains such as natural language processing, image classification \& generation and even scientific discovery (e.g.~\citep{bahdanau2014neural_nlp,krizhevsky2017imagenet,ramesh2022hierarchical_clip_dalle2}). However, despite their super-human accuracy on training datasets, neural networks may not be robust. For example, adding imperceptible perturbations, e.g., \textit{adversarial attacks}, to the inputs may cause neural networks to make catastrophic mistakes~\citep{Szegedy2014IntriguingPO,goodfellow2014explaining}. Conventional defense techniques focus on obtaining adversarial perturbations~\citep{carlini2017towards,goodfellow2014explaining} and augmenting them to the training process. For instance, the projected gradient descent (PGD)~\citep{madry2018towards}, which seeks the worst-case perturbation via iterative updates, marks a category of effective defense methods. Recent works show that additional training data, including data augmentation and unlabeled datasets, can effectively improve the robustness of deep learning models~\citep{volpi2018generalizing_data_aug_dro,rebuffi2021data_aug_rob_deepmind}. Despite augmenting worst-case samples with gradient information, an unlabeled, even out-of-distribution dataset may also be helpful in this regard~\citep{carmon2019unlabeled_imp_rob,bhagoji2019lower_adv_ot}. Among available strategies, Mixup~\citep{zhang2018mixup}, which interpolates training samples via convex combinations, is shown to improve both the robustness and generalization ~\citep{zhang2021mix_rob_gen}. Moreover, Gaussian noise is appended to training samples to achieve certifiable robustness~\citep{cohen2019certified_cert_rob}, which guarantees the model performance under a certain degree of perturbation. However, most aforementioned approaches operate on individual data samples (or pairs) and require the specification of a family of augmentation policies, model architecture, and additional datasets. Thus, the robustness can hardly be generalizable, e.g., to out-of-sample data examples. To this end, we are curious: \textit{Can we let the underlying data distribution guide us to robustness?} This paper proposes a framework to augment synthetic data samples by interpolating the underlying distributions of the training datasets. Specifically, we find the \textit{worst-case interpolation distributions} that lie on the decision boundary and improve the model's smoothness with samples from these distributions. This is justified by the fact that better decision margin~\citep{kim2021bridged_margin} and boundary thickness~\citep{moosavi2019robustness} are shown to benefit robustness. The probabilistic perspective allows us to formulate the distribution interpolation as barycenter distribution on \textit{Wasserstein geodesics}, where the latter can be reviewed as a dynamic formulation of optimal transport (OT)~\citep{villani2009optimal}. This formulation has the following benefits: (a). It nicely connects our worst-case barycenter distribution to distributionally robust optimization~\citep{DRO-duchi} on the geodesic and substantiates our method’s benefit in promoting robustness. (b). The geodesic provides a new protocol to assess one model's robustness beyond the local area surrounding individual data points. (c). Our data augmentation strategy also exploits the local distribution structure by generalizing the interpolation from (mostly Euclidean) feature space to probability space. (d). Apart from most OT use cases that rely on coupling, we reformulate the objective to include explicit optimal transport maps following McCann's interpolation~\citep{mccann1997convexity}. This enables us to deal with out-of-sample data and appreciate the recent advances in OT map estimation~\citep{perrot2016mapping,amos2022amortizing}, neural OT map estimators~\citep{makkuva2020optimal_icnn,seguy2017large,fan2021scalable_map} for large-scale high-dimensional datasets, and OT between labeled datasets~\citep{alvarez2020geometric_otdd,fan2022generating_geodesic}. \subsection{Related Work} \paragraph{Interpolation of data distributions} ~\cite{gao2021infor_geo_task} propose a transfer distance based on the interpolation of tasks to guide transfer learning. Meta-learning with task interpolation~\citep{yao2021meta_task_interp}, which mixes features and labels according to tasks, also effectively improves generalization. For gradual domain adaptation, ~\cite{wang2022understanding_gda} interpolate the source dataset towards the target in a probabilistic fashion following the OT schema. Recently, the interpolation among multiple datasets realized on generalized geodesics~\citep{fan2022generating_geodesic} is also shown to enhance generalizability for pretraining tasks. Most aforementioned works focus on the benefit of distribution interpolation in generalization. On the other hand, Mixup~\citep{zhang2018mixup}, which augments data by linear interpolating between two samples, is a simple yet effective data augmentation method. As detailed in survey~\citep{cao2022survey_mixup,lewy2022overview_survey_mixup}, there are plenty of extensions such as CutMix~\citep{yun2019cutmix}, saliency guided~\citep{uddin2020saliencymix}, AugMix~\citep{hendrycks2019_augmix}, manifold mixup~\citep{verma2019manifold}, and so on~\citep{yao2022_LISA}. A few studies have explored the usage of optimal transport (OT) ideas within mixup when interpolating features~\citep{kim2020_puzzlemix,kim2021_co-mixup}. However, those methods focus on individual pairs, thus neglecting the local distribution structure of the data. One recent work~\citep{greenewald2021_kmixup} also explores mixing multiple-batch samples with OT alignment. However, their method relies on optimal coupling. In contrast, this work looks for an interpolation path given by optimal transport maps. \paragraph{Data augmentation for robustness.} Augmentation of data\citep{rebuffi2021data_aug_rob_deepmind,volpi2018generalizing_data_aug_dro} or more training data \citep{carmon2019unlabeled_imp_rob,sehwag2021robust_aux_distribution} can improve the performance and robustness of deep learning models. However,~\citep{schmidt2018adversarially} show that sample complexity for robust learning may be prohibitively large when compared to standard learning. Moreover, with similar theoretical frameworks, recent papers ~\citep{deng2021improving_ood_data_rob_gaussian_mix,xing2022unlabeled_unlabel_minimax} further establish theoretical justifications to characterize the benefit of additional samples for model robustness. However, additional data may not be available; in this work, we therefore use a data-dependent approach to generate additional data samples. \subsection{Contributions} Our key contributions are as follows. We propose a data augmentation strategy that improves the robustness of the label prediction task by finding worst-case data distributions on the interpolation within training distributions. This is realized through the notion of Wasserstein geodesics and optimal transport map, and further strengthened by connection to DRO and regularization effect. Additionally, we also provide a theoretical guarantee of robustness improvement and investigate how the geodesic location and the sample size contribute, respectively. Experimental validations of the proposed strategy on \textit{four} datasets including CIFAR-100 and ImageNet establish the efficacy of our method. \textbf{Organization.} The remainder of this paper is organized as follows. Section~\ref{sec:prelim} provides the necessary background about distributional robustness and optimal transport distances. In Section~\ref{sec:adv_interpolate}, we introduce the interpolation strategy for robustifying a classification task. Connections to DRO(Distributionally Robust Optimization) setting further help ground our strategy. Additionally, we also extend this to a regularization framework that generalizes the data interpolation approach. Theoretical analysis for the data augmentation strategy is provided in Section~\ref{sec:theory}, while Section~\ref{sec:exp} provides experimental validation justifying our approach. \section{Preliminaries}\label{sec:prelim} Consider a classification problem on the data set $S = \{ (x_1, y_1),...,(x_n, y_n)\}$, where $x_i \in \mathcal{X} \subseteq \mathbb{R}^d$ and $y_i \in \mathcal{Y} \subseteq \mathbb{R}^y$ are drawn i.i.d from a joint distribution $\mathcal{P}^{all}_{x,y}$. Having a loss criteria $l(\cdot, \cdot): \mathcal{Y} \times \mathcal{Y} \mapsto \mathbb{R} $, the task is to seek a prediction function $f_\theta: \mathbb{R}^d \mapsto \mathbb{R}^y$ that minimizes the standard loss $L(\theta) = \mathbb{E}_{x,y \sim \mathcal{P}^{all}_{x,y}}[l(f_\theta (x), y)]$, and in practice people optimize the empirical loss $\hat{L}(\theta) = 1/n \sum_{i=1}^n l(f(x_i), y_i)$ following the Empirical Risk Minimization (ERM). In large-scale classification tasks such as $k$-class image classification, the label is the one-hot encoding of the class as $y_i \in \{0, 1\}^k := \mathbb{R}^k$ and $l$ are typically cross-entropy loss. \label{subsec:preliminary_on_robustness} \paragraph{Adversarial training \& distributional robustness } Typically, adversarial training is a minimax optimization problem~\citep{madry2018towards} which finds adversarial examples $x + \delta $ within a perturbation set $ \mathcal{S} = \{\delta: \| \delta \|_\infty \leq \epsilon, \epsilon > 0 \}$. While finding specific attack examples is effective, there are potential issues such as overfitting on the attack pattern~\citep{kurakin2016adversarial_pgd,xiao2019enhancing_adv,zhang2019defense_adv}. An alternative approach is to capture the distribution of adversarial perturbations for more generalizable adversarial training~\citep{dong2020adversarial}. In particular, the optimization problem solves a distributional robust optimization \citep{DRO-duchi,weber2022certifying_cert_ood_gen_dro} as follows: \begin{equation} \min_{\theta} \sup_{Q_{x,y} \in \mathcal{U}_P} \mathbb{E}_{x, y \sim Q_{x,y}} [l(f_{\theta}(x), y)], \label{eq:eq1_dro} \end{equation} where $\mathcal{U}_P \subseteq \mathcal{P(Z)} $ is a set of distributions with constrained support. Intuitively, it finds the worst-case optimal predictor $f^*_\theta$ when the data distribution $P$ is perturbed towards an adversarial distribution $\mathcal{U}_P$. However, the adversarial distribution family needs to be properly specified. In addition, adversarial training may still have unsmooth decision boundaries~\citep{moosavi2019robustness}, thus, are vulnerable around unobserved samples. \paragraph{Optimal transport} Given two probability distributions $\mu, \nu \in \mathcal{M}(\mathcal{X})$, where $\mathcal{M}(\mathcal{X})$ is the set of Borel measures on $\mathcal{X}$. The optimal transport (OT)~\citep{villani2009optimal} finds the optimal joint distribution and quantifies the movement between $\mu$ and $\nu$. Particularly, the Wasserstein distance is formulated as $ W_p(\mu, \nu) := ( \inf_{\pi \in \Pi} \int_{\mathcal{X} \times \mathcal{X}} d^p(x, y) d \pi(x, y) )^{1/p}, $ where $d(\cdot, \cdot) : \mathcal{X} \times \mathcal{X} \mapsto \mathbb{R}^+$ is the ground metric cost function, and $\Pi$ denotes set of all joint probability measures on $\mathcal{X} \times \mathcal{X}$ that have the corresponding marginals $\mu$ and $\nu$. \paragraph{Wasserstein barycenter and geodesic} Equipped with the Wasserstein distance, we can average and interpolate distributions beyond the Euclidean space. The Wasserstein barycenter $\mu^{\{ \nu_i\}}_{\alpha}$ of a set of measures $\{\nu_1, ..., \nu_N \}$ in a probability space $\mathbb{P} \subset \mathcal{M}(\mathcal{X})$ is a minimizer of objective $U^N_{wb}$ over $\mathbb{P}$, where \begin{align} \small U^N_{wb}(\mu) := \sum_{i=1}^N \alpha_i W(\mu, \nu_i), \label{eq:barycenter} \end{align} and $\alpha_i$ are the weights such that $\sum \alpha_i = 1$ and $\alpha_i > 0$. Let $\nu_0$ and $\nu_1$ be two measure with an existing optimal transportation map, $T$, satisfying $\nu_1 = T\# \nu_0$ and $W^2_2(\nu_0, \nu_1) = \int_{\mathcal{X}} \|x -T(x)\|^2 d \nu_0$. Then, for each $t$, the barycenter distribution(denoted by $\mu_t$) corresponding to $\alpha_0=t, \alpha_1=1-t$ in Eq.\eqref{eq:barycenter}, lies on the geodesic curve connecting $\nu_0$ and $\nu_1$ . Moreover, ~\citep{mccann1997convexity}, \begin{align}\small \mu_t:=((1-t)\text{Id} + t T)\# \nu_0 , \label{eq:maccann} \end{align} where $\text{Id}$ is the identity map. While the above McCann's interpolation is defined only for two distributions, the \textit{Wasserstein barycenter} eq. (\ref{eq:barycenter}) can be viewed as a generalization to $N \geq 2$ marginals. To this point, we are able to look for adversarial distributions leveraging such interpolation. \begin{figure*}[t!] \centering \includegraphics[width=0.98\textwidth]{figs/framework/illustrate_idea_v2.png} \vspace{-5pt} \caption{ \textbf{1}: For a classification problem, the data samples give empirical access to the underlying data distribution, which is a mixture of distinct subpopulation distributions. \textbf{2(a)}: The inner maximization step finds the worst-case Wasserstein barycenter on the geodesic. \textbf{2(b)}: The outer minimization step updates the predictive function with augmented samples. } \label{fig:fig1_illstration} \end{figure*} \section{Adversarial robustness by interpolation }\label{sec:adv_interpolate} For a $k$-classification task, it is natural to view the data of each category are samples from distinct distributions $P^{all}_{x,y}=\sum^k_i P^i_{x,y}$. Following eq.(\ref{eq:eq1_dro}), we can write the following minimax objective \begin{align} \min_{f} \max_\alpha \mathbb{E}_{x, y \sim U^{wb}(\alpha) } \left[ l(f(x), y) \right] \end{align} where $U^{wb}(\alpha)$ is the Wasserstein barycenter (eq. \ref{eq:barycenter}), in other words, the interpolation of different category distributions. In fact, this corresponds to a special case of DRO eq.(\ref{eq:eq1_dro}) as shown in the below proposition, and naturally corresponds to the adversarial distribution within a particular Wasserstein ball, for distributional robustness. \begin{proposition} \label{prop:DRO-geodesic} Suppose the original data $\{ {X}_i, {Y}_i, \}_{i=1}^{{n_0}}$ are iid with distribution satisfying $X|Y=y \sim \nu_{\mu}(X|Y)=N_d(y\mu, \sigma^2 I)$, $Y\sim \nu(Y)=U\{-1,1\}$. Assume the loss function is given by $l(f(x),y)=\mathbbm{1}(f(x)\neq y)$. We consider $f(x)=f_{\alpha,\beta}(x)$ of the form $\text{sign}(\alpha'x+\beta)$.Then the following holds \begin{eqnarray} \label{eq: maxinf-gaussian-geodesic} & & \max_{A(\nu_{\mu},\epsilon)} \inf_{\alpha, \beta} \mathbb{E}_{(X,Y) \sim \eta(X|Y)\nu(Y)}l(f_{(\alpha, \beta)}(X),Y)\nonumber\\ &= & inf_{\alpha,\beta} \max_{A(\nu_{\mu},\epsilon)} \mathbb{E}_{(X,Y) \sim \eta(X|Y)\nu(Y)}l(f_{(\alpha, \beta)}(X),Y) \nonumber \\ &=& \mathbb{E}_{(X,Y) \sim \nu_{(1-\epsilon)\mu}(X|Y)\nu(Y)}l(f_{(\mu, 0)}(X),Y). \end{eqnarray} Here, $A(\nu_{\mu},\epsilon)= \{\eta(X|Y): \eta(\cdot|Y) $ is Gaussian, $ W(\eta(X|Y),\nu_{\mu}(X|Y)) \leq \epsilon, \ \forall Y\in \{-1,1\}\}$. \end{proposition} This proposition, whose proof is discussed in Section~\ref{subsec:proof of prop DRO-Geodesic}. \subsection{Data augmentation: worst-case interpolation } In this section, we proceed to device computation strategies for the worst-case barycenter approach. Akin to robust training methods that seek adversarial examples approximately, such as PGD~\citep{madry2018towards} and FGSM~\citep{goodfellow2014explaining}, our paradigm learns an adversarial distribution~\citep{dong2020adversarial} and then samples from these distributions. Here we make an important choice by focusing on the interpolation between $N=2$ distributions rather than a generalized $K$-margin barycenter. We emphasize here that this is not a simplification but (1) allows us to focus on the decision boundary between the different categories of data, and even to deepen our understanding with theoretical analysis for robustness. (2) Achieve computation efficiency by leveraging established OT algorithms when iterating between pairs of distributions, as illustrated in Fig.(\ref{fig:fig1_illstration}). Thus, our data augmentation strategy is to sample data from the worst-case adversarial Wasserstein barycenter $\{ \hat{x}_i, \hat{y}_i\} \sim \mu^{\{P_0,P_1\}}_{adv}$, which can be obtained as an inner maximization problem, \begin{equation}\small \begin{aligned} \mu^{\{P_0,P_1\}}_{adv} & := \max_{t \in [0, 1]} \mathbb{E}_{x, y \sim \mu^{\{P_0,P_1\}}_{t} } \left[ l(f_\theta(x), y) \right]. \label{eq:inner_max_da_adv_bc} \end{aligned} \end{equation} Despite a list of recent advances~\citep{villani2009optimal,korotin2022wasserstein_barycenter,fan2020scalable_barycenter}, the usage of Wasserstein barycenter may still be limited by scalability, and those solvers are more limited since we are optimizing the location of barycenters. However, thanks to the celebrated properties~\citep{brenier1991polar,mccann1997convexity}, which connects the Monge pushforward map with the coupling, we can avoid the intractable optimization over $\mu_t$ and turn to the training distribution with a transport map. \paragraph{Interpolation with OT map} When $\nu_0,\nu_1 \in \mathcal{M}(\mathcal{X})$, $\nu_1$ is absolutely continuous with respect to $\nu_0$. and let $g(t) = \{\mu_t\}_{0\leq t \leq 1}$ be the geodesic of displacement interpolation, we have a unique and deterministic interpolation $\mu_t = (T_t)\# P^0$. Thus, the transport is \begin{equation}\small \begin{aligned} T_t(x) = (1 - t) x + t T(x), \label{eq:interpoalte_func} \end{aligned} \end{equation} where convex function $T(\cdot)$ is the optimal transport map~\citep{villani2009optimal}. We can have the following map: \begin{proposition} Consider a factored map $T^{xy}:=(T^x, T^y): \mathbb{R}^d \times \mathbb{R}^y \mapsto \mathbb{R}^d \times \mathbb{R}^y$ defined as $T(\cdot,*):= (T^x(\cdot),T^y(*))$. Consequently, rewriting Eq,~\eqref{eq:inner_max_da_adv_bc} with this above map yields \begin{equation}\small \begin{aligned} \tilde{\mu}^{\{P_0,P_1\}}_{adv} := & \max_{t \in [0, 1]} \mathbb{E}_{x, y \sim P^0 } \left[ l(f_\theta(T^x_t(x)), T^y_t(y)) \right] \\ \text{where, } & T^x_t(x) =(1 -t) x+ t T^x (x), \\ & T^y_t(y) =(1 - t) y+ t T^y (y) \label{eq:adv_da_geo_interpolate} \end{aligned} \end{equation} such that the map $T^{xy}$ satisfies the Monge problem $\min_{ T^{xy}\# P^0 = P^1} \mathbb{E}_{x,y \sim P^0} [ \| \{x, y\}- T^{xy}(\{x, y\}) \|^2]$. \end{proposition} The benefits of this formulation: (1). Rather than the barycenter, the problem uses the OT map estimation where a lot of previous works have concerned efficiency~\citep{perrot2016mapping}, scalability~\citep{seguy2017large} and convergence~\citep{manole2021plugin_map_rate}. (2). The transport map can be estimated solely on data and stored regardless of the supervised learning task. Moreover, the map can project \textit{out-of-sample} points, which improves the generalization. (4). Such OT results on labeled data distributions have been shown effective~\citep{alvarez2020geometric_otdd,alvarez2021dataset_otdd_flow,fan2022generating_geodesic} in transfer learning tasks while we first investigate its distributional robustness. Also, interestingly, when ignoring the expectation and defining the map as $T^x(x^0):=x^1$, $T^y(y^0):=y^1$ , such interpolation coincides with the popular mixup~\citep{zhang2018mixup} which is simple but effective even on complicated datasets. \subsection{Implicit regularization: geodesic smoothness} Data augmentation is, in general, viewed as implicit regularization~\citep{rebuffi2021data_aug_rob_deepmind}. However, our augmentation policy also motivates an explicit regularization term to enhance the training of deep neural networks. For a given predictive function $f^*_{\theta}: \mathbb{R}^d \mapsto \mathbb{R}^y$ and a loss criterion $l(\cdot, \cdot): \mathcal{Y} \times \mathcal{Y} \mapsto \mathbb{R}$, now we consider the following \textit{performance geodesic}, \begin{equation}\small \text{R}^{\text{g}}_{f^*_\theta,l} (t) := \mathbb{E}_{x, y \sim g(t)} \left[l ( f(x), y) \right], \end{equation} to quantify the loss associated with the prediction task, where $g(t)$ is the displacement interpolation as stated before eq.(\ref{eq:interpoalte_func}). The geodesic loss $\text{R}^{\text{geo}}_{f^*_\theta}$ provides us a new lens through which we can measure, interpret, and improve a predictive model's robustness from a geometric perspective. Since the geodesic is a smooth and continuous path connecting $P^0,P^1$, The factorized geodesic interpolation $T^{xy}$ Eq.~\eqref{eq:interpoalte_func} allows us to formulate a new metric $\text{Reg}^{T^{xy}}_{l}$ that measures the change of a classifier $f^*_\theta$, under criteria $l(\cdot, \cdot)$ when gradually transporting from $P^0$ to $P^1$. { \scriptsize \begin{align}\small & \int_{0}^1 \left| \frac{d}{dt} \int_{\mathcal{X} \times \mathcal{Y}} l ( f_\theta(T^x_t(x), T^y_t(y)) d P^0(x,y) \right| dt = \int_{0}^1 \left| \frac{d}{dt} \text{R}^{T^{xy}}_{f_\theta,l}(t) \right| dt \end{align}} where $\text{R}^{T}_{f_\theta,l}(t) = \mathbb{E}_{x, y \sim P^0} \left[l( f^*_\theta(T^x_t(x)), T^y_t(y))\right]$ is the expected loss of $f^*_\theta$ at the location $t$ on the geodesic interpolation. Thus, to robustify a classifier $f_\theta$, we propose to use the following regularization, which promotes the \textit{smoothness derivative along the geodesic}. {\small \begin{align} \text{Reg}^{T}_{l}(f_\theta) := \int_{0}^1 \left| \frac{d}{dt} \text{R}^{T}_{f_\theta,l}(t) \right| dt, \text{ (geodesic regularizer) } \end{align}} \begin{proposition}[Geodesic performance as data-adaptive regularization] Consider the following minimization \begin{equation} \min_{f \in \mathcal{H}} \mathbb{E}_{x,y \sim P}[l(f(x), y)] + \frac{\lambda_1}{2} \text{Reg}^{\hat{T}}_l(f)^2 + \frac{\lambda_2}{2} \| f\|^2_{\mathcal{H}}. \nonumber \end{equation} where $\mathcal{H}$ is space of function. When the data distribution is $P:=1/2P_0 + 1/2P_1$ and $P_0=\mathcal{N}(-\mu, I), P_1=\mathcal{N}(\mu,T)$. The objective has the following form: \begin{equation} \min_\theta \mathcal{L}(\theta) := - \langle \theta, \mu \rangle + \frac{\lambda_1}{2} | \langle \theta, \mu \rangle |^2 + \frac{\lambda_2}{2} \| \theta\|^2_2 \nonumber \end{equation} The optimal solution $f$ corresponding to data assumption has the closed form $\theta^* = (\lambda_1 \mu \otimes \mu + \lambda_2 I_m)^{-1} \mu \nonumber,$ where $\otimes$ refers to the outer product. \end{proposition} The illustrative result above indicates our geodesic regularizer is a \textit{data-depend regularization adjusted by the underlying data distributions}. This agrees with the recent theoretical understanding of mixup and robustness~\citep{zhang2021mix_rob_gen}. In addition, existing robustness criteria (empirical and certified robustness) focus on the local area of individual samples within a perturbation ball $ \mathcal{S} = \{\delta: \| \delta \|_\infty \leq \epsilon, \epsilon > 0 \}$ without considering the robustness behavior of $f_\theta$ while transitioning from $P^0_{x,y}$ to $P^1_{x,y}$. The interpolation provides a new perspective for robustness, as shown in Fig.(\ref{fig:geodesic}). \subsection{Computation and implementation} \paragraph{OT map estimation} Our formulation allows us to leverage off-the-shelf OT map estimation approaches. Despite recent scalable and efficient solutions that solve the Monge problem ~\citep{seguy2017large}, withGAN~\citep{arjovsky2017wasserstein}, ICNN~\citep{makkuva2020optimal_icnn}, flow~\citep{huang2020convex_ot_flow,makkuva2020optimal_icnn,fan2021scalable_map}, and so on~\citep{korotin2022neuralot,bunne2022supervised_monge_map}. As the first step, in this work, we refer to barycentric projection~\citep{ambrosio2005gradient_bc_proj} thanks to its flexibility~\citep{perrot2016mapping} and recent convergence understandings~\citep{manole2021plugin_map_rate,pooladian2021entropic_map_rate}. Specifically, we are not given access to the probability distributions $P^0$ and $P^1$, but only samples $\{(x^0_i, y^0_i) \}_{i=1}^n \sim P^0_{xy}$ and $\{(x^1_i, y^1_i) \}_{i=1}^n \sim P^1_{xy}$. When an optimal map $T_0 \in \{T: \mathcal{X} \times \mathcal{Y} \mapsto \mathcal{X} \times \mathcal{Y}| T\#P^0 = P^1 \}$ exists, we want an estimator $\hat{T}_n$ with empirical distributions $\hat{P}^0_{xy,n}$ and $\hat{P}^1_{xy,n}$. This problem is usually regarded as the two-sample estimation problem ~\citep{manole2021plugin_map_rate}. It was shown in Section 6.2 of \citep{pooladian2021entropic_map_rate} that an entropy-regularised map (given by $\hat{T}_{\epsilon,{n}}$) for empirical distributions can approximate the population transportation map efficiently. From the computation perspective, $T_{\epsilon,n}$ can be realized through the entropically optimal coupling~\citep{cuturi2013sinkhorn} $\pi^*_e$ as $\hat{T}_{\epsilon,n}(X_0) = \text{diag} (\pi^* \mathbf{1}_{n_1})^{-1} \pi^*_\epsilon X_1$. Since we assume the samples are drawn i.i.d, then $\hat{T}_{\epsilon,n} (X_0) = n_0 \pi^* X_1$. At this point, we can have the geodesic interpolation computed via regularized OT as \begin{equation}\small \begin{aligned} \hat{T}^{xy}_{t}: = \begin{cases} \hat{T}^{x}_{t}(X_0) &= ( 1 - t )X_0 + t \hat{T}_{\epsilon,n} (X_0), \\ \hat{T}^{y}_{t}(Y_0) &= (1 - t) Y_0 + t Y_1 \label{eq:map_computation} \end{cases} \end{aligned} \end{equation} Since the labels $Y^i$ have a Dirac distribution within each $P_i$, we utilize the map $T^y(y^0):= y^1$. With such closed-form interpolation, we then generate samples by optimizing Eq.~\eqref{eq:adv_da_geo_interpolate} using numerical methods such as grid search. Notice that, when setting $T^x(X_0) := X_1$ then the geodesic turns into the mixup however it can not deal with the case where we have different numbers of samples $n_0 \neq n_1$. \paragraph{Regularization} With the aforementioned parameterization, we thus have the following expression for the smoothness regularizer $\text{Reg}^{T}_{l}(f_\theta)$. \begin{equation}\small \begin{aligned} \text{Reg}^{\hat{T}}_{l}(f_\theta) = \int_0^1 \left| \frac{d}{dt} \text{R}^{T^{xy}}_{f_\theta,l}(t) \right| dt {\text{, {} where {} }} \frac{d}{dt} \text{R}^{T^{xy}}_{f_\theta,l}(t) = \int \frac{dL}{d \tilde{y}} \nabla f_\theta ((1-t)x + t \hat{T}_{\epsilon,n} (x) )(\hat{T}_{\epsilon,n} (x) - x) d P^0(x,y) \\ \end{aligned} \end{equation} where $\tilde{y} = f_\theta((1-t)x + t\hat{T}(x))$ is the predicted target, $L=l(\tilde{y}, \hat{T}^y_t(y))$ measures the loss with regard to the interpolated target. This regularizer can be easily computed with the Jacobian of $f_\theta$ on mixup samples. In fact, we regularize the inner product of the expected loss, the Jacobian on interpolating samples, and the difference of $\hat{T}_{\epsilon,n}(x_0) - x_0$. In fact, Jacobian regularizer has already been shown to improve adversarial robustness~\citep{hoffman2019robust_jacob_adv} \paragraph{Manifold and feature space} The proposed data augmentation and regularization paradigms using the OT formulation have nice properties when data lie in a Euclidean space. However, the real data may lie on a complex manifold. In such a scenario, we can use an embedding network $\phi: \mathcal{X} \mapsto \mathcal{Z}$ that projects it to a low-dimensional Euclidean space $Z \in \mathbb{R}^z$ and a decoder network $\psi: \mathcal{Z} \mapsto \mathcal{X}$. Similarly, data augmentation may be carried out via \begin{equation}\small \begin{aligned} \tilde{\mu}^{\{P_0,P_1\}}_{adv} = & \max_{t \in [0, 1]} \mathbb{E}_{x, y \sim P^0 } \left[ l(f_\theta( \psi( T^x_t(\phi(x) ))), T^y_t(y)) \right]. \end{aligned} \end{equation} Also, regularize the geodesic on the manifold \begin{equation}\small \begin{aligned} &\text{Reg}^{\hat{T}}_{l}(f_\theta) = \int_0^1 \left| \frac{d}{dt} \text{R}^{T^{xy}}_{f_\theta,l}(t) \right| dt {\text{, {} where }} \frac{d}{dt} \text{R}^{T^{xy}}_{f_\theta,l}(t) \\ &= \frac{1}{n} \frac{dL}{d \tilde{y}} \nabla f_\theta ((1-t) \phi(X_0) + t n \pi^*_\epsilon \phi(X_1))(n \pi^*_\epsilon \phi(X_1) - \phi(X_0)). \end{aligned} \end{equation} In fact, such a method has shown effectiveness in Manifold Mixup~\citep{verma2019manifold} since a well-trained embedding helps create semantically meaningful samples than mixing pixels, even on a Euclidean distance that mimics Wasserstein distance~\citep{courty2017learning_W_embedding}. Recent advances in representation learning~\citep{radford2021learning_CLIP} also facilitate this idea. In this work, we also adopt Variational Autoencoder (VAE)~\citep{kingma2013_vae} and pre-traiend ResNets to obtain the embedding space. \paragraph{Scalability and batch OT} To handle large-scale datasets, we follow the concept of minibatch optimal transport~\citep{fatras2021minibatch_OT,khai2022improving_batch_OT} where we sample a batch of $b_n$ samples from only two classes during the data augmentation procedure. Whereas minibatch OT could lead to non-optimal couplings, our experimental results have demonstrated that our data augmentation is still satisfactory. \begin{algorithm}[H] \centering \caption{The data augmentation algorithm}\label{alg:algorithm} \begin{algorithmic}[1] \FOR{ a batch of mixture data} \STATE We only sample from two classes. $\{ X_{s,i}, y_{s,i}\}_{i=1}^{n_s}$, and $\{ X_{t,j}, y_{t,j}\}_{j=1}^{n_t}$. \STATE Map data to manifold $Z_s = \phi_{rep}(X_s)$, $Z_t = \phi_{rep}(X_t)$. \STATE \textbf{\# Obtain the worst-case Wasserstein barycenters} \STATE Empirical distributions $\hat{\nu}_s = \sum_{i=1}^{n_s} p_{s,i} \delta_{Z_s}$, $\hat{\nu}_t = \sum_{j=1}^{n_t} p_{t,j} \delta_{Z_y}$. \STATE Sample a list of $\{ t_i\} \sim U[0, 1]$ for Monte-Carlo estimation \FOR{ each $t_i$} \STATE \textbf{\# Get transported samples via \eqref{eq:map_computation}.} \STATE Get the pushforward measures on the geodesic $\mu_{t_i} = (T_{t_i})\# \hat{\nu}_s$, \STATE Map to data space $\hat{X} = \phi^{-1}(\hat{Z}_s)$, where $\hat{Z}_s \sim \mu_{t_i}$. \STATE Prediction on the geodesic $\Tilde{y} = f(\hat{T}^x_{t_i} (\hat{X}))$, Compute the loss $L=l(\tilde{y}, \hat{T}^y_t(y))$. \ENDFOR \STATE Store the worst-case data $\hat{X}_{t_i}$ of this batch. \ENDFOR \STATE \textbf{return} All the augmented data \end{algorithmic} \end{algorithm} \section{Theoretical analysis} \label{sec:theory} Here, we rigorously investigate how the interpolation along geodesics affects the decision boundary and robustness. We use the concrete and natural Gaussian model~\citep{schmidt2018adversarially} since it is theoretically tractable and, at the same time, reflects underlying properties in high-dimensional learning problems. In fact, such settings have been widely studied to support theoretical understandings in complex ML problems such as adversarial learning~\citep{carmon2019unlabeled_imp_rob,dan2020sharp_rob_gaussian}, self-supervised learning~\citep{deng2021improving_ood_data_rob_gaussian_mix}, and neural network calibration~\citep{zhang2022and_mix_cali_gaussian}. More importantly, recent advances in deep generative models such as GAN~\citep{goodfellow2020generative}, VAE~\citep{kingma2013_vae}, and diffusion model~\citep{song2019generative_score} endorse the theoretical analysis of Gaussian generative models~\citep{zhang2021mix_rob_gen} on complicated real-world data, akin to our manifold geodesic setting. \paragraph{Problem set-up} As introduced in our preliminary (Sec. \ref{sec:prelim}) and problem formulation (Sec. \ref{sec:adv_interpolate}), we consider a $2-$ classification task where all the data $S = \{ (x_1, y_1),...,(x_n, y_n)\} \sim \mathcal{P}^{all}_{x,y}$ are sampled from a joint distribution $\mathcal{P}^{all}_{x,y} = 1/2 P^0_{xy} + 1/2 P^1_{xy}$. Formally, \begin{definition}[Conditional Gaussian model] For $\mu \in \mathbb{R}^d$ and $\sigma \geq 0$, the model is defined as the distribution over $(x,y) \in \mathcal{X} \times \mathcal{Y}$, where $\mathcal{X}\subseteq \mathbb{R}^d, \mathcal{Y} :=\{ -1, 1\}$, \begin{equation}\small \begin{aligned} (x,y) \sim P^{all}_{xy} :&= p(y=-1) P^0_{xy} + p(y=1) P^1_{xy} \nonumber \end{aligned} \end{equation} where $P^0_{xy} = N(- \mu, \sigma^2 I)$, $P^1_{xy} = N(\mu, \sigma^2 I)$, and $p(y=1)=p(y=-1)=\frac{1}{2}$. \end{definition} The goal here is is to learn a classifier $f_\theta: \mathcal{X} \mapsto \mathcal{Y}$ parameterized by $\theta$ which minimizes population classification error \begin{equation}\small \begin{aligned} R_{\mu,\sigma}(f):= \mathbb{E}_{x,y \sim P^{all}_{xy}}[ \mathbb{I}(f_\theta(x) \neq y)]. \label{eq:class_err} \end{aligned} \end{equation} And such classifier is estimated from $n_0$ observed training data samples $\{x_i, y_i \}_{i=1}^{n_0} \sim P^{all}_{x,y}$. \subsection{Geodesic between Gaussian distributions} The assumption of Gaussian distribution not only provides a tractable guarantee for classification but also allows us to employ desirable conclusions for optimal transport between Gaussian distributions, thanks to established studies~\citep{dowson1982frechet_Gaussian_W_dist,givens1984class_Gaussian_W_dist,knott1984optimal_GD_map}. More specifically, although the Wasserstein distance and the transport map between regular measures rarely admit closed-form expressions, the $W_2$-Wasserstein distance between Gaussian measures can be obtained explicitly ~\citep{dowson1982frechet_Gaussian_W_dist}. Moreover, the Optimal transport map~\citep{knott1984optimal_GD_map} between two Gaussian distributions as well as the constant speed geodesics between them, termed McCann's interpolation have explicit forms~\citep{mccann1997convexity}. Please see the Appendix for more detail on this. Given explicit forms of the augmented distribution, to proceed with the theoretical analysis, we construct the following data augmentation scheme: We always consider a symmetric pair of augmented Gaussian distributions $G^g_{t}$ and $G^g_{1-t}$, $t\in [0, \frac{1}{2})$. Further, since the marginal distributions of the Gaussian model are $P^1 = N(- \mu, \sigma^2 I)$ and $P_2 = N(+ \mu, \sigma^2 I)$, we can denote the augmented data distribution as a mixture of Gaussian distributions as $P^{A(t)}_{xy}:= \frac{1}{2} G^g_{t} + \frac{1}{2} G^g_{1-t}$ with augmented samples $\tilde{x}_i, \tilde{y}_i : x|y \sim N(r y \mu, \sigma^2 I), y \sim U\{-1, 1\} $, where $ r = 1 - 2t$. \subsection{Data augmentation improves robustness, provably} Here, we demonstrate that the data augmentation obtained via Wasserstein geodesic perturbation provably improves the robust accuracy probability. In this work, we consider the $\ell_p$ norm ball with $p=\infty$. Specifically, we apply a bounded worst-case perturbation before feeding the sample to the classifier. Then, we recap the definition of the standard classification and robust classification error. \begin{definition}[Standard, robust, and smoothed classification error probability~\citep{schmidt2018adversarially,carmon2019unlabeled_imp_rob}] ~\label{definition:classification_error_prob} Let the original data distribution be $P_{X,Y}$. The standard error probability for classifier $f_\theta : \mathbb{R}^d \mapsto \mathcal{Y}$ is defined is $\mathbb{PE}_a(f_\theta) = P_{(x, y) \sim P_{X,Y}}( f_\theta (x) \neq y)$. The robust classification error probability is defined as $\mathbb{PE}^{p, \epsilon}_a(f_\theta) = P_{(x, y) \sim P_{X,Y}}(\exists u' \in \mathcal{B}^p_\epsilon(x), f_\theta (u') \neq y)$, where the perturbations in a $\ell_p$ norm ball $\mathcal{B}^p_\epsilon(x):= \{ x' \in \mathcal{X} | \|x' - x \| \leq \epsilon \}$ of radius $\epsilon$ around the input. The smoothed classification error for certifiable robustness is defined as $\mathbb{PE}^{\sigma_s}_a(f_\theta) = P_{(x, y) \sim P_{X,Y}, \delta \sim N(0, \sigma_s^2 I )}( f_\theta (x + \delta) \neq y)$. \end{definition} \paragraph{Remark:} In this setting, standard, robust, and smoothed accuracies are aligned~\citep{carmon2019unlabeled_imp_rob}. In other words, a highly robust standard classifier will (1) also be robust to $\ell_\infty$ perturbation and (2) will be a robust base classifier for certifiable robustness, as randomized smoothing is a \textit{Weierstrauss transform} of the deterministic base classifier. The following result provides a bound for the robust error in such a case compared to using the original data alone. \begin{theorem} \label{theorem:Data_aug_Gaussian} Suppose the original data $\{ {X}_i, {Y}_i, \}_{i=1}^{{n_0}}$ are iid with distribution satisfying $X|Y=y \sim N(y\mu, \sigma^2 I)$, $Y\sim U\{-1,1\}$. Additionally our $n_1 = m_a n_0$ augmented data $\{ \Tilde{X}_i, \Tilde{Y}_i\}_{i=1}^{n_1}$ are iid and independent of the original data and satisfies $X|Y=y \sim N (y r\mu, \sigma^2 I)$, $Y\sim U\{-1,1\}$ where $r \in [0, 1]$, are the Wasserstein geodesic interpolation. Then for $\epsilon>0$, for all $n_1>N_1$ with $N_1$ (depending on $t$) satisfying $tN_1 +n_0 >\sqrt{N_1} \log(N_1)$ and $\sqrt{n_0} (r+n_0)/(\sqrt{N_1}\sigma)\leq \log{N_1}$, then we have \begin{equation}\small \mathbb{PE}^{p, \epsilon}_a(f_{\hat{\theta}_{n_0}}) \geq \mathbb{PE}^{p, \epsilon}_a(f_{\hat{\theta}_{n_0,n_1}}), \end{equation} \vspace{-10pt} \begin{equation}\small w.p. \geq P_{X\sim N(0, I_d)} (\|X\| \leq \log(n_1)/\sigma) \times P_{X\sim N(0, I_d)}( A \cap B ), \end{equation} where $\scriptsize{ A= \{X: \sqrt{n_0} (r+n_0)/(\sqrt{n_1}\sigma) \leq \|X\| \leq \log{n_1} \}}, $ $\scriptsize{B=\{X:\mu^TX/\|X\| \leq \sqrt{\|\mu\|^2-\{n_0 (r+n_0)^2/({n_1}\sigma^2)}\},}$ and $\small{\hat{{\theta}}_{n_0,n_1}={(\sum_{i=1}^{n_0}Y_i X_i + \sum_{i=1}^{n_1}\tilde{Y}_i \tilde{X}_i )} / {n_0 + n_1},}$ $\small{\hat{{\theta}}_{n_0}={\left(\sum_{i=1}^{n_0}Y_i X_i \right)} / {n_0 }}$. $f_{\theta}(x)$ defined as $sign(x^T\theta)$. \end{theorem} Note that in the above theorem $P_{X\sim N(0, I_d)} (\|X\| \leq \log(n_1)/\sigma) \to 1$ as $n_1 \to \infty$. Moreover, $P(A)$ and $P(B) \to 1$ as well with $n \to \infty$. The proof is shown in the Appendix. \paragraph{Remark:} From the above theory, we can see that the robustness from data augmentation will increase when we have a larger $r$ and sample size. This explains the property of interpolation-based methods where the samples from vicinal distributions are desired. Actually, the effect of sample size can be observed in the following experiments (figure (\ref{fig:ablation})). \section{Experiments and Discussion}\label{sec:exp} We evaluate our proposed method in terms of both empirical robustness and certified robustness~\citep{cohen2019certified_cert_rob} on the MNIST \citep{LeCun1998GradientbasedLA}, CIFAR-10 and CIFAR-100~\citep{Krizhevsky2009LearningML} dataset, and samples from ImageNet($64\times64$) dataset~\citep{deng2009imagenet,le2015tiny_imagenet}. Typically, we use data augmentation to double the size of the training set $m_a = 1$ at first and use the regularization with a fixed weight $\alpha_{reg}=5.0$ during the training, as implicit data augmentation. For the MNIST samples, we train a LeNet~\citep{LeCun1998GradientbasedLA} classifier with a learning rate $lr=0.01$ for $90$ epochs. For the CIFAR dataset, we use the ResNet110~\citep{He2016DeepRL} for the certifiable task on CIFAR10 and PreactResNet18 on CIFAR-100. The Sinkhorn entropic coefficient is chosen to be $\epsilon=0.01$. We use VAE with different latent dimensions as embedding, where details can be found in the appendix. The experiments are carried out on several NVIDIA RTX A6000 GPUs and two NVIDIA GeForce RTX 3090 GPUs. \begin{figure}[tb] \minipage{0.4\textwidth} \includegraphics[width=0.9\linewidth]{figs/geodesic/performance_geodesic.png} \caption{ The \textit{performance geodesic} $\text{R}^{\text{g}}_{f,l} (t)$ of classifiers obtained from different training strategies. } \label{fig:geodesic} \endminipage\hfill \minipage{0.58\textwidth} \begin{adjustbox}{width=0.99\linewidth} \input{tables/PGD} \end{adjustbox} \vspace{-10pt} \captionof{table}{Adversarial robustness (MNIST), ours:DA $+$ Reg } \label{table:pgd} \begin{adjustbox}{width=0.99\linewidth} \input{tables/tiny_image_net} \end{adjustbox} \vspace{-10pt} \captionof{table}{$\ell_\infty$ Standard and adversarial robust accuracy on ImageNet $(64\times64)$ with baselines } \label{table:imagenet} \begin{adjustbox}{width=0.99\linewidth} \input{tables/cifar100.tex} \end{adjustbox} \vspace{-10pt} \captionof{table}{$\ell_\infty$ Standard and adversarial robust accuracy on CIFAR-100 dataset with baselines } \label{table:cifar100} \endminipage\hfill \end{figure} \paragraph{Empirical robustness} We use the strongest PGD method to perform $\ell_\infty$ attack with $\epsilon = 2.0$ and $4$ steps. As shown in table (\ref{table:pgd}), either data augmentation and regularization can improve the $\ell_\infty$ robustness. Moreover, our method can further improve gradient-based adversarial training. In fig.(\ref{fig:geodesic}), we visualize the \textit{performance geodesic} of various training strategies where more robust models apparently have mode smoother geodesic. Here \textit{ERM} stands for normal training, \textit{$+$reg} is using geodesic regularization, \textit{$+$da} means using data augmentation, \textit{adv} denotes adversarial training with PGD. For empirical robustness on CIFAT-100 and ImageNet($64\times64$), we follow training protocol from ~\citep{kim2020_puzzlemix} and compare our method with ERM, vanilla mixup~\citep{zhang2018mixup}, Manifold mixup~\citep{verma2019manifold}, CutMix~\citep{yun2019cutmix}, AugMix~\citep{hendrycks2019_augmix}, and PuzzleMix~\citep{kim2020_puzzlemix}. To enable a fair comparison, we reproduce only the non-adversarial PuzzleMix methods. For ImageNet($64\times64$), it contains 200 classes with $64\times64$ resolution\citep{chrabaszcz2017downsampled_tiny_imagenet}. As in table (\ref{table:imagenet}), our approach outperforms the best baseline by $16.8\%$ under ($\epsilon=4/255$) FGSM attack. For CIFAR-100, as in table (\ref{table:cifar100}), we exceed baseline by $22.4\%$ under FGSM, while having comparable performance in standard accuracy. It may be caused by our data augmentation populating samples only on the local decision boundaries. \begin{figure}[t] \centering \includegraphics[width=0.65\linewidth]{figs/ablation_aistats.png} \caption{Comparison of approximate certified accuracy with different parameters, including (a) augmentation batch size $b_n$, and (b) magnificent coefficient $m_a$.} \label{fig:ablation} \end{figure} \paragraph{$\ell_2$ Certifiable robustness}We compare the performance with Gaussian \citep{cohen2019certified_cert_rob}, Stability training \citep{li2018certified_renyi}, SmoothAdv \citep{salman2019provably}, MACER \citep{Zhai2020MACER}, Consistency \citep{jeong2020consistency}, and SmoothMix \citep{jeong2021smoothmix}. We follow the same evaluation protocol proposed by \citep{cohen2019certified_cert_rob} and used by previous works~\citep{salman2019provably,Zhai2020MACER,jeong2020consistency}, which is a Monte Carlo-based certification procedure, calculating the prediction and a "safe" lower bound of radius over the randomness of $n$ samples with probability at least $1-\alpha$, or abstaining the certification. We consider three different models as varying the noise level $\sigma \in \{0.25, 0.5, 1.0 \}$. During inference, we apply randomized smoothing with the same $\sigma$ used in training. The parameters in the evaluation protocol \citep{cohen2019certified_cert_rob} are set as: $n=100,000$, $n_0 = 100$, and $\alpha = 0.001$, with previous work \citep{cohen2019certified_cert_rob,jeong2020consistency}. \begin{table}[tp]\small \centering \caption{Certified accuracy on CIFAR-10 dataset. } \vspace{-0.03in} \begin{adjustbox}{width=0.9\linewidth} \input{tables/cifar10} \end{adjustbox} \label{table:cifar10} \end{table} For the CIFAR-10 dataset, Table~\ref{table:cifar10} showed that our method generally exhibited better certified robustness compared to other baselines, i.e., SmoothAdv \citep{salman2019provably}, MACER \citep{Zhai2020MACER}, Consistency \citep{jeong2020consistency}, and SmmothMix \citep{jeong2021smoothmix}. The important characteristic of our method is the robustness under larger noise levels. Our method achieved the highest certified test accuracy among all the noise levels when the radii are large, i.e., radii 0.25-0.75 under noise level $\sigma=0.25$, radii 0.50-1.75 under noise level $\sigma=0.50$, and radii 0.50-2.75 under noise level $\sigma=1.00$. We obtained the new state-of-the-art certified robustness performance under large radii. As shown in Table~\ref{table:cifar10}, we find that by combing our data augmentation mechanism, the performance of previous SOTA methods can be even better, which demonstrates our method can be easily used as an add-on mechanism for other algorithms to improve robustness. \paragraph{Ablation study} Here, we conducted detailed ablation studies to investigate the effectiveness of each component. We performed experiments on MNIST with $\sigma=1.0$, and the results are shown in Figure~\ref{fig:ablation}. (More results are shown in the Appendix.) We investigated the influence by the augmentation batch size $b_n$ (Figure~\ref{fig:ablation}(a)) following the batch optimal transport setting. Also, we studied data augmentation sample size $m_a$ (Figure~\ref{fig:ablation}(b)). We found that a larger augmentation batch size $b_n$ leads to better performance, which is expected since it better approximates the joint measure. In addition, more augmented data samples $m_a$ benefit robustness, which agrees with our theoretical results. \section{Conclusion and Future Work} {\color{red}} In this paper, we proposed to characterize the robustness of a model through its performance on the Wasserstein geodesic connecting different training data distributions. The worst-case distributions on the geodesic allow us to create augmented data for training a more robust model. Further, we can regularize the smoothness of a classifier to promote robustness. We provided theoretical guarantees and carried out extensive experimental studies on multiple datasets, including CIFAR100 and ImageNet. Our results showed new SOTA performance compared with existing methods and can be easily combined with other learning schemes to boost the robustness. As a first step, this work provides a new perspective to characterize the model's robustness. There could be several future works, including considering multi-marginal adversarial Wasserstein barycenter on a simplex, more efficient optimization on the geodesic, and more thorough theoretical studies beyond Gaussian models.
\section{Introduction} Collaborative filtering (CF) is one of the most popular techniques in recommender systems, which predicts the interaction possibility between users and items through interaction history~\cite{Herlocker,Sarwar,sarwar2000application,Koren09,he2017neural,LightGCN}. Recently, graph signal processing (GSP) has been applied in CF tasks~\cite{Narang13a, Narang13b, LSB, VM, Diffusion, GFCF}, which can transform the interaction signals from spatial domain to spectral domain through Graph Fourier Transform (GFT) to capture the structure information of the whole similarity graph. Generally, GSP-based CF methods first construct a similarity graph between items, then use a low-pass filter defined on the similarity graph to smooth the users' interaction signals to obtain the prediction signals. Several recent studies~\cite{Huang18, Revisit, GFCF} show that these methods are related to both neighborhood-based CF methods~\cite{Herlocker,Sarwar} and GCN-based CF methods~\cite{LightGCN}. Existing GSP-based CF methods rely on the following two assumptions: 1) a user's personalized preference is completely characterized by his/her interaction history and 2) the low-frequency information in the interaction signal is enough to predict user preferences. However, due to data sparsity issues in many recommender systems, sparse historical interactions may not be enough to accurately describe user preferences. Besides, only using low-frequency information containing common user interests may not be personalized enough due to neglecting the useful high-frequency information containing unique user interests. In this paper, we propose the {\em personalized graph signal}, a signal with richer user information, to describe users more accurately. Instead of only using the interaction information of users, the personalized graph signals use both the similarity information between users-items and the similarity information between users-users to describe users. Moreover, we construct an \textit{augmented similarity graph} to utilize the signals more effectively. The augmented similarity graph contains not only the similarity information between items-items, but also the similarity information between users-items and the similarity information between users-users. With the personalized graph signal and the augmented similarity graph, users who are similar to the target user can amplify the signals of the items they have interacted with, which often contain the potential interests of the target user. We construct the similarity relationship from the perspective of random walk, which shares some of the motivations in Node2Vec~\cite{Node2Vec}. In the real world, the observed interaction signal of each user is a mixture of the real preference signal dominated by low-frequency information and the noise signal dominated by high-frequency information. Specifically, the real preferences of each user are composed of globally smooth signals that reflect the general user preferences and locally smooth but globally rough signal that reflects the personalized user preferences. In order to obtain these two kinds of signals, we propose a \textit{mixed-frequency graph filter}, which is a combination of an ideal low-pass filter that smooths signals globally and a linear low-pass filter that smooths signals locally. By controlling the proportion of the two signals, we can obtain more accurate recommendation results than using only an ideal low-pass graph filter. Finally, we propose the \textit{personalized graph signal processing} (PGSP) method by designing a pipeline to combine the personalized graph signal, the augmented similarity graph and the mixed-frequency graph filter to achieve higher accuracy. PGSP consists of three key steps: {\em 1) pre-processing}, in which we construct the personalized graph signal by concatenating user similarity information with user-item interaction signal; {\em 2) graph convolution}, in which we use the proposed mixed frequency graph filter to obtain both globally smooth signals and locally smooth but globally rough signals and {\em 3) post-processing}, in which we recover the predicted interaction signal. Extensive experiments show that PGSP has superior performance in prediction accuracy. Meanwhile, we analyze the role of the mixed-frequency graph filter and show that, as a nonparametric method, PGSP has very high training efficiency. The main contributions of this work are summarized as follows: \begin{itemize} \item We propose the personalized graph signal and the augmented similarity graph for GSP-based CF, which can characterize user interests more effectively and realize more personalized recommendations. \item We reveal the effectiveness of high-frequency components in the observed signal, and find that controlling the ratio of globally smooth signal to locally smooth signal by the proposed mixed-frequency graph filter can further improve the accuracy. \item We propose the personalized graph signal processing (PGSP) method by combining the personalized graph signal, the augmented similarity graph and mixed-frequency graph filters. Experiments show that PGSP can achieve higher accuracy compared with state-of-the-art CF methods. \end{itemize} \section{Related Work} GSP aims to develop tools for processing data defined on irregular graph domains, including sampling, filtering and graph learning~\cite{Chung97,GSP}. Next, we briefly summarize GSP-based CF works. Most GSP-based methods treat the CF problem as graph signal reconstruction~\cite{chen2021scalable}. ~\citet{Narang13a} obtain the interpolated signal by projecting the input signal into the appropriate bandlimited graph signal space. Then, ~\citet{Narang13b} extend the previous work to an iterative method, which has higher computational efficiency and takes into account the reconstruction error relative to the known signals. ~\citet{LSB} reconstruct the graph signal by reweighting the sampled residuals for different vertices or propagating the sampled residuals in their respective local sets. ~\citet{VM} formulate graph signal recovery as an optimization problem and provide a general solution through the alternating direction methods of multipliers. ~\citet{Diffusion} interpret the smoothing of the signal by low-pass filtering operation as the diffusion of temperature and prove that the diffused signals are stable to perturbations in the underlying network. Some CF methods introduced GSP into neural networks. SpectralCF~\cite{SpectralCF} constructs a deep model for learning in the spectral domain, which uses rich connection information to alleviate the cold start problem. ~\citet{FP} extend SpectralCF by directly mining the association rules between the target user and the target item through FP-Growth~\cite{Han2000}, and then solve the problems of cold start and data sparsity. AGE~\cite{AGE} proposes an attributed graph embedding framework, which consists of a carefully-designed Laplacian smoothing filter and an adaptive encoder. ~\citet{Yu20} propose a low-pass graph filter to remove the noise and reduce the complexity of graph convolution in an unscathed way. AGCN~\cite{AGCN} further reduces complexity with Chebyshev polynomial graph filters. Recently, some works have shown that there are close relationships between GSP-based CF methods and other CF methods~\cite{liu2022parameter,xia2022fire}. ~\citet{Huang18} demonstrate that neighborhood-based methods can be modeled as a specific band-stop graph filter and low-rank matrix completion can be viewed as band-limited interpolation algorithms. ~\citet{Revisit} find that graph neural networks only perform low-pass filtering on feature vectors and do not have the non-linear manifold learning property, which means that the graph structure only provides a means to denoise the data. ~\citet{Simplify} reduce the complexity of GCN through successively removing nonlinearities and collapsing weight matrices between consecutive layers, and show that the resulting linear model corresponds to a fixed low-pass filter. GF-CF~\cite{GFCF} develops a unified graph convolution-based framework for CF and proves that many existing CF methods are special cases of the framework which correspond to different low-pass filters in GSP. \section{Preliminaries} This section introduces the background knowledge of GSP and the motivation for using GSP in CF tasks. \subsection{Graph Signal Processing} Given a graph $\mathcal{G}=\{\mathcal{V},\mathcal{E}\}$, where $\mathcal{V}=\{v_1, v_2,...,v_n\}$ is the vertex set with $n$ nodes, $\mathcal{E}$ is the edge set. The topology structure of graph $\mathcal{G}$ can be denoted by a weighted adjacency matrix $W=\{w_{ij}\}\in\mathbb{R}^{n\times n}$, where $w_{ij}>0$ if $(v_i,v_j)\in \mathcal{E}$, indicating the similarity between $v_i$ and $v_j$, otherwise $w_{ij}=0$. $D=diag(d_1,d_2,...,d_n)\in\mathbb{R}^{n\times n}$ denotes the degree matrix of $W$, where $d_i=\sum_{v_j\in\mathcal{V}}w_{ij}$ is the degree of node $v_i$. The graph Laplacian matrix is defined as $L=D-W$. The signal on the node $v_i$ is defined as a mapping $x_i:\mathcal{V}\rightarrow\mathbb{R}$. We can take $\pmb{x}\in\mathbb{R}^n$ as a graph signal where each node is assigned with a scalar. The energy of the graph signal is defined as $E(\pmb{x})=||\pmb{x}||^2$. The smoothness of the graph signal can be measured by the total variation as follows: \begin{displaymath} \textstyle TV(\pmb{x})=\pmb{x}^TL\pmb{x}=\sum_{(v_i,v_j)\in \mathcal{E}}w_{ij}(x_i-x_j)^2. \end{displaymath} The normalized total variation of $\pmb{x}$ can be calculated with the Rayleigh quotient as follows: \begin{displaymath} Ray(\pmb{x})=\frac{TV(\pmb{x})}{E(\pmb{x})}=\frac{\pmb{x}^TL\pmb{x}}{\pmb{x}^T\pmb{x}}=\frac{\sum_{(v_i,v_j)\in \mathcal{E}}w_{ij}(x_i-x_j)^2}{\sum_{v_i\in \mathcal{V}}x_i^2}. \end{displaymath} As $L$ is real and symmetric, its eigendecomposition is given by $L=U\Lambda U^T$ where $\Lambda=diag(\lambda_1,\lambda_2,...,\lambda_n),\lambda_1\le \lambda_2\le...\le \lambda_n$, and $U=(\pmb{u}_1,\pmb{u}_2,...,\pmb{u}_n)$ with $\pmb{u}_i\in\mathbb{R}^{n}$ being the eigenvector for eigenvalue $\lambda_i$. We call $\tilde{\pmb{x}}=U^T\pmb{x}$ as the graph Fourier transform of the graph signal $\pmb{x}$ and its inverse transform is given by $\pmb{x}=U\tilde{\pmb{x}}$. GFT transfers the graph signal from the spatial domain to the spectral domain. Rayleigh quotient can be transformed into the spectral domain as follows: \begin{equation} \label{eq.Ray} Ray(\pmb{x})=\frac{\pmb{x}^TL\pmb{x}}{\pmb{x}^T\pmb{x}}=\frac{\pmb{x}^TU\Lambda U^T\pmb{x}}{\pmb{x}^TUU^T\pmb{x}}=\frac{\tilde{\pmb{x}}^T\Lambda \tilde{\pmb{x}}}{\tilde{\pmb{x}}^T\tilde{\pmb{x}}}=\frac{\sum_{v_i\in \mathcal{V}}\lambda_i\tilde{x}^2_i}{\sum_{v_i\in \mathcal{V}}\tilde{x}^2_i}. \end{equation} The graph filter $\mathcal{H}$ is defined as: \begin{equation} \label{eq.filter} \mathcal{H}=Udiag(h(\lambda_1),h(\lambda_2)...,h(\lambda_n))U^T, \end{equation} where $h(\cdot)$ is the frequency response function. The graph convolution of an input signal $\pmb{x}$ and the filter $\mathcal{H}$ is defined as follows: \begin{displaymath} \pmb{y}=\mathcal{H}\pmb{x}=Udiag(h(\lambda_1),h(\lambda_2)...,h(\lambda_n))U^T\pmb{x}. \end{displaymath} In summary, the original graph signal $\pmb{x}$ is first transformed into Fourier space by Fourier basis $U^T$, then the spectral domain signal is processed by filter $h(\cdot)$, and finally inversely transformed into spatial domain by $U$. \subsection{Motivation of Using GSP in CF} \label{sec:motivation} CF tasks aim to predict the real preference matrix according to the observed interaction matrix. If we have constructed the correct similarity matrix between items and the input signal is a user's real preference signal which indicates the user's preference for each item, the total variation of the graph signal can be discussed in two cases: 1) if two items $i$ and $j$ $(i\not=j)$ are similar, i.e., $w_{ij}$ is large, the user's preferences for these two items will be similar, which means that $(x_i-x_j)^2$ should be small. This situation will not lead to excessive $TV(\pmb{x})$; 2) if two items $i$ and $j$ $(i\not=j)$ are dissimilar, i.e., $w_{ij}$ is small, the user often has different preferences for the two items, which means that $(x_i-x_j)^2$ should be large. This also does not cause $TV(\pmb{x})$ to be too large because their similarity $w_{ij}$ is small. In conclusion, if the real preference signal is used as input, the total variation should be small. However, due to the exposure noise and quantization noise in the observed interaction matrix \cite{Yu20}, the total variation becomes larger when the input signal is the observed user interaction signal. Fig. \ref{Fig.noise.1} shows the real preference matrix, each row of which is a user's preference signal. Exposure noise means that users can not encounter all items, but only a subset of them. These items that are not exposed to users may or may not be liked by the users. Fig. \ref{Fig.noise.2} shows the observed change in the user preference matrix due to exposure noise. Users will choose whether to interact with the items exposed to them based on their preferences. Finally, our observed user-item ratings are binary variables, which are no longer the real preference values, due to quantization noise. Fig. \ref{Fig.noise.3} shows the change of user preference matrix observed by us due to quantization noise, that is, the final observed interaction matrix. \begin{figure} \centering \subfigure[Real preference matrix]{ \label{Fig.noise.1} \includegraphics[width=0.3\linewidth]{1.png} } \subfigure[With exposure noise]{ \label{Fig.noise.2} \includegraphics[width=0.3\linewidth]{2.png} } \subfigure[With quantization noise]{ \label{Fig.noise.3} \includegraphics[width=0.3\linewidth]{3.png} } \caption{Relationship between the real preference matrix and observed preference matrix by considering noises.} \label{fig:three} \end{figure} From the perspective of the spectral domain, the real preference signal is a low-frequency signal, and the two kinds of noise are high-frequency signals. The observed interaction signal is the fusion of low-frequency signal and high-frequency signal. We can effectively solve the CF problem by graph convolution, the key of which is to design a graph filter determined by the frequency response function. For Eq. (\ref{eq.Ray}), take $\pmb{x}=\pmb{u}_i$, we can get $Ray(\pmb{u}_i)=\lambda_i$, indicating that the eigenvector corresponding to the small eigenvalue is smoother, and this smoothing is smooth in the sense of the whole graph, e.g., globally smooth. When restoring the spectral domain signal to the spatial domain, if only the smoother eigenvectors are used as the basis vectors, the reconstructed spatial signal will have a lower frequency in the sense of the whole graph. Fig. \ref{Fig:pre}(i) illustrates the item similarity graph used in previous works. we use $1$ to represent strong node signal, and $0$ to represent weak node signal. The input graph signal is $(1,0,0)$, which makes item $1$ have a strong node signal, as shown in Fig. \ref{Fig:pre}(ii). After graph convolution, the graph signal becomes smooth, that is, similar items have similar graph signals. This improves the signal of item $2$ and then recommends it to the user $a$, as shown in Fig. \ref{Fig:pre}(iii). However, we believe that the real user preference and these two kinds of noise can not be simply separated from the spectral domain by frequency. Specifically, globally smooth signals are dominated by general preferences which may not be enough to capture personalized preferences. Therefore, it is necessary to introduce locally smooth but globally rough signals to capture personalized preferences, which can help to improve recommendation quality. \begin{figure}[tb!] \centering \includegraphics[width=0.98\linewidth]{pre.png} \caption{The previous GSP-based CF method. The interaction signal is directly input into the similarity graph.} \vspace{-1em} \label{Fig:pre} \end{figure} \section{The PGSP Method} In this section, we propose the personalized graph signal processing (PGSP) method which consists of three key components: \begin{itemize} \item {\em Personalized Graph Signal}, which has richer user-personalized information to describe users more accurately; \item {\em Augmented Similarity Graph}, which has more graph topology information to utilize the personalized graph signals more effectively; \item {\em Mixed-Frequency Graph Filter}, which allows globally smooth signals that reflect the general user preferences and locally smooth but globally rough signals that reflect the personalized user preferences to pass through. \end{itemize} We combine the above three components and propose the {\em PGSP Pipeline}, which consists of pre-processing, graph convolution and post-processing to achieve higher accuracy. In the following discussion, we suppose that there are $m$ users and $n$ items, and their interaction matrix is $R\in\{0,1\}^{m\times n}$, where $R_{ij}=1$ indicates that user $i$ has interacted with item $j$. \subsection{Personalized Graph Signal and Augmented Similarity Graph} In this section, we first introduce how to construct the similarity matrix when only relying on the graph structure from the perspective of random walk, and then propose personalized graph signal and augmented similarity graph. \subsubsection{Construction of Similarity Graph} When only considering the graph topology, we conclude from the design of \textit{Node2Vec}~\cite{Node2Vec} that the similarity of two nodes is determined by three factors: 1) the number of paths between two nodes, 2) the length of the paths and 3) the degree of the nodes that compose each of the paths. In {random walk}, there are usually a large number of short paths between two nodes with high similarity, and the degree of the nodes composing each of the paths should not be too large (otherwise the probability of walking through each path will be low). For the CF problem with only user-item interaction information, all we have is the structure of the interaction graph, so these three factors should be taken into account as prior knowledge when constructing the similarity graph. The user-item interaction graph is a bipartite graph, which means that users are directly connected to items, and paths between two users/items must pass through intermediate items/users. Therefore, for user-user similarity, item-item similarity, and user-item similarity, we need to consider the degrees of user nodes and item nodes at the same time. The interaction matrix indicates the existence of a path with a length of 1 between a user node and an item node. The original interaction matrix $R$ can not be used to describe the similarity between users and items, because it does not consider the node degree. We take into account the degree of nodes and obtain the normalized interaction matrix, which can be used to represent the similarity between users and items as follows: \begin{equation} S_{UI}=(D_U)^{-1/2}R(D_I)^{-1/2}. \end{equation} The $D_U$ and $D_I$ are diagonal matrix, where $(D_U)_{ii}=\sum_{j=1}^nR_{ij},i=1,...,m$ and $(D_I)_{jj}=\sum_{i=1}^mR_{ij},j=1,...,n$. From the perspective of random walk, the weight of an edge completely depends on the degree of the nodes connected by the edge. The more items that a user has interacted with, the less a single item can be capable of describing the user, and the lower the similarity between the user and the items. The same is true from the perspective of an item. Based on the normalized interaction matrix, we can calculate the user-user similarity matrix and item-item similarity matrix, respectively, as follows: \begin{equation} \label{eq.SU} S_U = S_{UI}S_{UI}^T,\quad S_I=S_{UI}^TS_{UI}. \end{equation} From the perspective of random walk, the construction of $S_U$ simulates the two-step walk process of transferring from the user nodes to the item nodes (represented by $S_{UI}$) and then to the user nodes (represented by $S_{UI}^T$). More paths with a length of 2 between two user nodes and higher weights of these paths will indicate higher similarity between the two user nodes. There is a similar conclusion for the item-item similarity matrix $S_I$. We emphasize that co-occurrence relationship and cosine similarity are not suitable for calculating similarity in this scenario. In detail, their calculations are as follows: \begin{displaymath} \begin{aligned} S^{co}_U=RR^T,\quad S^{cos}_U=D_U^{-1/2}RR^TD_U^{-1/2}.\\ S^{co}_I=R^TR,\quad S^{cos}_I=D_I^{-1/2}R^TRD_I^{-1/2}.\\ \end{aligned} \end{displaymath} Obviously, these two methods do not fully consider the influence of node degree on random walk. \subsubsection{Construction of Personalized Graph Signal} Due to data sparsity issues in many recommender systems, sparse historical interactions may not be enough to describe user preferences accurately. For each user, in addition to the direct interactions with items, there is also a collaborative relationship with other users, which is an indirect relationship. We combine these two kinds of information to describe users more accurately. For each user, we concatenate his/her similarities with other users with his/her interaction signal to obtain the personalized graph signal as follows: \begin{equation} \label{r-tilde} \tilde{R}=S_U||R, \end{equation} where $||$ is the concatenation operation. \subsubsection{Construction of Augmented Similarity Graph} The interaction matrix is the direct embodiment of users' behaviors and describes the relationship between users and items. The similarity matrix is the compression of interaction information to describe the relationship between item-item and user-user. There are two motivations for the augmented similarity graph. Firstly, all these relationships are useful for GSP-based CF methods. Using the user-item relationship, the signals of user nodes can directly affect the signals of item nodes, and the existence of the item-item/user-user relationship makes it possible for the signals between item/user nodes to interact with each other. Secondly, the personalized graph signal is an $m+n$-dimensional vector, which requires a similarity graph that can accommodate more node signals. We construct the augmented similarity graph, which contains all the above three relationships as follows: \begin{equation} \label{eq.ASG} A=\left[ \begin{matrix} S_U & S_{UI}\\ S_{UI}^T & S_I\end{matrix} \right]. \end{equation} Overall, our method is beneficial to CF in the following aspects: 1) a more reasonable similarity matrix constructed from the perspective of random walk is used to describe the relationship of users-items, users-users and items-items, 2) a personalized graph signal with richer information is used to describe users more accurately, and 3) an augmented similarity matrix with more topological information is used to process personalized graph signals more effectively. \subsection{Mixed-Frequency Graph Filter} In this section, we propose a mixed-frequency graph filter, which can capture globally smooth signals and locally smooth but globally rough signals simultaneously. With the definition of the augmented similarity graph, we can define the corresponding Laplacian matrix $L=I-A$, where $I$ is an identity matrix. The frequency response function of the ideal low-pass filter is $h(\lambda)= 1$ if $\lambda \le \lambda_k$ and $h(\lambda)=0$ otherwise, where $\lambda_k$ is the cut-off frequency of the low-pass filter. Putting it into Eq. (\ref{eq.filter}), we can obtain the ideal low-pass filter as follows: \begin{displaymath} \mathcal{H}_{ideal} =Udiag(\overbrace{1,...,1}^k,\overbrace{0,...,0}^{m+n-k})U^T=U_kU_k^T, \end{displaymath} where $U$ is a matrix composed of the eigenvectors of $L$, $U_k$ is the first $k$ columns of $U$ corresponding to the smaller eigenvalues. This indicates that the construction of the ideal low-pass filter does not need complete eigendecomposition of the matrix, but only needs to calculate the eigenvectors corresponding to the smaller eigenvalues. \begin{figure}[tb!] \centering \includegraphics[width=0.95\linewidth]{smooth.png} \caption{The ideal low-pass filter makes the signal globally smooth, and the linear low-pass filter makes the signal locally smooth but globally rough.} \vspace{-1em} \label{Fig:smooth} \end{figure} An ideal low-pass filter only uses the low-frequency Fourier basis to reconstruct the spatial signal. Since these Fourier bases are low-frequency signals in the sense of the whole graph, it means that the signal filtered by an ideal low-pass filter is also a smooth signal in the sense of the whole graph. The left arrow in Fig. \ref{Fig:smooth} describes this global smoothing. After filtering, the node signal spreads to the whole graph. \begin{figure*}[!th] \centering \includegraphics[width=0.78\linewidth]{ours.png} \caption{The proposed PGSP method. The personalized graph signal is constructed in the pre-processing step and input into the augmented similarity graph, which promotes users' potential interests.} \label{Fig:ours} \end{figure*} However, due to the sparsity of data, the interaction signal may not have enough information to restore the complete real preference through such global smoothing. On the contrary, only using the low-frequency signals will overdraft the expressive ability of the interaction signal for the filtered signals only containing general preference information, which damages the personalized information. To solve the above problems, we implement a mixed-frequency graph filter, which is a low-pass filter. From the perspective of the spatial domain, the result of multiplication with augmented similarity matrix $A$ is neighborhood aggregation, which leads to local smoothing. The right arrow in Fig. \ref{Fig:smooth} describes this local smoothing, after filtering, the node signal only diffuses to the directly connected nodes. Theorem \ref{theorem.A} shows that $A$ is a linear low-pass filter with frequency response function $h(\lambda)=1-\lambda$, which indicates that the filtered signal is not globally smooth because it allows some high-frequency components of the signal to pass through. \begin{theorem} \label{theorem.A} The augmented similarity matrix $A$ is a low-pass filter with a frequency response function $h(\lambda)=1-\lambda$. \end{theorem} \begin{proof} First, we have: \begin{displaymath} L=U\Lambda U^T=Udiag(\lambda_1,\lambda_2,...,\lambda_{m+n})U^T, \end{displaymath} which means that $L$ is a graph filter with a frequency response function of $h(\lambda)=\lambda$. Then, we have: \begin{displaymath} L=I-A. \end{displaymath} Suppose $\pmb{u}_i$ is the eigenvector of $L$ corresponds to $\lambda_i$, the derivation is as follows: \begin{displaymath} L\pmb{u}_i=\lambda_i\pmb{u}_i=(I-A)\pmb{u}_i=\pmb{u}_i-A\pmb{u}_i. \end{displaymath} So, we have: \begin{displaymath} A\pmb{u}_i=(1-\lambda_i)\pmb{u}_i, \end{displaymath} which means that $A$ and $L$ have the same eigenvectors, and the corresponding eigenvalues have the relationship: \begin{displaymath} (\lambda_A)_i=1-\lambda_i, \end{displaymath} where $(\lambda_A)_i$ is the $i$-th largest eigenvalue of $A$. Suppose: \begin{displaymath} \Lambda_A=diag((\lambda_A)_1,(\lambda_A)_2,...,(\lambda_A)_{m+n}). \end{displaymath} So, we have: \begin{displaymath} A=U\Lambda_{A}U^T=Udiag(1-\lambda_1, 1-\lambda_2,...,1-\lambda_{m+n})U^T, \end{displaymath} which means that $A$ is a low-pass filter with a frequency response function of $h(\lambda)=1-\lambda$. \end{proof} To consider both general user preferences and personalized user preferences, we superimpose a linear low-pass filter that smooths signals locally on the basis of an ideal low-pass filter that smooths signals globally in a certain proportion as follows: \begin{equation} \mathcal{H}=(1-\phi)\mathcal{H}_{ideal}+\phi A, \end{equation} where $\phi$ is a hyperparameter that controls the ratio of the globally smooth signal to the locally smooth signal. \subsection{PGSP Pipeline} \label{section.PGSP} In this section, we present how to combine the personalized graph signal, the augmented similarity graph and the mixed-frequency graph filter by proposing a pipeline named Personalized Graph Signal Processing which consists of pre-processing, graph convolution and post-processing. 1) {\em Pre-processing step}. We first obtain the personalized interaction matrix by Eq. (\ref{r-tilde}). Then we normalize it to obtain the normalized personalized interaction matrix as follows: \begin{equation} \label{eq.r-norm} \tilde{R}_{norm}=\tilde{R} \tilde{D}^{\beta}, \end{equation} where $\tilde{D}_{jj}=\sum_{i=1}^m\tilde{R}_{ij}$ is a diagonal matrix, and $\beta\le0$ is a hyperparameter. Eq. (\ref{eq.r-norm}) means that the more users an item interacts with, the more likely it is a popular item, and the lower ability to express users' personalized preferences. 2) {\em Graph convolution step}. We use the proposed mixed-frequency graph filter to filter the normalized personalized graph signals to get the filtered personalized graph signals: \begin{equation} \hat{\tilde{R}}_{norm}=\tilde{R}_{norm} \mathcal{H}. \end{equation} 3) {\em Post-processing step}. We restore the predicted personalized interaction matrix by multiplying $\tilde{D}^{-\beta}$, then the last $n$ columns are intercepted as the predicted users' preferences matrix: \begin{equation} \hat{R}=(\hat{\tilde{R}}_{norm}\tilde{D}^{-\beta})_{:,-n:}, \end{equation} where $:,-n:$ means to take all rows and last $n$ columns of the matrix. \begin{table}\small \centering \caption{Statistics of the experimental data.} \label{table.dataset} \begin{tabular}{c|c|c|c|c} \hline \textbf{Dataset} & \textbf{\#User} & \textbf{\#Item} & \textbf{\#Interaction} & \textbf{Density} \\ \hline {\textit{Gowalla}} & 29,858 & 40,981 & 1,027,370 & 0.084\% \\ {\textit{Yelp2018}} & 31,668 & 38,048 & 1,561,406 & 0.130\% \\ {\textit{Amazon-Book}} & 52,643 & 91,599 & 2,984,108 & 0.062\% \\ \hline \end{tabular} \end{table} \begin{table*}[t]\small \centering \caption{Performance comparison to state-of-the-art CF methods in recent two years. \textit{RI} represents the relative improvement between PGSP and the corresponding method.} \label{table.result} \begin{tabular}{c|cc|cc|cc|c|cc} \hline \textbf{Dataset} & \multicolumn{2}{c|}{\textbf{Gowalla}} & \multicolumn{2}{c|}{\textbf{Yelp2018}} & \multicolumn{2}{c|}{\textbf{Amazon-book}} & \multicolumn{1}{c|}{\multirow{2}{*}{\textbf{\begin{tabular}[c]{@{}c@{}}Reported\\ by\end{tabular}}}} & \multicolumn{2}{c}{Avg RI} \\ \cline{1-7} \cline{9-10} Method & recall & ndcg & recall & ndcg & recall & ndcg & \multicolumn{1}{c|}{} & recall & ndcg \\ \hline LR-GCCF~\cite{LR-GCCF} & 0.1519 & 0.1285 & 0.0561 & 0.0343 & 0.0335 & 0.0265 & \cite{SimpleX} & 54.88\% & 71.75\% \\ ENMF~\cite{ENMF} & 0.1523 & 0.1315 & 0.0624 & 0.0515 & 0.0359 & 0.0281 & \cite{SimpleX} & 45.79\% & 47.70\% \\ NIA-GCN~\cite{NIA-GCN} & 0.1726 & 0.1358 & 0.0599 & 0.0491 & 0.0369 & 0.0287 & \cite{NIA-GCN}~\cite{NGAT4Rec} & 40.65\% & 46.80\% \\ LightGCN~\cite{LightGCN} & 0.1830 & 0.1554 & 0.0649 & 0.0530 & 0.0411 & 0.0315 & \cite{LightGCN} & 28.95\% & 32.89\% \\ DGCF~\cite{DGCF} & 0.1842 & 0.1561 & 0.0654 & 0.0534 & 0.0422 & 0.0324 & \cite{DGCF} & 26.94\% & 30.75\% \\ NGAT4Rec~\cite{NGAT4Rec} & - & - & 0.0675 & 0.0554 & 0.0457 & 0.0358 & \cite{NGAT4Rec} & 30.27\% & 34.18\% \\ SGL-ED~\cite{SGL-ED} & - & - & 0.0675 & 0.0555 & 0.0478 & 0.0379 & \cite{SGL-ED} & 26.86\% & 29.57\% \\ DGCF~\cite{DGCF_li} & 0.1891 & 0.1602 & 0.0703 & 0.0575 & 0.0476 & 0.0369 & \cite{DGCF_li} & 17.16\% & 19.95\% \\ MF-CCL~\cite{SimpleX} & 0.1837 & 0.1493 & 0.0698 & 0.0572 & 0.0559 & 0.0447 & \cite{SimpleX} & 11.01\% & 13.36\% \\ SimpleX~\cite{SimpleX} & 0.1872 & 0.1557 & 0.0701 & 0.0575 & 0.0583 & 0.0468 & \cite{SimpleX} & 8.47\% & 9.75\% \\ UltraGCN~\cite{UltraGCN} & 0.1862 & 0.1580 & 0.0683 & 0.0561 & 0.0681 & 0.0556 & \cite{UltraGCN} & 3.70\% & 3.51\% \\ GF-CF~\cite{GFCF} & 0.1849 & 0.1518 & 0.0697 & 0.0571 & 0.0710 & 0.0584 & \cite{GFCF} & 1.83\% & 2.61\% \\ \hline PGSP (ours) & \textbf{0.1916} & \textbf{0.1605} & \textbf{0.0710} & \textbf{0.0583} & \textbf{0.0712} & \textbf{0.0587} & & - & - \\ \hline \end{tabular} \end{table*} We illustrate how the PGSP method works through an example as shown in Fig. \ref{Fig:ours}. For simplicity, we use $1$ to represent a strong node signal, and $0$ to represent a weak node signal. Suppose user $a$ interacted with item $1$, user $b$ interacted with items $1$ and $2$, user $c$ interacted with item $3$, and user $a$ is the target user. There is a strong similarity between the two connected nodes. User $a$ is similar to user $b$ because they both have interacted with item $1$. Item $1$ is similar to item $2$ because they both have interacted with user $b$. We first construct an augmented similarity graph as shown in Fig. \ref{Fig:ours}(i), which includes not only the user-user similarity (the blue part) and item-item similarity (the yellow part), but also the user-item interaction information (the dashed line). In pre-processing, the original interaction signal $(1,0,0)$ (indicating that user $a$ has only interacted with item $1$) concatenates the similarity signal $(1,1,0)$ (indicating that user $a$ is similar to user $b$ and himself/herself, but dissimilar to user $c$) and becomes $(1,1,0,1,0,0)$ (user $a$'s personalized graph signal). The personalized graph signal is input into the augmented similarity graph as shown in Fig. \ref{Fig:ours}(ii). In graph convolution, with the proposed mixed-frequency graph filter, we obtain the predicted signal, which is a combination of globally smooth signals and locally smooth signals as shown in Fig. \ref{Fig:ours}(iii). In this process, on one hand, on the item-item similarity graph, the strong signal of item $1$ will be transmitted to item $2$, causing the signal of item $2$ to be strengthened. On the other hand, on the user-item similarity graph, user $b$ who is similar to user $a$ has a strong signal, which will promote the signal strength of item $2$. User $c$ who is dissimilar to user $a$ has a weak signal, which will weaken the signal strength of item $3$. Our method makes the items that users like have a higher intensity than those that users dislike. Finally, the predicted signal is $(0,1,0)$, which means that the model will recommend item $2$, which may be the potential interests of user $a$ because user $b$ who is similar to user $a$ has interacted with it, to user $a$. \subsection{Comparison with GF-CF} As a GSP-based collaborative filtering method, GF-CF~\cite{GFCF} is very similar to PGSP, and has achieved excellent results in recommendation tasks. However, GF-CF only uses user interaction signals as input signals. In addition, GF-CF classifies various collaborative filtering methods as filters with different frequency response functions, without analyzing the role of high-frequency components of observed signals. In contrast, PGSP depicts user interests more accurately through the personalized graph signal containing richer user information, and constructs an augmented similarity graph containing more graph topology information, to more effectively characterize user interests. We not only propose a mixed-frequency graph filter to introduce useful information in the high-frequency component of the observed signals by combining an ideal low-pass filter and a linear low-pass filter, but also conduct an experimental analysis on the influence of high-frequency information on recommendation accuracy. \section{Experiments} We conduct extensive experiments to evaluate our method. Specifically, we evaluate the accuracy of the PGSP method, and analyze the effects of the personalized graph signal, augmented similarity graph, and mixed-frequency graph filter. \subsection{Experimental Settings} \begin{figure*}[t!] \centering \includegraphics[width=0.985\linewidth]{high.png} \caption{Effectiveness of high-frequency signals on three datasets. The $x$-axis is $\phi$, which controls the weight of the high frequency (locally smooth but globally rough) information in the prediction signal. We can see that high-frequency signals can help to improve accuracy in all three datasets.} \label{Fig.high_work} \end{figure*} \subsubsection{Dataset} We use three public datasets to evaluate the recommendation accuracy of our proposed method, including \textit{Gowalla}, \textit{Yelp2018} and \textit{Amazon-Book}, released by the LightGCN work~\cite{LightGCN}. The statistics of the experimental data are shown in Table \ref{table.dataset}. For each dataset, we randomly select 80\% of the historical interactions of each user to constitute the training set, and treat the remaining as the test set. From the training set, we randomly select 10\% of interactions as the validation set to tune hyper-parameters. \subsubsection{Metrics} We use two popular evaluation protocols for top-N recommendation~\cite{LightGCN}: \textit{Recall@K} and \textit{NDCG@K} with $K=20$. \subsubsection{Baselines} We compare the proposed PGSP method with three types of state-of-the-art methods in recent years as follows: \begin{itemize} \item MF-based methods, whose basic idea is to represent users and items in the same latent space with latent vectors, and use dot products as the strength of interaction possible between users and items, including ENMF \cite{ENMF}, MF-CCL \cite{SimpleX} and SimpleX \cite{SimpleX}. \item GNN-based methods, whose basic idea is to embed users and items in the space by means of message transmission. Each user and item has an embedding vector, and the dot product is used to represent the interaction possibility of different users and items. Including LR-GCCF \cite{LR-GCCF}, NIA-GCN \cite{NIA-GCN}, LightGCN \cite{LightGCN}, DGCF \cite{DGCF}, NGAT4Rec \cite{NGAT4Rec}, SGL-ED \cite{SGL-ED}, UltraGCN \cite{UltraGCN} and DGCF \cite{DGCF_li}. \item GSP-based GF-CF method \cite{GFCF}, which sums up different collaborative filtering methods, including those based on the neighborhood, matrix factorization and graph neural network, into low-pass filters with different frequency response functions. \end{itemize} We only use these latest works for comparison, and the classic baselines are omitted due to space limitations. \subsection{Performance Comparison} Table \ref{table.result} reports the performance comparison results and the relative improvement on each metric. Since the datasets partition and evaluation metrics of all compared baselines are consistent with our method, we directly present the results reported in them, we can ensure that we present the optimal performance of various methods on the premise of fair comparison. The experimental setting of all baselines can be found at \url{https://openbenchmark.github.io/BARS}~\cite{zhu2022bars}. We have the following observations from the results: \begin{itemize} \item Compared with SOTA methods in recent two years, our method has a significant improvement, especially in \textit{NDCG}, which shows that our method not only optimizes the recall score, but also optimizes the ranking order. \item As a nonparametric method, PGSP is better than recently proposed parametric methods with a large margin, especially on \textit{Amazon-Book}, a sparse dataset. This should be due to sparse data in CF, in which the data-driven methods may not work well. \item Our method is superior to GF-CF, which is also based on GSP. This is because compared with GF-CF, our method uses the augmented similarity matrix and the personalized graph signal, and takes into account the role of high-frequency information and the normalized matrix. \end{itemize} \subsection{Effectiveness of High-frequency Signal} We construct different mixed-frequency graph filters by controlling $\phi$ to change the proportion of globally smooth signals that reflect general user preferences and locally smooth but globally rough signals that reflect personalized user preferences. The results are shown in Fig. \ref{Fig.high_work}. We observe that the globally smooth signal filtered only by the ideal low-pass filter ($\phi=0$) is not optimal. The accuracy can be improved by superimposing locally smooth signals filtered by the linear low-pass filter in proportion. Specifically, on \textit{Gowalla} and \textit{Yelp2018}, with the increase of locally smooth signals, the accuracy first increases and then decreases, and on \textit{Amazon-Book}, the accuracy keeps increasing with the more locally smooth signal. The density of the datasets is related to the relative performance increase obtained by adding high-frequency (locally smooth but globally rough) signals. As mentioned earlier, the expression ability of sparse interaction signals is weak, so we introduce high-frequency signals. According to this viewpoint, on more sparse datasets, we should observe higher performance improvement due to the introduction of high-frequency signals. In order to give a more convincing conclusion, we carried out a new experiment and added a dataset \textit{ML-1M}~\cite{harper2015movielens}. The density of the datasets has such a relationship: \textit{Amazon-Book} (0.062\%) < \textit{Gowalla} (0.084\%) < \textit{Yelp2018} (0.130\%) < \textit{ML-1M} (4.845\%). Meanwhile, we conducted a 5-fold cross-validation and reported the average results to avoid the deviation caused by the dataset partition. We observed that compared with using only low-frequency signals, the relative improvements brought by high-frequency signals are as follows: \textit{Amazon-Book} (81.25\%) > \textit{Gowalla} (17.89\%) > \textit{Yelp2018} (4.47\%) > \textit{ML-1M} (0.79\%), which empirically confirmed our viewpoint. Since the recommender system datasets are sparse in most realistic scenarios, we believe the introduction of high-frequency signals is important. \begin{table}\small \centering \caption{Training time comparison of three types of methods on the Gowalla dataset. In ENMF and LightGCN, we show the training time of one epoch, and they need multiple epochs during training. In PGSP and GF-CF, we show the total time required to complete model training.} \label{tab.running} \begin{tabular}{c|c|c|c|c} \hline {Method} & {PGSP} & {ENMF} & {LightGCN} & GF-CF \\ \hline {Running time} & 8m42s & 11m5s & 69m40s & 5m31s \\ {Need multiple epochs} & \xmark & \cmark & \cmark & \xmark \\ \hline \end{tabular} \end{table} \subsection{Training Time Comparison} Different from the methods based on matrix factorization (MF) and graph neural network (GNN), PGSP is a nonparametric method, which does not require parameter learning, so it can achieve very high training efficiency. We compare PGSP with MF and GNN-based CF methods, and another GSP-based method GF-CF~\cite{GFCF} in Table \ref{tab.running}. It should be noted that the methods based on MF and GNN require multiple epochs to obtain a trained model. For ENMF and LightGCN, we show the training time for only one epoch, and they need to train multiple epochs until convergence. For PGSP and GF-CF, we show the total time required to complete the model training. It can be observed that the total time required to train PGSP is even less than the time to train one epoch in MF and GNN-based CF methods, which confirms the high efficiency of PGSP. Due to the introduction of additional information, \ours requires a slightly longer running time than the pure GSP-based GF-CF method. \section{Conclusion} In this work, we further promote the performance of GSP in CF tasks. We establish the similarity relationship from the perspective of random walk. Based on the proposed similarity, a personalized graph signal with more personalized information is proposed to describe users more accurately, and an augmented similarity graph with more topology information is constructed to utilize the signal more effectively. We reveal the importance of high-frequency signals in observed signals, and construct a mixed-frequency graph filter to simultaneously use the globally smooth signal and the locally smooth signal. Finally, the effectiveness of the proposed method is analyzed through comprehensive experiments on three public datasets. \begin{acks} This work was supported by the National Natural Science Foundation of China (NSFC) under Grants 62172106 and 61932007. \end{acks} \bibliographystyle{ACM-Reference-Format}
\section{Introduction} \input{manuscript/1_intro} \section{Related Work}\label{sec:rw} \input{manuscript/2_background} \section{Problem Statement}\label{sec:problem_statement} \input{manuscript/3_setup} \section{Main Results}\label{sec:main_results} \input{manuscript/4_results} \section{Discussion}\label{sec:discussion} \input{manuscript/5_discussion} \section{Experiments}\label{sec:experiments} \input{manuscript/6_experiments} \section{Conclusion} In this work, we propose to use a well-known matrix estimation (ME) method known as singular value thresholding (SVT) to pre-process sparse, noisy data before using the data in an inference task (e.g., to train a neural network). We show that pre-processing data using SVT comes with strong individual fairness (IF) guarantees. Specifically, we derive conditions under which SVT pre-processing \emph{improves} IF. We then show that there are overlapping conditions under which SVT pre-processing has strong performance guarantees. Together, these results imply that, under the appropriate conditions, SVT pre-processing provides a way to improve IF without imposing a performance cost. We verify our results on synthetic data and the MovieLens 1M dataset. \bibliographystyle{customref} \subsection{Setup}\label{sec:setup} Consider a setting with $m$ individuals. Suppose there is an unknown ground truth matrix $A \in \bbR^{m \times n}$, where each row in $A$ corresponds to an individual such that the $i$-th row $\bA_i \in \bbR^{n}$ is an unknown $n$-dimensional feature vector that describes individual $i \in [m]$. Without loss of generality, suppose that $A_{ij} \in [-1,1]$ for all $i \in [m]$ and $j \in [n]$.\footnote{ For any $A$ whose entries are finite such that $| A_{ij} | < \infty$ for all $i \in [m]$ and $j \in [n]$, one can always translate and rescale $A$ to be between $-1$ and $1$, then adjust the final result accordingly.} Suppose that it is possible to observe a noisy subsample of $A$'s entries. Formally, let $\Omega \subset [m] \times [n]$ denote the index set of observed entries and $\cZ = [-1,1] \cup \{\emptyset\}$. Let $Z \in \cZ^{m \times n}$ denote the matrix of observations, where each entry of $Z$ is a random variable, $\bbE Z_{ij} = A_{ij}$ if $(i,j) \in \Omega$, and $Z_{ij} = \emptyset$, otherwise. As such, the $i$-th row $\bZ_i \in \cZ^{n}$ denotes the observed covariates for individual $i$. For the remainder of this work, let $\mathbf{B}_i$ denote the $i$-th row and $\mathbf{b}_i$ denote the $i$-th column of a matrix $B$. \\ \noindent \textbf{Inference task}. We consider the following inference task. Make a prediction $\by \in \cY$ for individual $i \in [m]$ using the observations (i.e., training data) $Z$. Let $\cF = \{ f : [m] \times \cZ^{m \times n} \rightarrow \cY \}$ denote the class of algorithms that perform this inference task. Note that the output of $f$ could be a deterministic value or a distribution over possible values. \subsection{Individual Fairness}\label{sec:IF} {Individual fairness} (IF) is the notion that \emph{similar individuals should receive similar treatments} \citep{dwork2012fairness}. IF is formulated as a $(D,d)$-Lipschitz constraint, as follows. \begin{definition}[IF with respect to observed covariates]\label{def:IF_z} Consider an observation matrix $Z \in \cZ^{m \times n}$. An algorithm $f \in \cF$ is $(D, d)$-\emph{individually fair on $Z$} if \begin{align} D( f( i , Z ), f(j , Z ) ) \leq L \cdot d(\bZ_i , \bZ_j) \hspace{0.2in} \forall i,j \in [m], \label{eq:lipschitz_constraint_Z} \end{align} where $L \geq 0$ does not depend on $i$ or $j$, $D$ is a metric on $\cY$, and $d$ is a metric on $\cZ^n$. \end{definition} \begin{definition}[IF with respect to latent covariates]\label{def:IF_a} Consider an observation matrix $Z \in \cZ^{m \times n}$ and ground truth matrix $A \in [-1,1]^{m \times n}$. An algorithm $f \in \cF$ is $(D, d)$-\emph{individually fair on $A$} if \begin{align} D( f( i , Z), f(j , Z ) ) \leq L \cdot d(\bA_i , \bA_j) \label{eq:lipschitz_constraint_a} \hspace{0.2in} \forall i,j \in [m], \end{align} where $L \geq 0$ does not depend on $i$ and $j$, $D$ is a metric on $\cY$, and $d$ is a metric on $[-1, 1]^n$. \end{definition} \vspace{6pt} \noindent \textbf{Problem statement}. We focus on a subclass of algorithms $\cF( \cH , \Pi ) = \{ f = h \circ \Pi : h \in \cH \} \subset \cF$, where $\cH \subset \{ h : [m] \times [-1,1]^{m \times n} \rightarrow \cY \}$ and $\Pi : \cZ^{m \times n} \rightarrow [-1,1]^{m \times n}$. Intuitively, $\Pi$ is a pre-processing algorithm that takes in the (sparse and noisy) data $Z$ and produces an estimate $\Pi(Z)$ of the unknown ground truth matrix $A$. The inference algorithm $h$ is then applied on top of $\Pi$ such that $f(i , Z) = h(i , \Pi(Z))$. In this work, we examine the IF of $f$ relative to $h$ when $\Pi$ is given by a ME method, i.e., \emph{how a ME pre-processing step affects the IF of an inference algorithm}. \subsection{Examples} \label{sec:examples} The setup in Section \ref{sec:setup} can be applied to many problems in which the training data and algorithmic inputs are \emph{noisy}, \emph{sparse}, or both. Consider the following examples and the implications of IF. \vspace{6pt} \begin{example}[Recommendation]\label{ex:recommendation} Consider a platform that provides personalized movie recommendations to its $m$ users based on sparse, noisy observations of their preferences. Suppose that the movie preferences of each user $i \in [m]$ can be described by an unknown $n$-dimensional vector $\bA_i \in \bbR^n$. For instance, $a_{ij} \in [-1, 1]$ could denote the ground-truth preference of user $i$ for movie $j \in [n]$. Although $A = [\bA_1 , \hdots , \bA_m]^T$ is unknown, the platform receives occasional feedback from users in the form of ratings and can also observe the users' viewing behaviors. Let these sparse, noisy observations be stored in $Z$, where $Z_{ij} = \emptyset$ implies that user $i$ has not rated movie $j$. The goal of the platform is to estimate the users' movie preferences. Note that $f \in \cF$ can leverage other information (e.g., ratings by other users, as done in collaborative filtering). In this example, IF on $Z$ requires that users with similar viewing and rating behaviors receive similar recommendations. IF on $A$ implies that users with similar latent (i.e., unknown) movie preferences receive similar recommendations. \end{example} \begin{example}[Admissions]\label{ex:admissions} Consider an admissions setting in which there are $m$ applicants. Suppose that, for the purposes of admissions, each applicant $i \in [m]$ is described by an unknown $n$-dimensional vector $\bA_i \in \bbR^n$. Suppose each individual $i$ submits an application $\bZ_i$, which contains sparse, noisy measurements of $\bA_i$. For example, one's standardized test score in math is a noisy measurement of one's math abilities. Data sparsity can occur when one applicant includes information that another does not (e.g., one may list ``debate club'' on their resume while another does not, but this sparsity does not necessarily imply that the latter is worse at public speaking). As an output, $f \in \cF$ could produce an admissions score $\by \in [0,1]$. In this example, IF on $Z$ requires that applicants with similar applications receive similar admissions scores. IF on $A$ implies that applicants whose true (but unknown) qualifications are similar receive similar admissions scores. \end{example} \vspace{6pt} \noindent Although IF on $A$ is desirable, one generally requires IF on $Z$, i.e., that an algorithm ensures IF with respect to the information at its disposal. Consider Example \ref{ex:admissions}. Suppose that two applicants $i$ and $j$ have similar ground-truth features but the first $n/2$ values of $\bZ_{i}$ are $\emptyset$ while last $n/2$ values of $\bZ_{j}$ are $\emptyset$. In other words, the types of qualifications that $i$ reports contains no overlap with the types of qualifications $j$ reports. However, because $i$ and $j$ have similar ground-truth features, IF on $A$ would require that a school treat $i$ and $j$ similarly even though the schools are given vastly different information about those two applicants. \subsection{Setup for Experiment \#1: Synthetic Data} \label{sec:synth-setup} In Experiment \#1, we test $h$ with and without SVT pre-processing on synthetic data, as follows. \\ \noindent \textbf{Generating the ground truth matrix $A$}. Consider $m = 200$ individuals. We sample $m$ feature vectors of length $n = 800$, each corresponding to an individual, to form the ground truth matrix $A \in [-1, 1]^{m \times n}$. The feature vectors (i.e., the rows of $A$) are sampled from $c = 10$ clusters, where each cluster is a multivariate normal distribution. The mean of each cluster is a vector of length $n$ drawn uniformly at random from $(-1, 1)$, and the covariance of each cluster is an $n \times n$ diagonal matrix with whose diagonal values are sampled uniformly at random from $(0, 0.1)$. The feature vectors are then clipped so that all values fall within $[-1, 1]$. \\ \noindent \textbf{Generating the observation matrix $Z$}. Recall that $\Omega$ denotes the set of observed entries. We generate $Z$ as follows: \begin{align*} Z_{ij} = \begin{cases} \text{clip}(A_{ij} + \eta_{ij}, [-1, 1]) , & \text{if } (i, j) \in \Omega , \\ \emptyset , & \text{otherwise} , \end{cases} \end{align*} where $\eta_{ij} \sim \mathcal{N}(0, 0.1)$. In this section, $(i, j) \in \Omega \subset [m] \times [n]$ with probability $p$. This is aligned with the conditions in Proposition \ref{prop:USVT_MSE}. In the Appendix, we provide results under a different choice of $\Omega$ (specifically, when the probability of observing an individual $i$'s $j$-th feature depends on the cluster to which $i$ belongs). \\ \noindent \textbf{Inference algorithm}. Recall that the inference task is to predict the feature vector $\mathbf{A}_i$ for individual $i$ given data $B$ (where $B$ may or may not have undergone SVT pre-processing). In the synthetic data setting, we let the algorithm $h : [m] \times [-1, 1]^{m \times n} \rightarrow [-1, 1]^n$ be given as follows. Let $h' : [m] \times [n] \rightarrow [0, 1]$ denote a deep neural net (DNN) trained on data $B$. Let the DNN be composed of three fully connected layers of size 300, 100, and 1 with ReLU activation after the hidden layers and sigmoid after the output layer. Lastly, let \begin{align*} h(i, B) = 2 [ h'(i, 1), h'(i, 2), \hdots, h'(i, n)]^\top - 1. \end{align*} \noindent \textbf{Pre-processing}. We compare the IF and performance of $h$ with and without SVT pre-processing. When there is no pre-processing step, the data $B$ on which $h'$ is trained is $Z$ (missing entries are replaced with zeros). When SVT pre-processing is used, the data $B$ on which $h'$ is trained is $\svt(Z, \tau, \psi)$, where $\hat{p} = |\Omega|/(mn)$, $\psi(x) = x/\hat{p}$, $\hat{q} = 0.01^2 \hat{p} + \hat{p}(1 - \hat{p}) (1 - 0.01^2)$, and $\tau = \sqrt{2.01 n \hat{q}}$. This form of SVT is consistent with USVT (see Proposition \ref{prop:USVT_MSE} and Footnote \ref{fn:MSE_USVT}). \subsection{Setup for Experiment \#2: MovieLens 1M Dataset} In Experiment \#2, we test $h$ with and without SVT pre-processing on a popular, real-world dataset known as the MovieLens 1M Dataset. \\ \noindent \textbf{Dataset}. The MovieLens 1M dataset \citep{harper2015movielens} contains movie ratings data for 6040 users and 3952 movies. In the context of this work, this ratings data can be placed in the $m \times n$ matrix $Z$, where $m = 6040$ and $n = 3952$. Each entry $Z_{ij}$ contains user $i$'s rating of movie $j$ if $(i,j)$ is observed, and $Z_{ij} = \emptyset$ if user $i$ has not rated movie $j$. The ratings are normalized to be between $0$ and $1$. As a real-world dataset, there is no ground-truth matrix $A$. As such, we cannot evaluate performance relative to $A$---our MovieLens discussion instead focuses on IF. \\ \noindent \textbf{Inference algorithm}. Recall that the inference task is to predict the feature vector $\mathbf{A}_i$ for individual $i$ given data $B$ (where $B$ may or may not have undergone SVT pre-processing). In the MovieLens setting, we let the inference algorithm $h : [m] \times [-1, 1]^{m \times n} \rightarrow [-1, 1]^n$ be the $K$-nearest neighbors ($K$-NN) algorithm \citep{sarwar2001item}.\footnote{We use $K$-NN in order to investigate the effect of SVT pre-processing on another common class of algorithms. In particular, $K$-NN smooths data in a way that already encourages IF, which makes it particularly meaningful if SVT pre-processing is able to \emph{further} improve IF.} $K$-NN produces an estimate $\hat{\bA}_i$ by taking the weighted average of the $K$ users most similar to user $i$. In this work, we let $K = 10$ and the similarity between users $i$ and $j$ be measured using adjusted cosine similarity: \begin{equation*} \text{sim}(i,j) = \frac{\sum_{k \in [n]} (B_{ik} - \bar{B}_k)(B_{jk} - \overline{B}_k)}{\sqrt{\sum_{k \in [n]} (B_{ik} - \bar{B}_k)^2}\sqrt{\sum_{k \in [n]} (B_{ik} - \bar{B}_k)^2}}, \end{equation*} where $\bar{B}_k$ represents the average of the $k$-th movie's ratings. \\ \noindent \textbf{Pre-processing}. We compare the IF of $h$ with and without SVT pre-processing. When there is no pre-processing step, the data $B$ used by $K$-NN is $Z$ (missing entries are replaced with zeros). When SVT pre-processing is used, the data $B$ used by $K$-NN is $\svt(Z, \tau, \psi)$, where $\hat{p} = |\Omega|/(mn)$, $\psi(x) = x/\hat{p}$, $\tau = \sqrt{2.01 n \hat{p}}$, as consistent with USVT (see Proposition \ref{prop:USVT_MSE}). \subsection{Results} \begin{table}[t] \caption{Results on IF and performance in Experiment \#1.} \label{synth-random} \vskip 0.15in \begin{center} \begin{small} \begin{sc} \begin{tabular}{lccccr} \toprule {} & {$\hat{p} = 0.05$} & {$\hat{p} = 0.1$} & {$\hat{p}=0.2$} & {$\hat{p}=0.4$}\\ \midrule {MSE($h$)} & {$0.33 \pm 0.003$} & {$0.21 \pm 0.002$} & {$0.10 \pm 0.003$} & {$0.07 \pm 0.001$} \\ \midrule {MSE($f$)} & {$0.34 \pm 0.004$} & {$0.21 \pm 0.001$} & {$0.11 \pm 0.001$} & {$0.08 \pm 0.001$} \\ \midrule {$\IF^h_1(Z)$} & {$0.23 \pm 0.005$} & {$0.18 \pm 0.003$} & {$0.13 \pm 0.001$} & {$0.07 \pm 0.001$} \\ \midrule {$\IF^f_1(Z)$} & {$0.02 \pm 0.001$} & {$0.02 \pm 0.001$} & {$0.03 \pm 0.001$} & {$0.03 \pm 0.001$} \\ \midrule {\centering $K_2$} & {$0.06 \pm 0.007$} & {$0.12 \pm 0.003$} & {$0.25 \pm 0.009$} & {$0.49 \pm 0.012$} \\ \midrule {$\IF^h_2(A)$} & {$0.45 \pm 0.011$} & {$0.63 \pm 0.012$} & {$0.81 \pm 0.005$} & {$0.84 \pm 0.013$} \\ \midrule {$\IF^f_2(A)$} & {$0.49 \pm 0.015$} & {$0.65 \pm 0.006$} & {$0.82 \pm 0.003$} & {$0.84 \pm 0.005$} \\ \bottomrule \end{tabular} \end{sc} \end{small} \end{center} \vskip -0.2in \end{table} \textbf{Metrics}. For a function $g: [m] \times \cZ^{m \times n} \rightarrow \bbR$, let \begin{align*} \mse(g) \defeq \frac{1}{mn - |\Omega|} \sum_{(i, j) \notin \Omega} (g_j(i, Z) - \mathbf{A}_{ij} )^2 , \end{align*} where $g_j(i, Z)$ is the $j$-th element of the vector $g(i, Z)$. For a matrix $X \in \bbR^{m \times n}$, let \begin{align*} \IF^g_q(X) &\coloneqq \frac{1}{m^2} \sum_{i,j \in [m]} \norm{g(i,Z) - g(j,Z)}_2 / \norm{\mathbf{X}_i - \mathbf{X}_j}_q , \end{align*} $\IF^f_1(Z)$ and $\IF^h_1(Z)$ measure IF on $Z$ with and without SVT pre-processing, respectively. $\IF^f_2(A)$ and $\IF^h_2(A)$ measure IF on $A$ with and without SVT pre-processing, respectively.\footnote{We use the $\ell^1$ norm for $Z$ as per our result in Theorem \ref{thm:IF_z} and the $\ell^2$ norm for $A$ due to the connection between Theorem \ref{thm:IF_a} and Proposition \ref{prop:USVT_MSE}.} A smaller ratio indicates a stronger IF guarantee. \\ \noindent \textbf{Results}. Table \ref{synth-random} summarizes the results for Experiment \#1. The values are averaged over 10 simulations, and the error bars give $+/-$ two standard deviations. Figures \ref{fig:lipschitz-diff}-\ref{fig:movielens-knn} visualize the effect of SVT pre-processing on IF on $Z$ for Experiments \#1 and \#2. We discuss our findings below. \\ \noindent \textbf{Effect of SVT pre-processing on IF on $Z$}. Table \ref{synth-random} verifies that SVT pre-processing improves IF on $Z$ in Experiment \#1. In particular, $\IF^f_1(Z)$ is much smaller than $\IF^h_1(Z)$. Figures \ref{fig:lipschitz-diff} and \ref{fig:movielens-knn} visualize this effect for Experiments \#1 and \#2, showing that SVT pre-processing causes the difference in two individuals' outcomes relative to the difference in their features to be smaller than without SVT pre-processing. \\ \noindent \textbf{Effect of SVT pre-processing on IF on $A$}. IF on $A$ is comparable though slightly weaker with SVT pre-processing than without it. In particular, $\IF^f_2(A)$ is slightly larger than $\IF^h_2(A)$ in Table \ref{synth-random}. This is in line with Theorem \ref{thm:IF_a}, which tells us that adding a pre-processing step $\Pi$ may weaken IF on $A$ if the estimation error of $\Pi$ is non-zero. Since SVT cannot estimate $A$ perfectly, it yields some estimation error and, as a result, slightly weakens $f$'s IF on $A$. As illustrated in Table \ref{synth-random}, this effect is small. Moreover, the gap between $\IF^f_2(A)$ and $\IF^h_2(A)$ gets smaller as $\hat{p}$ increases. This is consistent with our results because the estimation error of SVT decreases as $\hat{p}$ increases (see Proposition \ref{prop:USVT_MSE}), which means that the IF on $A$ guarantee improves as $\hat{p}$ increases (see Theorem \ref{thm:IF_a}). \\ \noindent \textbf{Effect of SVT pre-processing on performance}. The rows in Table \ref{synth-random} corresponding to $\mse(h)$ and $\mse(f)$ measure the error of the DNN without and with SVT pre-processing, respectively, in Experiment \#1. As expected from Section \ref{sec:USVT}, they show that SVT pre-processing has a minimal effect on prediction performance, i.e., that there is little to no fairness-performance trade-off. \begin{figure}[t] \begin{center} \centerline{\includegraphics[width=0.9\columnwidth]{figures/movielens_knn_svt.pdf}} \vskip -0.1in \caption{ Frequencies of $||\hat{\bA}_i - \hat{\bA}_j||_2/\norm{\bZ_i - \bZ_j}_1$ across randomly selected pairs $(i, j)$ in Experiment \#2. $\hat{\bA}$ denotes the estimate produced by $K$-NN on the MovieLens 1M dataset with (red) and without (blue) SVT pre-processing.} \label{fig:movielens-knn} \end{center} \vskip -0.25in \end{figure} \subsection{Singular Value Thresholding}\label{sec:SVT} Recall the inference task described in Section \ref{sec:setup}. In this section, we propose to use a popular ME method known as \textbf{singular value thresholding (SVT)} as the pre-processing step. That is, for algorithms in the class $\cF( \cH , \Pi ) = \{ f = h \circ \Pi : h \in \cH \} \subset \cF$, we propose that $\Pi$ denote SVT. More precisely, $\svt(Z, \tau, \psi)$ takes in three values: the observation matrix $Z\in \cZ^{m \times n}$, a threshold $\tau \geq 0$, and an increasing function $\psi : \bbR_{\geq 0} \rightarrow \bbR_{\geq 0}$. SVT then proceeds in four steps: \begin{enumerate}[topsep=9pt,itemsep=1pt] \item For any element in $Z$ that is $\emptyset$, replace that value with $0$, i.e., if $Z_{ij} = \emptyset$, re-assign it to $Z_{ij} = 0$. \item Perform the singular value decomposition (SVD): \begin{align*} Z = \sum_{\ell=1}^{\min (m,n)} \sigma_\ell \bu_\ell \bv_\ell^T , \end{align*} where $\sigma_\ell \geq 0$ is the $\ell$-th singular value, $\bu_\ell \in \bbR^{m \times 1}$ is the $\ell$-th left singular vector, and $\bv_\ell \in \bbR^{n \times 1}$ is the $\ell$-th right singular vector. \item For any index $\ell$ such that $\sigma_\ell > \tau$, add $\ell$ to the set $S(\tau)$ such that $S(\tau) = \{ \ell : \sigma_\ell > \tau \}$. \item Finally, construct an estimate of $A$: \begin{align*} \hat{A} = \min \bigg( 1 , \max \bigg( -1 , \sum_{\ell \in S(\tau)} \psi( \sigma_\ell ) \bu_\ell \bv_\ell^T \bigg) \bigg) . \end{align*} \end{enumerate} Intuitively, SVT detects and removes components of the observation matrix $Z$ that correspond to noise while preserving the remaining components $S(\tau)$. The threshold $\tau$ determines the boundary between signal and noise, where a higher value for $\tau$ means that fewer components are kept. \subsection{IF With Respect to Observed Covariates} \label{sec:SVT_IF_Z} In the previous section, we proposed to pre-process $Z$ using SVT before applying an inference algorithm $h$ on top of it. In this section, we show that using SVT for pre-processing guarantees IF on $Z$. For the remainder of this section, we fix the $Z$ of interest. Consider a specific threshold $\tau$ and function $\psi$. Recall that $\sigma_\ell$, $\bu_\ell$, and $\bv_\ell$ are the $\ell$-th singular value, left singular vector, and right singular vector of $Z$, respectively. Recall further that $S(\tau) := \{ \ell : \sigma_\ell > \tau \}$. Let \begin{align*} K_2 = \norm{\sum_{\ell \in S(\tau)}\frac{\psi(\sigma_\ell)\bu_\ell \bv_\ell^T}{\sigma_\ell^2}}_{\infty} \sqrt{n} \max_k \norm{\bz_k}_1. \end{align*} \begin{theorem} \label{thm:IF_z} Suppose that $h$ is $(\cD, \ell^2)$-individually fair with constant $K_1$, i.e., $$D(h(i, B) , h(j , B)) \leq K_1 || \mathbf{B}_i - \mathbf{B}_j ||_{2},$$ for all $i , j \in [m]$ and $B \in [-1, 1]^{m \times n}$. Then, for $f = h \circ \svt(Z , \tau, \psi)$, \begin{equation} D(f ( i , Z) , f( j , Z) ) \leq K_1 K_2 \norm{\bZ_i - \bZ_j}_1 , \end{equation} for all $i ,j \in [m]$, i.e., $f$ is $(D, \ell^1)$-individually fair on $Z$ with constant $K_1 K_2$. \end{theorem} Theorem \ref{thm:IF_z} states that when $h$ is IF with Lipschitz constant $K_1$, applying SVT pre-processing preserves IF with constant $K_1 K_2$ with respect to the observed covariates. In order for $h$ with SVT pre-processing to have stronger IF than $h$ alone, we need $K_2 \ll 1$, as we examine next. \begin{corollary}\label{cor:k1} Suppose $\psi(x) = \beta x$ and $Z$ satisfies the strong incoherence condition\footnote{Strong incoherence is a standard assumption in the ME literature \citep{keshavan2010matrix, negahban2012restricted, chen2015incoherence}.} with parameter $\mu_1$, i.e., \begin{align*} \norm{\sum_{\ell \in S(\tau)} \bu_\ell \bv_\ell^T}_\infty \leq \sqrt{\frac{\mu_1 r}{mn}}, \end{align*} where $r = |S(\tau)|$ denotes the rank of $Z$. Then for any threshold $\tau$, $K_2 \leq {\beta \sqrt{rm}} / {\tau}$. \end{corollary} Corollary \ref{cor:k1} characterizes common conditions under which $K_2$ scales according to $O(\sqrt{r m} / \tau)$. Specifically, suppose that $\tau \geq \sqrt{2n\beta }$. Then, $K_2 = O (\sqrt{{rm}/{n}} )$. This indicates that combining $h$ with SVT pre-processing would \emph{improve} the IF of $h$ as long as $n = \omega(rm)$. In other words, as long as there is enough data $n$ per individual relative to the number of individuals $m$ and the rank $r$, then $K_2 \rightarrow 0$ as $n \rightarrow \infty$.\footnote{The rank $r$ indicates the ``complexity'' of the ground-truth matrix $A$. Although it is computed using $Z$, it reflects the amount of ``signal'' in $Z$, which generally depends on $A$.} We discuss the implications of this result further in Section \ref{sec:discussion}. \subsection{IF With Respect to Latent Covariates} \label{sec:SVT_IF_A} In the previous section, we showed that SVT pre-processing can improve IF on $Z$. In this section, we show that SVT pre-processing can also ensure IF on $A$ as long as its estimates $\hat{A}$ are close to the ground-truth values. \begin{theorem} \label{thm:IF_a} Let $d$ denote the $\ell^q$ norm. Suppose that $h$ is $(\cD, d)$-individually fair with constant $K_1$, i.e., $$D(h(i, B ) , h(j , B )) \leq K_1 || \mathbf{B}_i - \mathbf{B}_j ||_{q},$$ for all $i , j \in [m]$ and $B \in [-1, 1]^{m \times n}$. Then, for $f = h \circ \svt(Z , \tau, \psi)$, \begin{align} D(f (i, Z & ) , f( j , Z) ) \leq K_1 \norm{\bA_i - \bA_j}_q + 2 K_1 || \hat{A} - A ||_{q,\infty} , \label{eq:IF_a} \end{align} for all $i ,j \in [m]$. \end{theorem} Theorem \ref{thm:IF_a} states when $h$ is IF with Lipschitz constant $K_1$, then $f$ is approximately IF on $A$ and approaches exact IF as $\hat{A} \rightarrow A$. Note that Theorem \ref{thm:IF_a} holds for any $\Pi$. This result implies that SVT pre-processing preserves the individual fairness guarantee of $h$ on $A$ as the estimation error of SVT approaches $0$. We show in the next section (Proposition \ref{prop:USVT_MSE}) that, under an appropriate choice of threshold, the estimation error of SVT indeed goes to $0$ (specifically, that $||\hat{A} - A||_{2,\infty} \rightarrow 0$) as $m , n \rightarrow \infty$. Together, these two results imply that adding SVT pre-processing to $h$ ensures IF on $A$ under the same conditions that guarantee that SVT (or, more generally, ME) is accurate.\footnote{ Note that the condition in both theorems that $D(h(i, B) , h(j , B)) \leq K_1 || \mathbf{B}_i - \mathbf{B}_j ||_{q}$ for all $i , j \in [m]$ and $B \in [-1, 1]^{m \times n}$ is not strong. In fact, if it is not met, then there is no method $\Pi$ such that $f$ is IF. } \vspace{6pt} \begin{remark} Theorem \ref{thm:IF_a} shows that it is possible to achieve approximate IF on $A$, and the tightness of this guarantee depends on the accuracy of $\Pi$. Even though IF on $A$ may be desirable, IF on $Z$ is important because both individuals and algorithm designers generally cannot make claims based on the unknown ground-truth matrix $A$; they must point to the evidence (i.e., observations) $Z$. \end{remark} \subsection{Performance Under Individual Fairness}\label{sec:USVT} Recall from Theorem \ref{thm:IF_z} that, as long as the threshold $\tau$ is sufficiently large, SVT pre-processing guarantees IF on $Z$. However, it is unclear if the threshold chosen for IF is good for prediction performance. We now show that an adaptive threshold that is known to provide high accuracy coincides with thresholds that guarantee IF on $Z$. Because this adaptive threshold guarantees that $\hat{A} \rightarrow A$, it also guarantees IF on $A$, as per Theorem \ref{thm:IF_a}. As a result, SVT pre-processing under the appropriate threshold ensures IF on both $Z$ and $A$ at little to no performance cost. Consider a well-known ME method known as \textbf{universal singular value thresholding (USVT)}. USVT refines SVT by proposing a universal formula for the threshold $\tau$, thereby removing the need to tune $\tau$ by hand. Under mild assumptions on $A$ and $\Omega$, USVT has strong performance guarantees. % In order to study performance, let the mean-squared error (MSE) of ME be defined as \begin{align} \mse(\htA) \defeq \frac{1}{mn} \sum_{i=1}^m \sum_{j=1}^n \bbE (\htA_{ij} - A_{ij})^2 . \label{eq:mse} \end{align} Let $\norm{M}_*$ denote the nuclear norm of matrix $M$. We begin with a performance guarantee on USVT. \begin{proposition}[Modified from Theorem 1.1. in \citet{chatterjee}]\label{prop:USVT_MSE} Suppose that the entries of $A$ are independent random variables. Suppose each entry of $A$ is independently observed with probability $p \in [0,1]$. Let $\hat{p}$ be the proportion of observed values, $\psi( x) = x / \hat{p}$, $\epsilon \in (0,1]$, and $w = (2 + \eta)^2$ for $\eta \in (0,1)$. Let $\rho_1 = \max(m,n)$ and $\rho_2 = \min(m,n)$. Then, if $p \geq \rho_1^{\epsilon - 1}$ and $\tau = \sqrt{w \rho_1 \hat{p}}$, \begin{align*} \mse \left( \svt(Z, \tau, \psi) \right) \leq &C(\eta) \min \left( \frac{\norm{A}_*}{\rho_2 \sqrt{\rho_1 p}} , \frac{\norm{A}_*^2}{ \rho_1 \rho_2 } , 1 \right) + C(\epsilon, \eta) \exp( - c (\eta) \rho_1 p ) , \end{align*} where $C(\eta) , c(\eta) > 0$ depend only on $\eta$ and $C(\epsilon, \eta)$ depends only on $\eta$ and $\epsilon$.\footnote{\label{fn:MSE_USVT} This upper bound can be improved when the additional condition that $\var(Z_{ij}) \leq \sigma^2$ for all $i,j$ and $\sigma \leq 1$ holds. Then, if $\tau \geq \sqrt{w n \hat{q}}$, where $\hat{q} = \hat{p} \sigma^2 + \hat{p}(1 - \hat{p}) (1 - \sigma^2)$, $q \geq n^{\epsilon - 1}$, and $q = p \sigma^2 + p(1 - p) (1 - \sigma^2)$: \begin{align*} \mse( \htA ) &\leq C(\eta) \min \left( \frac{\norm{A}_* \sqrt{q} }{m p \sqrt{n}} , \frac{\norm{A}_*^2}{m n } , 1 \right) + C(\epsilon, \eta) \exp( - c (\eta) n q ) . \end{align*} } \end{proposition} Proposition \ref{prop:USVT_MSE} states that when $\tau = \sqrt{w \rho_1 \hat{p}}$, the MSE of SVT decays at a rate of $o((mn)^{-1})$. As an immediate extension, Proposition \ref{prop:USVT_MSE} tells us that if the loss of $h$ when given perfect information $A$ is small, then the loss of $f = h \circ \textsc{SVT}(Z, \sqrt{\omega \rho_1 \hat{p}}, \psi)$ is also small as $n , m \rightarrow \infty$ because the estimate $\hat{A}$ produced by USVT is close to $A$. \begin{remark} \citet{chatterjee} also show that the MSE of USVT is within a constant multiplicative factor and an exponentially small, additive term of the MSE of the minimax estimator, which implies that one cannot do much better than the USVT (cf. Theorem 1.2 in \citet{chatterjee}). \end{remark} As such, SVT is consistent and approximately minimax under the appropriate choice of threshold. Next, we connect this finding to our earlier results on IF. \\ \noindent \textbf{Performance under IF on $Z$.} Suppose that $n > m$. Then, $\rho_1 = n$ and Theorem \ref{prop:USVT_MSE} indicates that SVT pre-processing with the threshold $\tau = \sqrt{w \hat{p} n}$ has good performance. Under Corollary \ref{cor:k1}, such a threshold also ensures that $f$ with SVT pre-processing is \emph{more} individually fair on $Z$ than $f$ without SVT pre-processing for large enough $n$ such that $n = \omega(r m)$. Therefore, there is no trade-off between performance and IF under SVT pre-processing when $n$ grows at the rate $\omega(rm)$. \\ \noindent \textbf{Performance under IF on $\mathbf{A}$}. Recalling Theorem \ref{thm:IF_a}, ME is approximately individually fair on $A$ and fully individually fair on $A$ when $|| \Pi(Z) - A ||_{q , \infty} = 0$. Therefore, the relationship between IF on $A$ and performance under ME is straightforward: the lower the estimation error $\norm{ \Pi(Z) - A }_{q , \infty}$, the more individually fair $f$ is on $A$. \subsection{Proof of Theorem \ref{thm:IF_z}} In order to prove Theorem \ref{thm:IF_z}, we first prove the following two lemmas. \begin{lemma}\label{lemma:l2} Suppose $T \in \mathbb{R}^{m \times n}$ and $\bx \in \mathbb{R}^{n \times 1}.$ Then \[ \norm{T \bx}_2 \leq \norm{T}_\infty \norm{\bx}_1 \sqrt{m}. \] \end{lemma} \begin{proof} \begin{align*} \norm{T \bx}_2 &= \left(\sum_{i \in [m]} \left( \sum_{j \in [n]} T_{ij} x_j \right)^2\right)^{1/2} \leq \left(\sum_{i \in [m]} \left( \sum_{j \in [n]} |T_{ij}| |x_j| \right)^2\right)^{1/2} \leq \left(\sum_{i \in [m]} \left( \sum_{j \in [n]} \norm{T}_\infty |x_j| \right)^2\right)^{1/2} \\ &= \norm{T}_\infty \left(\sum_{i \in [m]} \left( \sum_{j \in [n]} |x_j| \right)^2\right)^{1/2} = \norm{T}_\infty \sqrt{m} \left( \sum_{j \in [n]} |x_j| \right) = \norm{T}_\infty \norm{\bx}_1 \sqrt{m}. \end{align*} \end{proof} \begin{lemma}\label{lemma:l1} Suppose $T \in \mathbb{R}^{m \times n}$ and $\bx \in \mathbb{R}^{n \times 1}$. Then \[ \norm{T \bx}_1 \leq \norm{\bx}_1 \max_j \norm{\bt_j}_1. \] \end{lemma} \begin{proof} Recall $\bT_i$ denotes the $i$-th row of $T$ and $\bt_i$ denotes the $i$-th column of $T$. \begin{align*} \norm{T \bx}_1 &= \sum_{i \in [m]} |T_i^\top \bx| = \sum_{i \in [m]} \left| \sum_{j \in [n]} T_{ij} x_j \right| = \sum_{i \in [m]} \sum_{j \in [n]} |T_{ij} x_j| \leq \sum_{i \in [m]} \sum_{j \in [n]} |T_{ij}| |x_j| \\ &= \sum_{j \in [n]} |x_j| \sum_{i \in [m]} |T_{ij}| = \norm{\bx}_1 \max_j \left(\sum_{i \in [m]} |T_{ij}| \right) = \norm{\bx}_1 \max_j \norm{\bt_j}_1. \end{align*} \end{proof} \theoremstyle{plain} \newtheorem*{theorem1}{Theorem 4.1} \begin{theorem1} Suppose that $h$ is $(\cD, \ell^2)$-individually fair with constant $K_1$, i.e., $$D(h(i, B) , h(j , B)) \leq K_1 || \mathbf{B}_i - \mathbf{B}_j ||_{2},$$ for all $i , j \in [m]$ and $B \in [-1, 1]^{m \times n}$. Then, for $f = h \circ \svt(Z , \tau, \psi)$, \begin{equation} D(f ( i , Z) , f( j , Z) ) \leq K_1 K_2 \norm{\bZ_i - \bZ_j}_1 , \end{equation} for all $i ,j \in [m]$, i.e., $f$ is $(D, \ell^1)$-individually fair on $Z$ with constant $K_1 K_2$. \end{theorem1} \begin{proof} Let the singular value decomposition (SVD) of $Z = \sum_{\ell=1}^{\min (m,n)} \sigma_\ell \bu_\ell \bv_\ell^T$, where $\sigma_i, \bu_i, \bv_i$ are the $i$-th singular value, left singular vector, and right singular vector of $Z$ respectively. Given $f = h \circ \svt(Z , \tau, \psi))$, the input $\hat{A}$ to $h$ is the output of running SVT on $Z$, i.e. \begin{align*} \hat{A} = \sum_{\ell \in S(\tau)} \psi( \sigma_\ell ) \bu_\ell \bv_\ell^T . \end{align*} We can expand $||\hat{\bA}_i - \hat{\bA}_j||_2$ to get \begin{align} ||\hat{\bA}_i - \hat{\bA}_j||_2 &= \norm{\sum_{\ell \in S(\tau)}\psi(\sigma_\ell)u_{\ell i}\bv_\ell^T - \sum_{\ell \in S(\tau)}\psi(\sigma_\ell)u_{\ell j}\bv_\ell^T}_2 \\ &= \norm{\sum_{\ell \in S(\tau)}\psi(\sigma_\ell)(u_{\ell i} - u_{\ell j})\bv_\ell^T}_2. \label{exp1} \end{align} Next we rewrite $u_{\ell i} - u_{\ell j}$ in terms of $\bZ_i$ and $\bZ_j$. Since $\bu_\ell$ is the $\ell$-th left singular vector of $Z$, it is the $\ell$-th eigenvector of $ZZ^T$. Let $\lambda_\ell$ be the $\ell$-th eigenvalue of $ZZ^T$. Note that $\lambda_\ell = \sigma_\ell^2$. Then \begin{equation*} \lambda_\ell \bu_\ell = Z Z^T \bu_\ell. \end{equation*} Looking at only the $i$th row, we see that \begin{align*} \lambda_\ell u_{\ell i} &= \bZ_i Z^T \bu_\ell \\ \implies u_{\ell i} &= \frac{\bZ_i Z^T \bu_\ell}{\lambda_\ell} \\ \implies u_{\ell i} - u_{\ell j} &= \frac{(\bZ_i - \bZ_j) Z^T \bu_\ell}{\sigma_\ell^2}. \end{align*} Plugging this back into equation \eqref{exp1}, we get \begin{align} ||\hat{\bA}_i - \hat{\bA}_j||_2 &= \norm{\sum_{\ell \in S(\tau)}\frac{\psi(\sigma_\ell)(\bZ_i - \bZ_j) Z^T \bu_\ell \bv_\ell^T}{\sigma_\ell^2}}_2 \\ &= \norm{\left(\sum_{\ell \in S(\tau)}\frac{\psi(\sigma_\ell)}{\sigma_\ell^2}\left(\bu_\ell \bv_\ell^T \right)^T \right) Z(\bZ_i - \bZ_j)}_2 \label{mineq} \end{align} Next we apply Lemma \ref{lemma:l2} to \eqref{mineq} to get \begin{equation} ||\hat{\bA}_i - \hat{\bA}_j||_2 \leq \norm{\sum_{\ell \in S(\tau)}\frac{\psi(\sigma_\ell) \bu_\ell \bv_\ell^T}{\sigma_\ell^2}}_\infty \sqrt{n} \norm{Z(\bZ_i - \bZ_j)}_1 \label{l2split} \end{equation} Apply Lemma \ref{lemma:l1} to $\norm{Z(\bZ_i - \bZ_j)}_1$ in \eqref{l2split} gives us \begin{equation} ||\hat{\bA}_i - \hat{\bA}_j||_2 \leq \norm{\sum_{\ell \in S(\tau)}\frac{\psi(\sigma_\ell) \bu_\ell \bv_\ell^T}{\sigma_\ell^2}}_\infty \sqrt{n} \max_k \norm{\bz_k}_1 \norm{\bZ_i - \bZ_j}_1 \end{equation} Since $D(h(i, B) , h(j , B)) \leq K_1 || \mathbf{B}_i - \mathbf{B}_j ||_{2}$, \begin{align} D(f(i, Z), f(j, Z)) &= D(h (i , \hat{A}) , h( j , \hat{A}) ) \\ & \leq K_1 \left( \norm{\sum_{\ell \in S(\tau)}\frac{\psi(\sigma_\ell) \bu_\ell \bv_\ell^T}{\sigma_\ell^2}}_\infty \sqrt{n} \max_k \norm{\bz_k}_1 \right) \norm{\bZ_i - \bZ_j}_1 \\ &= K_1 K_2 \norm{\bZ_i - \bZ_j}_1. \end{align} \end{proof} \subsection{Proof of Corollary \ref{cor:k1}} \newtheorem*{corollary2}{Corollary 4.2} \begin{corollary2} Suppose $\psi(x) = \beta x$ and $Z$ satisfies the strong incoherence condition with parameter $\mu_1$ \citep{chen2015incoherence}, i.e., \begin{align*} \norm{\sum_{\ell \in S(\tau)} \bu_\ell \bv_\ell^T}_\infty \leq \sqrt{\frac{\mu_1 r}{mn}}, \end{align*} where $r = |S(\tau)|$ denotes the rank of $Z$. Then for any threshold $\tau$, $K_2 \leq {\beta \sqrt{rm}} / {\tau}$. \end{corollary2} \begin{proof} Recall that \[ K_2 = \norm{\sum_{\ell \in S(\tau)}\frac{\psi(\sigma_\ell) \bu_\ell \bv_\ell^T}{\sigma_\ell^2}}_\infty \sqrt{n} \max_k \norm{\bz_k}_1.\] Given $\psi(x) = \beta x$, we have \begin{equation*} K_2 = \beta \norm{\sum_{\ell \in S(\tau)}\frac{\bu_\ell \bv_\ell^T}{\sigma_\ell}}_\infty \sqrt{n} \max_k \norm{\bz_k}_1. \end{equation*} Recall $S(\tau) \coloneqq \{\ell: \sigma_\ell > \tau\}$ is the set of components whose singular values exceed $\tau$, so the value of any $\sigma_\ell$ in the denominator must be at least $\tau$, giving us \begin{equation*} K_2 \leq \frac{\beta}{\tau} \norm{\sum_{\ell \in S(\tau)}\bu_\ell \bv_\ell}_\infty \sqrt{n} \max_k \norm{\bz_k}_1. \end{equation*} Given $Z$ satisfies the strong incoherence condition, \begin{equation*} K_2 \leq \frac{\beta}{\tau} \cdot \sqrt{\frac{r}{mn}} \cdot \sqrt{n} \max_k \norm{\bz_k}_1. \end{equation*} Since each entry $Z_{ij} \in [-1,1]$ and there are $m$ entries in each column of $Z$, $\norm{\bz_k}_1 \leq m$. Hence \begin{equation*} K_2 \leq \frac{\beta}{\tau} \cdot \sqrt{\frac{r}{mn}} \cdot \sqrt{n} \cdot m \leq \frac{\beta \sqrt{rm}}{\tau}, \end{equation*} concluding our proof. \end{proof} \subsection{Proof of Theorem \ref{thm:IF_a}} \newtheorem*{theorem3}{Theorem 4.3} \begin{theorem3} Let $d$ denote the $\ell^q$ norm. Suppose that $h$ is $(\cD, d)$-individually fair with constant $K_1$, i.e., $$D(h(i, B ) , h(j , B )) \leq K_1 || \mathbf{B}_i - \mathbf{B}_j ||_{q},$$ for all $i , j \in [m]$ and $B \in [-1, 1]^{m \times n}$. Then, for $f = h \circ \svt(Z , \tau, \psi)$, \begin{align} D(f (i, Z & ) , f( j , Z) ) \leq K_1 \norm{\bA_i - \bA_j}_q + 2 K_1 || \hat{A} - A ||_{q,\infty} \end{align} for all $i ,j \in [m]$. \end{theorem3} \begin{proof} Recall that $\norm{M}_{q, \infty} = \max_{i} \norm{ \mathbf{m}_i }_q$. This result follows from the application of the triangle inequality. \begin{align*} D(f (i, Z ) , f( j , Z) ) &= D( h ( i , \hat{A}) , h ( j , \hat{A} ) ) \\ &\leq K_1 \norm{ \hat{\bA}_i - \hat{\bA}_j }_q \\ &\leq K_1 (|| \hat{\bA}_i - \bA_i ||_q + || \hat{\bA}_j - \bA_j ||_q + || \bA_i - \bA_j ||_q ) \\ &\leq K_1 ( 2 || \hat{A} - A ||_ {q, \infty} + || \bA_i - \bA_j ||_q ) \\ &\leq K_1 || \bA_i - \bA_j ||_q + 2 K_1 || \hat{A} - A ||_{q,\infty} , \end{align*} which gives the result as stated. \end{proof} \subsection{Experimental Setup} Below are some additional details about our experimental setup. \\ \noindent \textbf{Training the DNN. } Given input matrix $B$, the training set of the deep neural net (DNN) described in Section \ref{sec:synth-setup} consists of (input, target) tuples of the form $(\begin{bmatrix} \mathbf{B}i & \mathbf{b}_j \end{bmatrix}, B_{ij})$. Missing entries in $\mathbf{B}_i$ and $\mathbf{b}_j$ are replaced with zeros. Out of the observed entries $(i,j) \in \Omega $, 80\% are used for training and the remaining 20\% are used for validation; the unobserved entries form our test set. We use a batch size of 128 and 2000 steps of training. \subsection{Additional Experimental Results} \subsubsection{Experiment \#3: Observing entries non-uniformly at random} \textbf{Setup. } Recall the setup for Experiment \#1 in Section \ref{sec:synth-setup}. We sample $m = 200$ feature vectors of length $n = 800$, each corresponding to an individual, to form the ground truth matrix $A \in [-1,1]^{m\times n}.$ The feature vectors are sampled from $c = 10$ clusters, where each cluster is a multivariate normal distribution. Next we generate the observation matrix $Z$. Recall that $\Omega$ denotes the set of observed entries. Instead of selecting each entry independently with probability $p$, we instead observe entries with different probabilities depending on the cluster it belongs to. For each cluster $k$, there is an associated random vector $\bp_k \in \mathbb{R}^n$ with entries summing to $p \cdot n$. For each individual $i$ in cluster $k$, the entry $(i,j)$ is observed with probability $p_i[j].$ The expected number of observed entries is $p \cdot n \cdot m$, so the proportion observed is as desired, but the entries are no longer drawn uniformly at random as the probability an entry is drawn is dependent on the cluster it is in. The remaining setup is identical to that for Experiment \#1. \\ \noindent \textbf{Results. } Table \ref{synth-group} summarizes the results for Experiment \#3. The values are averaged over 10 simulations, and the error bars give $+/-$ two standard deviations. We observe that $\IF^f_1(Z)$ is much smaller than $\IF^h_1(Z)$, which again verifies SVT pre-processing improves IF on $Z$. Note that the entries $(i,j) \in \Omega$ not being selected uniformly at random violates one of the conditions of Proposition \ref{prop:USVT_MSE}, which states that each entry of $A$ is independently observed with probability $p$. Despite violating this condition, we observe in Table \ref{synth-group} that there is minimal decrease in performance when applying SVT pre-processing. This indicates the performance guarantees of SVT are robust to relaxations of the independence condition stated in Proposition \ref{prop:USVT_MSE}. \begin{table}[t] \begin{center} \caption{Results on IF and performance in Experiment \#3.} \label{synth-group} \vskip 0.1in \begin{small} \begin{sc} \begin{tabular}{lcccr} \toprule {} & {$\hat{p} = 0.05$} & {$\hat{p} = 0.1$} & {$\hat{p} = 0.2$} & {$\hat{p} = 0.4$} \\ \midrule {MSE($h$)} & {$0.31 \pm 0.002$} & {$0.23 \pm 0.002$} & {$0.16 \pm 0.002$} & {$0.14 \pm 0.001$} \\ \midrule {MSE($f$)} & {$0.33 \pm 0.003$} & {$0.23 \pm 0.001$} & {$0.17 \pm 0.001$} & {$0.14 \pm 0.001$} \\ \midrule {$\IF^h_1(Z)$} & {$0.24 \pm 0.005$} & {$0.17 \pm 0.003$} & {$0.11 \pm 0.002$} & {$0.06 \pm 0.001$} \\ \midrule {$\IF^f_1(Z)$} & {$0.02 \pm 0.001$} & {$0.02 \pm 0.001$} & {$0.03 \pm 0.001$} & {$0.03 \pm 0.001$} \\ \midrule {\centering $K_2$} & {$0.05 \pm 0.003$} & {$0.11 \pm 0.007$} & {$0.25 \pm 0.009$} & {$0.49 \pm 0.013$} \\ \midrule {$\IF^h_2(A)$} & {$0.46 \pm 0.010$} & {$0.63 \pm 0.011$} & {$0.75 \pm 0.015$} & {$0.75 \pm 0.007$} \\ \midrule {$\IF^f_2(A)$} & {$0.49 \pm 0.014$} & {$0.64 \pm 0.006$} & {$0.75 \pm 0.008$} & {$0.73 \pm 0.014$} \\ \bottomrule \end{tabular} \end{sc} \end{small} \end{center} \end{table} \subsubsection{Experiment \#4: Varying length of feature vectors} \textbf{Setup. } Consider $m = 500$ individuals. We sample $m$ feature vectors of length $n$ from $c = 20$ clusters, where each cluster is a multivariate normal distribution. The mean of each cluster is a vector of length $n$ drawn uniformly at random from $(-1, 1)$, and the covariance of each cluster is an $n \times n$ diagonal matrix with whose diagonal values are sampled uniformly at random from $(0, 0.1)$. The feature vectors are then clipped so that all values fall within $[-1, 1]$. When generating the observation matrix $Z$, we observe a proportion $p = 0.2$ of entries uniformly at random. Instead of varying the value of $p$, we instead create datasets for varying values of $n$, the length of the feature vector. The remaining setup is identical to that for Experiment 1, described in Section \ref{sec:synth-setup}. \begin{table}[h] \caption{Results on IF and performance over different values of $n$ in Experiment \#4. } \label{synth-n} \vskip 0.1in \begin{center} \begin{small} \begin{sc} \begin{tabular}{lccccr} \toprule {} & {$n = 25$} & {$ n = 100 $} & {$n = 400$} & {$n = 800$} \\ \midrule {MSE($h$)} & {$0.36 \pm 0.004$} & {$0.28 \pm 0.003$} & {$0.13 \pm 0.001$} & {$0.10 \pm 0.001$} \\ \midrule {MSE($f$)} & {$0.36 \pm 0.004$} & {$0.28 \pm 0.003$} & {$0.12 \pm 0.001$} & {$0.10 \pm 0.001$} \\ \midrule {$\IF^h_1(Z)$} & {$0.43 \pm 0.004$} & {$0.26 \pm 0.002$} & {$0.17 \pm 0.001$} & {$0.13 \pm 0.001$} \\ \midrule {$\IF^f_1(Z)$} & {$0.15 \pm 0.003$} & {$0.07 \pm 0.001$} & {$0.05 \pm 0.001$} & {$0.03 \pm 0.001$} \\ \midrule {\centering $K_2$} & {$0.21 \pm 0.020$} & {$0.06 \pm 0.002$} & {$0.03 \pm 0.001$} & {$0.02 \pm 0.001$} \\ \midrule {$\IF^h_2(A)$} & {$0.51 \pm 0.004$} & {$0.63 \pm 0.005$} & {$0.80 \pm 0.007$} & {$0.83 \pm 0.007$} \\ \midrule {$\IF^f_2(A)$} & {$0.62 \pm 0.011$} & {$0.67 \pm 0.007$} & {$0.82 \pm 0.011$} & {$0.83 \pm 0.010$} \\ \bottomrule \end{tabular} \end{sc} \end{small} \end{center} \end{table} \noindent \textbf{Results. } Table \ref{synth-n} summarizes the results for Experiment \#4. Recall from Section \ref{sec:discussion} that our theoretical guarantees for SVT pre-processing simultaneously strengthening IF and having good prediction performance hold when $n = \omega(rm\hat{p}).$ In the above setting, both $n=25$ and $n = 100$ fall within $o(rm\hat{p}).$ However, we observe that $\IF^f_1(Z)$ is much smaller than $\IF^h_1(Z)$ for all the values of $n$, and there are very minimal differences between MSE$(h)$ and MSE$(f)$. This means that even when $n = o(rm\hat{p})$, we still see large improvements in IF with respect to $Z$ with little to no effect on prediction performance when applying SVT pre-processing. This demonstrates that the empirical IF and performance benefits of SVT pre-processing are not restricted to when $n = \omega(rm\hat{p}).$ In Figure \ref{fig:diff-n}, we visualize IF through histograms of the ratio $||\hat{\bA}_i - \hat{\bA}_j||_2/\norm{\bZ_i - \bZ_j}_1$ across randomly selected pairs $(i,j)$, which measures the difference in two individuals' outcomes relative to the difference in their features. A smaller ratio indicates a stronger IF guarantee. We see a noticeable improvement in IF for both small and large values of $n$ with SVT pre-processing. \begin{figure}[t] \begin{center} \hfill \subfigure[$n = 25$]{\includegraphics[width=0.48\columnwidth]{figures/n_25.pdf}} \hfill \subfigure[$n = 400$]{\includegraphics[width=0.48\columnwidth]{figures/n_400.pdf}} \hfill \vspace{-0.1in} \caption{ Frequencies of $||\hat{\bA}_i - \hat{\bA}_j||_2/\norm{\bZ_i - \bZ_j}_1$ across randomly selected pairs $(i, j)$. $\hat{\bA}$ denotes the estimate produced by the DNN on synthetic datasets containing length $n$ feature vectors, with (red) and without (blue) SVT pre-processing.} \label{fig:diff-n} \end{center} \vskip -0.25in \end{figure}
\section{Introduction} Recent years have witnessed an increasing trend of adopting modern machine learning paradigms to financial risk management (FRM) scenarios \cite{akib2020ML4fin}. As a typical use case in operational risk scenarios like fraud detection and anti-money laundering, the identification of risky entities (user accounts or transactions) is cast into a supervised classification problem using behavioral data collected from the operating financial platform \cite{chen2018machine, kute2021aml}. For institutions like commercial banks and online payment platforms, the most important source of behavior information is the \emph{transaction records} between users, \modification{ making \emph{transaction networks} (with users as nodes and transactions as edges) a direct and appropriate data model. Unlike standard pattern recognition tasks like image recognition where decisions are made according to information of individual objects, identification of risky patterns over transaction network requires reasoning beyond any individual scope. The phenomenon is particularly evident in the area of anti money laundering (AML), where suspicious transactions are usually related by several users or accounts, with transactions between them being highly correlated, thereby exhibiting a cascading pattern which makes i.i.d. approaches in machine learning unsuitable.} \par The surging developments of machine learning models over graphs, especially graph representation learning \cite{hamilton2020graph}, have attracted significant attention in the financial industry, and has shown promising results in the area of FRM \cite{liu2018heterogeneous, liu2021intention}. The dominant practice in graph representation learning is to utilize the panoply of graph neural networks (GNN) \cite{battaglia2018relational} that produce node-level representations via principled aggregation mechanisms which are generally described via message passing protocols \cite{pmlr-v70-gilmer17a} or spectral mechanisms \cite{kipf2016semi}. \par Despite their convincing performance, the majority of the existent GNN models operate over \emph{undirected graphs}, which makes them inadequate for direct modeling of transaction networks. Firstly, many graphs that arise in FRM applications are directed by nature: i.e., in the case of transaction network with users as nodes and transactions as edges, the direction of an edge is typically understood as the direction of its corresponding cash flow. In areas like anti-monery laundering (AML), directional information is generally perceived to be of significant importance and shall not be neglected \cite{Sudjianto2010Statistical}. Secondly, there might exist multiple transactions between certain pairs of users. Thirdly, transactions are naturally associated with timestamps that indicate the time of occurrence. Therefore, to fully utilize the graphical structure of transaction networks, we need representation learning frameworks that support \emph{temporal directed multigraphs}. While recent progress on \emph{dynamic graph neural networks} \cite{xu2020inductive, kazemi2020representation} provide appropriate methods to handle temporality, discussions over neural architectures that supports directed multigraphs remains nascent \cite{pmlr-v70-gilmer17a, ma2019spectral, tong2020directed, NEURIPS2020_cffb6e22, zhang2021magnet}.\par From a practical point of view, the targeted risky entities may be either nodes (i.e., malicious users) or edges (i.e., suspicious transactions). \modification{ Conventional GNN architectures produce node-level representations via encoding information of each node's rooted subtrees \cite{xu2018how}, making them a good fit for \emph{user or account level} risk identifications. When the underlying task is to detect risky transactions, the prevailing practice is to present edges using combination of node representations corresponding to both ends of edges. While such design may be adequate for tasks like link prediction, it lacks a way to effectively integrate edge level information into the edge representation. Since financial networks usually contain rich edge-level feature (i.e., detailed transaction-related information), refinements on edge-level representations are needed. For example, to accurately represent a transaction, we need to combine the information of its buyer (cash sender), seller (cash receiver), and the transaction-related information, with each of them requires aggregating relevant information from related users and transactions. A recent line of work \cite{jiang2020censnet, cai2020line, jo2021edge} focused directly on \emph{learned edge representations} using the idea of \emph{edge-to-node duality} and obtained satisfactory performance over downstream tasks like edge classification. However, previous works on edge representation learning all applies to undirected graphs, making the extension to transaction networks highly non-trivial.} \par In this paper we propose a general message passing neural network protocol that simultaneously output node and edge representations over directed multigraphs. Based on this protocol, we derive a GNN architecture called GRANDE with an extension to temporal graphs that efficiently leverages the underlying structural property of transaction networks. More specifically, we summarize our contribution as follows: \begin{itemize} \item We develop a novel bi-directional message passing protocol with duality enhancement (BiMPNN-DE) that strengthens previous proposals over message passing neural architectures over directed multigraphs. The improvement is two-fold: Firstly, it effectively combines neighborhood information from both incoming and outgoing edges of nodes. Secondly, it simultaneously outputs node and edge representations via performing message passing over both the original graph and its \emph{augmented} edge adjacency graph. \item We derive a concrete GNN architecture following the proposed BiMPNN-DE protocol called GRANDE, that devices the acclaimed transformer \cite{vaswani2017attention} mechanism for neighborhood aggregation. The proposed GRANDE framework is made compatible with temporal directed multigraphs through integration of a generic time encoding module that further extends previous works on dynamic graph modeling \cite{xu2020inductive}. \item To show the practical effectiveness of GRANDE, we apply it to a suspicious transaction identification task in anti-money laundering, with the underlying transaction network data collected from one of the world's leading online payment platforms. Comparisons against various undirected and directed GNN baselines show the superiority of the proposed model. We also provide evaluations on two public datasets generated from transaction networks to further verify the strength of GRANDE framework when underlying graph features are relatively weak. \end{itemize} \section{Methodology} \subsection{Problem formulation}\label{sec:problem_formulation} Under the context of financial risk management, we consider the following \emph{event stream} representation of recorded transaction data that are available in most online transaction systems: \begin{align} \mathcal{E} = \{(u_1, v_1, t_1, \chi_1), (u_2, v_2, t_2, \chi_2), \ldots \} \end{align} Each event $ (u, v, t, \chi) $ is interpreted as a transaction from user $u$ to user $v$ that occurred at time $t$, with related features $\chi$ that could often be further decomposed as user-level features like user account information, and event-level features like transaction amount and channels. In this paper we focus on the representative task of \emph{transaction property prediction} that typically takes form of binary classification that aims at identifying illicit or fraudulent transactions. The task could be cast into a graph learning problem of edge classification in a straightforward manner. We consider the temporal graph modeling paradigm \cite{kazemi2020representation} that views the underlying temporal graph as being generated from the event stream $\mathcal{E}$. Therefore, give a time period $\mathcal{T} = [\tau_{\tsf{start}}, \tau_{\tsf{end}}]$, we construct the graph data as the snapshot $G(\mathcal{T}) = (V(\mathcal{T}), E(\mathcal{T}))$ of the underlying temporal graph. Since there may exists multiple transactions between the same set of users, we consider $G(\mathcal{T})$ to be a \emph{directed multigraph} with each edge in the edge multiset $ E(\mathcal{T}) $ represents an event that happens inside the time interval $\mathcal{T}$, and the node set $ V(\mathcal{T}) $ consists of related users corresponding to the included events. During training stage, we construct a snapshot $G(\mathcal{T}_{\tsf{train}})$, and obtain a possibly incomplete set of edge labels that are understood as edge properties annotated using expert knowledge. During testing stage, we perform inference over snapshots $G(\mathcal{T}_{\tsf{test}})$ that are based on later time intervals than $\mathcal{T}_{\tsf{train}}$. We assume $\mathcal{T}_{\tsf{train}} \cap \mathcal{T}_{\tsf{test}} = \emptyset $, hence the problem of interest could be viewed as \emph{inductive edge classification over temporal graphs}. In the remainder of this section, we introduce our modeling framework as an instanciation of a novelly designed neural message passing protocol that excels in edge-property prediction tasks, with an extension over temporal graphs. \subsection{Message passing protocols and directed graphs} Let $ G = (V, E) $ be a directed multigraph with node set $ V $ and edge multiset $ E $. For any pairs of nodes $ (u, v) $, denote $ \mu(u, v) $ as the number of edges going from $ u $ to $ v $. Then $ G $ becomes a (simple) graph when $ \max_{u \in V, v \in V} \mu(u, v) \le 1 $. For each $ v \in V $, denote $ N^+(v) = \{u, (v, u) \in E\} $ and $ N^-(v) = \{u, (u, v) \in E\} $ as its in-neighborhood and out-neighborhood respectively \footnote{The naming convention in \cite{bang2008digraphs} appears tricky hence we adopt the conventional formulation} , and let $ N(v) = N^+(v) \cup N^-(v) $ be its neighborhood. For the sake of presentation clarity, we will overload the notation $uv$ for both an edge in the undirected graph, or a directed edge from $u$ to $v$ in a directed (multi)graph from time to time, with its exact meaning being clear from the context. We are interested in the general case where both node features $ X = \{x_v\}_{v \in V} $ and edge features $ Z = \{z_{uv}\}_{(u, v) \in E} $ are available, where we assume both kinds of features to be of dimension $d$. In this paper we focus on neural approaches to such directed multigraphs. A good starting point is the neural message passing scheme for undirected graphs \cite{pmlr-v70-gilmer17a}: let $ h^{(l)}_v $ denote the hidden representation of node $ v $ at the $ l $-th layer of the network, and $ h^{(0)}_v = x_v, \forall v \in V $. The message passing graph neural network protocol (abbreviated as GNN hereafter) is described recursively as: \begin{align}\label{eqn:gnn_undirected} h^{(l+1)}_v = \tsf{COMBINE}\left( h^{(l)}_v, \tsf{AGG}\left(\tsf{MESSAGE}(h^{(l)}_v, h^{(l)}_u, z_{uv}, u \in N(v))\right)\right) \end{align} Different combinations of \tsf{COMBINE}, \tsf{AGG} and \tsf{MESSAGE} mechanisms thus form the \emph{design space} of undirected GNNs \cite{you2020designspace}. To the best of our knowledge, there are three types of generalization strategies to directed graphs: \begin{description} \item[Symmetrization] The most ad-hoc solution is to "make it undirected" via padding necessary reverse edges so that $ N(v) = N^+(v) = N^-(v) $, and apply standard graph neural networks that operates on undirected graphs like GCN or GAT. Despite its simplicity and clearness, the symmetrization approach discards directional information in the digraph, and may raise subtleties when dealing with multigraphs. \item[DiGraph-theoretic motivations] A more recent line of work \cite{ma2019spectral, tong2020directed, NEURIPS2020_cffb6e22, zhang2021magnet} drew insights from directed graph theory, especially the spectral branch \cite{chung2005laplacians}. The proposed models are mostly digraph analogues of GCN, without the consideration for edge features, therefore severely limits the design space of directed message passing GNNs. \item[Directed Protocol] In the seminal work \cite[Algorithm 1]{battaglia2018relational}, the authors proposed a GNN protocol that operates on directed multigraphs with edge features via aggregating messages from only the in-neighborhood, i.e., replacing $ N(v)) $ in \eqref{eqn:gnn_undirected} with $ N^+(v)) $. \footnote{The original version also considered incorporation of a \emph{global node} that aggregates information from the whole graph regardless of the connectivity structure. While such design choice may have some gains in moderate size graphs \cite{xiong2021memory}, it does not scale to large graphs. Therefore we will not consider such design choice in this paper} While being a natural extension, such kind of GNN protocol losses information from the outgoing direction of each node. We present a pictorial illustration in figure \ref{fig:digraph_illustration}. \end{description} \begin{figure} \centering \input{digraph.tex} \caption{Illustration on the deficiency of the directed message passing protocol in \cite{battaglia2018relational}: suppose the node of interest is $ n_0 $, using GNNs designed according to the protocol in \cite{battaglia2018relational}, it becomes impossible for $ n_0 $ to aggregate information of $ n_9 $ and $ n_{10} $. Under the context of financial risk management, suppose $ n_9 $ and $ n_{10} $ corresponds to known fraudsters, and edges correspond to transactions. Although the riskiness of $ n_5 $ might be undetermined, the transaction pattern makes it highly suspicious and therefore uplifts the riskiness of $ n_0 $. To build models that behave coherently with the above reasoning process, GNN protocols that aggregates information from \emph{both directions} are required } \label{fig:digraph_illustration} \end{figure} To address the aforementioned shortcomings, we propose a novel GNN protocol that operates on directed digraphs termed \emph{bi-directional message passing neural network (BiMPNN)}. The protocol extends the standard undirected protocol \eqref{eqn:gnn_undirected} via enabling each node to aggregate information from both its in-neighborhood and out-neighborhood: \begin{align}\label{eqn:bimpnn} \begin{aligned} h^{(l+1)}_v &= \tsf{MERGE}\left(\phi^{(l+1)}_v, \psi^{(l+1)}_v\right) \\ \phi^{(l+1)}_v &= \tsf{COMBINE}_{\tsf{in}}\left( h^{(l)}_v, \tsf{AGG}_{\tsf{in}}\left(\tsf{MESSAGE}_{\tsf{in}}(h^{(l)}_v, h^{(l)}_u, z_{vu}, u \in N^+(v))\right)\right)\\ \psi^{(l+1)}_v &= \tsf{COMBINE}_{\tsf{out}}\left( h^{(l)}_v, \tsf{AGG}_{\tsf{out}}\left(\tsf{MESSAGE}_{\tsf{out}}(h^{(l)}_v, h^{(l)}_r, z_{ur}, r \in N^-(v))\right)\right) \end{aligned} \end{align} Despite being more complicated than the undirected protocol, the proposed BiMPNN protocol remains conceptually clear: for each layer, we aggregate separately from each node's in-neighborhood and out-neighborhood using distinct aggregation mechanisms, and merge the two obtained intermediate representations into next layer's input. \paragraph{On BiMPNN's inductive bias} A $ k $-layer GNN derived from the BiMPNN protocol utilizes both its \emph{root}-$k$ incoming subtree and outgoing subtree, thereby proving a richer set of \emph{relational inductive bias} than the one proposed in \cite{battaglia2018relational}. \subsection{Edge-level task and edge-to-node duality} The BiMPNN protocol \eqref{eqn:bimpnn} provides a principled way of obtaining node representations in directed multigraphs which serves as the building block of \emph{node-level tasks}. Yet another important type of graph-related tasks (in a \emph{local} sense \cite{Scarselli2009}) is \emph{edge-level} tasks, which exhibits a dichotomy between \emph{edge-existence} prediction, i.e., link prediction, and \emph{edge-property} prediction, i.e., edge classification. For the later task type, the very existence of an edge itself suggest basing the predictions on a properly defined \emph{edge representation}, which should go beyond naively concatenating node representations of its ends \cite{jo2021edge}. Although the protocol \eqref{eqn:bimpnn} implicitly encodes edge feature into node representations, it ignores the cascading dynamics of edges (i.e., information implied by cash flow in FRM applications). To build powerful edge representations that efficiently adapts to underlying graph structure. Mechanisms based on the edge-to-node dual graphs, or \emph{line graph}s, have been proposed \cite{chen2017supervised, jiang2020censnet, cai2020line, jo2021edge} under the undirected GNN protocol \eqref{eqn:gnn_undirected}. To begin our discussion on possible extensions to directed multigraphs, we first review the definition of line graphs as follows: \begin{definition}[Line graph and Line digraph \cite{godsil2001algebraic, bang2008digraphs}] For both undirected graph and directed (multi)graphs where we overload notation without misunderstandings, $ G = (V, E) $, the node set of its line graph $ L(G) = (L(V), L(E)) $ is defined as its edge (multi)set $ L(V) = E $. \begin{description} \item[Undirected graph] the edge set of its line graph is defined as \begin{align}\label{eqn:line} L(E) = \left\lbrace (uv, rs): (u, v) \in E, (r, s) \in E, \{u, v\} \cap \{r, s\} \ne \emptyset \right\rbrace \end{align} \item[Directed (multi)graph] the edge set of its line graph is defined as \begin{align}\label{eqn:diline} L(E) = \left\lbrace (uv, rs): (u, v) \in E, (r, s) \in E, v = r\right\rbrace \end{align} \end{description} \end{definition} For undirected graphs, their line graphs provides a natural way to update edge representations under standard message passing protocols like \eqref{eqn:gnn_undirected}. However, trivially extension using the definition of line digraphs may incur significant information loss: We take the graph in figure \ref{fig:digraph_illustration} as an example, its line graph has an empty edge set, which makes the message passing framework useless over the derived line graph. While the graph-theoretic definition enjoys some nice properties \cite{bang2008digraphs}, the adjacency criterion might be overly stringent for deriving useful GNN architectures. Intuitively, we may expect different transactions triggered by the same account as correlated rather than independent, which makes connectivity of edges like $ (n_5, n_9) $ and $ (n_5, n_0) $ as desirable. Therefore, we propose the following \emph{augmentation strategy} to obtain an \emph{augmented edge adjacency graph} $ \overline{L(G)} = (\overline{L(V)}, \overline{L(E)}, T(E)) $: The node set is still defined as $ \overline{L(V)} = E $, and we augment the edge set using the undirected adjacency criterion \eqref{eqn:line}. To retain directional information, we encode the adjacency pattern of two edges (with four possible patterns: \emph{head-to-head}, \emph{head-to-tail}, \emph{tail-to-head}, \emph{tail-to-tail}) into a categorical vector, which we denote as $ T(E) = \{ \tsf{type}(uv, rs): (uv, rs) \in \overline{L(E)} \} $. By construction, for each edge in $ \overline{L(E)} $, its reverse is also in $ \overline{L(E)} $ with different edge types. \par To derive an edge representation update rule, we follow the spirit of the BiMPNN node update rule \eqref{eqn:bimpnn}: let $ N^+_L(uv), N^-_L(uv) $ be the out and in neighborhoods in the ordinary line graph $ L(G) $ of $ G $, and $ \overline{N^+_L(uv)}, \overline{N^-_L(uv)} $ to be those in $ \overline{L(G)} $, respectively. For each edge $ (uv, rs) \in \overline{L(E)} $, we use $ \tsf{C}(uv, rs) \in V $ as the common incident node of the edges $uv$ and $rs$. The following updating rule enhances BiMPNN protocol with duality information, which we term BiMPNN-DE: \begin{align}\label{eqn:bimpnnde} \begin{aligned} h^{(l+1)}_v &= \tsf{MERGE}^{\tsf{node}}\left(\phi^{(l+1)}_v, \psi^{(l+1)}_v\right) \\ g^{(l+1)}_{uv} &= \tsf{MERGE}^{\tsf{edge}}\left(\theta^{(l+1)}_{uv}, \gamma^{(l+1)}_{uv}\right) \\ \phi^{(l+1)}_v &= \tsf{COMBINE}^{\tsf{node}}_{\tsf{in}}\left( h^{(l)}_v, \tsf{AGG}^{\tsf{node}}_{\tsf{in}}\left(\tsf{MESSAGE}^{\tsf{node}}_{\tsf{in}}(h^{(l)}_v, h^{(l)}_u, \blue{g^{(l)}_{vu}}, u \in N^+(v))\right)\right)\\ \psi^{(l+1)}_v &= \tsf{COMBINE}^{\tsf{node}}_{\tsf{out}}\left( h^{(l)}_v, \tsf{AGG}^{\tsf{node}}_{\tsf{out}}\left(\tsf{MESSAGE}^{\tsf{node}}_{\tsf{out}}(h^{(l)}_v, h^{(l)}_u, \blue{g^{(l)}_{ur}}, u \in N^-(v))\right)\right) \\ \theta^{(l+1)}_{uv} &= \tsf{COMBINE}^{\tsf{edge}}_{\tsf{in}}\left( g^{(l)}_{uv}, \tsf{AGG}^{\tsf{edge}}_{\tsf{in}}\left(\tsf{MESSAGE}^{\tsf{edge}}_{\tsf{in}}(g^{(l)}_{uv}, g^{(l)}_{pq}, \blue{\hat{h}^{(l)}_{pq, uv}}, pq \in \overline{N_L^+(uv)})\right)\right)\\ \gamma^{(l+1)}_{uv} &= \tsf{COMBINE}^{\tsf{edge}}_{\tsf{out}}\left( g^{(l)}_{uv}, \tsf{AGG}^{\tsf{edge}}_{\tsf{out}}\left(\tsf{MESSAGE}^{\tsf{edge}}_{\tsf{out}}(g^{(l)}_{uv}, g^{(l)}_{rs}, \blue{\hat{h}^{(l)}_{uv, rs}}, rs \in \overline{N_L^-(uv)})\right)\right) \\ \hat{h}^{(l)}_{uv, rs} &= \tsf{COMBINE}^{\tsf{type}}\left(h^{(l)}_{\tsf{C}(uv, rs)}, T_{\tsf{type}(uv, rs)}\right) \end{aligned} \end{align} Where we use $ g^{(l)}_{uv} $ to denote the hidden representation of edge $uv$ at the $l$-th layer of GNNs derived from the BiMPNN-DE protocol. The protocol devices an additional edge representation update component that mirrors the BiMPNN protocol over the augmented edge adjacency graph $ \overline{L(G)} $ (see the last three equations in the display \eqref{eqn:bimpnnde}). To obtain an edge representation counterpart $\tilde{h}^{(l)}_{uv, rs}$ during the aggregation process over $ \overline{L(G)} $, we use an additional $\tsf{COMBINE}^{\tsf{type}}$ mechanism that combines features of the common incident node and the information of adjacent types, with is encoded into a learnable edge type embedding matrix $ T \in \mathbb{R}^{4 \times d} $. The BiMPNN-DE protocol \eqref{eqn:bimpnnde} offers a much larger design space than that of BiMPNN protocol. In its full generality, we may specify up to $15$ different mechanisms corresponding to different \tsf{MERGE}, \tsf{COMBINE}, \tsf{AGG} and \tsf{MESSAGE} operations. From a practical point of view, we may design the aforementioned operations using parameterized functions that shares the same underlying structure. \begin{figure} \begin{minipage}{.5\textwidth} \centering \input{linegraph_aug.tex} \end{minipage} \begin{minipage}{.5\textwidth} \centering \input{lingraph_prune.tex} \end{minipage} \caption{An illustration of the proposed line graph augmentation strategy: The left figure stands for the augmented edge adjacency graph $ \overline{L(G)} $ for the digraph depicted in figure \ref{fig:digraph_illustration}. We use colored edges to represent edge types: {\color{sandybrown} head-to-head} and {\color{brightmaroon} tail-to-tail}, note that the remaining two kinds of edge types do not appear in $ \overline{L(G)} $. The right figure shows the effect of the causal pruning strategy under the additional temporal information that $t_0 < t_1 < \cdots < t_9$, with $t_i$ being the occurrence time of edge $t_i$ for $i \in \{0, \ldots, 9\}$} \label{fig:linegraphs} \end{figure} \subsection{The GRANDE architecture} In this section, we device the previously developed BiMPNN-DE protocol \eqref{eqn:bimpnnde} to derive a concrete GNN architecture that simultaneously outputs node and edge representations, along with an improvement strategy that targets edge-property prediction tasks. We base our design upon the acclaimed Transformer architecture \cite{vaswani2017attention}, which has seen abundant adaptations to GNNs recently \cite{xu2020inductive, dwivedi2020generalization, ying2021transformers}. We define the multiplicative attention mechanism that incorporates edge information as follows: \begin{align}\label{eqn:attention} \begin{aligned} \tsf{ATTN}(h_v, \{h_u, g_{uv}\}_{u \in N(v)}) &= \sum_{u \in N(v) \cup \{v\}} \alpha_{uv} W_N h_u + \beta_{uv} W_E g_{uv} \\ \alpha_{uv} &= \dfrac{\exp\left(\langle W_Q h_v, W_K h_u\rangle / \sqrt{d} \right)}{\sum_{u \in N(v) \cup \{v\}}\exp\left(\langle W_Q h_v, W_K h_u\rangle/ \sqrt{d}\right)} \\ \beta_{uv} &= \dfrac{\exp\left(\langle W_Q h_v, W_E g_{uv}\rangle/ \sqrt{d}\right)}{\sum_{u \in N(v) \cup \{v\}}\exp\left(\langle W_Q h_v, W_E g_{uv} \rangle/ \sqrt{d}\right)} \end{aligned} \end{align} We include commonly used operations in a transformer block, namely LayerNorm (\tsf{LN}), skip connection and a learnable two layer MLP (\tsf{FF}) as nonlinearity \cite{vaswani2017attention}, and wraps them into a transformer block: \begin{align}\label{eqn:transformer} \begin{aligned} \tsf{TRANSFORMER}(h_v, \{h_u, g_{uv}\}_{u \in N(v)}) &= \tsf{LN}(\tilde{h}_v + \tsf{FF}(\tilde{h}_v))\\ \tilde{h}_v &= \tsf{LN}(h_v + \tsf{ATTN}(h_v, \{h_u, g_{uv}\}_{u \in N(v)})) \end{aligned} \end{align} After defining the basic mechanisms, we write the node and edge update rules as follows: \begin{align}\label{eqn:grande_base} \begin{aligned} h^{(l+1)}_v &= \tsf{CONCAT} \left(\phi^{(l+1)}_v, \psi^{(l+1)}_v\right) \\ g^{(l+1)}_{uv} &= \tsf{CONCAT} \left(\theta^{(l+1)}_{uv}, \gamma^{(l+1)}_{uv}\right) \\ \phi^{(l+1)}_v &= \tsf{TRANSFORMER}^{\tsf{node}}_{\tsf{in}}\left(\Phi_N h_v^{(l)}, \{\Phi_N h^{(l)}_u, \Phi_E g^{(l)}_{uv}\}_{u \in N^+(v)}\right) \\ \psi^{(l+1)}_v &= \tsf{TRANSFORMER}^{\tsf{node}}_{\tsf{out}}\left(\Psi_N h_v^{(l)}, \{\Psi_N h^{(l)}_u, \Psi_E g^{(l)}_{uv}\}_{u \in N^-(v)}\right) \\ \theta^{(l+1)}_{uv} &= \tsf{TRANSFORMER}^{\tsf{edge}}_{\tsf{in}}\left(\Theta_N g_{uv}^{(l)}, \{\Theta_N g_{uv}^{(l)}, \Theta_E \tilde{h}^{(l)}_{pq, uv}\}_{pq \in \overline{N_L^+(uv)}}\right) \\ \gamma^{(l+1)}_{uv} &= \tsf{TRANSFORMER}^{\tsf{edge}}_{\tsf{out}}\left(\Gamma_N g_{uv}^{(l)}, \{\Gamma_N g_{uv}^{(l)}, \Gamma_E \tilde{h}^{(l)}_{uv, rs}\}_{rs \in \overline{N_L^-(uv)}}\right) \end{aligned} \end{align} The updating equations \eqref{eqn:grande_base} involve many learnable parameters, to which we apply the following naming convention: We use upper case greek letters $\Phi, \Psi, \Theta, \Gamma$ to denote projection matrices that takes value in $ \mathbb{R}^{2d \times d} $, and we use the subscript $N$ for \emph{node-related projection} and $E$ for \emph{edge-related projection}. The $\tsf{COMBINE}^{\tsf{type}}$ operation is set to be element-wise addition. \paragraph{Improvements over edge-property prediction tasks} The architecture in \eqref{eqn:grande_base} is most helpful when the underlying task is to predict properties of some existent edges, which serves as the underlying task for many financial applications like fraud detection and AML. Toward this goal, an ad-hoc solution is to base the prediction with respect to edge $ (u, v) $ upon the concatenation of $h_u$, $h_v$ and $g_{uv}$. According to recent practices over pairwise learning on graphs \cite{wang2019nan, wang2021pairwise}, incorporation of interactions between $ N(u) $ and $ N(v) $, or \emph{cross node interactions} significantly improves prediction performance. However, the cross-node attention module proposed in \cite{wang2019nan} requires full attention between $ h_{N(u)} $ and $ h_{N(v)} $, yielding a potentially large computation overhead. Here we provide a more efficient alternative to model the cross-node interactions called the \emph{cross-query attention} module. Given a node pair $ (u, v) $, compute \begin{align}\label{eqn:cross_query_attn} \begin{aligned} \delta_{uv} &= \tsf{CONCAT}\left(\tsf{ATTN}_{\tsf{left}}^{\tsf{in}}(h_u, \{h_r, g_{rv}\}_{r \in N^+(v)}), \tsf{ATTN}_{\tsf{left}}^{\tsf{out}}(h_u, \{h_s, g_{vs}\}_{s \in N^-(v)})\right) \\ \delta_{vu} &= \tsf{CONCAT}\left(\tsf{ATTN}_{\tsf{right}}^{\tsf{in}}(h_v, \{h_r, g_{ru}\}_{r \in N^+(u)}), \tsf{ATTN}_{\tsf{right}}^{\tsf{out}}(h_v, \{h_s, g_{us}\}_{s \in N^-(u)})\right) \end{aligned} \end{align} The above procedure \eqref{eqn:cross_query_attn} performs four queries that attends $u$ and $v$ to its opponent's in and out neighbors, respectively. Providing the existence of an edge $(u, v)$, the mechanism \eqref{eqn:cross_query_attn} could be understood as attending nodes to the a specific subsets of their \emph{second-order} neighborhoods which have close relationship to the edges of interest. Finally we summarize the previous developments into a framework termed multi\textbf{G}raph t\textbf{RAN}sformer with \textbf{D}uality \textbf{E}nhancement (GRANDE) , that utilizes the following edge representation for edge-property prediction tasks: \begin{align} g^{\tsf{GRANDE}}_{uv} = \tsf{CONCAT}(g_{uv}, h_v, h_u, \delta_{uv}, \delta_{vu}) \end{align} \subsection{Extension to temporal graphs} According to the formulation in section \ref{sec:problem_formulation}, extending the GRANDE framework to $G(\mathcal{T})$ requires utilization of the edge-wise timestamp information $ \{t_{uv}, (u, v) \in E \} $ to produce \emph{time-aware node and edge representations}. Inspired by recent developments of time-aware representation learning approaches \cite{xu2019self, xu2020inductive}, we propose an \emph{extended generic time encoding} mechanism that enhances the node and edge update rule of BiMPNN-DE with temporal information. Finally, to better exploit the structure of the temporal graph, we suggest a \emph{pruning strategy} that shrinks the number of edges of $ \overline{L(G_{\mathcal{T}}))} $ by a factor up to two. \paragraph{Generic time encoding} The functional time encoding (FTE) provides a principled way that modifies the self-attention operation \eqref{eqn:attention} with minimal architecture change: \begin{align}\label{eqn:temporal_attention} \begin{aligned} \tsf{TATTN}(h_v, \{h_u, g_{uv}\}_{u \in N(v)}) &= \sum_{u \in N(v) \cup \{v\}} \alpha_{uv} W_N \check{h}_{uv} + \beta_{uv} W_E \check{g}_{uv} \\ \alpha_{uv} &= \dfrac{\exp\left(\langle W_Q h_v, W_K \check{h}_{uv}\rangle / \sqrt{d} \right)}{\sum_{u \in N(v) \cup \{v\}}\exp\left(\langle W_Q h_v, W_K \check{h}_{uv}\rangle/ \sqrt{d}\right)} \\ \beta_{uv} &= \dfrac{\exp\left(\langle W_Q h_v, W_E \check{g}_{uv}\rangle/ \sqrt{d}\right)}{\sum_{u \in N(v) \cup \{v\}}\exp\left(\langle W_Q h_v, W_E \check{g}_{uv} \rangle/ \sqrt{d}\right)} \\ \check{h}_{uv} &= \tsf{CONCAT}(h_u, \tsf{TE}(|\Delta t_{uv}|)) \\ \check{g}_{uv} &= \tsf{CONCAT}(g_{uv}, \tsf{TE}(|\Delta t_{uv}|)) \end{aligned} \end{align} Where $ \tsf{TE}(|\Delta t_{uv}|) $ is temporal embedding obtained via certain FTE mechanisms. In this paper we will follow the Bochner-type FTE \cite{xu2019self, xu2020inductive}: \begin{align} \tsf{TE}(s) = \sqrt{\frac{1}{d}} \left[ \cos(\rho_1 s), \sin(\rho_1 s), \ldots, \cos(\rho_d s), \sin(\rho_d s)\right] \end{align} with learnable parameters $(\rho_1, \ldots, \rho_d)$. According to the setup in \cite{xu2020inductive}, timestamps are associated with nodes rather than edges, hence the authors used the time difference $ \Delta t_{uv} = t_u - t_v $. The situation becomes more complicated when timestamps are associated with edges, for which we propose the following modification: \begin{align}\label{eqn:edge_time_difference} \Delta t_{uv} = t_{uv} - \min_{u \in N(v)}t_{uv} \end{align} We use FTE based on \eqref{eqn:edge_time_difference} and replace the \tsf{ATTN} component with \tsf{TATTN} component of the node time difference calculation in the node update part of \eqref{eqn:grande_base}. For the edge update part, the ordinary node time difference method applies naturally since edge timestamps act as node timestamps in the dual formulation. \paragraph{Temporal information and pruning strategies} the proposed line graph augmentation strategy produces an undirected $ \overline{L(G)} $. While this undirected network might provide valuable information in general, in financial risk management scenarios where edges represent \emph{timestamped transactions}, directed adjacencies between transactions are typically of interest: Consider a transaction $ e_{t_0} $ from Bob to Alice, it is reasonable to assume that \emph{downstream} transactions of $ e_{t_0} $ (i.e., transactions $ e_t $ with $ t > t_0 $) will be affected by $ e_{t_0} $, but its upstream transactions shall not be affected. Inspired from this intuition, we introduce a \emph{causal pruning strategy} that applies when temporal information is available in the underlying graph, i.e, for an edge $ e $ that goes from $ u $ to $ v $, we have its time of occurrence $ t_e $. The causal pruning strategy deletes edges in $ \overline{L(G)} $ with the occurrence time of the head node is earlier than that of the tail node. When the causal pruning strategy is applicable, we may prune up to $50\%$ of the edges in $ \overline{L(G)} $. Note that the proposed strategy is closely related to the construction of causal temporal subgraphs in temporal graph modeling literature \cite{xu2020inductive, ddgcl}. \subsection{Scalability and complexity} Most of the real-world financial networks like transaction networks are \emph{sparse}, i.e., most people only make transactions to a few others given a finite time window. Consequently, the computational complexity of any message passing neural networks could be roughly regarded as $O(Ed^2)$. Extending ordinary MPNN architectures to BiMPNN protocol doubles the computation cost, which could be easily resolved through parallelization in modern deep learning frameworks like tensorflow \cite{abadi2016tensorflow}. The extra computational cost brought by introducing the dual component \eqref{eqn:bimpnnde} requires more care: even when the original graph is sparse, its augmented edge adjacency graph might be dense or even complete. Such cases does happen in realistic scenarios since large hubs frequently exist in transaction networks, which corresponds to a complete subgraph in the dual network. Therefore the worst case computation cost of $O(E^2d^2)$ is sometimes inevitable in architectures derived from the BiMPNN-DE protocol \eqref{eqn:bimpnnde}. Hence to meet the computational requirement of GNN architectures like GRANDE , performing GNN training/inference over the whole graph is unrealistic. Instead we resort to a \emph{local} computation alternative implemented by the AGL system \cite{zhang2020agl} which grabs the $K$-hop rooted subgraph of each target node and performed batched stochastic training and efficient parallel inference given distributed infrastructures like MapReduce \cite{zhang2020agl}. In practical scenarios, it is often reasonable to set an upper bound $M_{\tsf{max}}$ on the edges of any $K$-hop rooted subgraph and device proper sampling methods to meet the requirement. The resulting computational complexity during training is reduced to $O(BM^2_{\tsf{max}}d^2)$, where $B$ denotes the batch size. Since we may control $M_{\tsf{max}}$ so that the whole batch of subgraphs fits the storage requirement of high-performance hardwares like GPU, the computational costs of running GRANDE becomes fully affordable for industry-scale distributed training and inference. \section{Related Works} \subsection{Neural models over directed graphs} Directional extensions of message passing GNN protocol was mentioned in pioneer works \cite{pmlr-v70-gilmer17a, battaglia2018relational} without providing empirical evaluations. Recent developments toward designing GNNs for digraphs are mostly inspired by different types of graph Laplacians that are defined over digraphs. For example, \cite{NEURIPS2020_cffb6e22} used the definition in \cite{chung2005laplacians} and \cite{zhang2021magnet} used the Hermitian magnetic Laplacian to decouple the aggregation process of graph connectivey and edge orientations. \subsection{GNNs for edge representation learning} The idea of utilizing node-to-edge duality was explored in early works like LGNN \cite{chen2017supervised}, where the authors drew insights from community detection literature, and use the non-backtracking walk operator \cite{krzakala2013spectral} to define the dual graph, and perform GCN-like aggregations simultaneously over both graphs. Later developments \cite{jiang2020censnet, cai2020line, jo2021edge} focused on variants of LGNN with the alternative definition of the dual, such as the standard LINE graph \cite{godsil2001algebraic}. \subsection{Transformer architectures over graphs} The renowned GAT architecture \cite{velivckovic2017graph} could be regarded as using the \emph{additive} attention mechanism to form the attention layer, as opposed to the \emph{multiplicative} attention mechanism adopted by the Transformer architecture \cite{vaswani2017attention}. Adaptations of the original Transformer to graph context have been assessed recently, \cite{dwivedi2020generalization} replaced the additive attention in GAT with inner product attention, and use spectral embedding as a proxy for the positional embedding component in the original transformer architecture. In \cite{ying2021transformers}, the authors proposed to use \emph{full-attention} transformers and use graph-theoretical attributes of nodes and edges to guide the attention procedure. While the results were shown competitive over biological benchmarks, the computational overhead is way to heavy for industrial-level graphical applications. \section{Experiments} In this section we report empirical evaluations of GRANDE over an industrial application as well as assesments over public datasets. We focus on the edge classification task over temporal directed multigraphs. Finally we present a detailed ablation study to decompose the contributions of different constituents of GRANDE . \subsection{Datasets} We use one industrial dataset and two public datasets, with their summary statistics listed in table \ref{tab:dataset_summary}. \paragraph{AML dataset} This dataset is generated from transaction records collected from Alipay, one of the world's leading online payment systems. The business goal is to identify transactions that exhibit risky patterns as being highly suspicious of money laundering. The underlying graph is constructed via treating users as nodes and transactions as directed edges with arbitrary multiplicity. We engineer both node and edge feature under a two-stage process: We first obtain raw node features via statistical summaries of corresponding user's behavior on the platform during specific time periods, and raw edge features consist of transaction properties as well as related features of two users involved in the transaction. \footnote{Per organizational regulations, the detailed feature engineering logic is not fully described. We will consider (partially) releasing the AML dataset after passing relevant security checks of the company.} The decision tree feature transform \cite{he2014practical} is then applied to both features so that after the transform, the input node and edge feature for all the assessed models are sparse categorical features with dimension $6400$. For both training and testing, we collect data under a $10$-day period with no overlap between the training period and the testing period. A random subset corresponds to 10\% of the testing data is held out for validation. \paragraph{Bitcoin datasets} We use two who-trusts-whom networks of people who trade using Bitcoin on two different platforms, Bitcoin OTC and Bitcoin Alpha \cite{kumar2016edge, kumar2018rev2}. Both networks are directed without edge multiplicities, each edge is associated with a timestamp and a trust score ranging from $-10$ to $10$. We consider the task of binary edge classification with edge labels generated as whether the trust score is negative. Using node features represented as the concatenation of one-hot representation of in and out degree of nodes. For both datasets, we use the chronological split that uses $70\%$ data for training, $10\%$ for validation and $20\%$ for testing \begin{table} \centering \begin{tabular}{c|c|c|c|c|c|c} & \# Nodes & \# Edges & \# Positive edges & \# Negative edges & \# Node features & \# Edge features \\ \hline AML & $10268164$ & $13335278$ & $1338425$ & $11996853$ & $6400$ & $6400$ \\ Bitcoin-otc & $5881$ & $35592$ & $3563$ & $32029$ & $12012$ & $-$ \\ Bitcoin-alpha & $3783$ & $24186$ & $1536$ & $22650$ & $15210$ & $-$ \\ \end{tabular} \caption{Summary statistics of the evaluation datasets} \label{tab:dataset_summary} \end{table} \subsection{Baselines} We compare the proposed GRANDE framework with the following types of baselines: \begin{description} \item[Undirected approaches] We consider two representative GNN architectures GCN \cite{kipf2016semi} and GAT \cite{velivckovic2017graph} that operate on undirected graphs. Since temporal information is available in all three datasets, we also include the TGAT architecture \cite{xu2020inductive}. As all the aforementioned methods produce node-level representations, we use the concatenation of node representations as edge representation according to the adjacency structure. As frameworks that directly outputs edge representation remains few, we include the EHGNN architecture \cite{jo2021edge} as a strong baseline. To make the undirected architectures compatible with directed (multi)graphs, we add reverse edges with duplicated edge feature if there exists no edge multiplicities in the digraph. Otherwise, we keep only one edge between each pair of nodes, with the corresponding edge feature generated via aggregating the original edge features (according to the "multigraph to graph" hierarchy) using the DeepSet method \cite{zaheer2017deepsets}, and add reverse edges thereafter. \item[DiGraph-oriented approaches] We consider two digraph GNN architectures that utilizes different notions of directed graph Laplacians, DGCN \cite{ma2019spectral} and MagNet \cite{zhang2021magnet}. \end{description} The aforementioned baselines exclude some of the recently proposed state-of-the-art GNN models like Graphormer \cite{ying2021transformers} for undirected graphs or directed approaches like DiGCN \cite{NEURIPS2020_cffb6e22} due to scalability issues, i.e., they require either full graph attention or solving eigen programs over the full graph Laplacian, which are computationally infeasible for industry-scale graphs. \subsection{Experimental setup}\label{sec: exp_setup} Across all the datasets and models, we use a two-layer architecture with hidden dimension $d=128$ without further tuning. For models with generic time encodings, we fix the dimension of time encoding to be $128$. For transformer related architectures, we follow the practice in \cite{vaswani2017attention} and use a two-layer MLP with ReLU activation with hidden dimension $512$. As all the relevant tasks are binary classifications, we adopt the binary cross entropy loss as the training objective, with $\ell_2$ regularization under a coefficient $0.0001$ uniformly across all experiments. The graph data are constructed via the GraphFlat component of the AGL system \cite{zhang2020agl} that transforms the raw graph data into batches of subgraphs with appropriate sampling. \footnote{The AGL framework is particularly useful when dealing with industry-scale graphs that are barely possible to process as a whole. However it may lose some information in the sampling stage of the preprocessing phase. To fully mimic the industrial setup, we preprocess all three datasets using AGL, therefore the results of Bitcoin datasets are not directly comparable to previous published results. } We use Adam optimizer with a learning rate of $0.0001$ across all tasks and models. For the bitcoin datasets, we train each model for $10$ epochs using a batch size of $128$ and select the best-performed one according to the roc-auc score on the validation data under periodic evaluations every $100$ steps. For the AML dataset, we train the model for $2$ epochs with a batch size of $256$ as the size of the dataset is sufficiently large. We adopt similar model selection criterion as those of Bitcoin datasets, with periodic evalutions every $500$ steps. \paragraph{Metrics} Since the primary focus of this paper is applications to the FRM scenario, we choose three representative metrics, namely roc-auc score (AUC), Kolmogorov-Smirnov statistic (KS) and F$1$ score (F$1$). \subsection{Performance} We present evaluation results in table \ref{tab:dataset_results}. Apart from the proposed GRANDE architecture, we report a \emph{reduced} version of GRANDE via discarding all operations on the augmented edge adjacency graph, as well as the cross-query attention module \eqref{eqn:cross_query_attn}. The resulting model could be considered as implementing a time-aware variant of graph transformer under the BiMPNN protocol. We summarize our experimental findings as follows: \begin{itemize} \item For the Bitcoin datasets which could be considered as under the \emph{weak feature} regime, the GRANDE architecture obtains substantial performance improvement: On the Bitcoin-OTC dataset, the relative improvement over the best baselines are $10.1\%$, $30.7\%$ and $22.6\%$ with respect to AUC, KS and F$1$. On the Bitcoin-Alpha dataset, the relative improvement is more significant with $17.2\%$, $44.4\%$ and $29.0\%$ respectively. We attribute the improvements to both the directional information and the duality information that GRANDE utilizes. The improvements of the directional information could be inferred from the results of the reduced GRANDE variant, which exhibits solid improvements over all the baselines. The incorporation of edge-to-node duality and cross-query attention systematically encodes more structural information, therefor yield further improvements. \item For the AML dataset which could be regarded as under the \emph{strong feature} regime, the performance improvement is significant with respect to KS and F$1$ metrics, while being less significant with respect to AUC. Such improvements is still valuable in FRM applications, since higer F$1$ score potentially suggests better patterns of the precision-recall (PR) curve, which we plot in figure \ref{fig:precision_recall}. The PR curve shows the dominate performance of GRANDE against baselines: under various precision levels, the recall of GRANDE surpasses the best baseline (TGAT) by as many as $5.29\%$ in absolute value and $13.4\%$ in relative. \end{itemize} \begin{figure} \centering \input{precision_recall.tex} \caption{Precision-recall (PR) curve under the AML dataset. We show recall values corresponding to high precision ranges (from $0.7$ to $0.975$ equally spaced with $0.025$)} \label{fig:precision_recall} \end{figure} \begin{table}[] \centering \begin{tabular}{c|ccccccccc} & \multicolumn{3}{c}{Bitcoin-OTC} & \multicolumn{3}{c}{Bitcoin-Alpha} & \multicolumn{3}{c}{AML}\\ & AUC & KS & F$1$ & AUC & KS & F$1$ & AUC & KS & F$1$ \\ \hline GCN & $0.742$ & $0.376$ & $0.432$ & $0.626$ & $0.198$ & $0.282$ & $0.958$ & $0.793$ & $0.704$\\ GAT & $0.736$ & $0.381$ & $0.393$ & $0.626$ & $0.178$ & $0.269$ & $0.962$ & $0.802$ & $0.718$\\ TGAT & $0.744$ & $0.401$ & $0.422$ & $0.656$ & $0.248$ & $0.294$ & $0.963$ & $0.804$ & $0.720$ \\ EHGNN & $0.719$ & $0.356$ & $0.420$ & $0.626$ & $0.228$ & $0.297$ & $0.961$ & $0.804$ & $0.718$\\ DGCN & $0.634$ & $0.243$ & $0.354$ & $0.633$ & $0.228$ & $0.282$ & $0.962$ & $0.806$ & $0.720$\\ MagNet & $0.753$ & $0.388$ & $0.434$ & $0.645$ & $0.217$ & $0.293$ & $0.954$ & $0.780$ & $0.688$\\ \hline GRANDE (reduced) & $0.789$ & $0.459$ & $0.460$ & $0.669$ & $0.256$ & $0.294$ &$0.965$ & $0.810$ & $0.726$\\ GRANDE & $0.829$ & $0.524$ & $0.532$ & $0.769$ & $0.415$ & $0.398$ & $0.966$ & $0.813$ & $0.734$ \end{tabular} \caption{Experimental results over tow public Bitcoin datasets and the AML dataset {\color{scarlet} \bf tbd}} \label{tab:dataset_results} \end{table} \subsection{Ablation study} We evaluate the following variants of GRANDE over all three datasets to investigate contributions of different constituents: \begin{description} \item[Reduced version] this is the one reported in table \ref{tab:dataset_results} \item[Without causal pruning] in this model variant we retain the full edge adjacency graph without pruning. Which is computationally more heavy than the GRANDE architecture \item[Without time encoding] in this model variant we discard the temporal component of GRANDE and use the update rule \eqref{eqn:grande_base} \item[Without cross-query attention] in this model variant we discard the cross-query attention module \eqref{eqn:cross_query_attn}, and use $ \tsf{CONCAT}(g_{uv}, h_v, h_u) $ as the output embedding for edge $(u, v)$. \item[With line graph] in this model variant, we use the ordinary directed line graph instead of the proposed augmented edge adjacency graph. i.e., we replace $\overline{N_L^+(uv)}$ and $\overline{N_L^-(uv)}$ in \eqref{eqn:grande_base} with $N_L^+(uv)$ and $N_L^-(uv)$, respectively. \end{description} \paragraph{Results} we report results in table \ref{tab:ablation_study} using the same training configuration and evaluation metrics as in section \ref{sec: exp_setup}. There are a couple of notable observations: Firstly, the causal pruning procedure saves computation as well as improves performance, providing a solid relational inductive bias in temporal graph modeling. Secondly, the incorporation of time encoding and cross-query attention are in general helpful, but \skeptical{may slightly reduce certain metrics in different underlying data}. Finally, using the ordinary line graph results in \skeptical{drastic} performance degradation than the proposed augmented edge adjacency graph, thereby verifying its efficacy. \begin{table}[] \centering \begin{tabular}{l|ccccccccc} & \multicolumn{3}{c}{Bitcoin-OTC} & \multicolumn{3}{c}{Bitcoin-Alpha} & \multicolumn{3}{c}{AML}\\ & AUC & KS & F$1$ & AUC & KS & F$1$ & AUC & KS & F$1$ \\ \hline GRANDE & $0.829$ & $0.524$ & $0.532$ & $0.769$ & $0.415$ & $0.398$ & $0.966$ & $0.813$ & $0.734$ \\ - reduced & $0.789$ & $0.459$ & $0.460$ & $0.669$ & $0.256$ & $0.294$ &$0.965$ & $0.810$ & $0.726$ \\ - w/o causal pruning & $0.801$ & $0.464$ & $0.485$ & $0.726$ & $0.325$ & $0.339$ & $0.966$ & $0.813$ & $0.732$ \\ - w/o time encoding & $0.834$ & $0.525$ & $0.531$ & $0.691$ & $0.265$ & $0.324$ & $0.966$ & $0.813$ & $0.731$ \\ - w/o cross-query attention & $0.828$ & $0.528$ & $0.504$ & $0.759$ & $0.382$ & $0.385$ & $0.966$ & $0.813$ & $0.730$ \\ - w line graph & $0.762$ & $0.405$ & $0.415$ & $0.655$ & $0.228$ & $0.285$ & $0.965$ & $0.812$ & $0.729$ \end{tabular} \caption{Ablation study results {\color{scarlet} \bf tbd}} \label{tab:ablation_study} \end{table} \section{Deployments} The proposed GRANDE model has already been deployed in Alipay's AML risk detection system that \todo{mention a little bit about traffic and other stuff here, mbq}. Here we conduct an (offline) comparison between GRANDE and two baseline methods: Rule-based system and TGAT. The results are summarized in table \ref{tab:deployment}. The results suggest that GRANDE offers better recall given the same precision level, with an absolute margin of $2.39\%$, which is consistent with our experimental findings. \begin{table}[] \centering \begin{tabular}{c|c|c|c} Model & Mock FPR & Mock Precision & Recall \\ \hline Rule-based system & $0.075$ & $0.925$ & $0.454$ \\ TGAT & $0.041$ & $0.959$ & $0.723$ \\ GRANDE & $0.041$ & $0.959$ & $0.747$ \end{tabular} \caption{Deployment summaries {\color{scarlet} \bf tbd}} \label{tab:deployment} \end{table} \section{Discussion} \paragraph{Interpretability} The dominating performance of neural approaches comes at the cost of lacking of \emph{model interpretablity}, which is crucial to application scenarios like AML, where outputs of decision making systems tie strongly with regulatory strictures \cite{kute2021aml}. The adoption of neural approaches enjoys better performance than potentially interpretable methods like linear models as well as losing interpretability. Model explanation methods targeting graph neural models are especially challenging \cite{liu2022interpretability} due to the combinatorial nature of the interpretation problem. Off-the-shelf GNN explaining tools (refer to \cite{liu2022interpretability} and references therein) are not yet applicable to neural models over directed graphs, which is a promising and challenging direction for future explorations. \paragraph{Multi-task adaptations} The representation quality in both node and edge embeddings gives the GRANDE architecture the possibility to exploit side-information via multi-task learning paradigms \cite{ruder2017overview}. For example it is quite common in FRM scenarios to obtain both a set of user riskiness labels alongside transaction labels. We have taken a trivial adaptation of GRANDE into multi-task setups using extra node labels via adding a node-level classification loss to the training objective and has shown solid improvement (we report results in appendix {\color{scarlet} \bf tbd}). Applying more elegant multi-task learning techniques \cite{ruder2017overview} to further exploit the potential of GRANDE is an interesting direction for future studies. \section{Conclusion} In this paper we propose a graph representation learning framework for directed multigraphs that prevail in FRM applications. The proposed framework generalizes the acclaimed message passing graph neural network protocol to incorporate directional information, as well as utilizing the edge-to-dual relationship to further enhance the relational inductive bias with regard to edge property prediction tasks. A concrete architecture named GRANDE is derived according to the proposed protocol with the transformer architecture being its aggregation mechanism, as well as a cross-query attention module targeting edge-type tasks. The GRANDE model is generalizable to temporal dynamic graphs via proper generic time encodings along with a pruning strategy. Experimental results over both public and industrial datasets verifies the efficacy of the design of GRANDE . The model has been deployed in Alipay's online risk management system to fight against financial crime in money laundering. \bibliographystyle{alpha} \section{Introduction} Recent years have witnessed an increasing trend of adopting modern machine learning paradigms to financial risk management (FRM) scenarios \cite{akib2020ML4fin}. As a typical use case in operational risk scenarios like fraud detection and anti-money laundering, the identification of risky entities (user accounts or transactions) is cast into a supervised classification problem using behavioral data collected from the operating financial platform \cite{chen2018machine, kute2021aml}. For institutions like commercial banks and online payment platforms, the most important source of behavior information is the \emph{transaction records} between users. making \emph{transaction networks} (with users as nodes and transactions as edges) a direct and appropriate data model. Unlike standard pattern recognition tasks like image recognition where decisions are made according to information of individual objects, identification of risky patterns over transaction network requires reasoning beyond any individual scope. The phenomenon is particularly evident in the area of anti-money laundering (AML), where suspicious transactions are usually related by several users or accounts, with transactions between them being highly correlated, thereby exhibiting a cascading pattern which makes i.i.d. approaches in machine learning unsuitable. The surging developments of machine learning models over graphs, especially graph representation learning \cite{hamilton2020graph}, have attracted significant attention in the financial industry and have shown promising results in the area of FRM \cite{liu2018heterogeneous, liu2021intention}. The dominant practice in graph representation learning is to utilize the panoply of graph neural networks (GNN) \cite{battaglia2018relational} that produce node-level representations via principled aggregation mechanisms which are generally described via message passing protocols \cite{pmlr-v70-gilmer17a} or spectral mechanisms \cite{kipf2016semi}. \par Despite their convincing performance, the majority of the existent GNN models operate over \emph{undirected graphs}, which makes them inadequate for the direct modeling of transaction networks. Firstly, many graphs that arise in FRM applications are directed by nature: i.e., in the case of a transaction network with users as nodes and transactions as edges, the direction of an edge is typically understood as the direction of its corresponding cash flow. In areas like anti-money laundering (AML), directional information is generally perceived to be of significant importance and shall not be neglected \cite{Sudjianto2010Statistical}. Secondly, there might exist multiple transactions between certain pairs of users. Thirdly, transactions are naturally associated with timestamps that indicate the time of occurrence. Therefore, to fully utilize the graphical structure of transaction networks, we need representation learning frameworks that support \emph{temporal directed multigraphs}. While recent progress on \emph{dynamic graph neural networks} \cite{xu2020inductive, kazemi2020representation} provide appropriate methods to handle temporality, discussions over neural architectures that supports directed multigraphs remains nascent \cite{pmlr-v70-gilmer17a, ma2019spectral, tong2020directed, NEURIPS2020_cffb6e22, zhang2021magnet}.\par From a practical point of view, the targeted risky entities may be either node (i.e., malicious users) or edges (i.e., suspicious transactions). Conventional GNN architectures produce node-level representations via encoding information of each node's rooted subtrees \cite{xu2018how}, making them a good fit for \emph{user or account level} risk identifications. When the underlying task is to detect risky transactions, the prevailing practice is to present edges using a combination of node representations corresponding to both ends of edges. While such design may be adequate for tasks like link prediction, it lacks a way to effectively integrate edge-level information into the edge representation. Since financial networks usually contain rich edge-level features (i.e., detailed transaction-related information), refinements on edge-level representations are needed. For example, to accurately represent a transaction, we need to combine the information of its buyer (cash sender) and seller (cash receiver), and the transaction-related information, with each of them requiring aggregating relevant information from related users and transactions. \begin{figure} \centering \scalebox{.6}{\input{digraph.tex}} \caption{Illustration on the deficiency of the directed message passing protocol in \cite{battaglia2018relational}: suppose the node of interest is $ n_0 $, using GNNs designed according to the protocol in \cite{battaglia2018relational}, it becomes impossible for $ n_0 $ to aggregate information of $ n_9 $ and $ n_{10} $. Under the context of financial risk management, suppose $ n_9 $ and $ n_{10} $ corresponds to known fraudsters, and edges correspond to transactions. Although the riskiness of $ n_5 $ might be undetermined, the transaction pattern makes it highly suspicious and therefore uplifts the riskiness of $ n_0 $. To build models that behave coherently with the above reasoning process, GNN protocols that aggregates information from \emph{both directions} are required } \label{fig:digraph_illustration} \end{figure} A recent line of work \cite{jiang2020censnet, cai2020line, jo2021edge} focused directly on \emph{learned edge representations} using the idea of \emph{edge-to-node duality} and obtained satisfactory performance over downstream tasks like edge classification. However, previous works on edge representation learning all applies to undirected graphs, making the extension to transaction networks highly non-trivial.\par In this paper, we propose a general message passing neural network protocol that simultaneously outputs node and edge representations over directed multigraphs. Based on this protocol, we derive a GNN architecture called GRANDE with an extension to temporal graphs that efficiently leverages the underlying structural property of transaction networks. More specifically, we summarize our contribution as follows: \begin{itemize}[leftmargin=*] \item We develop a novel bi-directional message passing protocol with duality enhancement (BiMPNN-DE) that strengthens previous proposals over message passing neural architectures over directed multigraphs. The improvement is two-fold: Firstly, it effectively combines neighborhood information from both incoming and outgoing edges of nodes. Secondly, it simultaneously outputs node and edge representations via performing message passing over both the original graph and its \emph{augmented} edge adjacency graph. \item We derive a concrete GNN architecture following the proposed BiMPNN-DE protocol called GRANDE, that devices the acclaimed transformer \cite{vaswani2017attention} mechanism for neighborhood aggregation. The proposed GRANDE framework is made compatible with temporal directed multigraphs through the integration of a generic time encoding module that further extends previous works on dynamic graph modeling \cite{xu2020inductive}. \item To show the practical effectiveness of GRANDE, we apply it to a suspicious transaction identification task in anti-money laundering, with the underlying transaction network data collected from one of the world's leading online payment platforms. Comparisons against various undirected and directed GNN baselines show the superiority of the proposed model. We also provide evaluations on two public datasets generated from transaction networks to further verify the strength of GRANDE framework when underlying graph features are relatively weak. \end{itemize} \section{Methodology} \subsection{Problem formulation}\label{sec:problem_formulation} Under the context of financial risk management, we consider the following \emph{event stream} representation of recorded transaction data that are available in most online transaction systems: \begin{align} \mathcal{E} = \{(u_1, v_1, t_1, \chi_1), (u_2, v_2, t_2, \chi_2), \ldots \} \end{align} Each event $ (u, v, t, \chi) $ is interpreted as a transaction from user $u$ to user $v$ that occurred at time $t$, with related features $\chi$ that could often be further decomposed as user-level features like user account information, and event-level features like transaction amount and channels. In this paper, we focus on the representative task of \emph{transaction property prediction} that typically takes the form of binary classification that aims at identifying illicit or fraudulent transactions. The task could be cast into a graph learning problem of edge classification in a straightforward manner. We consider the temporal graph modeling paradigm \cite{kazemi2020representation} that views the underlying temporal graph as being generated from the event stream $\mathcal{E}$. Therefore, given a time period $\mathcal{T} = [\tau_{\tsf{start}}, \tau_{\tsf{end}}]$, we construct the graph data as the snapshot $G(\mathcal{T}) = (V(\mathcal{T}), E(\mathcal{T}))$ of the underlying temporal graph. Since there may exist multiple transactions between the same set of users, we consider $G(\mathcal{T})$ to be a \emph{directed multigraph} with each edge in the edge multiset $ E(\mathcal{T}) $ represents an event that happens inside the time interval $\mathcal{T}$, and the node set $ V(\mathcal{T}) $ consists of related users corresponding to the included events. During the training stage, we construct a snapshot $G(\mathcal{T}_{\tsf{train}})$, and obtain a possibly incomplete set of edge labels that are understood as edge properties annotated using expert knowledge. During testing stage, we perform inference over snapshots $G(\mathcal{T}_{\tsf{test}})$ that are based on later time intervals than $\mathcal{T}_{\tsf{train}}$. We assume $\mathcal{T}_{\tsf{train}} \cap \mathcal{T}_{\tsf{test}} = \emptyset $, hence the problem of interest could be viewed as \emph{inductive edge classification over temporal graphs}. \subsection{Message passing protocols and directed graphs} Let $ G = (V, E) $ be a directed multigraph with node set $ V $ and edge multiset $ E $. For any pairs of nodes $ (u, v) $, denote $ \mu(u, v) $ as the number of edges going from $ u $ to $ v $. Then $ G $ becomes a (simple) graph when $ \max_{u \in V, v \in V} \mu(u, v) \le 1 $. For each $ v \in V $, denote $ N^+(v) = \{u, (v, u) \in E\} $ and $ N^-(v) = \{u, (u, v) \in E\} $ as its out-neighborhood and in-neighborhood respectively, and let $ N(v) = N^+(v) \cup N^-(v) $ be its neighborhood. For the sake of presentation clarity, we will overload the notation $uv$ for both an edge in the undirected graph, or a directed edge from $u$ to $v$ in a directed (multi)graph from time to time, with its exact meaning being clear from the context. We are interested in the general case where both node features $ X = \{x_v\}_{v \in V} $ and edge features $ Z = \{z_{uv}\}_{(u, v) \in E} $ are available, where we assume both kinds of features to be of dimension $d$. In this paper we focus on neural approaches to such directed multigraphs. A good starting point is the neural message passing scheme for undirected graphs \cite{pmlr-v70-gilmer17a}: let $ h^{(l)}_v $ denote the hidden representation of node $ v $ at the $ l $-th layer of the network, and $ h^{(0)}_v = x_v, \forall v \in V $. The message passing graph neural network protocol (abbreviated as GNN hereafter) is described recursively as: \begin{align}\label{eqn:gnn_undirected} \resizebox{0.91\linewidth}{!}{$ h^{(l+1)}_v = \tsf{COMBINE}\left( h^{(l)}_v, \tsf{AGG}\left(\tsf{MESSAGE}(h^{(l)}_v, h^{(l)}_u, z_{uv}, u \in N(v))\right)\right) $} \end{align} Different combinations of \tsf{COMBINE}, \tsf{AGG} and \tsf{MESSAGE} mechanisms thus form the \emph{design space} of undirected GNNs \cite{you2020designspace}. To the best of our knowledge, there are three types of generalization strategies to directed graphs: \begin{description} \item[Symmetrization] The most ad-hoc solution is to "make it undirected" via padding necessary reverse edges so that $ N(v) = N^+(v) = N^-(v) $, and apply standard graph neural networks that operate on undirected graphs like GCN or GAT. Despite its simplicity and clearness, the symmetrization approach discards directional information in the digraph and may raise subtleties when dealing with multigraphs. \item[DiGraph-theoretic motivations] A more recent line of work \cite{ma2019spectral, tong2020directed, NEURIPS2020_cffb6e22, zhang2021magnet} drew insights from directed graph theory, especially the spectral branch \cite{chung2005laplacians}. The proposed models are mostly digraph analogs of GCN, without the consideration for edge features, therefore severely limiting the design space of directed message passing GNNs. \item[Directed Protocol] In the seminal work \cite[Algorithm 1]{battaglia2018relational}, the authors proposed a GNN protocol that operates on directed multigraphs with edge features via aggregating messages from only the in-neighborhood, i.e., replacing $ N(v) $ in \eqref{eqn:gnn_undirected} with $ N^-(v)) $. \footnote{The original version also considered incorporation of a \emph{global node} that aggregates information from the whole graph regardless of the connectivity structure. While such design choice may have some gains in moderate size graphs \cite{xiong2021memory}, it does not scale to large graphs. Therefore we will not consider such design choice in this paper} While being a natural extension, such kind of GNN protocol losses information from the outgoing direction of each node. We present a pictorial illustration in figure \ref{fig:digraph_illustration}. \end{description} To address the aforementioned shortcomings, we propose a novel GNN protocol that operates on directed digraphs termed \emph{bi-directional message passing neural network (BiMPNN)}. The protocol extends the standard undirected protocol \eqref{eqn:gnn_undirected} via enabling each node to aggregate information from both its in-neighborhood and out-neighborhood: \begin{align}\label{eqn:bimpnn} \resizebox{0.91\linewidth}{!}{$ \begin{aligned} h^{(l+1)}_v &= \tsf{MERGE}\left(\phi^{(l+1)}_v, \psi^{(l+1)}_v\right) \\ \phi^{(l+1)}_v &= \tsf{COMBINE}_{\tsf{in}}\left( h^{(l)}_v,\right.\\ &\quad \left.\tsf{AGG}_{\tsf{in}}\left(\tsf{MESSAGE}_{\tsf{in}}(h^{(l)}_v, h^{(l)}_u, \blue{z_{uv}}, u \in N^-(v))\right)\right)\\ \psi^{(l+1)}_v &= \tsf{COMBINE}_{\tsf{out}}\left( h^{(l)}_v,\right.\\ &\quad \left.\tsf{AGG}_{\tsf{out}}\left(\tsf{MESSAGE}_{\tsf{out}}(h^{(l)}_v, h^{(l)}_r, \blue{z_{vr}}, r \in N^+(v))\right)\right) \end{aligned} $} \end{align} Despite being more complicated than the undirected protocol, the proposed BiMPNN protocol remains conceptually clear: for each layer, we aggregate separately from each node's in-neighborhood and out-neighborhood using distinct aggregation mechanisms, and merge the two obtained intermediate representations into the next layer's input. Consequently, a $ k $-layer GNN derived from the BiMPNN protocol utilizes both its \emph{root}-$k$ incoming subtree and outgoing subtree, thereby providing a richer set of \emph{relational inductive bias} than the one proposed in \cite{battaglia2018relational}. \subsection{Edge-level task and edge-to-node duality} The BiMPNN protocol \eqref{eqn:bimpnn} provides a principled way of obtaining node representations in directed multigraphs which serves as the building block of \emph{node-level tasks}. Yet another important type of graph-related tasks (in a \emph{local} sense \cite{Scarselli2009}) is \emph{edge-level} tasks, which exhibits a dichotomy between \emph{edge-existence} prediction, i.e., link prediction, and \emph{edge-property} prediction, i.e., edge classification. For the later task type, the very existence of an edge itself suggests basing the predictions on a properly defined \emph{edge representation}, which should go beyond naively concatenating node representations of its ends \cite{jo2021edge}. Although the protocol \eqref{eqn:bimpnn} implicitly encodes edge features into node representations, it ignores the cascading dynamics of edges (i.e., information implied by cash flow in FRM applications). To build powerful edge representations that efficiently adapt to the underlying graph structure. Mechanisms based on the edge-to-node dual graphs, or \emph{line graph}s, have been proposed \cite{chen2017supervised, jiang2020censnet, cai2020line, jo2021edge} under the undirected GNN protocol \eqref{eqn:gnn_undirected}. To begin our discussion on possible extensions to directed multigraphs, we first review the definition of line graphs as follows: \begin{definition}[Line graph and Line digraph \cite{godsil2001algebraic, bang2008digraphs}] For both undirected graph and directed (multi)graphs where we overload notation without misunderstandings, $ G = (V, E) $, the node set of its line graph $ L(G) = (L(V), L(E)) $ is defined as its edge (multi)set $ L(V) = E $.\\ \textbf{Undirected graph} the edge set of its line graph is defined as \begin{align}\label{eqn:line} \resizebox{0.91\linewidth}{!}{$ L(E) = \left\lbrace (uv, rs): (u, v) \in E, (r, s) \in E, \{u, v\} \cap \{r, s\} \ne \emptyset \right\rbrace $} \end{align} \textbf{Directed (multi)graph} the edge set of its line graph is defined as \begin{align}\label{eqn:diline} L(E) = \left\lbrace (uv, rs): (u, v) \in E, (r, s) \in E, v = r\right\rbrace \end{align} \end{definition} For undirected graphs, their line graphs provides a natural way to update edge representations under standard message passing protocols like \eqref{eqn:gnn_undirected}. However, trivially extending \eqref{eqn:bimpnn} using the definition of line digraphs may incur significant information loss: We take the graph in figure \ref{fig:digraph_illustration} as an example, its line graph has an \emph{empty} edge set, which makes the message passing framework useless over the derived line graph. While the graph-theoretic definition enjoys some nice properties \cite{bang2008digraphs}, the adjacency criterion might be overly stringent for deriving useful GNN architectures. Intuitively, we may expect different transactions triggered by the same account as correlated rather than independent, which makes connectivity of edges like $ (n_5, n_9) $ and $ (n_5, n_0) $ as desirable. Therefore, we propose the following \emph{augmentation strategy} to obtain an \emph{augmented edge adjacency graph} $ \overline{L(G)} = (\overline{L(V)}, \overline{L(E)}, T(E)) $: The node set is still defined as $ \overline{L(V)} = E $, and we augment the edge set using the undirected adjacency criterion \eqref{eqn:line}. To retain directional information, we encode the adjacency pattern of two edges (with four possible patterns: \emph{head-to-head}, \emph{head-to-tail}, \emph{tail-to-head}, \emph{tail-to-tail}) into a categorical vector, which we denote as $ T(E) = \{ \tsf{type}(uv, rs): (uv, rs) \in \overline{L(E)} \} $. By construction, for each edge in $ \overline{L(E)} $, its reverse is also in $ \overline{L(E)} $ with possibly different edge types. We provide a pictorial illustration in the left part of figure \ref{fig:linegraphs}. \par To derive an edge representation update rule, we follow the spirit of the BiMPNN node update rule \eqref{eqn:bimpnn}: let $ N^+_L(uv), N^-_L(uv) $ be the out and in neighborhoods in the ordinary line graph $ L(G) $ of $ G $, and $ \overline{N^+_L(uv)}, \overline{N^-_L(uv)} $ to be those in $ \overline{L(G)} $, respectively. For each edge $ (uv, rs) \in \overline{L(E)} $, we use $ \tsf{C}(uv, rs) \in V $ as the common incident node of the edges $uv$ and $rs$. The following updating rule enhances BiMPNN protocol with duality information, which we term BiMPNN-DE: \begin{align}\label{eqn:bimpnnde} \resizebox{0.91\linewidth}{!}{$ \begin{aligned} h^{(l+1)}_v &= \tsf{MERGE}^{\tsf{node}}\left(\phi^{(l+1)}_v, \psi^{(l+1)}_v\right) \\ g^{(l+1)}_{uv} &= \tsf{MERGE}^{\tsf{edge}}\left(\theta^{(l+1)}_{uv}, \gamma^{(l+1)}_{uv}\right) \\ \phi^{(l+1)}_v &= \tsf{COMBINE}^{\tsf{node}}_{\tsf{in}}\left( h^{(l)}_v, \right.\\ &\quad \left.\tsf{AGG}^{\tsf{node}}_{\tsf{in}}\left(\tsf{MESSAGE}^{\tsf{node}}_{\tsf{in} }(h^{(l)}_v, h^{(l)}_u, \blue{g^{(l)}_{uv}}, u \in N^-(v))\right)\right)\\ \psi^{(l+1)}_v &= \tsf{COMBINE}^{\tsf{node}}_{\tsf{out}}\left( h^{(l)}_v,\right.\\ &\quad \left.\tsf{AGG}^{\tsf{node}}_{\tsf{out}}\left(\tsf{MESSAGE}^{\tsf{node}}_{\tsf{out}}(h^{(l)}_v, h^{(l)}_r, \blue{g^{(l)}_{vr}}, r \in N^+(v))\right)\right) \\ \theta^{(l+1)}_{uv} &= \tsf{COMBINE}^{\tsf{edge}}_{\tsf{in}}\left( g^{(l)}_{uv},\right.\\ &\quad \left.\tsf{AGG}^{\tsf{edge}}_{\tsf{in}}\left(\tsf{MESSAGE}^{\tsf{edge}}_{\tsf{in}}(g^{(l)}_{uv}, g^{(l)}_{pq}, \blue{\hat{h}^{(l)}_{pq, uv}}, pq \in \overline{N_L^-(uv)})\right)\right)\\ \gamma^{(l+1)}_{uv} &= \tsf{COMBINE}^{\tsf{edge}}_{\tsf{out}}\left( g^{(l)}_{uv},\right.\\ &\quad \left.\tsf{AGG}^{\tsf{edge}}_{\tsf{out}}\left(\tsf{MESSAGE}^{\tsf{edge}}_{\tsf{out}}(g^{(l)}_{uv}, g^{(l)}_{rs}, \blue{\hat{h}^{(l)}_{uv, rs}}, rs \in \overline{N_L^+(uv)})\right)\right) \\ \hat{h}^{(l)}_{uv, rs} &= \tsf{COMBINE}^{\tsf{type}}\left(h^{(l)}_{\tsf{C}(uv, rs)}, T_{\tsf{type}(uv, rs)}\right) \end{aligned} $} \end{align} Where we use $ g^{(l)}_{uv} $ to denote the hidden representation of edge $uv$ at the $l$-th layer of GNNs derived from the BiMPNN-DE protocol. The protocol devices an additional edge representation update component that mirrors the BiMPNN protocol over the augmented edge adjacency graph $ \overline{L(G)} $ (see the last four equations in the display \eqref{eqn:bimpnnde}). To obtain an edge representation counterpart $\tilde{h}^{(l)}_{uv, rs}$ during the aggregation process over $ \overline{L(G)} $, we use an additional $\tsf{COMBINE}^{\tsf{type}}$ mechanism that combines features of the common incident node and the information of adjacent types, with is encoded into a learnable edge type embedding matrix $ T \in \mathbb{R}^{4 \times d} $. The BiMPNN-DE protocol \eqref{eqn:bimpnnde} offers a much larger design space than that of BiMPNN protocol. In its full generality, we may specify up to $15$ different mechanisms corresponding to different \tsf{MERGE}, \tsf{COMBINE}, \tsf{AGG} and \tsf{MESSAGE} operations. From a practical point of view, we may design the aforementioned operations using parameterized functions that share the same underlying structure. \subsection{The GRANDE architecture} In this section, we devise the previously developed BiMPNN-DE protocol \eqref{eqn:bimpnnde} to derive a concrete GNN architecture that simultaneously outputs node and edge representations, along with an improvement strategy that targets edge-property prediction tasks. We base our design upon the acclaimed Transformer architecture \cite{vaswani2017attention}, which has seen abundant adaptations to GNNs recently \cite{xu2020inductive, dwivedi2020generalization, ying2021transformers}. We define the multiplicative attention mechanism that incorporates edge information as follows: \begin{align}\label{eqn:attention} \resizebox{0.91\linewidth}{!}{$ \begin{aligned} \tsf{ATTN}&(h_v, \{h_u, g_{uv}\}_{u \in N(v)})= \sum_{u \in N(v) \cup \{v\}} \alpha_{uv} W_N h_u + \beta_{uv} W_E g_{uv} \\ \alpha_{uv} &= \dfrac{\exp\left(\langle W_Q h_v, W_K h_u\rangle / \sqrt{d} \right)}{\sum_{u \in N(v) \cup \{v\}}\exp\left(\langle W_Q h_v, W_K h_u\rangle/ \sqrt{d}\right)} \\ \beta_{uv} &= \dfrac{\exp\left(\langle W_Q h_v, W_E g_{uv}\rangle/ \sqrt{d}\right)}{\sum_{u \in N(v) \cup \{v\}}\exp\left(\langle W_Q h_v, W_E g_{uv} \rangle/ \sqrt{d}\right)} \end{aligned} $} \end{align} We include commonly used operations in a transformer block, namely LayerNorm (\tsf{LN}), skip connection and a learnable two layer MLP (\tsf{FF}) as nonlinearity \cite{vaswani2017attention}, and wraps them into a transformer block: \begin{align}\label{eqn:transformer} \resizebox{0.91\linewidth}{!}{$ \begin{aligned} \tsf{TRANSFORMER}&(h_v, \{h_u, g_{uv}\}_{u \in N(v)}) = \tsf{LN}(\tilde{h}_v + \tsf{FF}(\tilde{h}_v))\\ \tilde{h}_v &= \tsf{LN}(h_v + \tsf{ATTN}(h_v, \{h_u, g_{uv}\}_{u \in N(v)})) \end{aligned} $} \end{align} After defining the basic mechanisms, we write the node and edge update rules as follows: \begin{align}\label{eqn:grande_base} \resizebox{0.91\linewidth}{!}{$ \begin{aligned} h^{(l+1)}_v &= \tsf{CONCAT} \left(\phi^{(l+1)}_v, \psi^{(l+1)}_v\right) \\ g^{(l+1)}_{uv} &= \tsf{CONCAT} \left(\theta^{(l+1)}_{uv}, \gamma^{(l+1)}_{uv}\right) \\ \phi^{(l+1)}_v &= \tsf{TRANSFORMER}^{\tsf{node}}_{\tsf{in}}\left(\Phi_N h_v^{(l)}, \{\Phi_N h_u^{(l)}, \Phi_E g^{(l)}_{uv}\}_{u \in N^-(v)}\right) \\ \psi^{(l+1)}_v &= \tsf{TRANSFORMER}^{\tsf{node}}_{\tsf{out}}\left(\Psi_N h_v^{(l)}, \{\Psi_N h_r^{(l)}, \Psi_E g^{(l)}_{vr}\}_{r \in N^z=(v)}\right) \\ \theta^{(l+1)}_{uv} &= \tsf{TRANSFORMER}^{\tsf{edge}}_{\tsf{in}}\left(\Theta_N g_{uv}^{(l)}, \{\Theta_N g_{uv}^{(l)}, \Theta_E \hat{h}^{(l)}_{pq, uv}\}_{pq \in \overline{N_L^-(uv)}}\right) \\ \gamma^{(l+1)}_{uv} &= \tsf{TRANSFORMER}^{\tsf{edge}}_{\tsf{out}}\left(\Gamma_N g_{uv}^{(l)}, \{\Gamma_N g_{uv}^{(l)}, \Gamma_E \hat{h}^{(l)}_{uv, rs}\}_{rs \in \overline{N_L^+(uv)}}\right) \end{aligned} $} \end{align} The updating equations \eqref{eqn:grande_base} involve many learnable parameters, to which we apply the following naming convention: We use upper case greek letters $\Phi, \Psi, \Theta, \Gamma$ to denote projection matrices that takes value in $ \mathbb{R}^{2d \times d} $, and we use the subscript $N$ for \emph{node-related projection} and $E$ for \emph{edge-related projection}. The $\tsf{COMBINE}^{\tsf{type}}$ operation is set to be element-wise addition. \par\noindent \textbf{Improvements over edge-property prediction tasks} The architecture in \eqref{eqn:grande_base} is most helpful when the underlying task is to predict properties of some existent edges, which serves as the underlying task for many financial applications like fraud detection and AML. Toward this goal, an ad-hoc solution is to base the prediction with respect to edge $ (u, v) $ upon the concatenation of $h_u$, $h_v$ and $g_{uv}$. According to recent practices over pairwise learning on graphs \cite{wang2019nan, wang2021pairwise}, incorporation of interactions between $ N(u) $ and $ N(v) $, or \emph{cross node interactions} significantly improves prediction performance. However, the cross-node attention module proposed in \cite{wang2019nan} requires full attention between $ h_{N(u)} $ and $ h_{N(v)} $, yielding a potentially large computation overhead. Here we provide a more efficient alternative to model the cross-node interactions called the \emph{cross-query attention} module. Given a node pair $ (u, v) $, compute \begin{align}\label{eqn:cross_query_attn} \begin{aligned} \delta_{uv} = \tsf{CONCAT}&\left(\tsf{ATTN}_{\tsf{left}}^{\tsf{in}}(h_u, \{h_r, g_{rv}\}_{r \in N^-(v)}), \right. \\ &\left.\tsf{ATTN}_{\tsf{left}}^{\tsf{out}}(h_u, \{h_s, g_{vs}\}_{s \in N^+(v)})\right) \\ \delta_{vu} = \tsf{CONCAT}&\left(\tsf{ATTN}_{\tsf{right}}^{\tsf{in}}(h_v, \{h_r, g_{ru}\}_{r \in N^-(u)}), \right. \\ &\left. \tsf{ATTN}_{\tsf{right}}^{\tsf{out}}(h_v, \{h_s, g_{us}\}_{s \in N^+(u)})\right) \end{aligned} \end{align} The above procedure \eqref{eqn:cross_query_attn} performs four queries that attends $u$ and $v$ to its opponent's in and out neighbors, respectively. Providing the existence of an edge $(u, v)$, the mechanism \eqref{eqn:cross_query_attn} could be understood as attending nodes to the a specific subsets of their \emph{second-order} neighborhoods which have close relationship to the edges of interest. Finally we summarize the previous developments into a framework termed multi\textbf{G}raph t\textbf{RAN}sformer with \textbf{D}uality \textbf{E}nhancement (GRANDE) , that utilizes the following edge representation for edge-property prediction tasks: \begin{align} g^{\tsf{GRANDE}}_{uv} = \tsf{CONCAT}(g_{uv}, h_v, h_u, \delta_{uv}, \delta_{vu}) \end{align} \subsection{Extension to temporal graphs} According to the formulation in section \ref{sec:problem_formulation}, extending the GRANDE framework to $G(\mathcal{T})$ requires utilization of the edge-wise timestamp information $ \{t_{uv}, (u, v) \in E \} $ to produce \emph{time-aware node and edge representations}. Inspired by recent developments of time-aware representation learning approaches \cite{xu2019self, xu2020inductive}, we propose an \emph{extended generic time encoding} mechanism that enhances the node and edge update rule of BiMPNN-DE with temporal information. Finally, to better exploit the structure of the temporal graph, we suggest a \emph{pruning strategy} that shrinks the number of edges of $ \overline{L(G_{\mathcal{T}}))} $ by a factor up to two. \par\noindent \textbf{Generic time encoding} The functional time encoding (FTE) provides a principled way that modifies the self-attention operation \eqref{eqn:attention} with minimal architecture change: \begin{align}\label{eqn:temporal_attention} \begin{aligned} \tsf{TATTN}&(h_v, \{h_u, g_{uv}\}_{u \in N(v)}) \\ &= \sum_{u \in N(v) \cup \{v\}} \alpha_{uv} W_N \check{h}_{uv} + \beta_{uv} W_E \check{g}_{uv} \\ \check{h}_{uv} &= \tsf{CONCAT}(h_u, \tsf{TE}(|\Delta t_{uv}|)) \\ \check{g}_{uv} &= \tsf{CONCAT}(g_{uv}, \tsf{TE}(|\Delta t_{uv}|)) \end{aligned} \end{align} Where $ \tsf{TE}(|\Delta t_{uv}|) $ is temporal embedding obtained via certain FTE mechanisms. $\alpha_{uv}$s and $\beta_{uv}$s are calculated analogously to the rules in \eqref{eqn:attention}. In this paper we will follow the Bochner-type FTE \cite{xu2019self, xu2020inductive}: \begin{align} \resizebox{0.85\linewidth}{!}{$ \tsf{TE}(s) = \sqrt{\frac{1}{d}} \left[ \cos(\rho_1 s), \sin(\rho_1 s), \ldots, \cos(\rho_d s), \sin(\rho_d s)\right] $} \end{align} with learnable parameters $(\rho_1, \ldots, \rho_d)$. According to the setup in \cite{xu2020inductive}, timestamps are associated with nodes rather than edges, hence the authors used the time difference $ \Delta t_{uv} = t_u - t_v $. The situation becomes more complicated when timestamps are associated with edges, for which we propose the following modification: \begin{align}\label{eqn:edge_time_difference} \Delta t_{uv} = t_{uv} - \min_{u \in N(v)}t_{uv} \end{align} We use FTE based on \eqref{eqn:edge_time_difference} and replace the \tsf{ATTN} component with \tsf{TATTN} component of the node time difference calculation in the node update part of \eqref{eqn:grande_base}. For the edge update part, the ordinary node time difference method applies naturally since edge timestamps act as node timestamps in the dual formulation. \par\noindent \textbf{Temporal information and pruning strategies} the proposed line graph augmentation strategy produces an undirected $ \overline{L(G)} $. While this undirected network might provide valuable information in general, in financial risk management scenarios where edges represent \emph{timestamped transactions}, directed adjacencies between transactions are typically of interest: Consider a transaction $ e_{t_0} $ from Bob to Alice, it is reasonable to assume that \emph{downstream} transactions of $ e_{t_0} $ (i.e., transactions $ e_t $ with $ t > t_0 $) will be affected by $ e_{t_0} $, but its upstream transactions shall not be affected. Inspired from this intuition, we introduce a \emph{causal pruning strategy} that applies when temporal information is available in the underlying graph, i.e, for an edge $ e $ that goes from $ u $ to $ v $, we have its time of occurrence $ t_e $. The causal pruning strategy deletes edges in $ \overline{L(G)} $ with the occurrence time of the head node being earlier than that of the tail node. When the causal pruning strategy is applicable, we may prune up to $50\%$ of the edges in $ \overline{L(G)} $. An illustration is provided in the right part of figure \ref{fig:linegraphs}. Note that the proposed strategy is closely related to the construction of causal temporal subgraphs in temporal graph modeling literature \cite{xu2020inductive, ddgcl}. \begin{figure} \begin{minipage}{.45\linewidth} \centering \scalebox{.6}{\input{linegraph_aug.tex}} \end{minipage} \begin{minipage}{.45\linewidth} \centering \scalebox{.6}{\input{lingraph_prune.tex}} \end{minipage} \caption{An illustration of the proposed line graph augmentation strategy: The left figure stands for the augmented edge adjacency graph $ \overline{L(G)} $ for the digraph depicted in figure \ref{fig:digraph_illustration}. We use colored edges to represent edge types: {\color{sandybrown} head-to-head} and {\color{brightmaroon} tail-to-tail}, note that the remaining two kinds of edge types do not appear in $ \overline{L(G)} $. The right figure shows the effect of the causal pruning strategy under the additional temporal constraint that $t_0 < t_1 < \cdots < t_9$, with $t_i$ being the occurrence time of edge $t_i$ for $i \in \{0, \ldots, 9\}$} \label{fig:linegraphs} \end{figure} \subsection{Scalability and complexity} Most of the real-world financial networks like transaction networks are \emph{sparse}, i.e., most people only make transactions to a few others given a finite time window. Consequently, the computational complexity of any message passing neural networks could be roughly regarded as $O(Ed^2)$. Extending ordinary MPNN architectures to BiMPNN protocol doubles the computation cost, which could be easily resolved through parallelization in modern deep learning frameworks like tensorflow \cite{abadi2016tensorflow}. The extra computational cost brought by introducing the dual component \eqref{eqn:bimpnnde} requires more care: even when the original graph is sparse, its augmented edge adjacency graph might be dense or even complete. Such cases do happen in realistic scenarios since large hubs frequently exist in transaction networks, which corresponds to a complete subgraph in the dual network. Therefore the worst-case computation cost of $O(E^2d^2)$ is sometimes inevitable in architectures derived from the BiMPNN-DE protocol \eqref{eqn:bimpnnde}. Hence to meet the computational requirement of GNN architectures like GRANDE , performing GNN training/inference over the whole graph is unrealistic. Instead, we resort to a \emph{local} computation alternative implemented by the AGL system \cite{zhang2020agl} which grabs the $K$-hop rooted subgraph of each target node and performed batched stochastic training and efficient parallel inference given distributed infrastructures like MapReduce \cite{zhang2020agl}. In practical scenarios, it is often reasonable to set an upper bound $M_{\tsf{max}}$ on the edges of any $K$-hop rooted subgraph and device proper sampling methods to meet the requirement. The resulting computational complexity during training is reduced to $O(BM^2_{\tsf{max}}d^2)$, where $B$ denotes the batch size. Since we may control $M_{\tsf{max}}$ so that the whole batch of subgraphs fits the storage requirement of high-performance hardware like GPU, the computational costs of running GRANDE becomes fully affordable for industry-scale distributed training and inference. \section{Related Works} \subsection{Neural models over directed graphs} Directional extensions of message passing GNN protocol were mentioned in pioneer works \cite{pmlr-v70-gilmer17a, battaglia2018relational} without providing empirical evaluations. Recent developments toward designing GNNs for digraphs are mostly inspired by different types of graph Laplacians that are defined over digraphs. For example, \cite{NEURIPS2020_cffb6e22} used the definition in \cite{chung2005laplacians} and \cite{zhang2021magnet} used the Hermitian magnetic Laplacian to decouple the aggregation process of graph connectivity and edge orientations. \subsection{GNNs for edge representation learning} The idea of utilizing node-to-edge duality was explored in early works like LGNN \cite{chen2017supervised}, where the authors drew insights from community detection literature, and use the non-backtracking walk operator \cite{krzakala2013spectral} to define the dual graph and perform GCN-like aggregations simultaneously over both graphs. Later developments \cite{jiang2020censnet, cai2020line, jo2021edge} focused on variants of LGNN with the alternative definition of the dual, such as the standard LINE graph \cite{godsil2001algebraic}. \subsection{Transformer architectures over graphs} The renowned GAT architecture \cite{velivckovic2017graph} could be regarded as using the \emph{additive} attention mechanism to form the attention layer, as opposed to the \emph{multiplicative} attention mechanism adopted by the Transformer architecture \cite{vaswani2017attention}. Adaptations of the original Transformer to graph context have been assessed recently, \cite{dwivedi2020generalization} replaced the additive attention in GAT with inner product attention and use spectral embedding as a proxy for the positional embedding component in the original transformer architecture. In \cite{ying2021transformers}, the authors proposed to use \emph{full-attention} transformers and use graph-theoretical attributes of nodes and edges to guide the attention procedure. While the results were shown competitive over biological benchmarks, the computational overhead is way too heavy for industrial-level graphical applications. \section{Experiments} In this section, we report empirical evaluations of GRANDE over an industrial application as well as assessments over public datasets. We focus on the edge classification task over temporal directed multigraphs. Finally, we present a detailed ablation study to decompose the contributions of different constituents of GRANDE . \subsection{Datasets} We use one industrial dataset and two public datasets, with their summary statistics listed in table \ref{tab:dataset_summary} in appendix \ref{sec:app:dataset_summary}.\par\noindent \textbf{AML dataset} This dataset is generated from transaction records collected one of the world's leading online payment systems. The business goal is to identify transactions that exhibit risky patterns as being highly suspicious of money laundering. The underlying graph is constructed by treating users as nodes and transactions as directed edges with arbitrary multiplicity. We engineer both node and edge features under a two-stage process: We first obtain raw node features via statistical summaries of corresponding user's behavior on the platform during specific time periods, and raw edge features consist of transaction properties as well as related features of two users involved in the transaction. \footnote{Per organizational regulations, the detailed feature engineering logic is not fully described. We will consider (partially) releasing the AML dataset after passing relevant security checks of the company, as well as the source code.} The decision tree feature transforms \cite{he2014practical} is then applied to both features so that after the transform, the input node and edge feature for all the assessed models are sparse categorical features with dimension $6400$. For both training and testing, we collect data under a $10$-day period with no overlap between the training period and the testing period. A random subset corresponding to 10\% of the testing data is held out for validation. \par\noindent \textbf{Bitcoin datasets} We use two who-trusts-whom networks of people who trade using Bitcoin on two different platforms, Bitcoin OTC and Bitcoin Alpha \cite{kumar2016edge, kumar2018rev2}. Both networks are directed without edge multiplicities, each edge is associated with a timestamp and a trust score ranging from $-10$ to $10$. We consider the task of binary edge classification with edge labels generated as whether the trust score is negative. Using node features represented as the concatenation of one-hot representation of in and out-degree of nodes. For both datasets, we use the chronological split that uses $70\%$ data for training, $10\%$ for validation, and $20\%$ for testing \subsection{Baselines} We compare the proposed GRANDE framework with the following types of baselines: \begin{description} \item[Undirected approaches] We consider two representative GNN architectures GCN \cite{kipf2016semi} and GAT \cite{velivckovic2017graph} that operate on undirected graphs. Since temporal information is available in all three datasets, we also include the TGAT architecture \cite{xu2020inductive}. As all the aforementioned methods produce node-level representations, we use the concatenation of node representations as edge representation according to the adjacency structure. As frameworks that directly output edge representation remain few, we include the EHGNN architecture \cite{jo2021edge} as a strong baseline. To make the undirected architectures compatible with directed (multi)graphs, we add reverse edges with duplicated edge features if there exist no edge multiplicities in the digraph. Otherwise, we keep only one edge between each pair of nodes, with the corresponding edge feature generated via aggregating the original edge features (according to the "multigraph to graph" hierarchy) using the DeepSet method \cite{zaheer2017deepsets}, and add reverse edges thereafter. \item[DiGraph-oriented approaches] We consider two digraph GNN architectures that utilizes different notions of directed graph Laplacians, DGCN \cite{ma2019spectral} and MagNet \cite{zhang2021magnet}. \end{description} The aforementioned baselines exclude some of the recently proposed state-of-the-art GNN models like Graphormer \cite{ying2021transformers} for undirected graphs or directed approaches like DiGCN \cite{NEURIPS2020_cffb6e22} due to scalability issues, i.e., they require either full graph attention or solving eigen programs over the full graph Laplacian, which are computationally infeasible for industry-scale graphs. \subsection{Experimental setup}\label{sec: exp_setup} Across all the datasets and models, we use a two-layer architecture with hidden dimension $d=128$ without further tuning. For models with generic time encodings, we fix the dimension of time encoding to be $128$. For transformer related architectures, we follow the practice in \cite{vaswani2017attention} and use a two-layer MLP with ReLU activation with hidden dimension $512$. As all the relevant tasks are binary classifications, we adopt the binary cross entropy loss as the training objective, with $\ell_2$ regularization under a coefficient $0.0001$ uniformly across all experiments. The graph data are constructed via the GraphFlat component of the AGL system \cite{zhang2020agl} that transforms the raw graph data into batches of subgraphs with appropriate sampling. \footnote{The AGL framework is particularly useful when dealing with industry-scale graphs that are barely possible to process as a whole. However, it may lose some information in the sampling stage of the preprocessing phase. To fully mimic the industrial setup, we preprocess all three datasets using AGL, therefore the results of Bitcoin datasets are not directly comparable to previously published results. } We use Adam optimizer with a learning rate of $0.0001$ across all tasks and models. For the bitcoin datasets, we train each model for $10$ epochs using a batch size of $128$ and select the best-performed one according to the roc-auc score on the validation data under periodic evaluations every $100$ steps. For the AML dataset, we train the model for $2$ epochs with a batch size of $256$ as the size of the dataset is sufficiently large. We adopt similar model selection criterion as those of Bitcoin datasets, with periodic evalutions every $500$ steps. \par\noindent \textbf{Metrics} Since the primary focus of this paper is applications to the FRM scenario, we choose three representative metrics, namely roc-auc score (AUC), Kolmogorov-Smirnov statistic (KS) and F$1$ score (F$1$). \begin{table*}[] \centering \caption{Experimental results over two public Bitcoin datasets and the AML dataset, with best performances in \textbf{bold}} \begin{tabular}{lccccccccc} \toprule & \multicolumn{3}{c}{Bitcoin-OTC} & \multicolumn{3}{c}{Bitcoin-Alpha} & \multicolumn{3}{c}{AML}\\ & AUC & KS & F$1$ & AUC & KS & F$1$ & AUC & KS & F$1$ \\ \midrule GCN \cite{kipf2016semi} & $0.742$ & $0.376$ & $0.432$ & $0.626$ & $0.198$ & $0.282$ & $0.958$ & $0.793$ & $0.704$\\ GAT \cite{velivckovic2017graph}& $0.736$ & $0.381$ & $0.393$ & $0.626$ & $0.178$ & $0.269$ & $0.962$ & $0.802$ & $0.718$\\ TGAT \cite{xu2020inductive} & $0.744$ & $0.401$ & $0.422$ & $0.656$ & $0.248$ & $0.294$ & $0.963$ & $0.804$ & $0.720$ \\ EHGNN \cite{jo2021edge} & $0.719$ & $0.356$ & $0.420$ & $0.626$ & $0.228$ & $0.297$ & $0.961$ & $0.804$ & $0.718$\\ DGCN \cite{ma2019spectral} & $0.634$ & $0.243$ & $0.354$ & $0.633$ & $0.228$ & $0.282$ & $0.962$ & $0.806$ & $0.720$\\ MagNet \cite{zhang2021magnet} & $0.753$ & $0.388$ & $0.434$ & $0.645$ & $0.217$ & $0.293$ & $0.954$ & $0.780$ & $0.688$\\ \midrule GRANDE (reduced) & $0.789$ & $0.459$ & $0.460$ & $0.669$ & $0.256$ & $0.294$ &$0.965$ & $0.810$ & $0.726$\\ GRANDE & \best{0.829} & \best{0.524} & \best{0.532} & \best{0.769} & \best{0.415} & \best{0.398} & \best{0.966} & \best{0.813} & \best{0.734} \\ \bottomrule \end{tabular} \label{tab:dataset_results} \end{table*} \begin{table*}[] \centering \caption{Performance summary of ablation studies, with best performance in \textbf{bold}} \begin{tabular}{lccccccccc} \toprule & \multicolumn{3}{c}{Bitcoin-OTC} & \multicolumn{3}{c}{Bitcoin-Alpha} & \multicolumn{3}{c}{AML}\\ & AUC & KS & F$1$ & AUC & KS & F$1$ & AUC & KS & F$1$ \\ \midrule GRANDE & $0.829$ & $0.524$ & \best{0.532} & \best{0.769} & \best{0.415} & \best{0.398} & \best{0.966} & \best{0.813} & \best{0.734} \\ \midrule - reduced & $0.789$ & $0.459$ & $0.460$ & $0.669$ & $0.256$ & $0.294$ &$0.965$ & $0.810$ & $0.726$ \\ - w/o causal pruning & $0.801$ & $0.464$ & $0.485$ & $0.726$ & $0.325$ & $0.339$ & $0.966$ & $0.813$ & $0.732$ \\ - w/o time encoding & \best{0.834} & $0.525$ & $0.531$ & $0.691$ & $0.265$ & $0.324$ & $0.966$ & $0.813$ & $0.731$ \\ - w/o cross-query attention & $0.828$ & \best{0.528} & $0.504$ & $0.766$ & $0.395$ & $0.372$ & $0.966$ & $0.813$ & $0.730$ \\ - w line graph & $0.762$ & $0.405$ & $0.415$ & $0.655$ & $0.229$ & $0.285$ & $0.965$ & $0.812$ & $0.729$ \\ \bottomrule \end{tabular} \label{tab:ablation_study} \end{table*} \subsection{Performance} We present evaluation results in table \ref{tab:dataset_results}. Apart from the proposed GRANDE architecture, we report a \emph{reduced} version of GRANDE via discarding all operations on the augmented edge adjacency graph, as well as the cross-query attention module \eqref{eqn:cross_query_attn}. The resulting model could be considered as implementing a time-aware variant of graph transformer under the BiMPNN protocol. We summarize our experimental findings as follows: \begin{itemize}[leftmargin=*] \item For the Bitcoin datasets which could be considered as under the \emph{weak feature} regime, the GRANDE architecture obtains substantial performance improvement: On the Bitcoin-OTC dataset, the relative improvement over the best baselines are $10.1\%$, $30.7\%$ and $22.6\%$ with respect to AUC, KS, and F$1$. On the Bitcoin-Alpha dataset, the relative improvement is more significant with $19.2\%$, $67.3\%$, and $35.4\%$ respectively. We attribute the improvements to both the directional information and the duality information that GRANDE utilizes. The improvements of the directional information could be inferred from the results of the reduced GRANDE variant, which exhibits solid improvements over all the baselines. The incorporation of edge-to-node duality and cross-query attention systematically encodes more structural information, therefore yielding further improvements. \item For the AML dataset which could be regarded as under the \emph{strong feature} regime, the performance improvement is significant with respect to KS and F$1$ metrics while being less significant with respect to AUC. Such improvements are still valuable in FRM applications since a higher F$1$ score potentially suggests better patterns of the precision-recall (PR) curve, which we plot in figure \ref{fig:precision_recall}. The PR curve shows the dominant performance of GRANDE against baselines: under various precision levels, the recall of GRANDE surpasses the best baseline (TGAT) by as many as $5.29\%$ in absolute value and $13.4\%$ in relative. \end{itemize} \begin{figure} \centering \scalebox{.6}{\input{precision_recall.tex}} \caption{Precision-recall (PR) curve under the AML dataset. We show recall values corresponding to high precision ranges (from $0.7$ to $1.0$ equally spaced with $0.025$)} \label{fig:precision_recall} \end{figure} \subsection{Ablation study} We evaluate the following variants of GRANDE over all three datasets to investigate contributions of different constituents: \begin{description} \item[Reduced version] this is the one reported in table \ref{tab:dataset_results} \item[Without causal pruning] in this model variant we retain the full edge adjacency graph without pruning. Which is computationally heavier than the GRANDE architecture \item[Without time encoding] in this model variant we discard the temporal component of GRANDE and use the update rule \eqref{eqn:grande_base} \item[Without cross-query attention] in this model variant we discard the cross-query attention module \eqref{eqn:cross_query_attn}, and use $ \tsf{CONCAT}(g_{uv}, h_v, h_u) $ as the output embedding for edge $(u, v)$. \item[With line graph] in this model variant, we use the ordinary directed line graph instead of the proposed augmented edge adjacency graph. i.e., we replace $\overline{N_L^+(uv)}$ and $\overline{N_L^-(uv)}$ in \eqref{eqn:grande_base} with $N_L^+(uv)$ and $N_L^-(uv)$, respectively. \end{description} \textbf{Results} we report results in table \ref{tab:ablation_study} using the same training configuration and evaluation metrics as in section \ref{sec: exp_setup}. There are a couple of notable observations: Firstly, the causal pruning procedure saves computation as well as improves performance, providing a solid relational inductive bias in temporal graph modeling. Secondly, the incorporation of time encoding and cross-query attention are in general helpful. Finally, using the ordinary line graph performs on par with the reduced model, showing the insufficiency of additional information provided by line digraphs, thereby verifying the necessity of using the augmented edge adjacency graph. \section{Discussion} \textbf{Interpretability} The dominating performance of neural approaches comes at the cost of lacking of \emph{model interpretablity}, which is crucial to application scenarios like AML, where outputs of decision making systems tie strongly with regulatory strictures \cite{kute2021aml}. The adoption of neural approaches enjoys better performance than potentially interpretable methods like linear models as well as losing interpretability. Model explanation methods targeting graph neural models are especially challenging \cite{liu2022interpretability} due to the combinatorial nature of the interpretation problem. Off-the-shelf GNN explaining tools (refer to \cite{liu2022interpretability} and references therein) are not yet applicable to neural models over directed graphs, which is a promising and challenging direction for future explorations. \par\noindent \textbf{Multi-task adaptations} The representation quality in both node and edge embeddings gives the GRANDE architecture the possibility to exploit side-information via multi-task learning paradigms \cite{ruder2017overview}. For example it is quite common in FRM scenarios to obtain both a set of user riskiness labels alongside transaction labels. We have taken a trivial adaptation of GRANDE into multi-task setups using extra node labels via adding a node-level classification loss to the training objective and has shown solid improvement (we report results in appendix \ref{sec:app:further_exp}). Applying more elegant multi-task learning techniques \cite{ruder2017overview} to further exploit the potential of GRANDE is an interesting direction for future studies. \section{Conclusion} In this paper we propose a graph representation learning framework for directed multigraphs that prevail in FRM applications. The proposed framework generalizes the acclaimed message passing graph neural network protocol to incorporate directional information, as well as utilizing the edge-to-node dual relationship to further enhance the relational inductive bias with regard to edge property prediction tasks. A concrete architecture named GRANDE is derived according to the proposed protocol with the transformer architecture being its aggregation mechanism, as well as a cross-query attention module targeting edge-type tasks. The GRANDE model is generalizable to temporal dynamic graphs via proper generic time encodings along with a pruning strategy. Experimental results over both public and industrial datasets verify the efficacy of the design of GRANDE . \bibliographystyle{acm} \section{Introduction} Recent years have witnessed an increasing trend of adopting modern machine learning paradigms to financial risk management (FRM) scenarios \cite{akib2020ML4fin}. As a typical use case in operational risk scenarios like fraud detection and anti-money laundering, the identification of risky entities (user accounts or transactions) is cast into a supervised classification problem using behavioral data collected from the operating financial platform \cite{chen2018machine, kute2021aml}. For institutions like commercial banks and online payment platforms, the most important source of behavior information is the \emph{transaction records} between users. making \emph{transaction networks} (with users as nodes and transactions as edges) a direct and appropriate data model. Unlike standard pattern recognition tasks like image recognition where decisions are made according to information of individual objects, identification of risky patterns over transaction network requires reasoning beyond any individual scope. The phenomenon is particularly evident in the area of anti-money laundering (AML), where suspicious transactions are usually related by several users or accounts, with transactions between them being highly correlated, thereby exhibiting a cascading pattern which makes i.i.d. approaches in machine learning unsuitable. The surging developments of machine learning models over graphs, especially graph representation learning \cite{hamilton2020graph}, have attracted significant attention in the financial industry and have shown promising results in the area of FRM \cite{liu2018heterogeneous, liu2021intention}. The dominant practice in graph representation learning is to utilize the panoply of graph neural networks (GNN) \cite{battaglia2018relational} that produce node-level representations via principled aggregation mechanisms which are generally described via message passing protocols \cite{pmlr-v70-gilmer17a} or spectral mechanisms \cite{kipf2016semi}. \par Despite their convincing performance, the majority of the existent GNN models operate over \emph{undirected graphs}, which makes them inadequate for the direct modeling of transaction networks. Firstly, many graphs that arise in FRM applications are directed by nature: i.e., in the case of a transaction network with users as nodes and transactions as edges, the direction of an edge is typically understood as the direction of its corresponding cash flow. In areas like anti-money laundering (AML), directional information is generally perceived to be of significant importance and shall not be neglected \cite{Sudjianto2010Statistical}. Secondly, there might exist multiple transactions between certain pairs of users. Thirdly, transactions are naturally associated with timestamps that indicate the time of occurrence. Therefore, to fully utilize the graphical structure of transaction networks, we need representation learning frameworks that support \emph{temporal directed multigraphs}. While recent progress on \emph{dynamic graph neural networks} \cite{xu2020inductive, kazemi2020representation} provide appropriate methods to handle temporality, discussions over neural architectures that supports directed multigraphs remains nascent \cite{pmlr-v70-gilmer17a, ma2019spectral, tong2020directed, NEURIPS2020_cffb6e22, zhang2021magnet}.\par From a practical point of view, the targeted risky entities may be either node (i.e., malicious users) or edges (i.e., suspicious transactions). Conventional GNN architectures produce node-level representations via encoding information of each node's rooted subtrees \cite{xu2018how}, making them a good fit for \emph{user or account level} risk identifications. When the underlying task is to detect risky transactions, the prevailing practice is to present edges using a combination of node representations corresponding to both ends of edges. While such design may be adequate for tasks like link prediction, it lacks a way to effectively integrate edge-level information into the edge representation. Since financial networks usually contain rich edge-level features (i.e., detailed transaction-related information), refinements on edge-level representations are needed. For example, to accurately represent a transaction, we need to combine the information of its buyer (cash sender) and seller (cash receiver), and the transaction-related information, with each of them requiring aggregating relevant information from related users and transactions. \begin{figure} \centering \scalebox{.6}{\input{digraph.tex}} \caption{Illustration on the deficiency of the directed message passing protocol in \cite{battaglia2018relational}: suppose the node of interest is $ n_0 $, using GNNs designed according to the protocol in \cite{battaglia2018relational}, it becomes impossible for $ n_0 $ to aggregate information of $ n_9 $ and $ n_{10} $. Under the context of financial risk management, suppose $ n_9 $ and $ n_{10} $ corresponds to known fraudsters, and edges correspond to transactions. Although the riskiness of $ n_5 $ might be undetermined, the transaction pattern makes it highly suspicious and therefore uplifts the riskiness of $ n_0 $. To build models that behave coherently with the above reasoning process, GNN protocols that aggregates information from \emph{both directions} are required } \label{fig:digraph_illustration} \end{figure} A recent line of work \cite{jiang2020censnet, cai2020line, jo2021edge} focused directly on \emph{learned edge representations} using the idea of \emph{edge-to-node duality} and obtained satisfactory performance over downstream tasks like edge classification. However, previous works on edge representation learning all applies to undirected graphs, making the extension to transaction networks highly non-trivial.\par In this paper, we propose a general message passing neural network protocol that simultaneously outputs node and edge representations over directed multigraphs. Based on this protocol, we derive a GNN architecture called GRANDE with an extension to temporal graphs that efficiently leverages the underlying structural property of transaction networks. More specifically, we summarize our contribution as follows: \begin{itemize}[leftmargin=*] \item We develop a novel bi-directional message passing protocol with duality enhancement (BiMPNN-DE) that strengthens previous proposals over message passing neural architectures over directed multigraphs. The improvement is two-fold: Firstly, it effectively combines neighborhood information from both incoming and outgoing edges of nodes. Secondly, it simultaneously outputs node and edge representations via performing message passing over both the original graph and its \emph{augmented} edge adjacency graph. \item We derive a concrete GNN architecture following the proposed BiMPNN-DE protocol called GRANDE, that devices the acclaimed transformer \cite{vaswani2017attention} mechanism for neighborhood aggregation. The proposed GRANDE framework is made compatible with temporal directed multigraphs through the integration of a generic time encoding module that further extends previous works on dynamic graph modeling \cite{xu2020inductive}. \item To show the practical effectiveness of GRANDE, we apply it to a suspicious transaction identification task in anti-money laundering, with the underlying transaction network data collected from one of the world's leading online payment platforms. Comparisons against various undirected and directed GNN baselines show the superiority of the proposed model. We also provide evaluations on two public datasets generated from transaction networks to further verify the strength of GRANDE framework when underlying graph features are relatively weak. \end{itemize} \section{Methodology} \subsection{Problem formulation}\label{sec:problem_formulation} Under the context of financial risk management, we consider the following \emph{event stream} representation of recorded transaction data that are available in most online transaction systems: \begin{align} \mathcal{E} = \{(u_1, v_1, t_1, \chi_1), (u_2, v_2, t_2, \chi_2), \ldots \} \end{align} Each event $ (u, v, t, \chi) $ is interpreted as a transaction from user $u$ to user $v$ that occurred at time $t$, with related features $\chi$ that could often be further decomposed as user-level features like user account information, and event-level features like transaction amount and channels. In this paper, we focus on the representative task of \emph{transaction property prediction} that typically takes the form of binary classification that aims at identifying illicit or fraudulent transactions. The task could be cast into a graph learning problem of edge classification in a straightforward manner. We consider the temporal graph modeling paradigm \cite{kazemi2020representation} that views the underlying temporal graph as being generated from the event stream $\mathcal{E}$. Therefore, given a time period $\mathcal{T} = [\tau_{\tsf{start}}, \tau_{\tsf{end}}]$, we construct the graph data as the snapshot $G(\mathcal{T}) = (V(\mathcal{T}), E(\mathcal{T}))$ of the underlying temporal graph. Since there may exist multiple transactions between the same set of users, we consider $G(\mathcal{T})$ to be a \emph{directed multigraph} with each edge in the edge multiset $ E(\mathcal{T}) $ represents an event that happens inside the time interval $\mathcal{T}$, and the node set $ V(\mathcal{T}) $ consists of related users corresponding to the included events. During the training stage, we construct a snapshot $G(\mathcal{T}_{\tsf{train}})$, and obtain a possibly incomplete set of edge labels that are understood as edge properties annotated using expert knowledge. During testing stage, we perform inference over snapshots $G(\mathcal{T}_{\tsf{test}})$ that are based on later time intervals than $\mathcal{T}_{\tsf{train}}$. We assume $\mathcal{T}_{\tsf{train}} \cap \mathcal{T}_{\tsf{test}} = \emptyset $, hence the problem of interest could be viewed as \emph{inductive edge classification over temporal graphs}. \subsection{Message passing protocols and directed graphs} Let $ G = (V, E) $ be a directed multigraph with node set $ V $ and edge multiset $ E $. For any pairs of nodes $ (u, v) $, denote $ \mu(u, v) $ as the number of edges going from $ u $ to $ v $. Then $ G $ becomes a (simple) graph when $ \max_{u \in V, v \in V} \mu(u, v) \le 1 $. For each $ v \in V $, denote $ N^+(v) = \{u, (v, u) \in E\} $ and $ N^-(v) = \{u, (u, v) \in E\} $ as its in-neighborhood and out-neighborhood respectively, and let $ N(v) = N^+(v) \cup N^-(v) $ be its neighborhood. For the sake of presentation clarity, we will overload the notation $uv$ for both an edge in the undirected graph, or a directed edge from $u$ to $v$ in a directed (multi)graph from time to time, with its exact meaning being clear from the context. We are interested in the general case where both node features $ X = \{x_v\}_{v \in V} $ and edge features $ Z = \{z_{uv}\}_{(u, v) \in E} $ are available, where we assume both kinds of features to be of dimension $d$. In this paper we focus on neural approaches to such directed multigraphs. A good starting point is the neural message passing scheme for undirected graphs \cite{pmlr-v70-gilmer17a}: let $ h^{(l)}_v $ denote the hidden representation of node $ v $ at the $ l $-th layer of the network, and $ h^{(0)}_v = x_v, \forall v \in V $. The message passing graph neural network protocol (abbreviated as GNN hereafter) is described recursively as: \begin{align}\label{eqn:gnn_undirected} \resizebox{0.91\linewidth}{!}{$ h^{(l+1)}_v = \tsf{COMBINE}\left( h^{(l)}_v, \tsf{AGG}\left(\tsf{MESSAGE}(h^{(l)}_v, h^{(l)}_u, z_{uv}, u \in N(v))\right)\right) $} \end{align} Different combinations of \tsf{COMBINE}, \tsf{AGG} and \tsf{MESSAGE} mechanisms thus form the \emph{design space} of undirected GNNs \cite{you2020designspace}. To the best of our knowledge, there are three types of generalization strategies to directed graphs: \begin{description} \item[Symmetrization] The most ad-hoc solution is to "make it undirected" via padding necessary reverse edges so that $ N(v) = N^+(v) = N^-(v) $, and apply standard graph neural networks that operate on undirected graphs like GCN or GAT. Despite its simplicity and clearness, the symmetrization approach discards directional information in the digraph and may raise subtleties when dealing with multigraphs. \item[DiGraph-theoretic motivations] A more recent line of work \cite{ma2019spectral, tong2020directed, NEURIPS2020_cffb6e22, zhang2021magnet} drew insights from directed graph theory, especially the spectral branch \cite{chung2005laplacians}. The proposed models are mostly digraph analogs of GCN, without the consideration for edge features, therefore severely limiting the design space of directed message passing GNNs. \item[Directed Protocol] In the seminal work \cite[Algorithm 1]{battaglia2018relational}, the authors proposed a GNN protocol that operates on directed multigraphs with edge features via aggregating messages from only the in-neighborhood, i.e., replacing $ N(v) $ in \eqref{eqn:gnn_undirected} with $ N^+(v)) $. \footnote{The original version also considered incorporation of a \emph{global node} that aggregates information from the whole graph regardless of the connectivity structure. While such design choice may have some gains in moderate size graphs \cite{xiong2021memory}, it does not scale to large graphs. Therefore we will not consider such design choice in this paper} While being a natural extension, such kind of GNN protocol losses information from the outgoing direction of each node. We present a pictorial illustration in figure \ref{fig:digraph_illustration}. \end{description} To address the aforementioned shortcomings, we propose a novel GNN protocol that operates on directed digraphs termed \emph{bi-directional message passing neural network (BiMPNN)}. The protocol extends the standard undirected protocol \eqref{eqn:gnn_undirected} via enabling each node to aggregate information from both its in-neighborhood and out-neighborhood: \begin{align}\label{eqn:bimpnn} \begin{aligned} h^{(l+1)}_v &= \tsf{MERGE}\left(\phi^{(l+1)}_v, \psi^{(l+1)}_v\right) \\ \phi^{(l+1)}_v &= \tsf{COMBINE}_{\tsf{in}}\left( h^{(l)}_v,\right.\\ &\quad \left.\tsf{AGG}_{\tsf{in}}\left(\tsf{MESSAGE}_{\tsf{in}}(h^{(l)}_v, h^{(l)}_u, \blue{z_{vu}}, u \in N^+(v))\right)\right)\\ \psi^{(l+1)}_v &= \tsf{COMBINE}_{\tsf{out}}\left( h^{(l)}_v,\right.\\ &\quad \left.\tsf{AGG}_{\tsf{out}}\left(\tsf{MESSAGE}_{\tsf{out}}(h^{(l)}_v, h^{(l)}_r, \blue{z_{ur}}, r \in N^-(v))\right)\right) \end{aligned} \end{align} Despite being more complicated than the undirected protocol, the proposed BiMPNN protocol remains conceptually clear: for each layer, we aggregate separately from each node's in-neighborhood and out-neighborhood using distinct aggregation mechanisms, and merge the two obtained intermediate representations into the next layer's input. Consequently, a $ k $-layer GNN derived from the BiMPNN protocol utilizes both its \emph{root}-$k$ incoming subtree and outgoing subtree, thereby providing a richer set of \emph{relational inductive bias} than the one proposed in \cite{battaglia2018relational}. \subsection{Edge-level task and edge-to-node duality} The BiMPNN protocol \eqref{eqn:bimpnn} provides a principled way of obtaining node representations in directed multigraphs which serves as the building block of \emph{node-level tasks}. Yet another important type of graph-related tasks (in a \emph{local} sense \cite{Scarselli2009}) is \emph{edge-level} tasks, which exhibits a dichotomy between \emph{edge-existence} prediction, i.e., link prediction, and \emph{edge-property} prediction, i.e., edge classification. For the later task type, the very existence of an edge itself suggests basing the predictions on a properly defined \emph{edge representation}, which should go beyond naively concatenating node representations of its ends \cite{jo2021edge}. Although the protocol \eqref{eqn:bimpnn} implicitly encodes edge features into node representations, it ignores the cascading dynamics of edges (i.e., information implied by cash flow in FRM applications). To build powerful edge representations that efficiently adapt to the underlying graph structure. Mechanisms based on the edge-to-node dual graphs, or \emph{line graph}s, have been proposed \cite{chen2017supervised, jiang2020censnet, cai2020line, jo2021edge} under the undirected GNN protocol \eqref{eqn:gnn_undirected}. To begin our discussion on possible extensions to directed multigraphs, we first review the definition of line graphs as follows: \begin{definition}[Line graph and Line digraph \cite{godsil2001algebraic, bang2008digraphs}] For both undirected graph and directed (multi)graphs where we overload notation without misunderstandings, $ G = (V, E) $, the node set of its line graph $ L(G) = (L(V), L(E)) $ is defined as its edge (multi)set $ L(V) = E $. \begin{description} \item[Undirected graph] the edge set of its line graph is defined as \begin{align}\label{eqn:line} L(E) = \left\lbrace (uv, rs): (u, v) \in E, (r, s) \in E, \{u, v\} \cap \{r, s\} \ne \emptyset \right\rbrace \end{align} \item[Directed (multi)graph] the edge set of its line graph is defined as \begin{align}\label{eqn:diline} L(E) = \left\lbrace (uv, rs): (u, v) \in E, (r, s) \in E, v = r\right\rbrace \end{align} \end{description} \end{definition} For undirected graphs, their line graphs provides a natural way to update edge representations under standard message passing protocols like \eqref{eqn:gnn_undirected}. However, trivially extending \eqref{eqn:bimpnn} using the definition of line digraphs may incur significant information loss: We take the graph in figure \ref{fig:digraph_illustration} as an example, its line graph has an \emph{empty} edge set, which makes the message passing framework useless over the derived line graph. While the graph-theoretic definition enjoys some nice properties \cite{bang2008digraphs}, the adjacency criterion might be overly stringent for deriving useful GNN architectures. Intuitively, we may expect different transactions triggered by the same account as correlated rather than independent, which makes connectivity of edges like $ (n_5, n_9) $ and $ (n_5, n_0) $ as desirable. Therefore, we propose the following \emph{augmentation strategy} to obtain an \emph{augmented edge adjacency graph} $ \overline{L(G)} = (\overline{L(V)}, \overline{L(E)}, T(E)) $: The node set is still defined as $ \overline{L(V)} = E $, and we augment the edge set using the undirected adjacency criterion \eqref{eqn:line}. To retain directional information, we encode the adjacency pattern of two edges (with four possible patterns: \emph{head-to-head}, \emph{head-to-tail}, \emph{tail-to-head}, \emph{tail-to-tail}) into a categorical vector, which we denote as $ T(E) = \{ \tsf{type}(uv, rs): (uv, rs) \in \overline{L(E)} \} $. By construction, for each edge in $ \overline{L(E)} $, its reverse is also in $ \overline{L(E)} $ with possibly different edge types. We provide a pictorial illustration in the left part of figure \ref{fig:linegraphs}. \par To derive an edge representation update rule, we follow the spirit of the BiMPNN node update rule \eqref{eqn:bimpnn}: let $ N^+_L(uv), N^-_L(uv) $ be the out and in neighborhoods in the ordinary line graph $ L(G) $ of $ G $, and $ \overline{N^+_L(uv)}, \overline{N^-_L(uv)} $ to be those in $ \overline{L(G)} $, respectively. For each edge $ (uv, rs) \in \overline{L(E)} $, we use $ \tsf{C}(uv, rs) \in V $ as the common incident node of the edges $uv$ and $rs$. The following updating rule enhances BiMPNN protocol with duality information, which we term BiMPNN-DE: \begin{align}\label{eqn:bimpnnde} \resizebox{0.92\linewidth}{!}{$ \begin{aligned} h^{(l+1)}_v &= \tsf{MERGE}^{\tsf{node}}\left(\phi^{(l+1)}_v, \psi^{(l+1)}_v\right) \\ g^{(l+1)}_{uv} &= \tsf{MERGE}^{\tsf{edge}}\left(\theta^{(l+1)}_{uv}, \gamma^{(l+1)}_{uv}\right) \\ \phi^{(l+1)}_v &= \tsf{COMBINE}^{\tsf{node}}_{\tsf{in}}\left( h^{(l)}_v, \right.\\ &\quad \left.\tsf{AGG}^{\tsf{node}}_{\tsf{in}}\left(\tsf{MESSAGE}^{\tsf{node}}_{\tsf{in} }(h^{(l)}_v, h^{(l)}_u, \blue{g^{(l)}_{vu}}, u \in N^+(v))\right)\right)\\ \psi^{(l+1)}_v &= \tsf{COMBINE}^{\tsf{node}}_{\tsf{out}}\left( h^{(l)}_v,\right.\\ &\quad \left.\tsf{AGG}^{\tsf{node}}_{\tsf{out}}\left(\tsf{MESSAGE}^{\tsf{node}}_{\tsf{out}}(h^{(l)}_v, h^{(l)}_u, \blue{g^{(l)}_{ur}}, u \in N^-(v))\right)\right) \\ \theta^{(l+1)}_{uv} &= \tsf{COMBINE}^{\tsf{edge}}_{\tsf{in}}\left( g^{(l)}_{uv},\right.\\ &\quad \left.\tsf{AGG}^{\tsf{edge}}_{\tsf{in}}\left(\tsf{MESSAGE}^{\tsf{edge}}_{\tsf{in}}(g^{(l)}_{uv}, g^{(l)}_{pq}, \blue{\hat{h}^{(l)}_{pq, uv}}, pq \in \overline{N_L^+(uv)})\right)\right)\\ \gamma^{(l+1)}_{uv} &= \tsf{COMBINE}^{\tsf{edge}}_{\tsf{out}}\left( g^{(l)}_{uv},\right.\\ &\quad \left.\tsf{AGG}^{\tsf{edge}}_{\tsf{out}}\left(\tsf{MESSAGE}^{\tsf{edge}}_{\tsf{out}}(g^{(l)}_{uv}, g^{(l)}_{rs}, \blue{\hat{h}^{(l)}_{uv, rs}}, rs \in \overline{N_L^-(uv)})\right)\right) \\ \hat{h}^{(l)}_{uv, rs} &= \tsf{COMBINE}^{\tsf{type}}\left(h^{(l)}_{\tsf{C}(uv, rs)}, T_{\tsf{type}(uv, rs)}\right) \end{aligned} $} \end{align} Where we use $ g^{(l)}_{uv} $ to denote the hidden representation of edge $uv$ at the $l$-th layer of GNNs derived from the BiMPNN-DE protocol. The protocol devices an additional edge representation update component that mirrors the BiMPNN protocol over the augmented edge adjacency graph $ \overline{L(G)} $ (see the last four equations in the display \eqref{eqn:bimpnnde}). To obtain an edge representation counterpart $\tilde{h}^{(l)}_{uv, rs}$ during the aggregation process over $ \overline{L(G)} $, we use an additional $\tsf{COMBINE}^{\tsf{type}}$ mechanism that combines features of the common incident node and the information of adjacent types, with is encoded into a learnable edge type embedding matrix $ T \in \mathbb{R}^{4 \times d} $. The BiMPNN-DE protocol \eqref{eqn:bimpnnde} offers a much larger design space than that of BiMPNN protocol. In its full generality, we may specify up to $15$ different mechanisms corresponding to different \tsf{MERGE}, \tsf{COMBINE}, \tsf{AGG} and \tsf{MESSAGE} operations. From a practical point of view, we may design the aforementioned operations using parameterized functions that share the same underlying structure. \subsection{The GRANDE architecture} In this section, we devise the previously developed BiMPNN-DE protocol \eqref{eqn:bimpnnde} to derive a concrete GNN architecture that simultaneously outputs node and edge representations, along with an improvement strategy that targets edge-property prediction tasks. We base our design upon the acclaimed Transformer architecture \cite{vaswani2017attention}, which has seen abundant adaptations to GNNs recently \cite{xu2020inductive, dwivedi2020generalization, ying2021transformers}. We define the multiplicative attention mechanism that incorporates edge information as follows: \begin{align}\label{eqn:attention} \resizebox{0.92\linewidth}{!}{$ \begin{aligned} \tsf{ATTN}&(h_v, \{h_u, g_{uv}\}_{u \in N(v)})= \sum_{u \in N(v) \cup \{v\}} \alpha_{uv} W_N h_u + \beta_{uv} W_E g_{uv} \\ \alpha_{uv} &= \dfrac{\exp\left(\langle W_Q h_v, W_K h_u\rangle / \sqrt{d} \right)}{\sum_{u \in N(v) \cup \{v\}}\exp\left(\langle W_Q h_v, W_K h_u\rangle/ \sqrt{d}\right)} \\ \beta_{uv} &= \dfrac{\exp\left(\langle W_Q h_v, W_E g_{uv}\rangle/ \sqrt{d}\right)}{\sum_{u \in N(v) \cup \{v\}}\exp\left(\langle W_Q h_v, W_E g_{uv} \rangle/ \sqrt{d}\right)} \end{aligned} $} \end{align} We include commonly used operations in a transformer block, namely LayerNorm (\tsf{LN}), skip connection and a learnable two layer MLP (\tsf{FF}) as nonlinearity \cite{vaswani2017attention}, and wraps them into a transformer block: \begin{align}\label{eqn:transformer} \begin{aligned} \tsf{TRANSFORMER}&(h_v, \{h_u, g_{uv}\}_{u \in N(v)}) = \tsf{LN}(\tilde{h}_v + \tsf{FF}(\tilde{h}_v))\\ \tilde{h}_v &= \tsf{LN}(h_v + \tsf{ATTN}(h_v, \{h_u, g_{uv}\}_{u \in N(v)})) \end{aligned} \end{align} After defining the basic mechanisms, we write the node and edge update rules as follows: \begin{align}\label{eqn:grande_base} \resizebox{0.92\linewidth}{!}{$ \begin{aligned} h^{(l+1)}_v &= \tsf{CONCAT} \left(\phi^{(l+1)}_v, \psi^{(l+1)}_v\right) \\ g^{(l+1)}_{uv} &= \tsf{CONCAT} \left(\theta^{(l+1)}_{uv}, \gamma^{(l+1)}_{uv}\right) \\ \phi^{(l+1)}_v &= \tsf{TRANSFORMER}^{\tsf{node}}_{\tsf{in}}\left(\Phi_N h_v^{(l)}, \{\Phi_N h_u^{(l)}, \Phi_E g^{(l)}_{uv}\}_{u \in N^+(v)}\right) \\ \psi^{(l+1)}_v &= \tsf{TRANSFORMER}^{\tsf{node}}_{\tsf{out}}\left(\Psi_N h_v^{(l)}, \{\Psi_N h_u^{(l)}, \Psi_E g^{(l)}_{uv}\}_{u \in N^-(v)}\right) \\ \theta^{(l+1)}_{uv} &= \tsf{TRANSFORMER}^{\tsf{edge}}_{\tsf{in}}\left(\Theta_N g_{uv}^{(l)}, \{\Theta_N g_{uv}^{(l)}, \Theta_E \hat{h}^{(l)}_{pq, uv}\}_{pq \in \overline{N_L^+(uv)}}\right) \\ \gamma^{(l+1)}_{uv} &= \tsf{TRANSFORMER}^{\tsf{edge}}_{\tsf{out}}\left(\Gamma_N g_{uv}^{(l)}, \{\Gamma_N g_{uv}^{(l)}, \Gamma_E \hat{h}^{(l)}_{uv, rs}\}_{rs \in \overline{N_L^-(uv)}}\right) \end{aligned} $} \end{align} The updating equations \eqref{eqn:grande_base} involve many learnable parameters, to which we apply the following naming convention: We use upper case greek letters $\Phi, \Psi, \Theta, \Gamma$ to denote projection matrices that takes value in $ \mathbb{R}^{2d \times d} $, and we use the subscript $N$ for \emph{node-related projection} and $E$ for \emph{edge-related projection}. The $\tsf{COMBINE}^{\tsf{type}}$ operation is set to be element-wise addition. \par\noindent \textbf{Improvements over edge-property prediction tasks} The architecture in \eqref{eqn:grande_base} is most helpful when the underlying task is to predict properties of some existent edges, which serves as the underlying task for many financial applications like fraud detection and AML. Toward this goal, an ad-hoc solution is to base the prediction with respect to edge $ (u, v) $ upon the concatenation of $h_u$, $h_v$ and $g_{uv}$. According to recent practices over pairwise learning on graphs \cite{wang2019nan, wang2021pairwise}, incorporation of interactions between $ N(u) $ and $ N(v) $, or \emph{cross node interactions} significantly improves prediction performance. However, the cross-node attention module proposed in \cite{wang2019nan} requires full attention between $ h_{N(u)} $ and $ h_{N(v)} $, yielding a potentially large computation overhead. Here we provide a more efficient alternative to model the cross-node interactions called the \emph{cross-query attention} module. Given a node pair $ (u, v) $, compute \begin{align}\label{eqn:cross_query_attn} \begin{aligned} \delta_{uv} = \tsf{CONCAT}&\left(\tsf{ATTN}_{\tsf{left}}^{\tsf{in}}(h_u, \{h_r, g_{rv}\}_{r \in N^+(v)}), \right. \\ &\left.\tsf{ATTN}_{\tsf{left}}^{\tsf{out}}(h_u, \{h_s, g_{vs}\}_{s \in N^-(v)})\right) \\ \delta_{vu} = \tsf{CONCAT}&\left(\tsf{ATTN}_{\tsf{right}}^{\tsf{in}}(h_v, \{h_r, g_{ru}\}_{r \in N^+(u)}), \right. \\ &\left. \tsf{ATTN}_{\tsf{right}}^{\tsf{out}}(h_v, \{h_s, g_{us}\}_{s \in N^-(u)})\right) \end{aligned} \end{align} The above procedure \eqref{eqn:cross_query_attn} performs four queries that attends $u$ and $v$ to its opponent's in and out neighbors, respectively. Providing the existence of an edge $(u, v)$, the mechanism \eqref{eqn:cross_query_attn} could be understood as attending nodes to the a specific subsets of their \emph{second-order} neighborhoods which have close relationship to the edges of interest. Finally we summarize the previous developments into a framework termed multi\textbf{G}raph t\textbf{RAN}sformer with \textbf{D}uality \textbf{E}nhancement (GRANDE) , that utilizes the following edge representation for edge-property prediction tasks: \begin{align} g^{\tsf{GRANDE}}_{uv} = \tsf{CONCAT}(g_{uv}, h_v, h_u, \delta_{uv}, \delta_{vu}) \end{align} \subsection{Extension to temporal graphs} According to the formulation in section \ref{sec:problem_formulation}, extending the GRANDE framework to $G(\mathcal{T})$ requires utilization of the edge-wise timestamp information $ \{t_{uv}, (u, v) \in E \} $ to produce \emph{time-aware node and edge representations}. Inspired by recent developments of time-aware representation learning approaches \cite{xu2019self, xu2020inductive}, we propose an \emph{extended generic time encoding} mechanism that enhances the node and edge update rule of BiMPNN-DE with temporal information. Finally, to better exploit the structure of the temporal graph, we suggest a \emph{pruning strategy} that shrinks the number of edges of $ \overline{L(G_{\mathcal{T}}))} $ by a factor up to two. \par\noindent \textbf{Generic time encoding} The functional time encoding (FTE) provides a principled way that modifies the self-attention operation \eqref{eqn:attention} with minimal architecture change: \begin{align}\label{eqn:temporal_attention} \resizebox{0.9\linewidth}{!}{$ \begin{aligned} \tsf{TATTN}&(h_v, \{h_u, g_{uv}\}_{u \in N(v)}) = \sum_{u \in N(v) \cup \{v\}} \alpha_{uv} W_N \check{h}_{uv} + \beta_{uv} W_E \check{g}_{uv} \\ \check{h}_{uv} &= \tsf{CONCAT}(h_u, \tsf{TE}(|\Delta t_{uv}|)) \\ \check{g}_{uv} &= \tsf{CONCAT}(g_{uv}, \tsf{TE}(|\Delta t_{uv}|)) \end{aligned} $} \end{align} Where $ \tsf{TE}(|\Delta t_{uv}|) $ is temporal embedding obtained via certain FTE mechanisms. $\alpha_{uv}$s and $\beta_{uv}$s are calculated analogously to the rules in \eqref{eqn:attention}. In this paper we will follow the Bochner-type FTE \cite{xu2019self, xu2020inductive}: \begin{align} \tsf{TE}(s) = \sqrt{\frac{1}{d}} \left[ \cos(\rho_1 s), \sin(\rho_1 s), \ldots, \cos(\rho_d s), \sin(\rho_d s)\right] \end{align} with learnable parameters $(\rho_1, \ldots, \rho_d)$. According to the setup in \cite{xu2020inductive}, timestamps are associated with nodes rather than edges, hence the authors used the time difference $ \Delta t_{uv} = t_u - t_v $. The situation becomes more complicated when timestamps are associated with edges, for which we propose the following modification: \begin{align}\label{eqn:edge_time_difference} \Delta t_{uv} = t_{uv} - \min_{u \in N(v)}t_{uv} \end{align} We use FTE based on \eqref{eqn:edge_time_difference} and replace the \tsf{ATTN} component with \tsf{TATTN} component of the node time difference calculation in the node update part of \eqref{eqn:grande_base}. For the edge update part, the ordinary node time difference method applies naturally since edge timestamps act as node timestamps in the dual formulation. \par\noindent \textbf{Temporal information and pruning strategies} the proposed line graph augmentation strategy produces an undirected $ \overline{L(G)} $. While this undirected network might provide valuable information in general, in financial risk management scenarios where edges represent \emph{timestamped transactions}, directed adjacencies between transactions are typically of interest: Consider a transaction $ e_{t_0} $ from Bob to Alice, it is reasonable to assume that \emph{downstream} transactions of $ e_{t_0} $ (i.e., transactions $ e_t $ with $ t > t_0 $) will be affected by $ e_{t_0} $, but its upstream transactions shall not be affected. Inspired from this intuition, we introduce a \emph{causal pruning strategy} that applies when temporal information is available in the underlying graph, i.e, for an edge $ e $ that goes from $ u $ to $ v $, we have its time of occurrence $ t_e $. The causal pruning strategy deletes edges in $ \overline{L(G)} $ with the occurrence time of the head node being earlier than that of the tail node. When the causal pruning strategy is applicable, we may prune up to $50\%$ of the edges in $ \overline{L(G)} $. An illustration is provided in the right part of figure \ref{fig:linegraphs}. Note that the proposed strategy is closely related to the construction of causal temporal subgraphs in temporal graph modeling literature \cite{xu2020inductive, ddgcl}. \begin{figure} \begin{minipage}{.45\linewidth} \centering \scalebox{.6}{\input{linegraph_aug.tex}} \end{minipage} \begin{minipage}{.45\linewidth} \centering \scalebox{.6}{\input{lingraph_prune.tex}} \end{minipage} \caption{An illustration of the proposed line graph augmentation strategy: The left figure stands for the augmented edge adjacency graph $ \overline{L(G)} $ for the digraph depicted in figure \ref{fig:digraph_illustration}. We use colored edges to represent edge types: {\color{sandybrown} head-to-head} and {\color{brightmaroon} tail-to-tail}, note that the remaining two kinds of edge types do not appear in $ \overline{L(G)} $. The right figure shows the effect of the causal pruning strategy under the additional temporal constraint that $t_0 < t_1 < \cdots < t_9$, with $t_i$ being the occurrence time of edge $t_i$ for $i \in \{0, \ldots, 9\}$} \label{fig:linegraphs} \end{figure} \subsection{Scalability and complexity} Most of the real-world financial networks like transaction networks are \emph{sparse}, i.e., most people only make transactions to a few others given a finite time window. Consequently, the computational complexity of any message passing neural networks could be roughly regarded as $O(Ed^2)$. Extending ordinary MPNN architectures to BiMPNN protocol doubles the computation cost, which could be easily resolved through parallelization in modern deep learning frameworks like tensorflow \cite{abadi2016tensorflow}. The extra computational cost brought by introducing the dual component \eqref{eqn:bimpnnde} requires more care: even when the original graph is sparse, its augmented edge adjacency graph might be dense or even complete. Such cases do happen in realistic scenarios since large hubs frequently exist in transaction networks, which corresponds to a complete subgraph in the dual network. Therefore the worst-case computation cost of $O(E^2d^2)$ is sometimes inevitable in architectures derived from the BiMPNN-DE protocol \eqref{eqn:bimpnnde}. Hence to meet the computational requirement of GNN architectures like GRANDE , performing GNN training/inference over the whole graph is unrealistic. Instead, we resort to a \emph{local} computation alternative implemented by the AGL system \cite{zhang2020agl} which grabs the $K$-hop rooted subgraph of each target node and performed batched stochastic training and efficient parallel inference given distributed infrastructures like MapReduce \cite{zhang2020agl}. In practical scenarios, it is often reasonable to set an upper bound $M_{\tsf{max}}$ on the edges of any $K$-hop rooted subgraph and device proper sampling methods to meet the requirement. The resulting computational complexity during training is reduced to $O(BM^2_{\tsf{max}}d^2)$, where $B$ denotes the batch size. Since we may control $M_{\tsf{max}}$ so that the whole batch of subgraphs fits the storage requirement of high-performance hardware like GPU, the computational costs of running GRANDE becomes fully affordable for industry-scale distributed training and inference. \section{Related Works} \subsection{Neural models over directed graphs} Directional extensions of message passing GNN protocol were mentioned in pioneer works \cite{pmlr-v70-gilmer17a, battaglia2018relational} without providing empirical evaluations. Recent developments toward designing GNNs for digraphs are mostly inspired by different types of graph Laplacians that are defined over digraphs. For example, \cite{NEURIPS2020_cffb6e22} used the definition in \cite{chung2005laplacians} and \cite{zhang2021magnet} used the Hermitian magnetic Laplacian to decouple the aggregation process of graph connectivity and edge orientations. \subsection{GNNs for edge representation learning} The idea of utilizing node-to-edge duality was explored in early works like LGNN \cite{chen2017supervised}, where the authors drew insights from community detection literature, and use the non-backtracking walk operator \cite{krzakala2013spectral} to define the dual graph and perform GCN-like aggregations simultaneously over both graphs. Later developments \cite{jiang2020censnet, cai2020line, jo2021edge} focused on variants of LGNN with the alternative definition of the dual, such as the standard LINE graph \cite{godsil2001algebraic}. \subsection{Transformer architectures over graphs} The renowned GAT architecture \cite{velivckovic2017graph} could be regarded as using the \emph{additive} attention mechanism to form the attention layer, as opposed to the \emph{multiplicative} attention mechanism adopted by the Transformer architecture \cite{vaswani2017attention}. Adaptations of the original Transformer to graph context have been assessed recently, \cite{dwivedi2020generalization} replaced the additive attention in GAT with inner product attention and use spectral embedding as a proxy for the positional embedding component in the original transformer architecture. In \cite{ying2021transformers}, the authors proposed to use \emph{full-attention} transformers and use graph-theoretical attributes of nodes and edges to guide the attention procedure. While the results were shown competitive over biological benchmarks, the computational overhead is way too heavy for industrial-level graphical applications. \section{Experiments} In this section, we report empirical evaluations of GRANDE over an industrial application as well as assessments over public datasets. We focus on the edge classification task over temporal directed multigraphs. Finally, we present a detailed ablation study to decompose the contributions of different constituents of GRANDE . \subsection{Datasets} We use one industrial dataset and two public datasets, with their summary statistics listed in table \ref{tab:dataset_summary} in appendix \ref{sec:app:dataset_summary}.\par\noindent \textbf{AML dataset} This dataset is generated from transaction records collected from Alipay, one of the world's leading online payment systems. The business goal is to identify transactions that exhibit risky patterns as being highly suspicious of money laundering. The underlying graph is constructed by treating users as nodes and transactions as directed edges with arbitrary multiplicity. We engineer both node and edge features under a two-stage process: We first obtain raw node features via statistical summaries of corresponding user's behavior on the platform during specific time periods, and raw edge features consist of transaction properties as well as related features of two users involved in the transaction. \footnote{Per organizational regulations, the detailed feature engineering logic is not fully described. We will consider (partially) releasing the AML dataset after passing relevant security checks of the company, as well as the source code.} The decision tree feature transforms \cite{he2014practical} is then applied to both features so that after the transform, the input node and edge feature for all the assessed models are sparse categorical features with dimension $6400$. For both training and testing, we collect data under a $10$-day period with no overlap between the training period and the testing period. A random subset corresponding to 10\% of the testing data is held out for validation. \par\noindent \textbf{Bitcoin datasets} We use two who-trusts-whom networks of people who trade using Bitcoin on two different platforms, Bitcoin OTC and Bitcoin Alpha \cite{kumar2016edge, kumar2018rev2}. Both networks are directed without edge multiplicities, each edge is associated with a timestamp and a trust score ranging from $-10$ to $10$. We consider the task of binary edge classification with edge labels generated as whether the trust score is negative. Using node features represented as the concatenation of one-hot representation of in and out-degree of nodes. For both datasets, we use the chronological split that uses $70\%$ data for training, $10\%$ for validation, and $20\%$ for testing \subsection{Baselines} We compare the proposed GRANDE framework with the following types of baselines: \begin{description} \item[Undirected approaches] We consider two representative GNN architectures GCN \cite{kipf2016semi} and GAT \cite{velivckovic2017graph} that operate on undirected graphs. Since temporal information is available in all three datasets, we also include the TGAT architecture \cite{xu2020inductive}. As all the aforementioned methods produce node-level representations, we use the concatenation of node representations as edge representation according to the adjacency structure. As frameworks that directly output edge representation remain few, we include the EHGNN architecture \cite{jo2021edge} as a strong baseline. To make the undirected architectures compatible with directed (multi)graphs, we add reverse edges with duplicated edge features if there exist no edge multiplicities in the digraph. Otherwise, we keep only one edge between each pair of nodes, with the corresponding edge feature generated via aggregating the original edge features (according to the "multigraph to graph" hierarchy) using the DeepSet method \cite{zaheer2017deepsets}, and add reverse edges thereafter. \item[DiGraph-oriented approaches] We consider two digraph GNN architectures that utilizes different notions of directed graph Laplacians, DGCN \cite{ma2019spectral} and MagNet \cite{zhang2021magnet}. \end{description} The aforementioned baselines exclude some of the recently proposed state-of-the-art GNN models like Graphormer \cite{ying2021transformers} for undirected graphs or directed approaches like DiGCN \cite{NEURIPS2020_cffb6e22} due to scalability issues, i.e., they require either full graph attention or solving eigen programs over the full graph Laplacian, which are computationally infeasible for industry-scale graphs. \subsection{Experimental setup}\label{sec: exp_setup} Across all the datasets and models, we use a two-layer architecture with hidden dimension $d=128$ without further tuning. For models with generic time encodings, we fix the dimension of time encoding to be $128$. For transformer related architectures, we follow the practice in \cite{vaswani2017attention} and use a two-layer MLP with ReLU activation with hidden dimension $512$. As all the relevant tasks are binary classifications, we adopt the binary cross entropy loss as the training objective, with $\ell_2$ regularization under a coefficient $0.0001$ uniformly across all experiments. The graph data are constructed via the GraphFlat component of the AGL system \cite{zhang2020agl} that transforms the raw graph data into batches of subgraphs with appropriate sampling. \footnote{The AGL framework is particularly useful when dealing with industry-scale graphs that are barely possible to process as a whole. However, it may lose some information in the sampling stage of the preprocessing phase. To fully mimic the industrial setup, we preprocess all three datasets using AGL, therefore the results of Bitcoin datasets are not directly comparable to previously published results. } We use Adam optimizer with a learning rate of $0.0001$ across all tasks and models. For the bitcoin datasets, we train each model for $10$ epochs using a batch size of $128$ and select the best-performed one according to the roc-auc score on the validation data under periodic evaluations every $100$ steps. For the AML dataset, we train the model for $2$ epochs with a batch size of $256$ as the size of the dataset is sufficiently large. We adopt similar model selection criterion as those of Bitcoin datasets, with periodic evalutions every $500$ steps. \par\noindent \textbf{Metrics} Since the primary focus of this paper is applications to the FRM scenario, we choose three representative metrics, namely roc-auc score (AUC), Kolmogorov-Smirnov statistic (KS) and F$1$ score (F$1$). \begin{table*}[] \centering \caption{Experimental results over two public Bitcoin datasets and the AML dataset, with best performances in \textbf{bold}} \begin{tabular}{lccccccccc} \toprule & \multicolumn{3}{c}{Bitcoin-OTC} & \multicolumn{3}{c}{Bitcoin-Alpha} & \multicolumn{3}{c}{AML}\\ & AUC & KS & F$1$ & AUC & KS & F$1$ & AUC & KS & F$1$ \\ \midrule GCN \cite{kipf2016semi} & $0.742$ & $0.376$ & $0.432$ & $0.626$ & $0.198$ & $0.282$ & $0.958$ & $0.793$ & $0.704$\\ GAT \cite{velivckovic2017graph}& $0.736$ & $0.381$ & $0.393$ & $0.626$ & $0.178$ & $0.269$ & $0.962$ & $0.802$ & $0.718$\\ TGAT \cite{xu2020inductive} & $0.744$ & $0.401$ & $0.422$ & $0.656$ & $0.248$ & $0.294$ & $0.963$ & $0.804$ & $0.720$ \\ EHGNN \cite{jo2021edge} & $0.719$ & $0.356$ & $0.420$ & $0.626$ & $0.228$ & $0.297$ & $0.961$ & $0.804$ & $0.718$\\ DGCN \cite{ma2019spectral} & $0.634$ & $0.243$ & $0.354$ & $0.633$ & $0.228$ & $0.282$ & $0.962$ & $0.806$ & $0.720$\\ MagNet \cite{zhang2021magnet} & $0.753$ & $0.388$ & $0.434$ & $0.645$ & $0.217$ & $0.293$ & $0.954$ & $0.780$ & $0.688$\\ \midrule GRANDE (reduced) & $0.789$ & $0.459$ & $0.460$ & $0.669$ & $0.256$ & $0.294$ &$0.965$ & $0.810$ & $0.726$\\ GRANDE & \best{0.829} & \best{0.524} & \best{0.532} & \best{0.769} & \best{0.415} & \best{0.398} & \best{0.966} & \best{0.813} & \best{0.734} \\ \bottomrule \end{tabular} \label{tab:dataset_results} \end{table*} \begin{table*}[] \centering \caption{Performance summary of ablation studies, with best performance in \textbf{bold}} \begin{tabular}{lccccccccc} \toprule & \multicolumn{3}{c}{Bitcoin-OTC} & \multicolumn{3}{c}{Bitcoin-Alpha} & \multicolumn{3}{c}{AML}\\ & AUC & KS & F$1$ & AUC & KS & F$1$ & AUC & KS & F$1$ \\ \midrule GRANDE & $0.829$ & $0.524$ & \best{0.532} & \best{0.769} & \best{0.415} & \best{0.398} & \best{0.966} & \best{0.813} & \best{0.734} \\ \midrule - reduced & $0.789$ & $0.459$ & $0.460$ & $0.669$ & $0.256$ & $0.294$ &$0.965$ & $0.810$ & $0.726$ \\ - w/o causal pruning & $0.801$ & $0.464$ & $0.485$ & $0.726$ & $0.325$ & $0.339$ & $0.966$ & $0.813$ & $0.732$ \\ - w/o time encoding & \best{0.834} & $0.525$ & $0.531$ & $0.691$ & $0.265$ & $0.324$ & $0.966$ & $0.813$ & $0.731$ \\ - w/o cross-query attention & $0.828$ & \best{0.528} & $0.504$ & $0.766$ & $0.395$ & $0.372$ & $0.966$ & $0.813$ & $0.730$ \\ - w line graph & $0.762$ & $0.405$ & $0.415$ & $0.655$ & $0.229$ & $0.285$ & $0.965$ & $0.812$ & $0.729$ \\ \bottomrule \end{tabular} \label{tab:ablation_study} \end{table*} \subsection{Performance} We present evaluation results in table \ref{tab:dataset_results}. Apart from the proposed GRANDE architecture, we report a \emph{reduced} version of GRANDE via discarding all operations on the augmented edge adjacency graph, as well as the cross-query attention module \eqref{eqn:cross_query_attn}. The resulting model could be considered as implementing a time-aware variant of graph transformer under the BiMPNN protocol. We summarize our experimental findings as follows: \vspace{-1mm} \begin{itemize}[leftmargin=*] \item For the Bitcoin datasets which could be considered as under the \emph{weak feature} regime, the GRANDE architecture obtains substantial performance improvement: On the Bitcoin-OTC dataset, the relative improvement over the best baselines are $10.1\%$, $30.7\%$ and $22.6\%$ with respect to AUC, KS, and F$1$. On the Bitcoin-Alpha dataset, the relative improvement is more significant with $19.2\%$, $67.3\%$, and $35.4\%$ respectively. We attribute the improvements to both the directional information and the duality information that GRANDE utilizes. The improvements of the directional information could be inferred from the results of the reduced GRANDE variant, which exhibits solid improvements over all the baselines. The incorporation of edge-to-node duality and cross-query attention systematically encodes more structural information, therefore yielding further improvements. \item For the AML dataset which could be regarded as under the \emph{strong feature} regime, the performance improvement is significant with respect to KS and F$1$ metrics while being less significant with respect to AUC. Such improvements are still valuable in FRM applications since a higher F$1$ score potentially suggests better patterns of the precision-recall (PR) curve, which we plot in figure \ref{fig:precision_recall}. The PR curve shows the dominant performance of GRANDE against baselines: under various precision levels, the recall of GRANDE surpasses the best baseline (TGAT) by as many as $5.29\%$ in absolute value and $13.4\%$ in relative. \end{itemize} \begin{figure} \centering \scalebox{.6}{\input{precision_recall.tex}} \caption{Precision-recall (PR) curve under the AML dataset. We show recall values corresponding to high precision ranges (from $0.7$ to $1.0$ equally spaced with $0.025$)} \label{fig:precision_recall} \end{figure} \subsection{Ablation study} We evaluate the following variants of GRANDE over all three datasets to investigate contributions of different constituents: \begin{description} \item[Reduced version] this is the one reported in table \ref{tab:dataset_results} \item[Without causal pruning] in this model variant we retain the full edge adjacency graph without pruning. Which is computationally heavier than the GRANDE architecture \item[Without time encoding] in this model variant we discard the temporal component of GRANDE and use the update rule \eqref{eqn:grande_base} \item[Without cross-query attention] in this model variant we discard the cross-query attention module \eqref{eqn:cross_query_attn}, and use $ \tsf{CONCAT}(g_{uv}, h_v, h_u) $ as the output embedding for edge $(u, v)$. \item[With line graph] in this model variant, we use the ordinary directed line graph instead of the proposed augmented edge adjacency graph. i.e., we replace $\overline{N_L^+(uv)}$ and $\overline{N_L^-(uv)}$ in \eqref{eqn:grande_base} with $N_L^+(uv)$ and $N_L^-(uv)$, respectively. \end{description} \textbf{Results} we report results in table \ref{tab:ablation_study} using the same training configuration and evaluation metrics as in section \ref{sec: exp_setup}. There are a couple of notable observations: Firstly, the causal pruning procedure saves computation as well as improves performance, providing a solid relational inductive bias in temporal graph modeling. Secondly, the incorporation of time encoding and cross-query attention are in general helpful. Finally, using the ordinary line graph performs on par with the reduced model, showing the insufficiency of additional information provided by line digraphs, thereby verifying the necessity of using the augmented edge adjacency graph. \section{Deployments} The proposed GRANDE model has already been deployed in Alipay's AML risk detection system. It provides risk assessment services to millions of entities every day and contributes more than $50\%$ suspicious entity identification to AML risk management and control in specific business scenarios. Based on over 11.3 million transaction records within a week provided by the Alipay payment platform, we conduct an A/B test between GRANDE , TGAT, and the identification system that has been previously deployed in production (with its working mechanism a combination of rule-based heuristics and gradient boosting models). Due to the existence of unknown risk transactions, we first adopt an empirical white list to mock the output precision of these models and then evaluate the performance by comparing the recall at the same mock precision. As summarized in table \ref{tab:deployment}, the results suggest that GRANDE offers better recall given the same precision level, with an absolute margin of $2.39\%$, which is consistent with our experimental findings. Finally, a combination of the output of GRANDE and the previous system (via simple model averaging) increases the overall coverage rate by an absolute margin of $36.46\% (45.41\% \rightarrow 81.87\%)$. \begin{table} \centering \caption{Deployment summaries} \begin{tabular}{lcc} \toprule Model & Mock Precision & Recall \\ \midrule Previous system & $0.925$ & $0.454$ \\ TGAT & $0.959$ & $0.723$ \\ GRANDE & $0.959$ & $0.747$ \\ \bottomrule \end{tabular} \label{tab:deployment} \end{table} \section{Discussion} \textbf{Interpretability} The dominating performance of neural approaches comes at the cost of lacking of \emph{model interpretablity}, which is crucial to application scenarios like AML, where outputs of decision making systems tie strongly with regulatory strictures \cite{kute2021aml}. The adoption of neural approaches enjoys better performance than potentially interpretable methods like linear models as well as losing interpretability. Model explanation methods targeting graph neural models are especially challenging \cite{liu2022interpretability} due to the combinatorial nature of the interpretation problem. Off-the-shelf GNN explaining tools (refer to \cite{liu2022interpretability} and references therein) are not yet applicable to neural models over directed graphs, which is a promising and challenging direction for future explorations. \par\noindent \textbf{Multi-task adaptations} The representation quality in both node and edge embeddings gives the GRANDE architecture the possibility to exploit side-information via multi-task learning paradigms \cite{ruder2017overview}. For example it is quite common in FRM scenarios to obtain both a set of user riskiness labels alongside transaction labels. We have taken a trivial adaptation of GRANDE into multi-task setups using extra node labels via adding a node-level classification loss to the training objective and has shown solid improvement (we report results in appendix \ref{sec:app:further_exp}). Applying more elegant multi-task learning techniques \cite{ruder2017overview} to further exploit the potential of GRANDE is an interesting direction for future studies. \section{Conclusion} In this paper we propose a graph representation learning framework for directed multigraphs that prevail in FRM applications. The proposed framework generalizes the acclaimed message passing graph neural network protocol to incorporate directional information, as well as utilizing the edge-to-node dual relationship to further enhance the relational inductive bias with regard to edge property prediction tasks. A concrete architecture named GRANDE is derived according to the proposed protocol with the transformer architecture being its aggregation mechanism, as well as a cross-query attention module targeting edge-type tasks. The GRANDE model is generalizable to temporal dynamic graphs via proper generic time encodings along with a pruning strategy. Experimental results over both public and industrial datasets verify the efficacy of the design of GRANDE . The model has been deployed in Alipay's online risk management system to fight against financial crime in money laundering. \vspace{-1mm} \bibliographystyle{acm}
\section*{Disclosure statement} The authors report there are no competing interests to declare. \section*{Supplemental Materials} The proofs of \cref{lem:convergence} and \cref{thrm:convergence-joint} are provided in the Appendix. The details of our FEM procedure and additional figures for \cref{sec:examples} are shown in the online supplement. The codes to reproduce all the results in the main paper are provided at the online repository \href{https://github.com/AgueroZZ/Smooth_IWP_code}{github.com/AgueroZZ/Smooth_IWP_code}. \bigskip \bibliographystyle{chicago} \section{Introduction}\label{sec:intro} In many statistical applications that involve an unknown regression function, $g$, inference for the derivatives of $g$ are often as important as inference for $g$ itself \citep{li2020inference, swain2016inferring, de2015smoothed}. To make joint inference for $g$ and its derivatives, we consider a model-based smoothing approach that assigns a Gaussian process ($\GP$) model to the function and its derivatives \citep{rasmussen2003gaussian}. Due to the close relationship with the traditional smoothing spline \citep{wahbaimproper} the $p^{\text{th}}$ order Integrated Wiener Process, denoted as $\text{IWP}_p(\sigma)$, is a popular choice for the $\GP$ model \citep{rw208}. The standard deviation parameter $\sigma \geq 0$ controls the covariance function of the $\text{IWP}_p(\sigma)$, and can also be interpreted as a smoothing parameter, where a larger value allows more variability in the inferred $g$ and a value close to zero will force the inferred $g$ to stay in the span of $p^{th}$ order polynomials. Given a $p-1$ times continuously differentiable function $g$ with $p \in \mathbb{Z}^+$, assigning $g$ with the $\text{IWP}_p(\sigma)$ immediately assigns its $q$th derivative $g^{(q)}$ with the $\text{IWP}_{p-q}(\sigma)$ for any $q < p$. Because of this {\em simultaneous derivative property}, model-based smoothing using $\text{IWP}_{p}(\sigma)$ yields interpretable joint inferences of $g$ and its derivatives. However, directly fitting the IWP models to $g$ and its derivatives is computationally intensive in many practical settings due to the cost to store and factorize the dense large covariance matrices. One way to significantly reduce the computational challenge is to approximate the IWP model with a finite-dimensional approximation obtained through the finite element method (FEM); see \cite{rw208} and \cite{adaptivesmoothingsplines} for examples. However, these methods only apply for order $p = 2$ and do not provide inference for derivatives. Furthermore, they involve an additional approximation to the FEM itself to achieve computational feasibility. In this article, we propose an alternative FEM approximation, called overlapping splines (O-spline), which pursues computational feasibility directly through the choice of test functions, and mirrors the construction of an IWP as the O-spline results from the multiple integrations of these same test functions. This article makes the following contributions: \begin{enumerate} \item[(a)] We propose a computationally efficient, finite-dimensional approximation for the $\text{IWP}_p(\sigma)$ model through FEM, called overlapping splines (O-splines), which is suitable for any order $p\geq1$. We denote by $\tilde{g}_k$ the O-spline approximation for $g$, where $k$ is the number of knots used to construct the approximation. \item[(b)] We show both theoretically and through simulations that the joint distribution of $\tilde{g}_k$ and its derivatives converges to the distribution under the true $\text{IWP}_p(\sigma)$, as the number of knots $k$ increases. \item[(c)] We propose a unified way to define the priors for the parameter $\sigma$ based on the notion of $h$-units predictive standard deviation (PSD), which has consistent interpretation across different order $p$. \end{enumerate} The rest of the paper is structured as the following. In \cref{sec:prelim}, we describe the modelling context for this paper and provide some necessary background for the $\text{IWP}_p(\sigma)$ model. In \cref{sec:method}, we introduce the proposed O-spline approximation; discuss its statistical and computational properties that justify its usage, and describe how to efficiently fit the approximation with the computational method in \cite{noeps}. We also introduce a unified and interpretable way to define the prior for the parameter $\sigma$. In \cref{sec:simulations} and \cref{sec:examples}, we illustrate the practical utility of the proposed method through simulation studies and an analysis of the COVID-19 death rates and their rates of change over time. Finally, we conclude with a discussion in \cref{sec:discussion}. The codes to replicate all the results and examples in this article can be found at the corresponding online repository \href{https://github.com/AgueroZZ/Smooth_IWP_code}{github.com/AgueroZZ/Smooth_IWP_code}. \section{Smoothing with the Integrated Wiener Processes}\label{sec:prelim} Consider the following hierarchical model: \begin{equation}\label{equ:smoothModel} \begin{aligned} Y_i|\boldsymbol{\eta} &\overset{ind}{\sim} \pi(Y_i|\boldsymbol{\eta}, \kappa), \ i \in [n], \\ \eta_i &= \boldsymbol{v}_i ^T \boldsymbol{\beta} + \sum_{l=1}^{L}g_{l}(x_{li}), \ x_{li} \in \Omega_l \subset \mathbb{R}, \boldsymbol{v}_i \in \mathbb{R}^r \\ g_l:\ &\Omega \rightarrow \mathbb{R}, \ g_l \overset{ind}{\sim} \text{IWP}_{p_l}(\sigma_l), \forall l \in [L]. \end{aligned} \end{equation} Here $\pi(Y_i|\boldsymbol{\eta}, \kappa)$ is a twice continuously-differentiable density, linear predictors $\boldsymbol{\eta} = \{\eta_i, i \in [n]\}$, covariates $\{\boldsymbol{v}_i,x_{li}: l \in [L], i \in [n]\}$ and hyperparameter $\kappa$. Each unknown function $g_l:\Omega_l \rightarrow \mathbb{R}$ is assigned an independent $\text{IWP}_{p_l}(\sigma_l)$ model with the SD parameter $\sigma_l$ and order $p_l$. Developing a technique for simultaneous inference of $g_l$ and its derivatives is the purpose of this paper. The above class of model in \cref{equ:smoothModel} belongs to the extended latent gaussian models of \cite{noeps}, and it includes the commonly used generalized additive models \cite{hastiegambook} as well as their extensions such as \cite{casecrossover} and \cite{coxphus}. For the purpose of exposition in the next few sections we consider develops for a single unknown function $g$. \subsection{Integrated Wiener Processes}\label{sec:IWP} To permit simultaneous inference of $g$ and its derivatives up to the order $p-1$ we adopt a $p^{th}$ order Integrated Wiener Process ($\text{IWP}_p(\sigma)$) as the $\GP$ model for $g$ through the following construction: \begin{equation}\label{eqn:expansion} \begin{aligned} g(x) \overset{d}{=} \sum_{l=0}^{p-1}\gamma_l x^l + \sigma W_p(x), \end{aligned} \end{equation} which we denote as $g \sim$ $\text{IWP}_p(\sigma)$. Let $\boldsymbol{\gamma} = (\gamma_0, ..., \gamma_{p-1})^T \sim N(0, \Sigma_{\boldsymbol{\gamma}})$, where $\Sigma_{\boldsymbol{\gamma}} = \text{diag}(\tau_0^2, ..., \tau_{p-1}^2 )$. We assume by default that $\tau_l^2 = 1000$ for all $0\leq l<p$. The process $W_p$ is independent of $\boldsymbol{\gamma}$, and is defined through \citep{shepp1966radon}: \begin{equation}\label{equ:iwp} \begin{aligned} \frac{\partial^q}{\partial t^q} W_p(0) = 0 ~~~\forall~ q<p \quad\quad\text{and}\quad\quad\frac{\partial^p}{\partial t^p} W_p(x) \overset{d}{=} \xi(x) \ \end{aligned} \end{equation} where $\xi(x)$ is a generalized Gaussian white noise process \citep{harvey1990forecasting, spde}. The ability to conduct simultaneous inference for $g$ and its derivatives is immediate from the above construction given $g^{(q)}\sim \text{IWP}_{p-q}(\sigma)$ with coefficients $\gamma_l,~q\leq l<p$. We call this the \emph{simultaneous derivative property}. Note throughout the order $p$ is treated as fixed and specified {\em a priori}. One barrier to conducting inference in this setting involves the covariance matrix of $W_{p}({\bf x})$ where $\boldsymbol{x} = \{x_i, i \in [n] \}$. While the covariance functions for $W_p$ and its derivative have explicit forms given in \citep{robinson2010continuous} the resulting covariance matrix is dense in each instance and inversion is computationally demanding requiring $O(n^3)$ floating point operations. A potentially efficient solution is to utilize the Markov property of integrated Weiner processes \citep{gmrfbook, robinson2010continuous} and make use of efficient algorithms for sparse matrix storage, decomposition, and inversion \citep{rue2001fast}. However, the size of the covariance matrix still grows with $n$, and computations can still become challenging with many locations. As a result, we propose a finite-dimensional approximation to $W_p$ hence $g$ using the Finite Element Method (FEM), that retains the \emph{simultaneous derivative property} while having desirable computational and theoretical properties. \section{Finite Element Method and Overlapping Splines}\label{sec:method} In this section, we develop a basis function approximation to $W_p$ (and hence $g$) using the Finite Element Method (FEM). Assume without loss of generality that the region of interest $\Omega$ has the form of an interval $[0,a]$ where $a \in \mathbb{R}^+$. Here we define $\widetilde{W}_p(x)$ and $\tilde{g}_k(x)$ as \begin{equation}\label{equ:FEM-approxi} \begin{aligned} \widetilde{W}_p(x) = \sum_{j=1}^{k} w_j \varphi_j(x); \quad \tilde{g}_k(x) &= \sum_{l=0}^{p-1}\gamma_l x^l + \sigma \widetilde{W}_p(x) \end{aligned} \end{equation} where $\mathbb{B}_k := \{\varphi_i: i \in [k]\}$ is a set of basis functions to be chosen, and $\boldsymbol{w} = (w_1, ..., w_k)^T$ are unknown (random) weights to be inferred. The distribution of the weights is determined by further choosing a set of test functions $\mathbb{T}_k:=\{\phi_i, i \in [k]\}$, and enforcing the distributional approximation: \begin{equation}\label{weakSol} \boldsymbol{w}\sim N({\bf 0}, \Sigma_{\boldsymbol{w}}) \end{equation} where $\Sigma_{\boldsymbol{w}}^{-1}={\bf B}^T{\bf T}^{-1}{\bf B}$ and $\bf B$, with ${\bf B}_{ij}=\int_\Omega \phi_i(x) \frac{\partial^p\varphi_j}{\partial t^p}(x) dx$ and ${\bf T}_{ij}=\int_\Omega \phi_i(x)\phi_j(x)dx$ respectively. As such, the distribution of the FEM approximation $\widetilde{W}_p$ hence $\tilde{g}_k$ is completely determined by the choices of test functions $\mathbb{T}_k$ and basis function $\mathbb{B}_k$. These choices also determine the other properties of the approximation. A more formal exposition of the above details, involving stochastic differential equations, is given in Supplement B but may also be found in the literature \citep{shepp1966radon}. An example of the FEM is given in \cite{rw208} in what is formally referred to as a \emph{Galerkin solution} for an $\text{IWP}_2$ model. Here they choose $\mathbb{B}_k = \mathbb{T}_k$ to be linear B-splines. As a result, ${\bf T}^{-1}$ is dense and to compute the precision matrix efficiently the authors suggest a further approximation that involves replacing $\bf T$ with $\bf A$, a diagonal matrix where each entry is obtained as the sum of the corresponding row in $\bf T$. The resulting approximation is called the \textit{continuous second order random walk} (RW2) and the same strategy is later generalized in \cite{spde} for modeling continuous spatial variation and in \cite{adaptivesmoothingsplines} for adaptive smoothing with $\text{IWP}_2$. While efficient, the RW2 method suffers from the following disadvantages: \bigskip \newline \indent a. The method is only defined for order $p=2$; \newline \indent b. To be computationally feasible the method involves two approximations; \newline \indent c. While the sample path from $\text{IWP}_2$ model is once continuously differentiable, the \newline \indent\indent sample from the approximation is not. As such the \emph{simultaneous derivative property} \newline \indent\indent does not obtain. \bigskip \newline In the next section, we address the above by proposing a new FEM approximation that pursues simultaneous inference and computational feasibility directly. \subsection{Overlapping Splines (O-Splines)}\label{sec:Approxi} In this section, we utilize the Finite Element Method (FEM) to derive a finite-dimensional approximation of $\text{IWP}_p(\sigma)$ model for general $p\in \mathbb{Z}^+$. We pursue the {\em simultaneous derivative property} and computational efficiency directly, develop what is formally referred to as a \emph{least squares solution}, and then demonstrate that the approximation has the desired properties. We call our proposed method an \emph{Overlapping-spline} (O-spline) approximation for reasons that are apparent from their construction. The development is intuitive, to ensure $\bf T$ is diagonal we define the set of test functions $\mathbb{T}_k$ to be piece-wise constant \begin{equation}\label{equ:basis} \phi_i(x) = \begin{cases} 0 & \text{if } x < s_{i-1}, \\ 1 & \text{if } x \in (s_{i-1},s_{i}], \\ 0 & \text{if } x \geq s_{i}, \end{cases} \end{equation} where $\boldsymbol{s} = \{s_i, i \in [k]\} \subset \Omega$ is a set of $k$ unique locations in increasing order with $s_0=0$. A least squares solution uses basis functions that satisfy the following conditions \citep{spde}: \begin{equation}\label{equ:LeastSquare} \begin{aligned} \frac{\partial^p}{\partial x^p} \varphi_i(x) = \phi_i(x), \quad \frac{\partial^q}{\partial x^q} \varphi_i(0) = 0 \ \text{for} \ \forall ~~q<p. \end{aligned} \end{equation} which is assured by defining (O-Splines) basis $\mathbb{B}_k$ through repeated integration of the test functions $\mathbb{T}_k$: \begin{equation} \varphi_i(x) = \begin{cases} 0 & \text{if } x < s_{i-1}, \\ \frac{(x-s_{i-1})^p}{p!} & \text{if } x \in (s_{i-1},s_{i}], \\ \sum_{k = 1}^{p} \frac{d_i^k (x-s_{i})^{p-k}}{k!(p-k)!} & \text{if } x \geq s_{i}, \end{cases} \end{equation} where $d_i = s_i - s_{i-1}$. The above choice of basis and test function implies the two matrices $\bf T$ and $\bf B$ in \cref{equ:FEM-approxi} are identical. Hence the precision matrix of the basis weights in the proposed approximation is diagonal as $\Sigma_{\boldsymbol{w}}^{-1}={\bf B}^T{\bf T}^{-1}{\bf B} = {\bf T}$, with $i$th diagonal element being $\int_\Omega \phi^2_i(x)dx = d_i$. From the above construction, it is immediately apparent that the O-spline approximation inherits the \emph{simultaneous derivative property} \begin{equation}\label{equ:sim-property-OS} \begin{aligned} \frac{\partial^q}{\partial t^q}\widetilde{W}_p(x) = \frac{\partial^q}{\partial t^q} \sum_j^{k} w_j \varphi_j(x) = \sum_j^{k} w_j \varphi^{(q)}_j(x) = \widetilde{W}_{p-q}(x). \end{aligned} \end{equation} \noindent In contrast to the RW2 method it also has the following three advantages: \bigskip \newline \indent a. The O-spline approximation handles IWP$_p(\sigma)$ at any choice of $p\geq 1$, and hence \newline \indent\indent allows $p$ to be chosen based on the prior knowledge on the differentiability of $g$; \newline \indent b. The sample path from the O-spline approximation inherits the same differentiability \newline \indent\indent as the original IWP$_p(\sigma)$ model, which simultaneously yields model-based \newline \indent\indent inference for the derivatives; \newline \indent c. Since the upper-trapezoidal and diagonal structures of $\Phi$ and $\Sigma_{\boldsymbol{w}}$ already facilitate \newline \indent\indent efficient matrix computations, the O-spline approximation is directly derived as an \newline \indent\indent FEM approximation to the IWP model without further matrix approximations. \bigskip \newline The O-spline approximation also has desirable theoretic properties described in the following section. \subsection{Theoretic properties of the O-spline approximation}\label{sec:OSpline} In addition to the immediate advantages of the proposed O-spline approximation it also has desirable theoretic properties. The proofs of these results appear in the appendix. First, the proposed O-spline approximation avoids the ambiguity of knot selection and placement, which has been the central problem to address for spline-based approximation method \citep{eilers1996flexible}, such as discussed in \cite{eilers2010splines} and \cite{ruppert2000theory}. As stated in \cref{lem:convergence}, the covariance function of the proposed approximation will converge at a linear rate to the covariance of the true IWP$_p(\sigma)$ with any $p\geq 1$, as more knots get equally placed over the region of interest. As a result, in terms of approximation accuracy, it is better to use as many equally spaced knots as is computationally feasible. \begin{lemma}[Convergence of O-spline Approximation]\label{lem:convergence} Let $\Omega = [a,b]$ where $a,b \in \mathbb{R}^+$ and let $g \sim \text{IWP}_p(\sigma)$ with $p \in \mathbb{Z}^+$. Assume the knots $\{s_1, ..., s_k\}$ are equally spaced over $\Omega$ for each $k \in \mathbb{N}$, and $\tilde{g}_k$ denotes the corresponding $p$th order (O-spline) approximation defined as in \cref{equ:FEM-approxi}, then: $$||\C - \C_{k}||_{\infty} = O(1/k),$$ where $\C(s,t) = \Cov[g(s),g(t)]$, $\C_{k}(s,t) = \Cov[\tilde{g}_k(s),\tilde{g}_k(t)]$ and $||\C - \C_{k}||_{\infty} \equiv \sup_{s,t \in \Omega}|\C(s,t) - \C_{k}(s,t)|$. \end{lemma} Secondly, the \emph{simulateous derivative property} of the O-spline approximation implies the knots sequence and the weight coefficients used for the function will be the same as those for the derivatives and the only additional step is to recompute the design matrix at a lower order. This property makes our proposed O-spline approximation appropriate and convenient for the joint inference of the function with its derivatives, and the following \cref{thrm:convergence-joint} can be proved from this property and \cref{lem:convergence}: \begin{theorem}[Main Theorem]\label{thrm:convergence-joint} Given the same setting and notations as in \cref{lem:convergence}, for any non-negative integers $q_1 \leq p-1$ and $q_2 \leq p-1$: $$||\C^{(q_1,q_2)} - \C^{(q_1,q_2)}_{k}||_{\infty} = O(1/k),$$ where $\C^{(q_1,q_2)}(s,t) = \Cov[g^{(q_1)}(s), g^{(q_2)}(t)]$ and $\C^{(q_1,q_2)}_{k}(s,t) = \Cov[\tilde{g}^{(q_1)}_k(s), \tilde{g}^{(q_2)}_k(t)]$. \end{theorem} This theorem gives general convergence results for the proposed O-spline approximation, implying that every cross-covariance and hence the cross-correlation between the approximation and its derivatives will converge to the true value. In particular, that implies any finite-dimensional distributions (f.d.d) of $\tilde{g}_k$ and its derivatives will converge to the true f.d.d under the $\text{IWP}_p(\sigma)$ model: \begin{corollary}[Convergence of Finite Dimensional Distribution]\label{cor:fdd} Consider the same setting and notations as in \cref{lem:convergence}, let $p,m \in \mathbb{Z}^+$, then: $$[\tilde{g}^{(q_1)}_k(x_1), \tilde{g}^{(q_2)}_k(x_2), ..., \tilde{g}^{(q_m)}_k(x_m)]^T \overset{d}{\rightarrow} [g^{(q_1)}(x_1), g^{(q_2)}(x_2), ..., g^{(q_m)}(x_m)]^T,$$ as $k \rightarrow \infty$, where $\{x_i \in \Omega:i \in [m]\}$ and $\{q_i \in \mathbb{Z}^+: i \in [m], q_i < p\}$ are arbitrary. \end{corollary} \begin{proof} Using \cref{thrm:convergence-joint} and Cramer-Wold device, \cref{cor:fdd} directly follows from Levy's continuity theorem. \end{proof} \noindent Note this result can not be achieved for the RW2 approximation method because its sample path is not $p-1$ times continuously differentiable. \subsection{Prior and interpretation of $\sigma$}\label{sec:intepret_var} A key consideration in our context is the choice of an appropriate prior for the parameter $\sigma$. This is made complex given the interpretability of $\sigma$ depends on the order $p$. For example, IWP models with the same value of $\sigma$, but different orders, can have sample paths with extremely different variability making the choice of prior problematic for practitioners. To address this we adopt a strategy similar to \cite{scalingigmrf} and assign a prior to a quantity that still involves $\sigma$ but has a consistent interpretation across different values of $p$. Aiming for interpretability we consider the standard deviation of the function $g$ at a future location $x+h$ given the value of $g$ and its derivatives at location $x$, denoted as: \begin{equation}\label{equ:condition_var} \begin{aligned} \sigma(h) = \text{Var}\bigg[g(x+h) \bigg| g(x), g^{(1)}(x), ... , g^{(p-1)}(x)\bigg]^{1/2} = \frac{\sqrt{h^{(2p-1)}} \sigma}{\sqrt{(2p-1)}(p-1)!}. \end{aligned} \end{equation} We refer this quantity $\sigma(h)$ as the $h$-units predictive SD (PSD), which quantifies the uncertainty in predicting the function $g$ at $h$ units ahead, using its information up to the current location. The choice of the unit $h$ can be made based on its practical relevance. This differs from the approach of \cite{scalingigmrf}, which uses the marginal standard deviation, but benefits from $\sigma(h)$ being invariant to the location $x$ while the marginal standard deviation is not. At the same time, \cite{scalingigmrf} applies their prior elicitation method on the finite-dimensional approximation of the $\text{IWP}_p(\sigma)$ process, whereas our approach is entirely based on the original $\text{IWP}_p(\sigma)$ process, hence invariant to the approximation choices such as the number and placement of the knots. Finally, motivated by \cite{pcprior}, we consider an exponential prior for $\sigma(h)$ of the form $\text{P}(\sigma(h) > u) = \alpha$, where $\{u,\alpha\}$ will be chosen by the user. The prior for $\sigma$ is then recovered by scaling the exponential prior for $\sigma(h)$ with $(p-1)!\sqrt{(2p-1)/h^{(2p-1)}}$. \subsection{Approximate Bayesian Inference}\label{sec:comp} For the remainder of this paper we embed the above developments in the ELGM context of \cite{noeps}. Using the adaptive Gaussian Hermite quadrature (\texttt{aghq}) algorithm introduced there, we outline how the proposed O-spline approximation in \cref{equ:FEM-approxi} may be implemented within an ELGM in \cref{equ:smoothModel}. Following the details of \cite{noeps} we let $\regparam = (\boldsymbol{w}, \boldsymbol{\gamma},\boldsymbol{\beta}),~ \varparam = (\sigma, \kappa)$ and have $\regparam\sim\text{N}\left[\boldsymbol{0},\Sigma(\varparam)\right]$ where $\Sigma(\varparam) = \text{diag}(\sigma^2\Sigma_{\boldsymbol{w}}, \Sigma_{\boldsymbol{\gamma}}, \Sigma_{\boldsymbol{\beta}})$ with $\Sigma_{\boldsymbol{\beta}}$ and $\Sigma_{\boldsymbol{\gamma}}$ being diagonal matrices. The goal is to make fully Bayesian inferences for $\regparam,\varparam$ based on the posterior distributions $\pi(\regparam|\response)$ and $\pi(\varparam|\response)$. Since both posterior distributions are intractable, we compute their corresponding approximations $\laplaceapprox(\varparam|\response)$ and $\widetilde{\pi}(\regparam|\response)$ using the methods of \cite{noeps}. First we compute the following Gaussian and Laplace approximations: \begin{equation}\label{equ:Gaussian_Laplace} \begin{aligned} \gaussapprox(\regparam|\varparam,\response) = N(\wmode{\varparam}, \whess{\varparam}^{-1}), \ \laplaceapprox(\varparam,\response) = \frac{\pi(\wmode{\varparam},\varparam,\response)}{\gaussapprox(\wmode{\varparam}|\varparam,\response)}, \end{aligned} \end{equation} where $\wmode{\varparam} = \argmax\log\pi(\regparam,\varparam,\response)$ is the mode and $\whess{\varparam}$ is the negative Hessian evaluated at the mode. Explicitly, we write $\boldsymbol{\eta}$ as $\boldsymbol{\eta} = \boldsymbol{\Phi} \boldsymbol{w} + \boldsymbol{P} \boldsymbol{\gamma} + \boldsymbol{V} \boldsymbol{\beta}$, where $\boldsymbol{V}, \boldsymbol{P}$ and $\boldsymbol{\Phi}$ are the appropriate design matrices, and compute $\whess{\varparam}$ as: \begin{equation} \begin{aligned} \whess{\varparam} &= \begin{pmatrix} \sigma^2\Sigma_{\boldsymbol{w}} & 0 & 0 \\ 0 & \Sigma_{\boldsymbol{\gamma}} & 0 \\ 0 & 0 & \Sigma_{\boldsymbol{\beta}} \end{pmatrix} + \begin{pmatrix} \boldsymbol{\Phi}^T \\ \boldsymbol{P}^T \\ \boldsymbol{V}^T \end{pmatrix} ~{\partial_{\boldsymbol{\eta}}^2\ \log \pi(\response|\hat{\boldsymbol{\eta}}(\varparam), \kappa)} ~\begin{pmatrix}\boldsymbol{\Phi}\ \boldsymbol{P}\ \boldsymbol{V} \end{pmatrix} \end{aligned} \end{equation} We then utilize the \texttt{aghq} package in the \texttt{R} language \citep{aghqsoftware,aghqus} to compute the normalized Laplace approximation $\laplaceapprox(\varparam|\response)$ and hence $\widetilde{\pi}(\regparam|\response)$. With a sample $\{\regparam_m\}_{m=1}^{M}$ from $\widetilde{\pi}(\regparam|\response)$ available, a sample $\{\widetilde{g}_{m}(t)\}_{m=1}^{M}$ or its derivatives can be obtained, for any $t\in \Omega$. \section{Simulation Study}\label{sec:simulations} \subsection{Assessment of approximation accuracy}\label{sec:sim1} In this section, we will assess the quality of the O-spline approximation to the IWP model. To compare the results across different choices of $p$, we will compute the correlation functions instead of the covariance functions, respectively using the true IWPs and their O-spline approximations. Without the loss of generality, we assume $\gamma_i = 0$ for each $0 \leq i < p$ and $\sigma = 1$ in \cref{eqn:expansion}. For order $p = 1,2,3$ and $4$, we compute the auto-correlation function $\rho(5,x) = \text{Cor}[W_p(5),W_p(x)]$ of the true IWP. We then obtain the corresponding approximations using O-spline with respectively $k = 5, 10, 30$ or $100$ knots placed equally over the interval $[0,15]$. As shown in Figure \ref{fig:converg}(a-d), the approximations using O-spline are always accurate for all $p$ when $k \geq 30$. As $p$ increases, the improved approximation quality with higher $k$ becomes more obvious at larger values of $x$. To assess the quality of approximation in the sense of joint distributions, we then compare the cross-correlation function between the IWP with its $q$th derivative, denoted as $\rho^{(0,q)}(5,x) = \text{Cor}[W_p(5), W^{(q)}_p(x)]$. We consider $p = 2,3,4$ and $q = 1$ or $2$. Their O-spline approximations are obtained using the same setting as above. The results are summarized in Figure \ref{fig:converg}(e-h). Similar to the previous result on the auto-correlation, the cross-correlations are always accurately approximated by the O-spline approximation for all $p$ when $k \geq 30$. The two results above together suggest that our proposed O-spline approximations are practically accurate at different orders of $p$ even with small $k$, both in terms of the distributions within the IWP as well as the joint distribution with its derivatives. \begin{figure}[!p] \centering \subfigure[IWP $p=1$]{ \includegraphics[width=0.23\textwidth]{figures/vari_p1.pdf} }\vspace{-0.5\baselineskip}% \subfigure[IWP $p=2$]{ \includegraphics[width=0.23\textwidth]{figures/vari_p2.pdf} }% \subfigure[IWP $p=3$]{ \includegraphics[width=0.23\textwidth]{figures/vari_p3.pdf} }% \subfigure[IWP $p=4$]{ \includegraphics[width=0.23\textwidth]{figures/vari_p4.pdf} } \subfigure[IWP $p=2$]{ \includegraphics[width=0.23\textwidth]{figures/cross_p2.pdf} }% \subfigure[IWP $p=3$]{ \includegraphics[width=0.23\textwidth]{figures/cross_p3.pdf} }% \subfigure[IWP $p=4$]{ \includegraphics[width=0.23\textwidth]{figures/cross_p4.pdf} }% \subfigure[IWP $p=4$]{ \includegraphics[width=0.23\textwidth]{figures/cross_p4_2driv.pdf} } \caption{Auto-correlation $\rho$ (a-d) and cross-correlation $\rho^{(0,q)}$ (e-h) functions of the IWP with its O spline approximation at $p = 1,2,3$ and $4$ for Section \ref{sec:sim1}. The plots (e-g) compute the correlation between the IWP with its first derivative, and the last plot in (h) computes the correlation between IWP with its second derivative. The auto-correlation and cross-correlation are accurately approximated when $k \geq 30$.} \label{fig:converg} \end{figure} \subsection{Computational Comparison with exact IWP}\label{sec:compareOSIWP} In this section, we will illustrate the computational feasibility of the proposed O-spline approximation by comparing its implementation with that of the exact IWP model using the approach of augmented space as described in \cite{gmrfbook} and \cite{robinson2010continuous}. To ensure the comparability of the results, both approaches will be fitted using the approximation Bayesian inference method as described in \cref{sec:comp}. As a proof of concept, we assume $\boldsymbol{x} = \{x_i\}_{i=1}^n$ were equally placed over $\Omega = [0,20]$, and $p=3$. The $n$ observations were simulated from the following simple univariate regression model: \begin{equation}\label{equ:sim42mod} \begin{aligned} y_i &= g(x_i) + \epsilon_i; \quad x_i \in \Omega; \\ \epsilon_i &\sim N(0,1) ;\quad g(x) = \sqrt{3}\sin(x/2). \end{aligned} \end{equation} For the inference of $g$, we consider both the exact $\text{IWP}_3(\sigma)$ and its O-spline approximation. The five-unit PSD $\sigma(5)$ was given Exponential prior with $\text{P}(\sigma(5)>3) = 0.01$. The number of knots $k$ used in the O-spline approximations are respectively $10,30,50$ and $100$, equally placed over $\Omega$. All computations in \cref{sec:comp} were done single-threaded with the number of adaptive quadrature being $10$ and the number of posterior samples being $3,000$. To compare the numerical stability of each method, we compute the condition number of $\whess{\varparam}$ in \cref{sec:comp} defined as \begin{equation}\label{equ:maxCN} \begin{aligned} \kappa[\whess{\varparam}] = \frac{\lambda_{\text{max}}[\whess{\varparam}]}{\lambda_{\text{min}}[\whess{\varparam}]}, \end{aligned} \end{equation} where $\lambda_{\text{max}}$ and $\lambda_{\text{min}}$ denote the largest and smallest singular value respectively. We then compute the maximum condition number $\kappa_{max}$ of each method defined as \begin{equation}\label{equ:maxCN} \begin{aligned} \kappa_{\text{max}} = \text{max} \{\kappa[\whess{\varparam_j}]: j \in [10]\}, \end{aligned} \end{equation} where $\{\varparam_j : j \in [10]\}$ denotes the set of 10 quadrature points. Table \ref{table:Simtable} displays the maximum condition number of each method for different $n$. Note that when $n \geq 800$, the implementation exact IWP method fails due to serious numerical singularity problems. However, the proposed O-spline approximations has no numerical problems. We also compared the average runtime for each method. For each choice of $n$, each model will be fitted independently for $10$ times, and the relative runtime is compared with the average runtime of the O-spline approximation with $k=10$ knots and $50$ observations. Table \ref{table:Simtable} shows the mean and standard deviation of the 10 relative runtimes for each model. The proposed O-spline approximation works much faster than the implementation using the exact IWP method, even when a large of number of knots ($k \geq n$) is used in the approximation. Finally, to illustrate the approximation quality using the proposed O-spline approach, we compared the inferential results obtained from O-spline approximations and the exact IWP method when $n=100$, for both the function and its first two derivatives. As shown in the Figure \ref{fig:simCompareIWPOS}, the inferential results between the exact IWP method and its O-spline approximation are very similar in posterior mean for both the function $g$ and its derivatives, even with only $k = 10$. The posterior standard deviations for the higher order derivative have some degree of inconsistency when $k$ is small, but it gets much smaller as $k$ increases to around $30$. In summary, the proposed method is found to yield indistinguishable inferential results compared to the exact IWP method, but with a significantly shorter runtime and better numerical stability when the number of locations of interest is large. \begin{table} \begin{center} \scalebox{0.58}{ \begin{tabular} {|p{1cm}|p{2.5cm}|p{1.90cm}|p{2.5cm}|p{1.90cm}|p{2.5cm}|p{1.90cm}|p{2.5cm}|p{1.90cm}|p{2.5cm}|p{1.90cm}|} \hline \cline{1-11} \multicolumn{1}{c}{} & \multicolumn{2}{c}{Exact} & \multicolumn{2}{c}{$\text{OS}_{k=10}$} & \multicolumn{2}{c}{$\text{OS}_{k=30}$} & \multicolumn{2}{c}{$\text{OS}_{k=50}$} & \multicolumn{2}{c}{$\text{OS}_{k=100}$} \\ \hline $n$ & {Rel Runtime} & {CN $(\log_{10})$} & {Rel Runtime} & {CN $(\log_{10})$} & {Rel Runtime} & {CN $(\log_{10})$} & {Rel Runtime} & {CN $(\log_{10})$} & {Rel Runtime} & {CN $(\log_{10})$}\\ \hline 50 & 3.29(0.06) & 12.52 & 1.00(0.05) & 6.35 & 1.10(0.06) & 6.10 & 1.31(0.33) & 6.03 & 1.65(0.30) & 5.98 \\ 100 & 5.47(0.33) & 14.13 & 1.11(0.03) & 6.47 & 1.23(0.01) & 6.20 & 1.37(0.05) & 6.12 & 1.86(0.04) & 6.10 \\ 200 & 10.40(0.62) & 16.05 & 1.83(0.38) & 6.98 & 1.83(0.05) & 6.76 & 2.02(0.03) & 6.96 & 2.82(0.06) & 7.23 \\ 500 & 41.44(1.21) & 17.34 & 5.80(0.34) & 7.19 & 6.08(0.21) & 7.08 & 6.69(0.35) & 7.30 & 8.02(0.24) & 7.56 \\ 800 & --(--) & -- & 14.53(0.17) & 7.29 & 15.07(0.28) & 7.24 & 15.76(0.08) & 7.46 & 18.15(0.24) & 7.73 \\ 2000 & --(--) & -- & 111.25(1.68) & 7.49 & 112.00(1.16) & 7.68 & 113.47(0.90) & 7.86 & 120.68(1.38) & 8.20 \\ 5000 & --(--) & -- & 1000.72(25.03) & 7.81 & 996.54(8.13) & 7.90 & 999.43(5.04) & 8.09 & 1010.83(6.77) & 8.43 \\ \hline \end{tabular} } \end{center} \caption{The left column (Rel Runtime) shows the mean (std.dev) of relative runtimes for 10 runs of the exact IWP model and of each of the O-spline approximation, as described in \cref{sec:compareOSIWP}. The relative runtimes are computed by the dividing the average runtimes of O-spline with $k=10, n = 50$. The right column (CN) shows the $\kappa_{\text{max}}$ at $\log_{10}$ scale. For $n\geq 800$, the exact method fails due to numerical problem, whereas the O-spline method is unaffected. The O-spline method has both faster runtime and better numerical stability regardless of $k$, and the difference gets bigger as $n$ increases. } \label{table:Simtable} \end{table} \begin{figure}[!p] \centering \subfigure[$\text{SD}\lbrack g(x)|y \rbrack$]{ \includegraphics[width=0.3\textwidth]{figures/compare_pos_sd_p3.pdf} } \subfigure[$\text{SD}\lbrack g'(x)|y \rbrack$]{ \includegraphics[width=0.3\textwidth]{figures/compare_pos_sd_p3_deriv.pdf} } \subfigure[$\text{SD} \lbrack g''(x)|y \rbrack$]{ \includegraphics[width=0.3\textwidth]{figures/compare_pos_sd_p3_2deriv.pdf} } \subfigure[$\E \lbrack g(x)|y \rbrack $]{ \includegraphics[width=0.3\textwidth]{figures/compare_pos_mean_p3.pdf} } \subfigure[$\E \lbrack g'(x)|y \rbrack $]{ \includegraphics[width=0.3\textwidth]{figures/compare_pos_mean_p3_deriv.pdf} } \subfigure[$\E \lbrack g''(x)|y \rbrack $]{ \includegraphics[width=0.3\textwidth]{figures/compare_pos_mean_p3_2deriv.pdf} } \caption{Comparing the posterior mean and standard deviation from the exact IWP method and its O-spline approximations, as described in \cref{sec:compareOSIWP} when $n = 100$, for both the function and its derivatives. The O-spline approximation is very accurate for both the posterior mean and the standard deviation when $k \geq 30$.} \label{fig:simCompareIWPOS} \end{figure} \subsection{Assessment of inferential accuracy}\label{sec:sim2} In this section, we illustrate that the higher-order O-spline method can provide inferential results that are significantly improved compared with the existing methods based on second-order smoothness, especially for derivatives. We consider the true function $g(x) = \sum_{i=1}^{3} \delta_i \phi(x-\mu_i)$ simulated with the form of mixture Gaussian density, where $\phi$ denotes the standard Gaussian density. The mixture weights $\{\delta_1, \delta_2, \delta_3 \}$ are set to $\{0.6, 0.3, 0.1\}$ and the mean values $\{\mu_i; i \in [3] \}$ are independently simulated from $N(5, 4)$ in each replication. The observation locations $\boldsymbol{x} = \{x_1, ..., x_n\}$ are equally located over $[0,10]$ with $n = 100$. The simulated true function will then be standardized so that the sample variance of $g(\boldsymbol{x})$ equals to one in each replication. Each observation is simulated as $y_i = g(x_i) + e_i$, where $e_i \overset{iid}{\sim} N(0, 1/100)$, making a signal-to-noise ratio of 100. For comparison, we fit the continuous RW2 method by \cite{rw208} which is derived as an approximation to IWP$_2(\sigma)$, and the proposed O-spline approximation to IWP$_3(\sigma)$. All the methods are fitted with 100 equally placed knots, and implemented using the approximate Bayesian inference method in \cref{sec:comp}. We adopt the approach in \cref{sec:intepret_var} with an Exponential prior on the one-unit PSD $\sigma(1)$ such that $\text{P}(\sigma(1) > 1) = 0.5$, which is then scaled to the corresponding Exponential prior for $\sigma$ for $p=3$ in the O-spline implementation and for $p=2$ in the RW2 implementation. The rMSE between the posterior mean functions and the true function is computed as $\text{rMSE}(g) = \sqrt{{\sum_{i=1}^n \{\mathbb{E}[g(x_i)|\boldsymbol{y}] - g(x_i)\}^2}/{n}}$, and similarly for the first and second-order derivatives. To compare the inferential accuracy between different methods, we then scale the rMSE of each method by the median rMSE of the O-spline method. We repeat the above procedure for $300$ independent replications. The results are summarised in Figure \ref{fig:sim_GMM_agg}. It shows that for such smooth true functions with a few peaks and valleys in their derivatives, the O-spline method with third-order smoothness indeed performs better than the existing method based on IWP-$2$. The difference is most obvious for the inference of the second derivative $g''(\boldsymbol{x})$ where the second-order method yields overly wiggly estimate. The main reason behind this is that the proposed O-spline method with third-order smoothness assumes the sample path from the target process to be twice continuously differentiable, whereas the second-order method RW2 assumes the sample path from the target process to be only once continuously differentiable. \begin{figure}[!p] \centering \subfigure[rMSE ratio for $g$]{ \includegraphics[width=0.31\textwidth]{figures/high_agg_g_rt.pdf} } \subfigure[rMSE ratio for $g'$]{ \includegraphics[width=0.31\textwidth]{figures/high_agg_g1st_rt.pdf} } \subfigure[rMSE ratio for $g''$]{ \includegraphics[width=0.31\textwidth]{figures/high_agg_g2nd_rt.pdf} } \subfigure[Posterior mean for $g$]{ \includegraphics[width=0.31\textwidth]{figures/single_g_compare.pdf} } \subfigure[Posterior mean for $g'$]{ \includegraphics[width=0.31\textwidth]{figures/single_g1st_compare.pdf} } \subfigure[Posterior mean for $g''$]{ \includegraphics[width=0.31\textwidth]{figures/single_g2nd_compare.pdf} } \caption{Simulation in \cref{sec:sim2}. Figures (a)-(c) show the boxplots of rMSE scaled by the median rMSE of the O-spline method. Figures (d)-(f) show the posterior means for $g$ and its derivatives. The O-spline method is shown in red; The RW2 method is shown in blue. Although the inferential qualities for $g$ are similar, the O-spline method provides more accurate inference for the derivatives.} \label{fig:sim_GMM_agg} \end{figure} \section{Example}\label{sec:examples} In this section, we use the O-spline method to analyze the COVID-19 daily death rates in Canada, Denmark, South Africa and South Korea from 2020-01-23 to 2022-04-26. In this example, the model-based inference for derivatives of death rates has practical meanings to answer questions such as when was COVID death rate growing at its fastest rate, or whether COVID death rate is slowing down or speeding up. The data is obtained from COVID-19 Data Repository by the Center for Systems Science and Engineering (CSSE) at Johns Hopkins University \citep{dong2020interactive}. The raw data for each country is displayed in the online supplement. Let $y_t$ denote the daily new deaths at time $t$, where $t$ denotes the time in days from 2020-03-01 up to 2022-04-26. We consider a Poisson regression model: \begin{equation}\label{covid_mod} \begin{aligned} y_i &\sim \text{Poisson}(\exp(\eta_i)),\\ \eta_{i} &= \boldsymbol{v}_i^T \boldsymbol{\beta} + g(x_i) + \epsilon_{i}, \\ g(x) &\sim \text{IWP}_3(\sigma), \quad \epsilon_i \overset{iid}{\sim} N(0,\phi^2). \end{aligned} \end{equation} The model contains linear fixed effect $\boldsymbol{v}_i = (v_{i1}, ..., v_{i6})^T $ for the variable weekdays, a smoothing effect over the time variable $x$ through the unknown smooth function $g(x)$, and an observation-level random effect $\epsilon_i$ to accommodate the potential over-dispersion. The weekdays variable $\boldsymbol{v}_i$ is coded such that $g(0)$ is interpreted as the average weekday effect. Therefore, $\boldsymbol{\beta}$ represents the additional weekday effects of Monday to Saturday relative to the average effect, and the additional weekday effect on Sunday is computed as $-\sum_{i=1}^6 \beta_i$. Each of the linear fixed effects $\beta_i$ is given independent $N(0,100)$ prior. The over-dispersion parameter $\phi$ is modelled with an Exponential prior with a median $0.1$. The unknown function $g(x)$ is modelled with an IWP$_3(\sigma)$ prior in \cref{eqn:expansion}, with $\gamma_l \overset{iid}{\sim} N(0,1/100)$ for $0\leq l < 3$. We then approximate the IWP prior using our proposed O-spline method with $k = 100$ to balance the computational efficiency and the approximation accuracy. For the parameter $\sigma$, we assign an Exponential prior on $\sigma(h)$ with median $\log(2)$, where $h$ is taken to be 7 days. This prior can be interpreted as with a roughly 50 percent chance that the death rate could be scaled by $4$ or $1/4$ in a week. The inferential results for the function $\exp [g(x)]$ which denotes the evolution of COVID death rate in each country after adjusting for the weekday effect and population size are shown in Figure \ref{fig:covidDeath}. Model-based inference is also done for the derivative of the COVID death rate $g'(x)\exp [g(x)]$ with adjusted results shown in Figure \ref{fig:covidDeriv}. It can be observed from Figure \ref{fig:covidDeriv} that COVID death rate was growing fastest in South Korea during the waves around March 2022, whereas in Canada the fastest time was between March 2020 and July 2020. For South Africa, the method suggests that the COVID death increased at fastest speed around the end of 2020. In Denmark, the three waves had similar speeds at their peaks. The posteriors of weekday effects in each country as well as the posteriors of the overdispersion and the PSD can be found in Figure \ref{fig:covidOther}. The inferential results for the log relative risk $g(x)$ and its derivative $g'(x)$ are also provided in the online supplement. \begin{figure}[!p] \centering \subfigure[Canada]{ \includegraphics[width=0.41\textwidth]{figures/canada_covid_death_adjusted.pdf} } \subfigure[Denmark]{ \includegraphics[width=0.41\textwidth]{figures/DK_covid_death_adjusted.pdf} } \subfigure[South Africa]{ \includegraphics[width=0.41\textwidth]{figures/SA_covid_death_adjusted.pdf} } \subfigure[South Korea]{ \includegraphics[width=0.41\textwidth]{figures/SK_covid_death_adjusted.pdf} } \caption{Results for the COVID data analysis in \cref{sec:examples}. In figures (a)-(d), the blue line is the posterior mean of $\exp[g(x)]$ the O-spline (OS) method; and the orange range is the 95 \% pointwise posterior credible interval of the OS method. The death counts were adjusted based on the population size (per million) of each country at 2020. } \label{fig:covidDeath} \end{figure} \begin{figure}[!p] \centering \subfigure[Canada]{ \includegraphics[width=0.41\textwidth]{figures/canada_covid_death_deriv_adjusted.pdf} } \subfigure[Denmark]{ \includegraphics[width=0.41\textwidth]{figures/DK_covid_death_deriv_adjusted.pdf} } \subfigure[South Africa]{ \includegraphics[width=0.41\textwidth]{figures/SA_covid_death_deriv_adjusted.pdf} } \subfigure[South Korea]{ \includegraphics[width=0.41\textwidth]{figures/SK_covid_death_deriv_adjusted.pdf} } \caption{Results for the COVID data analysis in \cref{sec:examples}. In figures (a)-(d) the posterior mean of the derivative $g'(x) \exp [g(x)]$ using the OS method is shown in blue; the orange range is the 95 \% pointwise posterior credible interval of the OS method. The results were adjusted based on the population size (per million) of each country at 2020.} \label{fig:covidDeriv} \end{figure} \begin{figure}[!p] \centering \subfigure[Weekday Effect]{ \includegraphics[width=0.41\textwidth]{figures/all_covid_death_weekdays.pdf} } \subfigure[7-days PSD]{ \includegraphics[width=0.41\textwidth]{figures/pred_smooth_para_covid.pdf} } \subfigure[Overdispersion $\phi$]{ \includegraphics[width=0.41\textwidth]{figures/overdis_para_covid.pdf} } \caption{Results for the COVID data analysis in \cref{sec:examples}. Figure (a) shows the inference of weekday effects in each country. The solid dots denote the posterior mean of each $\beta_i$, the weekday effect relative to the average effect. The lines denote the 95 \% credible interval. Figure (b) shows the posterior density of the 7-days PSD $\sigma(7)$ in each country, and (c) shows the posterior density of the overdispersion parameter $\phi$ in each country. For both figures, the orange shaded area represents the prior distribution.} \label{fig:covidOther} \end{figure} \section{Discussion}\label{sec:discussion} In this paper, we considered model-based smoothing method with Integrated Wiener's process (IWP), and provided a novel finite dimensional O-spline approximation that works for any order of IWP. The proposed approximation is able to give consistent inference for all the derivatives of the function, and we prove its convergence to the true IWP both theoretically and practically with the simulation study. To select and interpret prior for the parameter $\sigma$, we introduced a prior elicitation approach based on the notion of $h$-units PSD $\sigma(h)$, which unlike the existing approach based on the marginal SD of the approximation \citep{scalingigmrf}, is defined based on the exact process and hence invariant to the choice of knots. The utility of the method has been illustrated both by the simulation and the data analysis example with COVID death rates in four different countries. The order of the IWP$_p(\sigma)$ model implicitly states a priori knowledge one has on the function's smoothness, measured by the number of times the unknown function can be continuously differentiated. If the choice of the order $p$ is not clear by the priori knowledge, one can consider selecting it using methods such as the Bayes factor since marginal likelihood is well-defined within the proposed approximation. Although the proposed method is already flexible in terms of the supported IWP order and the inference for the derivative, it can be further improved and generalized to allow adaptive smoothing with a varying smoothing parameter $\sigma$, see \cite{adaptivesmoothingsplines} for an example. For the simplicity of our presentation, we assumed by default that the IWP starts at the leftmost point of the region of interest. However, the same procedure can still be applied to other starting values using two independent IWP moving toward different directions. This could further simplify the computation in certain scenarios by introducing a more sparse design matrix. Another potential direction for improvement is for multivariate smoothing such as the spatial setting studied in \cite{spde}, where the generalization of the proposed O-spline basis from univariate space will not be trivial. We leave these to the future work.
\section{Introduction}\label{} The ability to generate visualisations based on natural language (NL) text has long been a desirable goal in the field of data visualisation. Research into Natural Language Interfaces (NLIs) for visualisation has emerged as the primary field that has recently spearheaded the advancements in this area \cite{narechania2020nl4dv,shen2021towards}. These interfaces allow users to generate visualisations in response to NL queries or prompts that are free from programming and technical constructs, thus providing a flexible and intuitive way to interact with data. The ultimate aim is to devise systems enabling users to express queries like \textit{"Show me the sales trend?"} which are correctly understood and depicted by automatically discerning the correct chart type. The data visualisation paradigm can be difficult to learn for users \cite{wang2022towards} who must translate their analysis intentions into tool-specific operations which may take the form of point-and-click applications or code in various programming languages. Therefore, NLIs can improve the usability of visualisation tools \cite{luo2021natural} by making them more convenient and novice-friendly as well as effective, and ultimately, inclusive for a broader range of users. As such, approaches like NLIs have the potential to make data and insights more accessible to a wider audience and lower the barrier \cite{wang2022towards} by allowing users to express their queries and analysis intentions in a form that is most natural to them \cite{wang2021survey}. The process of translating NL inputs into visualisations (NL2VIS) involves several non-trivial tasks. Generally, the input query is first parsed and modelled, then the required data attributes are identified, and the low-level analytic tasks expressed within the query are discerned. These low-level tasks, such as filtering, correlation, and trend analysis, must then be translated into code to be executed. Finally, the input query is analysed and matched with the most appropriate visualisation, and then code is invoked to render the data. Each component in the pipeline is error-prone. The implementation of NL2VIS is a particularly challenging task due to the inherent characteristics of NL, such as ambiguity and the underspecification of requirements in the prompts, as well as unavoidable typographical errors. These characteristics of NL make it difficult to accurately interpret the user's intent and generate appropriate visualisations with the existing technologies and approaches \cite{song2022rgvisnet}. Despite these challenges, the popularity of NLIs for data visualisation has continued to grow, driven by the demand for data analytics and the increasing need for flexible and intuitive ways of interacting with data. The performance of NLIs for visualisations is largely dependent on Natural Language Processing (NLP) models \cite{wang2021survey} and their robustness in understanding NL. A recent comprehensive survey \cite{wang2021survey} of the use of NLIs for visualisations noted that while most existing approaches utilise hand-crafted grammar rules that require proficiency with typical NLP toolkits, more complex large language models (LLMs) like GPT-3 which are capable of achieving human-level performance on specific tasks \cite{Brown2020} have not yet been implemented or explored for visualisation generation directly from NL. LLMs have revolutionised the field of NL understanding and generation. These models are based on the transformer architecture \cite{vaswani2017attention}, which has demonstrated remarkable successes in tasks such as sentiment analysis, question-answering, and language generation owing both to the effectiveness of the architecture, but also due to them being trained on vast amounts of data. The data used to train these models typically comes from the internet and can include websites, books, and code repositories. As a result of being trained on such a large amount of data, LLMs have developed a comprehensive understanding of the structure and meaning of language, allowing them to perform tasks in a highly sophisticated manner, but also importantly to this study, the ability to generate code in response to NL requests. For these reasons, LLMs offer the potential to accurately understand free-form NL input and the capability to convert it into functional code that generates suitable visualisations which correctly pair with the underlying data types. \subsection*{Contribution} \label{sec:contribution} This work is the first of its kind to propose an end-to-end NL2VIS solution which converts free-form conversational language into visualisations via LLMs. The present work leverages the most recent advances in LLM technologies and AI in general, specifically investigating ChatGPT and GPT-3, which are considered state-of-the-art \cite{Brown2020}. The advantage of using pre-trained LLMs for this task is that they offer not only accuracy gains in robustly understanding user requests, even when malformed, but they also result in accelerated development turnarounds and a significant decrease in costs. Despite the capabilities of these models to display human-like performance on specific tasks, the integration of LLMs with NLIs for visualisation has not been explored in published literature. Therefore, this study seeks to examine the capability and comparative performances of two types of GPT-3 models and ChatGPT for NL2VIS tasks that also includes the automatic selection of chart types, through numerous experiments and examples. Our experiments demonstrate the potential of the LLMs to enhance the performance of NL2VIS in terms of accuracy, efficiency, and cost reduction, thus potentially minimising the need to devise new language models for this problem going forward. Our work also demonstrates how LLMs can be used in a manner that is data-privacy preserving and security-aware, making the approach generalisable to all types of datasets, irrespective of confidentiality concerns. In the process, we show how prompts for LLMs can be engineered to elicit desired outputs. Furthermore, the system developed in this study has also been made publicly available through an online application for testing and experimentation, with the ability for users to upload their datasets and generate visualisations\footnote{ Chat2VIS is currently hosted on Streamlit Cloud and can be accessed via https://chat2vis.streamlit.app/}. \begin{figure}[h!] \centering \includegraphics[scale=0.5] {intro.png} \caption {Timeline depicting the recent evolution of NL2VIS systems and the proposed Chat2VIS system.} \label{fig:timeline} \end{figure} \section{Related Work} In recent years, the idea of using NL as a way to create visualisations has gained significant attention within the field of data visualisation \cite{voigt2021challenges,luo2021natural}. The use of NLIs has also grown in popularity in commercial software as a means of improving the usability of visualisation systems. Various tools, such as IBM Watson Analytics, Microsoft Power BI, Tableau, ThoughtSpot, and Google Spreadsheet, have to varying degrees implemented NLIs that allow users to generate visualisations in response to NL queries or prompts \cite{narechania2020nl4dv,luo2021natural,wang2022towards,nvBench_SIGMOD21,tang2022sevi} indicating the level of demand for this innovation. These are early commercial iterations of this technology as these systems typically constrain NL interactions to data queries and standard chart types, and do not support more complex or open-ended visualisation tasks \cite{wang2022towards}. NL modelling techniques, which underpin NL2VIS, can broadly be categorised into traditional symbolic-based NLP approaches which rely on explicit rules and representation of the language structure and the emerging neural machine translation methods which rely on language models developed typically through deep learning \cite{nvBench_SIGMOD21}. Fig. \ref{fig:overview} depicts the evolution of NL2VIS systems recently, and their trend towards more sophisticated machine learning approaches, where we posit that the logical trajectory is pointing in the direction of using the most advanced AI systems like LLMs for language understanding and code generation. \begin{figure}[h!] \centering \includegraphics[scale=0.9] {overview.png} \caption {The Chat2VIS architecture converting free-form query text into visualisations using the large language models GPT-3, Codex, and ChatGPT.} \label{fig:overview} \end{figure} \subsubsection*{Symbolic NLP approaches} Symbolic approaches to NLP can involve heuristic, rule-based and probabilistic grammar-based approaches for parsing and understanding NL. Heuristic algorithms use pre-defined rules or heuristics to find approximate solutions for complex problems like NL and tend to be less accurate than other methods \cite{liu2020extracting}. Meanwhile, rule-based approaches rely on predefined rules created by experts for understanding NL. They are more accurate and reliable but, also less flexible in handling complex queries \cite{voigt2021challenges}. Probabilistic grammar-based approaches use formal grammar rules and probability distributions over the possible parses of a given input. These approaches are considered more accurate as well as flexible than the previous approaches but require more computational resources. Each of these approaches presents complexities and can be time-consuming and challenging to resolve especially for developers without prior experience \cite{narechania2020nl4dv}. The majority of the earlier systems have been developed using these approaches \cite{tang2022sevi}, including Articulate \cite{sun2010articulate}, DataTone \cite{gao2015datatone}, Eviza \cite{setlur2016eviza}, and Deep-Eye \cite{qin2018deepeye}, with each using distinct methodologies for mapping NL queries to visualisations. Certain systems also allow for user interaction to manage ambiguities. Meanwhile, recent state-of-the-art studies like NL4DV \cite{narechania2020nl4dv} and FlowSense \cite{yu2019flowsense} using symbolic NLP approaches have relied on semantic parsers such as NLTK \cite{loper2002nltk}, NER, and Stanford CoreNLP \cite{manning2014stanford}, to automatically add layers of valuable semantic information, such as parts-of-speech (PoS) tagging and named entity recognition to the NL input which improves accuracy. NL4DV \cite{narechania2020nl4dv}, an open-source Python toolkit, accepts a NL queries for a given dataset and outputs a JSON object with keys for dataset attributes, analytical tasks, and Vega-Lite visualisation specifications. This framework enables those who lack NLP expertise to harness NL2VIS concepts by creating NLIs or rendering the output in their own systems. \subsubsection*{Deep-learning model approaches} A more promising route has been highlighted by recent advancements in NL2VIS systems which have shifted the focus towards neural end-to-end models that leverage deep learning. These approaches combine the processes of language understanding, reasoning and chart generation in a single system and are closer to the proposed system in this work. These approaches aim to achieve greater robustness, flexibility and adaptability compared to traditional methods \cite{voigt2021challenges}. One notable system developed along these lines is ADVISor \cite{liu2021advisor}. ADVISor comprises multiple customised deep learning modules for determining the necessary visualisation data and appropriate attributes, as well as the filter and aggregation operations. These models are underpinned by the large language transformer-based BERT \cite{devlin2018bert} model which performed the vectorisation of user input and the data attribute names for subsequent steps. Meanwhile, the chart type is chosen based on a predefined rule-map. ncNet \cite{luo2021natural} is a novel approach which also uses transformer-based models and visualisation-aware optimisations. ncNet is a machine learning model that is trained using the nvBench \cite{luo2021nvbench} dataset, which maps natural language queries to visualisations. The system accepts the NL query and an optional chart template as an additional input to constrain the possible visualisations being outputted. The approach has been evaluated through quantitative evaluation and user study and has shown promising accuracy in the nvBench benchmark. Recently, this system has been extended to include speech-to-visualisation capabilities \cite{tang2022sevi}. Meanwhile, a system called RGVisNet \cite{song2022rgvisnet} was developed that decouples the NL2VIS process into two subtasks which consist of a hybrid retrieval and a generation framework. The first part of the system retrieves the most relevant visualisation query from a large-scale visualisation codebase which serves as a candidate prototype which is refined in the next step by a GNN-based deep-learning model. \subsection*{Summary of Literature and Research Aims} The trends in NL2VIS research highlight that focus is moving towards using transformer-based deep learning models and end-to-end solutions, and away from the complex task of engineering symbolic-based language models. Recent advancements, such as the use of pre-trained language models like BERT and domain-specific models like ncNet, have shown promising results in various benchmarks. However, there is a gap in the literature exploring the recent state-of-the-art pre-trained LLMs which are significantly larger and more sophisticated. This work aims to address this gap and examine the potential to simplify the NL2VIS pipeline, while making it more robust for free-form NL and complex visualisation tasks. Additionally, while advanced systems like ADVISor \cite{liu2021advisor} and ncNet \cite{luo2021natural} rely on various explicit mechanisms for determining which types of visualisations are to be rendered, the proposed system addresses this gap by investigating the ability to delegate the chart selection decision-making to the AI component. \subsubsection*{Research questions} In light of the existing literature, this study poses the following research questions: \begin{itemize} \item (RQ1) Do current LLMs support accurate end-to-end generation of visualisations from NL? \item (RQ2) How can LLMs be effectively leveraged in order to elicit the generation of correct and appropriately rendered charts? \item (RQ3) Which LLMs tend to perform more robustly to NL prompts? How do they perform against other state-of-the-art approaches? \item (RQ4) What are the limitations of using LLMs for NL2VIS and future research directions? \end{itemize} \section{Methodology} \label{sec:methodology} In this study, we explored the ability of three OpenAI LLMs to generate Python scripts for visualising data based on NL queries without explicit direction as to which types of graphs to generate. The models chosen for this investigation include the most advanced model family, Davinci, specifically the GPT-3 model \textit{"text-davinci-003"} and the Codex model \textit{"code-davinci-002"}, as well as the most recent addition, ChatGPT\footnote{OpenAI documentation refers to "text-davinci-003", "code-davinci-002" and ChatGPT models as belonging to the GPT-3.5 series https://platform.openai.com/docs/model-index-for-researchers }. The Davinci model family consists of billions of parameters\footnote{The reported number of parameters is 175B}, and is widely considered to be the most capable of all available models in its ability to follow instructions. This model family is based on GPT-3, with the Codex model receiving additional training data from a massive quantity of GitHub repository code. This makes the Codex model particularly well-suited for translating NL into code, being proficient in over a dozen programming languages, with Python being the target language in this study. Fig. \ref{fig:overview} depicts the overview of the developed Chat2VIS system. A user enters a NL query via a Streamlit NLI app which is an open-source Python framework for web-based dashboards. The query is combined with a prompt script which engineers a suitable prompt for a selected dataset. The prompt is forwarded to selected LLMs, which return a Python script that is subsequently rendered within the Streamlit NLI. \subsection{Natural Language Interface} The interface for the Chat2VIS software artefact used in this study is depicted in Fig. \ref{fig:interface}. The interface enables users to select a dataset and enter free-form text describing their data visualisation intent. The side toolbar provides the functionality to import additional CSV files and SQLite databases, with options to choose the desired LLMs\footnote{At the time of writing this manuscript, no official API for ChatGPT was available and the process of handling the request for this LLM using Chat2VIS was executed manually through the OpenAI ChatGPT interface. Use of ChatGPT within Chat2VIS hosted on Streamlit cloud is temporarily suspended until the immanent public release of the official OpenAI API.} to render the visualisations. An OpenAI Access Key is required to access the models and must be entered prior to querying. An input box is provided for entering the NL free-format text. Visualisations are presented for each selected model, with the actual dataset also shown to the users. \begin{figure} \centering \includegraphics[scale=0.9] {interface.png} \caption{The Streamlit Chat2VIS Natural Language Interface enabling dataset visualisations from free-form text queries.} \label{fig:interface} \end{figure} \subsection{Prompt Engineering} The most effective method for obtaining the desired output from the LLM is to use the "show-and-tell" technique\footnote{https://beta.openai.com/docs/guides/completion/prompt-design} by supplying within the prompt an example together with instructions. The proposed system generates a LLM prompt consisting of two parts: (1) a Description Prompt built from a Python docstring and declared using triple double quotes """ at the beginning and the end of the definition, (2) a Code Prompt comprising of Python code statements that provide guidance and a starting point for the script. The structure of the prompt is presented in Fig. \ref{fig:primer} and is described by way of an example dataset, using the \textit{products} table from the nvBench database\footnote{https://github.com/TsinghuaDatabaseGroup/nvBench/blob/main/nvBench\_VegaLite/VIS\_6.html} \textit{department\_store}, pre-loaded into dataframe \textit{df\_products}. For context, the example dataset lists the prices for a selection of clothing products such as coloured jeans and tops, together with hardware products like monitors and keyboards. There are four columns, \textit{product\_id}, \textit{product\_type\_code}, \textit{product\_name} and \textit{product\_price} which have data types \textit{int64}, \textit{object}, \textit{object} and \textit{float64} respectively. \begin{figure} \centering \includegraphics[scale=0.5] {primer.png} \caption{Description and Code Prompts built from combining the free-form text query with the selected dataset to be submitted to the LLMs.} \label{fig:primer} \end{figure} The Description Prompt and the Code Prompt shown in Fig. \ref{fig:primer} are depicted in components in order to aid their description. The bolded type highlights substitution values which are variable and dependent on the chosen dataset and is thus specific to our illustration. These provide an overview of the dataframe to the LLM, listing column names, their data types and categorical values, which assists the LLM in understanding the context, while maintaining data privacy by withholding the actual raw values. Each component of the proposed prompt is described as follows: \begin{enumerate} \item The Description Prompt is initiated with a Python docstring Fig. \ref{fig:primer}(a) \item In Fig. \ref{fig:primer}(b) we explicitly inform the LLM to use a dataframe (a tablular data object) with the name \textit{df} which enables us to refer to this dataframe by a specific name, thereby avoiding any confusion that might arise if the LLM were to assign a different name to the dataframe. Even though we opted to utilise a pre-loaded CSV file, there may be instances when the LLM (typically ChatGPT) includes code for loading the file. By anticipating the file name as data\_file.csv, we can easily identify and eliminate this code if required before execution. \item The Description Prompt in Fig. \ref{fig:primer}(c) consists of one entry for each column indicating its data type. If a column with an object data type has less than 20 distinct values, it is deemed as a categorical type, and its values are enumerated in the prompt. This listing could aid the LLM in identifying keywords for certain requests, for instance, prompts relating to keyboards or black jeans in our example. \item In Fig. \ref{fig:primer}(d) we ask the LLM to decide on appropriate naming for the x and y axes, and the plot title. In some cases, when working with grouped data, particularly box plots, the LLMs add a plot super-title unnecessarily. To address this, we recommend removing it by using positive instructions and explicitly setting it to empty. \item To encourage correct syntax, we include the Python version as shown in Fig. \ref{fig:primer}(e). \item The Description Prompt concludes with an instruction to create a plotting script with the supplied user query in Fig. \ref{fig:primer}(f). \item For this demonstration, the submitted NL query from nvBench is: \textit{What is the highest price of product, grouped by product type? Show a bar chart, and display by the names in desc.} \item The Python docstring in Fig. \ref{fig:primer}(g) closes off the Description Prompt \item The Code Prompt begins with import statements for the required Python packages we would like the LLMs to use in Fig. \ref{fig:primer}(h). \item To foster uniformity in the plot layout, we ask for a single subplot with a fixed figure size in Fig. \ref{fig:primer}(i) in an attempt to render equivalently sized plots on the interface. \item By assigning a copy of the named dataframe in Fig. \ref{fig:primer}(j) to the variable \textit{df} in the Code Prompt, ensures consistency within the script and enables the original dataframe to be retained for further querying. \end{enumerate} Once formulated, the two prompt elements are amalgamated, with the resulting string submitted to the LLMs via the text completion endpoint API with settings shown in Table. \ref{table:APIParameters}. \begin{table}[h!] \centering \caption{API Parameters.} \begin{tabular} {p{60pt}p{200pt}} \hline Parameter & Setting \\ \hline engine & text-davinci-003 or code-davinci-002 \\ prompt& <constructed NL prompt string>\\ temperature&0\\ max\_tokens&500\\ stop&plt.show() \\ \hline\end{tabular} \label{table:APIParameters} \end{table} Unspecified parameters remain at their default values. With many variations to Python scripting, we set the model temperature to 0 to help ensure the LLM is less creative and more consistent in its code generation. To encourage the model to avoid any unnecessarily long script responses, a token limit of 500 is enforced for responses. We believe this limit is sufficient for generating a Python script within the context of this study. A stopping point is specified to avoid returning multiple script examples and code alternatives. \subsection{Script Refinement and Rendering} On the return of the script from the API for each model, the Code Prompt is inserted at the start and the Python code may be edited to eliminate unnecessary instructions. It is rendered on the interface for each LLM. To further enhance the visualisations, users can refine their NL query, including requesting alternative chart types, plot colours, labels etc. \subsection{Chat2VIS Evaluation} The capabilities of the proposed Chat2VIS system to render visualisations based on NL input via LLMs, and their unique decision-making skills in autonomously selecting appropriate charting elements is demonstrated over six case studies, covering five datasets. Four of these case studies are reproduced from examples in existing literature, comparing our visualisations with those from prior studies using nvBench SQLite databases\footnote{https://sites.google.com/view/nvbench} and the NL4DV Python package\footnote{https://nl4dv.github.io/nl4dv/documentation.html}. One case study is taken from NL4DV \cite{narechania2020nl4dv}, one from ADVISor \cite{liu2021advisor} in which the authors also use NL4DV in their evaluation, and the final two using databases from nvBench \cite{luo2021nvbench}. In the remaining two case studies, we test the capabilities of the LLMs and the prompt scripts to handle misspecification in the form of typographical errors as well as acute underspecification, where the ability of the LLMs to exhibit reasoning and assumptions in the context of the priming text is explored. The results are inspected and evaluated visually for correctness and suitability. All case study examples are also reproducible from the online web app. The non-deterministic nature of the LLMs does occasionally lead to variability in plot generation even when an identical prompt is resubmitted. \section{Results} \label{sec:results} \subsection{Case Study 1: Department Store Dataset} The first example is based on the \textit{products} table illustrated above in the description of the prompt engineering which originated from the nvBench \textit{department\_store} database. The test query is as follows: \textit{"What is the highest price of product, grouped by product type? Show a bar chart, and display by the names in desc."}. The query is categorised by nvBench as an \textit{easy} visualisation for NLI systems. Fig. \ref{fig:eg_department_store} shows results generated by Chat2VIS alongside the correct nvBench visualisation. GPT-3 and Codex produce identical results, with ChatGPT rotating labels for ease of reading and arguably providing a slightly more comprehensive title. All 3 LLMs provide more informative \textit{x} and \textit{y} axis labelling and titles than the ground truth example from nvBench. \begin{figure}[h!] \centering \includegraphics[scale=0.9] {department_store.png} \caption{Case Study 1: Department Store Dataset} \label{fig:eg_department_store} \end{figure} \subsection{Case Study 2: Colleges Dataset} This dataset holds information on students and staff at U.S. public and private colleges. The \textit{colleges} dataset\footnote{https://github.com/nl4dv/nl4dv/blob/master/examples/assets/data/colleges.csv} was used by \cite{narechania2020nl4dv} to demonstrate the Vega-Lite editor for rendering queries visualised by NL4DV. The output from their toolset rendered via Streamlit is compared with Chat2VIS results. The broadness of the submitted query used in their study \textit{"Show debt and earnings for Public and Private colleges." } allows flexibility for different interpretations of the request. The figure (Fig. \ref{fig:colleges}) demonstrates that GPT-3 generated a scatter plot, similar to that produced by NL4DV, to represent the relationship between median debt and median earnings for all colleges by type. Codex interpreted the query by creating a bar chart to show the mean value of debt and earnings for each college type. ChatGPT focused on the distributions of debt and earnings by creating a box-and-whisker plot for public and private colleges. The models were able to differentiate between public and private colleges using the "Control" column, which was not easily recognisable as a college type. However by providing categorical values in the prompt, the models were able to accurately categorise the data based on the "public/private" indicator in the column. In addition, the models were required to perform further reasoning in order to arrive at the decision to extract data from the "Median Debt" and "Median Earnings" columns, having only been queried to show debt and earnings, thus illustrating the capability of AI inference potentials. \begin{figure}[h!] \centering \includegraphics[scale=0.9] {colleges.png} \caption{Case Study 2: Colleges Dataset} \label{fig:colleges} \end{figure} \subsection{Case Study 3: Energy Production Dataset} The next set of visualisations are depicted on the Energy Production dataset described in the ADVISor study and compared to those of both ADVISor and NL4DV outputs. The dataset details coal, oil, gas, and nuclear energy production in megawatt-hours per person per year from 2000 to 2011 for an unspecified country, including population statistics. We use here the test query from the ADVISor study, \textit{"What is the trend of oil production since 2004?"}. The results from Chat2VIS are shown in Fig. \ref{fig:oil} together with the output from NL4DV rendered via Streamlit. The results can be compared with the ADVISor plot presented in their study. All three LLMs select a line plot as the most suitable style of plot for this query, with GPT-3 and ChatGPT correctly showing data from 2004 onward. Codex, however, neglects to incorporate this detail into its code generation and has depicted data from 2000 onwards. NL4DV has produced an incorrect visualisation due to its semantic parsing limitations which lacks flexibility, as mentioned in \cite{liu2021advisor}. The ADVISor plot also selected the correct chart type, but like Codex, it was unable to filter the data to include 2004 onwards. It did, however, highlight the data points from 2004 onwards drawing attention to the oil trend and the selected data range. \begin{figure}[h!] \centering \includegraphics[scale=0.9] {oil.png} \caption{Case Study 3: Energy Production Dataset} \label{fig:oil} \end{figure} \subsection{Case Study 4: Customers and Products Contacts Dataset} The following example provides a demonstration of a more complex NL2VIS task from the \textit{products} table in the \textit{customers\_and\_products\_contacts} database\footnote{https://github.com/TsinghuaDatabaseGroup/nvBench/blob/main/ nvBench\_VegaLite/VIS\_299.html}, which the nvBench example benchmark classifies as \textit{Extra Hard}. The query is \textit{"Show the number of products with price higher than 1000 or lower than 500 for each product name in a bar chart, and could you rank y-axis in descending order?"}. Fig. \ref{fig:customers_products_contacts} shows all three models generate similar visualisations to the ground truth example specified in nvBench. ChatGPT provides a slightly more informative title, conveying that products with a price higher than 1000 are "expensive" and those lower than 500 are "cheap". Despite Sony and \& jcrew products swapped in comparison to nvBench, both have a value of 3 and are plotted accurately. The visualisation from Codex, while correct, is sub-optimal, requiring some further improvement in its coding structure to eliminate the multiple bar plotting. All three plots show more informative axis labels than their nvBench counterpart. The example demonstrates the high capability levels of Chat2VIS to handle challenging NL queries. \begin{figure}[h!] \centering \includegraphics[scale=0.9] {customers_and_products.png} \caption{Case Study 4: Customers and Products Contacts Dataset} \label{fig:customers_products_contacts} \end{figure} \subsection{Case Study 5: Misspecified Prompts} The following example illustrates the robustness of Chat2VIS to input errors that take the form of typographical mistakes. The movies\footnote{https://github.com/nl4dv/nl4dv/blob/master/examples/assets/data/movies-w-year.csv} dataset is used here and contains information on movies released between 1996 and 2010, including details such as financials, ratings, and classifications. The ideal query in this example is \textit{"Plot the number of movies by genre"} however, the system is prompted with \textit{"draw the numbr of movie by gener"}. The results are shown in Fig.\ref{fig:spelling}. The correct results across all three LLMs highlight the ability of the LLMs to interpret language even in the presence of multiple typographical errors and misspecification, thus emphasising their robustness. However, from the point of view of clarity of insights, the figure generated by ChatGPT is superior to those of the other models since it has decided to render the results as a rank-ordered bar graph in a descending order, while GPT-3 and Codex presented movies alphabetically. \begin{figure}[h!] \centering \includegraphics[scale=0.9] {spelling.png} \caption{Case Study 5: Misspelled Prompts} \label{fig:spelling} \end{figure} \subsection{Case Study 6: Underspecified and Ambiguous Prompts} The movies dataset is again used in this example in order to demonstrate the inference capabilities of the LLMs together with the underlying priming prompts developed for Chat2VIS, to creatively make decisions based on extremely underspecified or ambiguous queries. The test query used here is: \textit{"tomatoes"}, which has an association with an existing column in the dataset called \textit{Rotten Tomatoes Rating}. Fig. \ref{fig:Underspecified} demonstrates the results. Remarkably, the figures demonstrate that each LLM, was able to make inferences and produce a figure that connected the results with the \textit{Rotten Tomatoes Rating} despite a lack of direction. GPT-3 plots the rating against the IMDb Rating column. It is uncertain whether this column is selected due to it being a rating column or simply because it is the next column in the dataset. Codex plots the rating for every title, producing an aesthetically unusable visualisation due to overcrowding, while ChatGPT produces a meaningful distribution plot of the ratings. \begin{figure}[h!] \centering \includegraphics[scale=0.9] {tomatoes.png} \caption{Case Study 6: Underspecified and Ambiguous Prompts} \label{fig:Underspecified} \end{figure} \section{Discussion} The experimental results from the 6 case studies in this work confirm that LLMs can effectively support the end-to-end generation of visualisations from NL when supported by additional prompts, and are therefore, a viable solution for the NL2VIS problem (RQ1). The proposed method exhibits a number of advantages over existing NL2VIS systems which rely on symbolic NLP and deep learning approaches. The primary ones are efficiency, cost savings and accuracy. LLMs offer a pre-trained and simplified solution to the most difficult problem of understanding NL, while also encapsulating the code generation component as well. As such, this approach removes the need to create hand-crafted symbolic NLP solutions, thus saving resources. The abilities of current LLMs raise questions about the necessity to further explore symbolic NLP approaches for providing solutions to NL2VIS as a whole. Meanwhile, the proposed method demonstrated comparable if not indications of superior performances with existing methods, while showing robustness to misspecified and underspecified NL requests. The accuracy of LLMs will only continue to improve with time and therefore they represent the most viable solution for developing NL2VIS system going forward. To leverage this technology (RQ2), this study demonstrated the importance of prompt engineering in providing the LLMs with clear and concise NL requests. The study demonstrated how effective prompts can be engineered using Description and Code Primer definitions that indicate to the LLMs attributes of the underlying data as well as a coding guide. The results confirm that LLMs can be effectively primed with the proposed prompts to elicit the generation of appropriately rendered charts when accompanying the NL requests. In terms of performance (RQ3), the preliminary results indicate that the capability of the three LLMs tends not to show large deviations. This is likely due to the fact that the LLMs were trained on similar datasets. While the results demonstrate the potential of LLMs for NL2VIS, there are still some challenges to this technology (RQ4), mostly centring around aesthetic features of graphs and variable results. These challenges are addressed individually below. \subsection{Remaining challenges} While the proposed framework has performed impressively well and provided a viable solution to the problem of converting free-form NL directly into visualisation, some minor challenges still remain. \paragraph*{Setting the Plot Background Colour} Providing instruction within the engineered prompt to consistently and successfully generate code to change the background colour of a plot proved unsuccessful. With multiple factors at play, ranging from type of plot generated and the Python container it is rendered within, through to software theme settings, no consistent approach was unearthed. \paragraph*{Display of Plot Grid Lines} The incorporation of grid lines into a plot can enhance its aesthetics and aid in its interpretation. However, generating precise code for the successful rendering of grid lines is often determined by choice of plot type. As this is not specified within the engineered prompt, it is difficult to inform the LLM of the correct methods and function parameters to render the grid lines successfully. With thorough experimentation, the LLMs produced varying levels of success when the request for horizontal grid lines was included in the engineered prompt. Therefore, it is more favourable to request the adjustment of styling elements such as grid lines during the refinement of the NL query, and will be most successful when performed in conjunction with explicitly stating the type of plot to be rendered. \paragraph*{Specifying Colouring of Plot Lines and Elements} Analogously to the problems encountered with rendering grid lines, specifying refinements to other plotting elements such as line colour proved challenging within the engineered prompt. With the dependence of some function and parameter values on plot type selection, LLMs on occasion attempted to invoke unsuitable functions or assign values to unknown parameters while endeavouring to style plot elements as requested. As with grid line refinement, styling of plot lines will be most successful when combined with plot type and included as an extension to the user query. \paragraph*{Variability in Plot Generation} The repetition of the same prompt to the language model can result in significant variability in the type of plot generated and its features. This can make it difficult to consistently generate the desired visualisations. With their non-deterministic nature, especially of ChatGPT, is not possible to address this adequately at this stage since parameters that regulate the stochastic processes in its reasoning are not yet publicly available. \paragraph*{Refining the Prompt for Best Results} The generic and verbose nature of the engineered prompt caters to all three LLM models, but experimentation has shown that the ideal prompt for each model can be varied slightly to achieve the best results. Once a specific LLM is selected, the prompt may be optimised and refined for generating the best visualisations. \subsubsection*{Study limitations and future work} The current study included a limited number of case studies consisting of a selection of NL queries and example visualisations. Ideally, a comprehensive evaluation of a system like Chat2VIS would include end-users and a qualitative assessment of the system's usefulness based on their feedback. While the evaluation of NLIs in data visualisation is a complex task in the context of end-user experience, it is the intention of the authors to expand this study and conduct this type of evaluation in the subsequent work. Future work will also explore the incorporation of the nvBench benchmark dataset into the refinement of the Chat2VIS capabilities and make use of the dataset for a more comprehensive quantitative analysis of its capabilities across a wider set of queries, thus enabling a more robust comparison against results from prior studies. \section{Conclusion} The ability to generate visualisations based on natural language has been a long-standing goal in the field of data visualisation. The development of Natural Language Interfaces has paved the way for advancements in this area making data visualisation more accessible to a broader range of users by allowing them to express their queries and analysis intentions in natural language. However, the process of accurately and reliably translating natural language inputs into visualisations (NL2VIS) has been a challenging problem to solve due to the difficulty in understanding natural language. This study proposed a novel end-to-end solution for converting free-form natural language into visualisations using state-of-the-art Large Language Models (LLMs). This study explored ChatGPT and its predecessors like GPT-3 and Codex for their ability to solve the task of understanding the queries and both auto-generating code while using their internal inference abilities for selecting the appropriate visualisation types. The proposed system, Chat2VIS, has demonstrated that the use of pre-trained LLMs together with well-engineered prompts, provides an efficient, reliable and accurate solution for the problem of NL2VIS. Chart-type selection is automatic, and the LLMs are able to understand vague user queries as well as those that are malformed. Moreover, the approach is also data-privacy preserving and security-aware, making it generalisable to all types of datasets. The present study highlights the viability of LLMs to further the capabilities of existing NLIs for visualisation, providing a simpler pathway towards robust solutions which do not involve the task of defining grammars and customised domain-specific language models for language understanding. The results of this study provide valuable insights for researchers and practitioners in the field of data visualisation and NLIs, and offer simpler and more accurate solutions for making data and insights more accessible to a wider audience.
\section{Introduction and main results}\label{sec:intro} \subsection{Irreducible components of module varieties} Let $A$ be a finite-dimensional $K$-algebra, where $K$ is an algebraically closed field. Let $\operatorname{mod}(A)$ be the category of finite-dimensional left $A$-modules. For $d \ge 0$ let $\operatorname{mod}(A,d)$ be the affine variety of $A$-modules with dimension $d$. The general linear group $G_d := \operatorname{GL}_d(K)$ acts on $\operatorname{mod}(A,d)$ by conjugation. The orbits correspond to the isomorphism classes of $d$-dimensional modules. The orbit of $M \in \operatorname{mod}(A,d)$ is denoted by ${\mathcal O}_M$. Let $\operatorname{Irr}(A,d)$ be the set of irreducible components of $\operatorname{mod}(A,d)$, and let $\operatorname{Irr}(A)$ be the union of the sets $\operatorname{Irr}(A,d)$ where $d$ runs over all dimensions. We say that $Z \in \operatorname{Irr}(A,d)$ contains a dense orbit if there is some $M \in \operatorname{mod}(A,d)$ with $Z = \overline{{\mathcal O}_M}$. \subsection{Main results} For $d,d',i \ge 0$ define \begin{align*} \operatorname{ext}_A^i(-,?)&\colon \operatorname{mod}(A,d) \times \operatorname{mod}(A,d') \to \mathbb{Z},\quad (M,M') \mapsto \dim \operatorname{Ext}_A^i(M,M'), \\ \operatorname{ext}_A^i(-)&\colon \operatorname{mod}(A,d) \to \mathbb{Z},\quad M \mapsto \dim \operatorname{Ext}_A^i(M,M). \end{align*} These maps are well known to be upper semicontinuous. We have $\operatorname{Ext}_A^0(M,M') = \operatorname{Hom}_A(M,M')$. Let $\hom_A(M,M') := \operatorname{ext}_A^0(M,M')$. For $Z \in \operatorname{Irr}(A,d)$ and $Z' \in \operatorname{Irr}(A,d')$ let $\operatorname{ext}_A^i(Z,Z')$ (resp. $\operatorname{ext}_A^i(Z)$) be the generic value of $\operatorname{ext}_A^i(-,?)$ (resp. $\operatorname{ext}_A^i(-)$) on $Z \times Z'$ (resp. $Z$). Thus \begin{align*} \operatorname{ext}_A^i(Z,Z') &= \min\{ \dim \operatorname{Ext}_A^i(M,M') \mid (M,M') \in Z \times Z' \}, \\ \operatorname{ext}_A^i(Z) &= \min\{ \dim \operatorname{Ext}_A^i(M,M) \mid M \in Z \}. \end{align*} Let $\hom_A(Z,Z') := \operatorname{ext}_A^0(Z,Z')$ and $\operatorname{end}_A(Z) := \operatorname{ext}_A^0(Z)$. \begin{Thm}\label{thm:main1} For $d,d',t \ge 0$ the map $$ \eta_t(-,?)\colon \operatorname{mod}(A,d) \times \operatorname{mod}(A,d') \to \mathbb{Z},\quad (M,M') \mapsto \sum_{i=0}^t (-1)^i \dim \operatorname{Ext}_A^i(M,M') $$ is upper semicontinuous for $t$ even and lower semicontinuous for $t$ odd. \end{Thm} We call $\eta_t(-,?)$ a \emph{truncated Euler map}. If $\operatorname{gl.dim}(A) = t$, then Theorem~\ref{thm:main1} says that $\eta_t(-,?) = \eta_{t+1}(-,?)$ is upper and lower semicontinuous. This implies the well known result that in this case the value $\eta_t(M,M')$ depends only on the dimension vectors of $M$ and $M'$. The associated bilinear form $\mathbb{Z}^n \times \mathbb{Z}^n \to \mathbb{Z}$ is the \emph{Euler form} of $A$. (Here $n$ is the number of simple $A$-modules, up to isomorphism.) For $Z \in \operatorname{Irr}(A,d)$ and $Z' \in \operatorname{Irr}(A,d')$ let $\eta_t(Z,Z')$ be the generic value of $\eta_t(-,?)$ on $Z \times Z'$. The upper semicontinuity of $\operatorname{ext}_A^i(-,?)$ implies that $$ \eta_t(Z,Z') = \sum_{i=0}^t (-1)^i \operatorname{ext}_A^i(Z,Z'). $$ Theorem~\ref{thm:main1} implies that this generic value is in fact the minimal (for $t$ even) or maximal (if $t$ is odd) value of $\eta_t(-,?)$ on $Z \times Z'$. For $M,M' \in \operatorname{mod}(A)$, $i \ge 1$ and $j \ge 0$ we have $$ \operatorname{Ext}_A^i(\Omega^j(M),M') \cong \operatorname{Ext}_A^{i+j}(M,M') $$ where $\Omega^j(M)$ is the $j$-th syzygy module of $M$. For the definition of $\Omega^j(-)$ we use minimal projective resolutions. \begin{Cor}\label{cor1:main1} For $j \ge 0$ the map $$ \hom_A(\Omega^j(-),?)\colon \operatorname{mod}(A,d) \times \operatorname{mod}(A,d') \to \mathbb{Z},\quad (M,M') \mapsto \hom_A(\Omega^j(M),M') $$ is upper semicontinuous. \end{Cor} Let $S(1),\ldots,S(n)$ be the simple $A$-modules, up to isomorphism. For $M \in \operatorname{mod}(A)$ and $1 \le i \le n$ let $$ g_i := g_i(M) := - \dim \operatorname{Hom}_A(M,S(i)) + \dim\operatorname{Ext}_A^1(M,S(i)). $$ Then $g(M) := (g_1,\ldots,g_n)$ is the \emph{$g$-vector} of $M$. \begin{Cor}\label{cor2:main1} For $d \ge 0$ and $1 \le i \le n$ the map $$ g_i(-)\colon \operatorname{mod}(A,d) \to \mathbb{Z},\quad M \mapsto g_i(M) $$ is upper semicontinuous. \end{Cor} Corollary~\ref{cor2:main1} is already proved in our abandoned preprint \cite{GLFS20}. For $M,N \in \operatorname{mod}(A)$ let $$ E(M,N) := \dim \operatorname{Hom}_A(N,\tau(M)) \text{\quad and \quad} E(M) := E(M,M) $$ be the \emph{$E$-invariant} of $(M,N)$ and $M$, respectively. Here $\tau$ is the Auslander-Reiten translation for $\operatorname{mod}(A)$. (For an introduction to Auslander-Reiten theory we refer to \cite{ASS06,ARS97,R84}.) $E$-invariants and $g$-vectors appear in Derksen, Weyman and Zelevinsky's seminal work \cite{DWZ10} on the additive categorification of Fomin-Zelevinsky cluster algebras via Jacobian algebras. They also feature in $\tau$-tilting theory \cite{AIR14}. \begin{Cor}\label{cor3:main1} For $d,d' \ge 0$ the maps \begin{align*} E(-,?)&\colon \operatorname{mod}(A,d) \times \operatorname{mod}(A,d') \to \mathbb{Z},\quad (M,M') \mapsto E(M,M'), \\ E(-)&\colon \operatorname{mod}(A,d) \to \mathbb{Z},\quad M \mapsto E(M) \end{align*} are upper semicontinuous. \end{Cor} Corollary~\ref{cor3:main1} is closely related to \cite[Corollary~3.7]{DF15}. Note however that the map in \cite{DF15} is defined on another variety. For $Z \in \operatorname{Irr}(A,d)$ and $Z' \in \operatorname{Irr}(A,d')$ the generic value of $E(-,?)$ (resp. $E(-)$) on $Z \times Z'$ (resp. $Z$) is denoted by $E(Z,Z')$ (resp. $E(Z)$). For $Z,Z' \in \operatorname{Irr}(A)$ it is often crucial to know when $E(Z,Z') = 0$. Corollary~\ref{cor3:main1} implies that it is enough to find some $(M,M') \in Z \times Z'$ with $E(M,M') = 0$. By upper semicontinuity the inequalities $$ \operatorname{ext}_A^i(Z,Z) \le \operatorname{ext}_A^i(Z) \text{\quad and \quad} E(Z,Z) \le E(Z) $$ hold for all $Z \in \operatorname{Irr}(A)$ and $i \ge 0$. \begin{Thm}\label{thm:main2} For $Z \in \operatorname{Irr}(A)$ the following are equivalent: \begin{itemize}\itemsep2mm \item[(i)] $\hom_A(Z,Z) < \operatorname{end}_A(Z)$; \item[(ii)] $\operatorname{ext}_A^1(Z,Z) < \operatorname{ext}_A^1(Z)$; \item[(iii)] $E(Z,Z) < E(Z)$; \item[(iv)] $Z$ does not contain a dense orbit. \end{itemize} \end{Thm} If $Z$ does not contain a dense orbit, the inequality $\operatorname{ext}_A^i(Z,Z) \le \operatorname{ext}_A^i(Z)$ is not necessarily strict for $i \ge 2$. Some examples can be found in Section~\ref{sec:examples}. In general, it might be interesting to find a necessary and sufficient condition for $\operatorname{ext}_A^i(Z,Z) < \operatorname{ext}_A^i(Z)$. Recall that $M \in \operatorname{mod}(A)$ is a \emph{brick} if $\operatorname{End}_A(M) \cong K$. For $Z \in \operatorname{Irr}(A)$ let ${\rm brick}(Z) := \{ M \in Z \mid Z \text{ is a brick} \}$. Then $Z$ is a \emph{brick component} if ${\rm brick}(Z) \not= \varnothing$. This is the case if and only if $\operatorname{end}_A(Z) = 1$ if and only if $\overline{{\rm brick}(Z)} = Z$. \begin{Cor}\label{cor1:main2} Let $Z \in \operatorname{Irr}(A)$ be a brick component which does not contain a dense orbit. Then $\hom_A(Z,Z) = 0$. \end{Cor} Corollary~\ref{cor1:main2} generalizes one part of \cite[Theorem~3.5]{S92} from hereditary algebras to arbitrary algebras. It can also be extracted from the proof of \cite[Theorem~3.8]{PY20}. For $Z \in \operatorname{Irr}(A)$ let $$ c(Z) := \min\{ \dim(Z) - \dim {\mathcal O}_M \mid M \in Z \} $$ be the \emph{number of parameters} of $Z$. It follows that $c(Z) \le E(Z)$. Let $$ \operatorname{Irr}^\tau(A) := \{ Z \in \operatorname{Irr}(A) \mid c(Z) = E(Z) \} $$ be the set of \emph{generically $\tau$-reduced} components. These components were introduced and studied in \cite{GLS12} (where they ran under the name \emph{strongly reduced components}). A parametrization of $\operatorname{Irr}^\tau(A)$ via generic $g$-vectors is due to Plamondon \cite[Theorem~1.2]{P13}. The following result is useful for studying direct sum decompositions of generically $\tau$-reduced components for tame algebras, see Section~\ref{subsec:directsums} for more details. It follows from Corollary~\ref{cor1:main2} combined with some well known results on tame algebras. \begin{Cor}[{Plamondon, Yurikusa \cite{PY20}}]\label{cor2:main2} Assume that $A$ is tame. For each $Z \in \operatorname{Irr}^\tau(A)$ we have $E(Z,Z) = 0$. \end{Cor} Corollary~\ref{cor2:main2} appeared already as part of \cite[Theorem~3.8]{PY20} where it was mistakenly attributed to \cite{GLFS22}. Generically $\tau$-reduced components play a crucial role in the construction of well behaved bases for Fomin-Zelevinsky cluster algebras. Given a $2$-acyclic quiver $Q$ and a non-degenerate potential $W$ for $Q$ let $A = {\mathcal P}(Q,W)$ be the associated Jacobian algebra and let ${\mathcal A}(Q)$ (resp. ${\mathcal U}(Q)$) be the Fomin-Zelevinsky cluster algebra (resp. upper cluster cluster algebra) associated with $Q$, see \cite{DWZ08,DWZ10} for details. Recall that ${\mathcal A}(Q) \subseteq {\mathcal U}(Q)$. For each $Z \in \operatorname{Irr}^\tau(A)$ there is a \emph{generic Caldero-Chapoton function} $C_Z \in {\mathcal U}(Q)$. The set ${\mathcal B} := \{ C_Z \mid Z \in \operatorname{Irr}^\tau(A) \}$ often forms a basis of ${\mathcal A}(Q)$, see \cite{GLS12,Q19}. It is proved in \cite{DWZ10} that all cluster monomials of ${\mathcal A}(Q)$ are contained in ${\mathcal B}$. The tame Jacobian algebras were classified in \cite{GLFS16} and include all Jacobian algebras arising from triangulations of marked surfaces. In this case, Corollary~\ref{cor2:main2} implies that for each $C_Z \in {\mathcal B}$ we have $C_Z^m \in {\mathcal B}$ for all $m \ge 1$. In \cite{GLFS20} we construct a geometric version of the Derksen-Weyman-Zelevinsky mutation of modules over Jacobian algebras and generalize the mutation invariance of generically $\tau$-reduced components (see \cite[Theorem~1.3]{P13}) from finite-dimensional Jacobian algebras to arbitrary ones. Our proof of the mutation invariance uses Corollary~\ref{cor3:main1}. For the inverse Auslander-Reiten translation $\tau^-$ there are some obvious dual definitions and statements. \subsection{Organization of the paper} In Section~\ref{sec:known} we recall some definitions and well known results. Section~\ref{subsec:varieties} contains a few facts on varieties of modules and their connected components. Section~\ref{subsec:semicont} recalls the definition of upper and lower semicontinuous maps and lists their basic properties. Section~\ref{subsec:barresolution} contains the definition of the bar resolution of $A$. In Section~\ref{subsec:semicontext} we use the bar resolution to show that $\operatorname{ext}_A^i(-,?)$ is upper semicontinuous. Section~\ref{subsec:gvectors} explains the relation between $g$-vectors and $E$-invariants. Section~\ref{subsec:directsums} recalls the decomposition theorems on direct sums of irreducible components of module varieties. Section~\ref{sec:proofs} contains the proofs of all results mentioned in the introduction. Our first main result Theorem~\ref{thm:main1} is proved in Section~\ref{subsec:truncated}. Corollary~\ref{cor1:main1} is proved in Section~\ref{subsec:omega}. Section~\ref{subsec:gvectorsproof} contains the proofs of Corollaries~\ref{cor2:main1} and \ref{cor3:main1}. The proof of the second main result Theorem~\ref{thm:main2} and of Corollary~\ref{cor1:main2} is in Section~\ref{subsec:inequalities}. Section~\ref{subsec:tame} contains the proof of Corollary~\ref{cor2:main2}. Section~\ref{sec:examples} consists of a collection of examples. \subsection{Conventions} Throughout, let $K$ be an algebraically closed field. By $A$ we always denote a finite-dimensional algebra over $K$. By a \emph{module} we mean a finite-dimensional left $A$-module. Let $n(A)$ be the number of isomorphism classes of simple $A$-modules. (This number is finite.) All varieties are defined over $K$. For a subset $U$ of an affine variety $X$ let $\overline{U}$ be the Zariski closure of $U$ in $X$. For $d \ge 0$ let $M_d(K)$ be the set of $(d \times d)$-matrices with entries in $K$. Let $\mathbb{N}$ be the set of natural numbers including $0$, and let $K^\times := K \setminus \{0\}$. The cardinality of a set $X$ is denoted by $|X|$. For maps $f\colon X \to Y$ and $g\colon Y \to Z$, the composition is denoted by $gf\colon X \to Z$. \section{Known results on varieties of modules and semicontinuous maps}\label{sec:known} \subsection{Varieties of modules}\label{subsec:varieties} For $d \ge 0$ let $\operatorname{mod}(A,d)$ be the affine variety of $K$-algebra homomorphisms $M\colon A \to M_d(K)$. The general linear group $G_d = \operatorname{GL}_d(K)$ acts by conjugation on $\operatorname{mod}(A,d)$. (For $g \in G_d$ and $M \in \operatorname{mod}(A,d)$ let $gM\colon A \to M_d(K)$ be defined by $a \mapsto g^{-1}M(a)g$.) The \emph{orbit} of $M$ is ${\mathcal O}_M := \{ gM \mid g \in G_d \}$. Its dimension is $\dim G_d - \dim \operatorname{End}_A(M)$. The orbits in $\operatorname{mod}(A,d)$ correspond to the isomorphism classes of $d$-dimensional $A$-modules. Let $n = n(A)$, and let $S(1),\ldots,S(n)$ be the simple $A$-modules, up to isomorphism. For a simple $A$-module $S$ and $M \in \operatorname{mod}(A)$ let $[M:S]$ be the Jordan-H\"older multiplicity of $S$ in a (and therefore in all) composition series of $M$. Then $\underline{\dim}(M) := ([M:S(1)],\ldots,[M:S(n)]) \in \mathbb{N}^n$ is the \emph{dimension vector} of $M$. Let $d_S$ be the $K$-dimension of $S$. For $\mathbf{d} = (d_1,\ldots,d_n) \in \mathbb{N}^n$ with $d = d_1d_{S(1)} + \cdots + d_nd_{S(n)}$ let $$ \operatorname{mod}(A,\mathbf{d}) := \{ M \in \operatorname{mod}(A,d) \mid \underline{\dim}(M) = \mathbf{d} \}. $$ This is a connected component of $\operatorname{mod}(A,d)$, and all connected components of $\operatorname{mod}(A,d)$ arise in this way, see \cite[Corollary~1.4]{Ga74}. Let $\operatorname{Irr}(A,d)$ be the set of irreducible components of the variety $\operatorname{mod}(A,d)$, and let $\operatorname{Irr}(A)$ be the union of all $\operatorname{Irr}(A,d)$ for $d \ge 0$. For $Z \in \operatorname{Irr}(A)$ let $\underline{\dim}(Z) := \underline{\dim}(M)$ where $M$ is any module in $Z$, and let $\underline{\dim}_i(Z) := [M:S(i)]$ be the $i$-th entry of $\underline{\dim}(Z)$. \subsection{Semicontinuous maps}\label{subsec:semicont} Let $X$ be an affine variety. A map $\eta\colon X \to \mathbb{Z}$ is \emph{upper semicontinuous} (resp. \emph{lower semicontinuous}) if for each $n \in \mathbb{Z}$ the set $X_{\leq n} := \{ x \in X \mid \eta(x) \leq n \}$ (resp. $X_{\geq n} := \{ x \in X \mid \eta(x) \geq n \}$) is open in $X$. Obviously, $\eta$ is upper semicontinuous if and only if $-\eta$ is lower semicontinuous. Let $\eta\colon X \to \mathbb{Z}$ be upper semicontinuous (resp. lower semicontinuous), and let $Z$ be an irreducible component of $X$. Let $\eta(Z) := \min\{ \eta(x) \mid x \in Z \}$ (resp. $\eta(Z) := \max\{ \eta(x) \mid x \in Z \}$). Then $\{ x \in Z \mid \eta(x) := \eta(Z) \}$ is a dense open subset of $Z$. We call $\eta(Z)$ the \emph{generic value} of $\eta$ on $Z$. \begin{Lem}\label{lem:semicont1} For affine varieties $X$ and $Y$ let $\eta\colon X \times Y \to \mathbb{Z}$ be upper or lower semicontinuous. Then for $x \in X$ and $y \in Y$ the maps \begin{align*} \eta(x,-)&\colon Y \to \mathbb{Z},\quad y \mapsto \eta(x,y), \\ \eta(-,y)&\colon X \to \mathbb{Z},\quad x \mapsto \eta(x,y) \end{align*} are upper or lower semicontinuous, respectively. \end{Lem} \begin{Lem}\label{lem:semicont2} For an affine variety $X$ let $\eta\colon X \times X \to \mathbb{Z}$ be upper or lower semicontinuous. Then the map $$ \eta(-)\colon X \to \mathbb{Z},\quad x \mapsto \eta(x,x), $$ is upper or lower semicontinuous, respectively. \end{Lem} Note that the converses of Lemmas~\ref{lem:semicont1} and \ref{lem:semicont2} are usually wrong. \begin{Lem}\label{lem:semicont3} For an affine variety $X$ let $X_1,\ldots,X_t$ be the connected components of $X$. A map $\eta\colon X \to \mathbb{Z}$ is be upper or lower semicontinuous if and only if all restrictions $\eta_{X_i}\colon X_i \to \mathbb{Z}$ are upper or lower semicontinuous, respectively. \end{Lem} The following lemma is well known. \begin{Lem}\label{lem:semicont4} Let $X$ be an affine variety, let $V$ be a finite-dimensional $K$-vector space, and let $Z$ be a closed subset of $X \times V$. Assume that for each $x \in X$ the set $$ Z_x := \{ v \in V \mid (x,v) \in Z \} $$ is a subspace of $V$. Then $$ \eta\colon X \to \mathbb{Z},\quad x \mapsto \dim(Z_x) $$ is upper semicontinuous. \end{Lem} \subsection{Bar resolution}\label{subsec:barresolution} In the following all tensor products $\otimes = \otimes_K$ are over $K$ if not indicated otherwise. For $n \geq 1$ let $$ A^{\otimes n} := A \otimes \cdots \otimes A $$ be the $n$-fold tensor product. The \emph{standard complex} $$ \cdots \xrightarrow{\; p_2\;} A^{\otimes 3} \xrightarrow{\; p_1\;} A^{\otimes 2} \xrightarrow{\; p_0\;} A \to 0 $$ is defined by $$ p_i\colon a_0 \otimes \cdots \otimes a_{i+1} \mapsto \sum_{k=0}^i (-1)^k a_0 \otimes \cdots \otimes a_ka_{k+1} \otimes \cdots \otimes a_{i+1} $$ for $i \ge 0$. The standard complex is a free $A$-$A$-bimodule resolution of $A$. Let $M \in \operatorname{mod}(A)$. Applying the tensor functor $- \otimes_A M$ to the standard complex gives a projective resolution $$ \cdots \xrightarrow{d_3^M} A^{\otimes 3} \otimes M \xrightarrow{d_2^M} A^{\otimes 2} \otimes M \xrightarrow{d_1^M} A \otimes M \xrightarrow{d_0^M} M \to 0 $$ of $M$, where $d_i^M := p_i \otimes_A M$ for $i \ge 0$. Note that we identified the (left) $A$-modules $A \otimes_A M$ and $M$. Thus all tensor products in the resolution of $M$ are over $K$. \subsection{Upper semicontinuity of $\operatorname{ext}_A^i(-,?)$}\label{subsec:semicontext} We keep the notation from Section~\ref{subsec:barresolution}. Let $i \ge 1$. For simplification we define \begin{align*} k_i^{M,N} &:= \dim \operatorname{Ker}(\operatorname{Hom}_A(d_i^M,N)), \\ c_i^{M,N} &:= \dim \operatorname{Hom}_A(A^{\otimes i} \otimes M,N). \end{align*} The value $c_i^{M,N}$ depends only on $\dim(M)$ and $\dim(N)$ since $$ A^{\otimes i} \otimes M \cong A^{\dim(A^{\otimes (i-1)})\dim(M)} $$ is free projective and therefore $c_i^{M,N} = \dim(A^{\otimes (i-1)})\dim(M)\dim(N)$. (We use the convention $A^{\otimes 0} = K$.) Applying $\operatorname{Hom}_A(-,N)$ to the projective resolution of $M$ we have $$ \operatorname{Ext}_A^i(M,N) = \operatorname{Ker}(\operatorname{Hom}_A(d_{i+1}^M,N))/\operatorname{Im}(\operatorname{Hom}_A(d_i^M, N)) $$ and $\operatorname{Ext}_A^0(M,N) = \operatorname{Ker}(\operatorname{Hom}_A(d_1^M,N))$. Since $$ c_i^{M,N} = \dim \operatorname{Im}(\operatorname{Hom}_A(d_i^M,N)) + \dim \operatorname{Ker}(\operatorname{Hom}_A(d_i^M,N)) $$ we get \begin{align*} \operatorname{ext}_A^i(M,N) &= \dim \operatorname{Ker}(\operatorname{Hom}_A(d_{i+1}^M,N)) - \dim \operatorname{Im}(\operatorname{Hom}_A(d_i^M,N)) \\ &= k_{i+1}^{M,N} + k_i^{M,N} - c_i^{M,N}. \end{align*} and $\operatorname{ext}_A^0(M,N) = k_1^{M,N}$. For $d,d' \ge 0$ we want to show that the map $$ \eta\colon \operatorname{mod}(A,d) \times \operatorname{mod}(A,d') \to \mathbb{Z},\quad (M,M') \mapsto k_i^{M,M'} $$ is upper semicontinuous. For this let \begin{align*} X &:= \operatorname{mod}(A,d) \times \operatorname{mod}(A,d'), \\ V &:= \operatorname{Hom}_K(A^{\otimes i} \otimes K^d,K^{d'}), \\ Z &:= \{ ((M,M'),f) \in X \times V \mid f \in \operatorname{Hom}_A(A^{\otimes i} \otimes M,M'),\, f d_i^M = 0 \}. \end{align*} Then $Z$ is closed in $X \times V$. For $(M,M') \in X$ let $Z_{(M,M')} := \{ f \in V \mid ((M,M'),f) \in Z \}$. This is obviously a subspace of $V$ which is isomorphic to $\operatorname{Ker}(\operatorname{Hom}_A(d_i^M,M'))$. Thus we can apply Lemma~\ref{lem:semicont4} and get that $\eta$ is upper semicontinuous. Now it follows from the considerations above that $$ \operatorname{mod}(A,d) \times \operatorname{mod}(A,d') \to \mathbb{Z},\quad (M,M') \mapsto \operatorname{ext}_A^i(M,M') $$ is upper semicontinuous for all $i \ge 0$. \subsection{$g$-vectors and $E$-invariants}\label{subsec:gvectors} Let $n = n(A)$, and let $S(1),\ldots,S(n)$ be the simple $A$-modules, up to isomorphism. For $M \in \operatorname{mod}(A)$ and $1 \le i \le n$ recall that $$ g_i(M) = - \dim \operatorname{Hom}_A(M,S(i)) + \dim \operatorname{Ext}_A^1(M,S(i)). $$ Let $P(1),\ldots,P(n)$ be the indecomposable projective $A$-modules with $\operatorname{top}(P(i)) \cong S(i)$ for $1 \le i \le n$. Note that for $M \in \operatorname{mod}(A)$ we have $$ \dim \operatorname{Hom}_A(P(i),M) = [M:S(i)]. $$ Each finite-dimensional projective $A$-module $P$ is of the form $$ P \cong P(1)^{a_1} \oplus \cdots \oplus P(n)^{a_n} $$ for some uniquely determined $a_1,\ldots,a_n \ge 0$. For $1 \le i \le n$ let $$ [P:P(i)] := a_i. $$ For $M \in \operatorname{mod}(A)$ let $$ P_1 \xrightarrow{p_1} P_0 \xrightarrow{p_0} M \to 0 $$ be a minimal projective presentation of $M$. The following lemma is straightforward. \begin{Lem} For $1 \le i \le n$ we have $$ g_i(M) = [P_1:P(i)] - [P_0:P(i)]. $$ \end{Lem} Let $Z \in \operatorname{Irr}(A)$. By the upper semicontinuity of the maps $\hom_A(-,S(i))$ and $\operatorname{ext}_A^1(-,S(i))$, there is a dense open subset $U$ of $Z$ such the restriction of $g_i(-)$ is constant on $U$ for all $1 \le i \le n$. We denote this generic value by $g_i(Z)$. For $M, N \in \operatorname{mod}(A)$ recall that $$ E(M,N) = \dim \operatorname{Hom}_A(N,\tau(M)) \text{\quad and \quad} E(M) = E(M,M). $$ Applying $\operatorname{Hom}_A(-,N)$ to the minimal projective presentation of $M$ (see above) we get an exact sequence $$ 0 \to \operatorname{Hom}_A(M,N) \xrightarrow{\operatorname{Hom}_A(p_0,N)} \operatorname{Hom}_A(P_0,N) \xrightarrow{\operatorname{Hom}_A(p_1,N)} \operatorname{Hom}_A(P_1,N). $$ By \cite[Chapter IV, Corollary~4.3]{ARS97} we have $$ \operatorname{Coker}(\operatorname{Hom}_A(p_1,N)) \cong \operatorname{Hom}_A(N,\tau_A(M)). $$ In particular, we get \begin{align*} E(M,N) &= \dim \operatorname{Hom}_A(M,N) - \dim \operatorname{Hom}_A(P_0,N) + \dim \operatorname{Hom}_A(P_1,N) \\ &= \dim \operatorname{Hom}_A(M,N) - \sum_{i=1}^n [P_0:P(i)][N:S(i)] + \sum_{i=1}^n [P_1:P(i)][N:S(i)] \\ &= \dim \operatorname{Hom}_A(M,N) + \sum_{i=1}^n g_i(M)[N:S(i)]. \end{align*} Let $Z,Z' \in \operatorname{Irr}(A)$. By the upper semicontinuity of $\hom_A(-,?)$, there is a dense open subset $U$ of $Z \times Z'$ (resp. $Z$) such the restriction of $E(-,?)$ (resp. $E(-)$) is constant on $U$. We denote this generic value by $E(Z,Z')$ (resp. $E(Z)$). \subsection{Direct sums of irreducible components}\label{subsec:directsums} For $1 \le i \le t$ let $Z_i \in \operatorname{Irr}(A,d_i)$. Let $d = d_1 + \cdots + d_t$ and define \begin{align*} \eta\colon G_d \times Z_1 \times \cdots \times Z_t &\to \operatorname{mod}(A,d) \\ (g,M_1,\ldots,M_t) &\mapsto g.(M_1 \oplus \cdots \oplus M_t). \end{align*} The image of $\eta$ is denoted by $Z_1 \oplus \cdots \oplus Z_t$. The Zariski closure $\overline{Z_1 \oplus \cdots \oplus Z_t}$ is an irreducible closed subset of $\operatorname{mod}(A,d)$, but in general it is not an irreducible component of $\operatorname{mod}(A,d)$. \begin{Thm}[{\cite[Theorem~1.2]{CBS02}}]\label{thm:decomp1} For $Z_1,\ldots,Z_t \in \operatorname{Irr}(A)$ the following are equivalent: \begin{itemize}\itemsep2mm \item[(i)] $\overline{Z_1 \oplus \cdots \oplus Z_t} \in \operatorname{Irr}(A)$; \item[(ii)] $\operatorname{ext}_A^1(Z_i,Z_j) = 0$ for all $1 \le i,j \le n$ with $i \not= j$. \end{itemize} \end{Thm} For $Z \in \operatorname{Irr}(A)$ and $m \ge 1$ let $Z^m := Z \oplus \cdots \oplus Z$ be the $m$-fold direct sum of $Z$. One calls $Z$ \emph{indecomposable} if it contains a dense subset of indecomposable modules. Each $Z \in \operatorname{Irr}(A)$ can be written (in a unique way) as a direct sum $$ Z = \overline{Z_1^{a_1} \oplus \cdots \oplus Z_t^{a_t}} $$ where $Z_1,\ldots,Z_t$ are pairwise different indecomposable components and $a_1,\ldots,a_t \ge 1$. We refer to \cite{CBS02} for details. Let $\Sigma(Z) := t$. \begin{Cor} Let $Z,Z_1,\ldots,Z_t \in \operatorname{Irr}(A)$ with $Z = \overline{Z_1 \oplus \cdots \oplus Z_t} \in \operatorname{Irr}(A)$. Then the following are equivalent: \begin{itemize}\itemsep2mm \item[(i)] $\operatorname{ext}_A^1(Z,Z) = 0$; \item[(ii)] $\overline{Z_1^{a_1} \oplus \cdots \oplus Z_t^{a_t}} \in \operatorname{Irr}(A)$ for all $a_1,\ldots,a_t \ge 0$. \end{itemize} \end{Cor} For $Z \in \operatorname{Irr}(A)$ Voigt's Lemma (see for example \cite[Proposition~1.1]{Ga74}) and the Auslander-Reiten formulas (see for example \cite[Section~2.4]{R84}) imply that $$ c(Z) \le \operatorname{ext}_A^1(Z) \le E(Z). $$ Recall that $\operatorname{Irr}^\tau(Z) := \{ Z \in \operatorname{Irr}(A) \mid c(Z) = E(Z) \}$ are the \emph{generically $\tau$-reduced} components. Recall that $M \in \operatorname{mod}(A)$ is \emph{rigid} (resp. \emph{$\tau$-rigid}) if $\operatorname{Ext}_A^1(M,M) = 0$ (resp. $\operatorname{Hom}_A(M,\tau_A(M)) = 0$). By the Auslander-Reiten formulas, any $\tau$-rigid module is rigid, wheras the converse is wrong in general. If $M$ is $\tau$-rigid, then $Z = \overline{{\mathcal O}_M} \in \operatorname{Irr}^\tau(A)$. A systematic study of $\tau$-rigid modules was initiated in \cite{AIR14}. These modules are important for the additive categorification of Fomin-Zelevinsky cluster algebras and they also lead to a broad generalization of classical tilting theory. \begin{Thm}[{\cite[Theorem~1.3]{CLS15}}]\label{thm:decomp2} For $Z_1,\ldots,Z_t \in \operatorname{Irr}^\tau(A)$ the following are equivalent: \begin{itemize}\itemsep2mm \item[(i)] $\overline{Z_1 \oplus \cdots \oplus Z_t} \in \operatorname{Irr}^\tau(A)$; \item[(ii)] $E(Z_i,Z_j) = 0$ for all $1 \le i,j \le n$ with $i \not= j$. \end{itemize} \end{Thm} The proof of Theorem~\ref{thm:decomp2} relies on Theorem~\ref{thm:decomp1}. Note that in Theorems~\ref{thm:decomp1} and \ref{thm:decomp2} we do not assume that the components $Z_1,\ldots,Z_t$ are pairwise different. By the Auslander-Reiten formulas, the condition $E(Z_i,Z_j) = 0$ implies that $\operatorname{ext}_A^1(Z_i,Z_j) = 0$. \begin{Thm}[{\cite[Theorem~6.1]{CLS15}}]\label{prop:numberofsummands} Let $Z \in \operatorname{Irr}^\tau(A)$ with $E(Z,Z) = 0$. Then $\Sigma(Z) \le n(A)$. \end{Thm} It is an open problem if $\Sigma(Z) \le n(A)$ for all $Z \in \operatorname{Irr}^\tau(A)$. \section{Proofs of the main results}\label{sec:proofs} \subsection{Semicontinuity of truncated Euler maps} \label{subsec:truncated} We prove Theorem~\ref{thm:main1}. Recall that for $t \ge 0$ and $M,M' \in \operatorname{mod}(A)$ we defined $$ \eta_t(M,M') = \sum_{i=0}^t (-1)^i \operatorname{ext}_A^i(M,M'). $$ We use the notation from Section~\ref{subsec:semicontext}. For convenience, we set $c_0^{M,M'} := 0$ and define $$ c^{M,M'} := \sum_{i=0}^t (-1)^{i+1} c_i^{M,M'}. $$ This is a constant if we fix $\dim(M)$ and $\dim(M')$. We get $$ \eta_t(M,M') = \begin{cases} k_{t+1}^{M,M'} + c^{M,M'} & \text{if $t$ is even}, \\ -k_{t+1}^{M,M'} + c^{M,M'} & \text{if $t$ is odd}. \end{cases} $$ Thus $\eta_t(-,?)$ is upper semicontinuous if $t$ is even and lower semicontinuous if $t$ is odd. \subsection{Upper semicontinuity of $\hom_A(\Omega^j(-),?)$} \label{subsec:omega} We prove Corollary~\ref{cor1:main1}. For $M \in \operatorname{mod}(A)$ let $$ \cdots \xrightarrow{p_3} P_2 \xrightarrow{p_2} P_1 \xrightarrow{p_1} P_0 \xrightarrow{p_0} M \to 0 $$ be a minimal projective resolution of $M$. For $j \ge 0$ we have $\operatorname{Im}(p_j) = \Omega^j(M)$. For $j \ge 0$ and $M' \in \operatorname{mod}(A)$ define $$ p_j^{M,M'} := \sum_{i=0}^{j-1} (-1)^i\hom_A(P_{j-1-i},M'). $$ (For $j = 0$ we have $p_j^{M,M'} = 0$.) \begin{Lem}\label{lem:projmult4} For $d,d',j \ge 0$ we have $$ \hom_A(\Omega^j(M),M') = p_j^{M,M'} + (-1)^j\eta_j(M,M'). $$. \end{Lem} \begin{proof} Keeping the notation from the beginning of this section, there is a short exact sequence $$ 0 \to \Omega^j(M) \to P_{j-1} \to \Omega^{j-1}(M) \to 0 $$ for each $j \ge 1$. Applying $\operatorname{Hom}_A(-,M')$ gives an exact sequence \begin{multline*} 0 \to \operatorname{Hom}_A(\Omega^{j-1}(M),M') \to \operatorname{Hom}_A(P_{j-1},M') \to \operatorname{Hom}_A(\Omega^j(M),M')\\ \to \operatorname{Ext}_A^1(\Omega^{j-1}(M),M') \to 0. \end{multline*} Keeping in mind that $\operatorname{Ext}_A^1(\Omega^{j-1}(M),M') \cong \operatorname{Ext}_A^j(M,M')$ we get the formula $$ \hom_A(\Omega^j(M),M') = -\hom_A(\Omega^{j-1}(M),M') + \hom_A(P_{j-1},M') + \operatorname{ext}_A^j(M,M'). $$ Resolving this recursion we get \begin{align*} \hom_A(\Omega^j(M),M') &= \left(\sum_{i=0}^{j-1} (-1)^i \hom_A(P_{j-1-i},M')\right) + (-1)^j\eta_j(M,M') \\ &= p_j^{M,M'} + (-1)^j\eta_j(M,M'). \end{align*} \end{proof} The next lemma is well known. \begin{Lem}\label{lem:projmult1} For $1 \le i \le n(A)$ and $j \ge 0$ we have $$ \operatorname{ext}_A^j(M,S(i)) = \hom_A(P_j,S(i)) = [P_j:P(i)]. $$ \end{Lem} \begin{Lem}\label{lem:projmult2} For $j \ge 1$ we have $$ p_j^{M,M'} = \sum_{i=0}^{n(A)} (-1)^{j-1}\eta_{j-1}(M,S(i)) [M':S(i)]. $$ \end{Lem} \begin{proof} Recall that $\hom_A(P(i),M') = [M':S(i)]$. Now the claim follows from Lemma~\ref{lem:projmult1}. \end{proof} \begin{Cor}\label{cor:projmult3} The map $$ p_j^{-,?}\colon \operatorname{mod}(A,d) \times \operatorname{mod}(A,d') \mapsto \mathbb{Z},\quad (M,M') \mapsto p_j^{M,M'} $$ is upper semicontinuous. \end{Cor} \begin{proof} Combine Lemmas~\ref{lem:semicont3}, \ref{lem:projmult4}, \ref{lem:projmult2} with Theorem~\ref{thm:main1}. \end{proof} Combining Lemma~\ref{lem:projmult4} with Corollary~\ref{cor:projmult3} and Theorem~\ref{thm:main1} we get that the map $$ \hom_A(\Omega^j(-),?)\colon \operatorname{mod}(A,d) \times \operatorname{mod}(A,d') \to \mathbb{Z},\quad (M,M') \mapsto \hom_A(\Omega^j(M),M') $$ is upper semicontinuous. \subsection{Upper semicontinuity of $g$-vectors and $E$-invariants}\label{subsec:gvectorsproof} We prove Corollaries~\ref{cor2:main1} and \ref{cor3:main1}. \begin{Prop}\label{prop:gvectorusc} For $1 \le i \le n(A)$ the map $g_i(-)$ is upper semicontinuous. \end{Prop} \begin{proof} By Theorem~\ref{thm:main1}, the truncated Euler map \begin{align*} \eta_1(-,?)\colon \operatorname{mod}(A,d) \times \operatorname{mod}(A,d') &\to \mathbb{Z} \\ (M,M') &\mapsto \dim \operatorname{Hom}_A(M,M') - \dim \operatorname{Ext}_A^1(M,M') \end{align*} is lower semicontinuous. Using Lemma~\ref{lem:semicont1} we get that $-\eta_1(-,S(i))$ is upper semicontinuous. Since $$ g_i(M) = - \dim \operatorname{Hom}_A(M,S(i)) + \dim \operatorname{Ext}_A^1(M,S(i)) = -\eta_1(M,S(i)), $$ the result follows. \end{proof} \begin{Prop}\label{prop:Einvariantusc} $E(-,?)$ is upper semicontinuous. \end{Prop} \begin{proof} We know that $$ E(M,N) = \dim \operatorname{Hom}_A(M,N) + \sum_{i=1}^{n(A)} g_i(M)[N:S(i)] $$ for $M,N \in \operatorname{mod}(A)$. The upper semicontinuity of $\hom_A(-,?)$ and $g_i(-)$ for all $1 \le i \le n(A)$ implies that $E(-,?)$ is upper semicontinuous. \end{proof} \subsection{Inequalities for $\hom_A(-,?)$, $\operatorname{ext}_A^1(-,?)$ and $E(-,?)$}\label{subsec:inequalities} This section contains the proofs of Theorem~\ref{thm:main2} and Corollary~\ref{cor1:main2}. For a constructible subset $U$ of a variety $X$ let ${\rm codim}_X(U)$ be the codimension of $U$ in $X$. \begin{Lem}\label{lem:diagonaldim} For $Z \in \operatorname{Irr}(A)$ we have $$ {\rm codim}_{Z \times Z}\left(\{ (M,M') \in Z \times Z \mid M \cong M' \}\right) = c(Z). $$ \end{Lem} \begin{proof} Recall that $$ c(Z) = \min\{ \dim(Z) - \dim {\mathcal O}_M \mid M \in Z \} $$ and that $\dim {\mathcal O}_M = \dim G_d - \dim \operatorname{End}_A(M)$. Let \begin{align*} f\colon Z \times G_d &\to Z \times Z \\ (M,g) &\mapsto (M,gM). \end{align*} This is a morphism of affine varieties with $\operatorname{Im}(f) = \{ (M,M') \in Z \times Z \mid M \cong M' \}$. Clearly, $\operatorname{Im}(f)$ is irreducible, and $\{ (M,M') \in \operatorname{Im}(f) \mid \dim(Z) - \dim {\mathcal O}_M = c(Z) \}$ is a dense open subset of $\operatorname{Im}(f)$. For $(M,M')$ in this subset, Chevalley's Theorem says that $$ \dim \operatorname{Im}(f) = \dim(Z \times G_d) - \dim f^{-1}(M,M'). $$ We have $\dim f^{-1}(M,M') \cong {\rm Aut}_A(M)$. We get $$ \dim \operatorname{Im}(f) = \dim(Z) + \dim G_d - \dim \operatorname{End}_A(M) = \dim(Z) + \dim {\mathcal O}_M. $$ Thus ${\rm codim}_{Z \times Z}(\operatorname{Im}(f)) = 2\dim(Z) - \dim(Z) - \dim {\mathcal O}_M = c(Z)$. \end{proof} Now we prove Theorem~\ref{thm:main2}. (i) $\implies$ (ii): Assume that $\hom_A(Z,Z) < \operatorname{end}_A(Z)$. We choose $(M,M') \in Z \times Z$ such that \begin{align*} \hom_A(M,M') &= \hom_A(Z,Z), & \operatorname{ext}_A^1(M,M') &= \operatorname{ext}_A^1(Z,Z), \\ \operatorname{end}_A(M) &= \operatorname{end}_A(Z), &\operatorname{ext}^1_A(M) &= \operatorname{ext}_A^1(Z). \end{align*} The short exact sequence $$ 0 \to \Omega(M) \to P_0 \to M \to 0 $$ yields equalities \begin{align*} \operatorname{ext}_A^1(M,M') &= \hom_A(M,M') - \hom_A(P_0,M') + \hom_A(\Omega(M),M'), \\ \operatorname{ext}_A^1(M) &= \operatorname{end}_A(M) - \hom_A(P_0,M) + \hom_A(\Omega(M),M). \end{align*} The map $\hom_A(P_0,-)$ is constant on $Z$. By the upper semicontinuity of the map $\hom_A(\Omega(-),?)$ (see Corollary~\ref{cor1:main1}) we can assume that $\hom_A(\Omega(M),M') \le \hom_A(\Omega(M),M)$. Now $\hom_A(Z,Z) < \operatorname{end}_A(Z)$ implies $\operatorname{ext}_A^1(Z,Z) < \operatorname{ext}_A^1(Z)$. (i) $\implies$ (iv), (ii) $\implies$ (iv) and (iii) $\implies$ (iv): Assume that $Z \in \operatorname{Irr}(A)$ contains a dense orbit, i.e. $Z = \overline{{\mathcal O}_M}$ for some $M \in Z$. Then ${\mathcal O}_M$ and ${\mathcal O}_M \times {\mathcal O}_M$ are dense open subsets of $Z$ and $Z \times Z$, respectively. We get $\operatorname{ext}_A^i(Z,Z) = \operatorname{ext}_A^i(Z)$ for all $i \ge 0$ and $E(Z,Z) = E(Z)$. (iv) $\implies$ (i): Assume that $Z \in \operatorname{Irr}(A,d)$ does not contain a dense orbit. This implies $c(Z) \ge 1$. We want to show that $\hom_A(Z,Z) < \operatorname{end}_A(Z)$. Let $$ U := \{ (M,M',f) \in Z \times Z \times \operatorname{Hom}_K(K^d,K^d) \mid f \in \operatorname{Hom}_A(M,M') \}. $$ This is a closed subset of $Z \times Z \times \operatorname{Hom}_K(K^d,K^d)$. For $i \ge 0$ let $$ U_i := \{ (M,M',f) \in U \mid \dim \operatorname{Hom}_A(M,M') = i \}. $$ This is a locally closed subset of $U$. Let $\pi_i'\colon U_i \to Z \times Z$ be the obvious projection, and define $V_i := \operatorname{Im}(\pi_i')$. We get a surjective map $\pi_i\colon U_i \to V_i$. By \cite[Lemma~2.1]{B96} the map $\pi_i\colon U_i \to V_i$ is a vector bundle. In particular, $\pi_i$ maps open subsets of $U_i$ to open subsets of $V_i$. Let $i_0 := \hom_A(Z,Z)$. Then $V_{i_0}$ is a dense open subset of $Z \times Z$ and therefore irreducible. Let $M \in Z$ such that $\dim \operatorname{End}_A(M) = \operatorname{end}_A(Z)$. We know already that $i_0 = \hom_A(Z,Z) \le \operatorname{end}_A(Z)$. Let $$ U_{i_0}^\circ := \{ (M,M',f) \in U_{i_0} \mid f \text{ is not an isomorphism} \}. $$ This is a closed subset of $U_{i_0}$. Thus $W_{i_0} := U_{i_0} \setminus U_{i_0}^\circ$ is open in $U_{i_0}$. Suppose that $W_{i_0} \not= \varnothing$. Then $\pi_{i_0}(W_{i_0})$ is a dense open subset of $V_{i_0}$ and therefore of $Z \times Z$. Note that for all $(M,M') \in \pi_{i_0}(W_{i_0})$ we have $M \cong M'$. This is a contradiction, since by Lemma~\ref{lem:diagonaldim} we have $$ {\rm codim}_{Z \times Z}(\{ (M,M') \in Z \times Z \mid M \cong M'\}) = c(Z) \ge 1. $$ Thus we proved that $U_{i_0}^\circ = U_{i_0}$. In particular, if $(M,M') \in Z \times Z$ such that $\hom_A(M,M') = i_0$, then $M \not\cong M'$. This implies $\hom_A(Z,Z) < \operatorname{end}_A(Z)$. (iv) $\implies$ (iii): Let $Z \in \operatorname{Irr}(A)$. Assume that $Z$ does not contain a dense orbit. We know already that (iv) implies (i), i.e. $\hom_A(Z,Z) < \operatorname{end}_A(Z)$. Now the two equations \begin{align*} E(Z,Z) &= \hom_A(Z,Z) + \sum_{i=1}^{n(A)} g_i(Z)\underline{\dim}_i(Z), \\ E(Z) &= \operatorname{end}_A(Z) + \sum_{i=1}^{n(A)} g_i(Z)\underline{\dim}_i(Z). \end{align*} imply that $E(Z,Z) < E(Z)$. This finishes the proof of Theorem~\ref{thm:main2}. Let $Z \in \operatorname{Irr}(A)$ be a brick component. By definition we have $\operatorname{end}_A(Z) = 1$. If $Z$ does not have a dense orbit, Theorem~\ref{thm:main2} implies that $\hom_A(Z,Z) = 0$. Thus Corollary~\ref{cor1:main2} holds. \subsection{Generically $\tau$-reduced components for tame algebras}\label{subsec:tame} We prove Corollary~\ref{cor2:main2}. For $Z \in \operatorname{Irr}(A)$ we have $c(Z) = 0$ if and only if $Z$ contains a dense orbit. Furthermore, we have $c(Z) = E(Z) = 0$ if and only if $Z$ contains a $\tau$-rigid module $M$. In this case, ${\mathcal O}_M$ is dense in $Z$, and we have $E(Z,Z) = 0$. From now on assume that $A$ is a tame algebra, and let $Z \in \operatorname{Irr}(A)$ be indecomposable. It follows that $c(Z) \le 1$, see for example \cite[Section~2.2]{CC15}. In this situation, the following are equivalent: \begin{itemize}\itemsep2mm \item[(i)] $c(Z) = E(Z) = 1$; \item[(ii)] $Z$ is a brick component which does not contain a dense orbit. \end{itemize} For more details we refer to \cite[Section~3]{GLFS22}. In this case, Theorem~\ref{thm:main2} says that $E(Z,Z) = 0$. Now Theorem~\ref{thm:decomp2} implies Corollary~\ref{cor2:main2}. \section{Examples}\label{sec:examples} \subsection{} Let $Z \in \operatorname{Irr}(A)$. For $i \ge 2$ the inequalities $\operatorname{ext}_A^i(Z,Z) \le \operatorname{ext}_A^i(Z)$ are in general not strict. As a trivial example, if $\operatorname{gl.dim}(A) = t$, then for all $i \ge t+1$ and $Z \in \operatorname{Irr}(A)$ we have $\operatorname{ext}_A^i(Z,Z) = \operatorname{ext}_A^i(Z) = 0$. \subsection{} Let $A = KQ/I$ where $Q$ is the quiver $$ \xymatrix{ 1 \ar@(ul,dl)[]_a\ar@(ur,dr)^b } $$ and $I$ is generated by $\{ ab -ba,\, a^2,\, b^2 \}$. (If ${\rm char}(K) = 2$, then this is the group algebra of the Kleinean four group.) For $\lambda \in K^\times$ let $M_\lambda$ be the $2$-dimensional $A$-module defined by $$ M_\lambda\colon A \to M_2(K),\quad a \mapsto \BM0&0\\\lambda&0\end{matrix}\right),\quad b \mapsto \BM0&0\\1&0\end{matrix}\right). $$ We have \begin{align*} \dim \operatorname{Hom}_A(M_\lambda,M_\mu) &= \begin{cases} 2 & \text{if $\lambda = \mu$}, \\ 1 & \text{otherwise}, \end{cases} \\ \dim \operatorname{Ext}_A^1(M_\lambda,M_\mu) &= \begin{cases} 1 & \text{if $\lambda = \mu$}, \\ 0 & \text{otherwise}. \end{cases} \end{align*} Furthermore, we have $M_\lambda \cong M_\mu$ if and only if $\lambda = \mu$. Some easy computations show that $\tau(M_\lambda) \cong M_\lambda$ and $\Omega(M_\lambda) \cong M_{-\lambda^{-1}}$. Thus $\Omega^2(M_\lambda) \cong M_\lambda$. One easily checks that $$ Z := \overline{\bigcup_{\lambda \in K^\times} {\mathcal O}_{M_\lambda}} \in \operatorname{Irr}(A,2). $$ (In fact, we have $\operatorname{mod}(A,2) = Z$.) Note that $Z$ does not contain a dense orbit. It follows that $\hom_A(Z,Z) = 1$, $\operatorname{end}_A(Z) = 2$, $\operatorname{ext}_A^1(Z,Z) = 0$, $\operatorname{ext}_A^1(Z) = 1$, $E(Z,Z) = 1$ and $E(Z) = 2$. For $i \ge 2$ we get $\operatorname{ext}_A^i(Z,Z) = 0$ and $$ \operatorname{ext}_A^i(Z) = \begin{cases} 1 & \text{if $i$ is odd}, \\ 0 & \text{if $i$ is even}. \end{cases} $$ Here we used that $\operatorname{Ext}_A^i(M_\lambda,M_\mu) \cong \operatorname{Ext}_A^1(\Omega^{i-1}(M_\lambda),M_\mu)$. \subsection{} The following example is due to Calvin Pfeifer \cite{Pf22}. For $n \ge 2$ let $A = KQ/I$ where $Q$ is the quiver $$ \xymatrix{ 1 \ar@(ul,dl)_a & 2 \ar@<-0.5ex>[l]_{b_1}\ar@<0.5ex>[l]^{b_2} \ar@(ur,dr)[]^c } $$ and $I$ is generated by $\{ a^n,\, c^n,\, ab_i - b_ic \mid i = 1,2 \}$. This is the algebra $H(C,D,\Omega)$ from \cite{GLS17} for $$ C = \left(\begin{matrix} 2&-2\\-2&2\end{matrix}\right),\quad D = \left(\begin{matrix} n&\\&n\end{matrix}\right),\quad \Omega = \{ (1,2) \}. $$ Let $\mathbf{d} = (n,n)$. The locally free $A$-modules (in the sense of \cite{GLS17}) in $\operatorname{mod}(A,\mathbf{d})$ form a non-empty open irreducible subset of $\operatorname{mod}(A,2n)$. Let $Z \in \operatorname{Irr}(A,2n)$ be the closure of this subset. Then $Z$ is indecomposable, $\hom_A(Z,Z) = \operatorname{ext}_A^1(Z,Z) = E(Z,Z) = 0$ and $\operatorname{end}_A(Z) = \operatorname{ext}_A^1(Z) = E(Z) = n$. \subsection{} Let $A = KQ$ be a finite-dimensional path algebra. Then the irreducible components of $\operatorname{mod}(A,d)$ are just the connected components of $\operatorname{mod}(A,d)$. Furthermore, each indecomposable $Z \in \operatorname{Irr}(A)$ is a brick component, see \cite[Proposition~1]{K82}. Let $Q_0 = \{ 1,\ldots,n \}$ be the set of vertices of $Q$. Thus $n = n(A)$. Let $\mathbf{d} = (d_1,\ldots,d_n)$ be an isotropic Schur root in the sense of \cite{S92}, and let $d = d_1 + \cdots + d_n$. Let $Z = \operatorname{mod}(A,\mathbf{d}) \in \operatorname{Irr}(A,d)$. Then $\hom_A(Z,Z) = \operatorname{ext}_A^1(Z,Z) = E(Z,Z) = 0$ and $\operatorname{end}_A(Z) = \operatorname{ext}_A^1(Z) = E(Z) = 1$. If we assume additionally that $Q$ is connected and wild, then for all bricks $M \in Z$ we have $\tau(M) \not\cong M$. As a concrete example let $Q$ be the quiver $$ \xymatrix{ 1 & \ar@<0.5ex>[l]\ar@<-0.5ex>[l] 2 & 3 \ar[l] } $$ and let $\mathbf{d} = (1,1,0)$. Then $Q$ is connected and wild, and $\mathbf{d}$ is an isotropic Schur root.
\section*{Introduction} A \emph{Poisson Hamiltonian space} \begin{equation}\label{Poisson_Ham_space} G\curvearrowright (M,\pi)\stackrel{\mu}{\longrightarrow}\gg^* \end{equation} consists of: \begin{itemize} \item a Poisson manifold $(M,\pi)$, on which a Lie group $G$ acts by Poisson diffeomorphisms, \item an equivariant map $\mu:M\to \gg^*$, called the \emph{moment map}, where $\gg$ Lie algebra of $G$, \end{itemize}with the property that the infinitesimal action $\mathrm{a}_M(v) \in \mathfrak{X}(M)$ of an element $v \in \gg$ is the Hamiltonian vector field corresponding to the function $\langle \mu,v\rangle\in C^{\infty}(M)$: \[ \mathrm{a}_M(v) = \pi^{\sharp}\mathrm{d} \langle \mu,v\rangle. \] We prove a normal form theorem for a Poisson Hamiltonian space around the zero locus of the moment map $P:=\mu^{-1}(0)$, under the assumption that the action is \emph{proper and free}. In that case, $P$ is the total space of a principal $G$-bundle $p_S:P \to S:=\mu^{-1}(0)/G$ and, by the Marsden-Weinstein reduction in the Poisson setting \cite{Marsden_Ratiu,Marsden_Weinstein}, its base inherits the structure of a Poisson manifold $(S,\pi_S)$. In the language of Dirac geometry (see e.g.\ \cite{Bursztyn,Meinrenken}), $\pi_S$ is determined by the equality of the pullbacks to $P$ of the two Poisson structures $\pi$ and $\pi_S$, viewed as Dirac structures via their graphs: \[ i^!\mathrm{Gr}(\pi) = p_S^!\mathrm{Gr}(\pi_S), \]where $i:P \to M$ stands for the inclusion. The local model for \eqref{Poisson_Ham_space} is built using a principal connection $\theta\in \Omega^1(P;\mathfrak{g})$ on the principal $G$-bundle $p_S:P\to S$, and is given by the Dirac structure \begin{equation}\label{Dirac model} L_{\widetilde{\theta}}:=\mathcal{R}_{-\mathrm{d}\widetilde{\theta}}\, p^!\mathrm{Gr}(\pi_S) \quad \textrm{on}\quad P\times \gg^*, \end{equation} i.e., it is the pullback Dirac structure $ p^!\mathrm{Gr}(\pi_S)$, where $p=p_S\circ \mathrm{pr}_1:P\times \gg^*\to S $, gauged transformed by the 2-form $-\mathrm{d} \widetilde{\theta}$, where \begin{align*} &\widetilde{\theta}\in \Omega^1(P\times \mathfrak{g}^*), &\widetilde{\theta}_{(x,\xi)}:=\textrm{pr}_1^*\langle \xi, \theta_x\rangle. \end{align*} Then, for the diagonal action of $G$, we have that \begin{equation} G\curvearrowright (P \times \gg^*,L_{\widetilde{\theta}})\stackrel{\mathrm{pr}_2}{\longrightarrow}\gg^* \end{equation}is a Hamiltonian Dirac space, in the sense that, for all $v\in\gg$, \begin{align* & \mathrm{a}_{P \times \gg^*}(v)+\mathrm{d} \langle \mathrm{pr}_2,v\rangle \in \Gamma(L_{\widetilde{\theta}}). \end{align*} Our main result can be stated as follows (an improvement will be presented later): \begin{MT}\label{thm : zero set} Consider a proper and free Poisson Hamiltonian space \eqref{Poisson_Ham_space}. Then the Dirac manifold $(P \times \gg^*,L_{\widetilde{\theta}})$ is the graph of a Poisson structure $\pi_S^{-\mathrm{d}\widetilde{\theta}}$ in an invariant neighborhood $U$ of $P$, and the Hamiltonian Poisson spaces \begin{align*} & G\curvearrowright (M,\pi)\stackrel{\mu}{\longrightarrow}\gg^*, & G\curvearrowright (U,\pi_S^{-\mathrm{d}\widetilde{\theta}})\stackrel{\mathrm{pr}_2}{\longrightarrow}\gg^* \end{align*}are isomorphic around $P$, by a $G$-equivariant diffeomorphism which is the identity on $P$. \end{MT} In the symplectic case $(M,\pi=\omega^{-1})$, the Poisson structure on $S$ is also symplectic $\pi_S=\omega_S^{-1}$, and it is obtained as the classical Marsden-Weinstein reduction. In this case, the Dirac structure $L_{\widetilde{\theta}}$ on $P\times\gg^*$ is the graph of the closed 2-form $p^*\omega_S-\mathrm{d}\widetilde{\theta}$, which is the classical ``coupling construction" due to Sternberg and Weinstein \cite{Sternberg, Weinstein}. The analog of our Main Theorem is known in symplectic geometry \cite[Theorem 6.1]{Meinrenken_notes}, however, the original statement is difficult to trace back: it would follow from a version of the coisotropic embedding theorem \cite{Gotay} in the $G$-equivariant setting; the content of \cite[Chapters 35-40]{Guillemin_Sternberg} comes very close to it; and the exact statement can be found in \cite[Proposition 5.2]{Jeffrey_Kirwan} -- for finding this reference, we would like to thank Eckhard Meinrenken. The setting of the Main Theorem implies that $M/G$ has a Poisson structure $\pi_{M/G}$, for which the quotient map $M\to M/G$ and the inclusion $S\to M/G$ are Poisson maps. The Main Theorem provides a normal form for $(M/G,\pi_{M/G})$ around the Poisson submanifold $S$. In the symplectic case, the quotient Poisson manifold $(P\times\gg^*,p^*\omega_S-\mathrm{d} \widetilde{\theta})/G$ has been studied already in \cite{Montgomery}, but only later it has been identified to serve as the first order local model around the symplectic leaf $(S,\pi_S)$ \cite{CrMa12}, and as the integrable version of Vorobjev's local model \cite{Vorobjev01,Vorobjev05}. Around more general Poisson submanifolds, a first order local model was developed only recently \cite{FeMa22}, and our Main Theorem implies: \begin{corollary}\label{corollary:linearizable} Under the assumptions of the Main Theorem, the Poisson manifold $(M/G,\pi_{M/G})$ is linearizable around the Poisson submanifold $(S,\pi_S)$, in the sense of \cite{FeMa22}. \end{corollary} In the last section, we discuss the local structure around more general values of the moment map. Namely, if \eqref{Poisson_Ham_space} is a principal Hamiltonian $G$-space, to any $\lambda\in \mu(M)$, we associate the data of a principal $G_{\lambda}$-bundle over a Poisson manifold: \begin{equation}\label{eq:datum} G_{\lambda}\curvearrowright P_{\lambda}\to (S_{\lambda},\pi_{S_{\lambda}}), \end{equation} where $P_{\lambda}:=\mu^{-1}(\lambda)$, $S_{\lambda}:=\mu^{-1}(\lambda)/G_{\lambda}$ and the Poisson structure is determined by the condition \[p_{S_{\lambda}}^!\mathrm{Gr}(\pi_{S_{\lambda}})=i^!\mathrm{Gr}(\pi),\] where $p_{S_\lambda}:P_{\lambda} \to S_{\lambda}$ is the projection and $i:P_{\lambda}\hookrightarrow M$ is the inclusion. \begin{theorem} In the setting of the Main Theorem, consider a value $\lambda \in \gg^*$ of $\mu$ which admits an affine slice $j:\gg_{\lambda}^* \to \gg^*$ for the $G$-action (see Section \ref{sec : Other values of the moment map} for a more details). Then the Poisson Hamiltonian space \eqref{Poisson_Ham_space} is determined, up to isomorphism, in a $G$-invariant neighborhood of $\mu^{-1}(\lambda)$, by the data of the principal $G_{\lambda}$-bundle $P_{\lambda}$ over the Poisson manifold $(S_{\lambda},\pi_{S_{\lambda}})$, from \eqref{eq:datum}. More precisely, a $G$-invariant neighborhood of $P_{\lambda}=\mu^{-1}(\lambda)$ in the Poisson Hamiltonian space \eqref{Poisson_Ham_space} is isomorphic to a $G$-invariant neighborhood of $P_{\lambda}$ in the Dirac Hamiltonian space: \begin{align*}\label{eq : model for other values} G \curvearrowright \left((G\times P_{\lambda}\times \gg_{\lambda}^*)/G_{\lambda},\overline{D}\right)\stackrel{\overline{\mu}}{\longrightarrow} \gg^*, \end{align*} where $\overline{\mu}[g,x,\xi]=g\cdot j(\xi)$, and the pullback of $\overline{D}$ to $G\times P_{\lambda}\times \gg_{\lambda}^*$ is the Dirac structure \[ \mathcal{R}_{\mathrm{d} \gamma }p_{S_{\lambda}}^!\mathrm{Gr}(\pi_{S_{\lambda}}), \] where the 1-form $\gamma$ is built from a principal $G_{\lambda}$-connection $\theta_{\lambda}$ on $P_{\lambda}$, as follows: \[\gamma(V,U,\eta)_{(g,x,\xi)}:=\langle j(\xi),(g^{-1})_*(V)\rangle-\langle \xi,\theta_{\lambda}(U)\rangle,\quad (V,U,\eta)\in T_gG\times T_{x}P_{\lambda}\times T_{\xi}\gg^*_{\lambda}.\] \end{theorem} \subsection*{Conventions} We follow sign and Lie group conventions of \cite[Appendix A]{MariusRuiIonut}. For Dirac structures, we follow the notation of \cite{Meinrenken}; thus the standard Courant algebroid $TM \oplus T^*M$ is denoted by $\mathbb{T}M$, pullbacks are denoted $\varphi^!(L)$ and pushforwards by $\varphi_!(L)$. We also denote by \begin{align*} & \mathcal{R}_{\omega} : \mathbb{T}M \xrightarrow{\raisebox{-0.2 em}[0pt][0pt]{\smash{\ensuremath{\sim}}}} \mathbb{T}M, & \mathcal{R}_{\omega}(a)=a+\iota_{\mathrm{pr}_T(a)}\omega \end{align*}the orthogonal linear map of \emph{gauge transformation} by a two-form $\omega \in \Omega^2(M)$, and by \begin{align*} & \mathcal{R}_{\pi} : \mathbb{T}M \xrightarrow{\raisebox{-0.2 em}[0pt][0pt]{\smash{\ensuremath{\sim}}}} \mathbb{T}M, & \mathcal{R}_{\pi}(a)=a+\pi^{\sharp}(\mathrm{pr}_{T^*}(a)) \end{align*}the ``gauge transformation" by a bivector $\pi \in \mathfrak{X}^2(M)$ (this latter notation is less standard). \section{Preliminary remarks} Consider a Hamiltonian Poisson space: \begin{equation*} G\curvearrowright (M,\pi)\stackrel{\mu}{\longrightarrow}\gg^*. \end{equation*} Our goal is to describe the local behavior of this space around $P=\mu^{-1}(0)$. The weakest assumptions that will allow us to conclude interesting properties are the following: \begin{MA} $\phantom{00}$ \begin{itemize} \item The action of $\mathfrak{g}$ is free; \item The action of $G$ is proper. \end{itemize} \end{MA} Both these conditions are $G$-invariant and open; that the second condition is open follows from the stronger version of the slice theorem which assumes properness only pointwise (see e.g.\ \cite{Ortega_Ratiu, Palais}). Therefore, if these conditions are assumed to hold along $P=\mu^{-1}(0)$, it follows that they hold on a $G$-invariant neighborhood of $P$, which can then replace $M$. Henceforth, we will assume that the main assumptions are satisfied. \subsection*{The moment map as a submersion by Dirac manifolds} \begin{lemma}\label{lemma:restriction:to:fibers} If the action of $\gg$ is free, then the restriction of the moment map $\mu$ to each symplectic leaf of $(M,\pi)$ is a submersion, and each fibre of $\mu$ is a Dirac transversal. \end{lemma} \begin{proof} Let $x \in M$ and $(S,\omega)$ be the symplectic leaf of $\pi$ through $x$. By the moment map condition, \[ \mathrm{a}_M(v)=\pi^{\sharp} \circ \mu^*(v), \]where $v \in \gg$ is seen as a constant one-form on $\gg^*$, the infinitesimal action at $x$ takes values in $T_xS$: \begin{align*} & \mathrm{a}_{M,x} : \gg \longrightarrow T_xS, \end{align*}and this is the composition of \[ \gg=T^*_{\mu(x)}\gg^* \stackrel{\mu^*}{\longrightarrow} T^*_xM \longrightarrow T_x^*S \]with the isomorphism $\omega_{\flat}^{-1}:T_x^*S \xrightarrow{\raisebox{-0.2 em}[0pt][0pt]{\smash{\ensuremath{\sim}}}} T_xS$. Hence $\mathrm{a}_{M,x}$ is injective iff the dual composition \[ T_xS \longrightarrow T_xM \stackrel{\mu_*}{\longrightarrow} T_{\mu(x)}\gg^* \] is surjective. Otherwise said, $\gg \curvearrowright M$ is free iff the restriction of $\mu$ to each symplectic leaf is a submersion. This implies that the fibres of the submersion $\mu:M \to \gg^*$ are Dirac transversals --- that is, they meet the symplectic leaves transversely. \end{proof} The lemma implies that $P:=\mu^{-1}(0)$ inherits by pullback along the inclusion $i:P \to (M,\pi)$ a smooth Dirac structure, which will be denoted \[L_P:=i^!\mathrm{Gr}(\pi)=\{\pi^{\sharp}(\alpha) + i^*(\alpha) \ | \ \alpha\in T^*M|_{P}, \ \pi^{\sharp}(\alpha)\in TP\}\subset \mathbb{T}P.\] Geometrically, the presymplectic leaves of $L_P$ are the connected components of the intersections: \[(S\cap P, \omega|_{S\cap P}),\] where $(S,\omega)$ is a symplectic leaf of $\pi$. Note that $(S,\omega)$ is a Hamiltonian space for the connected component $G^0$ of the identity. By Lemma \ref{lemma:restriction:to:fibers}, the moment map $\mu|_S:S\to \gg^*$ has $0$ as a regular value. Therefore, the standard argument in symplectic geometry \cite[Theorem 1]{Marsden_Weinstein} shows that the kernel of the two-form $\omega|_{S\cap P}$ is spanned by the $\gg$-action: \begin{equation}\label{eq:ker:restr} \ker(\omega|_{S\cap P})_x=\{\mathrm{a}_{P,x}(v) \ | \ v\in \mathfrak{g}\}, \end{equation} where $\mathrm{a}_P=\mathrm{a}_M|_P$. Globally, this can be phrased as follows: \begin{lemma} The kernel of the Dirac structure $L_P$ is given by the image of the infinitesimal action: \begin{equation}\label{eq:ker:L_P} L_P\cap T P=\mathrm{Im} (\mathrm{a}_P). \end{equation} \end{lemma} \begin{remark}\rm A submersion $p:\Sigma \to N$ whose total space $\Sigma$ has a Lie algebroid $A$ in which each fibre $p^{-1}(x)$ sits as a Lie algebroid transversal is called \emph{a submersion by Lie algebroids} \cite{Subm}: \begin{align}\label{eq:SLA} A \Longrightarrow \Sigma \stackrel{p}{\longrightarrow} N. \end{align} This condition can be characterized by the surjectivity of the map \begin{align*} p_* \circ \rho_A : A \longrightarrow p^*(TN), \end{align*} where $\rho_A$ denotes the anchor of $A$. Every submersion by Lie algebroids admits an \emph{Ehresmann connection} --- that is, a linear splitting $\mathrm{hor}: p^*(TN) \to A$ of the map above. As shown in \cite{Subm}, such connections can be used to trivialize (\ref{eq:SLA}) locally. When the Lie algebroid is given by a Dirac structure, we shall speak of a \emph{submersion by Dirac manifolds}. By Lemma \ref{lemma:restriction:to:fibers}, under our Main Assumptions, we have a submersion by Dirac manifolds: \begin{equation}\label{sdm} \mathrm{Gr}(\pi) \Longrightarrow M \stackrel{\mu}{\longrightarrow} \gg^* \end{equation} To prove the normal form theorem, we will adapt the arguments from \cite{Subm} to this setting, under the additional constraint that the construction needs to be made $G$-invariant. \end{remark} \begin{lemma} Given a submersion by Dirac manifolds $L_{\Sigma} \Longrightarrow \Sigma \to N$ and any smooth map $f:P \to N$, there is a pullback submersion by Dirac manifolds \[ \overline{f}^!(L_{\Sigma}) \Longrightarrow f^*(\Sigma) \to P, \] where the pullback submersion $f^*(\Sigma)= P \times_N \Sigma \to P$ is equipped with the pullback of $L_{\Sigma}$ by \begin{align*} & \overline{f}: f^*(\Sigma) \to \Sigma, & \overline{f}(y,x) = x. \end{align*} Moreover, any Ehresmann connection $\mathrm{hor}:\Sigma\times_N TN \to L_{\Sigma}$ induces a pullback Ehresmann connection $f^!\mathrm{hor} : f^*(\Sigma) \times_P TP \to \overline{f}^!(L_{\Sigma})$, determined by the condition that $f^!\mathrm{hor}$ and $\mathrm{hor} f_*$ are $\overline{f}$-related. \end{lemma} \begin{proof} For Lie algebroids submersions, this was proven in \cite{Subm}, and we briefly explain how to reduce to this case. Note first that $\overline{f}$ is transverse to the Dirac structure $L_{\Sigma}$. This implies that the pullback Lie algebroid $T(f^*\Sigma)\times_{T\Sigma}L_{\Sigma}$ is canonically isomorphic to the Lie algebroid underlying the pullback Dirac structure $f^{!}(L_{\Sigma})$, via the map: \begin{equation}\label{identification} T(f^*\Sigma)\times_{T\Sigma}L_{\Sigma}\xrightarrow{\raisebox{-0.2 em}[0pt][0pt]{\smash{\ensuremath{\sim}}}} f^{!}(L_{\Sigma}),\qquad\qquad (v,v_1+\xi)\mapsto v+\overline{f}^*\xi. \end{equation} By \cite[Lemma 3]{Subm}, the left-hand side is a submersion by Lie algebroids: \[T(f^*\Sigma)\times_{T\Sigma}L_{\Sigma}\Longrightarrow f^*(\Sigma) \to P\] and this implies the first part. At the level of Lie algebroids, the pullback connection was constructed in \cite{Subm}. Under the isomorphism \eqref{identification}, this corresponds to the connection from the statement. \end{proof} \subsection*{The equivariant Ehresmann connection} The local model of the Hamiltonian Poisson space \eqref{Poisson_Ham_space} depends on an auxiliary choice of a \emph{principal connection}, i.e., a $\gg$-valued one-form $\theta \in \Omega^1(M;\gg)$, satisfying, for all $v \in \gg$ and $g \in G$, the equations: \begin{align}\label{principal:connection} & \theta(\mathrm{a}_M(v)) = v, & g\cdot \theta = \mathrm{Ad}_g \circ \theta. \end{align} Although only the infinitesimal action is assumed to be free, we have that: \begin{lemma}\label{lemma:existence:princ:conn} Under the Main Assumptions, $M$ admits principal connections. \end{lemma} \begin{proof} The hypothesis that the action is proper implies that $M$ has a $G$-invariant Riemannian metric $\langle \cdot,\cdot\rangle$ \cite[Theorem 4.3.1]{Palais}. The hypothesis that $\gg$ acts freely identifies $\gg\times M $ as a subbundle of $TM$: \begin{align*} \gg \times M \ni (v,x) \mapsto \mathrm{a}_{M}(v)_x \in T_xM. \end{align*} The one-form $\theta \in \Omega^1(M;\gg)$ arising from the projection $TM \to \gg\times M $ along the orthogonal complement to $\gg\times M$ satisfies the conditions \eqref{principal:connection}. \end{proof} \begin{lemma}\label{lem : equivariant Ehresmann} For a principal connection $\theta \in \Omega^1(M;\gg)$, the rule \begin{align*} & \mathrm{hor}_x : T_{\mu(x)}\gg^* \to \mathrm{Gr}(\pi)_x, & \mathrm{hor}_x(\xi) = -\pi^{\sharp}\langle \xi, \theta_x\rangle - \langle \xi, \theta_x\rangle \end{align*}is a $G$-equivariant Ehresmann connection on the submersion by Dirac manifolds \eqref{sdm}. \end{lemma} \begin{proof} For $x \in M$, denote by $\mathrm{h}_x=\mathrm{pr}_T\circ \mathrm{hor}_x$. For all $\xi + v \in T_{\mu(x)}\gg^*\oplus T^*_{\mu(x)}\gg^*$, we have that \begin{align*} \langle \mu_*\mathrm{h}_x(\xi),v\rangle = -\langle \pi_x^{\sharp}\langle \xi, \theta_x\rangle,\mu^*(v)\rangle = \langle \xi, \theta_x(\pi_x^{\sharp}\mu^*(v))\rangle = \langle \xi, \theta_x(\mathrm{a}_{M,x}(v))\rangle = \langle \xi,v\rangle, \end{align*} where in the third equality we used the moment map condition, and in the fourth the definition of $\theta$. This implies that $\mathrm{h}$ is a classical Ehresmann connection: $\mu_*\mathrm{h}_x(\xi)=\xi$. The $G$-equivariance of the Ehresmann connection follows from the $G$-equivariance of $\theta$, together with the fact that the $G$-action is Poisson --- which is to say that $\pi^{\sharp}$ is $G$-equivariant: $\pi_{gx}^{\sharp}=g_*\pi_{x}^{\sharp}g^*$. \end{proof} \section{The local model} To construct the local model, we will use the following \emph{local form data}: \begin{itemize} \item An action of $G$ on $P$, which is proper and infinitesimally free; \item A Dirac structure $L_P$ on $P$, with kernel given by the $\gg$-action: $L_P\cap TP=\mathrm{Im}(\mathrm{a}_P)$. \end{itemize} The construction depends also on a principal connection $\theta \in \Omega^1(P;\gg)$, as in Lemma \ref{lemma:existence:princ:conn}. The connection enters the picture through the usual one-form on $P\times \gg^*$ it induces: \begin{align*} & \widetilde{\theta}\in \Omega^1(P\times \mathfrak{g}^*), & \widetilde{\theta}_{(x,\xi)}:=\textrm{pr}_1^*\langle\xi, \theta_x\rangle. \end{align*} This one-form has the following properties: \begin{enumerate}[a)] \item It is $G$-invariant; \item For all $(x,\xi)\in P\times \gg^*$ and $v\in \gg$, it satisfies: \[\langle \widetilde{\theta}_{(x,\xi)},\mathrm{a}_{P \times \gg^*}(v)\rangle=\langle \xi,v\rangle;\] \item It vanishes along $P\simeq P \times \{0\}$. \end{enumerate} It will be convenient to consider all one-forms satisfying these properties: \begin{definition} A one-form $\alpha \in \Omega^1(U)$ defined on a $G$-invariant neighborhood $U$ of $P$ in $P \times \gg^*$ will be referred to as a {\bf generalized connection} if it satisfies properties a) - c) above. \end{definition} Such generalized connections give rise to local models for the Poisson Hamiltonian space \eqref{Poisson_Ham_space}: \begin{proposition}\label{pro : local model} Given a local form data $G\curvearrowright (P,L_P)$ and a generalized connection $\alpha \in \Omega^1(U)$ on $U \subset P \times \gg^*$, the Dirac structure $L_{\alpha}$, defined as the gauge transform of $\mathrm{pr}_1^!L_P$ by the two-from $-\mathrm{d} \alpha$ \begin{align}\label{local model} L_{\alpha}:=\mathcal{R}_{-\mathrm{d}\alpha}\mathrm{pr}_1^{!}L_P, \end{align} \begin{enumerate}[1)] \item is $G$-invariant and \begin{align*} G \curvearrowright (U,L_{\alpha}) \stackrel{\mathrm{pr}_2}{\longrightarrow} \gg^* \end{align*}is a Hamiltonian Dirac manifold, in the sense that, for all $v\in \gg$: \begin{align*} \mathrm{a}_U(v) + \mathrm{d}\langle \mathrm{pr}_2, v\rangle \in \Gamma(L_{\alpha}); \end{align*} \item is (the graph of) a Poisson structure $\pi_{\alpha}$ in a $G$-invariant neighborhood of $P$. \end{enumerate} \end{proposition} \begin{proof} Since all ingredients in its construction are $G$-invariant, so is the Dirac structure $L_{\alpha}$. Moreover, for any $v \in \gg$, since $\mathrm{a}_P(v)\in L_P$, we have that $\mathrm{a}_U(v) \in \mathrm{pr}_1^!L_P$. Thus invariance of $\alpha$, a): \[ \mathscr{L}_{\mathrm{a}_U(v)}\alpha = \mathrm{d} \iota_{\mathrm{a}_U(v)}\alpha+\iota_{\mathrm{a}_U(v)}\mathrm{d}\alpha=0, \]together with condition b) give \begin{align}\label{eq : dalpha iso} \iota_{\mathrm{a}_U(v)}\mathrm{d}\alpha = -\mathrm{d}\iota_{\mathrm{a}_U(v)}\alpha = -\mathrm{d} \langle \mathrm{pr}_2,v\rangle \end{align}and hence we obtain the moment map condition: \[ \mathrm{a}_U(v) - \iota_{\mathrm{a}_U(v)}\mathrm{d}\alpha = \mathrm{a}_U(v) + \mathrm{d}\langle \mathrm{pr}_2, v\rangle \in \Gamma(L_{\alpha}). \]The Poisson locus of $L_{\alpha}$ is given by the open, $G$-invariant set in which the intersection \begin{align*} \mathcal{R}_{-\mathrm{d} \alpha}\mathrm{pr}_1^!(L_P) \cap TU \end{align*}is trivial. Let $u\in \mathcal{R}_{-\mathrm{d} \alpha}\mathrm{pr}_1^!(L_P) \cap TU|_P$. Then there exists $\xi\in T^*P$ such that $\mathrm{pr}_{1*}(u)+\xi\in L_P$ and $\mathrm{pr}_1^*(\xi)=\iota_u\mathrm{d}\alpha$. We have that, for any $v\in \gg$: \[0=\langle \mathrm{a}_P(v), \mathrm{pr}_{1*}u+\xi\rangle= \langle \mathrm{a}_P(v), \xi\rangle=\langle \mathrm{a}_U(v), \mathrm{pr}_1^*(\xi)\rangle=\langle \mathrm{a}_U(v), \iota_{u}\mathrm{d}\alpha\rangle= \iota_{u}\mathrm{d}\langle \mathrm{pr}_2, v\rangle=\langle \mathrm{pr}_{2*}u,v\rangle, \] where the first equality holds because $\mathrm{Im}(\mathrm{a}_P)\subset L_P$, the third because $\mathrm{pr}_{1*}\mathrm{a}_U(v)=\mathrm{a}_P(v)$, and the one before the last by (\ref{eq : dalpha iso}). We conclude that $u\in \ker \mathrm{pr}_{2*}|_P=TP$. Pulling the equality $\mathrm{pr}_1^*(\xi)=\iota_u\mathrm{d}\alpha$ back to $P$ then gives $\xi =0$, which is to say that $u$ lies in the kernel of $L_P$. Therefore $u$ is of the form $u=\mathrm{a}_U(v)$ for some $v \in \gg$. But because $0 \in \gg^*$ is a fixed point of the coadjoint action, at points of $P \times \{0\} \subset U$, we have that $\mathrm{a}_P(v)=\mathrm{a}_U(v)$ along $P$, and because (\ref{eq : dalpha iso}) implies that $\mathrm{d}\alpha : \mathrm{Im}\, \mathrm{a}_U|_P \xrightarrow{\raisebox{-0.2 em}[0pt][0pt]{\smash{\ensuremath{\sim}}}} \mathrm{Im}\, \mathrm{pr}^*_{2}|_P$ is an isomorphism, we conclude that $u=0$. Hence the Dirac structure on $U$ is Poisson along $P$, and hence in a $G$-invariant neighborhood of $P$. \end{proof} \begin{definition}\label{def:local:model} Consider a $G$-invariant neighborhood $U\subset P\times \gg^*$ of $P$ on which the Dirac structure $L_{\alpha}$ corresponds to a Poisson structure $\pi_{\alpha}$. The Poisson Hamiltonian space: \[G\curvearrowright (U,\pi_{\alpha})\stackrel{\mathrm{pr}_2}{\longrightarrow}\gg^*\] is the \textbf{local model} corresponding to the generalized connection $\alpha$. \end{definition} The following shows uniqueness of the local model around $\mu^{-1}(0)$: \begin{proposition}\label{prop:local_models_are_the_same} Let $\alpha \in \Omega^1(U_{\alpha})$ and $\beta \in \Omega^1(U_{\beta})$ be two generalized connections, and let \begin{align*} & G \curvearrowright (U_{\alpha},{\pi}_{\alpha}) \stackrel{\mathrm{pr}_2}{\longrightarrow} \gg^*, & G \curvearrowright (U_{\beta},{\pi}_{\beta}) \stackrel{\mathrm{pr}_2}{\longrightarrow} \gg^* \end{align*} be the corresponding local models. There exist $G$-invariant neighborhoods $U'_{\alpha} \subset U_{\alpha}$ and $U'_{\beta}\subset U_{\beta}$ of $P$, and an isomorphism of Poisson Hamiltonian spaces which is the identity on $P$: \begin{align*} & \psi : (U'_{\alpha},{\pi}_{\alpha}) \xrightarrow{\raisebox{-0.2 em}[0pt][0pt]{\smash{\ensuremath{\sim}}}} (U'_{\beta},{\pi}_{\beta}), & \mathrm{pr}_2 = \mathrm{pr}_2 \circ \psi. \end{align* \end{proposition} \begin{proof} Observe first that, on the $G$-invariant common domain $U_{\alpha} \cap U_{\beta}$, the one-forms \begin{align*} \alpha_t:=\alpha+t\gamma, \qquad \text{where} \qquad \gamma:=\beta-\alpha \in \Omega^1(U_{\alpha} \cap U_{\beta}), \end{align*}are generalized connections for all $t \in [0,1]$. Let $U \subset U_{\alpha} \cap U_{\beta}$ be a $G$-invariant open set in which each Dirac structure $\mathcal{R}_{-\mathrm{d}\alpha_t}\mathrm{pr}_1^!L_P$ is the graph of a Poisson structure $\pi_t \in \mathfrak{X}^2(U)$, for all $t\in [0,1]$. Then the time-dependent vector field $\pi_{t}^{\sharp}(\gamma)$ is $G$-invariant and vanishes along $P$ (because so does $\gamma$); hence there is an open, $G$-invariant neighborhood of $P$ in which its flow $\psi_t$ is defined for all $t\in [0,1]$. These are $G$-equivariant maps, and by \cite[Lemma 3.4]{Alekseev_Meinrenken_2007} or \cite[Lemma 4]{Frejlich_Marcut} the time-one flow $\psi:=\psi_1$ maps $\pi_0=\pi_{\alpha}$ to $\pi_1=\pi_{\beta}$, wherever the flow is defined. Moreover, since $\gamma$ vanishes on $\mathrm{a}_U(v)$ for all $v\in\gg$, we have \[0=\left\langle \gamma,\mathrm{a}_U(v) \right\rangle=\left\langle\gamma, \pi_{t}^{\sharp}\mathrm{d}\langle \mathrm{pr}_2,v\rangle\right\rangle= -\big\langle \pi_{t}^{\sharp}(\gamma), \mathrm{d}\langle \mathrm{pr}_2,v\rangle\big\rangle,\] and therefore $\mathrm{pr}_2$ is preserved by the flow of $\pi_{t}^{\sharp}(\gamma)$. \end{proof} \section{The normal form theorem} We are now ready to state and prove the main theorem \begin{MT} Any proper and infinitesimally free Poisson Hamiltonian space \eqref{Poisson_Ham_space} is isomorphic around $\mu^{-1}(0)$ with the local model from Proposition \eqref{pro : local model}. \end{MT} \begin{proof} We pull back the submersion by Dirac manifolds \eqref{sdm} via scalar multiplication: \begin{align*} & m : I \times \gg^* \to \gg^*, & m(t,\xi):=t\xi, \end{align*} where $I:=[0,1]$. The resulting pullback diagram is \[ \xymatrix{ m^*(M) \ar[r]^{\overline{m}} \ar[d]_{\overline{\mu}} & M \ar[d]^{\mu}\\ I \times \gg^* \ar[r]_m & \gg^* } \] where \[m^*(M) = \{ (x,t,\xi) \in M \times I \times \gg^* \ | \ \mu(x)=m(t,\xi)\}\quad \textrm{and}\quad \overline{m}(x,t,\xi)=x.\] We obtain the submersion by Dirac manifolds: \begin{equation}\label{induced sdm} \overline{m}^!\mathrm{Gr}(\pi) \Longrightarrow m^*(M) \longrightarrow I \times \gg^*. \end{equation} For each $t\in I$, this can be pulled back via the map $\gg^*\hookrightarrow I\times \gg^*$, $\xi\mapsto (t,\xi)$ and we obtain a family of submersions by Dirac manifolds. For $t=1$, this is the original submersion by Dirac manifolds \eqref{sdm}: \begin{align*} \overline{\mu}_1 = \mu : m_1^*(M) = M \longrightarrow \gg^*, \end{align*} equipped with the Dirac structure $\overline{m}_1^!\mathrm{Gr}(\pi) =\mathrm{Gr}(\pi)$. For $t=0$, the induced submersion is \begin{align*} \overline{\mu}_0 = \mathrm{pr_2} : m_0^*(M) = P \times \gg^* \longrightarrow \gg^*, \end{align*}equipped with the Dirac structure \begin{align*} \overline{m}_0^!\mathrm{Gr}(\pi) = \mathrm{pr}_1^!i^!\mathrm{Gr}(\pi)= \mathrm{pr}_1^!(L_P). \end{align*} On the original submersion by Dirac manifolds \eqref{sdm}, we consider an Ehresmann connection induced by a principal connection $\theta\in \Omega^1(M;\gg)$, as in Lemma \ref{lem : equivariant Ehresmann}. Denote the associated generalized connection by $\widetilde{\theta}\in \Omega^1(M\times \gg^*)$. We equip the submersion by Dirac manifolds \eqref{induced sdm} with the pullback Ehresmann connection. Then, the horizontal lift of the vector field $\tfrac{\partial}{\partial t}\in \mathfrak{X}(I \times \gg^*)$ has the form \[ \mathrm{hor}(\tfrac{\partial}{\partial t})=\mathcal{V}-r^*\widetilde{\theta} \in \Gamma(\overline{m}^!\mathrm{Gr}(\pi)), \] where $r(x,t,\xi)=(x,\xi)$, and the vector component is given by: \[\mathcal{V}_{(x,t,\xi)}= \big(-\pi^{\sharp}\langle \xi, \theta_x\rangle,\tfrac{\partial}{\partial t},0\big)\in T_{(x,t,\xi)}m^*(M).\] It is useful to regard it as a vector field on $M \times I \times \gg^*$ which is tangent to $m^*(M)$. Then one can easily see that the flow of $\mathcal{V}$ has the form: \begin{equation}\label{eq:form:of:diffeo} \varphi_t: m^*(M) \supset U_t \to m^*(M),\quad \varphi_t(x,s,\xi)=(\varphi_{t,\xi}(x),s+t,\xi), \end{equation} where $U_t$ is the maximal domain of the flow and $\varphi_{t,\xi}$ is the flow on $M$ of the vector field $-\pi^{\sharp}\langle \xi, \theta\rangle $. Along the submanifold $P\times I\times \{0\}\subset m^*(M)$, we have that $\varphi_t(x,s,0)=(x,s+t,0)$, and so the flow is defined up to time $t=1$ on $P=P\times \{0\}\times \{0\}$. Therefore, there is an open set \[P\subset O\subset m_0^*(M)=P\times \gg^*,\] such that the flow is defined on $O$ for all $t\in I$: \[\varphi_t:O\xrightarrow{\raisebox{-0.2 em}[0pt][0pt]{\smash{\ensuremath{\sim}}}} \varphi_t(O)\subset m_t^*(M).\] Moreover, because $\mathcal{V}$ is $G$-invariant, $O$ may be chosen $G$-invariant, and so $\varphi_t$ is $G$-equivariant. The flow of the section $\mathrm{hor}(\tfrac{\partial}{\partial t})$ of the Dirac structure $\overline{m}^!\mathrm{Gr}(\pi)$ is by $G$-equivariant Courant automorphisms of this Dirac structure (in the sense of \cite[Proposition 2.3]{Gualtieri}) \begin{align* &\Phi_t:(U_t,\overline{m}^!\mathrm{Gr}(\pi))\to (m^*(M),\overline{m}^!\mathrm{Gr}(\pi)),\\ & \Phi_t: = \varphi_{t\ast} \circ \mathcal{R}_{-\mathrm{d}\alpha_t}, & \alpha_t:=\smallint_0^t \varphi_s^* r^*\widetilde{\theta} \mathrm{d}s. \end{align*} Therefore, we have a $G$-equivariant Dirac-embedding between the fibers over $0$ and $1$ \begin{align}\label{eq:the_final_iso} \varphi_{1} : \left(O,\mathcal{R}_{-\mathrm{d}\alpha_1}\mathrm{pr}_1^!L_P \right) \hookrightarrow \left(M,\mathrm{Gr}(\pi) \right) \end{align}which, by the explicit form \eqref{eq:form:of:diffeo}, intertwines $\mathrm{pr}_2$ and the original moment map $\mu$: \begin{align*} \mu \circ \varphi_{1} = \mathrm{pr}_2. \end{align*} To conclude the proof, we show that the left-hand side of \eqref{eq:the_final_iso} is isomorphic to a local model. By Proposition \ref{prop:local_models_are_the_same}, it suffices to show that $\alpha_1\in \Omega^1(O)$ is a generalized connection. This can be deduced from the following properties of the map $r\circ \varphi_t|_{O}:O \to M\times \gg^*$, which are readily checked using \eqref{eq:form:of:diffeo}: it preserves the projection $\mathrm{pr}_2$ to $\gg^*$, restricts to the inclusion $P\times \{0\}\hookrightarrow M\times \{0\}$ and is $G$-equivariant. Therefore $\varphi_t^*r^*\widetilde{\theta}|_O$ is a generalized connection on $O$, and so is the average $\alpha_1=\smallint_0^1 \varphi_t^* r^*\widetilde{\theta} \mathrm{d}t|_O$. \end{proof} \subsection*{Other proofs} The Main Theorem is a normal form around the Dirac transversal $P=\mu^{-1}(0)$, which is additionally compatible with the $G$-action and the moment map. In recent years, several techniques have been developed to obtain local forms around transversals. Our proof is modeled on the ideas from \cite{Subm}, which are closely related to \cite{Bischoff_Bursztyn_Lima_Meinrenken_2020}. An alternative proof, based on \cite{Bursztyn_Lima_Meinrenken}, can be obtained by using an equivariant Ehresmann connection as in Lemma \ref{lem : equivariant Ehresmann} to lift the Euler vector field on $\gg^*$ to a section of $\mathrm{Gr}(\pi)$ which is Euler-like along $P \subset M$, and then invoke \cite[Theorem 5.1]{Bursztyn_Lima_Meinrenken}. These steps lead to the same isomorphism \eqref{eq:the_final_iso} as in the proof above. Yet another proof can be deduced from a $G$-equivariant version of the uniqueness of coisotropic embeddings \cite[Proposition 5.1]{Geudens_2020}, which can be proven using the spray methods of \cite{Frejlich_Marcut,Frejlich_Marcut18}. \section{The case of a principal action} Consider now the case of a Poisson Hamiltonian space \eqref{Poisson_Ham_space}, for which the action of $G$ on $M$ is proper and free. In this case, we have that \begin{itemize} \item $S:=P/G$ has an induced Poisson structure $\pi_S$; \item $M/G$ has a Poisson structure $\pi_{M/G}$, for which both the quotient map $M\to M/G$ and the inclusion $S\hookrightarrow M/G$ are Poisson maps. \end{itemize} The Main Theorem provides a normal form for $(M/G,\pi_{M/G})$ around the Poisson submanifold $S$, which we will describe here. In the case when $S$ is a symplectic manifold, the Poisson quotient $(P\times\gg^*,p^*\omega_S-\mathrm{d} \widetilde{\theta})/G$ has been studied in \cite{Montgomery}, and our discussion will generalize this construction. \vspace*{0.2cm} We specialize the local model from Definition \ref{def:local:model} to the proper and free case. The input data is \begin{itemize} \item a principal $G$-bundle $P$ over the Poisson manifold $(S,\pi_S)$. \end{itemize} To keep track of notation, we put the many projections involved into a diagram: \[ \xymatrix{ P\times \gg^* \ar[r]^{p_G}\ar[d]_{\mathrm{pr_1}}\ar[dr]^{p} & P\times_{G}\gg^* \ar[d]^r\\ P \ar[r]_{p_S} & S. } \]and recall that \[p_S^!\mathrm{Gr}(\pi_S)=L_P.\] Fix a principal bundle connection $\theta$ on $P$. On $P\times \gg^*$, we have the $G$-invariant Dirac structure: \[ L_{\widetilde{\theta}}:=\mathcal{R}_{-\mathrm{d} \widetilde{\theta}} \, p^!\mathrm{Gr}(\pi_S).\] By Proposition \ref{pro : local model}, on some open $G$-invariant neighborhood $U\subset P\times \gg^*$ of $P$, $L_{\widetilde{\theta}}$ corresponds to a Poisson structure $\pi_S^{-\mathrm{d} \widetilde{\theta}}$. The local model for the Hamiltonian Poisson space is: \[G\curvearrowright (U,\pi_S^{-\mathrm{d} \widetilde{\theta}})\stackrel{\mathrm{pr}_2}{\longrightarrow}\gg^*.\] We will describe the Poisson structure on the quotient, i.e., for which the projection is a Poisson map: \[p_G: (U,\pi_S^{-\mathrm{d} \widetilde{\theta}})\longrightarrow (U/G,\pi_0).\] For this, we introduce some notation. The horizontal lift with respect to $\theta$ will be denoted by $\mathrm{h}_{\theta}$. Denote the curvature of $\theta$ by: \[\mathrm{R}_{\theta}(u_1,u_2)_{x}:=\big([\mathrm{h}_{\theta}(u_1),\mathrm{h}_{\theta}(u_2)]-\mathrm{h}_{\theta}([u_1,u_2])\big)_{x}\in \gg,\quad \quad u_1,u_2\in \mathfrak{X}(S),\] where the right-hand side is a vertical vector in $T_yP$, and so we can identify it with an element of $\gg$. Since $\mathrm{R}_{\theta}(u_1,u_2):P\to \gg$ is $G$-equivariant, the following 2-form is well-defined: \[\Form\in \Omega^2(P\times_G\gg^*),\qquad \Form(U_1,U_2)_{p_G(x,\xi)}:=\langle \xi,\mathrm{R}_{\theta}(r_*(U_1),r_*(U_2))_{x}\rangle \] The connection $\theta$ induces a linear connection on the associated bundle $P\times_G\gg^*$, and the corresponding Ehresmann connection will be denoted by \[H_{\theta}\subset T(P\times_G\gg^*).\] Next consider the linear Poisson structure $\pi_{\gg}$ on $\gg^*$. Since $\pi_{\gg}$ is $G$-invariant, it induces a vertical, fiberwise linear Poisson structure on $P\times_G\gg^*$, which will be denoted \[\pi^{\mathrm{v}}\in \mathfrak{X}^2(P\times_{G}\gg^*).\] We first describe the structure which depends only on the connection: \begin{proposition}\label{lemma:push:forward:foo} The Dirac structure $\mathrm{Gr}(-\mathrm{d} \widetilde{\theta})$ pushes forward via the projection $p_G$ to a Dirac structure $D_{\theta}$ on $P\times_G\gg^*$, for which the quotient map \[ p_G : \left(P \times \gg^*,\mathrm{Gr}(-\mathrm{d} \widetilde{\theta})\right) \longrightarrow \left(P \times_G \gg^*,D_{\theta}\right) \]is a strong, forward Dirac submersion. Moreover, $D_{\theta}$ is explicitly given by: \begin{equation}\label{eq:Dirac:Vorobjev} D_{\theta}= \mathcal{R}_{\Form}(H_{\theta}) \oplus \mathcal{R}_{-\pi^{\mathrm{v}}}(H_{\theta}^{\circ}) \end{equation} \end{proposition} \begin{remark}\rm If follows from \eqref{eq:Dirac:Vorobjev} that the Dirac structure on $D_{\theta}$ is a \emph{coupling} Dirac structure with respect to the projection $r:P\times_{G}\gg^*\to S$, meaning that (see, e.g., \cite{BrFe08,DuWa,Vaisman}): \begin{align*} & D_{\theta}\cap (V\oplus V^{\circ})=0,& V:=\ker r_*\subset T(P\times_G\gg^*). \end{align*} Equality \eqref{eq:Dirac:Vorobjev} also shows that the Vorobjev triple corresponding to $D_{\theta}$ is $(-\pi^{\mathrm{v}},H_{\theta},\Form)$. The Dirac structure $D_{\theta}$ can be obtained also using the more general construction from \cite[Theorem 3.2]{Wade}. \end{remark} \begin{proof} Because $\mathrm{Gr}(-\mathrm{d} \widetilde{\theta})$ is $G$-invariant, it pushes forward pointwise to $P\times_{G}\gg^*$, so $D_{\theta}:=(p_{G})_{!}\mathrm{Gr}(-\mathrm{d} \widetilde{\theta})$ is a well-defined family of Lagrangian subspaces. We will prove \eqref{eq:Dirac:Vorobjev}, which implies that $D_{\theta}$ is a smooth Lagrangian subbundle, and being the smooth pushforward of a Dirac structure, it will follow \cite[Proposition 5.9]{Bursztyn} that $D_{\theta}$ is a Dirac structure. We will use the following notation: \begin{itemize} \item $\hat{v}:=(\mathrm{a}_{P}(v),0)\in \mathfrak{X}(P\times \gg^*)$, i.e., the infinitesimal action of $v\in \gg$ on $P$; \item $\mathrm{h}_{P \times \gg^*}(u):=(\mathrm{h}_{P}(u),0)\in\mathfrak{X}(P\times \gg^*)$ the horizontal lift of $u\in \mathfrak{X}(S)$; \item $\hat{\xi}:=(0,\xi)\in \mathfrak{X}(P\times \gg^*)$ the constant vector field with second component $\xi\in \gg^*$. \end{itemize} Vector fields of these three types span $T(P\times\gg^*)$. In fact, we have a direct sum decomposition: \begin{equation}\label{eq:decomposition:T} T_{p_S(y)}S\oplus \gg \oplus \gg^*\simeq T_{(y,\eta)}(P\times \gg^*),\qquad (u,v,\xi) \mapsto\big(\mathrm{h}_{P \times \gg^*}(u)+\hat{v}+\hat{\xi}\big)\big|_{(y,\eta)}. \end{equation} Consider \begin{align*} & \rho_{(y,\eta)}:\gg \to T^*_yP \times T^*_{\eta}\gg^*, & \rho_{(y,\eta)}(v):= (\langle \pi_{\gg,\eta}(v),\theta_y\rangle,v), \end{align*}and observe that \[ \langle \rho(v), \mathrm{h}_{P \times \gg^*}(u)\rangle = 0, \qquad \langle \rho(v), \hat{w}\rangle = \pi_{\gg}(v,w), \qquad \langle \rho(v), \hat{\xi} \rangle =\langle \xi,v\rangle. \] In particular, $\rho(v) \in \mathrm{a}_{P \times \gg^*}(\gg)^{\circ}\subset T^*(P \times\gg^*)$, since the infinitesimal coadjoint action of $\gg$ on $\gg^*$ is given by \[\mathrm{a}_{\gg^*}(v)_{\xi}=\langle \xi, [v,\cdot]\rangle=\pi_{\gg,\xi}^{\sharp}(v),\]and therefore \[ \langle \rho(v), \mathrm{a}_{P \times \gg^*}(w)\rangle = \langle \rho(v), (\hat{w},\pi_{\gg}^{\sharp}(w))\rangle = \pi_{\gg}(v,w)+\pi_{\gg}(w,v) = 0 \] for all $v,w \in \gg$. Because \[ \iota_{\mathrm{h}_{P \times \gg^*}(u)}\widetilde{\theta} = \iota_{\hat{\eta}}\widetilde{\theta} = 0, \qquad \iota_{\hat{v}}\widetilde{\theta} = \langle \mathrm{pr}_2,v\rangle \]we deduce that \begin{align*} &-\mathrm{d} \widetilde{\theta}(\mathrm{h}_{P \times \gg^*}(u),\mathrm{h}_{P \times \gg^*}(u'))_{(y,\eta)}=\langle \eta, \mathrm{R}_{\theta}(u,u')\rangle\\ &-\mathrm{d} \widetilde{\theta}(\hat{v},\hat{w})_{(y,\eta)}=\langle \eta, [v,w]\rangle \\ &-\mathrm{d} \widetilde{\theta}(\hat{v},\hat{\xi})_{(y,\eta)}=\langle \xi,v \rangle \end{align*} are the only non-zero pairings between the three types of vector fields on $P \times \gg^*$. Therefore \[ -\iota_{\mathrm{h}_{P \times \gg^*}(u)}\mathrm{d}\widetilde{\theta} = \iota_{\mathrm{h}_{P \times \gg^*}(u)}p_G^*(\Form), \qquad -\iota_{\hat{v}}\mathrm{d}\widetilde{\theta} = \rho(v). \]The first equality implies that the sections \begin{align*} & \mathrm{h}_{P \times \gg^*}(u)-\iota_{\mathrm{h}_{P \times \gg^*}(u)}\mathrm{d}\widetilde{\theta} \in \Gamma(\mathrm{Gr}(-\mathrm{d} \widetilde{\theta})) & \mathrm{h}_{\theta}(u)+\iota_{\mathrm{h}_{\theta}(u)}\Form \in \Gamma(\mathcal{R}_{\Form}(H_{\theta})) \end{align*}are $p_G$-related, while the second equality means that \begin{align*} & \hat{v}-\iota_{\hat{v}}\mathrm{d}\widetilde{\theta} \in \Gamma(\mathrm{Gr}(-\mathrm{d} \widetilde{\theta})) & -{\pi^{\mathrm{v}}}^{\sharp}\rho(v)+\rho(v) \in \Gamma(\mathcal{R}_{-\pi^{\mathrm{v}}}(H_{\theta}^{\circ})) \end{align*}are $p_G$-related, since \begin{align*} (p_G)_*\hat{v} = (p_G)_*(\mathrm{a}_P(v),0) = (p_G)_*(0,-\mathrm{a}_{\gg^*}(v))= (p_G)_*(0,-\pi_{\gg}(v)) = -{\pi^{\mathrm{v}}}^{\sharp}\rho(v). \end{align*}This shows that \[ \mathcal{R}_{\Form}(H_{\theta}) \oplus \mathcal{R}_{-\pi^{\mathrm{v}}}(H_{\theta}^{\circ}) \subset D_{\theta}, \] which implies equality \eqref{eq:Dirac:Vorobjev}, because both are Lagrangian families. This shows that \begin{align*} p_G : \left(P \times \mathfrak{g}^*,\mathrm{Gr}(-\mathrm{d} \widetilde{\theta}) \right) \longrightarrow \left(P \times_G \mathfrak{g}^*,D_{\theta} \right) \end{align*}is forward Dirac submersion, and it is \emph{strong} \cite[Definition 1.11]{ABM}, in the sense that $\ker (p_{G})_* \cap \mathrm{Gr}(-\mathrm{d} \widetilde{\theta}) = 0$, as one can read off from the non-zero pairings of $\mathrm{d} \widetilde{\theta} $ listed above. \end{proof} In the next step, the tangential product (or \emph{tensor product} in \cite[Section 2.3]{Gualtieri}) of Dirac structures $D_1$ and $D_2$ will be play an important role: \[D_1 \star D_2:=\{v+\alpha_1+\alpha_2 \, |\, v+\alpha_i\in D_i\}.\] In general, $D_1\star D_2$ is a family of Lagrangian spaces, but might fail to be smooth. If it is smooth, then it is automatically a Dirac structure. \begin{lemma} Let $D$ be a coupling Dirac structure for a surjective submersion $p:M\to N$. For any Dirac structure $E$ on $N$, $D\star p^!E$ is a Dirac structure on $M$. Moreover, if $D$ pushes forward to a Dirac structure $F$ on $N$, i.e., if \[ p : (M,D) \to (N,F) \]is a forward Dirac map, then so is \[ p :(M,D \star p^!E) \to (N,F \star E). \] \end{lemma} \begin{proof} The Lagrangian family $D\star p^!E$ is smooth because $D$ and $p^!E$ \emph{tangentially transverse}, that is, their anchors $D \to TM$ and $p^!(E) \to TM$ are transverse. This is so because $D$ is transverse to the Dirac structure corresponding to the fibres of $p$, and $p^!E$ contains all vectors tangent to such fibres. Assume now that $p_!D=F$, for a Dirac structure $F$ on $N$. Every $b \in (F \star E)_{p(x)}$ is of the form $b=f+\xi$, where \[ f \in F_{p(x)}, \qquad \xi \in T_{p(x)}^*N, \qquad \mathrm{pr}_T(f)+\xi \in E_{p(x)}. \]Because $p:(M,D) \to (N,F)$ is forward, $f$ is $p$-related to some $d \in D_x$. Therefore $a:=d + p^*\xi \in (D \star p^!E)_x$ is $p$-related to $b$, which is to say that \[ p_!(D \star p^!(E)) = p_!(D) \star E. \qedhere \] \end{proof} Applying the lemma to the submersion $r:P\times_G\gg^*\to S$, the coupling Dirac structure $D_{\theta}$ on $P\times_G\gg^*$ and the Poisson structure $\pi_S$, we obtain that \[D_{\theta}\star r^!\mathrm{Gr}(\pi_S)\] is a smooth Dirac structure on $P\times_G\gg^*$. Noting that: \[L_{\widetilde{\theta}}=\mathcal{R}_{-\mathrm{d} \widetilde{\theta}}\,p^!\mathrm{Gr}(\pi_S)=\mathrm{Gr}(-\mathrm{d} \widetilde{\theta})\star p_G^!r^!\mathrm{Gr}(\pi_S),\] the previous lemma implies: \begin{proposition}\label{proposition_coupling_Poisson} The projection map is a forward Dirac map \[p_G:(P\times \gg^*,L_{\widetilde{\theta}})\to (P\times_G\gg^*, D_{\theta}\star r^!\mathrm{Gr}(\pi_S)),\] and we have that: \[D_{\theta}\star r^!\mathrm{Gr}(\pi_S)= \big\{(\pi^{\mathrm{v}})^{\sharp}\alpha-\alpha \ | \ \alpha\in H_{\theta}^{\circ}\big\}\oplus \big\{\mathrm{h}_{\theta}(\pi_S)^{\sharp}\beta+\beta + i_{\mathrm{h}_{\theta}(\pi_S)^{\sharp}\beta}\Form \ | \ \beta\in V^{\circ}\big\}. \]where $\mathrm{h}_{\theta}(\pi_S) \in \mathfrak{X}^2(P \times_G \gg^*)$ is the horizontal lift of $\pi_S$. \end{proposition} Finally, we obtain an explicit formula for the Poisson structure $\pi_0$: \begin{corollary}\label{corollary:global:form} Let $U/G\subset P\times_G\gg^*$ be the open set of elements $z=p_G(y,\eta)$, where the map: \[\mathrm{Id}+B(z) :T^*_{p_S(y)}S\to T^*_{p_S(y)}S,\quad \lambda \mapsto \lambda+\langle \eta, \mathrm{R}_{\theta}(\pi_S^{\sharp}\lambda,\cdot)_y\rangle\] is invertible. On $U/G$, $D_{\theta}\star r^!\mathrm{Gr}(\pi_S)$ corresponds to the graph of the Poisson structure \[\pi_{0}:=\pi^{\mathrm{h}}-\pi^{\mathrm{v}}\in \mathfrak{X}^2(U/G),\] where \[\pi^{\mathrm{h}}=\mathrm{h}_{\theta}(\gamma)\in \Gamma(\wedge^2H_{\theta}),\quad \gamma_{z}^{\sharp}:=\pi_{S}^{\sharp}\circ (\mathrm{Id}+B(z))^{-1}.\] \end{corollary} \begin{remark}\rm Using the calculations from Proposition \ref{lemma:push:forward:foo}, it is easy to see that $\mathrm{Gr}(-\mathrm{d} \widetilde{\theta})$ is also a coupling Dirac structure for the projection $p:P\times \gg^*\to S$, and its corresponding Vorobjev triple has 2-form $p_G^*\Form$, Ehresmann connection $E_{\theta}=\ker\theta\times 0\subset TP\times T\gg^*$ and vertical Poisson structure $\Pi^{\mathrm{v}}$, which is such that its restriction to each fiber $P_x\times \gg^*$ corresponds to minus the inverse of the canonical symplectic structure on $T^*P_x$, under the dual of the action $(\mathrm{a}_{P_x})^*: TP_x^* \xrightarrow{\raisebox{-0.2 em}[0pt][0pt]{\smash{\ensuremath{\sim}}}} P_x\times \gg^*$. Arguments similar to the ones above show further that $L_{\widetilde{\theta}}$ corresponds to a Poisson structure exactly on the set $U$ described in the corollary above, and this Poisson structure admits a similar description: \[\pi_S^{-\mathrm{d} \widetilde{\theta}}=\mathrm{h}_{\theta}(\gamma)+\Pi^{\mathrm{V}},\] where $\gamma$ is the same as above, but where $\mathrm{h}_{\theta}$ now denotes the horizontal lift with respect to $E_{\theta}$. \end{remark} \subsection*{Linearization around Poisson submanifolds} Corollary \ref{corollary:global:form} implies Corollary \ref{corollary:linearizable} from the Introduction. For this, we will briefly discuss the linear models around Poisson submanifolds from \cite{FeMa22}. Consider a bundle of Lie algebras $(\mathfrak{k},[\cdot,\cdot]_{\mathfrak{k}})\to S$ over a Poisson manifold $(S,\pi_S)$. We will call a pair $(\nabla,U)$ a \emph{coupling data} for $\mathfrak{k}$ and $\pi_S$, if $\nabla$ is a connection on $\mathfrak{k}$, $U\in \Gamma(TS\otimes T^*S\otimes \mathfrak{k})$ is a tensor field, and they satisfy the structure equations: \begin{enumerate} \item[(S1)] the connection $\nabla$ preserves the Lie bracket $[\cdot,\cdot]_{\mathfrak{k}}$, i.e., \[\nabla_{X}[\xi,\eta]_{\mathfrak{k}}=[\nabla_{X}\xi,\eta]_{\mathfrak{k}}+[\xi,\nabla_{X}\eta]_{\mathfrak{k}};\] \item[(S2)] the curvature of $\nabla$ is related to $[U,\cdot]$ as follows: \[\nabla_{\pi^{\sharp}_S(\alpha)}\nabla_{X}-\nabla_{X}\nabla_{\pi^{\sharp}_S(\alpha)}-\nabla_{[\pi^{\sharp}_S(\alpha),X]}=[U(\alpha,X),\cdot ]_{\mathfrak{k}};\] \item[(S3)] $U$ satisfies the skew-symmetry condition \begin{equation* U(\alpha,\pi^{\sharp}_S(\beta))=- U(\beta,\pi^{\sharp}_S(\alpha)). \end{equation*} and the ``mixed'' cocycle-type equation: \begin{align*} \nabla_{\pi^{\sharp}_S(\alpha)}U(\beta,X)&-\nabla_{\pi^{\sharp}_S(\beta)}U(\alpha,X)+\nabla_{X}U(\alpha,\pi_S^{\sharp}(\beta))\\ &+U(\alpha,[\pi^{\sharp}_S(\beta),X])-U(\beta,[\pi_S^{\sharp}(\alpha),X])=U([\alpha,\beta]_{\pi_S},X), \end{align*} \end{enumerate} for all $X\in \mathfrak{X}^1(S)$, $\alpha,\beta\in \Omega^1(S)$, $\xi,\eta\in \Gamma(\mathfrak{k})$,and where \begin{align*} & [\cdot,\cdot]_{\pi_S} : \Omega^1(M) \times \Omega^1(M) \to \Omega^1(M), & [\alpha,\beta]_{\pi_S}:=\mathscr{L}_{\pi_S^{\sharp}(\alpha)}\beta-\iota_{\pi_S^{\sharp}(\beta)}\mathrm{d}\alpha \end{align*}stands for the bracket induced by $\pi_S$ on one-forms on $S$. A coupling data induces first of all a Lie algebroid structure on $A:=T^*S\oplus \mathfrak{k}$, with anchor $\rho(\alpha,\xi):=\pi_S^{\sharp}(\alpha)$ and Lie bracket: \begin{equation* [(\alpha,\xi),(\beta,\eta)]:=([\alpha,\beta]_{\pi_S},[\xi,\eta]_{\mathfrak{k}}+\nabla_{\pi_S^{\sharp}(\alpha)}\eta-\nabla_{\pi_S^{\sharp}(\beta)}\xi+U(\alpha,\pi_S^{\sharp}(\beta))). \end{equation*} As the formula for the bracket shows, we have a short exact sequence of Lie algebroids \[0\longrightarrow (\mathfrak{k},[\cdot,\cdot]_{\mathfrak{k}})\longrightarrow (A,[\cdot,\cdot])\longrightarrow (T^*S,[\cdot,\cdot]_{\pi_S})\longrightarrow 0.\] Secondly, the coupling data induces a Poisson structure $\pi_0$, which is a \textbf{linear model}. It is defined on the neighborhood of $S$ in $\mathfrak{k}^*$, consisting of points $z\in \mathfrak{k}^*$ where the map $\mathrm{Id}+\langle z, U\rangle:T^*_{p(z)}S\to T^*_{p(z)}S$ is invertible, and is given by \[\pi_0=\pi_{\mathfrak{k}}+\mathrm{hor}(\gamma),\] where $\pi_{\mathfrak{k}}$ is the vertical, fiberwise linear Poisson structure on $\mathfrak{k}^*$, $\mathrm{hor}$ denotes the horizontal lift with respect to $\nabla$ and $\gamma\in \wedge^2 TS$ \[\gamma_z^{\sharp}=\pi_S^{\sharp}\circ (\mathrm{Id}+\langle z, U\rangle)^{-1}.\] \begin{example}\label{ex:principal:type}\rm A principal $G$-bundle $P\to S$ gives rise to a transitive Lie algebroid, $A(P):=TP/G$, with bracket coming from the Lie bracket on $G$-invariant vector fields: \[\Gamma(A(P))\simeq \mathfrak{X}^1(P)^G.\] Being transitive means that $A(P)$ fits into a sort exact sequence: \begin{equation}\label{eq:sesAtiyah} 0\longrightarrow \mathfrak{k}\longrightarrow A(P)\stackrel{\rho}{\longrightarrow} TS\longrightarrow 0, \end{equation} where $\rho$ denotes the anchor of $A(P)$. The bundle of isotropy Lie algebras can be canonically identified with the bundle adjoint bundle $P\times_G\gg\simeq \mathfrak{k}$, and the map at the level of sections is given by: \[\xi\in C^{\infty}(P;\gg)^G\mapsto \tilde{\xi}\in \mathfrak{X}(P)^G,\quad \tilde{\xi}_{x}:=\mathrm{a}_P(\xi_x),\] where we think of sections of $P\times_G\gg$ as $G$-equivariant maps $P\to \gg$, and we regard sections of $\mathfrak{k}$ as $G$-invariant vertical vector fields on $P$. We will use this isomorphism to further identify $\mathfrak{k}=P\times_G\gg$. However, note that under this identification the Lie bracket $[\cdot,\cdot]_{\mathfrak{k}}$ corresponds to the opposite of the fiber-wise Lie bracket on $P\times_G \gg$ coming from $\gg$, i.e., \begin{equation}\label{the_other_bracket} [\xi,\eta]_{\mathfrak{k},x}=-[\xi_x,\eta_x]_{\gg}. \end{equation} Principal connections on $P$ are in 1-to-1 correspondence with splittings of the short exact sequence \eqref{eq:sesAtiyah}. Fix a principal connection $\theta$. The corresponding splitting sends $X\in \mathfrak{X}(S)$ to its horizontal lift $\mathrm{h}_{\theta}(X)$. Under the resulting isomorphism $A(P)\simeq TS\oplus \mathfrak{k}$ the Lie bracket of $A(P)$ takes the form: \begin{equation* [(X,\xi),(Y,\eta)]:=([X,Y],[\xi,\eta]_{\mathfrak{k}}+\nabla_{X}\eta-\nabla_{Y}\xi+\mathrm{R}_{\theta}(X,Y)), \end{equation*} where $\nabla$ is a linear connection on $\mathfrak{k}$ and $\mathrm{R}_{\theta}\in\Omega^2(S;\mathfrak{k})$ is the curvature of $\theta$. The Jacobi identity for the bracket implies the following relations for all $X,Y,Z\in \mathfrak{X}^1(S)$, $\xi,\eta\in \Gamma(\mathfrak{k})$: \begin{enumerate} \item[(P1)] the connection $\nabla$ preserves the Lie bracket $[\cdot,\cdot]_{\mathfrak{k}}$, i.e., \[\nabla_{X}[\xi,\eta]_{\mathfrak{k}}=[\nabla_{X}\xi,\eta]_{\mathfrak{k}}+[\xi,\nabla_{X}\eta]_{\mathfrak{k}};\] \item[(P2)] the curvatures of $\nabla$ and $\theta$ are related by: \[\nabla_{X}\nabla_{Y}-\nabla_{Y}\nabla_{X}-\nabla_{[X,Y]}=[\mathrm{R}_{\theta}(X,Y),\cdot ]_{\mathfrak{k}};\] \item[(P3)] $\mathrm{R}_{\theta}$ satisfies the second Bianchi identity: \begin{equation*} \nabla_{X}\mathrm{R}_{\theta}(Y,Z)+\mathrm{R}_{\theta}([X,Y],Z)+c.p.=0. \end{equation*} \end{enumerate} The equations above imply that the pair $(\nabla,U)$, where \[U(\alpha,X):=\mathrm{R}_{\theta}(\pi_S^{\sharp}(\alpha),X)\] is a coupling data for the bundle of Lie algebras $\mathfrak{k}=P\times_G\gg$ and $(S,\pi_S)$, for any Poisson structure $\pi_S$ on the base. The resulting Lie algebroid is isomorphic to the product $A(P)\times_{TS}T^*S$. The resulting linear model is precisely the Poisson structure obtained in Corollary \ref{corollary:global:form}, where we note that, by \eqref{the_other_bracket}, we have that $\pi_{\mathfrak{k}}=-\pi^{\mathrm{v}}$. These special linear models, coming from principal bundles, are called of \emph{principal type} in \cite{FeMa22}. \end{example} We put now these construction into the context of local models around Poisson submanifolds. Consider a Poisson submanifold $(S,\pi_S)$ of a Poisson manifold $(M,\pi_M)$. The restriction to $S$ of the Lie algebroid $T^*M$ fits into a short exact sequence of Lie algebroids: \begin{equation}\label{eq:short:exact:sequence} 0\longrightarrow \mathfrak{k}\longrightarrow T^*_SM\longrightarrow T^*S\longrightarrow 0, \end{equation} where the bundle of Lie algebras $\mathfrak{k}$ can be identified with the conormal bundle of $S$ in $M$. This short exact sequence is a geometric way of encoding the \emph{first order jet} of $\pi$ along $S$. We call the short exact sequence \textbf{partially split} if there exist: \begin{itemize} \item a coupling data $(\nabla,U)$ for $\mathfrak{k}$ and \item a vector bundle splitting of \eqref{eq:short:exact:sequence} which induces a Lie algebroid isomorphism $T^*_SM\simeq T^*S\oplus \mathfrak{k}$, where $T^*S\oplus \mathfrak{k}$ is endowed with the Lie algebroid structure coming from $(\nabla,U)$. \end{itemize} If this is the case, then the corresponding linear model $(O,\pi_0)$, where $S\subset O\subset \mathfrak{k}^*$, is a first order approximation of $\pi$ around $S$, in the sense that \begin{itemize} \item $(S,\pi_S)$ is a Poisson submanifold of $(O,\pi_0)$; \item the short exact sequences of the restricted Lie algebroids are isomorphic. \end{itemize} Moreover, if $T^*_SM$ is partially split, then different coupling data produce linear models that are isomorphic around $S$. The Poisson manifold $(M,\pi_M)$ is said to be \textbf{linearizable} around the Poisson submanifold $(S,\pi_S)$ if its short exact sequence \eqref{eq:short:exact:sequence} is partially split, and a neighborhood of $S$ in $(M,\pi_M)$ is Poisson-diffeomorphic to a neighborhood of $S$ in the linear model $(O,\pi_0)$. Since any linear model is linearizable, using Example \ref{ex:principal:type}, Corollary \ref{corollary:global:form} and the Main Theorem, we obtain Corollary \ref{corollary:linearizable} from the Introduction. \section{Other values of the moment map}\label{sec : Other values of the moment map} The Main Theorem has a natural generalization to other values of the moment map. First, we explain the conditions on the value, and some of its consequences. \subsection*{Conditions on the value of the moment map} Let $\lambda \in \gg^*$. We denote by $G_{\lambda}$ the stabilizer of $\lambda$ with respect to the coadjoint action, and by $\mathcal{O}_{\lambda}=G\cdot \lambda$ the coadjoint orbit through $\lambda$, which comes equipped with its symplectic form $\omega_{{\lambda}} \in \Omega^2(\mathcal{O}_{\lambda})$. We will assume that $\lambda$ satisfies two assumptions, which we call \emph{split} and \emph{slice}; for a detailed discussion of these conditions, see Section 2.3.1 in \cite{GLS96}. \begin{itemize} \item [($\lambda$1)] \textbf{Split:} the Lie subalgebra $\gg_{\lambda}\subset \gg$ has a $G_{\lambda}$-invariant complement $\mathfrak{c}\subset \gg$. \end{itemize} This condition on $\lambda$ is called \emph{split} in \cite{GLS96}, \emph{reductive} in \cite{Montgomery}, and \emph{Molino's condition} in \cite{Wein85E}. We denote by $q:\gg \to \gg_{\lambda}$ the $G_{\lambda}$-equivariant projection associated with the decomposition $\gg=\gg_{\lambda}\oplus\mathfrak{c}$. We will use more often the affine inclusion: \begin{equation}\label{eq:j:map} j:\gg^*_{\lambda}\hookrightarrow \gg^*,\qquad j(\xi)=\lambda+q^*(\xi). \end{equation} Since $j(\gg_{\lambda}^*)$ is a transverse and complementary to the orbit $\mathcal{O}_{\lambda}$, it follows that a neighborhood of $\lambda$ in $j(\gg_{\lambda}^*)$ is a Poisson transversal \cite{Frejlich_Marcut}. It is well-known \cite{Molino,Wein85E} that the induced Poisson structure on the Poisson transversal is linearizable around $\lambda$ via the isomorphism $j$. Moreover, $j(\gg_{\lambda}^*)$ is a Poisson-Dirac submanifold \cite[Illustration 2]{PT1.5}, and globally we have that: \[ j^!\mathrm{Gr}(\pi_{\gg}) = \mathrm{Gr}(\pi_{\gg_{\lambda}}). \] The abstract normal bundle of the orbit $\mathcal{O}_{\lambda}$ is $G$-equivariantly isomorphic to $G\times_{G_{\lambda}}\gg^*_{\lambda}$. In fact $j$ induces a $G$-equivariant ``exponential map'': \begin{align*} & \epsilon: G \times_{G_{\lambda}} \gg_{\lambda}^* \longrightarrow \gg^*, & \epsilon([g,\xi]):= g \cdot j(\xi). \end{align*} This map is called \emph{Molino's exponential map} in \cite[\S 1.3.]{Montgomery}, where the Poisson structure corresponding to $\epsilon^!\mathrm{Gr}(\pi_{\gg})$ is described in detail. In particular, it is shown that this Poisson structure coincides with the construction from Proposition \ref{proposition_coupling_Poisson} for the principal $G_{\lambda}$-bundle $P:=G$ over the symplectic manifold $(S,\pi_S):=(\mathcal{O}_{\lambda},\omega_{\lambda}^{-1})$, and moreover that this Poisson structure blows up exactly at the critical points of $\epsilon$. We prove next a related property: \begin{lemma}\label{lemma:split} The following three properties describe the same $G_{\lambda}$-invariant, open neighborhood \[0\in \mathcal{T}_{\mathrm{max}}\subset \gg^{*}_{\lambda}:\] \begin{enumerate}[i)] \item the points $\xi\in \gg_{\lambda}^*$ for which $j(\gg_{\lambda}^*)$ is a Poisson transversal around $j(\xi)$; \item the points $\xi\in \gg_{\lambda}^*$ for which $[g,\xi]\in G\times_{G_{\lambda}}\gg^*_{\lambda}$ is a regular point of $\epsilon$, for some (and hence all) $g\in G$; \item the points $\xi\in \gg_{\lambda}^*$ for which $\gg_{j(\xi)}\subset \gg_{\lambda}$. \end{enumerate} \end{lemma} \begin{proof} By \cite[Illustration 2]{PT1.5}, we have the following decomposition of $\pi_{\gg}$ along $j(\gg_{\lambda}^*)$: \begin{equation}\label{P_along_PT} \pi_{\gg,j(\xi)}(v_1+w_1,v_2+w_2) = \pi_{\gg_{\lambda},\xi}(v_1,v_2)+\pi_{\gg,j(\xi)}(w_1,w_2), \end{equation} where $v_1,v_2 \in \gg_{\lambda}$ and $w_1,w_2 \in \mathfrak{c}$. Hence $j(\gg_{\lambda}^*)$ is a Poisson transversal at $j(\xi)$, \[ T_{j(\xi)}\gg^* = T_{j(\xi)}j(\gg_{\lambda}^*) \oplus \pi^{\sharp}_{\gg,j(\xi)}(N^*j(\gg_{\lambda}^*)), \]exactly when the following 2-form is non-degenerate: \begin{align*} & \eta_{\xi} \in \wedge^2\mathfrak{c}^*, & \eta_{\xi}(w_1,w_2):=\pi_{\gg,j(\xi)}(w_1,w_2). \end{align*} Since $\epsilon$ is $G$-equivariant, $[g,\xi]$ is a regular point of $\epsilon$ if and only if $[1,\xi]$ is a regular point of $\epsilon$. Under the canonical identification \[\mathfrak{c}\oplus \mathfrak{c}^{\circ}\simeq T_{[1,\xi]}(G\times_{G_{\lambda}}\gg_{\lambda}^*),\] the differential of $\epsilon$ becomes: \begin{align*} & \epsilon_*[w,\zeta] = -\mathrm{a}_{\gg^*}(w)+\zeta, & (w,\zeta) \in \mathfrak{c} \times \mathfrak{c}^{\circ}. \end{align*} Therefore elements in $\ker \epsilon_{*,[1,\xi]}$ are of the form $[w,\mathrm{a}_{\gg^*}(w)]$, with $\mathrm{a}_{\gg^*}(w)\in \mathfrak{c}^{\circ}$. Since $\mathrm{a}_{\gg^*}(w)=\pi_{\gg,j(\xi)}^{\sharp}(w)$, by \eqref{P_along_PT}, this last condition is equivalent to $w\in \ker\eta_{\xi}$. So i) and ii) describe the same set. Finally, using that the stabilizer Lie algebra of a point in $\gg^*$ coincides with the Poisson-geometric isotropy Lie algebra, and the explicit description of $\pi_{\gg}$ \eqref{P_along_PT}, we obtain \[\gg_{j(\xi)}=\ker(\pi_{\gg})_{j(\xi)}=(\gg_{\lambda})_{\xi}\oplus \ker \eta_{\xi}\subset \gg_{\lambda}\oplus\mathfrak{c}.\] Hence $\gg_{j(\xi)} \subset \gg_{\lambda}$ iff $\eta_{\xi}$ is nondegenerate. Hence items i) and iii) describe the same set. \end{proof} In addition to ($\lambda$1), we will assume also the following, stronger condition on $\lambda$: \begin{itemize} \item[($\lambda$2)] \textbf{Slice:} the point $\lambda$ admits an \emph{(affine) slice}, i.e., there is an open, $G_{\lambda}$-invariant set \[0\in \mathcal{T} \subset \gg_{\lambda}^*\] with the property that $j(\mathcal{T})$ is a slice for the action --- meaning that, for $g\in G$, \[j(\mathcal{T})\cap (g\cdot j(\mathcal{T}))\neq \emptyset\quad \implies \quad g\in G_{\lambda}.\] \end{itemize} It is easy to see that the slice condition is equivalent to the restriction \begin{equation}\label{eq:exp:rest} \epsilon: G\times_{G_{\lambda}}\mathcal{T}\longrightarrow \gg^* \end{equation} being injective. We also note the following: \begin{lemma} Any slice $\mathcal{T}$ is contained in the set $\mathcal{T}_{\mathrm{max}}$ defined in Lemma \ref{lemma:split}. Hence $j(\mathcal{T})$ is a Poisson transversal, and the exponential map $\epsilon$ restricts to a $G$-equivariant diffeomorphism, from $G\times_{G_{\lambda}}\mathcal{T}$ onto its image. In particular, the orbit $\mathcal{O}_{\lambda}$ is an embedded submanifold. \end{lemma} \begin{proof} Take $v\in \gg_{j(\xi)}$, with $\xi\in \mathcal{T}$. Then, for all $t\in \mathbb{R}$, we have that \[g_t\cdot j(\xi)=j(\xi)\in j(\mathcal{T})\cap (g_t\cdot j(\mathcal{T})),\] where $g_t$ denotes $\exp(t v)$. By the slice condition, it follows that $g_t\in G_{\lambda}$. Hence $\gg_{j(\xi)}\subset \gg_{\lambda}$, so item iii) in Lemma \ref{lemma:split} holds. By item i), $j(\mathcal{T})$ is a Poisson transversal. By item ii) it follows that $\epsilon$ is a local diffeomorphism on $G\times_{G_{\lambda}}\mathcal{T}$, and since it is injective, it is a diffeomorphism onto its image. \end{proof} Finally, let us remark that conditions ($\lambda$1) and ($\lambda$2) hold, for example, when $G$ is compact (see Section 2.3.2 in \cite{GLS96} for an explicit slice in this case) and, more generally, when the action of $G$ is proper at $\lambda$. There are other cases when these conditions hold, for example, when $\lambda=0$. \subsection*{Reducing to the slice} Consider a Poisson Hamiltonian space \[ G\curvearrowright (M,\pi)\stackrel{\mu}{\longrightarrow}\gg^* \] and $\lambda\in \gg^*$ a value of the moment map which satisfies conditions ($\lambda$1) and ($\lambda$2). Since $j(\mathcal{T})$ is a Poisson transversal, the Poisson map $\mu:M \to \gg^*$ is transverse to it, its pullback \[ X:=\mu^{-1}(j(\mathcal{T})) \] is again a Poisson transversal in $(M,\pi)$, and the induced map \begin{align*} & \mu_X : (X,\pi_X) \longrightarrow (\gg_{\lambda}^*,\pi_{\gg_{\lambda}}), & \mu_X:=j^{-1}\circ \mu|_X \end{align*} is again a Poisson map \cite[Lemma 2]{Frejlich_Marcut}.s In fact, \begin{equation}\label{eq:restriction:of:Ham:space} G_{\lambda} \curvearrowright (X,\pi_X) \stackrel{\mu_X}{\longrightarrow} \gg_{\lambda}^* \end{equation} is a Poisson Hamiltonian space. In the next subsection, we will make extra assumptions of this Poisson Hamiltonian space, in order to apply the Main Theorem to it. Before that, we show that this Poisson Hamiltonian space determines the original Hamiltonian space around $X$. \begin{proposition}\label{prop:restr:slice} Consider a Poisson Hamiltonian space \begin{equation} \label{Poisson_Ham_space2} G\curvearrowright (M,\pi)\stackrel{\mu}{\longrightarrow}\gg^*, \end{equation} and a value of the moment map $\lambda\in \gg^*$ which satisfies conditions ($\lambda$1) and ($\lambda$2). \begin{enumerate}[a) ] \item With the notation introduced above, the map \[\varphi: G\times_{G_{\lambda}}X\longrightarrow M,\quad [g,x]\mapsto g\cdot x\] is a $G$-equivariant diffeomorphism onto a $G$-invariant neighborhood of $X$ in $M$. \item Denote by $p_{\lambda}:G\times X\to G\times_{G_{\lambda}}X$ and $p_X:G\times X\to X$ the projections, and by $\pi_0$ be the pullback by $\varphi$ of the Poisson structure $\pi$ on $M$: $\varphi^!\mathrm{Gr}(\pi)=\mathrm{Gr}(\pi_0)$. Then $\pi_0$ is determined by the equality of Dirac structures on $G\times X$: \[p^!_{{\lambda}}\mathrm{Gr}(\pi_0)=\mathcal{R}_{\mathrm{d} \alpha}p_{X}^!\mathrm{Gr}(\pi_X),\] where $\alpha$ is the one-form given by: \[\alpha(V,U)=\langle j\circ \mu_X(x),\theta_G^l(V) \rangle, \qquad (V,U)\in T_{g}G\times T_xX, \] and where $\theta_G^l$ denotes left-invariant Maurer Cartan form on $G$. \item Hence, equipped the with moment map \[\mu_0:=\mu\circ \varphi, \quad \mu_0([g,x])=g\cdot (j\circ \mu_X(x)),\] we obtain a Poisson Hamiltonian space \[G\curvearrowright (G\times_{G_{\lambda}}X,\pi_0)\stackrel{\mu_0}{\longrightarrow}\gg^*,\] which is isomorphic around $X$ to the Poisson Hamiltonian space \eqref{Poisson_Ham_space2}. \end{enumerate} \end{proposition} \begin{remarks}\normalfont \begin{enumerate}[(1)] \item For a symplectic version of this result, see Corollary 2.3.6 and Theorem 2.3.7 in \cite{GLS96} \item The reader might have noticed that the map $j\circ \mu_X: X\to \gg^*$ is just the restriction $\mu|_X$. The more cumbersome notation was used in order to emphasize that the construction of the Poisson structure and moment map on $G\times_{G_{\lambda}}X$ depends only on the $G_{\lambda}$-Poisson Hamiltonian space \eqref{eq:restriction:of:Ham:space} and the affine map $j:\gg_{\lambda}^*\hookrightarrow \gg^*$ inducing the slice. \item The proposition provides a recipe of how to ``extend'' a $G_{\lambda}$-Poisson Hamiltonian space to a $G$-Hamiltonian space, once an affine slice has been fixed. \item As opposed to our Main Theorem, this proposition holds also in the holomorphic or algebraic setting, because the isomorphism does not depend on choosing a connection or on the existence of some splitting; it depends only on the existence of the affine slice. \end{enumerate} \end{remarks} \begin{proof} We start by proving the form from the statement of the pullback of $\mu$: \[\mu\circ \varphi([g,x])=\mu(g\cdot x)=g\cdot \mu(x)=g\cdot (j\circ \mu_X(x)),\] where we used $G$-equivariance of $\mu$. Hence, we have a commutative diagram of $G$-equivariant maps: \[ \xymatrix{ G\times_{G_{\lambda}} X \ar[r]^{\varphi}\ar[d]_{\mathrm{id}\times \mu_X}\ar[dr]^{\mu_0} & M \ar[d]^{\mu}\\ G\times_{G_{\lambda}}\mathcal{T} \ar[r]^{\epsilon} & \gg^*. } \] Next, we show that $\varphi$ is injective. By commutativity of the diagram and the fact that $\epsilon$ is injective, we have that $\varphi([g,x])=\varphi([h,y])$ implies that $[g,\mu_X(x)]=[h,\mu_X(y)]$ in $G\times_{G_{\lambda}}\mathcal{T}$, and so $h=gk$, with $k\in G_{\lambda}$. Then $\varphi([g,y])=\varphi([h,y])$ implies that $g\cdot x=gk\cdot y$, and so $x=k\cdot y$. Hence $[g,x]=[h,y]$. We show that $\varphi$ is a diffeomorphism onto its image. Since it is injective, it suffices to show that its differential is invertible, and by $G$-equivariance, it suffices to show this along $X$. Moreover, note that, since $\mu$ is transverse to $\mathcal{T}$, it follows that: \[\mathrm{codim}_M(X)=\mathrm{codim}_{\gg^*}(j(\mathcal{T}))=\mathrm{codim}_{\gg}(\gg_{\lambda})=\mathrm{codim}_{G}(G_{\lambda}).\] Hence the dimensions match, and so it suffices to show that $\varphi_*$ is injective at points in $X$. Let $v\in \gg$ and $U\in T_xX$ be such that $[v,U]\in T_{[e,x]}(G\times_{G_{\lambda}}X)$ is in the kernel of $\varphi_*$. Using commutativity of the diagram and that $\epsilon_*$ is invertible, it follows that $[v,(\mu_X)_*U]=0$, hence $v\in \gg_{\lambda}$, so by changing representatives, we may assume that $v=0$. But then $\varphi_*[0,U]=i_*U=0$, where $i:X\hookrightarrow M$ is the inclusion, and so $U=0$. This concludes the proof that $\varphi$ is a diffeomorphism onto its image. Next consider the Dirac structure on $G\times X$ given by: \[D:=p_{\lambda}^! \varphi^! \mathrm{Gr}(\pi).\] This Dirac structure has the following properties: \begin{enumerate}[1.] \item $D$ is invariant under the action of $G$ \begin{align*} & G \curvearrowright G \times X, & g \cdot (g',x):=(gg',x) \end{align*} \item $D$ is Hamiltonian for this action of $G$, with moment map $\mu_0\circ p_{\lambda}$: \[ G \curvearrowright (G \times X,D) \stackrel{\mu_0p_{\lambda}}{\longrightarrow} \gg^*, \]that is: for all $v \in \gg$, we have that \begin{align*} & \mathrm{a}_{G\times X}(v)+(\mu_0p_{\lambda})^*(v) \in \Gamma(D). \end{align*} \item The fibres of $\mathrm{pr}_1 : G \times X \to G$ are Poisson transversals in $(G \times X,D)$, and the induced Poisson structure on the fibres is $\pi_X$. \end{enumerate} The first property follows because $\mathrm{Gr}(\pi)$ is $G$-invariant and both $p_{\lambda}$ and $\varphi$ are $G$-equivariant. Because \[ G \curvearrowright (G\times_{G_{\lambda}}X,\varphi^!\mathrm{Gr}(\pi)) \stackrel{\mu_0}{\longrightarrow} \gg^*\] is a Dirac Hamiltonian space, that is, \[\mathrm{a}_{G\times_{G_{\lambda}}X}(v)+\mu_0^*(v) \in \varphi^!\mathrm{Gr}(\pi)\] for all $v \in \gg$, and since \[(p_{\lambda})_*\mathrm{a}_{G\times X}(v)=\mathrm{a}_{G\times_{G_{\lambda}}X}(v),\] property 2 follows. Moreover, we obtain an injective vector bundle map \begin{align*} & a : \gg\times G \times X \longrightarrow D, & a(v,g,x):=\mathrm{a}_{G\times X}(v)_{(g,x)}+(\mu_0p_{\lambda})^*(v)_{(g,x)} \in D_{(g,x)}. \end{align*} This implies also that the fibres of $G \times X \to G$ are Dirac transversals for $D$. Because the composition of $\varphi \circ p_{\lambda}:G \times X \to M$ with \[i_{1} : X \to G \times X, \qquad i_1(x)=(1,x),\] is just the inclusion $X\hookrightarrow M$, it follows that the fibre $\{1\} \times X$ is a Poisson transversal with induced Poisson structure $\pi_X$. By property 1, the same holds for every fibre $\{g\} \times X$, so property 3 holds. Since $(\{1\} \times X,\pi_X)$ is a Poisson transversal in $(G \times X,D)$, for any $\xi\in T^*_xX$ there exists a unique element $b(\xi)\in D_{(1,x)}$ which is $i_1$ related to $\pi_X^{\sharp}\xi+\xi\in \mathrm{Gr}(\pi_X)$. We claim that \begin{align*} b(\xi) = ((j \circ \mu_X)_*\pi_X^{\sharp}(\xi),\pi_X^{\sharp}(\xi)+\xi). \end{align*} Note that any element in $\mathbb{T}_{(1,x)}(G\times X)$ which is $i_1$-related to $\pi_X^{\sharp}(\xi)+\xi$ must take the form $b'(\xi):=(\beta_{\xi},\pi_X^{\sharp}(\xi)+\xi)$ for some $\beta_{\xi} \in \gg^*$, and if such an element were to lie in $D_{(1,x)}$, then \begin{align*} \langle b'(\xi), a(v)\rangle = -\langle \beta_{\xi},v\rangle +\langle (\mu_0p_{\lambda})_*\pi_X^{\sharp}(\xi),v\rangle = -\langle \beta_{\xi},v\rangle +\langle (j \circ \mu_X)_*\pi_X^{\sharp}(\xi),v\rangle \end{align*}must vanish for all $v \in \gg$, which is to say that $b'(\xi)=b(\xi)$. By property 1, we get an injective vector bundle map \begin{align*} & b : G \times T^*X \longrightarrow D, & b(g,\xi):=g_*b(\xi). \end{align*} It is easy to see that $a$ and $b$ are transverse, and by comparing ranks, we obtain an isomorphism: \begin{align*} &\gg \times G \times T^*X \xrightarrow{\raisebox{-0.2 em}[0pt][0pt]{\smash{\ensuremath{\sim}}}} D, & (v,g,\xi) \mapsto a(v,g,x)+b(g,\xi). \end{align*} Next, we prove the formula for $D$ from item b) in the statement: \begin{align} D = \mathcal{R}_{\mathrm{d}\alpha}p_X^!\mathrm{Gr}(\pi_X), \end{align} where $\alpha \in \Omega^1(G \times X)$ is the unique one-form with the property that \begin{align*} & \alpha(v^L,U):=\langle j \circ \mu_X,v\rangle, & (v,U) \in \gg \times T_xX, \end{align*}where $v^L$ denotes the extension of $v \in \gg$ of a left-invariant vector field on $G$. This one-form is $G$-invariant, and, for all $v_1,v_2\in \gg$ and $U_1,U_2\in \mathfrak{X}(X)$, $\mathrm{d}\alpha$ reads \begin{align}\label{eq:d:alpha} \mathrm{d} \alpha((v_1^L,U_1),(v_2^L,U_2))&= \langle (j\circ \mu_X)_* U_1,v_2\rangle - \langle (j\circ \mu_X)_* U_2,v_1\rangle-\langle j\circ \mu_X ,[v_1,v_2]\rangle. \end{align} This implies that \begin{align*} \iota_{\pi_X^{\sharp}(\xi)}\mathrm{d} \alpha_{(1,x)} = (j\circ \mu_X)_*\pi_X^{\sharp}(\xi)_x, \end{align*} and so: \[b(\xi)=\mathcal{R}_{\mathrm{d}\alpha}\circ \mathcal{R}_{(0,\pi_X)}(0,\xi)\in \mathcal{R}_{\mathrm{d}\alpha}p_X^!\mathrm{Gr}(\pi_X), \] and by property 1, $g_*b(\xi)\in \mathcal{R}_{\mathrm{d}\alpha}p_X^!\mathrm{Gr}(\pi_X)$. In fact, fix $w\in \gg$, $U\in \mathfrak{X}(X)$ and denote by $\phi_{U}^t$ the local flow of $U$. Then, at $(1,x)$, we have that \begin{align*} \langle (\mu_0\circ p_{\lambda})^*(v),(w^L,U)\rangle_{(1,x)} & = \langle (\mu_0\circ p_{\lambda})_*(w,U),v\rangle\\ &=\tfrac{\mathrm{d}}{\mathrm{d} t}\big|_{t=0}\langle \mu_0\circ p_{\lambda}(\exp(tw),\phi_{U}^t(x)),v\rangle\\ &=\tfrac{\mathrm{d}}{\mathrm{d} t}\big|_{t=0}\langle \exp(tw)\cdot j\circ \mu_X(\phi_{U}^t(x)),v\rangle\\ &=\tfrac{\mathrm{d}}{\mathrm{d} t}\big|_{t=0}\langle j\circ \mu_X(\phi_{U}^t(x)), \exp(-tw)\cdot v\rangle\\ &=\langle (j\circ \mu_X)_*U, v\rangle+\langle j\circ \mu_X, [v,w]\rangle\\ &=\left(-\iota_{v^L}\mathrm{d} \alpha(w^L,U)\right)_{(1,x)}. \end{align*} Because $-(v^L,0)$ coincides with $\mathrm{a}_{G \times X}(v)$ at points of the form $(1,x) \in G \times X$, we have that \begin{align*} a(v)_{(1,x)} = \mathrm{a}_{G \times X}(v)_{(1,x)} + (\mu_0\circ p_{\lambda})_{(1,x)}^*(v) \in \mathcal{R}_{\mathrm{d}\alpha}p_X^!\mathrm{Gr}(\pi_X)_{(1,x)}. \end{align*} Therefore, $G$-invariance of $\mathcal{R}_{\mathrm{d}\alpha}p_X^!\mathrm{Gr}(\pi_X)$ and $G$-equivariance of the moment map $\mu_0\circ p_{\lambda}$ imply: \begin{align*} a(v)_{(g,x)} = g_*a(g^{-1} \cdot v)_{(1,x)} \in \mathcal{R}_{\mathrm{d}\alpha}p_X^!\mathrm{Gr}(\pi_X)_{(g,x)}. \end{align*} We conclude that the sections $a(v)$ and $b(\xi)$ which span $D$ lie in fact in $\mathcal{R}_{\mathrm{d}\alpha}p_X^!\mathrm{Gr}(\pi_X)$, from which it follows that these two Dirac structures coincide: \[ \mathcal{R}_{\mathrm{d}\alpha}p_X^!\mathrm{Gr}(\pi_X) = D.\qedhere \] \end{proof} \subsection*{The normal form theorem} Next, we give a normal form theorem around more general values of the moment map. As before, we consider a principal Hamiltonian $G$-space \begin{equation}\label{Poisson_Ham_space2_again} G\curvearrowright (M,\pi)\stackrel{\mu}{\longrightarrow}\gg^*. \end{equation} For any $\lambda\in \mu(M)$, we have the principal $G_{\lambda}$-bundle $P_{\lambda}:=\mu^{-1}(\lambda)$ over $S_{\lambda}:=\mu^{-1}(\lambda)/G_{\lambda}$. The base manifold $S_{\lambda}$ has an induced Poisson structure $\pi_{S_{\lambda}}$, characterized by the following condition: \begin{align*} & p_{S_{\lambda}}^!\mathrm{Gr}(\pi_{S_{\lambda}})=i^!\mathrm{Gr}(\pi), \end{align*} where $p_{S_\lambda}:P_{\lambda} \to S_{\lambda}$ is the projection and $i:P_{\lambda}\hookrightarrow M$ is the inclusion. The normal form theorem shows that, for special values $\lambda$, the data \begin{align*}\label{eq:datum} & G_{\lambda}\curvearrowright P_{\lambda}\stackrel{p_{\lambda}}{\longrightarrow} (S_{\lambda},\pi_{S_{\lambda}}) \end{align*} can be used to reconstruct the Poisson Hamiltonian $G$-space \eqref{Poisson_Ham_space2_again} around $\mu^{-1}(\lambda)$. \begin{theorem}\label{thm : normal form other values} For $\lambda\in \gg^*$ satisfying ($\lambda$1) and ($\lambda$2), any principal Hamiltonian $G$-space \eqref{Poisson_Ham_space2_again} is isomorphic around $P_{\lambda}$ to the Hamiltonian Poisson space \[ G \curvearrowright \left((G\times P_{\lambda}\times \gg_{\lambda}^*)/G_{\lambda},\overline{D}\right)\stackrel{\overline{\mu}}{\longrightarrow} \gg^*, \] where the moment map is given by \[\overline{\mu}([g,x,\xi])=g\cdot j(\xi),\] and the Dirac structure $\overline{D}$ is determined by the condition that its pullback via $p_{\lambda}:G\times P_{\lambda}\times \gg_{\lambda}^*\to (G\times P_{\lambda}\times \gg_{\lambda}^*)/G_{\lambda}$ is given by \[p_{\lambda}^!\overline{D}=\mathcal{R}_{\mathrm{d}(\alpha-\widetilde{\theta}_{\lambda})}p_{S_{\lambda}}^!\mathrm{Gr}(\pi_{S_{\lambda}}),\] where $\widetilde{\theta}_{\lambda} \in \Omega^1(P_{\lambda} \times \gg_{\lambda}^*)$ is the one-form corresponding to a principal $G_{\lambda}$-connection $\theta_{\lambda} \in \Omega^1(P_{\lambda};\gg_{\lambda})$, and the one-form $\alpha \in \Omega^1(G \times \gg_{\lambda}^*)$ is given by \begin{align*} & \alpha(V,\eta)_{(g,\xi)}=\langle j(\xi), (g^{-1})_*V\rangle, & (V,\eta) \in T_gG \times T_{\xi}\gg_{\lambda}^*. \end{align*} \end{theorem} \begin{proof}[Proof of Theorem \ref{thm : normal form other values}] Using the notation of the previous subsection, we have a Poisson transversal $X:=\mu^{-1}(j(\mathcal{T}))$, and \begin{equation}\label{eq:restriction:of:Ham:space:2} G_{\lambda} \curvearrowright (X,\pi_X) \stackrel{\mu_X}{\longrightarrow} \gg_{\lambda}^* \end{equation} is a free and proper Poisson Hamiltonian space. Moreover, we have that: \[\mu_X^{-1}(0)=P_{\lambda},\] and clearly, the induced Poisson structure on the base $S_{\lambda}$ is $\pi_{S_{\lambda}}$. So we can apply the Main Theorem to \eqref{eq:restriction:of:Ham:space:2}, and we obtain that it is isomorphic around $P_{\lambda}$ to the Dirac Hamiltonian space: \[ G_{\lambda} \curvearrowright \left(P_{\lambda}\times \gg_{\lambda}^*,\mathcal{R}_{-\mathrm{d}\widetilde{\theta}_{\lambda}}p_{S_{\lambda}}^!\mathrm{Gr}(\pi_{S_{\lambda}})\right) \stackrel{\mathrm{pr}_2}{\longrightarrow} \gg_{\lambda}^*, \] where $\theta_{\lambda}$ is a $G_{\lambda}$-principal connection on $P_{\lambda}\to S_{\lambda}$. Next, we apply Proposition \ref{prop:restr:slice}, and conclude that a $G$-invariant neighborhood of $P_{\lambda}$ in $M$ is isomorphic, as a Poisson Hamiltonian space, to a $G$-invariant neighborhood of $P_{\lambda}$ in the Dirac Hamiltonian space: \[ G \curvearrowright \left((G\times P_{\lambda}\times \gg_{\lambda}^*)/G_{\lambda},\overline{D}\right)\stackrel{\overline{\mu}}{\longrightarrow} \gg^*, \] where the moment map is given by \[\overline{\mu}([g,x,\xi])=\epsilon ([g,\xi])=g\cdot j(\xi),\] and the Dirac structure is determined by the equality of Dirac structure on $G\times P_{\lambda}\times \gg_{\lambda}^*$: \[p_{\lambda}^!\overline{D}=\mathcal{R}_{\mathrm{d}(\alpha-\widetilde{\theta}_{\lambda})}p_{S_{\lambda}}^!\mathrm{Gr}(\pi_{S_{\lambda}}),\] and the 1-forms are given by \[\alpha(V,U,\eta)_{(g,x,\xi)}=\langle j(\xi), (g^{-1})_*V\rangle,\qquad \widetilde{\theta}_{\lambda}(V,U,\eta)_{(g,x,\xi)}=\langle\xi,{\theta}_{\lambda}(U)\rangle.\qedhere\] \end{proof} \begin{remark}\normalfont The extension to proper and infinitesimally free actions holds in this setting as well. \end{remark} \begin{remark}\normalfont Since the normal form holds on a $G$-invariant neighborhood, it can be seen also as a normal form around the preimage of the orbit \[Q_{\lambda}:=\mu^{-1}(\mathcal{O}_{\lambda})=\mu^{-1}(G\cdot \lambda).\] The theorem provides a $G$-equivariant identifications: $(G\times P_{\lambda})/G_{\lambda}\simeq Q_{\lambda}$, and of the local model $(G\times P_{\lambda}\times \gg_{\lambda}^*)/G_{\lambda}$ with the normal bundle of $Q_{\lambda}$ in $M$. Moreover, since $\mathcal{O}_{\lambda}\subset \gg^*$ is a Poisson submanifold, it follows that $Q_{\lambda}$ is a coisotropic submanifold in $M$. The theorem implies that under the identification $Q_{\lambda}\simeq (G\times P_{\lambda})/G_{\lambda}$, the induced Dirac structure $\overline{D}_{\lambda}$ on $(G\times P_{\lambda})/G_{\lambda}$ has the property that its pullback to $G\times P_{\lambda}$ is given by \[\mathcal{R}_{\mathrm{d} \widetilde{\lambda}}p_{S_{\lambda}}^!\mathrm{Gr}(\pi_{S_{\lambda}}),\] where $\widetilde{\lambda}\in \Omega^1(G)$ is the left-invariant extension of $\lambda$ to $G$. This follows because, under the zero-section $i:G\times P_{\lambda}\hookrightarrow G\times P_{\lambda}\times \gg^{*}_{\lambda}$, we have that $i^*\alpha= \widetilde{\lambda}$ and $i^*\widetilde{\theta}_{\lambda} = 0$. Thus $((G\times P_{\lambda})/G_{\lambda}, \overline{D}_{\lambda})$ is a coisotropic Poisson transversal in the local model. Around such submanifolds the the local structure is determined, as shown in \cite[Section 4.3]{Geudens_2020}, and our local model is a more specialized version of this construction, where we also keep track of the $G$-action and the moment map. \end{remark}
\section*{Main} RF superconductors (\textit {e.g.}, Nb and Nb$_3$Sn) are primarily used in superconducting radio-frequency (SRF) resonators with ultra-high quality factors and high electromagnetic fields, enabling modern particle accelerators, quantum circuits, detectors, filters, and other emerging electronics \cite{SunRef1,SunRef72,SunRef20,SunRef17,SunRef28}. Three-dimensional SRF cavities (Fig.~S1a) are the resonant chamber with low-loss superconducting coatings coupled with narrow-bandwidth RF waves for accelerating charged particle beams and functioning as frequency- or mode-sensitive high-performance electronics. Instruments and devices based on SRF cavities find a wide range of applications \cite{SunRef20,SunRef70}, including photon science (\textit{e.g.}, hard X-ray free-electron lasers) \cite{SunRef21,SunRef22}, high-energy and nuclear physics (\textit{e.g.}, high-energy colliders and dark-matter detection) \cite{SunRef23,SunRef24}, advanced materials discovery, biopharmaceuticals, alongside emerging technologies in $<$\,5\,nm semiconductor device fabrication \cite{SunRef71} and quantum computing \cite{SunRef17,SunRef28,SunRef26}. \begin{table}[b] \centering \caption{Comparison of measured BCS resistances at multiple operation temperatures at the 1.3\,GHz frequency and low RF fields for typical Nb, nitrogen-doped Nb, vapor-diffused Nb$_3$Sn, and electrochemical Nb$_3$Sn. 2\,K Nb$_3$Sn values only reflect consistent comparisons, with uncertainties.} \begin{tabular}{|p{3cm}|p{3cm}|p{3cm}|p{3cm}|p{3cm}|} \hline Operation temperature & Typical Nb & Typical nitrogen-doped Nb & Typical vapor-diffused Nb$_3$Sn & Electrochemical Nb$_3$Sn (this work) \\ \hline 10\,K & - & - & 500\,--\,700\,n$\Omega$ \cite{SunRef74} & 300\,--\,400\,n$\Omega$ \\ \hline 4.2\,K & 900\,n$\Omega$ & 450\,n$\Omega$ & \,6\,--\,10\,n$\Omega$ \cite{SunRef18,SunRef74} & $\sim$\,3\,n$\Omega$\\ \hline 2\,K & 15\,n$\Omega$ & 8\,n$\Omega$ & $\sim$\,1\,n$\Omega$ \cite{SunRef18,SunRef74} & $<$\,1\,n$\Omega$ \\ \hline \end{tabular} \label{SunTable} \end{table} Development of Nb SRF cavities over the last decades has pushed their performance close to the theoretical limit of this material\cite{SunRef32}. In order to surpass this limit and exploit the existing technology, the research focus is shifting toward Nb-based alloys (Nb$_3$Sn, NbTiN, NbN) with higher critical temperatures ($T_\mathrm{c}$) and superheating fields \cite{SunRef35}. Nb$_3$Sn is expected to support large accelerating gradients ($E_\mathrm{acc}$) up to 100\,MV/m owing to the high predicted superheating field ($\sim$\,400\,mT \cite{SunRef19}) that doubles Nb's value ($\sim$\,200\,mT). Nb$_3$Sn $T_\mathrm{c}$ (18\,K) is notably higher than Nb (9\,K), which reduces surface resistance ($R_\mathrm{s}$) and thus boosts quality factors ($Q_\mathrm{0}$) following $Q_\mathrm{0}\,\propto\,1\,/\,R_\mathrm{s}$. $R_\mathrm{s}$ is a sum of residual resistance ($R_\mathrm{0}$) and temperature-dependent BCS resistance ($R_\mathrm{BCS}$) that exponentially depends on $T_\mathrm{c}$ ($R_\mathrm{BCS}\,\propto\,1\,/\,T\,\times\,\mathrm{exp}\,(-\,T_\mathrm{c}\,/\,T)$). Table~\ref{SunTable} shows the mitigation of BCS resistances by replacing Nb with Nb$_3$Sn, especially at high operation temperatures (4.2\,K). Moreover, higher $T_\mathrm{c}$ allows the replacement from costly helium cryogenics (2\,K operation) with specialized cryomodules to commercial cryocoolers (4.2\,K operation) \cite{SunRef34}, enabling turn-key, compact accelerators. These high-quality-factor, high-field, high-operation-temperature potentials motivate the efforts on building Nb$_3$Sn-based cavities; their performance capabilities have been demonstrated in a full-scale operation moving toward practical accelerator applications \cite{SunRef31}. \begin{figure}[b!] \centering \includegraphics[width=17 cm]{Figure_1_combined_v11.pdf} \caption{\textbf{Process flow combines electrochemistry and post annealing to achieve smoothness, stoichiometry, and purity in Nb$_3$Sn.} Inserts show pictures of (a) electrochemical and (b) vapor-diffused Nb$_3$Sn.} \label{SunFig1} \end{figure} However, surface roughness, \cite{SunRef3,SunRef4,SunRef6,SunRef14,SunRef18,SunRef35,SunRef38,SunRef39} non-stoichiometry, \cite{SunRef3,SunRef4,SunRef8,SunRef9,SunRef10,SunRef15,SunRef16,SunRef18,SunRef35,SunRef38,SunRef39,SunRef40} and impurities \cite{SunRef3,SunRef4,SunRef10,SunRef18,SunRef35,SunRef40} cause a variety of issues in Nb$_3$Sn. Surface peaks excessively enhance local magnetic fields \cite{SunRef6} and cause premature quenches, \textit {i.e.}, loss of superconductivity at elevated fields \cite{SunRef39,SunRef14} (Fig.~S1a,b). Also, roughness and local variations enable early magnetic vortex nucleation (Fig.~S1b) \cite{SunRef3}. Prior to this work, vapor diffusion was the only successful process to make high-performance Nb$_3$Sn cavities \cite{SunRef35,SunRef18}. Vapor-diffused Nb$_3$Sn films typically exhibit above 300\,nm $R_\mathrm{a}$ (average surface roughness) and above 2\,$\mu$m maximum peak-to-valley heights, highlighting the importance of achieving smoother film surfaces \cite{SunRef38,SunRef40,SunRef18,SunRef35}. The adoption of thinner films suggests a roughness reduction; nevertheless, the reproducibility of their RF performance has been an issue probably due to excessive thinness (versus the field penetration depth) and subsequent interface issues \cite{SunRef31}. Furthermore, stochiometric variations dramatically degrade $T_\mathrm{c}$ and induce local heating; for example, a 3\,at.\% variation reduces $T_\mathrm{c}$ by 50\% (Fig.~S1c) \cite{SunRef8,SunRef9,SunRef10,SunRef15,SunRef16}. Also, impurities strongly affect the electron mean free path and hence surface resistance. In vapor-diffused Nb$_3$Sn, Sn-deficient grains and impurities are observed at the local surface regions with larger dimensions than the $\sim$\,3\,nm coherence length \cite{SunRef38,SunRef40}. These crystal defects limit the minimization of BCS resistance and quality factor enhancement (Table~\ref{SunTable}). It is thus essential to investigate methods for reducing roughness, attaining stoichiometry, and controlling impurities in Nb$_3$Sn, along with surface engineering at hundreds of nanometers dictated by the field penetration depth. Studies on vapor-diffused Nb$_3$Sn \cite{SunRef9,SunRef38,SunRef40} suggest that these material issues arise from the insufficient and non-uniform Sn-vapor supply. Local variations in Sn flux during vapor diffusion result in an uneven spatial distribution of growth rates attributing to roughness. Likewise, inadequate Sn sources and slow supply rates produce the initially Sn-deficient grains ("bad" Nb$_3$Sn) following the 18\,at.\%-Sn boundary in the phase diagram; subsequently, slow Sn diffusion within these grains kinetically limits their conversion into stoichiometric "good" Nb$_3$Sn \cite{SunRef73,SunRef48,SunRef38,SunRef9}. Thus, we intend to design a deposition process that ensures a sufficient amount and rate of Sn supply during nucleation. As illustrated in Fig.~\ref{SunFig1}, we deposit a prerequisite Sn source on the Nb surface using our electrochemical recipe and subsequently convert the film to Nb$_3$Sn by thermal annealing. This process generates smooth ($R_\mathrm{a}$\,=\,54\,$\pm$\,4\,nm) and stoichiometric Nb$_3$Sn with minimal impurity concentrations on the industry-standard Nb substrate ($>$\,100\,nm initial roughness). Here, we detail the design principle of how initial electrochemical pre-deposits affect the material properties of resulting Nb$_3$Sn. We provide the atomic, chemical, structural, surface, and superconducting properties of electrochemical Nb$_3$Sn, and compare them with vapor-diffused films. We demonstrate excellent RF performance, \textit {e.g.}, ultra-low BCS resistances and high quality-factors, of the first electrochemical Nb$_3$Sn cavity as a proof of concept for use in SRF cavities and other superconducting devices. \subsection*{Correlation between Sn pre-deposition and Nb$_3$Sn surface roughness} \begin{figure}[b!] \centering \includegraphics[width=11.83 cm]{Figure_2_combined_v6.pdf} \caption{\textbf{Effect of Sn pre-deposition on resulting Nb$_3$Sn roughnesses.} a | AFM surface morphology of 2.5\,min electrochemical Nb$_3$Sn. b | $R_\mathrm{a}$ roughnesses of converted Nb$_3$Sn versus their film thicknesses, compared with the corresponding pre-deposits, $\sim$\,3\,$\mu$m thick vapor-diffused Nb$_3$Sn, and Nb substrates. c | FFT spectra for electrochemical Nb$_3$Sn and pre-deposits with different plating times (2.5\,--\,20\,min), compared with vapor-diffused Nb$_3$Sn.} \label{SunFig2} \end{figure} We developed a low-cost manufacturable electrochemical process to produce high-quality Sn pre-deposits, $\textit{i.e.}$, uniform, smooth, dendrite-free, and adhesive. The surfactant-assisted electrochemistry avoids seed layers and their inevitable normal-conducting contaminations and overcomes the dendrite formation and adhesion challenges. Supplementary Information details the optimization of synthesis and characterization of pre-deposits. By chronoamperometry at a 0.3\,$\mu$m/min plating rate, we controlled the pre-deposit thickness from 800\,nm to 6.6\,$\mu$m determined by cross-sectional scanning electron microscopy (SEM) after focused ion beam (FIB) polishing. After synthesis, these films were vacuum annealed using the heating profile shown in Fig.~\ref{SunFig1} for conversion to Nb$_3$Sn. The atomic force microscopy (AFM) scan in Fig.~\ref{SunFig2}a presents the Nb$_3$Sn surface topography with $\sim$\,1\,$\mu$m grain-like structures converted from 2.5\,min pre-deposition (AFM data for all conditions in Fig.~S9). Unlike vapor-diffused films with surface variations from thin to abnormally large grains \cite{SunRef38}, the electrochemical Nb$_3$Sn shows uniformly distributed small grains (SEM images in Fig.~S11). A visual comparison in Fig.~\ref{SunFig1} between electrochemical and vapor-diffused Nb$_3$Sn undoubtedly demonstrates the smooth surface converted from electrochemical pre-deposits, with empirical statistical significance. Fig.~\ref{SunFig2}b compares AFM quantifications of electrochemical and vapor-diffused Nb$_3$Sn using 20\,$\mu$m$^2$ areas with Nb substrates and pre-deposits references. The $R_\mathrm{a}$ of pre-deposits increase with the plating time. Dendrites appear at 20\,min plating and jeopardize the surface profile of pre-deposits (Fig.~S9g). Converted Nb$_3$Sn $R_\mathrm{a}$'s are essentially minimized to values below 100\,nm unless dendrites had formed during pre-deposition. These values are approximately equivalent to starting Nb $R_\mathrm{a}$ ($\sim$\,100\,nm). In contrast, $\sim$\,3\,$\mu$m thick vapor-diffused Nb$_3$Sn typically observes 5\,$\times$ higher roughnesses \cite{SunRef38,SunRef18,SunRef39,SunRef74,SunRef79} than electrochemical Nb$_3$Sn. The smallest $R_\mathrm{a}$ for electrochemical Nb$_3$Sn is 54\,nm from 2.5\,--\,10 min no-dendrite platings with variations ($<$\,10\,nm) between baths. Dendrite formation during pre-deposition causes large roughnesses of converted Nb$_3$Sn ($\sim$\,150\,nm), approaching the $\sim$\,300\,nm value in vapor-diffused Nb$_3$Sn. Indeed, electrochemical pre-deposits, if smooth and dendrite-free, can improve the surface profile of converted Nb$_3$Sn. Root-mean-squared ($R_\mathrm{q}$) and absolute-maximum ($R_\mathrm{z}$) roughnesses find similar trends (Table~S2 and Fig.~S10). Local inspections using cross-sectional STEM (scanning transmission electron microscopy) confirm a smooth surface on electrochemical Nb$_3$Sn (Fig.~\ref{SunFig3}d), whereas vapor-diffused Nb$_3$Sn comprises both smooth and uneven regions. Smooth regions of both vapor-diffused and electrochemical Nb$_3$Sn look similar. However, the rough regions on vapor-diffused Nb$_3$Sn, \textit {e.g.}, an extreme example in Fig.~\ref{SunFig3}e, exhibit 1\,--\,2\,$\mu$m surface variation along with no Nb$_3$Sn film regions. This rough surface is likely improved in vapor diffusion by a "correct" Sn-vapor flux and thinner films \cite{SunRef31}, but additional performance issues emerge, {e.g.}, poor interfaces and reproducibility. Our electrochemical Sn pre-deposition remains feasible and promising to resolve these issues collectively. To effectively evaluate surface profiles, we performed fast Fourier transformation (FFT) to quantify power spectral densities (PSD) of surface features at different spatial frequencies (Fig.~\ref{SunFig2}c). We focus on 0.5\,--\,3\,$\mu$m$^{-1}$ frequencies where sharp features significantly enhance local fields. Nb$_3$Sn from dendrite-free pre-deposits, regardless of their plating times (2.5\,--\,10\,min), show 5\,$\times$ lower PSDs than vapor-diffused Nb$_3$Sn, \textit{e.g.}, at the 2 $\mu$m$^{-1}$ frequency. Dendrite formation at 20\,min plating yields the highest PSDs for electrochemical Nb$_3$Sn similar to the values in vapor-diffused Nb$_3$Sn. Furthermore, the dendrite-free pre-deposits show even lower densities than their converted Nb$_3$Sn, suggesting that optimization of thermal annealing may further improve the surface conditions. Our results indicate that smooth Sn pre-deposits are crucial to overcoming the spatial variation in nucleation rate and lessening the kinetic requirement for Sn diffusion by providing sufficient Sn sources near the nuclei during alloying. In contrast, vapor diffusion studies \cite{SunRef9,SunRef38} revealed that a low and spatially differing Sn supply resulted in erratic nucleation; the long-range obstructed lateral Sn diffusion on Nb surfaces or the low Sn bulk diffusion within Nb and Nb$_3$Sn grains \cite{SunRef9,SunRef38} exacerbated these problems. Here, the Sn pre-deposits avoid these high surface and chemical barriers for Sn diffusion and ensure a uniform distribution of nucleation sites, ameliorating the surface profile. \subsection*{Improved stoichiometry in electrochemical Nb$_3$Sn and comparison with vapor diffusion} \begin{figure}[b!] \centering \includegraphics[width=\linewidth]{Figure_3_combined_v3.pdf} \caption{\textbf{Comparison of stoichiometry between electrochemical and vapor-diffused Nb$_3$Sn.} a | XPS depth profiling of Nb$_3$Sn made by electrochemical synthesis (es) versus vapor diffusion (vd) with/without pre-anodization (an). b | Typical XPS spectrum for electrochemical Nb$_3$Sn taken after etching surface oxides. c | Probability of Sn concentration over the entire film region (\textit{e.g.}, shown in (d,e)) analyzed by cross-sectional 4D-STEM/EDS. d,e | Cross-sectional composition maps of (d) electrochemical Nb$_3$Sn and (e) vapor-diffused Nb$_3$Sn (an extreme example).} \label{SunFig3} \end{figure} Stoichiometry within the first few hundreds of nanometers surface where RF fields penetrate is critical to sustaining superconductivity of Nb$_3$Sn and, herein, a low surface resistance under extreme conditions, \textit {e.g.}, high fields and high operating temperatures. We evaluate the Nb/Sn atomic ratios as a function of film depth using X-ray photoelectron spectroscopy (XPS) combined with ion etching and further map the Sn compositions on film cross-sections using energy-dispersive X-ray spectroscopy (EDS) under STEM after FIB polishing. We compare the results of electrochemical and vapor-diffused samples. For electrochemical Nb$_3$Sn, XPS depth profiling shows a constant 3:1 ratio at the surface 600\,nm region with the first a few nanometers affected by oxides (Fig.~\ref{SunFig3}a and up to 2\,$\mu$m data in Fig.~S12). For example, XPS spectra of the film after sputtering away surface oxides (Fig.~\ref{SunFig3}b) confirm a homogeneous Nb$_3$Sn stoichiometry of 75\,at.\% Nb and 25\,at.\% Sn. Surface EDS spectra (Fig.~S13) taken at different spots on the film verify this ratio. Moreover, cross-sectional EDS mapping under STEM, \textit {e.g.}, Fig.~\ref{SunFig3}d, provides a more refined spatial resolution than the XPS probe and confirms the homogeneity of Nb$_3$Sn stochiometry at the hundreds of nanometers surface. Collective quantification of the distribution of Sn composition over the entire Nb$_3$Sn cross-sections of multiple specimens (Fig.~\ref{SunFig3}c) shows a 25\,at.\% main peak reflecting the popularity of a homogeneous surface of desired stoichiometry. A side peak at 18\,at.\% exists and corresponds to the Sn deficiency region appearing at the film base (Fig.~\ref{SunFig3}d). Nevertheless, we observed one 10-nm-sized Sn-deficient part at the surface after examining $>$\,100 grains, which could matter. However, our quantifications confidently prove the predominance of stoichiometric surfaces in the electrochemical samples. These chemical analyses match the diffraction and $T_\mathrm{c}$ results (Fig.~\ref{SunFig4}) that indicate an ideal stoichiometry. In contrast, vapor-diffused Nb$_3$Sn, grown on either pre-anodized or non-anodized Nb surfaces, show non-homogeneity within the film, containing 25\,at.\% Sn, Sn-rich, and Sn-poor regions (Fig.~\ref{SunFig3}a). Despite the majority of 25\,at.\%-Sn grains, we observed a three-dimensional non-uniformity of Sn composition and even no film region, \textit {e.g.}, as mapped by the cross-sectional STEM/EDS in Fig.~\ref{SunFig3}e. This behavior is confirmed by a prominent 18\,at.\% peak for the probability distribution of Sn concentration in vapor-diffused samples (Fig.~\ref{SunFig3}c). Phase and $T_\mathrm{c}$ calculations \cite{SunRef9,SunRef10,SunRef15,SunRef16} showed that tin-poor and tin-rich stoichiometries deteriorate the superconducting properties. For example, Sn concentrations below 20\,at.\% or above 30\,at.\% result in $T_\mathrm{c}$ below 9\,K (plain Nb). Vapor-diffused Nb$_3$Sn commonly observed tin-poor problems owing to (1) an insufficient Sn supply advising the alloying nucleation to follow the 18\,at.\%-Sn boundary (see phase diagram); and (2) a reluctant Sn diffusion within the 18\,at.\%-Sn grains making rectifying difficult. Electrochemical Nb$_3$Sn benefits from sufficient Sn supply that promotes nucleation following the 25\,at.\% Sn boundary. \subsection*{Structural characterizations and superconducting properties} \begin{figure}[b!] \centering \includegraphics[width=\linewidth]{Figure_4_combined_v2.pdf} \caption{\textbf{Physical and structural analysis of 10\,min electrochemical Nb$_3$Sn.} a | Surface SEM. b | Cross-sectional 4D-STEM showing EWPC-resolved grain contrasts. c | Atomic resolution STEM. d | XRD pattern. e,f | $T_\mathrm{c}$ determined by (e) temperature-dependent resistivity at 0\,--\,1\,T fields and (f) flux expulsion.} \label{SunFig4} \end{figure} We further characterize electrochemical Nb$_3$Sn to study the surface morphology, film thickness, structural phase, grain size and orientation, and superconducting properties (Fig.~\ref{SunFig4}). Surface and cross-sectional images taken by SEM and STEM show a uniform, smooth 2.4\,$\mu$m-thick Nb$_3$Sn film converted from, \textit {e.g.}, 10\,min platings (Fig.~\ref{SunFig4}a,b). Regardless of pre-deposit thicknesses, the surface morphology of converted Nb$_3$Sn barely changes (Fig.~S11) with grain sizes 200\,nm\,--\,1\,$\mu$m smaller than typical vapor-diffused grains \cite{SunRef38}. Small grains facilitate coordination between orientations and reduce surface roughness. Electron diffractions under 4D-STEM, combined with the EWPC (exit-wave power cepstrum) transform\cite{SunRef47}, accurately determine the Nb$_3$Sn grains marked by false colors in Fig.~\ref{SunFig4}b. Unlike the predominance of cylinder-shaped grains penetrating through vapor-diffused films \cite{SunRef38}, electrochemical Nb$_3$Sn accommodates multiple grains in the film depth direction. This behavior infers that nucleations, in the presence of pre-deposits wetting on the Nb surface during annealing, likely originate at multiple sites, and the growth develops regardless of growth direction. In contrast, the heterogeneous nucleation during vapor diffusion strongly relies on the Nb surface conditions, the Sn-vapor adsorption preference, and the Sn diffusion limitations, generating vertically abnormal grains \cite{SunRef9,SunRef73,SunRef48,SunRef38}. This difference in nucleation mechanism may deserve further \textit{in situ} investigations. STEM atomic images (\textit {e.g.}, Fig.~\ref{SunFig4}c taken from the [111] zone axis) and X-ray diffractions (XRD) indexed \cite{SunRef49} (Fig.~\ref{SunFig4}d) confirm an A15 structure following the Pm$\overline{3}$n space group for electrochemical Nb$_3$Sn. Besides surface oxides, we did not observe foreign phases. We determine an 18\,K $T_\mathrm{c}$ by the resistivity drop (Fig.~\ref{SunFig4}e) and flux expulsion (Fig.~\ref{SunFig4}f) measurements, matching the limit for stoichiometric Nb$_3$Sn. At increasing DC fields, $T_\mathrm{c}$ is sustained at 17\,K at 0.5\,T and drops to 9\,K at 1\,T. Nb$_3$Sn bears critical superheating at 0.4\,T under RF fields, so the slight $T_\mathrm{c}$ degradation at 0.5\,T under DC fields is a positive indicator. \subsection*{Outlook: performance demonstration on SRF cavities} \begin{figure}[b!] \centering \includegraphics[width=11.83 cm]{Figure_6_combined_v6.pdf} \caption{\textbf{RF performance of the electrochemical Nb$_3$Sn 1.3\,GHz SRF cavity, and quantitative analysis of impurities.} a | $R_\mathrm{BCS}$ (total $R_\mathrm{s}$ minus the average of $R_\mathrm{s}$'s at 2.4\,--\,2.6\,K) measured at 2\,MV/m as a function of temperature (1/$\mathit{T}$) for electrochemical versus vapor-diffused Nb$_3$Sn. Inserts show smooth surfaces of electrochemical pre-deposits and Nb$_3$Sn on the cavity. b | $Q_\mathrm{0}$ versus $E_\mathrm{acc}$ at 1.8\,K and 4.2\,K temperatures. c,d | (c) SIMS and (d) XPS depth profiling of O, C, N, and H for Nb$_3$Sn made by electrochemical synthesis (es) versus vapor diffusion (vd) with/without pre-anodization (an).} \label{SunFig6} \end{figure} We have successfully scaled up the electrochemical process tailored to a large-scale (0.2\,m$^2$ surface area), intricate-structured 1.3\,GHz SRF cavity. Inserts in Fig.~\ref{SunFig6}a demonstrate smooth pre-deposits and a resulting shiny Nb$_3$Sn surface on the cavity. Flux expulsion tests on two locations of the cavity (Fig.~\ref{SunFig4}f) confirm the 18\,K $T_\mathrm{c}$ of converted Nb$_3$Sn, suggesting 3:1 stoichiometry. Proof-of-concept results demonstrate $R_\mathrm{BCS}$ minimization in the electrochemical cavity at multiple operation temperatures, approximately two times lower than vapor-diffused cavities (Fig.~\ref{SunFig6}a and Table~\ref{SunTable}). $R_\mathrm{BCS}$ reductions at different temperature regimes reveal the underlying meanings of their corresponding material improvements. At high temperatures ($\textit{e.g.}$, 10\,K), the reduction is linked to the purification in "good" Nb$_3$Sn, improving the mean free path. At 4\,K, the lower $R_\mathrm{BCS}$ is strong evidence of the stoichiometric conformity for the Sn-deficient "bad" Nb$_3$Sn, which is consistent with our chemical analysis. Below 4\,K, the ultra-low $R_\mathrm{BCS}$'s below 1\,n$\Omega$ reflect consistent reductions extrapolated from 4\,K and 10\,K results. Benefiting from low $R_\mathrm{BCS}$, quality factors at low RF fields are as high as 5.6\,$\times$\,10$^{10}$ measured at 1.8\,K and 2.6\,$\times$\,10$^{10}$ at 4.2\,K (Fig.~\ref{SunFig6}b). The quench fields occur at $\sim$\,13\,MV/m, which falls in the typical quenching range for vapor-diffused cavities\cite{SunRef75,SunRef79,SunRef18,SunRef39,SunRef31}. Further studies are needed to understand the source(s) of quench mechanisms in Nb$_3$Sn and then fully realize the full benefits of the reduced surface roughness. To understand the refinement of Nb$_3$Sn achieved, we probed impurities by SIMS (secondary ion mass spectrometry, Fig.~\ref{SunFig6}c and Fig.~S14) and XPS (Fig.~\ref{SunFig6}d) depth profiling. H, C, and O concentrations remain essentially low in electrochemical Nb$_3$Sn while oxides exist at the surface. The trivial amount of monolayer H and C might be induced by residue from cleaning protocols using methanol or contamination in the air. In contrast, detrimental H and C prevail in vapor-diffused films with high concentrations at considerable depths that significantly affect the RF penetration region. XPS oxygen profiles show thinner oxides on the electrochemical Nb$_3$Sn in contrast to vapor-diffused films. Further deconvolution of oxide structures is detailed elsewhere. In summary, the advancements in chemical and surface properties of Nb$_3$Sn are translated to minimizing BCS surface resistances and enhancing quality factors in the SRF cavity. The data does not suggest quench mechanisms. The RF responses from electrochemical Nb$_3$Sn are also practical for other superconducting devices. The deposition principle may enable the processing of smooth, homogeneous, high-purity compound superconductors in general. \section*{Methods} \subsection*{Electrochemical synthesis and characterization} The industry-standard Nb substrates with $>$\,300 superconducting Residual Resistivity Ratios (RRR) were mechanically polished and electropolished via 9\,H$_2$SO$_4$\,:\,1\,HF, ending with $R_\mathrm{a}$\,=\,$\sim$\,100\,nm and $R_\mathrm{z}$\,=\,$\sim$\,2.3\,$\mu$m (Table~S2). Nominal substrate oxides may persist after HF cleaning before Sn pre-deposition. Sn electrochemical deposition was performed using a Princeton Applied Research VersaSTAT 3-500 potentiostat system. As illustrated in Fig.~\ref{SunFig1}, a three-electrode setup was employed with the Pt wire counter and saturated calomel (SCE) electrodes. A DI-water bath achieved uniform heating of reaction mixtures for sample-scale studies, and a digital feedback control monitored the temperature. SnCl$_2$ and ammonium citrate tribasic surfactant were purchased from Sigma-Aldrich and used as received. The pH as-prepared 0.2\,M SnCl$_2$ / 0.3\,M citrate is 4.14, while changing the SnCl$_2$ / surfactant ratio alters pH values as monitored by pH meters (Fig.~S15). pH values were also adjusted by adding HCl or NaOH in the optimum baths. Solutions were stirred for 5\,min after dissolving the chemicals and let stand for another 5\,min. (White clouds were observed on mixing, likely due to low-solubility SnCl$_2$ that later dissolved on standing to obtain clear reaction solutions or Sn(OH)Cl produced from the reaction between SnCl$_2$ and H$_2$O in low-pH baths.) Best deposits were determined from 0.2\,M SnCl$_2$ aqueous bath containing 0.3\,M surfactant at above 50\,℃, plated at a potential of -\,0.7 to -\,0.8\,V versus SCE, without additional acid/base and stirring. Cyclic voltammetry (CV) measurements were performed to determine Sn electrochemistries on Nb at varied scan rates (20\,--\,100\,mV/s). Effects of temperature (30\,--\,90\,°C), pH (0\,--\,14), surfactant (0.2\,--\,3.7\,M) and precursor (0.2\,--\,0.7\,M) concentrations, redox potentials, substrate oxide thicknesses, and stirring conditions along with surfactant- and precursor-only control studies were systematically investigated and are detailed in Supplementary Information. A potentiostat controlled the deposition. The deposition time was altered from 2.5 to 20\,min. After deposition, samples were cleaned with methanol, dried, and sealed in plastic bags. The deposition processes were repeated in 22 batches with multiple samples in each set. \subsection*{Post thermal annealing} The electrochemical pre-deposits were annealed in a high-vacuum (10$^{-6}$\,Torr) furnace for conversion to Nb$_3$Sn. As shown in Fig.~\ref{SunFig1}, samples were heated at 500\,\textdegree C for 5\,h for nucleation and subsequently at 1100\,\textdegree C for 3\,h for alloying, followed by slow cooling in the furnace without additional control. For comparison, vapor-diffused samples were prepared using the same heating profile \cite{SunRef18}. \subsection*{Surface, chemical, atomic, and structural characterizations} The electrochemical pre-deposits and converted Nb$_3$Sn films were imaged by Zeiss Gemini SEM equipped with an in-lens detector under low voltages (1\,--\,5\,kV) to evaluate the film uniformity, surface morphology, grain information, and dendrite formation. Films cross-sections were polished and scanned using Thermo Fisher Helios G4 UX FIB to determine the film thicknesses and prepare the STEM specimens. Surface profiles were examined and quantified using Asylum MFP-3D AFM. Cross-sectional microscopy images provided supporting evidence of surface smoothness. EDS under microscopies, XPS, and SIMS were performed to determine the chemical, stoichiometry, and impurity information. Cross-sectional EDS/STEM provided composition mappings. Stoichiometry depth profilings were achieved by XPS combined with ion etching with the etching rate calibrated by actual film thicknesses determined. Cross-sectional phase and grain mappings that resolve high contrasts were obtained by FEI F20 4D-STEM equipped with a high dynamic range EMPAD (Electron Microscope Pixel Array Detector) and analyzed by the EWPC transform \cite{SunRef47}. High-resolution Rigaku SmartLab XRD was measured to support the determination of phase and grain orientations. Atomic imaging was obtained by FEI/Thermo Fisher Titan Themis STEM. Additionally, tape tests were performed to confirm the adhesion strength for electrochemical pre-deposits on Nb. \subsection*{Superconducting property and RF performance} $T_\mathrm{c}$ values were determined by (1) temperature-dependent resistivity measurements under different DC fields using a Quantum Design Physical Property Measurement System (PPMS) under the AC transport mode and (2) flux expulsion tests while warming up the cryostat from liquid helium temperature. For the resistivity measurements, the sample surface was wedge-bonded to the sample puck using four 25\,$\mu$m aluminum wires (West Bond 747630E); the fields (0\,--\,1\,T) were applied perpendicular to the sample surface. As for the expulsion tests, two fluxgates were recorded at different electrochemical cavity locations. To evaluate the RF performance, we scaled up the electrochemical and annealing process to large sizes at the inner surface of a 1.3\,GHz SRF cavity, as shown in Fig.~\ref{SunFig6}a. The cavity was electropolished with a nominal 100\,$\mu$m removal. The deposition was performed in an inert gas glovebox with O$_2$ and H$_2$O levels below 0.5\,ppm. To facilitate the large-scale deposition, the heating method was changed to fiberglass heating tape, and the temperature was monitored by two thermocouples placed at different locations of the cavity (Fig.~S25). The electrochemical and annealing parameters were set the same as with sample-scale depositions; nevertheless, the plating current density was low, likely due to thin electrodes used for deposition on a large surface area (0.2\,m$^2$). $R_\mathrm{s}$'s were measured at 1.6\,--\,10\,K temperatures under increasing RF fields. Temperature-dependent $R_\mathrm{BCS}$'s were determined by the difference between total $R_\mathrm{s}$ and an estimate of $R_\mathrm{0}$ (the average of $R_\mathrm{s}$'s at 2.4\,--\,2.6\,K temperatures). \subsection*{Data availability} All data generated or analyzed during this study are included in this manuscript and Supplementary Information.
\section{Missing Proofs from Section~\ref{sec:descent}}\label{appendix:descent} \subsection{Proof of Theorem~\ref{thm:dual-descent-regret}} \begin{proof}[Proof of Theorem~\ref{thm:dual-descent-regret}] Let $\zeta_A$ be the first time less than $T$ for which $\sum_{t=1}^{\zeta_A} b_{t}(x_t) + \bar{b} \ge B$. Set $\zeta_A = T$ if this inequality is never satisfied. Then, $x_t = x_t'$ for all $t \leq \zeta_A$ and $\sum_{t=1}^{\zeta_A} b_t(x_t') \geq B - \bar b$. First, observe that \begin{align}\label{eq:alg-reward} R(A| \{\gamma_t\}_t) \geq \sum_{t=1}^{\zeta_A} f_t(x_t') = \sum_{t=1}^T f_t(x_t') - \sum_{t=\zeta_A +1}^T f_t(x_t') \geq \sum_{t=1}^Tf_t(x_t') - \kappa \cdot \sum_{t=\zeta_A +1 }^T b_t(x_t')\,. \end{align} Next observe that, for all $t \in [T]$, $\mu_t$ is independent of $\gamma_t$ because $\mu_t$ is completely determined by $\{\gamma_1, \dots, \gamma_{t-1}\}$. Hence, \begin{align*} \mathbb{E}_{\gamma_t}\left[ f_t(x_t') \mid \mu_t \right] &= \mathbb{E}_{\gamma_t}\left[ f_t(x_t') + \mu_t \cdot (\beta_t - b_t(x_t')) \mid \mu_t \right] - \mathbb{E}_{\gamma_t}\left[ \mu_t \cdot (\lambda_t - b_t(x_t')) \mid \mu_t \right] - \mathbb{E}_{\gamma_t}\left[ \mu_t \cdot (\beta_t - \lambda_t) \mid \mu_t \right]\\ &= \mathbb{E}_{\gamma_t}\left[ D(\mu_t|\mathcal{P}_t, \beta_t) | \mu_t \right] - \mathbb{E}_{\gamma_t}\left[ \mu_t \cdot (\lambda_t - b_t(x_t')) \mid \mu_t \right] - \mathbb{E}_{\gamma_t}\left[ \mu_t \cdot (\beta_t - \lambda_t) \mid \mu_t \right] \,. \end{align*} Taking unconditional expectations on both sides and applying the tower rule yields \begin{align*} \mathbb{E}\left[ f_t(x_t')\right] = \mathbb{E}\left[ D(\mu_t|\mathcal{P}_t, \beta_t) \right] - \mathbb{E}\left[ \mu_t \cdot (\lambda_t - b_t(x_t'))\right] - \mathbb{E}\left[ \mu_t \cdot (\beta_t - \lambda_t)\right] \,. \end{align*} Summing over $t \in [T]$, we get \begin{align}\label{eq:tot-reward} \sum_{t=1}^T \mathbb{E}[f_t(x_t')] = \sum_{t=1}^T \mathbb{E}\left[ D(\mu_t|\mathcal{P}_t, \beta_t) \right] - \sum_{t=1}^T \mathbb{E}\left[ \mu_t \cdot (\lambda_t - b_t(x_t'))\right] - \sum_{t=1}^T \mathbb{E}\left[ \mu_t \cdot (\beta_t - \lambda_t)\right]\,. \end{align} Therefore, \eqref{eq:alg-reward} and \eqref{eq:tot-reward} together imply \begin{align}\label{eq:interim-regret} \mathbb{E}\left[ \left\{ \sum_{t=1}^T D(\mu_t|\mathcal{P}_t, \beta_t) \right\} - R(A|\{\gamma_t\}_t) \right] \leq \mathbb{E}\left[ \sum_{t=1}^T \mu_t \cdot (\lambda_t - b_t(x_t')) + \kappa \cdot \sum_{t=\zeta_A + 1}^T b_t(x_t') \right] + \sum_{t=1}^T \mathbb{E}[\mu_t \cdot (\beta_t - \lambda_t)]\,. \end{align} \textbf{FTRL Regret Bound.} Define $w_t(\mu) \coloneqq \mu \cdot (\lambda_t - b_t(x_t'))$. Then, Algorithm~\ref{alg:dual-descent} can be seen as running FTRL with linear losses $\{w_t(\cdot)\}_t$. The gradients of these loss functions are given by $\nabla w_t(\mu) = \lambda_t - b_t(x_t')$, which satisfy $\|\nabla w_t(\mu)\|_\infty \leq \|b_t(x_t')\|_\infty + \|\lambda_t\|_\infty \leq \bar b + \bar \lambda$. Therefore, the regret bound for FTRL implies that for all $\mu \geq 0$: \begin{align} \sum_{t=1}^{T} w_t(\mu_t) - w_t(\mu) \le E(T,\mu)\,, \end{align} where $E(T,\mu) = \frac{2(\bar{b} + \bar\lambda)^2}{\sigma} \eta \cdot T + \frac{h(\mu) - h(\mu_1)}{\eta}$ is the regret bound of FTRL after $T$ iterations \citep{hazan2016introduction}. Equivalently, we can write \begin{align*} \sum_{t=1}^T \mu_t \cdot (\lambda_t - b_t(x_t')) \leq E(T,\mu) + \sum_{t=1}^T \mu \cdot (\lambda_t - b_t(x_t')) \qquad \forall\ \mu \geq 0. \end{align*} Now, consider the following two cases: \begin{itemize} \item Case 1: $\zeta_A = T$. Here, setting $\mu = 0$ yields \begin{align*} \sum_{t=1}^T \mu_t \cdot (\lambda_t - b_t(x_t')) + \kappa \cdot \sum_{t=\zeta_A + 1}^T b_t(x_t') \leq E(T,0) \,. \end{align*} \item Case 2: $\zeta_A < T$. Then, $\sum_{t=1}^{\zeta_A} b_t(x_t') \geq B - \bar b$. Hence, setting $\mu = \kappa$ yields \begin{align*} \sum_{t=1}^T \mu_t \cdot (\lambda_t - b_t(x_t')) + \kappa \cdot \sum_{t=\zeta_A + 1}^T b_t(x_t') &\leq E(T, \kappa) + \sum_{t=1}^T \kappa \cdot (\lambda_t - b_t(x_t')) + \kappa \cdot \sum_{t=\zeta_A + 1}^T b_t(x_t')\\ &= E(T, \kappa) + \kappa \cdot \left(\sum_{t=1}^T \lambda_t - \sum_{t=1}^{\zeta_A} b_t(x_t') \right)\\ &\leq E(T, \kappa) + \kappa \cdot \left( \left\{\sum_{t=1}^T \lambda_t \right\} - (B - \bar b) \right)\\ &= E(T, \kappa) + \kappa\bar b + \kappa \cdot \left(\left\{\sum_{t=1}^T \lambda_t \right\} - B \right)\,. \end{align*} \end{itemize} Combining the two cases implies that for all values of $\zeta_A$ we have \begin{align}\label{eq:comp-slack} \sum_{t=1}^T \mu_t \cdot (\lambda_t - b_t(x_t')) + \kappa \cdot \sum_{t=\zeta_A + 1}^T b_t(x_t') \leq \max\{E(T,0), E(T,\kappa)\} + \kappa \bar b + \kappa \cdot \left(\left\{\sum_{t=1}^T \lambda_t \right\} - B \right)^+ \,. \end{align} Finally, combining \eqref{eq:interim-regret} and \eqref{eq:comp-slack} yields \begin{align*} \mathbb{E}\left[ \left\{ \sum_{t=1}^T D(\mu_t|\mathcal{P}_t, \beta_t) \right\} - R(A|\{\gamma_t\}_t) \right] \leq &\max\{E(T,0), E(T,\kappa)\} + \kappa \bar b + \kappa \cdot \left(\left\{\sum_{t=1}^T \lambda_t \right\} - B \right)^+\\ &+ \sum_{t=1}^T \mathbb{E}[\mu_t \cdot (\beta_t - \lambda_t)]\,. \end{align*} Plugging in the definition of $E(T,\mu)$ finishes the proof. \end{proof} \subsection{Proof of Lemma~\ref{lemma:discrepancy-term}} \begin{proof}[Proof of Lemma~\ref{lemma:discrepancy-term}] Consider any two request distributions $\mathcal{P}, \tilde \mathcal{P} \in \Delta(\S)$. Then, by the definition of the Wasserstein metric, there exists a joint probability distribution $Q$, with marginals $\mathcal{P}$ and $\tilde \mathcal{P}$ on the first and second factors respectively, such that \begin{align*} \mathcal{W}(\mathcal{P}, \tilde\mathcal{P}) = \mathbb{E}_{(\gamma, \tilde \gamma) \sim Q} \left[ \sup_x |f(x) - \tilde f(x)| + \sup_x |b(x) - \tilde b(x)| \right] \,. \end{align*} Let $x^*(\gamma, \mu)$ be the optimal solution of $\max_{x \in X} f(x) - \mu \cdot b(x)$ for request $\gamma = (f,b)$ as described in Definition~\ref{definition:profit-maximizing-decision}. Then, for any $\mu \in [0,\kappa]$ and $x: \S \to \mathcal{X}$, we have \begin{align}\label{eq:wasserstein} &\mathbb{E}_{(\gamma, \tilde \gamma) \sim Q} \left[ \left| f(x(\gamma)) - \mu \cdot b(x(\gamma)) - \left\{ \tilde f(x(\gamma)) - \mu \cdot \tilde b(x(\gamma)) \right\} \right| \right] \nonumber \\ \leq & \mathbb{E}_{(\gamma, \tilde \gamma) \sim Q} \left[ \left| f(x(\gamma)) - \tilde f(x(\gamma))\right| + \mu \cdot \left| b(x(\gamma)) - \tilde b(x(\gamma)) \right| \right] \nonumber \\ \leq & \mathcal{W}(\mathcal{P}, \tilde \mathcal{P}) + \kappa \cdot \mathcal{W}(\mathcal{P}, \tilde\mathcal{P}) \nonumber\\ =& (1 + \kappa) \cdot \mathcal{W}(\mathcal{P}, \tilde \mathcal{P})\,. \end{align} Now, for $t \in [T]$, we can use \eqref{eq:wasserstein} to write \begin{align*} & D(\mu_t|\tilde \mathcal{P}, \beta_t) - D(\mu_t| \mathcal{P}, \beta_t) \\ =& \mathbb{E}_{\tilde\gamma \sim \tilde \mathcal{P}}[ \tilde f(x^*(\tilde\gamma, \mu_t)) - \mu_t \cdot \tilde b(x^*(\tilde \gamma, \mu_t)) + \mu_t\cdot \beta_t ] - \mathbb{E}_{\gamma \sim \mathcal{P}}[ f(x^*(\gamma, \mu_t)) - \mu_t \cdot b(x^*(\gamma, \mu_t)) + \mu_t \cdot \beta_t ] \\ =& \mathbb{E}_{\tilde\gamma \sim \tilde \mathcal{P}}[ \tilde f(x^*(\gamma, \mu_t)) - \mu_t \cdot \tilde b(x^*( \gamma, \mu_t)) + \mu_t\cdot \beta_t ] - \mathbb{E}_{\gamma \sim \mathcal{P}}[ f(x^*(\gamma, \mu_t)) - \mu_t \cdot b(x^*(\gamma, \mu_t)) + \mu_t \cdot \beta_t ] \\ \leq& \mathbb{E}_{(\gamma, \tilde \gamma) \sim Q} \left[ \left| f(x^*(\gamma, \mu_t)) - \mu_t \cdot b(x^*(\gamma, \mu_t)) - \left\{ \tilde f(x^*(\gamma, \mu_t)) - \mu_t \cdot \tilde b(x^*(\gamma, \mu_t)) \right\} \right| \right]\\ \leq& (1 + \kappa) \cdot \mathcal{W}(\mathcal{P}, \tilde\mathcal{P})\,, \end{align*} where the first inequality follows from the definition of $x^*(\tilde\gamma, \mu_t)$ and the second inequality follows from the fact that $(\mathcal{P}, \tilde\mathcal{P})$ are the marginals of $Q$. As a consequence, we get \begin{align}\label{eq:wasserstein-inter} \sum_{t=1}^T D(\mu_t|\mathcal{P}_t, \beta_t) &= \sum_{t=1}^T D(\mu_t | \tilde \mathcal{P}_t, \beta_t) - \sum_{t=1}^T \left\{ D(\mu_t|\tilde \mathcal{P}_t, \beta_t) - D(\mu_t| \mathcal{P}_t, \beta_t) \right\} \nonumber\\ &\geq \sum_{t=1}^T D(\mu_t | \tilde \mathcal{P}_t, \beta_t) - (1 + \kappa) \cdot \sum_{t=1}^T \mathcal{W}(\mathcal{P}_t, \tilde\mathcal{P}_t) \nonumber\\ &\geq \sum_{t=1}^T \fluid(\tilde \mathcal{P}_t, \beta_t) - (1 + \kappa) \cdot \sum_{t=1}^T \mathcal{W}(\mathcal{P}_t, \tilde\mathcal{P}_t)\,, \end{align} where the second inequality follows from weak duality. Next, observe that the definition of $\beta_t = \mathbb{E}_{\hat \gamma \sim \tilde \mathcal{P}_t}[ \hat b^*(\tilde \mu)]$ implies that $x^*(\tilde \gamma_t, \tilde \mu)$ is a feasible to solution to the optimization problem which defines $\fluid(\tilde \mathcal{P}_t, \beta_t)$. Hence, \begin{align*} \sum_{t=1}^T \fluid(\tilde \mathcal{P}_t, \beta_t) &\geq \sum_{t=1}^T \mathbb{E}_{\tilde \gamma_t \sim \tilde \mathcal{P}_t} \left[ \tilde f_t(x^*(\tilde \gamma_t, \tilde \mu)) \right]\\ &= \sum_{t=1}^T \mathbb{E}_{\tilde \gamma_t \sim \tilde \mathcal{P}_t} \left[ \tilde f_t(x^*(\tilde \gamma_t, \tilde \mu)) - \tilde\mu \cdot \tilde b_t(x^*(\tilde \gamma_t, \tilde \mu))\right] + \tilde\mu \cdot \sum_{t=1}^T \mathbb{E}_{\tilde \gamma_t \sim \tilde \mathcal{P}_t} \left[ \tilde b_t(x^*(\tilde \gamma_t, \tilde \mu)) \right]\,. \end{align*} Let $\{x_t(\cdot)\}_t$ be an optimal solution for $\fluid(\{\mathcal{P}_t\})$. Then, for all $t \in [T]$, we have \begin{align*} \mathbb{E}_{\tilde \gamma_t \sim \tilde \mathcal{P}_t} \left[ \tilde f_t(x^*(\tilde \gamma_t, \tilde \mu)) - \tilde\mu \cdot \tilde b_t(x^*(\tilde \gamma_t, \tilde \mu))\right] &= \mathbb{E}_{(\gamma_t, \tilde\gamma_t) \sim Q} \left[ \tilde f_t(x^*(\tilde \gamma_t, \tilde \mu)) - \tilde\mu \cdot \tilde b_t(x^*(\tilde \gamma_t, \tilde \mu))\right]\\ &\geq \mathbb{E}_{(\gamma_t, \tilde\gamma_t) \sim Q} \left[ \tilde f_t(x_t(\gamma_t)) - \tilde\mu \cdot \tilde b_t(x(\gamma_t))\right] \\ &\geq \mathbb{E}_{(\gamma_t, \tilde\gamma_t) \sim Q} \left[ f_t(x_t(\gamma_t)) - \tilde\mu \cdot b_t(x(\gamma_t))\right] - (1 + \kappa) \cdot \mathcal{W}(\mathcal{P}_t, \tilde \mathcal{P}_t)\\ &= \mathbb{E}_{\gamma_t \sim \mathcal{P}_t} \left[ f_t(x_t(\gamma_t)) - \tilde\mu \cdot b_t(x(\gamma_t))\right] - (1 + \kappa) \cdot \mathcal{W}(\mathcal{P}_t, \tilde \mathcal{P}_t)\,, \end{align*} where the first inequality follows from the definition of $x^*(\tilde \gamma_t, \tilde\mu)$ and the second inequality follows from \eqref{eq:wasserstein}. Therefore, \begin{align*} &\sum_{t=1}^T \fluid(\tilde \mathcal{P}_t, \beta_t)\\ \geq & \sum_{t=1}^T \mathbb{E}_{\gamma_t} \left[ f_t(x_t(\gamma_t)) - \tilde\mu \cdot b_t(x(\gamma_t))\right] - (1 + \kappa) \cdot \sum_{t=1}^T \mathcal{W}(\mathcal{P}_t, \tilde \mathcal{P}_t) + \tilde\mu \cdot \sum_{t=1}^T \mathbb{E}_{\tilde \gamma_t} \left[ \tilde b_t(x^*(\tilde \gamma_t, \tilde \mu)) \right]\\ =& \sum_{t=1}^t \mathbb{E}_{\gamma_t \sim \mathcal{P}_t}[f_t(x(\gamma_t))] - \tilde \mu\cdot \left(\sum_{t=1}^T \mathbb{E}_{\gamma_t}[b_t(x(\gamma_t))] -\sum_{t=1}^T \mathbb{E}_{\tilde \gamma_t}[\tilde b_t^*(\tilde \mu)] \right) - (1 + \kappa) \cdot \sum_{t=1}^T \mathcal{W}(\mathcal{P}_t, \tilde \mathcal{P}_t)\\ \geq& \fluid(\{\mathcal{P}_t\}_t) - \tilde \mu \cdot \left(B - \sum_{t=1}^T \beta_t \right) - (1 + \kappa) \cdot \sum_{t=1}^T \mathcal{W}(\mathcal{P}_t, \tilde \mathcal{P}_t)\,, \end{align*} where the second inequality follows from the feasibility of the optimal solution $\{x_t(\cdot)\}_t$, i.e., $\sum_{t=1}^T \mathbb{E}_{\gamma_t}[b_t(x(\gamma_t))] \leq B$. Combining this with \eqref{eq:wasserstein-inter} yields \begin{align*} \sum_{t=1}^T D(\mu_t| \mathcal{P}_t, \beta_t) \geq \fluid(\{\mathcal{P}_t\}_t) - \tilde \mu \cdot \left(B - \sum_{t=1}^T \beta_t \right) - 2(1 + \kappa) \cdot \sum_{t=1}^T \mathcal{W}(\mathcal{P}_t, \tilde \mathcal{P}_t)\,, \end{align*} as required. \end{proof} \subsection{Proof of Lemma~\ref{lemma:monotonicity}} \begin{proof}[Proof of Lemma~\ref{lemma:monotonicity}] The definition of $x$ and $x'$ implies \begin{align*} f(x) - \mu \cdot b(x) \geq f(x') - \mu \cdot b(x') \quad \text{ and } \quad f(x') - \mu' \cdot b(x') \geq f(x) - \mu' \cdot b(x)\,. \end{align*} Combining the two inequalities, we get \begin{align*} &f(x) - \mu \cdot b(x) - \left\{ f(x) - \mu' \cdot b(x) \right\} \geq f(x') - \mu \cdot b(x') - \left\{ f(x') - \mu' \cdot b(x') \right\} \\ \implies & (\mu - \mu') \cdot (b(x') - b(x)) \geq 0\,. \end{align*} The lemma follows from the last inequality because $\mu - \mu' > 0$. \end{proof} \subsection{Proof of Lemma~\ref{lemma:change-in-target}} \begin{proof}[Proof of Lemma~\ref{lemma:change-in-target}] Define \begin{align*} q(\mu) \coloneqq \mu\cdot B + \sum_{t=1}^T \max_{x \in \mathcal{X}} \left\{ \tilde f_t(x) - \mu \cdot \tilde b_t(x) \right\} \quad \text{and} \quad q^{(-s)}(\mu) \coloneqq \mu\cdot B + \sum_{t\neq s} \max_{x \in \mathcal{X}} \left\{ \tilde f_t(x) - \mu \cdot \tilde b_t(x) \right\} \,. \end{align*} We start by proving $\tilde \mu \geq \tilde \mu^{(-s)}$. For contradiction, suppose $\tilde \mu < \tilde \mu^{(-s)}$. Consider the following two cases: \begin{itemize} \item Case I: $0 \in \argmax_{x \in \mathcal{X}} \tilde f_s(x) - \tilde \mu \cdot \tilde b_s(x)$. Then, we must have $0 \in \argmax_{x \in \mathcal{X}} \tilde f_s(x) - \mu \cdot \tilde b_s(x)$ for all $\mu \geq \tilde \mu$. This is because, for $\mu \geq \tilde \mu$, Lemma~\ref{lemma:monotonicity} implies that $\tilde b_s(x') \leq \tilde b_s(0) = 0$ for all $x' \in \argmax_{x \in \mathcal{X}} \tilde f_s(x) - \mu \cdot \tilde b_s(x)$, and $\tilde f_s(x) \leq \kappa \cdot \tilde b_s(x)$ for all $x \in \mathcal{X}$. Therefore, $q(\mu) = q^{(-s)}(\mu)$ for all $\mu \geq \tilde \mu$. Since $\tilde \mu$ is a minimizer of $q(\cdot)$ and $\tilde \mu^{(-s)} > \tilde\mu$, we get that \begin{align*} q^{(-s)}(\tilde \mu) = q(\tilde\mu) \leq q(\tilde\mu^{(-s)}) = q^{(-s)}\left(\tilde \mu^{(-s)} \right)\,. \end{align*} On the other hand, $\tilde \mu^{(-s)}$ is a minimizer of $q^{(-s)}(\cdot)$, which implies $q^{(-s)}\left(\tilde \mu^{(-s)} \right) \leq q^{(-s)}(\tilde \mu)$. Therefore, $q^{(-s)}\left(\tilde \mu^{(-s)} \right) \leq q^{(-s)}(\tilde \mu)$, which contradicts the fact that $\tilde \mu^{(-s)}$ is the smallest minimizer of $q^{(-s)}(\cdot)$. \item Case II: $0 \notin \argmax_{x \in \mathcal{X}} \tilde f_s(x) - \tilde \mu \cdot \tilde b_s(x)$. Since $f_s(x) \leq \kappa \cdot b_s(x)$ for all $x \in \mathcal{X}$, we get that $\tilde b_s(x') > 0$ for all $x' \in \argmax_{x \in \mathcal{X}} \tilde f_s(x) - \tilde \mu \cdot \tilde b_s(x)$. Consider any sequences of optimal action sequences $\{x_t\}_t$ and $\{x_t^{(-s)}\}_t$ such that for all $t \in [T]$, we have \begin{align*} x_t \in \argmax_{x \in \mathcal{X}} \tilde f_t(x) - \tilde\mu \cdot \tilde b_t(x) \quad \text{and} \quad x_t^{(-s)} \in \argmax_{x \in \mathcal{X}} \tilde f_t(x) - \tilde\mu^{(-s)} \cdot \tilde b_t(x) \ . \end{align*} Then, Lemma~\ref{lemma:monotonicity} implies that $\tilde b_t(x_t) \geq \tilde b_t(x_t^{(-s)})$ for all $t \neq s$. Therefore, \begin{align}\label{eq:change-target-inter-1} B - \sum_{t=1}^T \tilde b_t(x_t) = \left\{ B - \sum_{t\neq s} \tilde b_t(x_t) \right\} - b_t(x_t) < B - \sum_{t\neq s} \tilde b_t(x_t) \leq B - \sum_{t\neq s} \tilde b_t(x_t^{(-s)}) \,. \end{align} Now observe that, since $q(\cdot)$ (and $q^{(-s)}(\cdot)$) are the maxima of a collection of linear functions, its sub-gradient is given by the convex hull of gradients of all the linear functions which are binding (for example, see Chapter 5 of \citealt{bertsekas2009convex}). Therefore, $\partial q(\tilde\mu)$ (and $\partial q^{(-s)}\left(\tilde \mu^{(-s)} \right)$) is a convex hull of terms of the form $B - \sum_{t=1}^T \tilde b_t(x_t)$ for some optimal action sequence $\{x_t\}_t$ (and $\{x_t^{(-s)}\}_t$). Since $\tilde \mu^{(-s)} > \tilde \mu \geq 0$, first-order optimality conditions imply that $0 \in \partial q^{(-s)}\left(\tilde \mu^{(-s)} \right)$. Therefore, \eqref{eq:change-target-inter-1} implies that $v < 0$ for all $v \in \partial q(\tilde \mu)$. This contradicts the optimality of $\tilde \mu$ for $q(\cdot)$. \end{itemize} As we have obtained a contradiction in both cases, we get that $\tilde \mu \geq \tilde \mu^{(-s)}$, as required. Moreover, $\lambda_t \leq \lambda_t^{(-s)}$ for all $t \neq s$ follows immediately from Lemma~\ref{lemma:monotonicity}. Hence, to finish the proof, it suffices to show the final inequality in the following chain: \begin{align}\label{eq:change-target-inter-2} \sum_{t =1}^{s-1} \left|\lambda_t^{(-s)} - \lambda_t \right| \leq \sum_{t\neq s} \left|\lambda_t^{(-s)} - \lambda_t \right| = \sum_{t\neq s} \lambda_t^{(-s)} - \sum_{t \neq s}\lambda_t \leq 3 \bar b \,. \end{align} Note that, Lemma~\ref{lemma:trace-dual} implies that at least one of the following conditions hold \begin{enumerate} \item $\tilde \mu = 0$ and $\sum_{t=1}^T \lambda_t \leq B + \bar b$. \item $\left|B - \sum_{t=1}^T \tilde \lambda_t \right| \leq \bar b$. \end{enumerate} If $\tilde \mu = 0$, then $\tilde \mu^{(-s)} = 0$ because $\tilde mu^{(-s)} \leq \tilde \mu$. Therefore, in that case $\lambda^{(-s)}_t = \lambda_t = \tilde b^*_t(0)$ for all $t \neq s$ and \eqref{eq:change-target-inter-2} follows. Suppose $\left|B - \sum_{t=1}^T \tilde \lambda_t \right| \leq \bar b$. Observe that Lemma~\ref{lemma:trace-dual} applied to the trace $\{\hat \gamma_t\}_t$, where $\hat \gamma_t = \tilde \gamma_t$ for all $t \neq s$ and $\hat \gamma_s = (0,0)$, implies that at least one of the following conditions hold: \begin{enumerate} \item $\tilde \mu^{(-s)} = 0$ and $\sum_{t\neq s} \lambda^{(-s)}_t \leq B + \bar b$. \item $\left|B - \sum_{t\neq s} \tilde \lambda_t^{(-s)} \right| \leq \bar b$. \end{enumerate} Therefore, $\sum_{t\neq s} \lambda_t^{(-s)} - \sum_{t \neq s}\lambda_t \leq B + \bar b - \sum_{t \neq s}\lambda_t \leq \bar b + \bar b + \lambda_s \leq 3 \bar b$, as required to establish \eqref{eq:change-target-inter-2}. \end{proof} \subsection{Proof of Lemma~\ref{lemma:coupling}} \begin{proof}[Proof of Lemma~\ref{lemma:coupling}] It is known that FTRL is equivalent to Lazy Online Mirror Descent (for example, see \citealt{hazan2016introduction}). In particular, if we let $V_h(x,y)=h(x)-h(y)-\nabla h(y)^\top (x-y)$ denote the Bregman divergence w.r.t. $h(\cdot)$, then the FTRL update \eqref{eq:FTRL} of Algorithm~\ref{alg:dual-descent} can be equivalently written as: \begin{align*} &\theta_s = \nabla h(\mu_s)\\ &\theta_{s+1} = \theta_t - \eta \cdot g_s = \theta_t - \eta \cdot (\lambda_s - b_s(x_t'))\\ &\mu_{t+1} = \argmin_{\mu \in [0,\kappa]} V_h(\mu, (\nabla h)^{-1}(\theta_{s+1}))\,. \end{align*} where $x_t' \in \argmax_{x\in \mathcal{X}} f_s(x) - \mu_s \cdot b_s(x)$. We will use $\{\mu_t'\}_t$ and $\{\theta_t'\}_t$ to represent the dual and mirror iterates of Algorithm~\ref{alg:dual-descent} with target sequence $\{\lambda'_t\}_t$: \begin{align*} &\theta'_s = \nabla h(\mu'_s)\\ &\theta'_{s+1} = \theta'_t - \eta \cdot g_s = \theta'_t - \eta \cdot (\lambda'_s - b_s(y_t'))\\ &\mu'_{t+1} = \argmin_{\mu \in [0,\kappa]} V_h(\mu, (\nabla h)^{-1}(\theta'_{s+1}))\,. \end{align*} where $y_t' \in \argmax_{x\in \mathcal{X}} f_s(x) - \mu'_s \cdot b_s(x)$. We will first use induction on $s$ to prove the following statement, \begin{align}\label{eq:coupling-induction} \left| \theta_s - \theta'_s \right| \leq \eta \cdot \left\{ \sum_{t=1}^{s-1} |\lambda_t - \lambda_t'| \right\} + \eta \cdot \bar b\,. \end{align} The base case $s =1$ follows directly from our assumption that the initial iterates $\theta_1 = \nabla h(\mu_1) = \nabla h(\mu_1') = \theta_2$ are the same. Suppose \eqref{eq:coupling-induction} holds for $s \in [T-1]$ (Induction Hypothesis). Define $\theta_{s + 1/2} = \theta_s + \eta \cdot b_s(x_t')$ and $\theta'_{s + 1/2} = \theta'_s + \eta \cdot b_s(y_t')$. W.l.o.g. assume that $\theta_s \geq \theta_s'$. Due to the invertibility of $\nabla h$, we get that $\mu_s \geq \mu_s'$, and consequently Lemma~\ref{lemma:monotonicity} implies $b(x_t') \leq b(y_t')$. Consider the following cases: \begin{itemize} \item Case I: $\theta'_{s+1/2} \leq \theta_{s+1/2}$. Then, $\theta_{s+1/2} - \theta'_{s+1/2} = \theta_s - \theta'_{s} + \eta \cdot (b(x_t') - b(y_t')) \leq \theta_s - \theta_s'$ because $b(x_t') \leq b(y_t')$. \item Case II: $\theta'_{s+1/2} \geq \theta_{s+1/2}$. Then, $\theta'_{s+1/2} - \theta_{s+1/2} = \theta'_s - \theta_{s} + \eta \cdot (b(x_t') - b(y_t')) \leq \eta \cdot \bar b$ because $\theta'_{s} \leq \theta_{s}$ and $b(y_t') - b(x_t') \leq \bar b$. \end{itemize} Therefore, in both cases we have \begin{align*} |\theta_{s+1/2} - \theta'_{s+1/2}| \leq \max\{\theta_s - \theta'_s, \eta \cdot\bar b\} \leq \eta \cdot \left\{ \sum_{t=1}^{s-1} |\lambda_t - \lambda_t'| \right\} + \eta \cdot \bar b\,. \end{align*} where we used the induction hypothesis in the second inequality. Consequently, we can write \begin{align*} |\theta_{s+1} - \theta'_{s+1}| &= \left|\theta_{s+1/2} - \eta \cdot \lambda_s + (\theta'_{s+1/2} - \eta \cdot \lambda'_s) \right|\\ &\leq |\theta_{s+1/2} - \theta'_{s+1/2}| + \eta \cdot |\lambda_s - \lambda'_s|\\ &\leq \eta \cdot \left\{ \sum_{t=1}^{s} |\lambda_t - \lambda_t'| \right\} + \eta \cdot \bar b\,. \end{align*} Hence, we have established \eqref{eq:coupling-induction} for all $s \in [T]$. Now, since $h$ is $\sigma$-strongly convex and differentiable, we have \begin{align*} \nabla h(x) - \nabla h(y) \geq \sigma \cdot (x - y) \qquad \forall\ x \geq y \,. \end{align*} Therefore, we have \begin{align}\label{eq:coupling-inter-1} \left| (\nabla h)^{-1}(\theta_s) - (\nabla h)^{-1}(\theta_s') \right| \leq \frac{1}{\sigma} \cdot |\theta_s - \theta'_s|\,. \end{align} To finish the proof, we will use the fact that Bregman projections are contractions in one dimensions, which we prove next. Consider any $x < 0$, then for any $\mu \in [0,\kappa]$, we have \begin{align*} V_h(\mu, x) - V_h(0,x) = h(\mu) - h(0) - \nabla h(x)^\top (\mu - 0) \geq h(\mu) - h(0) - \nabla h(0)^\top (\mu - 0) \geq 0\,, \end{align*} where the inequality follows from $\nabla h(0) \geq \nabla h(x)$ (convexity of $h(\cdot)$). Therefore, $\argmin_{\mu \in [0,\kappa]} V_h(\mu, x) = 0 = \argmin_{\mu \in [0,\kappa]} |\mu - x|$. Similarly, for $x > \kappa$ and $\mu \in [0,\kappa]$, we have \begin{align*} V_h(\mu, x) - V_h(\kappa, x) = h(\mu) - h(\kappa) - \nabla h(x)^\top (\mu - \kappa) \geq h(\mu) - h(\kappa) - \nabla h(\kappa)^\top (\mu - \kappa) \geq 0\,, \end{align*} where the inequality follows from $\nabla h(x) \geq \nabla h(\kappa)$ (convexity of $h(\cdot)$). Therefore, $\argmin_{\mu \in [0,\kappa]} V_h(\mu, x) = \kappa = \argmin_{\mu \in [0,\kappa]} |\mu - x|$. Consequently, we have shown that $\argmin_{\mu \in [0,\kappa]} V_h(\mu, x) = \argmin_{\mu \in [0,\kappa]} |\mu - x|$, i.e., the Bregman project is identical to the Euclidean projection in one dimension. Since Euclidean projection is a contraction, we get \begin{align*} \left| \mu_s - \mu'_s \right| &= \left| \argmin_{\mu \in [0,\kappa]} V_h(\mu, (\nabla h)^{-1}(\theta_{s+1})) - \argmin_{\mu \in [0,\kappa]} V_h(\mu, (\nabla h)^{-1}(\theta'_{s+1})) \right|\\ &= \left| \argmin_{\mu \in [0,\kappa]} |\mu - (\nabla h)^{-1}(\theta_{s+1}))| - \argmin_{\mu \in [0,\kappa]} |\mu - (\nabla h)^{-1}(\theta'_{s+1}))| \right|\\ &\leq \left| (\nabla h)^{-1}(\theta_s) - (\nabla h)^{-1}(\theta_s') \right|\,. \end{align*} Finally, combining this with \eqref{eq:coupling-induction} and \eqref{eq:coupling-inter-1}, we get \begin{align*} |\mu_s - \mu'_s| \leq \frac{\eta}{\sigma} \cdot \left\{ \sum_{t=1}^{s-1} |\lambda_t - \lambda_t'| \right\} + \frac{\eta}{\sigma} \cdot \bar b\,, \end{align*} as required. \end{proof} \subsection{Proof of Lemma~\ref{lemma:leave-one-out}} \begin{proof}[Proof of Lemma~\ref{lemma:leave-one-out}] Using the definitions of $\lambda_s$ and $\beta_s$, we can write \begin{align*} \mathbb{E}\left[ \lambda_s \big| \tilde \mu^{(-s)} \right] = \mathbb{E}\left[ \tilde b_s^*(\tilde \mu) \biggr|\ \tilde \mu^{(-s)} \right] \quad \text{ and } \quad \mathbb{E}\left[ \beta_s \big|\ \tilde \mu^{(-s)} \right] = \mathbb{E}\left[ \mathbb{E}_{\hat \gamma \sim \tilde \mathcal{P}_t} \left[ \hat b_s^*(\tilde\mu) \right] \biggr|\ \tilde \mu^{(-s)} \right]\,. \end{align*} Fix a trace $\{\tilde \gamma_t\}_t$. Observe that for any request \begin{align*} x^*(\tilde \gamma_s, \tilde \mu) = \begin{cases} \bar x &\text{if } \coeff(\tilde f_s) - \tilde \mu \cdot \coeff(\tilde b_s) \geq 0 \text{ and } \coeff(\tilde f_s) \neq 0\\ 0 &\text{otherwise} \end{cases}\,, \end{align*} and \begin{align*} x^*(\tilde \gamma_s, \tilde \mu^{(-s)}) = \begin{cases} \bar x &\text{if } \coeff(\tilde f_s) - \tilde \mu^{(-s)} \cdot \coeff(\tilde b_s) \geq 0 \text{ and } \coeff(\tilde f_s) \neq 0\\ 0 &\text{otherwise} \end{cases}\,. \end{align*} From Lemma~\ref{lemma:change-in-target}, we know that $\tilde \mu^{(-s)} \leq \tilde \mu$. Now, if $\coeff(\tilde f_s) = 0$, then $x^*(\tilde \gamma_s, \tilde \mu) = x^*(\tilde \gamma_s, \tilde \mu^{(-s)}) = 0$. Assume that $\coeff(\tilde f_s) > 0$ (and thus $\coeff(\tilde b_s) > 0$ because $f_s(x) \leq \kappa \cdot b(x)$), let $A \coloneqq \{\mu \geq 0 \mid \coeff(\tilde f_s) - \mu \cdot \coeff(\tilde b_s) < 0\}$ be the set of all dual variables that lead to $x^*(\tilde \gamma_s, \mu) = 0$. Define the dual functions: \begin{align*} q(\mu) \coloneqq \mu\cdot B + \sum_{t=1}^T \max_{x \in \mathcal{X}} \left\{ \tilde f_t(x) - \mu \cdot \tilde b_t(x) \right\} \quad \text{and} \quad q^{(-s)}(\mu) \coloneqq \mu\cdot B + \sum_{t\neq s} \max_{x \in \mathcal{X}} \left\{ \tilde f_t(x) - \mu \cdot \tilde b_t(x) \right\} \,. \end{align*} For contradiction, suppose $\tilde \mu \in A$ and $\tilde \mu^{(-s)} \notin A$. Since $A$ is open, there exists a point $\mu \in A$ such that $\mu = \alpha \cdot \tilde \mu + (1 - \alpha) \cdot \tilde \mu^{(-s)}$ for some $\alpha \in (0,1)$. Moreover, observe that the minimality of $\tilde \mu^{(-s)}$ implies $q^{(-s)}\left(\tilde \mu^{(-s)} \right) \leq q^{(-s)}(\mu)$ and $q^{(-s)}\left(\tilde \mu^{(-s)} \right) \leq q^{(-s)}(\tilde \mu)$. Therefore, as $q^{(-s)}$ is convex, we get \begin{align*} q^{(-s)}(\mu) \leq \alpha \cdot q^{(-s)}(\tilde \mu) + (1 - \alpha) \cdot q^{(-s)}\left(\tilde \mu^{(-s)} \right) \leq \alpha \cdot q^{(-s)}(\tilde \mu) + (1 - \alpha) \cdot q^{(-s)}(\tilde \mu^) = q^{(-s)}(\tilde \mu)\,. \end{align*} Now, observe that $q(\mu) = q^{(-s)}(\mu)$ for all $\mu \in A$. Therefore, $q(\mu) \leq q(\tilde \mu)$, which contradicts the fact that $\tilde \mu$ is the smallest minimizer of $q(\cdot)$. Hence, either $\tilde \mu, \tilde \mu^{(-s)} \in A$ or $\tilde \mu, \tilde \mu^{(-s)} \in A^c$, and as a consequence, we get $\tilde b_s^*(\tilde \mu) = \tilde b_s^*\left(\tilde \mu^{(-s)} \right)$. Furthermore, combining $\tilde \mu \geq \tilde \mu^{(-s)}$ (from Lemma~\ref{lemma:change-in-target}) and Lemma~\ref{lemma:monotonicity}, we also get $\hat b_s^* \left(\tilde \mu^{(-s)} \right) \geq \hat b_s^*(\tilde \mu)$ for every $\hat \gamma_s \in \S$. Therefore, \begin{align*} \mathbb{E}\left[ \lambda_s \big| \tilde \mu^{(-s)} \right] &= \mathbb{E}\left[ \tilde b_s^*(\tilde \mu) \biggr|\ \tilde \mu^{(-s)} \right]\\ &= \mathbb{E}\left[ \tilde b_s^*\left(\tilde \mu^{(-s)} \right) \biggr|\ \tilde \mu^{(-s)} \right]\\ &= \mathbb{E}_{\hat \gamma_s \sim \tilde \mathcal{P}_s}\left[ \hat b_s^*\left(\tilde \mu^{(-s)} \right) \biggr|\ \tilde \mu^{(-s)} \right]\\ &\geq \mathbb{E}\left[ \mathbb{E}_{\hat \gamma_s \sim \tilde \mathcal{P}_s}\left[ \hat b_s^*(\tilde \mu) \biggr|\ \tilde \mu^{(-s)} \right] \right]\\ &= \mathbb{E}\left[ \beta_s \big|\ \tilde \mu^{(-s)} \right]\,, \end{align*} where the third equality follows from the fact that $\tilde \gamma_s$ and $\tilde \mu^{(-s)}$ are independent of each other, which allows us to rename the variable from $\tilde \gamma_s \sim \tilde \mathcal{P}_s$ to $\hat \gamma_s \sim \tilde \mathcal{P}_s$. We combine this with the Tower Property of conditional expectations to finish the proof: \begin{align*} \mathbb{E} \left[ \mu_s^{(-s)} \cdot (\beta_s - \lambda_s) \right] = \mathbb{E}\left[ \mu_s^{(-s)} \cdot \mathbb{E} \left[ (\beta_s - \lambda_s) \biggr|\ \mu_s^{(-s)} \right] \right] = \mathbb{E}\left[ \mu_s^{(-s)} \cdot \left( \mathbb{E} \left[\beta_s \biggr|\ \mu_s^{(-s)} \right] - \mathbb{E} \left[\lambda_s \biggr|\ \mu_s^{(-s)} \right] \right) \right] \leq 0 \,. \end{align*} \qedhere \end{proof} \subsection{Proof of Theorem~\ref{thm:main-result}} \begin{proof}[Proof of Theorem~\ref{thm:main-result}] Theorem~\ref{thm:dual-descent-regret} and \eqref{eq:discrepancy-term} together imply that, with probability at least $1 - 1/T^2$, we have \begin{align*} \regret(A) = \fluid(\{\mathcal{P}_t\}_t) - \mathbb{E}_{\{\gamma_t\}_t \sim \prod_t \mathcal{P}_t}[R(A|\{\gamma_t\}_t)] \leq R_1 + R_2 + R_3 + \kappa \cdot r(T) + \kappa \bar b + 2(1 + \kappa) \cdot \sum_{t=1}^T \mathcal{W}(\mathcal{P}_t, \tilde \mathcal{P}_t) \,. \end{align*} From our choice of step size $\eta = \sqrt{d_R/T}$ and the observation that $\bar \lambda = \max_t \lambda_t \leq \bar b$, we get that \begin{align*} R_1 = \kappa \bar b + \frac{2(\bar b+ \bar \lambda)^2}{\sigma} \cdot \eta T + \frac{d_R}{\eta} \leq \kappa \bar b + \left( \frac{8 \bar b^2}{\sigma} + 1 \right) \cdot \sqrt{d_r T} \,. \end{align*} From \eqref{eq:excess-spend}, we know that \begin{align*} R_2 = \kappa \cdot \left( \left\{ \sum_{t=1}^T \lambda_t \right\} - B \right)^+\leq \kappa\bar b\,. \end{align*} Moreover, from Lemma~\ref{lemma:leave-one-out} and $\eta = \sqrt{d_R/T}$, we know that \begin{align*} R_3 = \sum_{s=1}^T \mathbb{E} \left[ \mu_s \cdot (\beta_s - \lambda_s) \right] \leq \frac{4 \eta \bar b^2}{\sigma} \cdot T = \frac{4\bar b^2}{\sigma} \cdot \sqrt{d_r T}\quad\,. \end{align*} Combining the above inequalities and plugging in $r(T) = 8 \bar b \sqrt{T \log(T)}$, we get that \begin{align*} \regret(A) \leq 3 \kappa \bar b + \left( \frac{12 \bar b^2}{\sigma} + 1 \right) \cdot \sqrt{d_r T} + 8 \kappa \bar b \sqrt{T \log(T)} + 2(1 + \kappa) \cdot \sum_{t=1}^T \mathcal{W}(\mathcal{P}_t, \tilde \mathcal{P}_t)\\ &\leq \end{align*} with probability at least $1 - 1/T^2$. On the other than, we always have $\regret(T) \leq \bar f T \leq \kappa \bar b T$. Hence, we get \begin{align*} \regret(A) &\leq \left(1 - \frac{1}{T^2} \right) \cdot \left[ 3 \kappa \bar b + \left( \frac{12 \bar b^2}{\sigma} + 1 \right) \cdot \sqrt{d_r T} + 8 \kappa \bar b \sqrt{T \log(T)} + 2(1 + \kappa) \cdot \sum_{t=1}^T \mathcal{W}(\mathcal{P}_t, \tilde \mathcal{P}_t) \right] + \frac{1}{T^2} \cdot \kappa \bar b T\\ &\leq 4 \kappa \bar b \sqrt{T \log(T)} + \left( \frac{12 \bar b^2}{\sigma} + 1 \right) \cdot \sqrt{d_r} \cdot \sqrt{T \log(T)} + 8 \kappa \bar b \sqrt{T \log(T)} + 2(1 + \kappa) \cdot \sum_{t=1}^T \mathcal{W}(\mathcal{P}_t, \tilde \mathcal{P}_t)\\ &= C_1 \cdot \sqrt{T \log(T)} + C_2 \cdot \sum_{t=1}^T \mathcal{W}(\mathcal{P}_t, \tilde \mathcal{P}_t) \end{align*} where $C_1 = \frac{12 \bar b^2 \sqrt{d_R}}{\sigma} + \sqrt{d_R} + 12 \kappa \bar b$ and $C_2 = 2(1+\kappa)$. \end{proof} \section{Missing Proofs from Section~\ref{sec:dual}} \subsection{Proof of Lemma~\ref{lemma:trace-dual}} \begin{proof}[Proof of Lemma~\ref{lemma:trace-dual}] Define $q(\mu) = \mu\cdot B + \sum_{t=1}^T \max_{x \in \mathcal{X}} \left\{\tilde f_t(x) - \mu \cdot \tilde b_t(x) \right\}$. Then, $q(\cdot)$ is a convex function of $\mu$ because the maximum of a collection of linear function is convex and the sum of convex function is also convex \citep{bertsekas2009convex}. Since $\tilde \mu \in \argmin_{\mu \geq 0} q(\mu)$, first-order condition of optimality (Proposition 5.4.7 of \citealt{bertsekas2009convex}) implies that one of the following statements holds: \begin{itemize} \item[(i)] $\tilde \mu = 0$ and there exists $v \in \partial q(0)$ such that $v \geq 0$. \item[(ii)] Zero is a sub-differential of $q$ at $\tilde \mu$, i.e., $0 \in \partial q(\tilde \mu)$. \end{itemize} Recall that the trace $\{\tilde \gamma_t\}_t$ is assumed to be in general position with probability one. Therefore, there is at most one time step for which $\argmax_{x \in \mathcal{X}} f_t(x) - \tilde \mu \cdot b_t(x)$ is not unique. Let $s$ be that time step. Now, note that the set of sub-gradients of the maximum of a collection of linear functions is equal to convex hull of gradients of all the linear functions which are binding (for example, see Chapter 5 of \citealt{bertsekas2009convex}). Hence, $v \in \partial q(\tilde\mu)$ implies the existence of $\mathcal{D}_s \in \Delta(\mathcal{X})$ such that \begin{align*} \text{Support}(\mathcal{D}_s) \subseteq \argmax_{x \in \mathcal{X}} \tilde f_s(x) - \tilde\mu \cdot \tilde b_s(x) \quad \text{ and } \quad v = B - \mathbb{E}_{x \sim \mathcal{D}_s}[\tilde b_s(x)] - \sum_{t\neq s}^T \tilde b_t^*(\tilde \mu) \,. \end{align*} where $x_t^*(\gamma_t, \tilde \mu)$ is the optimal solution to $\max_{x \in \mathcal{X}} \tilde f_t(x) - \tilde \mu \cdot \tilde b_t(x)$ as described in Definition~\ref{definition:profit-maximizing-decision}. Since $0 \leq b_s(x) \leq \bar b$ for all $x \in \mathcal{X}$, we get \begin{align*} \left| B - v - \sum_{t=1}^T \tilde b_t^*(\tilde \mu) \right| \leq \bar b\,, \end{align*} where we have used $0 \leq b_t(x) \leq \bar b$ for all $x \in \mathcal{X}$ and $t \in [T]$. Therefore, statements (i) and (ii) imply that either $\tilde \mu = 0$ and $\bar b + B - \sum_{t=1}^T \tilde b_t^*(\tilde \mu) \geq v \geq 0$, or $\left|B - \sum_{t=1}^T \tilde b_t^*(\tilde \mu) \right| \leq \bar b$, as required. \end{proof} \subsection{Proof of Theorem~\ref{thm:concentration}} \begin{proof}[Proof of Theorem~\ref{thm:concentration}] Define the hypothesis class \begin{align*} \mathcal{F}\coloneqq \{ (f,b) \mapsto b^*(\mu) \mid \mu \geq 0 \} \,. \end{align*} Let $\text{Rad}(\cdot)$ denote Radmacher complexity. Then, we know from PAC learning theory (for example see Chapter 26 of \citealt{shalev2014understanding}) that \begin{align}\label{eq:radmacher1} \Pr_{\{\tilde \gamma\}_t \sim \prod_t \tilde \mathcal{P}_t}\left( \sup_{\mu \geq 0} \left| \sum_{t=1}^T \tilde b_t^*(\mu) - \sum_{t=1}^T \mathbb{E}_{\hat \gamma_t \sim \tilde \mathcal{P}_t}\left[\hat b_t^*(\mu) \right] \right| \geq r(T) \right) \leq \frac{1}{T^2} \,. \end{align} for \begin{align*} r(T) \geq 2T \cdot \mathbb{E}_{\{\hat \gamma_t\}_t \sim \prod_t \tilde \mathcal{P}_t} \left[\text{Rad}(\mathcal{F}\ \circ\ \{\hat \gamma_t\}_t) \right] + 2\bar b \cdot \sqrt{T\log(2T)}\,. \end{align*} Let $H(\{\hat \gamma_t\}_t) = \left\{ \{\hat b_t^*(\mu) \}_t \mid \mu \geq 0 \right\}$ denote the set of all possible resource expenditure vectors that can be generated from a trace $\{\hat \gamma_t\}_t$, then \begin{align}\label{eq:radmacher2} \mathbb{E}_{\{\hat \gamma_t\}_t \sim \prod_t \tilde \mathcal{P}_t} \left[\text{Rad}(\mathcal{F}\ \circ\ \{\hat \gamma_t\}_t) \right] = \mathbb{E}_{\{\hat \gamma_t\}_t \sim \prod_t \tilde \mathcal{P}_t} \left[\text{Rad}(H(\{\hat\gamma_t\}_t))\right] = \frac{1}{T} \cdot \mathbb{E}_{\{\hat \gamma_t\}_t \sim \prod_t \tilde \mathcal{P}_t}\mathbb{E}_{\vec\sigma} \left[ \sup_{\mu \geq 0} \sum_{t=1}^T \sigma_t \cdot \hat b_t^*(\mu) \right]\,, \end{align} where $\{\sigma_t\}_t$ are independent Radmacher random variables. For a linear function $f:\mathbb{R} \to \mathbb{R}$, let $\coeff(f)$ denote its coefficient. Moreover, let $\bar x = \max_{x \in \mathcal{X}} x$. Then, observe that for a request $\gamma = (f,b)$ and dual variable $\mu \geq 0$, we have \begin{align*} x^*(\gamma, \mu) = \begin{cases} \bar x &\text{if } \coeff(f) - \mu \cdot \coeff(b) \geq 0 \text{ and } \coeff(f) \neq 0\\ 0 &\text{otherwise} \end{cases}\,. \end{align*} Therefore, for any request $\gamma = (f,b)$ with $\coeff(f) \neq 0$ and $\coeff(b) \neq 0$, there exists a critical $\mu^* = \coeff(f)/\coeff(b)$ such that \begin{align*} b^*(\mu) = \begin{cases} b(\bar x) &\text{if } \mu \leq \mu^*\\ 0 &\text{if } \mu > \mu^* \end{cases}\,. \end{align*} For $\gamma = (f,b)$ with $\coeff(f) = 0$ or $\coeff(b) \neq 0$, we have $b^*(\mu) = 0$ for all $\mu \geq 0$. Consider the trace $\{\hat \gamma_t\}_t$, and let $\mu^*_t$ be the critical dual solution for request $\hat \gamma_t$ as defined above. Then, the assumption that the trace is in general position (Assumption~\ref{assumption:general-position}) implies that the critical points $\{\mu^*_t\}_t$ are distinct. Consequently, we get that $\{\hat b_t^*(\mu)\}_t$ remains constant whenever $\mu$ lies between any two critical points. Since the total number of critical points is $T$, we get that $|H(\{\hat \gamma_t\}_t)| \leq T$. Therefore, Massart Lemma applies and we get \begin{align*} \text{Rad}(H(\{\hat\gamma_t\}_t)) \leq \bar b \cdot \sqrt{\frac{2 \log(T)}{T}}\,. \end{align*} Combining this with \eqref{eq:radmacher1} and \eqref{eq:radmacher2} yields the theorem. \end{proof} \subsection{Proof of Theorem~\ref{thm:learned-dual-regret}} \begin{proof}[Proof of Theorem~\ref{thm:learned-dual-regret}] By Assumption~\ref{assumption:general-position}, the request sequence $\{\gamma_t\}$ is in general position almost surely. Therefore, there is at most 1 time step such that $f_t(x_t') \neq f_t^*(\tilde\mu)$, call it $s$. Let $\zeta_A$ be the first time step $t$ in which $B_{t+1} \leq \bar b$, i.e., $\sum_{t=1}^{\zeta_A} b_t^*(\tilde \mu) \geq B - \bar b$. Then, \begin{align*} \mathbb{E}\left[ R(A|\{\gamma_t\}_t) \right] &= \mathbb{E}\left[ \sum_{t=1}^{\zeta_A} f_t(x_t') \right]\\ &\geq \mathbb{E}\left[ \sum_{t=1}^{\zeta_A} f_t^*(\tilde \mu) \right] - |f_s^*(\tilde\mu) - f_s(x_s')| \\ &\geq \mathbb{E}\left[ \sum_{t=1}^T f_t^*(\tilde \mu) \right] - \mathbb{E}\left[\sum_{t=\zeta_A +1}^T f_t^*(\tilde\mu) \right] - \bar f \\ &\geq \mathbb{E}\left[ \sum_{t=1}^T f_t^*(\tilde \mu) \right] - \mathbb{E}\left[\kappa \cdot \sum_{t=\zeta_A +1}^T b_t^*(\tilde\mu) \right] - \bar f \\ &\geq D(\tilde \mu| \{\mathcal{P}_t\}_t) - \mathbb{E}\left[ \tilde \mu \cdot \left(B - \sum_{t=1}^T b_t^*(\tilde \mu) \right) \right] - \mathbb{E}\left[\kappa \cdot \sum_{t=\zeta_A +1}^T b_t^*(\tilde \mu) \right] - \bar f\\ &\geq \fluid(\{\mathcal{P}_t\}_t) - \mathbb{E}\left[ \tilde \mu \cdot \left(B - \sum_{t=1}^T b_t^*(\tilde \mu) \right) \right] - \mathbb{E}\left[\kappa \cdot \sum_{t=\zeta_A +1}^T b_t^*(\tilde \mu) \right] - \bar f \,. \end{align*} Therefore, \begin{align*} \regret(A) \leq \mathbb{E}\left[ \kappa \cdot \sum_{t=\zeta_A +1}^T b_t^*(\tilde \mu) \right] + \mathbb{E}\left[ \tilde \mu \cdot \left(B - \sum_{t=1}^T b_t^*(\tilde \mu) \right) \right] + \bar f\,. \end{align*} In the remainder of the proof, we bound the first two terms on the RHS. For the first term, observe that \begin{align}\label{eq:excess-spend} \sum_{t =\zeta_A + 1}^T b_t^*(\tilde \mu) &\leq \left( \sum_{t=1}^T b_t^*(\tilde\mu) \right) - (B - \bar b) \nonumber \\ &= \left( \sum_{t=1}^T b_t^*(\tilde\mu) - \sum_{t=1}^T\tilde b_t^*(\tilde\mu) \right) - \left(B - \sum_{t=1}^T \tilde b_t^*(\tilde\mu) \right) + \bar b \nonumber \\ &\leq \left| \sum_{t=1}^T b_t^*(\tilde\mu) - \sum_{t=1}^T\tilde b_t^*(\tilde\mu) \right| + 2 \cdot \bar b \,, \end{align} where the first inequality follows from the definition of $\zeta_A$ and the last inequality follows from Lemma~\ref{lemma:trace-dual}. For the second term, observe that Lemma~\ref{lemma:trace-dual} implies \begin{align*} \tilde \mu \cdot \left(B - \sum_{t=1}^T b_t^*(\tilde \mu) \right) &= \tilde \mu \cdot \left(B - \sum_{t=1}^T \tilde b_t^*(\tilde \mu) \right) + \tilde \mu \cdot \left( \sum_{t=1}^T \tilde b_t^*(\tilde \mu) - \sum_{t=1}^T b_t^*(\tilde \mu) \right) \\ &\leq \tilde \mu \cdot \bar b + \tilde \mu \cdot \left| \sum_{t=1}^T \tilde b_t^*(\tilde \mu) - \sum_{t=1}^T b_t^*(\tilde \mu) \right| \,. \end{align*} Note that $\tilde \mu \leq \kappa$. This is because the definition of $\kappa$ implies that $\max_{x \in \mathcal{X}} f(x) - \mu \cdot b(x) = 0$ for all $\gamma = (f,b) \in \S$ and $\mu \geq \kappa$. Hence, \begin{align*} \mu\cdot B + \sum_{t=1}^T \max_{x \in \mathcal{X}} \left\{\tilde f_t(x) - \mu \cdot \tilde b_t(x) \right\} = \mu \cdot B < \kappa \cdot B= \kappa \cdot B + \sum_{t=1}^T \max_{x \in \mathcal{X}} \left\{\tilde f_t(x) - \kappa \cdot \tilde b_t(x) \right\} \end{align*} for all $\mu > \kappa$. Therefore, we get \begin{align}\label{eq:slackness-term} \tilde \mu \cdot \left(B - \sum_{t=1}^T b_t^*(\tilde \mu) \right) \leq \kappa \cdot \bar b + \kappa \cdot \left| \sum_{t=1}^T \tilde b_t^*(\tilde \mu) - \sum_{t=1}^T b_t^*(\tilde \mu) \right| \,. \end{align} Define $G$ to be the good event to be one in which the total expenditures under the trace and the requests sequence are close: \begin{align*} \sup_{\mu \geq 0} \left| \sum_{t=1}^T \tilde b_t^*(\mu) - \sum_{t=1}^T b_t^*(\mu) \right| \leq r(T) \,. \end{align*} Then, Theorem~\ref{thm:concentration} and Union Bound imply that $\Pr(G^c) \leq 2/T^2$ and $\Pr(G) \geq 1/2/T^2$. Finally, we can put it all together to get the required bound: \begin{align*} \regret(A) &\leq \mathbb{E}\left[ \kappa \cdot \sum_{t=\zeta_A +1}^T b_t^*(\tilde \mu) \right] + \mathbb{E}\left[ \tilde \mu \cdot \left(B - \sum_{t=1}^T b_t^*(\tilde \mu) \right) \right] + \bar f\\ &\leq \mathbb{E}\left[ \kappa \cdot \left| \sum_{t=1}^T \tilde b_t^*(\tilde \mu) - \sum_{t=1}^T b_t^*(\tilde \mu) \right| \right] + 2 \kappa \bar b + \mathbb{E}\left[ \kappa \cdot \left| \sum_{t=1}^T \tilde b_t^*(\tilde \mu) - \sum_{t=1}^T b_t^*(\tilde \mu) \right| \right] + \kappa \bar b + \kappa \bar b \\ &= 2 \kappa \cdot \mathbb{E}\left[\left| \sum_{t=1}^T \tilde b_t^*(\tilde \mu) - \sum_{t=1}^T b_t^*(\tilde \mu) \right|\ \biggr|\ G \right] \Pr(G) + 2 \kappa \cdot \mathbb{E}\left[\left| \sum_{t=1}^T \tilde b_t^*(\tilde \mu) - \sum_{t=1}^T b_t^*(\tilde \mu) \right|\ \biggr|\ G^c \right] \Pr(G^c) + 4 \kappa \bar b\\ &\leq 2 \kappa \cdot r(T) + 2 \kappa \cdot 2 T \bar b \cdot \frac{2}{T^2} + 4\kappa \bar b\\ &\leq 12 \kappa \bar b + 2 \kappa r(T)\,. \qedhere \end{align*} \end{proof} \section{Fluid Benchmark is Stronger}\label{appendix:fluid-relaxation} \begin{proposition} For any collection of request distributions $\{\mathcal{P}_t\}_t$, we have $\mathbb{E}_{\{\gamma_t\}_t}[\opt(\{\gamma_t\}_t)] \leq \fluid(\{\mathcal{P}_t\}_t)$. \end{proposition} \begin{proof} Fix any request sequence $\{\gamma_t\}_t$ and let $\{x_t^*\}_t$ be an optimal solution to the corresponding hindsight optimization problem $\opt(\{\gamma_t\}_t)$. Then, $x_t(\gamma) = x_t^*$ for all $\gamma \in \S$ is a feasible solution of $\fluid(\{\mathcal{P}_t\})$ and consequently, we have $\opt(\{\gamma_t\}_t) \leq \fluid(\{\mathcal{P}_t\}_t)$. Since the request sequence $\{\gamma_t\}_t$ was arbitrary, we have $\mathbb{E}_{\{\gamma_t\}_t}[\opt(\{\gamma_t\}_t)] \leq \fluid(\{\mathcal{P}_t\}_t)$, as required. \end{proof} \section{General Position}\label{appendix:general-position} Given any collection of request distributions $\{\mathcal{P}_t\}_t$ (which may or may not satisfy Assumption~\ref{assumption:general-position}), we can define perturbed distributions $\{\hat \mathcal{P}_t\}_t$ to capture the distribution of perturbed requests $\hat \gamma_t = (\hat f_t, \hat b_t)$ generated using the following two step procedure: (i) Draw a request $\gamma_t = (f_t, b_t)$ according to the unperturbed distributions $\mathcal{P}_t$; (ii) Add a perturbation by setting $\hat f_t(x) = f_t(x) + \epsilon_t \cdot x$ for all $x \in \mathcal{X}$, where $\epsilon_t \sim \text{Unif}([0,a])$, and leave the consumption function unchanged $\hat b_t( \cdot) = b_t(\cdot)$. Then, $\{\hat \mathcal{P}_t\}_t$ satisfy Assumption~\ref{assumption:general-position} and $\left| \fluid(\{\mathcal{P}_t\}_t) - \fluid(\{\hat \mathcal{P}_t\}_t) \right| \leq a \cdot T$, where $a > 0$ can be made arbitrarily small. \section{Efficiently Computing the Target Sequence}\label{appendix:fast-implmentation} \begin{algorithm}[t!] \SetAlgoLined \textbf{Input:} Trace $\{\tilde \gamma_t\}_t$ in general position and sorted in increasing order of $\coeff(\tilde f_t)/\coeff(\tilde b_t)$.\\ \textbf{Initialize:} Total payment $P= 0$ and target sequence $\lambda_t = 0$ for all $t \in [T]$.\\ \For{$t = T, \ldots, 0$}{ \If{$P + \tilde b_t(\bar x) > B$}{Set $\lambda_t \leftarrow \tilde b_t(\bar x)$, and set $\tilde \mu = \coeff(\tilde f_t)/\coeff(\tilde b_t)$. \textbf{Break}.} \Else{Update total payment $P \leftarrow P + \tilde b_t(\bar x)$ and set $\lambda_t \leftarrow \tilde b_t(\bar x)$.} } \Return{Dual variable $\tilde \mu$, target sequence $\{\lambda_t\}_t$} \caption{Learning the Dual from the Trace} \label{alg:efficient-trace-dual} \end{algorithm} In this section, we describe an efficient procedure for computing the empirical optimal dual solution $\tilde \mu$ and the target sequence $\{\lambda_t\}_t$. Consider a trace $\{\tilde \gamma_t\}_t$ and set $\tilde \gamma_0 = (f_0,b_0)$ such that $f_0(x) = b_0(x) = 0$ for all $x \in \mathcal{X}$. Without loss of generality, we will assume that $\{\tilde \gamma_t\}_t$ is sorted in increasing order of $\coeff(\tilde f_t)/\coeff(\tilde b_t)$ (assume $0/0 = 0$), i.e., \begin{align*} \frac{\coeff(\tilde f_s)}{\coeff( \tilde b_s)} \leq \frac{\coeff(\tilde f_t)}{\coeff( \tilde b_t)} \quad \forall\ s \leq t\,. \end{align*} This can be easily achieved by maintaining a sorted array with $O(\log(T))$ insertion time or sorting the array with $O(T \log(T))$ processing time. Moreover, since the trace $\{\tilde \gamma_t\}_t$ is in general position by Assumption~\ref{assumption:general-position}, all the $\coeff(\tilde f_t)/ \coeff(\tilde b_t)$ are distinct for $t \in [T]$. \begin{theorem} $\tilde \mu$ returned by Algorithm~\ref{alg:efficient-trace-dual} is the smallest element in $\argmin_{\mu \geq 0} \mu\cdot B + \sum_{t=1}^T \max_{x \in \mathcal{X}} \left\{ \tilde f_t(x) - \mu \cdot \tilde b_t(x) \right\} $. Moreover, $\lambda_t = b_t^*(\tilde \mu)$ for all $t \in [T]$. \end{theorem} \begin{proof} Set $q(\mu) = \mu\cdot B + \sum_{t=1}^T \max_{x \in \mathcal{X}} \left\{ \tilde f_t(x) - \mu \cdot \tilde b_t(x) \right\}$. First, we show that the dual variable $\tilde \mu$ is smallest element in $\argmin_{\mu \geq 0} q(\mu)$. To do so, we consider the following two cases: \begin{itemize} \item $\tilde \mu = 0$. In this case, the `If' condition implies that there exists $s \in [T]$ such that $\sum_{t=s}^T \tilde b_t(\bar x) \leq B$ and $\coeff(\tilde f_t) = 0$ for all $t< s$. Moreover, we have $0 \in \argmax_{x \in \mathcal{X}} \left\{ \tilde f_t(x) - \mu \cdot \tilde b_t(x) \right\}$ for all $t < s$ and $\bar x \in \argmax_{x \in \mathcal{X}} \left\{ \tilde f_t(x) - \mu \cdot \tilde b_t(x) \right\}$ for all $t \geq s$. Now, note that the set of sub-gradients of the maximum of a collection of linear functions is equal to convex hull of gradients of all the linear functions which are binding (for example, see Chapter 5 of \citealt{bertsekas2009convex}). Therefore, $B - \sum_{t=s}^T \tilde b(\bar x) \in \partial q(0)$. Since $B - \sum_{t=s}^T \tilde b(\bar x) \geq 0$, the definition of a subgradient implies that $q(0) \leq q(\mu)$ for all $\mu \geq 0$. Hence, we have shown that $\tilde \mu$ is the smallest minimizer of $q(\cdot)$, as required. \item $\tilde \mu > 0$. In this case, the `If' condition implies that there exists $s \in [T]$ such that $\sum_{t=s+1}^T \tilde b_t(\bar x) < B$, $\sum_{t=s}^T \tilde b_t(\bar x) > B$ and $\tilde f_s(x) - \tilde \mu \cdot \tilde b_s(x) = 0$ for all $x \in \mathcal{X}$. Moreover, we have $0 \in \argmax_{x \in \mathcal{X}} \left\{ \tilde f_t(x) - \mu \cdot \tilde b_t(x) \right\}$ for all $t < s$, $\bar x \in \argmax_{x \in \mathcal{X}} \left\{ \tilde f_t(x) - \mu \cdot \tilde b_t(x) \right\}$ for all $t > s$ and $\{0,\bar x\} \subseteq \argmax_{x \in \mathcal{X}} \left\{ \tilde f_s(x) - \mu \cdot \tilde b_s(x) \right\}$. Now, select a $\lambda \in [0,1]$ such that \begin{align*} B - \lambda \cdot \tilde b_s(0) + (1 - \lambda) \cdot \tilde b_s(\bar x) + \sum_{t=s+1}^T \tilde b_t(\bar x) = 0\,. \end{align*} Now, note that the set of sub-gradients of the maximum of a collection of linear functions is equal to convex hull of gradients of all the linear functions which are binding (for example, see Chapter 5 of \citealt{bertsekas2009convex}). Therefore, $0 =B - \lambda \cdot \tilde b_s(0) + (1 - \lambda) \cdot \tilde b_s(\bar x) + \sum_{t=s+1}^T \tilde b_t(\bar x) \in \partial q(\tilde\mu)$. Consequently, the definition of a subgradient implies that $q(0) \leq q(\mu)$ for all $\mu \geq 0$. Finally, consider any $\mu < \tilde \mu$. Then, $\tilde f_s(x) - \mu \cdot \tilde b_s(x) > 0$, which further implies $\{\bar x\} = \argmax_{x \in \mathcal{X}} \left\{ \tilde f_t(x) - \mu \cdot \tilde b_t(x) \right\}$ for all $t \geq s$. Therefore, for any $\{x_t\}_t$ such that $x_t \in \argmax_{x \in \mathcal{X}} \left\{ \tilde f_t(x) - \mu \cdot \tilde b_t(x) \right\}$, we have $B - \sum_{t=1}^T \tilde b_t(x_t) > 0$. Hence, $v > 0$ for all $v \in \partial q(\mu)$ and consequently $\mu$ is a minimizer of $q(\cdot)$. Hence, we have shown that $\tilde \mu$ is the smallest minimizer of $q(\cdot)$, as required. \end{itemize} Finally, we show that $\lambda_t = \tilde b_t^*(\tilde \mu)$ for all $t \in [T]$. Let $s$ be the value of $t$ at which the `For' loop terminates. From the definition of $\tilde \mu$, we have $\{\bar x\} = \argmax_{x \in \mathcal{X}} \left\{ \tilde f_t(x) - \tilde \mu \cdot \tilde b_t(x) \right\}$ for all $t > s$, $\mathcal{X} = \argmax_{x \in \mathcal{X}} \left\{ \tilde f_s(x) - \tilde \mu \cdot \tilde b_s(x) \right\}$ and $\{ 0 \} = \argmax_{x \in \mathcal{X}} \left\{ \tilde f_t(x) - \tilde \mu \cdot \tilde b_t(x) \right\}$ for all $t < s$. Therefore, $\tilde b_t^*(\tilde \mu) = \tilde b_t(\bar x) = \lambda_t$ for all $t \geq s$ and $\tilde b_t^*(\tilde \mu) = \tilde b_t(0) = \lambda_t$ for all $t < s$. \end{proof} \section{Application to Budget Pacing}\label{sec:application} Here we discuss how the budget pacing problem fits as a special case of the online resource allocation problem that we study in this paper. Consider the setting in which a budget-constrained advertiser repeatedly participates in $T$ second-price auctions. For simplicity, assume that all ties are broken in favor of this advertiser. Let $v_t$ and $d_t$ denote her value and the highest competing bid in the $t$-th auction respectively. Moreover, let $B$ denote her budget, which represents the maximum amount she is willing to spend over all $T$ auctions. We will assume that the tuple $(v_t, d_t)$ is drawn from some distribution $\mathcal{P}_t$, independently of all other auctions. Now, observe that every bid of the advertiser results in one of two possible outcomes: (i) she bids greater than or equal to $d_t$, wins the auction, gains utility $v_t - d_t$ and pays $d_t$; (ii) she bids strictly less than $d_t$, loses the auction, gains zero value and pays zero. Thus, corresponding to the tuple $(v_t, d_t)$, we can define a corresponding request $\gamma_t$ with linear reward function $f_t(x) = (v_t - d_t) \cdot x$ and linear consumption function $b_t(x) = d_t \cdot x$, for the action space $x \in \{0,1\} = \{\text{lose}, \text{win}\}$. Similarly, corresponding to the sample trace of tuples $\{(\tilde v_t, \tilde d_t)\}_t$, we can define a trace $\{\tilde \gamma_t\}_t$ for the online allocation problem. This defines a corresponding instance of the online allocation problem. Since every bid either results in either a win or loss, the maximum expected utility (value - payment) that the advertiser can earn subject to her budget constraint is bounded above by $\fluid(\{\mathcal{P}_t\}_t)$ for this instance. Finally, consider step $t$ of Algorithm~\ref{alg:dual-descent} on this instance. The decision $x_t$ is calculated as $x_{t} \in \argmax_{x\in\mathcal{X}_t}\left\{f_{t}(x)-\mu_{t} \cdot b_{t}(x)\right\}$. Therefore, $x_t = 1$ if $v_t - d_t \geq \mu d_t$, or equivalently $v_t/(1 + \mu_t) \geq d_t$, and $x_t = 0$ otherwise. Observe that, in a second price auction, if the advertiser bids $v_t/(1 + \mu_t)$, she will win ($x_t = 1$) if $v_t/(1 + \mu_t) \geq d_t$ and lose ($x_t = 0$) otherwise. Thus, by bidding $v_t/(1 + \mu_t)$, she can simulate the actions of Algorithm~\ref{alg:dual-descent} for the online allocation instance. Moreover, she does not require knowledge of the competing bid $d_t$ to compute her bid, which is crucial because $d_t$ is not known in practice. Once the auction is over, the expenditure $b_t(x_t) = d_t \cdot x_t$ is revealed to the advertiser. She can then use it to update the dual iterate according to \eqref{eq:FTRL}. \section{Dual FTRL with Target Rate Estimation}\label{sec:descent} In this section, we will develop an algorithm based on Dual Follow-The-Regularized-Leader (FTRL) that achieves near-optimal regret with a single trace, and is robust to discrepancies between the sampling distributions and request distributions. Now, if one had complete knowledge of the sampling distributions $\{\tilde \mathcal{P}_t\}_t$, then one can solve $\fluid(\{\tilde \mathcal{P}_t\}_t)$ to find an optimal solution and run Dual Gradient Descent with the goal of spending the same as the optimal solution at each time step. It is known from \citet{jiang2020online} that this approach achieves $O(\max\{\sqrt{T}, \sum_{t=1}^T \mathcal{W} (\tilde \mathcal{P}_t, \mathcal{P}_t)\})$ regret, thereby making it rate optimal and robust to discrepancies. However, with just a single sample from each of distributions $\tilde \mathcal{P}_t$, we are far from having complete knowledge of $\{\tilde \mathcal{P}_t\}_t$. Despite this apparent lack of data, a careful analysis of Dual FTRL will allow us to show that it achieves near-optimal regret rate in a robust manner. \subsection{Dual Follow-The-Regularized-Leader} \begin{algorithm}[t!] \SetAlgoLined {\bf Input:} Initial resource endowment $B_1 = B$, target consumption sequence $\{\lambda_t\}_{t=1}^T$, regularizer $h: \mathbb{R} \rightarrow \mathbb{R}$ and step-size $\eta$. \\ Set initial dual solution $\mu_1 = \argmin_{\mu \in [0,\kappa]} h(\mu)$.\\ \For{$t=1,\ldots,T$}{ Receive request $\gamma_t = (f_t, b_t) \sim \mathcal{P}_t$.\\ Make the primal decision $x_t$ and update the remaining resources $B_t$: \begin{align} &{x}'_{t} \in \argmax_{x\in\mathcal{X}_t}\left\{f_{t}(x)-\mu_{t} \cdot b_{t}(x)\right\} \ ,\label{eq:primal_decision} \\ &x_{t}=\begin{cases} {x}'_t & \text{ if } b_t({x}'_t)\le B_t \\ 0 & \text{ otherwise} \end{cases}\ , \nonumber \\ &B_{t+1} = B_t - b_t(x_t) . \nonumber \end{align} Obtain a sample sub-gradient of the dual function $D(\mu|\mathcal{P}_t, \lambda_t)$: $g_t = \lambda_t -b_t(x_t')$. Update the dual iterate with FTRL: \begin{align}\label{eq:FTRL} &\mu_{t+1} = \argmin_{\mu \in [0,\kappa]} \left\{ \eta \sum_{r=1}^t g_r \cdot \mu + h(\mu) \right\} \,, \end{align} } \caption{Dual Follow-The-Regularized-Leader} \label{alg:dual-descent} \end{algorithm} The non-stationarity of the request distributions necessitates the need for Dual FTRL that can incorporate target resource consumptions (Algorithm~\ref{alg:dual-descent}). It takes as input a target sequence $\{\lambda_t\}_{t=1}^T$ which specifies $\lambda_t \geq 0$ to be the amount of resource Dual FTRL should attempt to consume at time $t$. Moreover, like FTRL \citep{shalev2012online, hazan2016introduction}, it also takes as input a regularizer $h(\cdot)$, an initial dual variable $\mu_1$ and a step-size $\eta$. We will make the standard assumption that the regularizer $h(\cdot)$ is differentiable and is $\sigma$-strongly convex in the $\|\cdot \|_1$ norm. Before stating the performance bound of Algorithm~\ref{alg:dual-descent}, we introduce some preliminaries. Given a budget of $\beta_t$ for period $t \in [T]$, the optimal expected reward which can be collected in period $t$ is captured by the following fluid optimization problem: \begin{align*} \fluid(\mathcal{P}_t, \beta_t) \coloneqq \text{max} \quad & \mathbb{E}[f_t(x_t(\gamma_t)]\\ \text{s.t.} \quad & \mathbb{E}[b_t(x_t(\gamma_t))] \leq \beta_t\\ &x_t: \S \to \mathcal{X} \,. \end{align*} The dual function of $\fluid(\mathcal{P}_t, \beta_t)$ is given by \begin{align*} D(\mu|\mathcal{P}_t, \beta_t) \coloneqq \mu \cdot \beta_t + \mathbb{E}\left[\max_{x \in \mathcal{X}} \left\{f_t(x) - \mu \cdot b_t(x) \right\} \right]\,, \end{align*} for any $\mu \geq 0$. Then, by weak duality, we have $\fluid(\mathcal{P}_t, \beta_t) \leq D(\mu| \mathcal{P}_t, \beta_t)$ for all $\mu \geq 0$. Moreover, since dual functions are always convex (they are the suprema of linear functions), the dual function $D(\cdot|\mathcal{P}_t, \beta_t)$ is convex. Theorem~\ref{thm:dual-descent-regret} states a general regret bound for Algorithm~\ref{alg:dual-descent} with an arbitrary target sequence $\{\lambda_t\}_t$ and against a general benchmark $\sum_{t=1}^T D(\mu_t|\mathcal{P}_t, \beta_t)$. Since $\fluid(\mathcal{P}_t, \beta_t) \leq D(\mu| \mathcal{P}_t, \beta_t)$ by weak duality, Theorem~\ref{thm:dual-descent-regret} also characterizes the performance against the weaker benchmark $\sum_{t=1}^T \fluid(\mathcal{P}_t, \beta_t)$, which is simply the optimal expected reward the decision maker would collect if she spent $\beta_t$ at time $t$. \begin{theorem}\label{thm:dual-descent-regret} Consider Algorithm~\ref{alg:dual-descent} with target consumption sequence $\{\lambda_t\}_t$, regularizer $h(\cdot)$ and step-size $\eta$. Then, for a benchmark sequence $\{\beta_t\}_t$, we have \small \begin{align*} \mathbb{E}\left[ \left\{ \sum_{t=1}^T D(\mu_t|\mathcal{P}_t, \beta_t) \right\} - R(A|\{\gamma_t\}_t) \right] \leq\ R_1 + R_2 + R_3 \,, \end{align*} \normalsize where \vspace{-0.8em} \small \begin{itemize} \item $R_1 = \kappa \bar b + \frac{2(\bar b+ \bar \lambda)^2}{\sigma} \cdot \eta T + \frac{d_R}{\eta}$, for $\bar \lambda = \max_t\lambda_t$ and $d_R = \max\{h(0) - h(\mu_1), h(\kappa) - h(\mu_1)\}$. \item $R_2 = \kappa \cdot \left( \left\{ \sum_{t=1}^T \lambda_t \right\} - B \right)^+$, \item $R_3 = \mathbb{E}\left[ \sum_{t=1}^T \mu_t \cdot (\beta_t - \lambda_t) \right]$. \end{itemize} \normalsize \end{theorem} Theorem~\ref{thm:dual-descent-regret} decomposes the regret of Algorithm~\ref{alg:dual-descent} into three terms, where (i) $R_1$ is simply the regret associated with the FTRL algorithm in the OCO setting \citep{hazan2016introduction}; (ii) $R_2$ captures the overspending error, which is large whenever the total target consumption $\sum_{t=1}^T \lambda_t$ is in excess of the budget $B$; (iii) $R_3$ captures the underestimation error, which is a weighted sum over the amounts by which the target sequence $\{\lambda_t\}_t$ underestimates the benchmark sequence $\{\beta_t\}_t$, with weights equal to the dual iterates $\mu_t$. Observe that there is an inherent tension between the overspending error $R_2$ and the underestimation error $R_3$---$R_2$ can be made smaller by making the target consumptions $\{\lambda_t\}_t$ smaller, but this in turn makes $R_3$ bigger, and vice versa. To obtain the desired performance guarantees for Algorithm~\ref{alg:dual-descent} (see Theorem~\ref{thm:main-result}), we need to carefully choose the benchmark sequence $\{\beta_t\}_t$ and the target sequence $\{\lambda_t\}_t$, which is what we do next (see \eqref{eq:benchmark-target-def}). We go on to show that \begin{itemize} \item Our choice of target sequence does not overspend too much. In particular, it satisfies $R_2 \leq \kappa \cdot \bar b$ (see \eqref{eq:R2}). \item Our choice of benchmark sequence $\{\beta_t\}_t$ ensures \tiny \begin{align*} \sum_{t=1}^T D(\mu_t| \mathcal{P}_t, \beta_t) \geq \fluid(\{\mathcal{P}_t\}_t) - \tilde O\left(\max\left\{\sqrt{T}, \sum_{t=1}^T \mathcal{W}(\mathcal{P}_t, \tilde\mathcal{P}_t) \right\} \right) \end{align*} \normalsize i.e., the benchmark in Theorem~\ref{thm:dual-descent-regret} is at most $\tilde O\left(\max\left\{\sqrt{T}, \sum_{t=1}^T \mathcal{W}(\mathcal{P}_t, \tilde\mathcal{P}_t) \right\} \right)$ away from our desired benchmark $\fluid(\{\mathcal{P}_t\}_t)$ (see Lemma~\ref{lemma:discrepancy-term} and the discussion that follows). \item Moreover, our choice of the sequences in combination with an intricate argument, consisting of a coupling lemma and a leave-one-out thought experiment, allows use to prove $R_3 = O(\sqrt{T})$ (see Subsection~\ref{subsec:R3}). \end{itemize} Finally in Subsection~\ref{subsec:putting-together}, we combine everything to prove the desired regret bound for Algorithm~\ref{alg:dual-descent}. \subsection{Choosing the Target and Benchmark Sequences} We define the target and benchmark sequences using the empirical optimal dual solution computed from the trace $\{\tilde \gamma_t\}_t$: \begin{align*} \tilde \mu \in \argmin_{\mu \geq 0} \mu\cdot B + \sum_{t=1}^T \max_{x \in \mathcal{X}} \left\{ \tilde f_t(x) - \mu \cdot \tilde b_t(x) \right\} \quad\,. \end{align*} If there are multiple minimizers, set $\tilde \mu$ to be the smallest one. Given the empirical optimal dual solution $\tilde \mu$, the target and benchmark sequences are defined as \begin{align}\label{eq:benchmark-target-def} \beta_t = \mathbb{E}_{\hat \gamma \sim \tilde \mathcal{P}_t} \left[ \hat b_t^*(\tilde\mu) \right] \quad \text{ and } \quad \lambda_t = \tilde b_t^*(\tilde \mu) \,. \end{align} In other words, the benchmark sequence is the expected consumption and the target sequence is the empirical consumption on the trace if we were to make profit-maximizing decisions using the empirical optimal dual solution $\tilde \mu$ as the price of the resource. Instead of learning the empirical optimal dual $\tilde \mu$ and directly making decisions with it like we did in Algorithm~\ref{alg:learned-dual}, we use $\tilde \mu$ to learn the empirical consumptions $\{\lambda_t\}_t$ and use Algorithm~\ref{alg:dual-descent} to track this target. Importantly, the benchmark sequence $\{\beta_t\}_t$ cannot be computed in practice because it requires full knowledge of the request distributions. Algorithm~\ref{alg:dual-descent} respects this limitation and does not require knowledge of the benchmark sequence $\{\beta_t\}_t$; we only use it for our analysis. Our choice of $\{\lambda_t\}_t$ and Lemma~\ref{lemma:trace-dual} immediately imply \vspace{-0.7em} \begin{align}\label{eq:R2} R_2 = \kappa \cdot \left( \left\{ \sum_{t=1}^T \lambda_t \right\} - B \right)^+\leq \kappa\cdot \bar b\,. \end{align} \vspace{-0.7em}Next, we show that, for our choice of the benchmark sequence $\{\beta_t\}_t$, the benchmark $\sum_{t=1}^T D(\mu_t|\mathcal{P}_t, \beta_t)$ of Theorem~\ref{thm:dual-descent-regret} is not too far from the desired benchmark $\fluid(\{\mathcal{P}_t\})$. \begin{lemma}\label{lemma:discrepancy-term} For any dual variable $\tilde \mu \geq 0$, dual iterates $\{\mu_t\}_t \in [0,\kappa]^T$ and benchmark sequence $\{\beta\}_t$ with $\beta_t = \mathbb{E}_{\hat \gamma \sim \tilde \mathcal{P}_t}[ \hat b^*(\tilde \mu)]$, we have \vspace{-0.7 em} \small \begin{align*} \sum_{t=1}^T D(\mu_t | \mathcal{P}_t, \beta_t) \geq &\fluid(\{\mathcal{P}_t\}_t) - \tilde \mu \cdot \left(B - \sum_{t=1}^T \beta_t \right)\\ &- 2(1 + \kappa) \cdot \sum_{t=1}^T \mathcal{W}(\mathcal{P}_t, \tilde \mathcal{P}_t) \,. \end{align*} \normalsize \end{lemma} \vspace{-0.7em} Observe that Theorem~\ref{thm:concentration} implies that, with probability at least $1 - 1/T^2$, we have $\left| \sum_{t=1}^T \beta_t - \sum_{t=1}^T \lambda_t \right| \leq r(T)$. Combining this with Lemma~\ref{lemma:trace-dual} yields \begin{align}\label{eq:discrepancy-term} \tilde \mu \cdot \left(B - \sum_{t=1}^T \beta_t \right) &\leq \tilde \mu \cdot \left(r(T) + B - \sum_{t=1}^T \lambda_t \right) \nonumber \\ &= \tilde \mu \cdot r(T) + \tilde \mu \cdot \left(B - \sum_{t=1}^T \lambda_t \right) \nonumber \\ &\leq \tilde \mu \cdot \left(r(T) + \bar b \right) \nonumber \\ &\leq \kappa \cdot r(T) + \kappa \bar b\,, \end{align} \vspace{-0.7em}thereby showing that the benchmark $\sum_{t=1}^T D(\mu_t|\mathcal{P}_t, \beta_t)$ of Theorem~\ref{thm:dual-descent-regret} is not too far from the desired benchmark $\fluid(\{\mathcal{P}_t\})$. In order to establish the desired regret and robustness guarantees for Algorithm~\ref{alg:dual-descent}, all that remains to show is that $R_3 \leq \tilde O( \sqrt{T})$. However, as we demonstrate in the next subsection, this step is rife with challenges. \subsection{Bounding $\mathbf{R_3}$}\label{subsec:R3} We begin with a brief discussion of the challenges involved in bounding $R_3$. It is illuminating to consider the slightly more permissive setting in which the decision maker has access to two sample traces: suppose in addition to trace $\{\tilde\gamma_t\}_t \sim \prod_t \tilde \mathcal{P}_t$, we had access to an additional trace $\{\dbtilde \gamma_t\}_t \sim \prod_t \tilde\mathcal{P}_t$. Then, we could compute $\tilde \mu$ using $\{\dbtilde \gamma_t\}_t$ as follows \begin{align*} \tilde \mu \in \argmin_{\mu \geq 0} \mu\cdot B + \sum_{t=1}^T \max_{x \in \mathcal{X}} \left\{ \dbtilde f_t(x) - \mu \cdot \dbtilde b_t(x) \right\} \quad\,, \end{align*} making it completely independent of $\{\tilde \gamma_t\}_t$. With this modified $\tilde \mu$, we continue to define $\{\beta_t\}_t, \{\gamma_t\}_t$ as before (see~\eqref{eq:benchmark-target-def}). As a consequence, we get that $\mu_s$ is completely determined by $\{\gamma_t\}_{t=1}^{s-1}$ and $\{\lambda_t\}_{t=1}^{s-1}$, with the latter being completely determined by $\tilde \mu$ and $\{\tilde \gamma_t\}_{t=1}^{s-1}$. This makes $\mu_s$ independent of $\lambda_s$ conditional on $\tilde \mu$, and consequently yields \scriptsize \begin{align*} \mathbb{E}\left[ \mu_s\cdot (\beta_s - \lambda_s) \big|\ \tilde \mu, \{\tilde \gamma_t, \gamma_t\}_{t=1}^{s-1} \right] = \mu_s \cdot \left( \beta_s - \mathbb{E}\left[\tilde b_s^*(\tilde \mu) \big|\ \tilde \mu\right] \right) = 0\,. \end{align*} \normalsize Thus, we can apply the Tower Rule of conditional expectations to get \tiny \begin{align*} R_3 &= \sum_{s=1}^T \mathbb{E}\left[\mu_s \cdot (\beta_s - \lambda_s) \right] = \sum_{t=1}^T \mathbb{E}\left[ \mathbb{E}\left[ \mu_s\cdot (\beta_s - \lambda_s) \big|\ \tilde \mu, \{\tilde \gamma_t, \gamma_t\}_{t=1}^{s-1} \right] \right] = 0\,. \end{align*} \normalsize \vspace{-1 em}It is straightforward to see that the bounds on $R_1$ and $R_2$ established in the previous subsection continue to hold in this two-trace setting. Therefore, two traces allow us to achieve the near-optimal $\tilde O(\sqrt{T})$-regret while being robust to discrepancies between $\tilde\mathcal{P}_t$ and $\mathcal{P}_t$. Although moving from two traces to one trace might appear to be a minor change, it introduces correlations that make the proof much more difficult. Observe that Algorithm~\ref{alg:dual-descent} determines $\mu_s$ using $\{\lambda_t\}_{t=1}^{s-1}$, all of which depend on $\tilde \mu$, which in turn is computed using the request $\tilde \gamma_s$. Furthermore, $\lambda_s$ directly depends on $\tilde \gamma_s$. Thus, $\mu_s$ and $\lambda_s$ are intricately correlated with each other, which breaks the aforementioned argument for the two-trace setting. Nonetheless, $R_3$ can still be shown to be small, as we note in the following lemma and prove in the remainder of this subsection. \begin{lemma}\label{lemma:R3} For all $s \in [T]$, we have \vspace{-0.5em} \begin{align*} R_3 = \sum_{s=1}^T \mathbb{E} \left[ \mu_s \cdot (\beta_s - \lambda_s) \right] \leq \frac{4 \eta \bar b^2}{\sigma} \cdot T\quad\,. \end{align*} \end{lemma} \vspace{-0.5em} We prove Lemma~\ref{lemma:R3} in the remainder of this subsection. The following lemma will find repeated use in the proof. In keeping with economic intuition, it shows that increasing the price (dual variable) leads to smaller consumption under the profit-maximzing decision. \begin{lemma}[Monotonicity]\label{lemma:monotonicity} For $\mu > \mu'$, request $\gamma = (f,b) \in \S$, $x \in \argmax_{z \in \mathcal{X}} \{f(z) - \mu \cdot b(z)\}$ and $x' \in \argmax_{z \in \mathcal{X}} \{f(z) - \mu' \cdot b(z)\}$, we have $b(x) \leq b(x')$. \end{lemma} Fix an $s \in [T]$. We will get around the correlation between $\mu_s$ and $\tilde \gamma_s$ by conducting the following leave-one-out thought experiment: suppose we remove the $s$-th sample $\tilde \gamma_s$, compute $\tilde \mu$ on the remaining trace $\{\tilde \gamma_t\}_{t \neq s}$, and run Algorithm~\ref{alg:dual-descent} with the resulting target sequence. More precisely, in this thought experiment, we set $\tilde \mathcal{P}_s$ to be the distribution which always serves the request $\gamma = (f,b)$ with $f(x) = b(x) = 0$ for all $x \in \mathcal{X}$. Thus, $\tilde f_s(x)= \tilde b_s(x) = \tilde f^*(\mu) = \tilde b^*(\mu) = 0$ for all $x \in \mathcal{X}$ and $\mu \geq 0$. We will use the superscript $(-s)$ to denote the various variables in this thought experiment: \vspace{-0.5em} \begin{itemize} \item $\tilde \mu^{(-s)} \in \argmin_{\mu \geq 0} \mu\cdot B + \sum_{t\neq s} \max_{x \in \mathcal{X}} \{\tilde f_t(x) - \mu \cdot \tilde b_t(x) \}$. If there are multiple minimizers, set $\tilde\mu^{(-s)}$ to be the smallest one amongst them. \item $\lambda_t^{(-s)} = \tilde b_t^* \left( \tilde \mu^{(-s)} \right)$ for all $t \in [T]$. \item $\mu_t^{(-s)}$ is the $t$-th iterate of Algorithm~\ref{alg:dual-descent} with the target consumption sequence $\left\{ \lambda_t^{(-s)} \right\}_t$. \end{itemize} \vspace{-0.5em} We begin by characterizing the impact of this change on the target consumption sequence. \begin{lemma}\label{lemma:change-in-target} For every sample trace $\{\tilde \gamma_t\}_t$, we have $\tilde \mu \geq \tilde \mu^{(-s)}$ and $\lambda_t \leq \lambda_t^{(-s)}$ for all $t \neq s$. Moreover, $\sum_{t=1}^{s-1} \left|\lambda_t^{(-s)} - \lambda_t \right| \leq 3 \bar b \,.$ \end{lemma} Lemma~\ref{lemma:change-in-target} shows that the target sequences $\{\lambda_t\}_t$ and $\{\lambda^{(-s)}_t\}_t$ are close to each other. Next, we couple the dual iterates $\mu_t$ and $\mu_t^{(-s)}$ generated by Algorithm~\ref{alg:dual-descent} to show that they never stray too far from each other whenever the target sequences are close. \begin{lemma}[Dual Iterate Coupling]\label{lemma:coupling} Let $\{\mu_t\}_t$ and $\{\mu_t'\}_t$ denote the iterates generated by Algorithm~\ref{alg:dual-descent} on the request sequence $\{\gamma_t\}_t$ for the target sequences $\{\lambda_t\}_t$ and $\{\lambda'_t\}_t$ respectively. Assume that the initial iterates are the same, i.e., $\mu_1 = \mu_1'$. Then, for all $s \in [T]$, we have \begin{align*} \left| \mu_s - \mu'_s \right| \leq \frac{\eta}{\sigma} \cdot \left\{ \sum_{t=1}^{s-1} |\lambda_t - \lambda_t'| \right\} + \frac{\eta}{\sigma} \cdot \bar b\,. \end{align*} \end{lemma} \vspace{-0.7em}Applying Lemma~\ref{lemma:coupling} with $\lambda_t' = \lambda_t^{(-s)}$ and using Lemma~\ref{lemma:change-in-target} yields $\left| \mu_s - \mu'_s \right| \leq \frac{\eta}{\sigma} \cdot \left\{ 3\bar b \right\} + \frac{\eta}{\sigma} \cdot \bar b = \frac{4 \eta \bar b}{\sigma} \,.$ Combining this with the fact that $|\beta_s - \lambda_s| \leq \bar b$, we get \tiny \begin{align}\label{eq:lemma-R3-inter} \mathbb{E} \left[ \mu_s \cdot (\beta_s - \lambda_s) \right] &= \mathbb{E} \left[ \left(\mu_s - \mu_s^{(-s)} \right) \cdot (\beta_s - \lambda_s) \right] + \mathbb{E} \left[ \mu_s^{(-s)} \cdot (\beta_s - \lambda_s) \right] \nonumber \\ &\leq \frac{4 \eta \bar b}{\sigma} \cdot \bar b + \mathbb{E} \left[ \mu_s^{(-s)} \cdot (\beta_s - \lambda_s) \right]\,. \end{align} \normalsize \vspace{-1em}The next lemma shows that the second term is non-positive. Its proof critically leverages the fact that the iterate $\mu_s^{(-s)}$ is independent of the $s$-th sample in the trace $\tilde \gamma_s$ (which is used to determine $\lambda_s$). This is in stark contrast to $\mu_s$ which depends on $\tilde \gamma_s$, and demonstrates the merit of our leave-one-out thought experiment. \begin{lemma}\label{lemma:leave-one-out} $\mathbb{E} \left[ \mu_s^{(-s)} \cdot (\beta_s - \lambda_s) \right] \leq 0$ for all $s \in [T]$. \end{lemma} Lemma~\ref{lemma:leave-one-out} in combination with \eqref{eq:lemma-R3-inter} yields $\mathbb{E} \left[ \mu_s \cdot (\beta_s - \lambda_s) \right] \leq 4 \eta \bar b^2/\sigma$. Summing over all $s \in [T]$ finishes the proof of Lemma~\ref{lemma:R3}. \subsection{Putting It All Together}\label{subsec:putting-together} In the previous subsections, we bounded $R_1$, $R_2$ and $R_3$, and related the benchmark $\sum_{t=1}^T D(\mu_t|\mathcal{P}_t, \beta_t)$ from Theorem~\ref{thm:dual-descent-regret} to our desired benchmark $\fluid(\{\mathcal{P}_t\}_t)$. Combining everything yields the following performance gaurantee for Algorithm~\ref{alg:dual-descent}. \begin{theorem}\label{thm:main-result} Let $A$ be Algorithm~\ref{alg:dual-descent} with target sequence $\{\lambda_t\}_t$, where $\lambda_t = \tilde b_t^*(\tilde \mu)$ (as defined in \eqref{eq:benchmark-target-def}), regularizer $h(\cdot)$ and step-size $\eta = \sqrt{d_R/ T}$, where $d_R = \max\{h(0) - h(\mu_1), h(\kappa) - h(\mu_1)\}$. Then, \vspace{-1em} \small \begin{align*} \regret(A) \leq C_1 \sqrt{T \log(T)} + C_2 \sum_{t=1}^T \mathcal{W}(\mathcal{P}_t, \tilde \mathcal{P}_t)\,. \end{align*} \normalsize where $C_1 = \frac{12 \bar b^2 \sqrt{d_R}}{\sigma} + \sqrt{d_R} + 12 \kappa \bar b$ and $C_2 = 2(1+\kappa)$. \end{theorem} Observe that the regret of Dual FTRL satisfies $\regret(A) = \tilde O(\sqrt{T})$ whenever $\sum_{t=1}^T \mathcal{W}(\mathcal{P}_t, \tilde \mathcal{P}_t) = \tilde O(\sqrt{T})$. In other words, Dual FTRL achieves near-optimal regret with a single trace as long as the total discrepancy $\sum_{t=1}^T \mathcal{W}(\mathcal{P}_t, \tilde \mathcal{P}_t)$ is not too large. Finally, we would also like to note that our algorithm is extremely efficient computationally. In particular, due to the equivalence of FTRL and ``Lazy" Online Mirror Descent (OMD) (see \citealt{hazan2016introduction}), each dual update in \eqref{eq:FTRL} can be computed in constant time by running Lazy OMD. Moreover, given a trace $\{\tilde \gamma_t\}$ which is sorted in increasing order of bang-per-buck $\coeff(\tilde f_t)/\coeff(\tilde b_t)$, the target sequence $\{\lambda_t\}_t$ can be computed in $O(T)$ steps (see Appendix~\ref{appendix:fast-implmentation} for details). \section{Warmup: Learning the Dual and Earning with It}\label{sec:dual} First, let us focus on the simpler case when $\tilde \mathcal{P}_t = \mathcal{P}_t$ for all $t \in [T]$, i.e., the sampling distributions are the same as the request distributions. At first glance, it may appear that only having access to one sample from each of request distributions $\mathcal{P}_t$ yields too little information to achieve near-optimal rewards. If one were to attempt to directly learn the optimal solution of $\fluid(\{\mathcal{P}_t\}_t)$, this initial impression would be accurate because of the high-dimensional nature of the space of all possible solutions $\{x_t(\cdot)\}_t$. Fortunately, we do not need to learn this high-dimensional information and can instead leverage the structure of the problem: the dual space is just one-dimensional and thereby amenable to learning. More precisely, the dual function $D(\mu | \{\mathcal{P}_t\}_t)$ of $\fluid(\{\mathcal{P}_t\}_t)$ at dual variable $\mu \geq 0$ is given by \small \begin{align*} &\max_{\{x_t(\cdot)\}_t} \sum_{t=1}^T \mathbb{E}[f_t(x_t(\gamma_t))] + \mu\left( B - \sum_{t=1}^T \mathbb{E}[b_t(x_t(\gamma_t))] \right) \\ =&\ \mu \cdot B + \sum_{t=1}^T \max_{x_t: \S \to \mathcal{X}} \mathbb{E}\left[ f_t(x_t(\gamma_t)) - \mu\cdot b_t(x_t(\gamma_t)) \right] \\ =&\ \mu \cdot B + \sum_{t=1}^T \mathbb{E}\left[ \max_{x_t \in \mathcal{X}} \left\{ f_t(x_t) - \mu \cdot b_t(x_t) \right\} \right] \,. \end{align*} \normalsize Throughout, we assume $\argmax_{x \in \mathcal{X}} \left\{ f(x) - \mu \cdot b(x)\right\}$ is non-empty for all requests $\gamma \in \S$ and dual solutions $\mu \geq 0$. If we treat the dual variable $\mu$ as the per-unit price of the resource, $\max_{x_t \in \mathcal{X}} \left\{f_t(x_t) - \mu \cdot b_t(x_t)\right\}$ captures the profit maximization problem. The following terminology would be helpful in working with the dual. \begin{definition}\label{definition:profit-maximizing-decision} For a request $\gamma = (f,b)$ and dual variable $\mu \geq 0$, let $x^*(\gamma, \mu)$ be the optimal solution of $\max_{x \in \mathcal{X}} \left\{f(x) - \mu \cdot b(x)\right\}$ with the largest value of $f(x)$. If there are multiple such solutions, pick one which minimizes $b(x)$. Moreover, let $f^*(\mu) \coloneqq f(x^*(\gamma, \mu))$ and $b^*(\mu) \coloneqq b(x^*(\gamma, \mu))$ be the corresponding reward and resource consumption respectively. \end{definition} We denote $D(\mu|\{\mathcal{P}_t\}_t) = \mu\cdot B + \sum_{t=1}^T \mathbb{E}[f_t^*(\mu) - \mu \cdot b_t^*(\mu)]$. Throughout this paper, we will repeatedly leverage weak duality, which is a central property of duals. We state the property here and refer the reader to any standard text on convex optimization (e.g., \citealt{bertsekas2009convex}) for a proof. \begin{proposition}[Weak Duality]\label{prop:global-weak-duality} For all request distributions $\{\mathcal{P}_t\}_t$ and dual variables $\mu \geq 0$, we have $D(\mu|\{\mathcal{P}_t\}_t) \geq \fluid(\{\mathcal{P}_t\}_t)$, i.e., \small \begin{align*} \sum_{t=1}^T \mathbb{E}[f_t^*(\mu)] \geq \fluid(\{\mathcal{P}_t\}_t) - \mu \cdot \left( B - \sum_{t=1}^T \mathbb{E}[b_t^*(\mu)] \right)\,. \end{align*} \normalsize \end{proposition} Observe that $\sum_{t=1}^T \mathbb{E}[f_t^*(\mu)]$ is exactly the expected reward the decision maker would receive if she had an infinite budget and she took actions which maximized profit with $\mu$ being the per-unit price of the resource. Moreover, $B - \sum_{t=1}^T \mathbb{E}[b_t^*(\mu)]$ is the amount by which the decision maker would underspend her budget in expectation if she were to take actions using $\mu$ as the price. Suppose we can find a dual variable $\mu \geq 0$ that satisfies approximate complementary slackness, i.e., $\mu$ satisfies at least one of the following statements: (1) $\mu = 0$ and maximizing profit with $\mu$ as the per-unit price results in total expenditure less than the budget $B$ \noneurips{($\sum_{t=1}^T b_t^*(\mu) \leq B$)} with high probability; (2) $\mu > 0$ and maximizing profit with $\mu$ as the per-unit price results in total expenditure close to the budget $B$ \noneurips{($\sum_{t=1}^T b_t^*(\mu) \approx B$)} with high probability. Then, if the decision maker were to use $\mu$ as the price and make decisions to maximize profit, she will not run out of budget too early and the complementary slackness term $\mu \cdot \left(B - \sum_{t=1}^T \mathbb{E}[b_t^*(\mu)] \right)$ would also be small. Therefore, such a $\mu$ would yield rewards that are close to $\fluid(\{\mathcal{P}_t\}_t)$, i.e., yield small regret, as required. We next describe how such a $\mu$ can be learned from the sample trace $\{\tilde \gamma_t\}$ when $\tilde \mathcal{P}_t = \mathcal{P}_t$ for all $t \in [T]$. We will assume that the distributions satisfy the following mild and standard assumption \citep{devanur2009adwords, agrawal2014dynamic} to exclude the degenerate case. \begin{assumption}[General Position]\label{assumption:general-position} The request sequence $\{\gamma_t\}_t \sim \prod_t \mathcal{P}_t$ is in general position almost surely: For any $\mu \geq 0$, there is at most one request with multiple profit maximizers, i.e., \begin{align*} \left| \left\{ t \in [T] : |\argmax_{x \in \mathcal{X}} \left\{ f_t(x) - \mu \cdot b_t(x)\right\}| > 1 \right\} \right| \leq 1 \,. \end{align*} Moreover, the sample trace $\{\tilde\gamma_t\}_t \sim \prod_t \tilde \mathcal{P}_t$ is also in general position almost surely. \end{assumption} Assumption~\ref{assumption:general-position} is made without any loss of generality because, as pointed out in \citet{devanur2009adwords} and \citet{agrawal2014dynamic}, adding an infinitesimally-small perturbation to the reward functions always results in perturbed distributions that satisfy Assumption~\ref{assumption:general-position} with only an infinitesimal change in the value of $\fluid(\{\mathcal{P}_t\}_t)$ (see Appendix~\ref{appendix:general-position} for a formal description). Assumption~\ref{assumption:general-position} ensures that there exists a dual solution $\tilde \mu \geq 0$ which spends close to the budget $B$ on the trace $\{\tilde\gamma_t\}_t$ if it is possible to do so. In fact, as the following lemma shows, the optimal empirical dual solution satisfies this property. \begin{lemma}\label{lemma:trace-dual} Suppose the trace $\{\tilde \gamma\}_t \sim \prod_t \tilde \mathcal{P}_t$ is in general position, and consider \begin{align*} \tilde \mu \in \argmin_{\mu \geq 0} \left\{\mu\cdot B + \sum_{t=1}^T \max_{x \in \mathcal{X}} \left\{\tilde f_t(x) - \mu \cdot \tilde b_t(x) \right\}\right\}\,. \end{align*} Then, at least one of the following statements holds: \begin{enumerate} \item $\tilde \mu = 0$ and $\sum_{t=1}^T \tilde b_t^*(\tilde \mu) \leq B + \bar b$. \item $\left|B - \sum_{t=1}^T \tilde b_t^*(\tilde \mu) \right| \leq \bar b$. \end{enumerate} \end{lemma} Recall that weak duality (Proposition~\ref{prop:global-weak-duality}) suggests that finding a dual solution which satisfies approximate complementary slackness with high probability would yield reward close to $\fluid(\{\mathcal{P}_t\})$. Lemma~\ref{lemma:trace-dual} states that we can compute a dual variable $\tilde \mu$ which satisfies approximate complementary slackness on the trace. To finish the argument, we require a uniform convergence bound which shows that expenditure on the trace (or the sequence of requests) is concentrated close to the expected expenditure for all dual variables $\mu \geq 0$. \begin{theorem}\label{thm:concentration} For $r(T) \coloneqq 8\bar b \cdot \sqrt{T \log(T)}$ and request distributions $\{\tilde \mathcal{P}_t\}_t$, the following uniform convergence bound holds \footnotesize \begin{align*} \Pr\left( \sup_{\mu \geq 0} \left| \sum_{t=1}^T \tilde b_t^*(\mu) - \sum_{t=1}^T \mathbb{E}_{\hat \gamma_t \sim \tilde \mathcal{P}_t}\left[\hat b_t^*(\mu) \right] \right| \geq r(T) \right) \leq \frac{1}{T^2} \,. \end{align*} \normalsize \end{theorem} \begin{algorithm}[t!] \SetAlgoLined \textbf{Input:} Trace $\{\tilde \gamma_t\} \sim \prod_t \tilde \mathcal{P}_t$, initial budget $B_1 = B$.\\ \textbf{Compute an Optimal Empirical Dual Solution: } \small \begin{align}\label{eq:empirical-dual} \tilde \mu \in \argmin_{\mu \geq 0} \mu\cdot B + \sum_{t=1}^T \max_{x \in \mathcal{X}} \left\{\tilde f_t(x) - \mu \cdot \tilde b_t(x) \right\} \end{align} \normalsize \For{$t =1, \dots, T$}{ Receive request $\gamma_t = (f_t, b_t) \sim \mathcal{P}_t$.\\ Make the primal decision $x_t$ and update the remaining resources $B_t$: \small \begin{align} &{x}'_{t} \in \argmax_{x\in\mathcal{X}} \left\{f_{t}(x)- \tilde \mu \cdot b_{t}(x) \right\}\ ,\nonumber \\ &x_{t}=\begin{cases} {x}'_t & \text{ if } b_t({x}'_t)\le B_t \\ 0 & \text{ otherwise} \end{cases}\ , \nonumber \\ &B_{t+1} = B_t - b_t(x_t) . \nonumber \end{align} \normalsize } \caption{Learning the Dual and Earning with It} \label{alg:learned-dual} \end{algorithm} With Theorem~\ref{thm:concentration} in hand, we are now ready to state and prove the regret guarantee for Algorithm~\ref{alg:learned-dual}. It first learns an empirical optimal dual variable $\tilde \mu$ from the trace $\{\tilde \gamma_t\}_t$, and then uses it as the per-unit price of the resource to take profit-maximizing actions on the request sequence $\{\gamma_t\}_t$. \begin{theorem}\label{thm:learned-dual-regret} If $\mathcal{P}_t = \tilde \mathcal{P}_t$ for all $t \in [T]$, then Algorithm~\ref{alg:learned-dual} (denoted by $A$) satisfies $\regret(A) \leq 12 \kappa \bar b + 2 \kappa r(T)$. \end{theorem} \citet{arlotto2019uniformly} showed that every algorithm must incur a regret of $\Omega(\sqrt{T})$, even when the request distributions are identical (i.e., $\mathcal{P}_t = \mathcal{P}$ for all $t \in [T]$) and known to the decision-maker ahead of time. Thus, Theorem~\ref{thm:learned-dual-regret} shows the regret of Algorithm~\ref{alg:learned-dual} achieves a near-optimal dependence on $T$ with just a single sample per distribution, despite the request distributions being unknown and time-varying. However, as the following example demonstrates, this regret bound critically relies on the assumption that $\mathcal{P}_t = \tilde \mathcal{P}_t$ for all $t \in [T]$, and is fragile to even slight deviations from it. This fact was also demonstrated in \citet{jiang2020online} in a related context which inspired the following example. \begin{example*}\label{example:dual-bad} Fix a small $\epsilon > 0$, an even horizon $T$ and budget $B = T/2$. Assume actions are accept/reject decisions, i.e., $\mathcal{X} = \{0,1\}$, and the reward/resource consumption functions are linear with $\coeff(b) = 1$ for all $\gamma = (f,b) \in \S$. In this setting, a request is completely determined by the coefficient $\coeff(f)$ of its reward function. We will overload notation and use $\gamma$ to denote this coefficient. Set $\tilde \mathcal{P}_t = \text{Unif }([1 + \epsilon, 1 + 2 \epsilon])$ for all $t \leq T/2 + 1$ and $\tilde \mathcal{P}_t = \text{Unif }([1 - \epsilon, 1])$ for all $t \geq T/2 + 2$. Moreover, set $\mathcal{P}_t = \text{Unif }([1 - \epsilon, 1])$ for all $t \in [T]$. Then, it is easy to see that $\mathcal{W}(\mathcal{P}_t, \tilde \mathcal{P}_t) \leq 3 \epsilon$ for all $t \in [T]$. Also, observe that any trace $\{\tilde \gamma_t\}_t \sim \prod_t \tilde \mathcal{P}_t$ would satisfy $\tilde\gamma_t \geq 1 + \epsilon$ for all $t \leq T/2 + 1$ and $\tilde\gamma_t \leq 1$ for all $t \geq T/2 + 2$. Hence, we always have $\tilde \mu \geq 1 + \epsilon$. On the other hand, we also always have $\gamma_t \leq 1$ for all $t \in [T]$. Therefore, Algorithm~\ref{alg:learned-dual} sets $x_t' = 0$ for all $t \in [T]$, yielding a reward of 0. Whereas, $\fluid(\{\mathcal{P}_t\}_t) \geq (1 - \epsilon) \cdot (T/2)$, thereby making the regret linear in $T$. \end{example*} Since $\epsilon > 0$ was arbitrary in the above example, it shows that even infinitesimally-small differences between the sampling and request distributions can lead to linear regret for Algorithm~\ref{alg:learned-dual}. This is antithetical to our goal of developing robust online algorithms for pacing. Formally, we would like to develop online algorithms that achieve regret which is small and degrades smoothly as $\sum_{t=1}^T \mathcal{W}(\mathcal{P}_t, \tilde \mathcal{P}_t)$ grows large. Nonetheless, although Algorithm~\ref{alg:learned-dual} falls short of this goal, it highlights the power of dual-based algorithms. Building on the intuition developed in this section, we next describe and analyze a Dual FTRL algorithm that achieves near-optimal regret while being robust to discrepancies between the sampling distributions $\{\tilde \mathcal{P}_t\}_t$ and the request distributions $\{\mathcal{P}_t\}_t$. \section{Introduction} Online advertising is the economic engine of the internet. It allows platforms like Google, Facebook, and TikTok to fund services that are free at the point of delivery while providing businesses the ability to target their ads to relevant users. When a user logs onto these platforms, an auction is run among the interested advertisers to determine which ad is displayed to her. Given the sheer scale of the internet, advertisers are typically interested in thousands (if not millions) of such auctions every day. If they participate in all such auctions, they will end up spending large sums of money, often far beyond their budget. This necessitates the need for budget management, which is our focus. We consider a setting in which a budget-constrained advertiser participates in $T$ second-price auctions, say, in a day. The goal of the advertiser is to maximize her utility while respecting her budget. We model the value of the advertiser and the highest competing bid as being generated from unknown independent time-varying distributions $\{\mathcal{P}_t\}_{t=1}^T$. This is a major departure from the stochastic budget-management/resource-allocation literature, which for the most part assumes stationary distributions---an assumption that rarely holds in practice as daily traffic patterns are non-stationary~\citep{zhou2019robust}. If nothing else is known about the distributions $\{\mathcal{P}_t\}_t$ and they can be chosen by an adversary; \citet{balseiro2019learning} showed that every algorithm must incur linear regret against the hindsight-optimal benchmark. Their impossibility result also highlights the fact that budget management does not fall under the purview of online convex optimization (OCO) and is vastly different, as evidenced by the ability to achieve $O(\sqrt{T})$ regret for adversarially-chosen input in OCO and the lack thereof in budget management. Thankfully, reality is not adversarial and additional information is available in the form of historical samples. For example, both intraday and interday internet activity (and consequently the user traffic in which an advertiser is interested) tends to be similar week-on-week. However, this periodicity is never exact, i.e., it is too stringent to assume these historical samples are drawn from exactly the same distributions as $\{\mathcal{P}_t\}_t$. In this work, we allow the sampling distributions $\{\tilde \mathcal{P}_t\}$ to differ from $\{\mathcal{P}_t\}$, and develop algorithms that are robust to differences between them. In particular, we call an algorithm robust if its regret degrades smoothly as a function of the total Wasserstein distance between the two sequences of distributions. Crucially, classical training-based algorithms that learn a dual solution from samples and use it to make bidding decisions (see Algorithm~\ref{alg:learned-dual}, which is inspired by \citealt{devanur2009adwords,agrawal2014dynamic}) do not satisfy this property as we show in Section~\ref{sec:dual}. Our main contribution is to show that Dual Follow-The-Regularized-Leader (FTRL) is robust and achieves $\tilde O(\sqrt{T})$ regret even when it has access to just \emph{one} sample from each distribution $\tilde \mathcal{P}_t$. At a high level, our algorithm uses the samples to estimate the ideal amount of expenditure to target in each auction and then uses Dual FTRL to follow these targets by shading the advertiser's values appropriately. \citet{jiang2020online} study a similar setting to ours, but their approach involves first learning all the sampling distributions $\{\tilde \mathcal{P}_t\}_t$, then using them to compute the target expenditures, and finally using Dual Gradient Descent (which is a special case of Dual FTRL) to spend the target amounts. Their approach requires $T$ samples per distribution to achieve $O(\sqrt{T})$ regret, {\color{blue}Maybe we can make the comparison more explicit and stronger, for example: 'Their approach requires $T$ samples per distribution to achieve $O(\sqrt{T})$ regret, which is not surprising since distributions can carry abundant structures, and thus inherently requires a large number of samples to learn. Our key observation is that full knowledge of the distributions is not necessary for budget pacing, and we learn a single dual variable capturing how budget constrained the advertiser is, and use it (instead of the distributions) to estimate the target expenditures. Our approach turns out to be much more robust against sampling noises or shifts between sampling and actual distributions, and allow us to significantly reduce the sampling complexity from $T$ to $1$ sample per distribution. --Di} which is significantly worse than the one sample per distribution that suffices for our algorithm. In fact, our approach of learning the target expenditures and tracking them with a dual-based learning/control algorithm is also remarkably close to the practical implementation of the budget management method called Pacing \citep{facebookguide, kumar2022optimal}, thereby providing theoretical backing to a real-world algorithm and guidance for tuning its parameters. Continuing with our example of weekly periodic traffic, it is reasonable to assume that last week was similar to the current week but the differences grow larger as one moves further into the past. Since $T$ samples per distribution would be tantamount to thousands of samples per distribution in practice, one would need to go back several months to collect sufficiently many samples. Our result suggests that one is better off using a handful of samples per distribution from recent weeks with similar traffic, rather than attempting to collect a large amount of potentially biased samples from weeks farther out in the past. {\color{blue} This last point is a little confusing, an attempt: Our improvement on sampling complexity has important practical implications. Continuing with our example of weekly periodic traffic where one distribution corresponds to a particular hour (e.g. Monday $10am$), the only way to acquire samples is from the advertiser's logged data in that hour from previous weeks. While our approach can be effective with just the data from last week, a method requiring a large number of samples may have to go back for months to collect enough data. This poses larger storage and maintenance challenge, but more importantly, as the traffic pattern naturally shifts, samples from weeks farther out in the past are inherently more biased (compared to last week), which can further hurt the performance of algorithms making decisions based on them. --Di} Furthermore, our regret guarantee is near-optimal in light of the $\Omega(\sqrt{T})$ lower bound established in \citet{arlotto2019uniformly}, {\color{blue} maybe "which holds even in the easier case of i.i.d. and known distributions."?}when the distributions $\{\mathcal{P}_t\}$ are identical and known ahead of time. On the technical front, we achieve our result by developing a novel dual-iterate coupling lemma (see Lemma~\ref{lemma:coupling}) and leveraging it to analyze a leave-one-out thought experiment designed to break challenging correlations which arise from working with one sample per distribution (see Subsection~\ref{subsec:R3} for details). Additionally, we also prove a novel regret decomposition for Dual FTRL (Theorem~\ref{thm:dual-descent-regret}), which may be of independent interest. Finally, our algorithm does not require one to solve large linear programs and can be implemented efficiently (see Subsection~\ref{subsec:putting-together}), which is critical for online advertising since each auction runs programmatically in a few milliseconds. Due to space constraints, we directly move onto a formal description of our model next, and refer the reader to Appendix~\ref{sec:related-work} for a discussion on other related work. \section{Model} \label{sec:model} \textbf{Notation.} We use $\mathbb{R}_+$ and $\mathbb{R}_{++}$ to denote the set of non-negative real numbers and the set of positive real numbers respectively. For $n \in \mathbb{N}$, we use $[n] = \{1, \dots, n\}$ to denote the set of positive integers less than or equal to $n$. We use $\mathcal{W}(\cdot, \cdot)$ to denote the Wasserstein distance between two distributions under the metric with which the sample space is endowed. \textbf{Online Allocation with a Single Resource and Budget Management.} For ease of exposition, we will prove our results for the more general single-resource online allocation problem with linear rewards/consumptions. It is well-known that bidding in repeated second-price auctions with budgets can be modelled as an instance of this online allocation problem (e.g., see \citealt{balseiro2022best}, or our Appendix~\ref{sec:application}). It also captures the stochastic multi-secretary problem \citep{arlotto2019uniformly} as a special case. Consider a decision maker with an initial budget $B \in \mathbb{R}_{++}$ of a resource, whose goal is to optimally spend it on $T$ sequentially arriving requests. Each request $\gamma = (f,b)$ is comprised of a linear reward function $f: \mathcal{X} \to \mathbb{R}_+$ such that $f(x) = \coeff(f) \cdot x$, and a linear resource consumption function $b: \mathcal{X} \to \mathbb{R}_+$ such that $b(x) = \coeff(b) \cdot x$; where $\mathcal{X} \subseteq \mathbb{R}_+$ is a compact set which denotes the space of possible actions of the decision maker. We will use $\S$ to denote the set of all possible requests and $\Delta(S)$ to denote the set of distributions over $\S$. Moreover, we endow $\S$ with the following metric $d(\cdot, \cdot)$: For any two requests $\gamma = (f,b)$ and $\tilde \gamma = (\tilde f, \tilde b)$: \vspace{-0.5em} \begin{align*} d(\gamma, \tilde\gamma) = \sup_{x\in \mathcal{X}} \left| f(x) - \tilde f(x) \right| + \sup_{x \in \mathcal{X}} \left| b(x) - \tilde b(x) \right| \,. \end{align*} We will assume that $0 \in \mathcal{X}$. This allows the decision maker to avoid spending the resource if she so chooses and ensures feasibility. Moreover, let $\bar x = \max_{x \in \mathcal{X}} x$. We will make standard regularity assumptions \citep{jiang2020online, balseiro2022online, balseiro2022best}: there exist $\bar f, \bar b \in \mathbb{R}_+$ such that $f(x) \leq \bar f$ and $b(x) \leq \bar b$ for all $x \in \mathcal{X}$. Like \citet{jiang2020online}, we will also assume that there exists $\kappa \in \mathbb{R}_+$ such that $f(x) \leq \kappa \cdot b(x)$ for all $x \in \mathcal{X}$, i.e., the maximum rate of return from spending the resource is bounded above by $\kappa$. At time $t \in [T]$, the following sequence of events takes place: (i) a request $\gamma_t = (f_t, b_t)$ arrives; (ii) the decision maker observes $\gamma_t$ and chooses an action $x_t \in \mathcal{X}$ based on the information observed so far; (iii) the request consumes $b_t(x_t)$ amount of the resource and generates a reward of $f_t(x_t)$. The decision maker aims to maximize her rewards subject to her budget constraint. A policy $\{x_t(\cdot)\}_t$ for the decision maker maps requests to actions $x_t: \S \to \mathcal{X}$ based on the available information at each time step, i.e., the action $x_t(\gamma_t)$ at time $t \in [T]$ can depend on the historical requests $\{\gamma_s\}_{s=1}^{t-1}$ and the current request $\gamma_t$, but not the future requests $\{\gamma_s\}_{s=t+1}^T$. Moreover, a policy is said to be budget-feasible if it respects the budget constraint by ensuring $\sum_{t=1}^T b_t(x_t(\gamma_t)) \leq B$ for every sequence $\{\gamma_t\}_t$. The request $\gamma_t$ at time $t$ is drawn from a distribution $\mathcal{P}_t \in \Delta(\S)$ unknown to the decision maker, independently of the requests at other time steps. We only require the requests $\{\gamma_t\}_t$ to be independent and allow the distributions $\mathcal{P}_t$ to vary arbitrarily across time. We will measure the performance of a policy against the fluid-optimal benchmark, which is defined as: \begin{align*} \fluid(\{\mathcal{P}_t\}_t) \coloneqq \noneurips{\quad} \text{max} \quad & \sum_{t=1}^T \mathbb{E}[f_t(x_t(\gamma_t))]\\ \text{s.t.} \quad & \sum_{t=1}^T \mathbb{E}[b_t(x_t(\gamma_t))] \leq B\\ &x_t: \S \to \mathcal{X} \quad \forall\ t \in [T] \,. \end{align*} Another benchmark common in the literature on online resource allocation is the expected hindsight optimal solution, which is defined as $\mathbb{E}[\opt(\{\gamma_t\}_t)]$ for \begin{align*} \opt(\{\gamma_t\}_t) \coloneqq \max_{x \in \mathcal{X}^T}\ \sum_{t=1}^T f_t(x_t) \text{ s.t. } \sum_{t=1}^T b_t(x_t) \leq B\,. \end{align*} It is well-known that $\fluid(\{\mathcal{P}_t\}) \geq \mathbb{E}[\opt(\{\gamma_t\}_t)]$, which makes our benchmark the stronger one (we provide a proof in Appendix~\ref{appendix:fluid-relaxation} for completeness). Hence, our performance guarantees relative to the fluid-optimal benchmark also imply the same guarantees for the expected hindsight-optimal benchmark. More concretely, we use $R(A | \{\gamma_t\}_t)$ to denote the total reward of a policy $A$ on the request sequence $\{\gamma_t\}_t$, and the performance of an algorithm is measured using its expected regret against the fluid-optimal reward: \begin{align*} \regret(A) \coloneqq \fluid(\{\mathcal{P}_t\}_t) - \mathbb{E} \left[R(A|\{\gamma_t\}_t) \right]\,. \end{align*}% Now, if the distributions $\{\mathcal{P}_t\}_t$ are unknown and arbitrary, and no other information about $\{\mathcal{P}_t\}_t$ is available, then the requests $\{\gamma_t\}_t$ can be adversarial. This case has been addressed in \citet{balseiro2022best}, where the authors showed no policy can achieve sub-linear regret. In this work, we address the setting in which the decision maker has additional information in the form of historical samples. In particular, we focus on the setting where the decision maker has access to one independent sample $\tilde \gamma_t \sim \tilde \mathcal{P}_t$ for each $t \in [T]$. We will assume that the $\{\tilde \gamma_t\}$ samples are independent of the request sequence $\{\gamma_t\}_t$ and $\{\tilde \mathcal{P}_t\}$ are not known to the decision maker. We will show that when the sampling distributions $\{\tilde \mathcal{P}_t\}_t$ are not too far from the actual distributions $\{\mathcal{P}_t\}_t$, which is a minimal relaxation over the adversarial setting, it is possible to achieve sub-linear regret. We refer to the collection of samples $\{\tilde \gamma_t\}_t$ as a \emph{trace} and allow the actions of the decision-maker to depend on it. Throughout this paper, we will use $\{\tilde \gamma_t\}_t$ to denote the trace and $\{\gamma_t\}_t$ to denote the (random) sequence of requests on which the decision maker wishes to maximize reward. \section{Introduction} Online advertising is the economic engine of the internet. It allows platforms like Google, Facebook, and TikTok to fund services that are free at the point of delivery while providing businesses the ability to target their ads to relevant users. When a user logs onto these platforms, an auction is run among the interested advertisers to determine which ad is displayed to her. Given the scale of the internet, advertisers are typically interested in thousands (if not millions) of auctions every day. If they participate in all such auctions, they will likely spend far beyond their budget. This necessitates the need for budget management, which is our focus. \textbf{Target spend plans to address non-stationarities.} Given the inherent non-stationarities that exist over time, in the volume of traffic, in the demographic of users that visit, the rates of conversion etc., an advertiser's own value and that of the competing advertisers' values are also non-stationary. To deal with this non-stationarity, budget management systems compute a target expenditure plan~\citep{facebookguide, kumar2022optimal}. The latter is a function of time that specifies the recommended amount of spend at each point of time. I.e., such a plan distributes the cumulative daily/weekly budget into smaller chunks of time, appropriately capturing the non-stationarity. A pacing algorithm like a controller is used to track the plan. This raises the question: how much data is required to come up with a good target spend plan? \textbf{Our model.} We study this question by considering a budget-constrained advertiser participating in $T$ second-price auctions. The advertiser seeks to maximize her utility while respecting her budget (formal model in Section~\ref{sec:model}). We model the tuple, of an advertiser's value and that of her highest competing bid, at time $t$, as being generated from unknown independent time-varying distributions $\{\mathcal{P}_t\}_{t=1}^T$. This is a major departure from the stochastic budget-management/resource-allocation literature, which for the most part assumes stationary distributions---an assumption that rarely holds in practice as daily traffic patterns are non-stationary~\citep{zhou2019robust}. If nothing is known about the distributions $\{\mathcal{P}_t\}_t$ and they can be chosen adversarially,~\citet{balseiro2019learning} showed that every algorithm must incur linear regret against the hindsight-optimal benchmark. Their impossibility result also shows that budget management does not fall under the purview of online convex optimization (OCO) and is vastly different, given that one can achieve $O(\sqrt{T})$ regret for adversarially-chosen input in OCO. Thankfully, additional information is usually available in the form of historical samples. For example, both intraday and interday internet activity (and consequently the user traffic in which an advertiser is interested) tends to be similar week-on-week. However, this periodicity is never exact, i.e., it is too stringent to assume these historical samples are drawn from exactly the same distributions as $\{\mathcal{P}_t\}_t$. To reflect this reality, in this work, we assume that we have samples from distributions $\{\tilde \mathcal{P}_t\}$, which are potentially different from $\{\mathcal{P}_t\}$, and develop algorithms that are robust to differences between them. We call an algorithm robust if its regret degrades smoothly as a function of the total Wasserstein distance between the two sequences of distributions. Crucially, classical training-based algorithms that learn a dual solution from samples and use it for bidding (see Algorithm~\ref{alg:learned-dual}, inspired by \citealt{devanur2009adwords,agrawal2014dynamic}) are not robust (see Section~\ref{sec:dual}). \textbf{Our result.} Our main contribution is to show that Dual Follow-The-Regularized-Leader (FTRL) is robust and achieves the near optimal $\tilde O(\sqrt{T})$ regret even when it has access to \emph{just one sample from each distribution} $\tilde \mathcal{P}_t$, dramatically improving over the prior $T\log T$ samples from each distribution~\citep{jiang2020online} to achieve $O(\sqrt{T})$ regret. \textbf{Key insights.} Our algorithm uses the samples to estimate the ideal amount of expenditure to target in each auction and then uses Dual FTRL to follow these targets by shading the advertiser's values appropriately. The key insight driving the reduction in sample complexity from $T\log T$ to $1$ per distribution is the following. Prior work by~\citet{jiang2020online} first learns the sampling distributions $\{\tilde \mathcal{P}_t\}_t$ from the samples, then computes the optimal duals on the learned distributions, and finally uses those duals to compute the target expenditures. Our insight is that it is not necessary to learn the entire sampling distribution. Instead, it is far more efficient to directly learn the duals from the samples and construct target expenditure based on those duals (i.e., setting target expenditure at $t$ to be what the dual-based solution consumes at $t$). Beyond being very efficient with samples, learning the duals from the samples also guarantees robustness to shifts between $\{\tilde \mathcal{P}_t\}_t$ and $\{\mathcal{P}_t\}_t$. \textbf{Practical implications.} Consider $T$ representing a week's worth of auctions. While a total of $T\log T$ samples may be possible to obtain by looking at the past few weeks (given that each week has about $T$ samples to offer), requiring $T\log T$ samples \emph{per distribution} calls for looking at many months into the past. This is because getting a sample for a distribution, where a distribution could correspond to say a particular hour (e.g. Monday 10 AM), entails looking at that same hour from the past week. Asking for $T \log T$ samples for any given hour, when $T$ samples is what we get for the entire week, clearly requires looking at the numerous months into the past. Apart from posing huge storage and operational challenges, given that traffic pattern shifts over time, even gradual shifts would significantly degrade quality as one moves too much into the past. Our ask of one sample per distribution requires looking at just the past week and getting one sample for each hour. \textbf{Near optimality: $O(\sqrt{T})$ vs $\tilde{O}(\sqrt{T})$.} Furthermore, our regret guarantee is near-optimal in light of the $\Omega(\sqrt{T})$ lower bound established in \citet{arlotto2019uniformly}, which holds even in the much easier case when the distributions $\{\mathcal{P}_t\}$ are identical (i.e., i.i.d. setting) and known ahead of time. Why is our $\tilde{O}(\sqrt{T})$ regret separated from the $O(\sqrt{T})$ regret in the lower bound (and the matching upper bound in~\citet{jiang2020online})? Indeed, we can also obtain $O(\sqrt{T})$ regret when given $\log T$ samples per distribution, or in the other direction, the~\citet{jiang2020online} paper also gets only $\tilde{O}(\sqrt{T})$ regret when given only $T$ samples per distribution rather than $T\log T$ samples. In other words, we get a factor $T$ reduction in samples: either from $T$ to $1$ sample while maintaining the same regret of $\tilde{O}(\sqrt{T})$ or from $T\log T$ to $\log T$ samples while maintaining the same regret of $O(\sqrt{T})$. \textbf{Primal vs dual approach.} The recent works of~\citet{banerjee2020constant} and \citet{banerjee2020uniform} show how to obtain a constant regret with a single historical trace by repeatedly solving the primal. We note that they crucially rely on the total number of types being small. When the number of types is very large as in Internet advertising where the type models user features, intent, time of day, location etc., a primal based algorithm is not even well defined because one would not have even seen all the types in the samples. Thus, a primal approach is out of question for us. More on this in Appendix~\ref{sec:related-work}. \textbf{Technical contributions.} We achieve our result by developing a novel dual-iterate coupling lemma (see Lemma~\ref{lemma:coupling}) and leveraging it to analyze a leave-one-out thought experiment designed to break challenging correlations which arise from working with one sample per distribution (see Subsection~\ref{subsec:R3} for details). Additionally, we also prove a novel regret decomposition for Dual FTRL (Theorem~\ref{thm:dual-descent-regret}), which may be of independent interest. Finally, our algorithm does not require solving large linear programs and can be implemented efficiently (see Subsection~\ref{subsec:putting-together}), which is critical for online advertising since each auction runs in a few milliseconds. Due to space constraints, we directly move onto a formal description of our model next, and refer the reader to Appendix~\ref{sec:related-work} for a discussion on other related work. \section{Related Work}\label{sec:related-work} \citet{balseiro2019learning} study budget pacing in repeated second-price auctions when the values and competing bids are either i.i.d. according to some unknown distribution or adversarially selected. They show that Dual Gradient Descent with the constant target $\lambda_t = B/T$ for all $t \in [T]$ attains the optimal regret of $O(\sqrt{T})$ in the i.i.d. stochastic setting, and the optimal parameter-dependent asymptotic competitive ratio (equal to ratio of the per-period budget to the maximum value) in the adversarial setting. \citet{zhou2008budget} also study the adversarial setting and provide a pacing-based algorithm that achieves a differently-parameterized competitive ratio which scales as the logarithm of the ratio of the highest-to-lowest return-on-investment, and show that it is optimal. \citet{kumar2022optimal} study an episodic setting and provide a density-estimation-based algorithm for learning the target expenditures for each episode. \citet{gaitonde2022budget} study the performance of the algorithm of \citet{balseiro2019learning} for the different objective of value maximization, and against the different benchmark comprised of pacing multipliers which spend the same amount $B/T$ at each time period. Under the no-overbidding assumption, they show that the algorithm of \citet{balseiro2019learning} achieves $O(T^{3/4})$ regret. Recent years have also seen significant attention being given to pacing in multi-buyer settings, but we focus on the single-agent setting here and refer the reader to the recent works of \citet{chen2021complexity} and \citet{gaitonde2022budget} for an overview. More generally, budget pacing in second-price auctions is a special case of online linear packing, which in turn is a special case of the online resource allocation problem. Both these problems allow for multiple resources and have been studied extensively; we only provide a broad overview here. For the most part, these problems have also been studied in the i.i.d. stochastic model, or the slightly more general random arrival model (requests are selected by an adversary but arrive in a uniformly random order). \citet{devanur2009adwords} and \citet{feldman2010online} study online linear packing under the random arrival model, and show that learning the dual from the initial requests and then using it to make decisions yields $O(T^{2/3})$ regret. \citet{agrawal2014dynamic} extended these results to show that repeatedly solving for the dual at geometrically increasing intervals yields the optimal $O(\sqrt{T})$ regret. \citet{devanur2011near} and \citet{kesselheim2014primal} also achieve $O(\sqrt{T})$ regret but with a better dependence on the constants and the number of resources. \citet{gupta2016experts} give a dual-descent-based algorithm that also achieves $O(\sqrt{T})$ regret. \citet{agrawal2014fast} study online resource allocation with concave rewards and convex constraints, and give a dual-descent-based algorithm that achieves $O(\sqrt{T})$ regret. \citet{balseiro2022best} give a Dual Mirror Descent algorithm which attempts to spend $\lambda_t = B/T$ at each time step and show that it achieves $O(\sqrt{T})$ regret for the general online allocation problem. Their results also hold for stochastic models that are close to i.i.d. like periodic, ergodic etc. \citet{balseiro2022online} present and analyze a generalization of Dual Mirror Descent that can incorporate arbitrary target expenditures $\{\lambda_t\}_t$. When the horizon $T$ is not known exactly and only assumed to lie in some known uncertainty window, they provide a procedure for computing target expenditures which yield a near-optimal asymptotic competitive ratio. Our Dual FTRL algorithm (Algorithm~\ref{alg:dual-descent}) is equivalent to the Lazy-update version of the algorithm of \citet{balseiro2022online}. Importantly, with the exception of \citet{devanur2011near}, none of the aforementioned works provide algorithms which can achieve vanishing regret for the setting with time-varying distributions. \citet{devanur2011near} achieve $O(\sqrt{T})$ regret when the optimal expected reward for each distribution is known in advance. However, this quantity cannot be computed with a single sample for non-trivial distributions, and they do not provide guarantees for our sample-access setting. Another line of work develops algorithms that beat $O(\sqrt{T})$ regret when the problem instance is well-structured. With the exception of \citet{banerjee2020constant} and \citet{banerjee2020uniform}, all of these works assume complete knowledge of the distributions and/or assume that the distributions are identical. When the number of requests of each type satisfies a concentration property between the trace and the actual requests, \citet{banerjee2020constant} and \citet{banerjee2020uniform} show that a constant regret can be achieved for online resource allocation using one sample per distribution. For the budget pacing problem, a type corresponds to a value and competing bid pair. Since complex machine-learning models are typically used to estimate advertiser values to a high precision, this translates to an extremely large number of possible types. Far from concentrating, these large number of types imply that one is unlikely to even observe a type more than once, making their primal-based method ineffective for budget pacing. Moreover, neither \citet{banerjee2020constant} nor \citet{banerjee2020uniform} do not provide any robustness guarantees for possible discrepancies between the sampling and true distributions, and their algorithm requires knowledge of the competing bid. Finally, our results are meaningful when the budget is much larger than the maximum amount one can spend on an auction/request, as is the case for budget pacing. In contrast, the literature on prophet inequalities considers a unit-cost variable-reward online allocation problem where the budget is only large enough to accept one request. See \citet{azar2014prophet, correa2019prophet, rubinstein2020optimal, caramanis2022single} for a sample-driven treatment of prophet inequalities.
\section{Introduction} Semantic segmentation aims at assigning pixel-wise semantic labels to an image. It plays an important role in various applications such as autonomous driving \cite{citys,auto_driving}, medical diagnostics \cite{unet} and virtual reality \cite{VR}. A key challenge in semantic segmentation is how to improve the boundary quality of segmentation results (Figure \ref{fig:intro1}). In general, people have been working on this problem in three different ways: (i) adopting a post-processing module to refine the boundary \cite{deeplab,densecrf,convcrf,crfasrnn,segfix}, (ii) jointly learned the edge detection and semantic segmentation task for boundary-awareness \cite{rpcnet,DTNet,edge_ss_other}, and (iii) making training more focused on the boundary by designing a boundary-aware loss with higher sensitivity to the boundary changes \cite{inverseform,bloss_1,bloss_2}. Nevertheless, all these methods explored the boundary information via either post-processing refinement or additional supervision, rather than directly address the intrinsic reason for fuzzy boundary and detail degradation, that is, \textit{vanilla convolution \cite{lenet} naturally tends to smooth the feature \cite{pdc,cdc_1,cdc_2,cdc_3,cdc_4}, making it difficult to capture the boundary cues} (see Figure \ref{fig:intro2}b). Although traditional gradient operators \cite{LBC,HOG} and difference convolutions \cite{cdc_1,cdc_2,cdc_3,cdc_4,pdc} have the ability to perceive boundary, they are sensitive to all the boundaries including intra-class texture edges, which makes it not suitable for semantic segmentation. This motivates us to explore a segmentation-friendly operator with only inter-class boundary awareness to improve the boundary ambiguity in semantic segmentation. { \textbf{Our method.} In this paper, we are committed to improving the boundary quality of semantic segmentation from the operator level. Inspired by the anisotropic diffusion \cite{r1_4} in the signal processing field, we formulate the inter-class boundary enhancement as a modified anisotropic diffusion process guided by semantics, which can be solved by the finite difference method. While such a traditional solver can hardly be integrated into deep segmentation networks due to the hyper-parameter sensitivity, numerical instability, and high computational complexity caused by its iterative formulation. To solve this problem, we propose a learnable semantic diffusion network (SDN) to approximate the diffusion process, which parameterizes the traditional solver and only requires only one forward instead of multiple iterations. The SDN aims to construct a differentiable mapping from the original feature to the inter-class boundary-enhanced feature, which consists of a semantic difference convolution and a feature fusion operation. Our proposed SDN is an efficient and flexible module that can be easily plugged into the existing encoder-decoder segmentation models. To evaluate its effectiveness, we integrate our SDN into multiple baseline segmentation models and conduct experiments on two challenging benchmarks (\textit{i.e.,} ADE20K \cite{ade20k} and Cityscapes \cite{citys}). Extensive experiments show that our approach can bring consistent improvements for existing segmentation methods with few additional computational costs. In particular, our SDN can bring +2.57\% and +1.43\% mIoU improvements for Segmenter \cite{segmenter} with ViT-B \cite{vit} backbone on ADE20K \cite{ade20k} and Cityscapes \cite{citys}, respectively. Qualitative visualization verifies the obvious boundary quality improvement of our approach. } \begin{figure} \centering \begin{minipage}{0.6\textwidth} \centering \includegraphics[width=\textwidth]{fig/intro1.png} \end{minipage} \hspace{0.01\textwidth} \begin{minipage}{0.37\textwidth} \vspace{0.2cm} \caption{\label{fig:intro1} Qualitative analysis of the segmentation error maps. The baseline denotes OCRNet \cite{ocrnet}, and the non-black pixels indicate the wrong predictions. It can be seen that segmentation error is particularly obvious in the boundary region. Our method achieves significant boundary improvements over the baseline model. The examples are selected and cropped from Cityscapes-\textit{val} \cite{citys}.} \end{minipage} \end{figure} \section{Related Work} \noindent \textbf{Semantic Segmentation.} In 2015, FCN \cite{fcn} first proposed to use a fully convolutional network to generate dense predictions, which is regarded as a milestone for semantic segmentation. Since then, lots of works have been exploring larger receptive fields for better scene understanding based on CNN architecture. For example, PSPNet \cite{pspnet} proposed a general pyramid pooling module to fuse features at different scales. DeepLab family \cite{deeplab,deeplabv2,deeplabv3,deeplabv3plus} used atrous convolution to enlarge the receptive fields while keeping the resolution. Recent works focused on how to capture more precise context \cite{ocrnet,isnet,context_encoding,dependencynet,cpnet} and better boundary \cite{segfix,inverseform}. Considering that the attention operation \cite{non_local} has a large receptive field and can adaptively aggregate features, \cite{danet,ccnet,asymmetric_non_local,aanet} employed the attention-based modules on the top of CNN segmentation networks to adaptively combine local features with their global dependencies. Inspired by the success of Transformer \cite{transformer} in NLP tasks, SETR \cite{setr} and DPT \cite{dpt} attempted to use Vision Transformer \cite{vit} as the backbone. They demonstrated the effectiveness of global receptive fields for semantic segmentation tasks. Inspired by \cite{detr}, Tran2Seg \cite{trans2seg} explored a hybrid encoder and prototype-based transformer decoder. FTN \cite{ftn} and Segmenter \cite{segmenter} further designed fully transformer networks. SegFormer \cite{segformer} proved that a lightweight MLP decoder can also achieve satisfactory results under a strong transformer encoder. Recently, MaskFormer \cite{maskformer} proposed a simple but effective mask classification scheme to predict a set of binary masks, which unified the semantic, instance, and panoptic segmentation. \noindent \textbf{Boundary-aware Segmentation.} Methods for promoting boundary quality in semantic segmentation can be divided into three categories: (1) \textit{Adopting the post-processing module.} Most methods applied a post-processing module on the top of coarse segmentation results to refine the boundary and recover the details \cite{deeplab,densecrf,convcrf,crfasrnn,segfix}. DenseCRF model \cite{densecrf} is the most well-known post-processing method, which achieves fine boundary results by encouraging assigning neighboring pixels with similar colors to the same semantic label. SegFix \cite{segfix} proposed a model-agnostic boundary refinement model, which aims to replace the ambiguous predictions at boundaries with predictions at the intra-class areas. (2) \textit{Auxiliary branch for boundary-awareness.} \cite{rpcnet,DTNet,edge_ss_other} utilized the multi-task learning strategy by jointly learning boundary detection and semantic segmentation together. For example, RPCNet \cite{rpcnet} introduced the auxiliary branch for boundary enhancement to the semantic segmentation model. (3) \textit{Boundary-aware loss.} These works guide the model to focus more on boundary accuracy by designing the boundary-aware loss function with high sensitivity to the boundary changes \cite{inverseform,bloss_1,bloss_2}. Inverseform \cite{inverseform} introduced a boundary distance-based measure into the popular segmentation loss functions. Kervadec \textit{et.al.}\cite{bloss_1} proposed a boundary loss taking the form of a distance metric on the space of contours for highly unbalanced situations. ABL \cite{bloss_2} designed an active boundary loss function for progressively encouraging the predicted boundaries matching the ground-truth boundaries. \textit{Instead of imposing various boundary-related constraints, we consider the intrinsic reason for fuzzy boundary from the operator level, and design a boundary-sensitive operator to make the network naturally capable of modeling and perceiving boundaries.} \noindent \textbf{Related Operators.} The convolution operator, which calculates the kernel's response to each local patch of the input feature maps, is not good at modeling boundary information. To solve this, people try to combine the traditional image gradient operator with convolution operators. Local binary convolution (LBC) \cite{LBC} used a series of pre-defined binary filters to replace learnable kernels in convolution. Subsequently, a series of difference convolution operators represented by central difference convolution (CDC) \cite{cdc_1,cdc_2,cdc_3,cdc_4} used learnable kernels to capture useful boundary information on the central difference map. PDC \cite{pdc} further extended the flexibility of CDC and achieved excellent results in boundary detection tasks. In addition, the local self-attention (LSA) \cite{LSA} operator replaces the fixed kernel with the content-adaptive attentive weights to achieve local feature fusion, making it good at capturing contextual dependence. But it is still not good at perceiving the boundary. \textit{Different from existing methods, we are committed to designing a novel and efficient operator-level solution with a high sensitivity to the inter-class boundaries rather than all the edges.} \section{Preliminaries} \subsection{Diffusion Process} \label{sec:diffusion} Diffusion is a physical model aimed at minimizing the spatial concentration difference \cite{r1_5}, which is widely used in image processing \cite{r1_4, NLF_0, NLF_1, NLF_2}. Given an image tensor $U$ to be smoothed, this process needs to solve the well-known second-order partial differential equation: \begin{equation} \frac{\partial U}{\partial t} = \textit{Div}(D \cdot \nabla U), \end{equation} where $\frac{\partial U}{\partial t} $ is the time derivative of the solution tensor, \textit{Div} is the divergence operator, $D$ is the diffusivity tensor, which describes the speed of the diffusion process, $\nabla $ is the gradient operator. With increasing time $t$, the solution $U_t$ of this process will correspond to increasingly smoothed versions of the original tensor. The concrete form of $D$ determines the properties of the PDE. For $D = 1$, it is called homogeneous linear diffusion, where the diffusion velocity of spatial concentration is exactly the same in all directions. For a spatial-dependent $D=D(x)$ (\textit{e.g.} learnable kernel), the process is linear and inhomogeneous. However, the two kinds of simple linear diffusion processes not only smooth the noise but also blur the edges. An ideal diffusivity function allows more smoothing parallel to image edges and less smoothing perpendicular to these edges, which is actually anisotropic and nonlinear. For this reason, some classic milestones \cite{r1_4,NLF_0, NLF_1, NLF_2} increase the nonlinear modeling ability by designing complex diffusivity functions $D=D(U)$ depending on the input $U$. \subsection{Rethinking Operator-level Boundary Awareness} \label{sec:rethinking} \begin{figure}[thtp] \centering \includegraphics[width=0.99095\linewidth]{fig/intro2.pdf} \caption{\label{fig:intro2} Visualization of the feature maps from (b) vanilla convolution \cite{lenet}, (c) central difference convolution (CDC) \cite{cdc_3}. We choose three points $A_1, A_2, B$ on the image, corresponding to \textit{car-body}, \textit{car-glass} and \textit{plant}, respectively. In (b), due to the local smoothness of the vanilla-conv operator, we can see that there is no significant difference in the feature responses at the three coordinates in the feature map. According to (c), the CDC operator can hardly distinguish the true semantic boundary and the pseudo boundary caused by textures or noise, for example, we can see that the features captured by CDC have cluttered false boundary responses between these two coordinates $A_1$ (\textit{car-body}) and $A_2$ (\textit{car-glass}). } \end{figure} Here we discuss the operator-level causes of potential CNN failures in boundary predictions. Given the input feature map $\bm{x}$, the vanilla convolution calculates the output tensor $\bm{y}$ through the inner product between the kernel $\bm{w}$ and each local feature patch. Without loss of generality, we assume that the channel number of both input and output is $1$. The vanilla convolution with kernel $\bm{w} \in \mathcal{R}^{h \times w}$ over a input feature $\bm{x} \in \mathcal{R}^{H \times W}$ could be written as: $\bm{y}_{p} = \langle \bm{w}, \bm{x}_{p} \rangle$, where $\bm{x}_{p} $ is the local patch centering at the position $p$. Intuitively, the vanilla convolution is just a local weighted average operation, which tends to smooth the local detailed information \cite{cdc_3}. Especially when entries within the kernel are non-negative, the smoothness will be particularly significant as it forms a low-pass filter. This results in a poor capacity for modeling the semantic boundary information, see Figure \ref{fig:intro2}b. Recently, people try to combine the traditional gradient operator (edge-detector) with convolution operators to enhance its edge awareness \cite{LBC,cdc_1,cdc_2,cdc_3,cdc_4,pdc}. Local binary convolution (LBC) \cite{LBC} used a series of pre-defined binary filters to replace learnable kernels in convolution. Subsequently, a series of difference convolution operators represented by central difference convolution (CDC) \cite{cdc_1,cdc_2,cdc_3,cdc_4} used learnable kernels to capture useful boundary information on the central difference map, that is, $\bm{y}_p = \langle \bm{w}, (\bm{x}_p - \bm{x}_\text{center}) \rangle$, where $\bm{x}_\text{center}$ indicates the center entry of the current patch, and the rest symbols are defined in the same way as that of the vanilla convolution. It aggregates the center-oriented gradient within the local region instead of the feature values. Even though this kind of operator has better edge awareness, however, because the gradient operator cannot distinguish between real semantic boundary and pseudo boundary caused by textures or noise (see Figure \ref{fig:intro2}c), it is difficult for us to directly apply them to tasks such as semantic segmentation. \section{Methodology} \label{sec:methodology} This section introduces the semantic diffusion network (SDN) for semantic segmentation tasks to compensate for the detail blur caused by the vanilla convolution operator. It is combined with CNN backbone when used, so as to strengthen semantic boundary information and filter out pseudo boundary information caused by texture or noise. \subsection{Formulation} \label{sec:formulation} Considering a CNN backbone model with $L$ stacked neural stages mapping an image $I$ to pixel-wise feature maps $\bm{X}$. Let $\bm{X}^\ell$ denote the feature map from the $\ell$-th stage. We define the semantic diffusion process over the feature map $\bm{X}^\ell$ as: \begin{equation} \frac{\partial U_t }{ \partial t} = \textit{Div}\Big(g(|\nabla V|^2) \nabla U_t\Big),\label{eq:diff3} \end{equation} where $\frac{\partial U}{\partial t} $ is the time derivative of the solution tensor, \textit{Div} is the divergence operator, $\nabla $ is the gradient operator. $V$ is the guidance feature map with the same resolution of $U$. The diffusivity term is a monotonically decreasing function of the square of the gradient $|\nabla V|^2$, for example, $g(|\nabla V|^2) = 1/{\sqrt{1+|\nabla V|^2/\lambda^2}}$. Ideally, the diffusion close to the semantic boundary areas will be suppressed, while the diffusion far away from the semantic boundary will be accelerated. Therefore, $V$ should contain sufficient semantic information, so the gradient norm $|\nabla V|^2$ can be used as a reliable semantic boundary indicator to construct the diffusivity. The PDE of the non-linear diffusion process defined by Eq.\eqref{eq:diff3} could be approximately solved by performing the finite difference update rule for $T$ steps: \begin{align} \label{finite_difference1} &\widetilde{U}^{t+1}_{(m, n)} = \sum_{(i, j) \in \mathcal{N}_{(m, n)}} g(|V_{(i, j)}- V_{(m, n)}|^2) \cdot (U^t_{(i, j)} - U^t_{(m, n)}),\\ \label{finite_difference2} &U^{t+1}_{(m, n)} = \alpha^t \cdot U^{t}_{(m, n)} + \beta^t \cdot \widetilde{U}^{t+1}_{(m, n)}, \end{align} where the step-index $t\in\{0, ..., T-1\}$, the tuple $(i, j)$ enumerates the index of every entry within the local neighbor region $\mathcal{N}_{(m, n)}$ of the position $(m, n)$, and the initial state is $U^{0} = \bm{X}^\ell$. In fact, it is obvious that the diffusivity $g(|V_{(i, j)}- V_{(h, w)}|^2)$ calculates the similarity between semantic guidance features at $(i, j)$ and $(m, n)$. The solver builds a differentiable map from the input feature map $\bm{X}^\ell$ to the boundary-enhanced feature. \paragraph{Remark.} The finite difference based solver can hardly be directly integrated with deep segmentation models for several reasons: (1). the stability of the finite difference method depends on the setting of boundary conditions and the selection of parameters $(\alpha, \beta)$; (2). the solver requires multiple iterations, which will consume high computational complexity. (3). integrating the iterative solver with the deep networks would result in numerical instability to the training process, such as gradient explosion \cite{crfasrnn}. \subsection{Semantic Diffusion Network} \label{sec:Semantic Diffusion Process} This subsection describes a novel learnable approach called \textbf{semantic diffusion network (SDN)} for approximating the diffusion process, which contains a parameterized semantic difference convolution operator followed by a feature fusion module and constructs a differentiable mapping from original backbone features to advanced boundary-aware features. As a learnable PDE approximate solver, the well-trained SDN could approximate the diffusion process in only one forward computation, reducing the computational complexity and improving the stability. Overall, we formulate the SDN as $\bm{F}^\text{sdn} = \textbf{SDN} \big( \bm{U}, \bm{V} \big)$, where $\bm{U}$ is the input feature map to be processed and $\bm{V}$ is the semantic guidance map. \subsubsection{Semantic Difference Convolution} \label{sec:sdc} Inspired by Eq.\eqref{finite_difference1}, we develop the semantic difference convolution (SDC) operator. We set the $\mathcal{N}_{m, n}$ as a $h\times w$ local region centered at position $(m, n)$. SDC takes the feature map $\bm{U}$ and the semantic guidance $\bm{V}$ as inputs and calculates the output feature map $\bm{Y}$. Specifically, each component of $\bm{y}$ indexed by $(m, n)$ is calculated via \begin{align} \label{sdc} \bm{Y}_{(m, n)} = \sum_{(i, j) \in \mathcal{N}_{(m, n)}} {\bm{W}_{(i, j)} } \cdot \bm{\mathcal{S}}\big( \bm{V}_{(i, j)} , \bm{V}_{(m, n)} \big) \cdot \big( \bm{U}_{(i, j)} - \bm{U}_{(m, n)} \big), \end{align} where the tuple $(i, j)$ enumerates the index of every entry within the local neighbor region $\mathcal{N}_{m, n}$. In the right hand of Eq.\eqref{sdc}, the first term is the learnable convolutional kernel $\bm{W}$, of which $\text{(height, width)} = (h, w)$. The kernel introduces a more powerful modeling capability than the naive non-linear diffusion process in Eq.\eqref{eq:diff3}. The second term $\bm{\mathcal{S}}\big( \bm{V}_{(i, j)}, \bm{V}_{(m, n)} \big)$, called the semantic similarity term, is a scalar measuring the similarity between semantic guidance features at $(i, j)$ and $(m, n)$. This term corresponds to the diffusivity $g(|V_{(i, j)}- V_{(h, w)}|^2)$ in Eq.\eqref{finite_difference1}. The third term $( \bm{U}_{(i, j)} - \bm{U}_{(m, n)} ) $, called the pixel difference term, calculates the feature difference between features at the position $(i, j)$ and $(m, n)$. Note that Eq.\eqref{sdc} can be implemented efficiently using CUDA. By default, the kernel size of $\bm{W}$ is set to $3\times 3$. \begin{figure}[t] \centering \includegraphics[width=1\linewidth]{fig/sdc_compare.pdf} \caption{\label{fig:sdc_compare} Comparisons between the vanilla convolution, the central difference convolution, and our semantic difference convolution. } \end{figure} Figure \ref{fig:sdc_compare} provides the comparison between SDC with other well-known convolution operators. As defined in Eq.\eqref{sdc}, the proposed SDC operator contains two sequential steps: (i) calculating the semantic similarity, and (ii) calculating the output feature. The first step consumes a complexity of $\mathcal{O}(HWhwC_f)$, and the second step consumes a complexity of $\mathcal{O}(HWhwC_iC_o)$. Thus, the overall complexity is $\text{Complexity} = \mathcal{O}(HWhw(C_iC_o+C_f))$, where $H, W$ are the height and width of the input feature, and $h, w$ are the height and width of the kernel tensor. $C_i, C_o$, and $C_f$ are the channel number of input, output, and semantic features, respectively. \subsubsection{Feature Fusion} This step aims to fuse the semantic difference convolution output $\bm{Y}$ and the module's input feature map $\bm{U}$ into the final boundary-enhanced feature map $\bm{F}^{\text{sdn}}$. This module is actually corresponding to Eq.\eqref{finite_difference2} in the classic finite differential solution. Here, we extend the simple weighted addition operation in Eq.\eqref{finite_difference2} to a learnable and more flexible way, that is, $\bm{F}^{\text{sdn}} = \textbf{Conv} \Big( \big[ \bm{U}, \bm{{Y}} \big] \Big)$. It first concatenates the original input feature $\bm{U}$ with the semantic difference convolution output $\bm{Y}$ and then uses a simple but effective $1\times1$ convolution to achieve channel-wise feature fusion, resulting in the boundary-enhanced feature $\bm{F}^{\text{sdn}}$. Note that both $\bm{U}$ and $\bm{Y}$ should have the same shape. Otherwise, we need to perform the bilinear interpolation upsampling operation on the smaller one to align the shapes. \subsection{Segmentation Model with SDN} Here, we introduce how to integrate our SDN into the existing encoder-decoder-based segmentation models. For better compatibility, we treat SDN as a neck part between the encoder and decoder, without breaking the original design of the baseline network. According to the feature scales required by the decoder, existing segmentation models can be divided into two categories: (i) encoder with single-scale decoder (\textit{i.e.,} ViT+Segmenter and ResNet+FCN); (ii) encoder with single-scale decoder, such as ResNet+SemanticFPN. Next, we discussed the two cases separately. \begin{figure} \centering \includegraphics[width=\textwidth]{fig/pipeline.png} \caption{\label{fig:pipeline} Illustration of how to combine the proposed semantic diffusion network (SDN) with the baseline segmentation model with single-scale decoder and multi-scale decoder in (a) and (b), respectively. The SDN is regarded as a neck part in order not to break the original encoder and decoder design of the baseline model. } \end{figure} \textbf{SDN with single-scale decoder.} As shown in Figure \ref{fig:pipeline}(a), given an input image $\bm{I}\in\mathbb{R}^{3 \times H \times W}$, the encoder is first applied to it to extract the feature, resulting in $\bm{F} \in\mathbb{R}^{C' \times H' \times W'}$, where $H'$, $W'$ and $C'$ denote the height, width and channel numbers, respectively. We then incorporate our SDN on the encoder output feature $\bm{F}$ to enhance the boundary details, and the output of SDN $\bm{F}^\text{sdn}$ is sent to the decoder. Note that $\bm{F}^{\text{sdn}}$ has the same size of $\bm{F}$. As mentioned in Sec. \ref{sec:sdc}, SDN requires an additional feature with rich semantics as guidance. To construct such a semantic feature $\bm{F}^s$ for SDN, we stack a lightweight layer $\Phi$ on the top of the encoder, where $\Phi$ is instantiated as a $3\times3$ convolution with stride 2. Thus, we have $\bm{F}^\text{sdn} = \textbf{SDN} \big( \bm{F}, \bm{F}^{s} \big)$. \textbf{SDN with multi-scale decoder.} As Figure \ref{fig:pipeline}(b), the input image $\bm{I}\in\mathbb{R}^{3 \times H \times W}$ is first passed through a backbone with totally $L$ scales (generally $L=4$), resulting in multi-scale features $\{ \bm{F}_i \in\mathbb{R}^{C_i \times H_i \times W_i}\}_{i=1}^L$. $H_i$, $W_i$ and $C_i$ denote the height, width, and channel numbers, respectively. We then incorporate the SDN after all the backbone stages to strengthen the boundaries comprehensively. In particular, for the $i$-th SDN, it takes $\bm{F}_i$ and $\bm{F}_i^s$ as the inputs, and generates the feature: $\bm{F}_i^\text{sdn} = \textbf{SDN} \big( \bm{F}_i, \bm{F}_i^s \big), 1 \leq i \leq L$, where $\bm{F}_i^s$ denotes the semantic feature at scale $i$, which is defined as follows: \begin{equation} \label{eq:semantic_feature} \begin{aligned} \bm{F}_i^s = \begin{cases} \bm{F}_{i+1}, & 1 \leq i < L ~~~~~~~~~~~ \\ \Phi \big( \bm{F}_{L} \big), & i = L \end{cases} \end{aligned} \end{equation} Similarly, $\Phi$ is also implemented by a $3\times3$ convolution with stride 2. Note that the SDNs applied on different stages have the same architecture but do not share the same parameters. Finally, the boundary-enhanced features are fed into the decoder to generate the pixel-wise probability map. \section{Experiments} \label{sec:exp} In this section, we first introduce the datasets and implementation details in Sec. \ref{sec:5.1}. Then, we evaluate our approach over several baseline segmentation models on these public benchmarks in Sec. \ref{sec:5.2}. Finally, in Sec. \ref{sec:exp_ablation}, we conduct ablation studies to analyze the effect of key designs and the compatibility of our approach. \subsection{Experimental Setup} \label{sec:5.1} \noindent \textbf{Datasets.} Experiments are conducted on two widely-used public benchmarks: \textit{ADE20K} \cite{ade20k} is a very challenging benchmark including 150 categories, which is split into 20000 and 2000 images for training and validation. \textit{Cityscapes} \cite{citys} is a real-world scene parsing benchmark, which contains over 5000 urban scene images with 19 classes. The number of images for training, validation, and testing are 2975, 500, and 1525, respectively. \noindent \textbf{Baseline models.} To evaluate the effectiveness of our SDN, we integrate it into two typical CNN-based baseline methods (FCN \cite{fcn} and SemanticFPN \cite{semanticfpn}) and a recent Transformer-based segmentation model (Segmenter \cite{segmenter}). \noindent \textbf{Training.} All the experiments are implemented with PyTorch \cite{pytorch} and conducted on 4 NVIDIA V100 GPUs. For fair comparisons, we apply the same settings as the baseline methods. Specifically, for CNN baselines (\textit{i.e.,} FCN and SemanticFPN), we use the SGD optimizer with momentum 0.9 and weight decay 0.0005. The learning rate is initialized at 0.01 and decays until 1e-4 by a polynomial strategy with power 0.9. For Transformer baselines (\textit{i.e.,} Segmenter), AdamW is used as the optimizer without weight decay. The learning rate is initialized as 6e-5 and decays until 0 via a polynomial strategy with power 1.0. We train the models with 160k and 80k iterations for ADE20K and Cityscapes, respectively. For ADE20K, we train the models with 160k iterations, each of which involves 16 images. For Cityscapes, the training contains 80k iterations with a batch size of 8. Synchronized BN \cite{syncbn} is used to synchronize the mean and standard deviation of BN \cite{bn} across multiple GPUs. The backbone is initialized by the ImageNet-1K \cite{imagenet} and ImageNet-22K \cite{imagenet22k} pre-trained weights for ResNet-50 \cite{resnet} and ViT-B \cite{vit}, respectively. \noindent \textbf{Evaluation.} We adopt the widely-used mean intersection of union (mIoU) to measure the overall segmentation performance. In order to measure the boundary quality of the prediction, we compute F-score only on the 1px and 3px boundary region, which denotes the 1 pixel and 3 pixels width area along the ground-truth boundary. For the multi-scale inference, we follow the previous works \cite{ocrnet,maskformer} to perform horizontal flip and average the predictions at multiple scales [0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0]. \begin{table*}[tp] \centering \setlength\tabcolsep{4pt} \caption{\label{tb:exp_main} Experimental results on ADE20K-\textit{val} and Cityscapes-\textit{val}. ``s.s.'' and ``m.s.'' denote the single-scale and multi-scale mIoU, respectively.} \begin{tabular}{l|c|cccc} \toprule[1pt] \multirow{2}{*}{Method} & \multirow{2}{*}{Encoder} & \multicolumn{2}{c}{ADE20K} & \multicolumn{2}{c}{Cityscapes} \\ & & mIoU (s.s.) & mIoU (m.s.) & mIoU (s.s.) & mIoU (m.s.) \\ \midrule[1pt] FCN \cite{fcn} & ResNet-50 & 36.10 & 38.08 & 72.64 & 73.32 \\ \rowcolor{gray} \textbf{FCN+Ours} & ResNet-50 & \textbf{38.12 \textcolor[RGB]{92,174,86}{(+2.02)}} & \textbf{39.36 \textcolor[RGB]{92,174,86}{(+1.28)}} & \textbf{74.75 \textcolor[RGB]{92,174,86}{(+2.11)}} & \textbf{75.79 \textcolor[RGB]{92,174,86}{(+2.47)}} \\ \midrule SemanticFPN \cite{semanticfpn} & ResNet-50 & 37.49 & 39.09 & 74.10 & 75.98 \\ \rowcolor{gray} \textbf{SemanticFPN+Ours} & ResNet-50 & \textbf{38.79 \textcolor[RGB]{92,174,86}{(+1.30)}} & \textbf{40.27 \textcolor[RGB]{92,174,86}{(+1.18)}} & \textbf{75.97 \textcolor[RGB]{92,174,86}{(+1.87)}} & \textbf{77.31 \textcolor[RGB]{92,174,86}{(+1.33)}} \\ \midrule Segmenter \cite{segmenter} & ViT-B & 48.48 & 50.00 & 77.97 & 80.07 \\ \rowcolor{gray} \textbf{Segmenter+Ours} & ViT-B & \textbf{51.05 \textcolor[RGB]{92,174,86}{(+2.57)}} & \textbf{52.18 \textcolor[RGB]{92,174,86}{(+2.18)}} & \textbf{79.42 \textcolor[RGB]{92,174,86}{(+1.45)}} & \textbf{81.38 \textcolor[RGB]{92,174,86}{(+1.31)}} \\ \bottomrule[1pt] \end{tabular} \end{table*} \begin{table}[t] \newcommand{\tabincell}[2]{\begin{tabular}{@{}#1@{}}#2\end{tabular}} \setlength\tabcolsep{5pt} \centering \caption{\label{tb:exp_boundary} Boundary F-score comparisons on Cityscapes-\textit{val}. } \vspace{0.2cm} \begin{tabular}{l|c|cc|cc} \toprule[1pt] \multirow{2}{*}{Method} & \multirow{2}{*}{Encoder} & \multirow{2}{*}{with SegFix \cite{segfix}} & \multirow{2}{*}{with SDN (ours)} & \multicolumn{2}{c}{F-score}\\ & & & & 1px & 3px \\ \midrule[1pt] \multirow{3.5}{*}{OCRNet\cite{ocrnet}} & \multirow{3.5}{*}{HRNet-48\cite{hrnetv2}} & \ding{55} & \ding{55} & 65.2 & 76.7 \\ & & \Checkmark & \ding{55} & 66.7 (+1.5) & 77.1 (+0.4)\\ & & \ding{55} & \Checkmark & \textbf{69.5 \textcolor[RGB]{92,174,86}{(+4.3)}} & \textbf{78.2 \textcolor[RGB]{92,174,86}{(+1.5)}} \\ \bottomrule[1pt] \end{tabular} \end{table} \begin{figure}[tp] \centering \vspace{-0.2cm} \includegraphics[width=0.99\linewidth]{fig/supp_visual_city.png} \caption{\label{fig:img_city} Visualization comparisons of the segmentation results on Cityscapes-\textit{val}, where the baseline is OCRNet.} \end{figure} \subsection{Main Results} \label{sec:5.2} To verify the effectiveness and generalization of our approach, we apply the proposed SDN to several baseline segmentation models on various datasets. Table \ref{tb:exp_main} reports the quantitative comparisons. \noindent \textbf{ADE20K.} \enspace Table \ref{tb:exp_main} shows that our approach brings significant mIoU improvements for all the baselines on the challenging ADE20K dataset, \textit{i.e.}, improves FCN by +2.02\% mIoU (s.s.), improves SemanticFPN by +1.30\% mIoU (s.s.), and improves Segmenter by +2.57\% mIoU (s.s.). The improvement could be attributed to the fact that explicit boundary information is particularly useful for ADE20K images with complex scenarios. With the HRNet-48, ResNet-101, and Swin-B backbone, we contribute +2.6\%, +1.7\%, and +1.1\% mIoU gain over OCRNet and MaskFormers, respectively. \noindent \textbf{Cityscapes.} \enspace Table \ref{tb:exp_main} shows that our approach brings nontrivial mIoU improvements for all the baselines, \textit{i.e.}, improves FCN by +2.47\% mIoU (m.s.), improves SemanticFPN by +1.87\% mIoU (s.s.), and improves Segmenter by +1.45\% mIoU (s.s.). Additionally, with the OCRNet(HRNet-w48) \cite{ocrnet} baseline, SDN brings +0.9\% mIoU improvement to the baseline OCRNet (81.9\% to 82.8\% mIoU) and outperforms the SegFix model by +0.3\% mIoU (the OCRNet's results are not listed in Table \ref{tb:exp_main}). Moreover, our approach (84.7\% mIoU) outperforms the OCRNet+SegFix (84.5\% mIoU) by +0.2\% on Cityscapes-\textit{test}, where the detailed results can be found in the \href{https://www.cityscapes-dataset.com/anonymous-results/?id=7406ee5226414cf0d88999e98155a5c0fa37e32e4494d96081d2719861751403}{web-link}. We also compare the boundary-promoting ability of SDN and the classic SegFix \cite{segfix} model in Table \ref{tb:exp_boundary}, where our method brings significant improvement, \textit{i.e.}, +4.3 and +1.5 for OCRNet in terms of the 1px and 3px F-score. Figure \ref{fig:img_city} provides some typical visualizations to show the boundary improvement effect of our method. \subsection{Further Study} \label{sec:exp_ablation} \noindent \textbf{Compare SDC with other operators.} \enspace For direct comparisons with other related operators, we replace the semantic difference convolution (SDC) in SDN with other two related operators, vanilla convolution \cite{lenet} and CDC \cite{cdc_3}. Table \ref{tb:exp_ablation}(a) compares their boundary performance on Cityscapes with OCRNet \cite{ocrnet} as the baseline model. It can be found that SDC outperforms its vanilla convolution counterpart by +4.3 F-score, and surpasses CDC by a large margin, which demonstrates the irreplaceability of SDC. \noindent \textbf{Effect of kernel settings of SDC.} We conduct experiments under different choices of the kernel size and dilation rate of SDC in Table \ref{tb:exp_ablation}(b). It can be found that: (1). Increasing the size of the convolution kernel in SDC does not bring significant changes. (2). Excessive dilation rate leads to negative effects. In fact, large kernels and dilated convolution are mainly used for enlarging the receptive fields. While, the goal of our SDC is to infer the inter-class boundary cue in a local region, which may not require more contexts brought by large kernels. Similarly, a large dilation rate may lead to the lack of local information, where, however, the local information is critical for local boundary exploration. \begin{table*}[b] \caption{\label{tb:exp_ablation} Further studies on (a) comparison with other operators, where V-Conv denotes the vanilla convolution, (b) the effect of the kernel size and dilation rate settings of the SDC operator in the SDN module, and (c) compatibility with other boundary-promoting methods in semantic segmentation. } \begin{minipage}[t]{.241315\linewidth} \setlength{\tabcolsep}{2pt} \renewcommand{\arraystretch}{1.2} \subcaption{\label{tb:ablation_operators}} \centering \begin{tabular}{l|c} \toprule[1pt] Operator & F-score \\ \midrule[1pt] Baseline &65.2 \\ V-Conv \cite{lenet} & 65.2 \\ CDC \cite{cdc_1} & 60.1 \\ SDC (ours) & 69.5 \\ \bottomrule[1pt] \end{tabular} \end{minipage} \hspace{0.45cm} \begin{minipage}[t]{.352\linewidth} \centering \setlength{\tabcolsep}{2.5pt} \renewcommand{\arraystretch}{1.2} \subcaption{\label{tb:ablation_Fis}} \centering \begin{tabular}{l|c|cccc} \toprule[1pt] Kernel-size & Dilation-rate & F-score \\ \midrule[1pt] $3\times 3$ & 1 & 69.5 \\ $5\times 5$ & 1 & 69.6 \\ $3\times 3$ & 3 & 69.1 \\ $3\times 3$ & 5 & 68.8 \\ \bottomrule[1pt] \end{tabular} \end{minipage} \hspace{0.45cm} \begin{minipage}[t]{.342\linewidth} \setlength{\tabcolsep}{2.2pt} \subcaption{\label{tb:ablation_lamda}} \centering \begin{tabular}{l|c} \toprule[1pt] Model & F-score \\ \midrule[1pt] Baseline & 65.2 \\ + Ours & 69.5 \\ + Ours + CRF \cite{densecrf} & 69.7 \\ + Ours + SegFix \cite{segfix} & 70.1 \\ + Ours + IF \cite{inverseform} & 70.5 \\ \bottomrule[1pt] \end{tabular} \end{minipage} \end{table*} \noindent \textbf{Compatibility with other boundary promoting methods.} \enspace Our approach can be incorporated with other boundary improvement methods, for example, using our SDN and a post-processing boundary refinement module simultaneously in a network. Table \ref{tb:exp_ablation}(c) presents the good compatibility of our approach with three well-known methods on Cityscapes-\textit{val}. Specifically, the additional DenseCRF \cite{densecrf}, SegFix \cite{segfix} and InverseForm \cite{inverseform} further bring $+0.2$, $+0.6$ and $+1.0$ boundary F-score gains, respectively. It is worth noting that, our method can directly achieve $+4.4$ boundary F-score improvement over the baseline without any other methods. Benefiting from the intrinsic boundary exploration, segmentation networks with our SDN can relieve the dependence on other boundary improvement techniques. \begin{figure}[t] \centering \includegraphics[width=1.0\linewidth]{fig/supp_visual_feature2.png} \caption{\label{fig:supp_visual_feature} Visualization of the feature mapping in SDN. The second row shows the output feature of each encoder stage, which is also the input feature of SDNs. The output features of SDN according to each stage are shown in the third row. Obviously, our SDN enhances inter-class boundaries and suppresses the intra-class pseudo boundaries. The example is selected from Cityscapes. } \end{figure} \section{Conclusion} In this paper, we have summarized the internal reasons why the deep semantic segmentation model is difficult to produce accurate boundary prediction, that is, the commonly used convolutional operators tend to smooth and blur local detail cues, making it difficult for deep models to capture precise boundary information. To solve this problem, this paper introduces an operator-level approach to enhance semantic boundary awareness, so as to improve the prediction of the deep semantic segmentation model. Specifically, we formulate the boundary feature enhancement process as an anisotropic diffusion process and propose the novel semantic diffusion network (SDN) to approximate the anisotropic diffusion process. The proposed SDN is an efficient, stable, and flexible module that can be plugged into existing encoder-decoder segmentation models. Extensive experiments show that our approach can achieve consistent improvement over various baseline semantic segmentation models and significantly improve the boundary quality of segmentation results. \section{Limitations and Social Impact} We believe that SDN is a general approach that can benefit deep learning models in various popular visual tasks. However, this paper only verifies the effectiveness of SDN on a single task (semantic segmentation). In the recent future, we will explore the application of SDN in other 2D/3D tasks, such as instance segmentation, panoptic segmentation, flow estimation, image denoising, image super-resolution, and so on. SDN has potential value in important applications such as autonomous driving and medical image analysis. But it can also deploy inhumane surveillance. The potential negative effects can be avoided by implementing strict and secure regulations. \bibliographystyle{splncs04}
\section{Introduction} Millimeter wave (mmWave) and terahertz (THz) frequencies are considered to be a key component of 5G and 6G cellular systems\cite{saad2019vision}. However, as the operating frequencies increase, path and absorption losses also increase. Despite these disadvantages, this approach will allow packing more antennas in a small area and, then, the network can leverage beamforming techniques to compensate for the losses operating in such frequencies. However, the gains stemming from these multiple antenna techniques hinge on the ability to accurately estimate the channel state information (CSI). Estimating channel coefficients over a wideband and across multiple antennas incurs significant resource overhead in terms of resources occupied for sending pilot symbols. However, it has been observed that the mmWave channel exhibits a sparse behavior with only a few resolvable multi-paths in angle and delay domain \cite{RanRapErk_2014} and \cite{AkdRizEtal_2014}. By leveraging such sparsity, several works have come with compressed sensing (CS) based approaches for channel estimation and precoder design in mmWave multi-input multi-output (MIMO) systems\cite{SchniAkb_2014,AlkElLeuHeath_2014,LeeGilYong_2016,venugopal2017channel,8398433,8227682}. However, while used in wideband massive MIMO systems, these approaches lead to higher complexity due to the requirement of inverting huge matrices (for every subcarrier) across such antenna arrays. \begin{figure}[t] \centerline{\includegraphics[width=3.2in,height=1.9in]{fig/graphics_scenario.png}} \vspace{-3mm}\caption{Uplink multi-path scenario along with the co-located radar.} \label{fig:graphic_sec}\vspace{-7mm} \end{figure} Since the sparse wireless channel is described by a few geometric multi-path propagation parameters, one might ask: Can the information on the physical propagation environment, for example, scatter or reflector locations, be useful in channel estimation? Indeed, one of the earlier works in \cite{VasDeeKatabi_2016} has utilized this key observation. The authors extract physical multi-path parameters from the CSI measurements in one frequency band and then use them to construct the CSI in another frequency band. However, no extra pilots are used in aiding the channel estimation, and they assume that the extracted multi-path parameters are perfect. On the other hand, advances in radar and joint communication sensing made it possible to have real-time dynamic radio environment maps at the communicating devices. Prior works in \cite{AliGonHeath_2018,ali2019millimeter,liu2020radar,WangNarHeath_2018,LaNuriaHeath_2019,chaccour2021joint} use such radar environment side information for the beam prediction and beam alignment to reduce the initial synchronization time in vehicular systems. A recent work in \cite{JiangAlkhateeb_2022} tried to address the problem of channel estimation in massive MIMO systems by leveraging radar sensing information. The authors retrieve the scatterers location and velocity in the surrounding environment from the measurements collected by a co-located radar at the base station (gNB). Then multi-path parameters such as delays and angles are extracted from the radar sensing information. These inferred multi-path parameters from the radar are then used to initialize the dictionary in an orthogonal matching pursuit (OMP) based channel estimation algorithm. However, the extracted multi-path parameters from the radar are assumed to be error-free. The limitations of existing literature on radar-based sensing for channel estimation in massive MIMO systems include the following. Firstly, the sensing based channel estimation algorithms may have limited angle and delay resolution, resulting in imprecise channel estimation and affecting the system performance. Secondly, utilizing separate spectrum for sensing and communication leads to inefficient resource utilization. But this can be overcome by using full-duplex techniques \cite{HassaniSJ2020}, which requires efficient signal processing to mitigate the self-interference components. Thirdly, implementing sensing baded channel estimation in practice can be difficult due to the increasing radio frequency (RF) components and computational complexity, especially in massive MIMO systems with many antennas. These limitations highlight the need for further research to improve sensing based channel estimation’s accuracy, efficiency, and robustness in massive MIMO systems. Specifically, this paper proposes novel signal processing methods to bridge the gap on the limited angular and delay resolution issue mentioned above. In this work, we consider the problem of channel estimation in a wideband mmWave MIMO system in which sensing information is obtained from a co-located radar at the gNB as shown in Fig.~\ref{fig:graphic_sec} is used to reduce the pilot overhead. The contributions of our paper are summarized as follows, \begin{enumerate} \item Unlike \cite{JiangAlkhateeb_2022}, we assume that the sensing information from the radar can be erroneous. We also consider cases in which scatterers detected from radar might not be associated with the communication channel. \item To address these issues, a novel Simultaneous Weighting Orthogonal Matching Pursuit (SWOMP) - Sparse Bayesian Learning (SBL) based channel estimation is proposed that incorporates the imperfect sensing information from the radar. \item We also provide local identifiability analysis for the parameter estimation using SBL by deriving Cramer-Rao bound (CRB) for the joint angle of arrival (AoA) and path gain estimation using SBL. \end{enumerate} \section{System Model} We consider a scenario where a user (UE) communicates with base station (gNB) in an environment with the scatterers located between them. The scatterers are represented by $\mathcal{S}_r$, and $|\mathcal{S}_r|=L_r$. Only a subset of these scatterers, $\mathcal{S}_c \subseteq\mathcal{S}_r$, $|\mathcal{S}_c|=L_c$, are assumed to affect the UE-gNB communication channel. The set $\mathcal{S}_c$ is unknown, however, we assume that location estimates of scatterers in $\mathcal{S}_r$ are provided by a sensing system. This represents a scenario where the scatterers are present in the blind zone to UE but can be detected by a sensing system co-located at the gNB as shown in the Fig.~\ref{fig:channel_model_rad}. \subsection{Sensing Information} We assume that the sensing is accomplished at the gNB either using a co-located radar operating in a seperate spectrum \cite{rao2017introduction} or through a joint communication sensing framework \cite{zhang2021overview}. The sensing information available at the gNB is given by $$ \{(\tau_{\ell}^{rad}+e_{\tau},\theta_l+e_{\theta}) ~ | ~ l=1,2,\ldots, L_r\}, $$ where $\tau_{\ell}^{rad}$ and $\theta_\ell$ represent the round trip delay and angle of the $l$-th scatterer from the gNB, respectively. The error in the estimated parameters is assumed to be Gaussian distributed as $e_{\theta} \sim\mathcal{N}(0, \sigma_{\theta}^2)$ and $e_{\tau} \sim\mathcal{N}(0, \sigma_{\tau}^2)$. The error in the radar spatial information can appear due to noise and the inability of the radar to resolve delay and/or angles sufficiently. \subsection{Communication Model} We consider a mmWave orthogonal frequency division multiplexing (OFDM) system with a single antenna UE and $M$ antenna gNB. The gNB is equipped with a uniform linear array (ULA) with half-wavelength spacing between consecutive antennas. The UE sends $P\ll K$ (narrowband) pilots, where $K$ is the total number of subcarriers used for communication. The received complex baseband signal at the $k$-th subcarrier after down-conversion, zero prefix removal, OFDM demodulation, and correlation with the pilots is given by \begin{align} \boldsymbol{y}[k] = \boldsymbol{h}[k] + \boldsymbol{n}[k], \label{eq_rx_sig} \end{align} where $k=0$ to $K-1$, $\boldsymbol{h}[k]\in\mathbb{C}^{M\times 1}$ represent the baseband channel, $\boldsymbol{n}[k]\sim\mathcal{CN}(0, \sigma^2\boldsymbol{I}_{M})$ is a circularly symmetric complex Gaussian distributed additive noise vector. We define the received signal-to-noise-ratio (SNR) at subcarrier $k$ as ${\norm{\bfh[k]}^2}/{\sigma^2}$. Next, we describe the mmWave channel model generation that is a parametric function of the multipath components. \subsection{Channel Model}\label{sec:ch_mod} A frequency-selective geometric channel model with $N_c$ delay taps and $L_c+1$ paths\cite{venugopal2017channel} is considered. The channel consists of a line-of-sight (LoS) component, and $L_c$ (yet unknown) reflections resulting from the scatterers as described earlier. The $d$-th delay tap is modeled as \begin{align} \boldsymbol{h}_d = \sqrt{\frac{M}{L_c+1}}\sum\limits_{\ell=0}^{L_c} \alpha_\ell p(dT_s-\tau_\ell) \boldsymbol{a}(\theta_\ell), \label{eq:Hd} \end{align} where $p(.)$ is the pulse-shaping filter, $T_s$ is the sampling interval, $\alpha_\ell$, $\tau_\ell$, $\theta_\ell$ represent the path gain, delay and the angle-of-arrival (AoA) of the $l$-th path, respectively. The receiver array steering vector for the $l$-th path is denoted by $\boldsymbol{a}(\theta_\ell) \in \mathbb{C}^{M\times 1}$. The index $\ell{=}0$ is always associated with the LoS path. We can compactly represent the channel as $\boldsymbol{h}_d{=} \boldsymbol{A}\boldsymbol{\Delta}_d,$ where $ \boldsymbol{A}{=} [\boldsymbol{a}(\theta_0)\ \boldsymbol{a}(\theta_1)\ \dots\ \boldsymbol{a}(\theta_{L_c})]\in \mathbb{C}^{M\times \left(L_c+1\right)}$ contains the receiver side steering vectors and \begin{align} \boldsymbol{{\Delta}}_d = \left[{\begin{array}{c} \alpha_0 p (dT_s-\tau_0), \cdots, \alpha_{L_c} p (dT_s-\tau_{L_c}) \end{array}}\right]^{{\Transpose}}. \label{delta_d_m} \end{align} We obtain the frequency domain channel representation by taking a $K$-point DFT of the delay-domain channel, and the channel at subcarrier $k$ can be written as \begin{align} \boldsymbol{h}[k] = \sum\limits_{d=0}^{N_c-1} \boldsymbol{h}_d \exp\left({-\frac{j2\pi kd}{K}}\right) = \boldsymbol{A} \boldsymbol{{\Delta}}[k], \label{eq:Hk} \end{align} and $\boldsymbol{{\Delta}}[k]$ is given by $ \boldsymbol{{\Delta}}[k] = \sum\limits_{d=0}^{N_c-1}\boldsymbol{{\Delta}}_d \exp\left({-\frac{j2\pi kd}{K}}\right).$ Further substituting for $\boldsymbol{{\Delta}}_d$ from \eqref{delta_d_m}, we obtain \begin{align} \boldsymbol{\Delta}[k]=\left[{\beta_{k,0}\alpha_0},{\beta_{k,1}\alpha_1}, \dots, {\beta_{k,L_c}\alpha_{L_c}}\right]^{{\Transpose}}, \end{align} where $\beta_{k,\ell}{=}\sum _{d=0}^{N_c-1}p(dT_s-\tau_\ell)\exp\left({-\frac{j2\pi kd}{K}}\right)$. Substituting $\boldsymbol{{\Delta}}[k]$ in \eqref{eq:Hk}, a compact form of the frequency domain channel $\boldsymbol{h}[k]$ can be obtained as \begin{align} \boldsymbol{h}[k] =\boldsymbol{A}\boldsymbol{\beta}_k\boldsymbol{\alpha}, \end{align} where $\boldsymbol{\beta}_k{=}\textrm{diag}\big(\beta_{k,0},\beta_{k,1},\dots,\beta_{k,{L_c-1}}\big)$, and $\boldsymbol{\alpha}{=}[\alpha_0,\alpha_1,\dots,\alpha_{L_c}]^{{\Transpose}}$. Further substituting $\boldsymbol{h}[k]$ in \eqref{eq_rx_sig}, the received frequency domain signal $\boldsymbol{y}[k]$ can be written as \begin{align} \boldsymbol{y}[k]=\boldsymbol{\Psi}_k\boldsymbol{\alpha} + \boldsymbol{n}[k], \label{eq_underscore_dict} \end{align} where $\boldsymbol{\Psi}_k = \boldsymbol{A}\boldsymbol{\beta}_k\in \mathbb{C}^{M\times \left(L_c+1\right)}$. \begin{figure}[t]\vspace{-1mm} \centerline{\includegraphics[width=3.5in]{fig/fig2_fig3_new.png}} \vspace{-3mm}\caption{\hspace{-1mm}Scatterer environment along with the sensing information.} \label{fig:channel_model_rad} \end{figure} \section{Sensing Aided Channel Estimation} In this section, we provide a channel estimation framework that incorporates the sensing information available at the gNB. From \eqref{eq_underscore_dict}, the received $P$ pilots in vectorized form is given by \begin{align} & \boldsymbol{y} = \left[\boldsymbol{y}^{{\Transpose}}[0] \,\boldsymbol{y}^{{\Transpose}}[1]\, \ldots \, \boldsymbol {y}^{{\Transpose}}[P-1] \right]^{{\Transpose}},\\ & \boldsymbol{y} = \underbrace{\left[ {\boldsymbol{\Psi}_0^{{\Transpose}}} {\boldsymbol{\Psi}_1^{{\Transpose}}} \cdots {\boldsymbol{\Psi}_{P-1}^{{\Transpose}}}\right]^{{\Transpose}}}_{{\boldsymbol{\Omega}}}\boldsymbol{\alpha} + {\boldsymbol {n}}, \label{eq:omega} \end{align} where the matrix $\boldsymbol{\Omega}\in \mathbb{C}^{MP\times (L_c+1)}$ carries the delay-angle information of the multipath components and ${\boldsymbol {n}}$ is the vectorized noise ${\boldsymbol {n}}=[{\boldsymbol {n}}^{{\Transpose}}[0] {\boldsymbol {n}}^{{\Transpose}}[1] \cdots {\boldsymbol {n}}^{{\Transpose}}[P-1]]^{{\Transpose}}$. Moreover, the sensing information can be used as an initial estimate of the multipath delays and angles. Let $\tilde{\bm{\theta}}=[{\theta}_0,\tilde{\theta}_1, \tilde{\theta}_2,\ldots, \tilde{\theta}_{L_r}]$, where ${\theta}_0$ is the angle associated with the LoS path and $\tilde{\theta}_l$, $l \in [1,L_r]$ is the AoA of the $l$-th path obtained from the sensing information. The round-trip propagation delay between the gNB and the $l$-th, $l \in [1,L_r]$, scatterer is denoted by $\tau^{rad}_{\ell}$. Let us define $\tilde{\bm{\tau}} = [{\tau_0}, \tilde{\tau}_1,\tilde{\tau}_2,\ldots,\tilde{\tau}_{L_r}]$, where $\tau_0$ is the delay between the UE and the gNB, and the delay of the $\ell$-th communication path can be estimated using the radar delay $\tau^{rad}_{\ell}$ as \begin{equation} \tilde{\tau}_{\ell} = {\tau^{rad}_{\ell}}/{2} + \tau^{\prime}_{\ell}, \label{eq:tau_ell} \end{equation} where $\tau^{\prime}_{\ell}$ is obtained using triangle laws of cosines as shown in Fig.~\ref{fig:channel_model_rad_delay_est}, \begin{align} \tau^{\prime}_{\ell} = \sqrt{\tau_{0}^2 + \left({\tau^{rad}_{\ell}}/{2}\right)^2 - \tau_{0}(\tau^{rad}_{\ell})cos(\tilde{\theta}_{\ell}-\theta_{0})}. \label{eq:tau_prime} \end{align} Similar to the matrix $\boldsymbol{\Omega}$ in \eqref{eq:omega}, using the sensing information $(\tilde{\bm{\tau}}, \tilde{\bm{\theta}})$, we can construct a matrix $\bar{\boldsymbol{\Omega}}\in\mathbb{C}^{MP\times (L_r+1)}$ that captures the delay-angle information of the $L_r+1$ paths. As we described earlier, only a subset of $L_c$ among the $L_r$ scatterers are included in the communication channel, and $L_c$ is unknown. This can be mathematically represented as, \begin{equation}\vspace{-1mm} \boldsymbol{\Omega} = \bar{\boldsymbol{\Omega}}\boldsymbol{B} + \boldsymbol{E}, \label{eq_omega_err}\vspace{-1mm} \end{equation} where $\boldsymbol{B}\in\mathbb{R}^{(L_r+1)\times (L_c+1)}$ is obtained by selecting $L_c+1$ columns of the identity matrix $\boldsymbol{I}_{L_r+1}$. The indices of the columns that are included in $\boldsymbol{B}$, correspond to the paths that are present both in the communication channel and sensing information. The unknown error term is denoted by $\boldsymbol{E}$. \vspace{-1mm}\subsection{Problem Formulation} Utilizing the received pilot signal \eqref{eq:omega} and the sensing information in the form of \eqref{eq_omega_err}, the maximum a posteriori (MAP) based channel estimation problem is formulated as: \begin{align}\vspace{-1mm} \left[\boldsymbol{\Omega}^*, \boldsymbol{\alpha}^*\right] = \arg \max\limits_{\boldsymbol{\Omega},\boldsymbol{\alpha}} p(\boldsymbol{\Omega},\boldsymbol{\alpha}\mid \boldsymbol{y}), \label{eq_MAP}\vspace{-1mm} \end{align} where $p(.)$ represents the probability distribution and $\boldsymbol{\alpha}$ is the channel gain vector. The optimization problem at hand is difficult to solve in general as a) it is hard to obtain the distribution $p(\boldsymbol{\Omega},\boldsymbol{\alpha}\mid \boldsymbol{y})$ b) the combinatorial nature of the path association matrix $\boldsymbol{B}$ and the unknown error. A conventional approach to relax this problem and solve it using compressed sensing schemes, such as SBL, by considering a joint dictionary matrix consisting of finely spaced angles and delays. However, such a solution results in cubic complexity with respect to the dictionary dimensions, which has to be finely spaced to alleviate the off-grid errors. Hence, we propose a two-stage SWOMP-SBL algorithm to overcome such high complexity. \begin{figure}[t]\vspace{-2mm} \centerline{\includegraphics[width=3.5in,height=1.21in]{fig/channel_model_scatt_3_new.png}}\vspace{-2mm} \caption{Communication delay estimation from radar delay.} \label{fig:channel_model_rad_delay_est}\vspace{-4mm} \end{figure} \vspace{-2mm}\section{SWOMP-SBL Algorithm} The proposed algorithm works in two stages. In the first stage, based on the sensing information, a SWOMP based algorithm is used to find the paths that are associated with the communication and their respective AoAs. Based on these selected paths, a SBL inference algorithm is used to obtain finer estimate of the delays and corresponding channel gains $\widehat{\balpha}$. A schematic describing this two-stage algorithm is shown in Fig \ref{fig:block_diagram}. \begin{figure}[t]\vspace{-2mm} \centerline{\includegraphics[width=4.5in]{fig/block_diagram_new.png}} \vspace{-2mm}\caption{\hspace{-1mm} SWOMP-SBL algorithm.}\vspace{-5mm} \label{fig:block_diagram} \end{figure} \vspace{-3mm}\subsection{SWOMP Stage} The algorithm is initialized with assuming that all the $L_r+1$ paths from the sensing information are present in the communication channel. The AoA's $\tilde{\boldsymbol{\theta}}$ are used to form the angle dictionary $\boldsymbol{A}^{\prime}$ as described in steps 2 and 3 of the Algorithm \ref{SWOMP}. The SWOMP algorithm \cite{rodriguez2018frequency} outputs the maximum correlated paths $\hat{\boldsymbol{\theta}}$ corresponding to the angle dictionary $\boldsymbol{A}^{\prime}$ with the received signal $\boldsymbol{y}$. The noise variance $\sigma^2$ is utilized as a stopping condition in SWOMP, where all the refined angles associated with the channel and their corresponding path indices $\boldsymbol{\chi}$ are estimated. However, a dictionary matrix $\widehat{\bOmega}$ is needed to refine the delays further and estimate the channel gains. The path association matrix $\boldsymbol{B}$ can be obtained from the estimated $\boldsymbol{\chi}$, but it's avoided since the path indices are enough to create the dictionary matrix $\widehat{\bOmega}$. $\widehat{\bOmega}$ is constructed using the refined AoA $\hat{\boldsymbol{\theta}}$ obtained using SWOMP and a finely space dictionary matrix of the associated delays. The association of the path is given by the path indices $\boldsymbol{\chi}$ and maps the refined angles to their corresponding delays. The details of our algorithm are discussed in Algorithm~\ref{SWOMP}. The refinement of the delays $\tilde{\btau}$ and their corresponding channel gains $\boldsymbol{\alpha}$ are estimated using SBL with the obtained $\widehat{\bOmega}$ in the next stage. The computational complexity of SWOMP in each iteration is $MP (d_\theta L^{\prime})^2 +MPd_{\theta}L_r + MPd_{\theta}L^{\prime}$. \subsection{SBL Stage} Recalling the measurement equation with the obtained $\widehat{\bOmega}$, we write $\boldsymbol{y} = \widehat{\bOmega}{{ {\boldsymbol{\alpha}}}} + {{{\boldsymbol {n}}}}$. We formulate the estimation method of $(\boldsymbol{\alpha},\tilde{\btau})$ using SBL as follows. SBL is a type-II maximum likelihood (ML) estimation procedure to obtain the channel estimate~\cite{wipf2004sparse,zhang2011sparse}. In this method, ${\boldsymbol{\alpha}}$ is considered as a hidden variable, and posterior statistics are obtained given the observations. SBL assumes a complex Gaussian prior distribution for the entries of ${\boldsymbol{\alpha}}$, which gets written as $ p(\alpha_i){=}\frac{\gamma_i}{\pi}^{-\gamma_i(\alpha_i)^2}.$ The hyperparameters $\alpha_i$ also estimated using the inference procedure. $\gamma_i$ is assumed to follow a Gamma distribution, $\mathcal{G}(\gamma_i;a,b){=}\Gamma((\gamma_i))^{-1}(\gamma_i)^{a-1}e^{-b\gamma_i}b^{\gamma_i}$. Defining, $\boldsymbol{\Gamma}{=}\mbox{diag}(\boldsymbol{\gamma})$, where $\boldsymbol{\gamma}$ is the vector of $\gamma_i$. Noise is assumed to be complex Gaussian, $\mathcal{CN}(\bf{0},\frac{1}{\zeta}{\boldsymbol {I}})$. $\zeta$ is assumed to have Gamma as a prior distribution such that $ p_{\zeta}(\zeta){=}\mathcal{G}(\zeta;c,d)$, where $c,d$ are known. Note that in the case of an uninformative prior, the values of $a$ and $b$ corresponds to 1 and 0 respectively. Now, the posterior distribution of $\boldsymbol{\alpha}$ and the hyper-parameters $\boldsymbol{\gamma}, \zeta$ needs to be obtained. Since the prior and the noise are both Gaussian, obtaining the posterior statistics of $\boldsymbol{\alpha}$ is straightforward. But, the computation of $\boldsymbol{\gamma}$ requires the computation of the marginal probability distribution $p(\boldsymbol{y};\boldsymbol{\gamma},\zeta)$ and maximizing it (alternatively) w.r.t. $\boldsymbol{\gamma},\zeta$. This procedure is known as evidence maximization or type-II ML estimation. To solve this, expectation-maximization (EM) algorithm is used, which proceeds by lower bounding the logarithm of the evidence $p(\boldsymbol{y};\boldsymbol{\gamma},\zeta)$, and maximizing it iteratively. Treating $\boldsymbol{\alpha}$ as a hidden variable, In the expectation (E) step, expectation of the log likelihood of $(\boldsymbol{y},\boldsymbol{\alpha})$ w.r.t. $p(\boldsymbol{\alpha}|\boldsymbol{y},\boldsymbol{\gamma},\zeta)$ is computed. In the maximization (M) step, the hyper-parameters $\boldsymbol{\gamma},\zeta$ are computed by maximizing the function obtained in the E step. More details of SBL and type-II ML estimation can be found in \cite{wipf2004sparse}. Detailed steps for the channel estimation are provided in Algorithm~\ref{SBL}. The SBL algorithm outputs the estimate of the channel gains $\widehat{\balpha}$. Using step 17 in Algorithm~\ref{SWOMP}, the channel estimate $\hat{\boldsymbol{h}}$ at the $k$-th subcarrier can be obtained by $\hat{\boldsymbol{h}}_k{=}\hat{\boldsymbol{\Psi}}_k\widehat{\balpha}$ for all the $K$ subcarriers. The convergence properties of the SBL algorithm are well understood in the literature \cite{wipf2004sparse}. In short, using similar arguments in \cite{wipf2004sparse}, we can show that the proposed SBL converges to the sparsest solution when the noise variance is zero and to a sparse local minimum, irrespective of the noise variance. The computational complexity of each iteration of SBL is $(MP)^3+ 2(MP)^2(d_{\tau}L^{\prime})+2(d_{\tau}L^{\prime})^2MP+(d_{\tau}L^{\prime})^2+ 4MP(d_{\tau}L^{\prime})+(d_{\tau}L^{\prime})$. \setlength{\textfloatsep}{0pt} \vspace{0mm}\begin{algorithm}[t] \caption{SWOMP Stage}\label{SWOMP} \begin{algorithmic}[1]\vspace{-0mm} \Require $\boldsymbol{y}, \tilde{\boldsymbol{\theta}}, \tilde{\btau}, d_{\theta}, d_{\tau}, \sigma_{\theta}, \sigma_{\tau}, \sigma^2$\\ Initialize: $\boldsymbol{\chi}=\{\}$ \vspace{1mm} \State $\boldsymbol{\theta}_l^{\prime}=\tilde{\theta}_l-2\sigma_{\theta}:\frac{4\sigma_{\theta}}{d_{\theta}}:\tilde{\theta}_l+2\sigma_{\theta}\in\mathbb{R}^{1 \times d_{\theta}}$ \vspace{1mm} \State $\boldsymbol{A}^{\prime}$=$[a(\boldsymbol{\theta}_0^{\prime})\ a(\boldsymbol{\theta}_1^{\prime})\ \cdots\ a(\boldsymbol{\theta}_{L_r}^{\prime})]\in\mathbb{C}^{M\times d_{\theta}(L_r+1)}$ \vspace{1mm} \State $\hat{\boldsymbol{\theta}}=\textbf{SWOMP}(\boldsymbol{y}, \boldsymbol{A}^{\prime},\sigma^2)$ \\ \vspace{1mm} $\hat{\boldsymbol{\theta}}\in\mathbb{R}^{1\times L^{\prime}}$ is $\{\hat{\theta}_{\ell}\ |\ \ell=0,1,\cdots,L^{\prime}-1\}$\\ \vspace{1mm} $\textbf{Path association:}$ \For{$\ell=0:L^{\prime}-1$} \State $p = \arg \min\limits\{|\theta_\ell\boldsymbol{1}-\boldsymbol{\theta}|\}$ \Comment{$\boldsymbol{1}\in 1^{1\times (L_r+1)}$} \State $\boldsymbol{\chi}=\boldsymbol{\chi} \cup p$ \Comment{$p{\ =}\ $path index} \EndFor \State $\tilde{\btau}(\boldsymbol{\chi})\in\mathbb{R}^{1\times L^{\prime}}$ is $\{\tilde{\tau}_{\ell}(\boldsymbol{\chi})\ |\ \ell=0,1,\cdots,L^{\prime}-1\}$ \Comment{\!delays of the corresponding path index obtained in step 9} \vspace{1mm} \State $\hat{\btau}_{\ell}=\tilde{\tau}_{\ell}(\boldsymbol{\chi})-2\sigma_{\tau}:\frac{4\sigma_{\tau}}{d_{\tau}}:\tilde{\tau}_{\ell}(\boldsymbol{\chi})+2\sigma_{\tau}\in\mathbb{R}^{1 \times d_{\tau}}$ \vspace{1mm} \State $\hat{\btau} = [\hat{\btau}_0\ \hat{\btau}_1\ \cdots\ \hat{\btau}_{L^\prime-1}]\in\mathbb{R}^{1 \times d_{\tau}L^{\prime}}$ \vspace{1mm} \State The resulting $\boldsymbol{\beta}_{k}$ obtained using $\hat{\btau}$ is denoted as $\hat{\boldsymbol{\beta}}_{k}\in\mathbb{C}^{d_{\tau}L^{\prime} \times d_{\tau}L^{\prime}}$ \vspace{1mm} \State $\hat{\boldsymbol{A}}_{\ell}=[a(\hat{\theta}_{\ell})a(\hat{\theta}_{\ell})\cdots a(\hat{\theta}_{\ell})]\in\mathbb{C}^{M \times d_{\tau}}$\Comment{Repeat $d_{\tau}$ times} \vspace{1mm} \State $\hat{\boldsymbol{A}}=[\hat{\boldsymbol{A}}_0\ \hat{\boldsymbol{A}}_1\ \cdots\ \hat{\boldsymbol{A}}_{L^{\prime}-1}]\in\mathbb{C}^{M \times d_{\tau}L^{\prime}}$ \vspace{1mm} \State $\hat{\boldsymbol{\Psi}}_{k} = \hat{\boldsymbol{A}}\hat{\boldsymbol{\beta}}_{k}\in\mathbb{C}^{M \times d_{\tau}L^{\prime}}$ \vspace{1mm} \State $\widehat{\bOmega}=[\hat{\boldsymbol{\Psi}}_0^{{\Transpose}} \hat{\boldsymbol{\Psi}}_1^{{\Transpose}} \cdots \hat{\boldsymbol{\Psi}}_{{P-1}}^{{\Transpose}}]^{{\Transpose}}\!\in\!\mathbb{C}^{MP \!\times d_{\tau}L^{\prime}}$ \end{algorithmic}\vspace{-1.5mm} \vspace{-0mm} \end{algorithm}\vspace{-1mm} \setlength{\textfloatsep}{0pt} \begin{algorithm}[t] \caption{SBL Stage}\label{SBL} \begin{algorithmic}[1] \Require $\boldsymbol{y}$, $\widehat{\bOmega}$, $p_{\boldsymbol{y}}(\boldsymbol{y}\mid\widehat{\bOmega},\boldsymbol{\alpha} )$ \\ Initialize: $t=0$, $(\widehat{\balpha})^t$ using LS estimate. \Repeat \State [Estimate $\boldsymbol{\alpha}$] \vspace{1mm} \State $\boldsymbol{\Sigma}_y^t = \frac{1}{\zeta^{t-1}}{\boldsymbol {I}} + \widehat{\bOmega}\boldsymbol{\Gamma}^{-1}\widehat{\bOmega}^H$. \vspace{1mm} \State $\widehat{\bSigma}^t = \boldsymbol{\Gamma}^{-1} - \boldsymbol{\Gamma}^{-1}\widehat{\bOmega}^H\left(\boldsymbol{\Sigma}_y^t\right)^{-1}\widehat{\bOmega}\boldsymbol{\Gamma}^{-1}$. \vspace{1mm} \State $(\widehat{\balpha})^t = \zeta^{t-1}\widehat{\bSigma}^{t}\widehat{\bOmega}^H\boldsymbol{y}$. \vspace{1mm} \State [Hyper-parameters Update] \vspace{1mm} \State $\gamma_i^t = \frac{2a-1}{\mathbb{E}\left((\widehat{\alpha}_i)^2\right)+2b}$. \vspace{1mm} \State $\zeta^t = \frac{2c-1}{\frac{\mathbb{E}(\lvert \boldsymbol{y}-{\boldsymbol {z}} \rvert^2)}{MP}+2c}, z_i = \widehat{\bOmega} \widehat{\balpha}$. \Until {Convergence} \end{algorithmic} \end{algorithm} \vspace{-2mm}\subsection{Identifiability of the Proposed SBL: Minimum Narrowband Pilots Required?} \vspace{-2mm} This subsection provides conditions under which the sensing-aided channel estimation using SBL becomes locally identifiable. Furthermore, the analysis herein provides the minimum pilots required for the respective channel estimation algorithm to be identifiable. The distribution of $\boldsymbol{y}[k]$, after marginalizing w.r.t $\boldsymbol{\alpha}$ can be written as \vspace{-1mm}\begin{align} p_{\boldsymbol{y}}(\boldsymbol{y}[k]) = \mathcal{CN}(\boldsymbol{0}, {\boldsymbol {\Psi}}_k \boldsymbol{\Gamma}^{-1}({\boldsymbol {\Psi}}_k)^H + \zeta^{-1}{\boldsymbol {I}}).\vspace{-2mm} \end{align} The signal model in \eqref{eq_underscore_dict} is non-identifiable if ${\boldsymbol {\Psi}}_k \boldsymbol{\Gamma}^{-1}_1({\boldsymbol {\Psi}}_k)^H{=}{\boldsymbol {\Psi}}_k \boldsymbol{\Gamma}^{-1}_2({\boldsymbol {\Psi}}_k)^H$ for some $\boldsymbol{\Gamma}^{-1}_1 \neq \boldsymbol{\Gamma}^{-1}_2$. The rank of ${\boldsymbol {\Psi}}_k^{{\Transpose}}\otimes {\boldsymbol {\Psi}}$ is denoted as $R \leq \left(MP\right)$, where $\otimes$ represents the Khatri-Rao product. Following similar analysis\cite{PalICASSP2014}, we can show that the SBL algorithm is identifiable as long as $L$ (number of nonzero elements in $\boldsymbol{\alpha}$) is $\mathcal{O}(R^2)$ (${=}\mathcal{O}(\left(MP\right)^2)$ for suitable ${\boldsymbol {\Psi}}_k^{{\Transpose}}$). For a mmWave system, this would be just fewer pilots, compared to using number of pilots of the $\mathcal{O}(K)$ as in existing 5G-NR algorithms. Next, we look at the CRB of the estimation model here. The local identifiability (upto permutation ambiguity) of the SBL based parameter estimation is ensured if the Fisher information matrix (FIM) is non-singular \cite{BoizardICASSP2015}. First, the estimated parameters are defined in a vector as $\boldsymbol{\Theta} {=}[\boldsymbol{\theta}, \boldsymbol{\alpha}, \boldsymbol{\gamma}, \zeta, \boldsymbol{\tau}]$. The FIM can be partitioned as \vspace{-1mm}\begin{align}\vspace{-2mm} \small {\boldsymbol {J}}_{\boldsymbol{\Theta}\bTheta} = \begin{bmatrix} {\boldsymbol {J}}_{\boldsymbol{\theta}\btheta} &{\boldsymbol {J}}_{\boldsymbol{\theta}\boldsymbol{\alpha}} &{\boldsymbol {J}}_{\boldsymbol{\theta}\boldsymbol{\gamma}} &{\boldsymbol {J}}_{\boldsymbol{\theta}\zeta} &{\boldsymbol {J}}_{\boldsymbol{\theta}\btau}\\ {\boldsymbol {J}}_{\boldsymbol{\alpha}\boldsymbol{\theta}} &{\boldsymbol {J}}_{\boldsymbol{\alpha}\balpha} &{\boldsymbol {J}}_{\boldsymbol{\alpha}\boldsymbol{\gamma}}& {\boldsymbol {J}}_{\boldsymbol{\alpha}\zeta} & {\boldsymbol {J}}_{\boldsymbol{\alpha}\btau}\\ {\boldsymbol {J}}_{\boldsymbol{\gamma}\boldsymbol{\theta}} &{\boldsymbol {J}}_{\boldsymbol{\gamma}\boldsymbol{\alpha}} &{\boldsymbol {J}}_{\boldsymbol{\gamma}\bgamma}& {\boldsymbol {J}}_{\boldsymbol{\gamma}\zeta} & {\boldsymbol {J}}_{\boldsymbol{\gamma}\btau} \\ {\boldsymbol {J}}_{\zeta\boldsymbol{\theta}} &{\boldsymbol {J}}_{\zeta\boldsymbol{\alpha}} &{\boldsymbol {J}}_{\zeta\boldsymbol{\gamma}}& {\boldsymbol {J}}_{\zeta\zeta}& {\boldsymbol {J}}_{\zeta\btau}, \\ {\boldsymbol {J}}_{\btau\boldsymbol{\theta}} &{\boldsymbol {J}}_{\btau\boldsymbol{\alpha}} &{\boldsymbol {J}}_{\btau\boldsymbol{\gamma}}& {\boldsymbol {J}}_{\btau\zeta}& {\boldsymbol {J}}_{\btau\btau} \end{bmatrix},\vspace{-5mm} \end{align}\vspace{-1mm} where ${\boldsymbol {J}}_{{\bm x}{\bm y}}{=} \mathbb{E}\left(\frac{\partial \ln p({\bm y},{\bm x})}{\partial {\bm x}} \frac{\partial \ln p({\bm y},{\bm x})}{\partial {\bm y}}^{{\Transpose}}\right)$. Each of the FIM blocks can be derived as (detailed derivations are skipped since those follows classical results in estimation theory) \begin{align}\vspace{-4mm} {\boldsymbol {J}}_{\boldsymbol{\theta}\btheta} &= \mathbb{E}(\zeta)(\boldsymbol{\beta}_k)^H\mathbb{E}(\frac{\partial {\bm A}(\boldsymbol{\theta})}{\partial \boldsymbol{\theta}}^H\frac{\partial {\bm A}(\boldsymbol{\theta})}{\partial \boldsymbol{\theta}})\boldsymbol{\beta}_k\mathbb{E}(\boldsymbol{\Gamma}^{-1}) , \\ {\boldsymbol {J}}_{\boldsymbol{\theta}\zeta} &= \mbox{diag}\left(\Re\{(\boldsymbol{\beta}_k)^H\frac{\partial {\bm A}(\boldsymbol{\theta})}{\partial \boldsymbol{\theta}}^H{\bm A}\boldsymbol{\beta}_k\}\mathbb{E}(\boldsymbol{\Gamma}^{-1})\right), \\ {\boldsymbol {J}}_{\boldsymbol{\gamma}\bgamma} &= -\mathbb{E}(\boldsymbol{\Gamma}^{-1}) + (a-1)\mathbb{E}(\boldsymbol{\Gamma}^{-1}), \\ {\boldsymbol {J}}_{\zeta\zeta} &= -MP\mathbb{E}(\zeta^{-2}) + (c-1)\mathbb{E}(\zeta^{-1}), \\ {\boldsymbol {J}}_{\boldsymbol{\alpha}\balpha} &= -\mathbb{E}(\boldsymbol{\Gamma})- (\boldsymbol{\beta}_k)^H({\bm A})^H{\bm A}\boldsymbol{\beta}_k\mathbb{E}(\zeta), \\ {\boldsymbol {J}}_{\zeta\btau} &= \frac{\partial(\boldsymbol{\beta}_k)^H}{\partial \btau}\mathbb{E}\left( {\bm A}(\boldsymbol{\theta})^H{\bm A}(\boldsymbol{\theta})\right)\boldsymbol{\beta}_k\mathbb{E}(\boldsymbol{\Gamma}^{-1}) , \\ {\boldsymbol {J}}_{\btau\btau} &= \mathbb{E}(\zeta)\frac{\partial(\boldsymbol{\beta}_k)^H}{\partial \btau}\mathbb{E}\left( {\bm A}(\boldsymbol{\theta})^H{\bm A}(\boldsymbol{\theta})\right)\frac{\partial\boldsymbol{\beta}_k}{\partial \btau}\mathbb{E}(\boldsymbol{\Gamma}^{-1}) , \vspace{-4mm} \end{align}\vspace{-4mm}\begin{align}\vspace{-3mm} {\boldsymbol {J}}_{\boldsymbol{\theta}\btau} &= \mathbb{E}(\zeta)\frac{\partial(\boldsymbol{\beta}_k)^H}{\partial \btau}\mathbb{E}\left( {\bm A}(\boldsymbol{\theta})^H\frac{\partial{\bm A}(\boldsymbol{\theta})}{\partial \boldsymbol{\theta}}\right)\boldsymbol{\beta}_k\mathbb{E}(\boldsymbol{\Gamma}^{-1}) , \vspace{-5mm} \end{align} \vspace{-2mm} and rest of the terms result to be zero. \begin{align}\vspace{-3mm}\small {\boldsymbol {J}}_{\boldsymbol{\Theta}\bTheta} = \begin{bmatrix} {\boldsymbol {J}}_{\boldsymbol{\theta}\btheta} & \boldsymbol{0} &\boldsymbol{0} &{\boldsymbol {J}}_{\boldsymbol{\theta}\zeta} & {\boldsymbol {J}}_{\boldsymbol{\theta}\btau} \\ \boldsymbol{0} &{\boldsymbol {J}}_{\boldsymbol{\alpha}\balpha} &\boldsymbol{0}& \boldsymbol{0} &\boldsymbol{0}\\ \boldsymbol{0} &\boldsymbol{0} &{\boldsymbol {J}}_{\boldsymbol{\gamma}\bgamma}& \boldsymbol{0}&\boldsymbol{0} \\ {\boldsymbol {J}}_{\zeta\boldsymbol{\theta}} &\boldsymbol{0} & \boldsymbol{0}& {\boldsymbol {J}}_{\zeta\zeta} & {\boldsymbol {J}}_{\zeta\btau} \\ {\boldsymbol {J}}_{\btau\boldsymbol{\theta}} &\boldsymbol{0} & \boldsymbol{0}& {\boldsymbol {J}}_{\btau\zeta} & {\boldsymbol {J}}_{\btau\btau} \end{bmatrix}.\vspace{-2mm} \end{align} \begin{figure*} \begin{equation}\tag{27}\begin{aligned}\vspace{-4mm} &CRB(\boldsymbol{\theta},\boldsymbol{\alpha}) = \left(\begin{bmatrix}{\boldsymbol {J}}_{\boldsymbol{\theta}\btheta} & \boldsymbol{0}\nonumber \\ \boldsymbol{0} & {\boldsymbol {J}}_{\boldsymbol{\alpha}\balpha}\end{bmatrix} - \begin{bmatrix}\tiny\boldsymbol{0} & {\boldsymbol {J}}_{\boldsymbol{\theta}\zeta} & {\boldsymbol {J}}_{\boldsymbol{\theta}\btau} \\ \boldsymbol{0} & \boldsymbol{0} & \boldsymbol{0}\end{bmatrix}\begin{bmatrix}\tiny{\boldsymbol {J}}_{\boldsymbol{\gamma}\bgamma}^{-1} & \boldsymbol{0} \\ \boldsymbol{0} & \underbrace{\begin{bmatrix}{\boldsymbol {J}}_{\zeta\zeta} & {\boldsymbol {J}}_{\zeta\btau} \\ {\boldsymbol {J}}_{\btau\zeta} & {\boldsymbol {J}}_{\btau\btau}\end{bmatrix}^{-1}}_{{\bm F}_{\zeta,\btau}}\end{bmatrix}\begin{bmatrix}\tiny\boldsymbol{0} & {\boldsymbol {J}}_{\boldsymbol{\theta}\zeta} & {\boldsymbol {J}}_{\boldsymbol{\theta}\btau}\\ \boldsymbol{0} & \boldsymbol{0} & \boldsymbol{0}\end{bmatrix}^{{\Transpose}}\right)^{-1},\vspace{-2mm} \end{aligned}\label{eq_CRB_1} \end{equation}\vspace{-6mm} \end{figure*}The CRB for $\boldsymbol{\Theta}$ can be expressed as $CRB(\boldsymbol{\Theta}) {=}{\boldsymbol {J}}_{\boldsymbol{\Theta}\bTheta}^{-1}$. The CRB for AoA estimates and $\boldsymbol{\alpha}$ can be written using Schur-complement for inverting a block matrix as derived in \eqref{eq_CRB_1}, which can be simplified as \vspace{-2mm}\begin{align}\vspace{-2mm}\scriptsize &CRB(\boldsymbol{\theta},\boldsymbol{\alpha}) = \\\nonumber & \begin{bmatrix}\left({\boldsymbol {J}}_{\boldsymbol{\theta}\btheta}-\begin{bmatrix} {\boldsymbol {J}}_{\boldsymbol{\theta}\zeta}&{\boldsymbol {J}}_{\boldsymbol{\theta}\btau} \end{bmatrix}{\bm F}_{\zeta\btau}^{-1}\begin{bmatrix} {\boldsymbol {J}}_{\boldsymbol{\theta}\zeta}&{\boldsymbol {J}}_{\boldsymbol{\theta}\btau} \end{bmatrix}^{{\Transpose}}\right)^{-1} & \boldsymbol{0} \\ \boldsymbol{0} & {\boldsymbol {J}}_{\boldsymbol{\alpha}\balpha}^{-1}\end{bmatrix} . \label{eq_crb_theta_alpha}\vspace{-6mm} \end{align} Following similar derivations, the CRB can be computed for $\boldsymbol{\alpha},\boldsymbol{\gamma},\zeta$. From (26), we can conclude that for local identifiability of $\boldsymbol{\theta},\boldsymbol{\alpha}$, ${\boldsymbol {J}}_{\boldsymbol{\theta}\btheta}-\begin{bmatrix} {\boldsymbol {J}}_{\boldsymbol{\theta}\zeta}&{\boldsymbol {J}}_{\boldsymbol{\theta}\btau} \end{bmatrix}{\bm F}_{\zeta\zeta}^{-1}\begin{bmatrix} {\boldsymbol {J}}_{\boldsymbol{\theta}\zeta}&{\boldsymbol {J}}_{\boldsymbol{\theta}\btau} \end{bmatrix}^{{\Transpose}}$, and ${\boldsymbol {J}}_{\boldsymbol{\alpha}\balpha}$ should be invertible, respectively. \section{Simulation Results} In this section, the performance of our novel SWOMP-SBL sensing aided channel estimation algorithm is evaluated through numerical simulations. The system parameters considered here are, subcarrier spacing${=}120 \,\textrm{KHz}$, center frequency${=}28 \,\textrm{GHz}$, sampling rate${=}30.72 \,\textrm{MHz}$, sampling period $T_s{=}32.552\, \textrm{ns}$, fft size $K{=}256$, cyclic prefix length $N_{cp}{=}34$ and the number of receive antennas $M{=}32$. The pilots are generated similar to the sounding reference signals (SRS) in 5G standards \cite{3GPP5GNR}. The location of the pilots in the OFDM grid are arranged in a comb fashion as defined in the 3GPP standard\cite{3GPP5GNR} i.e., one pilot for every $K_c$ subcarriers as shown in Fig.~\ref{fig:comb}. The channel is generated using a ray-tracing tool using the locations of gNB and UE with the number of delay taps $N_c{=}N_{cp}$. The erroneous sensing information is generated with $\sigma_{\theta}{=}3^{\circ}$ and $\sigma_{\tau}{=}\frac{Ts}{6}$. In our scenario, pilots of size $P{=}16$ are transmitted with a comb size $K_c{=}16$. The erroneous AoA from the sensing information are refined using SWOMP with a dictionary matrix considering $d_{\theta}{=}500$. Further, the channel gains $\widehat{\balpha}$ are estimated using SBL considering $d_{\tau}{=}50$. The channel estimation procedure with erroneous sensing information is denoted by $\textbf{SWOMP-SBL\ +\ Sensing\ Info\ Error}$ in the plot. The channel gains $\widehat{\balpha}$ are also estimated using LS assuming perfect sensing information is available at the gNB denoted by $\textbf{Ideal\ Sensing\ Info\ +\ LS}$. The performance of our proposed algorithms is evaluated by comparing the normalized mean squared error (NMSE) of the channel using fewer $P$ pilots to the NMSE of the channel obtained by transmitting all the $K=256$ pilots (wideband). The channel estimation using the wideband pilots is performed using the classical LS method and SWOMP denoted as $\textbf{WB+LS}$ and $\textbf{WB+SWOMP}$ respectively. The dictionary used for both algorithms is of size 500, discretized in the angular domain in $[0^{\circ},180^{\circ}]$. We consider a scenario where all the scatterers provided by the sensing information in $\mathcal{S}_r$ might not be associated with the communication channel. The parameters of the scatterers chosen for the simulations are $L_r{=}10$ and $L_c{=}6$. From Fig.~\ref{fig:case1}, we can see that with sensing information, SWOMP-SBL based channel estimation algorithm has a significant gain in the NMSE compared to the wideband classical LS and greedy SWOMP algorithm with fewer pilots and robust to the errors in the sensing information. Hence, we reduce the pilot overhead from $100\%$ to $6.25\%$. \begin{figure}[t] \centerline{\includegraphics[width=3in,height=0.8in]{fig/comb_structure.png}}\vspace{-4mm} \caption{Uplink SRS comb structure in a OFDM symbol.} \label{fig:comb} \end{figure}\vspace{-2mm} \begin{figure}[t] \centerline{\includegraphics[width=3.8in,height=2.4in]{fig/Fig_6_point_scat_angle_error_2_reduced_latest.png}}\vspace{-2mm} \caption{SNR vs NMSE of the channel estimates in the case of point scatterers.} \label{fig:case1} \end{figure} \section{Conclusion} In this paper, the uplink channel estimation aided by sensing information for mmWave MIMO systems has been studied. The proposed SWOMP-SBL algorithm, along with the sensing information, uses fewer uplink pilots compared to conventional state-of-the-art systems. The proposed scheme is also robust to erroneous sensing information, including unassociated paths in the sensing information. Simulation results have validated the superior performance using reduced uplink pilots for the proposed SWOMP-SBL scheme compared to conventional state-of-the-art algorithms. Finally, the CRB for the unknown parameters is derived, and local identifiability analysis has been presented. \bibliographystyle{IEEEtran}\def0.9{0.9}
\section{Introduction} \input{sections/intro.tex} \section{Related Works} \input{sections/related_works.tex} \section{Approach} \input{sections/methods.tex} \section{Embedding Analysis} \input{sections/analysis.tex} \section{Experiments and Discussion} \input{sections/experiments.tex} \section{Conclusion} \input{sections/conclusion.tex} \section{Experimental Design} We offer an overview of the architecture and training parameters used to learn molecular embeddings on our simulation data. While this description can be valuable to some readers, we direct those interested in reproducing our findings or building on our framework to access the code directly. We are currently in the process of developing a github repository to host all code used in this work, a service that supports users downloading our generated simulation dataset, as well as a webserver that can be called over gRPC to convert a list of molecules represented as SMILES strings to molecular embeddings produced by our model. \subsection{Architecture Details} To learn on the simulation dataset, we follow a design similar to the multi-task architecture described in FS-Mol~\cite{fsmol}, adapting their code written in Pytorch~\cite{paszke2019pytorch} to train on our simulation dataset. In particular, we use a 10-layer MPNN~\cite{gilmer2017neural} augmented with PNA~\cite{pna}, and a graph readout composed of an element-wise max pooling operation, weighted sum, and weighted mean to compose a fixed-dimension feature vector from an arbitrary graph representation. We then pass the representation output from the graph readout through a shallow MLP of hidden dimension \num{512} and finally use a projection layer composed of a $[512 \times 1]$ linear transformation for each target in our dataset to map the penultimate representation into a predicted regression binding affinity score between the input and the multi-task label. We use a mean squared error loss to train the model. \\ \subsection{Training Parameters} Our architecture employs a learning rate of 5e-5 for the shared parameters and a learning rate of 1e-4 for the task-specific parameters. We use a linear warm-up scheduler for 100 steps (starting at 0 and ending at the specified learning rate) for both shared and task-specific learning rates. The training process also leverages Adam~\cite{kingma2014adam} with default Pytorch parameters and uses a batch size of 256 molecules.\\ We randomly split our simulation data into 80\% train and 20\% validation, and use early stopping with a window size of 10 epoch. Training is run across 100 epochs, and we load the model parameters with the best validation performance to convert the feature space to an embedding space for downstream molecular prediction tasks. \subsection{Integrating the Simulation Model into Existing Deep Learning Paradigms} To integrate the embeddings learned during simulation into existing deep learning paradigms, we simply iterate over the training data of a real-world dataset, featurize the molecules, send the featurized molecules through the simulation model, and then extract the final graph representation output from the GNN layers. We then compose a new dataset mapping the molecular embedding to its appropriate label in the original real-world dataset. \\ Oftentimes, deep learning models fitting molecular prediction tasks will learn a node embedding layer which projects the initial feature space to an embedding space. For models which employ such a projection, we simply remove it from the model. If a model's internal hidden representation does not match the learned embedding dimension, a single linear transformation can simply be learned to project each node in the molecular embedding to the per-node hidden dimension space of the downstream model. \section{MoleculeNet Dataset (Dis)Similarity} Expanding on our analysis of the MoleculeNet datasets in \autoref{sec:experiment}, we go into additional detail in the specific ways one dataset may be similar or dissimilar to the small molecule-target interactions evaluated during simulation. BACE Regression, BACE Classification, and Tox21 measure the interactions of small molecules with different target proteins. These datasets are conceptually similar to our molecular simulation, and the BACE datasets can even be viewed as one of the 5,135 biological targets in FS-Mol. BBBP, ClinTox, and Clearance contain measurements that are related to processes at the organ or organism level and arise from a combination of many factors, including interactions with a host of proteins and membrane permeability. In this way, some parts of the physical generative process are related to the pre-training data, but these measurements correspond to much higher-level phenomena making it unclear \textit{a priori} if the knowledge gained from pre-training would be relevant. Delaney, FreeSolv, and Lipo measure, roughly speaking, the relative favorability of each molecule occurring in water as compared to in a crystalline form, a vacuum, or a hydrophobic solvent, respectively. Of these, Lipo is the most conceptually similar to small molecule-target docking simulation, as hydrophobic and hydrophilic functional groups are causal for both tasks. HOPV maps small molecules to photovoltaic measurements. While conceptually dissimilar from ligand–target docking simulation, this dataset is extremely small, composed of 350 small molecules split across train, validation, and test sets. \section{Additional FS-Mol Experimental Results} To offer additional insight into the FS-Mol empirical findings in \autoref{sec:experiment}, we present a per-target breakdown of the first 50 targets in the test set of FS-Mol across support size splits of 16, 32, 64, 128, and 256. \autoref{table:50_mt_fsmol} depicts these results for the Multi-Task Learning baseline, \autoref{table:50_proto_fsmol} depicts these results for the Prototypical Networks baseline using GNN features only (as opposed to the model reported in \cite{fsmol} which uses ECFP as well as GNN features)\footnote{We focus our analysis to GNN features in Prototypical networks to isolate the effect of transforming the default GNN feature space to the learned embedding space and avoid non-linear interactions between different input modalities.}, and \autoref{table:50_maml_fsmol} depicts these results from the MAML baseline. Highlighted values indicate the highest result for this target at the given support size. \begin{table*}[t!] \centering \caption{Multi-Task Results measuring $\Delta$AUPRC on the first 50 tasks in the test set of FS-Mol.} \resizebox{1.0\linewidth}{!}{% \begin{tabular}{lllllllllll} \toprule {TASK-ID} & {16 (EMB-MT)} & {32 (EMB-MT)} & {64 (EMB-MT)} & {128 (EMB-MT)} & {256 (EMB-MT)} & {16 (MT)} & {32 (MT)} & {64 (MT)} & {128 (MT)} & {256 (MT)} \\ \midrule 1006005 & {\color{green} $\mathbf{0.57 \pm 0.05}$} & {\color{green} $\mathbf{0.62 \pm 0.04}$} & {\color{green} $\mathbf{0.63 \pm 0.05}$} & {\color{green} $\mathbf{0.62 \pm 0.05}$} & nan & $0.54 \pm 0.03$ & $0.54 \pm 0.03$ & $0.55 \pm 0.03$ & $0.56 \pm 0.06$ & nan \\ 1066254 & {\color{green} $\mathbf{0.71 \pm 0.07}$} & {\color{green} $\mathbf{0.73 \pm 0.06}$} & {\color{green} $\mathbf{0.81 \pm 0.06}$} & $0.83 \pm 0.10$ & nan & $0.65 \pm 0.05$ & $0.64 \pm 0.09$ & $0.77 \pm 0.07$ & {\color{green} $\mathbf{0.86 \pm 0.11}$} & nan \\ 1119333 & {\color{green} $\mathbf{0.69 \pm 0.08}$} & {\color{green} $\mathbf{0.73 \pm 0.05}$} & {\color{green} $\mathbf{0.78 \pm 0.03}$} & {\color{green} $\mathbf{0.82 \pm 0.03}$} & {\color{green} $\mathbf{0.85 \pm 0.02}$} & $0.69 \pm 0.07$ & $0.72 \pm 0.05$ & $0.76 \pm 0.02$ & $0.79 \pm 0.04$ & $0.84 \pm 0.04$ \\ 1243967 & $0.62 \pm 0.08$ & {\color{green} $\mathbf{0.72 \pm 0.09}$} & {\color{green} $\mathbf{0.74 \pm 0.05}$} & {\color{green} $\mathbf{0.80 \pm 0.05}$} & nan & {\color{green} $\mathbf{0.63 \pm 0.07}$} & $0.66 \pm 0.05$ & $0.71 \pm 0.04$ & $0.76 \pm 0.05$ & nan \\ 1243970 & {\color{green} $\mathbf{0.66 \pm 0.06}$} & {\color{green} $\mathbf{0.70 \pm 0.04}$} & {\color{green} $\mathbf{0.75 \pm 0.05}$} & {\color{green} $\mathbf{0.77 \pm 0.04}$} & nan & $0.63 \pm 0.06$ & $0.65 \pm 0.04$ & $0.70 \pm 0.02$ & $0.75 \pm 0.05$ & nan \\ 1613777 & $0.52 \pm 0.03$ & $0.53 \pm 0.04$ & {\color{green} $\mathbf{0.55 \pm 0.02}$} & {\color{green} $\mathbf{0.57 \pm 0.03}$} & {\color{green} $\mathbf{0.59 \pm 0.02}$} & {\color{green} $\mathbf{0.52 \pm 0.04}$} & {\color{green} $\mathbf{0.53 \pm 0.02}$} & $0.54 \pm 0.02$ & $0.57 \pm 0.02$ & $0.59 \pm 0.02$ \\ 1613800 & $0.42 \pm 0.02$ & {\color{green} $\mathbf{0.43 \pm 0.03}$} & {\color{green} $\mathbf{0.43 \pm 0.02}$} & $0.45 \pm 0.02$ & $0.47 \pm 0.02$ & {\color{green} $\mathbf{0.42 \pm 0.03}$} & $0.42 \pm 0.01$ & {\color{green} $\mathbf{0.43 \pm 0.03}$} & {\color{green} $\mathbf{0.45 \pm 0.02}$} & {\color{green} $\mathbf{0.47 \pm 0.01}$} \\ 1613898 & $0.53 \pm 0.03$ & $0.54 \pm 0.06$ & $0.56 \pm 0.04$ & $0.60 \pm 0.07$ & nan & {\color{green} $\mathbf{0.55 \pm 0.04}$} & {\color{green} $\mathbf{0.54 \pm 0.06}$} & {\color{green} $\mathbf{0.58 \pm 0.04}$} & {\color{green} $\mathbf{0.61 \pm 0.08}$} & nan \\ 1613907 & {\color{green} $\mathbf{0.62 \pm 0.06}$} & {\color{green} $\mathbf{0.62 \pm 0.08}$} & $0.63 \pm 0.08$ & $0.66 \pm 0.14$ & nan & $0.60 \pm 0.05$ & {\color{green} $\mathbf{0.62 \pm 0.07}$} & {\color{green} $\mathbf{0.67 \pm 0.06}$} & {\color{green} $\mathbf{0.70 \pm 0.15}$} & nan \\ 1613926 & {\color{green} $\mathbf{0.67 \pm 0.07}$} & {\color{green} $\mathbf{0.69 \pm 0.06}$} & {\color{green} $\mathbf{0.74 \pm 0.06}$} & {\color{green} $\mathbf{0.85 \pm 0.14}$} & nan & $0.61 \pm 0.04$ & $0.60 \pm 0.06$ & $0.69 \pm 0.06$ & $0.73 \pm 0.19$ & nan \\ 1613949 & {\color{green} $\mathbf{0.47 \pm 0.08}$} & {\color{green} $\mathbf{0.46 \pm 0.06}$} & {\color{green} $\mathbf{0.54 \pm 0.04}$} & {\color{green} $\mathbf{0.62 \pm 0.12}$} & nan & $0.45 \pm 0.06$ & $0.45 \pm 0.06$ & $0.52 \pm 0.06$ & $0.56 \pm 0.12$ & nan \\ 1614027 & {\color{green} $\mathbf{0.54 \pm 0.03}$} & {\color{green} $\mathbf{0.56 \pm 0.04}$} & {\color{green} $\mathbf{0.60 \pm 0.03}$} & {\color{green} $\mathbf{0.66 \pm 0.02}$} & {\color{green} $\mathbf{0.69 \pm 0.03}$} & $0.53 \pm 0.03$ & {\color{green} $\mathbf{0.56 \pm 0.04}$} & $0.59 \pm 0.03$ & $0.63 \pm 0.02$ & $0.66 \pm 0.02$ \\ 1614153 & {\color{green} $\mathbf{0.36 \pm 0.01}$} & {\color{green} $\mathbf{0.38 \pm 0.03}$} & {\color{green} $\mathbf{0.38 \pm 0.03}$} & {\color{green} $\mathbf{0.40 \pm 0.02}$} & {\color{green} $\mathbf{0.40 \pm 0.02}$} & $0.36 \pm 0.02$ & $0.37 \pm 0.03$ & $0.37 \pm 0.02$ & $0.38 \pm 0.03$ & $0.39 \pm 0.01$ \\ 1614292 & {\color{green} $\mathbf{0.37 \pm 0.03}$} & {\color{green} $\mathbf{0.37 \pm 0.02}$} & {\color{green} $\mathbf{0.38 \pm 0.02}$} & {\color{green} $\mathbf{0.38 \pm 0.02}$} & {\color{green} $\mathbf{0.39 \pm 0.01}$} & $0.36 \pm 0.02$ & $0.37 \pm 0.01$ & $0.38 \pm 0.02$ & $0.38 \pm 0.01$ & $0.38 \pm 0.02$ \\ 1614423 & {\color{green} $\mathbf{0.66 \pm 0.12}$} & {\color{green} $\mathbf{0.68 \pm 0.10}$} & {\color{green} $\mathbf{0.72 \pm 0.05}$} & {\color{green} $\mathbf{0.77 \pm 0.04}$} & {\color{green} $\mathbf{0.82 \pm 0.02}$} & $0.52 \pm 0.05$ & $0.54 \pm 0.05$ & $0.59 \pm 0.05$ & $0.67 \pm 0.04$ & $0.74 \pm 0.04$ \\ 1614433 & {\color{green} $\mathbf{0.45 \pm 0.04}$} & $0.47 \pm 0.06$ & {\color{green} $\mathbf{0.48 \pm 0.04}$} & {\color{green} $\mathbf{0.50 \pm 0.02}$} & {\color{green} $\mathbf{0.55 \pm 0.04}$} & $0.45 \pm 0.04$ & {\color{green} $\mathbf{0.47 \pm 0.05}$} & $0.47 \pm 0.04$ & $0.49 \pm 0.03$ & $0.53 \pm 0.04$ \\ 1614466 & {\color{green} $\mathbf{0.47 \pm 0.04}$} & {\color{green} $\mathbf{0.48 \pm 0.05}$} & {\color{green} $\mathbf{0.49 \pm 0.03}$} & {\color{green} $\mathbf{0.49 \pm 0.05}$} & {\color{green} $\mathbf{0.50 \pm 0.03}$} & $0.46 \pm 0.05$ & $0.47 \pm 0.05$ & $0.47 \pm 0.04$ & $0.48 \pm 0.04$ & $0.48 \pm 0.02$ \\ 1614503 & {\color{green} $\mathbf{0.47 \pm 0.08}$} & {\color{green} $\mathbf{0.48 \pm 0.09}$} & {\color{green} $\mathbf{0.52 \pm 0.05}$} & {\color{green} $\mathbf{0.73 \pm 0.21}$} & nan & $0.44 \pm 0.05$ & $0.44 \pm 0.06$ & $0.48 \pm 0.08$ & $0.66 \pm 0.22$ & nan \\ 1614508 & $0.74 \pm 0.10$ & {\color{green} $\mathbf{0.85 \pm 0.02}$} & $0.87 \pm 0.02$ & $0.90 \pm 0.04$ & nan & {\color{green} $\mathbf{0.76 \pm 0.07}$} & {\color{green} $\mathbf{0.85 \pm 0.04}$} & {\color{green} $\mathbf{0.87 \pm 0.03}$} & {\color{green} $\mathbf{0.91 \pm 0.05}$} & nan \\ 1614522 & {\color{green} $\mathbf{0.58 \pm 0.04}$} & {\color{green} $\mathbf{0.61 \pm 0.04}$} & {\color{green} $\mathbf{0.62 \pm 0.03}$} & {\color{green} $\mathbf{0.66 \pm 0.01}$} & {\color{green} $\mathbf{0.66 \pm 0.03}$} & $0.54 \pm 0.04$ & $0.55 \pm 0.02$ & $0.56 \pm 0.02$ & $0.58 \pm 0.03$ & $0.60 \pm 0.02$ \\ 1737951 & {\color{green} $\mathbf{0.64 \pm 0.10}$} & {\color{green} $\mathbf{0.67 \pm 0.06}$} & {\color{green} $\mathbf{0.79 \pm 0.05}$} & {\color{green} $\mathbf{0.85 \pm 0.08}$} & nan & $0.55 \pm 0.06$ & $0.60 \pm 0.08$ & $0.63 \pm 0.05$ & $0.72 \pm 0.07$ & nan \\ 1738079 & $0.50 \pm 0.02$ & $0.50 \pm 0.04$ & $0.49 \pm 0.03$ & $0.48 \pm 0.03$ & nan & {\color{green} $\mathbf{0.52 \pm 0.04}$} & {\color{green} $\mathbf{0.52 \pm 0.04}$} & {\color{green} $\mathbf{0.53 \pm 0.03}$} & {\color{green} $\mathbf{0.56 \pm 0.05}$} & nan \\ 1738362 & $0.50 \pm 0.10$ & $0.46 \pm 0.08$ & $0.59 \pm 0.09$ & $0.75 \pm 0.20$ & nan & {\color{green} $\mathbf{0.52 \pm 0.07}$} & {\color{green} $\mathbf{0.56 \pm 0.11}$} & {\color{green} $\mathbf{0.62 \pm 0.05}$} & {\color{green} $\mathbf{0.84 \pm 0.14}$} & nan \\ 1738395 & {\color{green} $\mathbf{0.51 \pm 0.04}$} & {\color{green} $\mathbf{0.49 \pm 0.05}$} & {\color{green} $\mathbf{0.50 \pm 0.04}$} & {\color{green} $\mathbf{0.54 \pm 0.04}$} & nan & $0.49 \pm 0.04$ & $0.48 \pm 0.03$ & $0.50 \pm 0.05$ & $0.51 \pm 0.05$ & nan \\ 1738485 & {\color{green} $\mathbf{0.56 \pm 0.02}$} & $0.55 \pm 0.03$ & {\color{green} $\mathbf{0.58 \pm 0.06}$} & $0.59 \pm 0.04$ & $0.65 \pm 0.06$ & $0.54 \pm 0.04$ & {\color{green} $\mathbf{0.56 \pm 0.03}$} & $0.58 \pm 0.04$ & {\color{green} $\mathbf{0.60 \pm 0.06}$} & {\color{green} $\mathbf{0.68 \pm 0.06}$} \\ 1738502 & {\color{green} $\mathbf{0.47 \pm 0.06}$} & {\color{green} $\mathbf{0.50 \pm 0.06}$} & {\color{green} $\mathbf{0.53 \pm 0.05}$} & {\color{green} $\mathbf{0.53 \pm 0.03}$} & {\color{green} $\mathbf{0.58 \pm 0.03}$} & $0.37 \pm 0.03$ & $0.39 \pm 0.02$ & $0.42 \pm 0.03$ & $0.45 \pm 0.02$ & $0.49 \pm 0.04$ \\ 1738573 & $0.51 \pm 0.02$ & $0.52 \pm 0.03$ & {\color{green} $\mathbf{0.54 \pm 0.03}$} & {\color{green} $\mathbf{0.55 \pm 0.02}$} & {\color{green} $\mathbf{0.57 \pm 0.01}$} & {\color{green} $\mathbf{0.52 \pm 0.02}$} & {\color{green} $\mathbf{0.53 \pm 0.01}$} & $0.53 \pm 0.01$ & $0.54 \pm 0.01$ & $0.56 \pm 0.02$ \\ 1738579 & {\color{green} $\mathbf{0.58 \pm 0.05}$} & {\color{green} $\mathbf{0.59 \pm 0.05}$} & {\color{green} $\mathbf{0.59 \pm 0.04}$} & {\color{green} $\mathbf{0.67 \pm 0.04}$} & nan & $0.52 \pm 0.03$ & $0.54 \pm 0.04$ & $0.56 \pm 0.03$ & $0.62 \pm 0.04$ & nan \\ 1738633 & {\color{green} $\mathbf{0.59 \pm 0.06}$} & {\color{green} $\mathbf{0.68 \pm 0.04}$} & {\color{green} $\mathbf{0.71 \pm 0.06}$} & $0.70 \pm 0.08$ & nan & $0.57 \pm 0.05$ & $0.60 \pm 0.08$ & $0.60 \pm 0.05$ & {\color{green} $\mathbf{0.71 \pm 0.10}$} & nan \\ 1794324 & $0.52 \pm 0.04$ & {\color{green} $\mathbf{0.54 \pm 0.03}$} & $0.55 \pm 0.03$ & $0.57 \pm 0.01$ & {\color{green} $\mathbf{0.60 \pm 0.01}$} & {\color{green} $\mathbf{0.53 \pm 0.03}$} & $0.54 \pm 0.03$ & {\color{green} $\mathbf{0.56 \pm 0.03}$} & {\color{green} $\mathbf{0.58 \pm 0.02}$} & $0.60 \pm 0.02$ \\ 1794504 & {\color{green} $\mathbf{0.72 \pm 0.06}$} & {\color{green} $\mathbf{0.75 \pm 0.05}$} & {\color{green} $\mathbf{0.81 \pm 0.04}$} & $0.85 \pm 0.24$ & nan & $0.67 \pm 0.04$ & $0.67 \pm 0.06$ & $0.73 \pm 0.05$ & {\color{green} $\mathbf{0.90 \pm 0.21}$} & nan \\ 1794519 & $0.69 \pm 0.08$ & {\color{green} $\mathbf{0.73 \pm 0.05}$} & $0.79 \pm 0.02$ & {\color{green} $\mathbf{0.81 \pm 0.05}$} & nan & {\color{green} $\mathbf{0.70 \pm 0.06}$} & $0.72 \pm 0.05$ & {\color{green} $\mathbf{0.80 \pm 0.03}$} & $0.77 \pm 0.07$ & nan \\ 1794557 & {\color{green} $\mathbf{0.52 \pm 0.04}$} & {\color{green} $\mathbf{0.53 \pm 0.03}$} & {\color{green} $\mathbf{0.56 \pm 0.04}$} & {\color{green} $\mathbf{0.58 \pm 0.04}$} & {\color{green} $\mathbf{0.60 \pm 0.02}$} & $0.51 \pm 0.03$ & $0.53 \pm 0.02$ & $0.53 \pm 0.03$ & $0.53 \pm 0.01$ & $0.54 \pm 0.03$ \\ 1963701 & {\color{green} $\mathbf{0.54 \pm 0.03}$} & $0.54 \pm 0.02$ & {\color{green} $\mathbf{0.58 \pm 0.04}$} & {\color{green} $\mathbf{0.61 \pm 0.04}$} & {\color{green} $\mathbf{0.65 \pm 0.03}$} & $0.53 \pm 0.03$ & {\color{green} $\mathbf{0.54 \pm 0.04}$} & $0.56 \pm 0.03$ & $0.58 \pm 0.03$ & $0.63 \pm 0.03$ \\ 1963705 & {\color{green} $\mathbf{0.67 \pm 0.09}$} & {\color{green} $\mathbf{0.75 \pm 0.05}$} & {\color{green} $\mathbf{0.78 \pm 0.03}$} & {\color{green} $\mathbf{0.82 \pm 0.03}$} & {\color{green} $\mathbf{0.84 \pm 0.02}$} & $0.65 \pm 0.07$ & $0.70 \pm 0.06$ & $0.73 \pm 0.04$ & $0.78 \pm 0.03$ & $0.82 \pm 0.02$ \\ 1963715 & {\color{green} $\mathbf{0.61 \pm 0.05}$} & {\color{green} $\mathbf{0.59 \pm 0.08}$} & {\color{green} $\mathbf{0.68 \pm 0.04}$} & {\color{green} $\mathbf{0.72 \pm 0.04}$} & {\color{green} $\mathbf{0.75 \pm 0.02}$} & $0.50 \pm 0.06$ & $0.50 \pm 0.06$ & $0.56 \pm 0.04$ & $0.60 \pm 0.03$ & $0.65 \pm 0.03$ \\ 1963721 & {\color{green} $\mathbf{0.45 \pm 0.08}$} & {\color{green} $\mathbf{0.48 \pm 0.08}$} & {\color{green} $\mathbf{0.55 \pm 0.06}$} & {\color{green} $\mathbf{0.57 \pm 0.07}$} & {\color{green} $\mathbf{0.71 \pm 0.09}$} & $0.38 \pm 0.05$ & $0.42 \pm 0.04$ & $0.44 \pm 0.03$ & $0.50 \pm 0.05$ & $0.61 \pm 0.08$ \\ 1963723 & {\color{green} $\mathbf{0.70 \pm 0.10}$} & {\color{green} $\mathbf{0.75 \pm 0.09}$} & {\color{green} $\mathbf{0.80 \pm 0.03}$} & {\color{green} $\mathbf{0.84 \pm 0.02}$} & {\color{green} $\mathbf{0.86 \pm 0.02}$} & $0.61 \pm 0.05$ & $0.69 \pm 0.05$ & $0.74 \pm 0.04$ & $0.78 \pm 0.03$ & $0.81 \pm 0.02$ \\ 1963731 & {\color{green} $\mathbf{0.74 \pm 0.06}$} & {\color{green} $\mathbf{0.79 \pm 0.03}$} & {\color{green} $\mathbf{0.82 \pm 0.02}$} & {\color{green} $\mathbf{0.87 \pm 0.02}$} & {\color{green} $\mathbf{0.89 \pm 0.02}$} & $0.63 \pm 0.08$ & $0.70 \pm 0.04$ & $0.75 \pm 0.02$ & $0.79 \pm 0.03$ & $0.82 \pm 0.02$ \\ 1963741 & {\color{green} $\mathbf{0.60 \pm 0.05}$} & {\color{green} $\mathbf{0.65 \pm 0.05}$} & {\color{green} $\mathbf{0.70 \pm 0.04}$} & {\color{green} $\mathbf{0.75 \pm 0.03}$} & {\color{green} $\mathbf{0.78 \pm 0.02}$} & $0.51 \pm 0.08$ & $0.57 \pm 0.06$ & $0.59 \pm 0.05$ & $0.64 \pm 0.04$ & $0.71 \pm 0.03$ \\ 1963756 & {\color{green} $\mathbf{0.63 \pm 0.09}$} & {\color{green} $\mathbf{0.75 \pm 0.04}$} & {\color{green} $\mathbf{0.77 \pm 0.03}$} & {\color{green} $\mathbf{0.80 \pm 0.02}$} & {\color{green} $\mathbf{0.83 \pm 0.02}$} & $0.57 \pm 0.07$ & $0.67 \pm 0.05$ & $0.69 \pm 0.06$ & $0.75 \pm 0.02$ & $0.79 \pm 0.02$ \\ 1963773 & {\color{green} $\mathbf{0.59 \pm 0.06}$} & {\color{green} $\mathbf{0.61 \pm 0.07}$} & {\color{green} $\mathbf{0.65 \pm 0.04}$} & {\color{green} $\mathbf{0.69 \pm 0.03}$} & {\color{green} $\mathbf{0.72 \pm 0.02}$} & $0.54 \pm 0.06$ & $0.57 \pm 0.06$ & $0.61 \pm 0.05$ & $0.65 \pm 0.03$ & $0.70 \pm 0.03$ \\ 1963799 & {\color{green} $\mathbf{0.58 \pm 0.07}$} & {\color{green} $\mathbf{0.64 \pm 0.04}$} & {\color{green} $\mathbf{0.68 \pm 0.04}$} & {\color{green} $\mathbf{0.71 \pm 0.03}$} & {\color{green} $\mathbf{0.74 \pm 0.04}$} & $0.48 \pm 0.06$ & $0.55 \pm 0.05$ & $0.58 \pm 0.07$ & $0.63 \pm 0.05$ & $0.68 \pm 0.07$ \\ 1963810 & {\color{green} $\mathbf{0.78 \pm 0.06}$} & {\color{green} $\mathbf{0.81 \pm 0.05}$} & {\color{green} $\mathbf{0.85 \pm 0.02}$} & {\color{green} $\mathbf{0.86 \pm 0.02}$} & {\color{green} $\mathbf{0.88 \pm 0.01}$} & $0.67 \pm 0.06$ & $0.73 \pm 0.05$ & $0.76 \pm 0.06$ & $0.80 \pm 0.04$ & $0.84 \pm 0.02$ \\ 1963818 & {\color{green} $\mathbf{0.71 \pm 0.05}$} & {\color{green} $\mathbf{0.74 \pm 0.04}$} & {\color{green} $\mathbf{0.78 \pm 0.03}$} & {\color{green} $\mathbf{0.80 \pm 0.03}$} & {\color{green} $\mathbf{0.82 \pm 0.02}$} & $0.66 \pm 0.07$ & $0.68 \pm 0.06$ & $0.72 \pm 0.03$ & $0.76 \pm 0.03$ & $0.79 \pm 0.02$ \\ 1963819 & {\color{green} $\mathbf{0.61 \pm 0.07}$} & {\color{green} $\mathbf{0.67 \pm 0.06}$} & {\color{green} $\mathbf{0.73 \pm 0.06}$} & {\color{green} $\mathbf{0.77 \pm 0.05}$} & {\color{green} $\mathbf{0.82 \pm 0.01}$} & $0.48 \pm 0.05$ & $0.56 \pm 0.07$ & $0.60 \pm 0.08$ & $0.68 \pm 0.06$ & $0.77 \pm 0.02$ \\ 1963824 & {\color{green} $\mathbf{0.59 \pm 0.05}$} & {\color{green} $\mathbf{0.66 \pm 0.05}$} & {\color{green} $\mathbf{0.70 \pm 0.03}$} & {\color{green} $\mathbf{0.74 \pm 0.03}$} & {\color{green} $\mathbf{0.77 \pm 0.05}$} & $0.54 \pm 0.04$ & $0.59 \pm 0.05$ & $0.64 \pm 0.04$ & $0.64 \pm 0.04$ & $0.69 \pm 0.03$ \\ 1963825 & {\color{green} $\mathbf{0.62 \pm 0.06}$} & {\color{green} $\mathbf{0.69 \pm 0.04}$} & {\color{green} $\mathbf{0.70 \pm 0.05}$} & {\color{green} $\mathbf{0.75 \pm 0.05}$} & {\color{green} $\mathbf{0.81 \pm 0.04}$} & $0.57 \pm 0.04$ & $0.61 \pm 0.04$ & $0.64 \pm 0.04$ & $0.65 \pm 0.04$ & $0.69 \pm 0.03$ \\ 1963827 & {\color{green} $\mathbf{0.74 \pm 0.09}$} & {\color{green} $\mathbf{0.78 \pm 0.06}$} & {\color{green} $\mathbf{0.84 \pm 0.03}$} & {\color{green} $\mathbf{0.86 \pm 0.01}$} & {\color{green} $\mathbf{0.88 \pm 0.02}$} & $0.71 \pm 0.06$ & $0.72 \pm 0.08$ & $0.79 \pm 0.05$ & $0.82 \pm 0.02$ & $0.84 \pm 0.02$ \\ 1963831 & {\color{green} $\mathbf{0.61 \pm 0.10}$} & {\color{green} $\mathbf{0.69 \pm 0.07}$} & {\color{green} $\mathbf{0.76 \pm 0.02}$} & {\color{green} $\mathbf{0.78 \pm 0.04}$} & {\color{green} $\mathbf{0.81 \pm 0.05}$} & $0.55 \pm 0.11$ & $0.61 \pm 0.07$ & $0.69 \pm 0.06$ & $0.74 \pm 0.05$ & $0.77 \pm 0.04$ \\ 1963838 & {\color{green} $\mathbf{0.56 \pm 0.04}$} & {\color{green} $\mathbf{0.57 \pm 0.05}$} & {\color{green} $\mathbf{0.59 \pm 0.06}$} & {\color{green} $\mathbf{0.67 \pm 0.05}$} & nan & $0.54 \pm 0.05$ & $0.55 \pm 0.04$ & $0.58 \pm 0.04$ & $0.62 \pm 0.06$ & nan \\ \bottomrule \end{tabular} } \vspace{-0.2cm} \label{table:50_mt_fsmol} \end{table*} \begin{table*}[t!] \centering \caption{Prototypical Results measuring $\Delta$AUPRC on the first 50 tasks in the test set of FS-Mol.} \resizebox{1.0\linewidth}{!}{% \begin{tabular}{lllllllllll} \toprule {TASK-ID} & {16 (EMB-PROTO)} & {32 (EMB-PROTO)} & {64 (EMB-PROTO)} & {128 (EMB-PROTO)} & {256 (EMB-PROTO)} & {16 (PROTO)} & {32 (PROTO)} & {64 (PROTO)} & {128 (PROTO)} & {256 (PROTO)} \\ \midrule 1006005 & {\color{green} $\mathbf{0.61 \pm 0.05}$} & {\color{green} $\mathbf{0.63 \pm 0.04}$} & {\color{green} $\mathbf{0.66 \pm 0.04}$} & {\color{green} $\mathbf{0.69 \pm 0.06}$} & nan & $0.56 \pm 0.06$ & $0.61 \pm 0.05$ & $0.65 \pm 0.03$ & $0.66 \pm 0.07$ & nan \\ 1066254 & {\color{green} $\mathbf{0.72 \pm 0.07}$} & $0.77 \pm 0.06$ & {\color{green} $\mathbf{0.84 \pm 0.04}$} & {\color{green} $\mathbf{0.87 \pm 0.10}$} & nan & $0.71 \pm 0.08$ & {\color{green} $\mathbf{0.78 \pm 0.06}$} & $0.82 \pm 0.06$ & $0.85 \pm 0.08$ & nan \\ 1119333 & {\color{green} $\mathbf{0.73 \pm 0.05}$} & {\color{green} $\mathbf{0.74 \pm 0.06}$} & {\color{green} $\mathbf{0.78 \pm 0.03}$} & {\color{green} $\mathbf{0.82 \pm 0.02}$} & {\color{green} $\mathbf{0.84 \pm 0.04}$} & $0.71 \pm 0.06$ & $0.72 \pm 0.04$ & {\color{green} $\mathbf{0.78 \pm 0.03}$} & $0.81 \pm 0.02$ & $0.83 \pm 0.04$ \\ 1243967 & {\color{green} $\mathbf{0.78 \pm 0.03}$} & {\color{green} $\mathbf{0.81 \pm 0.04}$} & {\color{green} $\mathbf{0.83 \pm 0.03}$} & {\color{green} $\mathbf{0.84 \pm 0.03}$} & nan & $0.73 \pm 0.05$ & $0.76 \pm 0.04$ & $0.80 \pm 0.03$ & $0.81 \pm 0.03$ & nan \\ 1243970 & {\color{green} $\mathbf{0.75 \pm 0.05}$} & {\color{green} $\mathbf{0.79 \pm 0.04}$} & {\color{green} $\mathbf{0.81 \pm 0.03}$} & {\color{green} $\mathbf{0.85 \pm 0.03}$} & nan & $0.71 \pm 0.07$ & $0.74 \pm 0.04$ & $0.81 \pm 0.03$ & $0.82 \pm 0.05$ & nan \\ 1613777 & $0.52 \pm 0.02$ & {\color{green} $\mathbf{0.54 \pm 0.03}$} & $0.56 \pm 0.03$ & $0.59 \pm 0.02$ & $0.61 \pm 0.02$ & {\color{green} $\mathbf{0.52 \pm 0.04}$} & $0.54 \pm 0.04$ & {\color{green} $\mathbf{0.57 \pm 0.03}$} & {\color{green} $\mathbf{0.60 \pm 0.04}$} & {\color{green} $\mathbf{0.62 \pm 0.03}$} \\ 1613800 & {\color{green} $\mathbf{0.42 \pm 0.02}$} & {\color{green} $\mathbf{0.44 \pm 0.02}$} & {\color{green} $\mathbf{0.46 \pm 0.02}$} & {\color{green} $\mathbf{0.48 \pm 0.02}$} & {\color{green} $\mathbf{0.50 \pm 0.01}$} & $0.41 \pm 0.03$ & $0.43 \pm 0.03$ & $0.45 \pm 0.02$ & $0.46 \pm 0.02$ & $0.48 \pm 0.02$ \\ 1613898 & $0.52 \pm 0.02$ & $0.55 \pm 0.04$ & $0.54 \pm 0.04$ & {\color{green} $\mathbf{0.61 \pm 0.07}$} & nan & {\color{green} $\mathbf{0.55 \pm 0.04}$} & {\color{green} $\mathbf{0.55 \pm 0.05}$} & {\color{green} $\mathbf{0.55 \pm 0.03}$} & $0.57 \pm 0.08$ & nan \\ 1613907 & {\color{green} $\mathbf{0.56 \pm 0.04}$} & $0.58 \pm 0.04$ & $0.63 \pm 0.04$ & $0.64 \pm 0.14$ & nan & $0.55 \pm 0.06$ & {\color{green} $\mathbf{0.62 \pm 0.06}$} & {\color{green} $\mathbf{0.66 \pm 0.07}$} & {\color{green} $\mathbf{0.68 \pm 0.10}$} & nan \\ 1613926 & {\color{green} $\mathbf{0.70 \pm 0.04}$} & {\color{green} $\mathbf{0.74 \pm 0.06}$} & {\color{green} $\mathbf{0.77 \pm 0.04}$} & {\color{green} $\mathbf{0.88 \pm 0.12}$} & nan & $0.65 \pm 0.08$ & $0.70 \pm 0.06$ & $0.76 \pm 0.04$ & $0.86 \pm 0.15$ & nan \\ 1613949 & {\color{green} $\mathbf{0.57 \pm 0.08}$} & {\color{green} $\mathbf{0.63 \pm 0.05}$} & {\color{green} $\mathbf{0.67 \pm 0.06}$} & {\color{green} $\mathbf{0.67 \pm 0.10}$} & nan & $0.53 \pm 0.05$ & $0.57 \pm 0.04$ & $0.58 \pm 0.05$ & $0.63 \pm 0.10$ & nan \\ 1614027 & $0.53 \pm 0.02$ & {\color{green} $\mathbf{0.57 \pm 0.02}$} & $0.60 \pm 0.03$ & $0.64 \pm 0.02$ & {\color{green} $\mathbf{0.67 \pm 0.02}$} & {\color{green} $\mathbf{0.55 \pm 0.02}$} & $0.57 \pm 0.04$ & {\color{green} $\mathbf{0.61 \pm 0.04}$} & {\color{green} $\mathbf{0.64 \pm 0.02}$} & $0.67 \pm 0.02$ \\ 1614153 & {\color{green} $\mathbf{0.35 \pm 0.02}$} & $0.37 \pm 0.01$ & $0.36 \pm 0.02$ & $0.39 \pm 0.01$ & {\color{green} $\mathbf{0.41 \pm 0.01}$} & $0.34 \pm 0.03$ & {\color{green} $\mathbf{0.37 \pm 0.02}$} & {\color{green} $\mathbf{0.37 \pm 0.02}$} & {\color{green} $\mathbf{0.39 \pm 0.01}$} & {\color{green} $\mathbf{0.41 \pm 0.01}$} \\ 1614292 & {\color{green} $\mathbf{0.36 \pm 0.02}$} & $0.38 \pm 0.03$ & $0.39 \pm 0.02$ & $0.40 \pm 0.02$ & $0.41 \pm 0.02$ & {\color{green} $\mathbf{0.36 \pm 0.02}$} & {\color{green} $\mathbf{0.39 \pm 0.02}$} & {\color{green} $\mathbf{0.41 \pm 0.02}$} & {\color{green} $\mathbf{0.42 \pm 0.03}$} & {\color{green} $\mathbf{0.44 \pm 0.02}$} \\ 1614423 & {\color{green} $\mathbf{0.68 \pm 0.06}$} & {\color{green} $\mathbf{0.72 \pm 0.04}$} & {\color{green} $\mathbf{0.76 \pm 0.02}$} & {\color{green} $\mathbf{0.78 \pm 0.02}$} & {\color{green} $\mathbf{0.79 \pm 0.04}$} & $0.54 \pm 0.07$ & $0.58 \pm 0.05$ & $0.67 \pm 0.04$ & $0.73 \pm 0.02$ & $0.77 \pm 0.02$ \\ 1614433 & {\color{green} $\mathbf{0.49 \pm 0.04}$} & {\color{green} $\mathbf{0.50 \pm 0.04}$} & {\color{green} $\mathbf{0.51 \pm 0.03}$} & {\color{green} $\mathbf{0.53 \pm 0.02}$} & $0.54 \pm 0.02$ & $0.46 \pm 0.04$ & $0.48 \pm 0.02$ & $0.48 \pm 0.03$ & $0.52 \pm 0.03$ & {\color{green} $\mathbf{0.54 \pm 0.04}$} \\ 1614466 & $0.47 \pm 0.03$ & $0.48 \pm 0.04$ & $0.49 \pm 0.01$ & $0.51 \pm 0.03$ & $0.53 \pm 0.03$ & {\color{green} $\mathbf{0.48 \pm 0.05}$} & {\color{green} $\mathbf{0.53 \pm 0.05}$} & {\color{green} $\mathbf{0.53 \pm 0.04}$} & {\color{green} $\mathbf{0.57 \pm 0.02}$} & {\color{green} $\mathbf{0.58 \pm 0.01}$} \\ 1614503 & {\color{green} $\mathbf{0.49 \pm 0.03}$} & $0.51 \pm 0.07$ & $0.56 \pm 0.06$ & $0.70 \pm 0.22$ & nan & $0.49 \pm 0.07$ & {\color{green} $\mathbf{0.55 \pm 0.05}$} & {\color{green} $\mathbf{0.59 \pm 0.02}$} & {\color{green} $\mathbf{0.76 \pm 0.22}$} & nan \\ 1614508 & $0.84 \pm 0.02$ & $0.85 \pm 0.03$ & $0.86 \pm 0.03$ & {\color{green} $\mathbf{0.89 \pm 0.04}$} & nan & {\color{green} $\mathbf{0.86 \pm 0.02}$} & {\color{green} $\mathbf{0.86 \pm 0.02}$} & {\color{green} $\mathbf{0.87 \pm 0.02}$} & $0.88 \pm 0.04$ & nan \\ 1614522 & {\color{green} $\mathbf{0.58 \pm 0.04}$} & {\color{green} $\mathbf{0.61 \pm 0.03}$} & $0.60 \pm 0.03$ & {\color{green} $\mathbf{0.64 \pm 0.02}$} & $0.67 \pm 0.03$ & {\color{green} $\mathbf{0.58 \pm 0.03}$} & $0.60 \pm 0.03$ & {\color{green} $\mathbf{0.61 \pm 0.03}$} & {\color{green} $\mathbf{0.64 \pm 0.02}$} & {\color{green} $\mathbf{0.67 \pm 0.02}$} \\ 1737951 & {\color{green} $\mathbf{0.65 \pm 0.08}$} & {\color{green} $\mathbf{0.71 \pm 0.06}$} & {\color{green} $\mathbf{0.76 \pm 0.04}$} & {\color{green} $\mathbf{0.80 \pm 0.06}$} & nan & $0.63 \pm 0.06$ & $0.67 \pm 0.05$ & $0.71 \pm 0.04$ & $0.75 \pm 0.07$ & nan \\ 1738079 & $0.49 \pm 0.03$ & $0.49 \pm 0.03$ & $0.50 \pm 0.04$ & $0.49 \pm 0.04$ & nan & {\color{green} $\mathbf{0.49 \pm 0.02}$} & {\color{green} $\mathbf{0.49 \pm 0.03}$} & {\color{green} $\mathbf{0.50 \pm 0.03}$} & {\color{green} $\mathbf{0.54 \pm 0.06}$} & nan \\ 1738362 & $0.46 \pm 0.06$ & $0.55 \pm 0.08$ & $0.59 \pm 0.06$ & $0.64 \pm 0.22$ & nan & {\color{green} $\mathbf{0.49 \pm 0.10}$} & {\color{green} $\mathbf{0.56 \pm 0.09}$} & {\color{green} $\mathbf{0.65 \pm 0.05}$} & {\color{green} $\mathbf{0.82 \pm 0.17}$} & nan \\ 1738395 & $0.53 \pm 0.05$ & $0.51 \pm 0.04$ & $0.52 \pm 0.03$ & $0.57 \pm 0.04$ & nan & {\color{green} $\mathbf{0.53 \pm 0.04}$} & {\color{green} $\mathbf{0.53 \pm 0.04}$} & {\color{green} $\mathbf{0.54 \pm 0.05}$} & {\color{green} $\mathbf{0.58 \pm 0.06}$} & nan \\ 1738485 & $0.54 \pm 0.04$ & $0.57 \pm 0.04$ & $0.58 \pm 0.05$ & {\color{green} $\mathbf{0.63 \pm 0.04}$} & {\color{green} $\mathbf{0.69 \pm 0.05}$} & {\color{green} $\mathbf{0.58 \pm 0.03}$} & {\color{green} $\mathbf{0.59 \pm 0.03}$} & {\color{green} $\mathbf{0.61 \pm 0.04}$} & $0.62 \pm 0.03$ & $0.64 \pm 0.07$ \\ 1738502 & $0.41 \pm 0.07$ & $0.44 \pm 0.05$ & $0.47 \pm 0.04$ & $0.49 \pm 0.03$ & {\color{green} $\mathbf{0.53 \pm 0.03}$} & {\color{green} $\mathbf{0.42 \pm 0.07}$} & {\color{green} $\mathbf{0.45 \pm 0.05}$} & {\color{green} $\mathbf{0.48 \pm 0.03}$} & {\color{green} $\mathbf{0.49 \pm 0.02}$} & $0.52 \pm 0.02$ \\ 1738573 & $0.52 \pm 0.03$ & {\color{green} $\mathbf{0.53 \pm 0.03}$} & {\color{green} $\mathbf{0.54 \pm 0.02}$} & {\color{green} $\mathbf{0.56 \pm 0.02}$} & {\color{green} $\mathbf{0.57 \pm 0.02}$} & {\color{green} $\mathbf{0.53 \pm 0.02}$} & $0.52 \pm 0.02$ & $0.53 \pm 0.02$ & $0.55 \pm 0.01$ & $0.55 \pm 0.01$ \\ 1738579 & $0.52 \pm 0.04$ & $0.55 \pm 0.05$ & $0.58 \pm 0.02$ & {\color{green} $\mathbf{0.65 \pm 0.06}$} & nan & {\color{green} $\mathbf{0.55 \pm 0.06}$} & {\color{green} $\mathbf{0.59 \pm 0.03}$} & {\color{green} $\mathbf{0.59 \pm 0.03}$} & $0.64 \pm 0.04$ & nan \\ 1738633 & $0.56 \pm 0.04$ & $0.58 \pm 0.04$ & {\color{green} $\mathbf{0.59 \pm 0.05}$} & {\color{green} $\mathbf{0.63 \pm 0.08}$} & nan & {\color{green} $\mathbf{0.56 \pm 0.05}$} & {\color{green} $\mathbf{0.59 \pm 0.05}$} & $0.59 \pm 0.04$ & $0.62 \pm 0.13$ & nan \\ 1794324 & $0.50 \pm 0.03$ & $0.51 \pm 0.03$ & $0.53 \pm 0.03$ & $0.57 \pm 0.02$ & $0.60 \pm 0.02$ & {\color{green} $\mathbf{0.53 \pm 0.03}$} & {\color{green} $\mathbf{0.54 \pm 0.02}$} & {\color{green} $\mathbf{0.56 \pm 0.03}$} & {\color{green} $\mathbf{0.59 \pm 0.02}$} & {\color{green} $\mathbf{0.62 \pm 0.02}$} \\ 1794504 & {\color{green} $\mathbf{0.70 \pm 0.06}$} & {\color{green} $\mathbf{0.72 \pm 0.05}$} & {\color{green} $\mathbf{0.80 \pm 0.06}$} & {\color{green} $\mathbf{0.95 \pm 0.16}$} & nan & $0.59 \pm 0.05$ & $0.64 \pm 0.05$ & $0.72 \pm 0.09$ & {\color{green} $\mathbf{0.95 \pm 0.16}$} & nan \\ 1794519 & $0.65 \pm 0.08$ & $0.72 \pm 0.06$ & $0.78 \pm 0.04$ & {\color{green} $\mathbf{0.82 \pm 0.05}$} & nan & {\color{green} $\mathbf{0.73 \pm 0.06}$} & {\color{green} $\mathbf{0.78 \pm 0.03}$} & {\color{green} $\mathbf{0.81 \pm 0.02}$} & $0.79 \pm 0.04$ & nan \\ 1794557 & {\color{green} $\mathbf{0.54 \pm 0.02}$} & {\color{green} $\mathbf{0.54 \pm 0.02}$} & {\color{green} $\mathbf{0.55 \pm 0.02}$} & {\color{green} $\mathbf{0.57 \pm 0.03}$} & {\color{green} $\mathbf{0.60 \pm 0.02}$} & $0.52 \pm 0.02$ & $0.53 \pm 0.02$ & $0.53 \pm 0.03$ & $0.54 \pm 0.03$ & $0.56 \pm 0.02$ \\ 1963701 & {\color{green} $\mathbf{0.58 \pm 0.05}$} & {\color{green} $\mathbf{0.59 \pm 0.06}$} & {\color{green} $\mathbf{0.62 \pm 0.03}$} & {\color{green} $\mathbf{0.67 \pm 0.02}$} & {\color{green} $\mathbf{0.69 \pm 0.02}$} & $0.56 \pm 0.04$ & $0.58 \pm 0.05$ & $0.60 \pm 0.04$ & $0.62 \pm 0.03$ & $0.66 \pm 0.02$ \\ 1963705 & {\color{green} $\mathbf{0.74 \pm 0.06}$} & {\color{green} $\mathbf{0.77 \pm 0.04}$} & {\color{green} $\mathbf{0.81 \pm 0.02}$} & {\color{green} $\mathbf{0.83 \pm 0.01}$} & {\color{green} $\mathbf{0.84 \pm 0.01}$} & $0.71 \pm 0.05$ & $0.74 \pm 0.03$ & $0.78 \pm 0.03$ & $0.80 \pm 0.02$ & $0.81 \pm 0.02$ \\ 1963715 & {\color{green} $\mathbf{0.63 \pm 0.10}$} & {\color{green} $\mathbf{0.68 \pm 0.05}$} & {\color{green} $\mathbf{0.72 \pm 0.03}$} & {\color{green} $\mathbf{0.76 \pm 0.02}$} & {\color{green} $\mathbf{0.78 \pm 0.02}$} & $0.57 \pm 0.07$ & $0.61 \pm 0.03$ & $0.65 \pm 0.03$ & $0.69 \pm 0.02$ & $0.72 \pm 0.02$ \\ 1963721 & {\color{green} $\mathbf{0.47 \pm 0.07}$} & {\color{green} $\mathbf{0.52 \pm 0.04}$} & {\color{green} $\mathbf{0.54 \pm 0.04}$} & {\color{green} $\mathbf{0.58 \pm 0.04}$} & {\color{green} $\mathbf{0.63 \pm 0.08}$} & $0.45 \pm 0.06$ & $0.47 \pm 0.04$ & $0.51 \pm 0.04$ & $0.53 \pm 0.03$ & $0.61 \pm 0.10$ \\ 1963723 & {\color{green} $\mathbf{0.77 \pm 0.05}$} & {\color{green} $\mathbf{0.80 \pm 0.04}$} & {\color{green} $\mathbf{0.84 \pm 0.01}$} & {\color{green} $\mathbf{0.86 \pm 0.01}$} & {\color{green} $\mathbf{0.87 \pm 0.01}$} & $0.72 \pm 0.08$ & $0.79 \pm 0.03$ & $0.81 \pm 0.01$ & $0.83 \pm 0.01$ & $0.85 \pm 0.01$ \\ 1963731 & $0.79 \pm 0.06$ & {\color{green} $\mathbf{0.84 \pm 0.02}$} & {\color{green} $\mathbf{0.87 \pm 0.02}$} & {\color{green} $\mathbf{0.89 \pm 0.01}$} & {\color{green} $\mathbf{0.90 \pm 0.01}$} & {\color{green} $\mathbf{0.80 \pm 0.05}$} & $0.83 \pm 0.02$ & $0.86 \pm 0.01$ & $0.87 \pm 0.01$ & $0.88 \pm 0.01$ \\ 1963741 & {\color{green} $\mathbf{0.64 \pm 0.06}$} & {\color{green} $\mathbf{0.70 \pm 0.04}$} & {\color{green} $\mathbf{0.74 \pm 0.02}$} & {\color{green} $\mathbf{0.76 \pm 0.02}$} & {\color{green} $\mathbf{0.78 \pm 0.02}$} & $0.59 \pm 0.03$ & $0.63 \pm 0.04$ & $0.68 \pm 0.04$ & $0.71 \pm 0.02$ & $0.73 \pm 0.02$ \\ 1963756 & {\color{green} $\mathbf{0.74 \pm 0.06}$} & {\color{green} $\mathbf{0.77 \pm 0.03}$} & {\color{green} $\mathbf{0.79 \pm 0.02}$} & {\color{green} $\mathbf{0.82 \pm 0.01}$} & {\color{green} $\mathbf{0.84 \pm 0.01}$} & $0.63 \pm 0.06$ & $0.68 \pm 0.04$ & $0.73 \pm 0.02$ & $0.76 \pm 0.02$ & $0.77 \pm 0.03$ \\ 1963773 & {\color{green} $\mathbf{0.62 \pm 0.09}$} & $0.64 \pm 0.06$ & {\color{green} $\mathbf{0.69 \pm 0.04}$} & $0.72 \pm 0.03$ & {\color{green} $\mathbf{0.75 \pm 0.01}$} & $0.61 \pm 0.07$ & {\color{green} $\mathbf{0.65 \pm 0.06}$} & $0.69 \pm 0.04$ & {\color{green} $\mathbf{0.73 \pm 0.02}$} & $0.74 \pm 0.03$ \\ 1963799 & {\color{green} $\mathbf{0.65 \pm 0.07}$} & {\color{green} $\mathbf{0.67 \pm 0.05}$} & {\color{green} $\mathbf{0.69 \pm 0.02}$} & {\color{green} $\mathbf{0.74 \pm 0.02}$} & {\color{green} $\mathbf{0.76 \pm 0.03}$} & $0.56 \pm 0.07$ & $0.63 \pm 0.04$ & $0.67 \pm 0.03$ & $0.69 \pm 0.02$ & $0.72 \pm 0.05$ \\ 1963810 & {\color{green} $\mathbf{0.80 \pm 0.04}$} & {\color{green} $\mathbf{0.83 \pm 0.03}$} & {\color{green} $\mathbf{0.86 \pm 0.01}$} & {\color{green} $\mathbf{0.86 \pm 0.01}$} & {\color{green} $\mathbf{0.88 \pm 0.01}$} & $0.76 \pm 0.06$ & $0.79 \pm 0.04$ & $0.82 \pm 0.02$ & $0.85 \pm 0.01$ & $0.87 \pm 0.01$ \\ 1963818 & {\color{green} $\mathbf{0.71 \pm 0.06}$} & {\color{green} $\mathbf{0.75 \pm 0.05}$} & $0.78 \pm 0.03$ & {\color{green} $\mathbf{0.82 \pm 0.02}$} & {\color{green} $\mathbf{0.84 \pm 0.02}$} & {\color{green} $\mathbf{0.71 \pm 0.03}$} & $0.73 \pm 0.04$ & {\color{green} $\mathbf{0.78 \pm 0.02}$} & $0.81 \pm 0.01$ & $0.82 \pm 0.01$ \\ 1963819 & {\color{green} $\mathbf{0.65 \pm 0.08}$} & $0.68 \pm 0.06$ & {\color{green} $\mathbf{0.74 \pm 0.03}$} & $0.78 \pm 0.03$ & $0.81 \pm 0.02$ & $0.62 \pm 0.12$ & {\color{green} $\mathbf{0.70 \pm 0.05}$} & $0.73 \pm 0.05$ & {\color{green} $\mathbf{0.79 \pm 0.02}$} & {\color{green} $\mathbf{0.81 \pm 0.02}$} \\ 1963824 & {\color{green} $\mathbf{0.60 \pm 0.06}$} & {\color{green} $\mathbf{0.63 \pm 0.04}$} & {\color{green} $\mathbf{0.67 \pm 0.05}$} & {\color{green} $\mathbf{0.72 \pm 0.04}$} & {\color{green} $\mathbf{0.75 \pm 0.03}$} & $0.52 \pm 0.04$ & $0.54 \pm 0.03$ & $0.57 \pm 0.03$ & $0.61 \pm 0.03$ & $0.62 \pm 0.06$ \\ 1963825 & {\color{green} $\mathbf{0.66 \pm 0.06}$} & {\color{green} $\mathbf{0.70 \pm 0.05}$} & {\color{green} $\mathbf{0.72 \pm 0.03}$} & {\color{green} $\mathbf{0.74 \pm 0.02}$} & {\color{green} $\mathbf{0.78 \pm 0.04}$} & $0.62 \pm 0.07$ & $0.68 \pm 0.03$ & $0.71 \pm 0.04$ & $0.73 \pm 0.02$ & $0.77 \pm 0.03$ \\ 1963827 & {\color{green} $\mathbf{0.78 \pm 0.06}$} & {\color{green} $\mathbf{0.81 \pm 0.03}$} & {\color{green} $\mathbf{0.86 \pm 0.02}$} & {\color{green} $\mathbf{0.88 \pm 0.00}$} & {\color{green} $\mathbf{0.88 \pm 0.01}$} & $0.77 \pm 0.04$ & $0.80 \pm 0.04$ & $0.84 \pm 0.02$ & $0.86 \pm 0.01$ & $0.87 \pm 0.01$ \\ 1963831 & {\color{green} $\mathbf{0.62 \pm 0.10}$} & $0.69 \pm 0.07$ & $0.74 \pm 0.03$ & $0.77 \pm 0.03$ & $0.78 \pm 0.05$ & $0.61 \pm 0.08$ & {\color{green} $\mathbf{0.69 \pm 0.05}$} & {\color{green} $\mathbf{0.76 \pm 0.03}$} & {\color{green} $\mathbf{0.78 \pm 0.02}$} & {\color{green} $\mathbf{0.79 \pm 0.06}$} \\ 1963838 & $0.52 \pm 0.03$ & $0.55 \pm 0.02$ & $0.58 \pm 0.03$ & $0.60 \pm 0.03$ & nan & {\color{green} $\mathbf{0.55 \pm 0.03}$} & {\color{green} $\mathbf{0.57 \pm 0.05}$} & {\color{green} $\mathbf{0.61 \pm 0.04}$} & {\color{green} $\mathbf{0.64 \pm 0.03}$} & nan \\ \bottomrule \end{tabular} } \vspace{-0.2cm} \label{table:50_proto_fsmol} \end{table*} \begin{table*}[t!] \centering \caption{MAML results measuring $\Delta$AUPRC on the first 50 tasks in the test set of FS-Mol.} \resizebox{1.0\linewidth}{!}{% \begin{tabular}{lllllllllll} \toprule {TASK-ID} & {16 (EMB-MAML)} & {32 (EMB-MAML)} & {64 (EMB-MAML)} & {128 (EMB-MAML)} & {256 (EMB-MAML)} & {16 (MAML)} & {32 (MAML)} & {64 (MAML)} & {128 (MAML)} & {256 (MAML)} \\ \midrule 1006005 & $0.47 \pm 0.03$ & $0.49 \pm 0.05$ & $0.49 \pm 0.04$ & $0.54 \pm 0.06$ & nan & {\color{green} $\mathbf{0.49 \pm 0.02}$} & {\color{green} $\mathbf{0.51 \pm 0.04}$} & {\color{green} $\mathbf{0.52 \pm 0.03}$} & {\color{green} $\mathbf{0.56 \pm 0.05}$} & nan \\ 1066254 & {\color{green} $\mathbf{0.58 \pm 0.07}$} & {\color{green} $\mathbf{0.61 \pm 0.05}$} & {\color{green} $\mathbf{0.65 \pm 0.07}$} & {\color{green} $\mathbf{0.65 \pm 0.13}$} & nan & $0.56 \pm 0.07$ & $0.58 \pm 0.04$ & $0.59 \pm 0.07$ & $0.63 \pm 0.15$ & nan \\ 1119333 & {\color{green} $\mathbf{0.73 \pm 0.03}$} & {\color{green} $\mathbf{0.74 \pm 0.03}$} & {\color{green} $\mathbf{0.77 \pm 0.04}$} & {\color{green} $\mathbf{0.76 \pm 0.05}$} & {\color{green} $\mathbf{0.77 \pm 0.06}$} & $0.70 \pm 0.03$ & $0.72 \pm 0.04$ & $0.74 \pm 0.05$ & $0.72 \pm 0.02$ & $0.74 \pm 0.05$ \\ 1243967 & $0.72 \pm 0.03$ & {\color{green} $\mathbf{0.76 \pm 0.03}$} & {\color{green} $\mathbf{0.75 \pm 0.04}$} & {\color{green} $\mathbf{0.77 \pm 0.04}$} & nan & {\color{green} $\mathbf{0.72 \pm 0.05}$} & $0.75 \pm 0.01$ & $0.74 \pm 0.04$ & $0.76 \pm 0.04$ & nan \\ 1243970 & $0.70 \pm 0.04$ & $0.71 \pm 0.01$ & $0.70 \pm 0.02$ & {\color{green} $\mathbf{0.71 \pm 0.03}$} & nan & {\color{green} $\mathbf{0.71 \pm 0.03}$} & {\color{green} $\mathbf{0.72 \pm 0.03}$} & {\color{green} $\mathbf{0.72 \pm 0.03}$} & $0.68 \pm 0.03$ & nan \\ 1613777 & {\color{green} $\mathbf{0.53 \pm 0.01}$} & {\color{green} $\mathbf{0.53 \pm 0.01}$} & {\color{green} $\mathbf{0.53 \pm 0.01}$} & {\color{green} $\mathbf{0.54 \pm 0.02}$} & {\color{green} $\mathbf{0.54 \pm 0.02}$} & $0.50 \pm 0.01$ & $0.51 \pm 0.01$ & $0.51 \pm 0.01$ & $0.53 \pm 0.02$ & $0.53 \pm 0.02$ \\ 1613800 & {\color{green} $\mathbf{0.40 \pm 0.00}$} & {\color{green} $\mathbf{0.40 \pm 0.01}$} & {\color{green} $\mathbf{0.41 \pm 0.01}$} & {\color{green} $\mathbf{0.42 \pm 0.01}$} & {\color{green} $\mathbf{0.42 \pm 0.01}$} & {\color{green} $\mathbf{0.40 \pm 0.01}$} & $0.40 \pm 0.01$ & $0.40 \pm 0.01$ & $0.41 \pm 0.01$ & $0.41 \pm 0.01$ \\ 1613898 & $0.56 \pm 0.02$ & $0.55 \pm 0.04$ & {\color{green} $\mathbf{0.58 \pm 0.04}$} & {\color{green} $\mathbf{0.57 \pm 0.08}$} & nan & {\color{green} $\mathbf{0.57 \pm 0.02}$} & {\color{green} $\mathbf{0.56 \pm 0.03}$} & $0.56 \pm 0.03$ & $0.56 \pm 0.04$ & nan \\ 1613907 & {\color{green} $\mathbf{0.54 \pm 0.03}$} & {\color{green} $\mathbf{0.55 \pm 0.04}$} & {\color{green} $\mathbf{0.54 \pm 0.06}$} & {\color{green} $\mathbf{0.55 \pm 0.07}$} & nan & $0.53 \pm 0.03$ & $0.51 \pm 0.02$ & $0.53 \pm 0.05$ & $0.55 \pm 0.13$ & nan \\ 1613926 & {\color{green} $\mathbf{0.67 \pm 0.04}$} & {\color{green} $\mathbf{0.65 \pm 0.06}$} & {\color{green} $\mathbf{0.71 \pm 0.06}$} & {\color{green} $\mathbf{0.78 \pm 0.20}$} & nan & $0.57 \pm 0.09$ & $0.59 \pm 0.10$ & $0.65 \pm 0.12$ & $0.77 \pm 0.12$ & nan \\ 1613949 & $0.46 \pm 0.04$ & $0.47 \pm 0.04$ & $0.47 \pm 0.05$ & {\color{green} $\mathbf{0.45 \pm 0.10}$} & nan & {\color{green} $\mathbf{0.48 \pm 0.03}$} & {\color{green} $\mathbf{0.48 \pm 0.04}$} & {\color{green} $\mathbf{0.48 \pm 0.06}$} & $0.43 \pm 0.09$ & nan \\ 1614027 & $0.51 \pm 0.02$ & $0.52 \pm 0.02$ & {\color{green} $\mathbf{0.54 \pm 0.02}$} & {\color{green} $\mathbf{0.57 \pm 0.03}$} & {\color{green} $\mathbf{0.60 \pm 0.02}$} & {\color{green} $\mathbf{0.52 \pm 0.01}$} & {\color{green} $\mathbf{0.52 \pm 0.01}$} & $0.53 \pm 0.03$ & $0.54 \pm 0.03$ & $0.58 \pm 0.04$ \\ 1614153 & $0.33 \pm 0.01$ & $0.34 \pm 0.01$ & $0.33 \pm 0.01$ & $0.34 \pm 0.01$ & $0.34 \pm 0.01$ & {\color{green} $\mathbf{0.33 \pm 0.01}$} & {\color{green} $\mathbf{0.34 \pm 0.01}$} & {\color{green} $\mathbf{0.34 \pm 0.01}$} & {\color{green} $\mathbf{0.35 \pm 0.01}$} & {\color{green} $\mathbf{0.36 \pm 0.01}$} \\ 1614292 & {\color{green} $\mathbf{0.35 \pm 0.02}$} & {\color{green} $\mathbf{0.36 \pm 0.02}$} & {\color{green} $\mathbf{0.37 \pm 0.02}$} & {\color{green} $\mathbf{0.37 \pm 0.02}$} & {\color{green} $\mathbf{0.39 \pm 0.01}$} & $0.35 \pm 0.01$ & $0.35 \pm 0.01$ & $0.35 \pm 0.01$ & $0.35 \pm 0.01$ & $0.35 \pm 0.01$ \\ 1614423 & $0.44 \pm 0.07$ & {\color{green} $\mathbf{0.52 \pm 0.10}$} & {\color{green} $\mathbf{0.64 \pm 0.03}$} & {\color{green} $\mathbf{0.69 \pm 0.05}$} & {\color{green} $\mathbf{0.71 \pm 0.04}$} & {\color{green} $\mathbf{0.45 \pm 0.05}$} & $0.47 \pm 0.07$ & $0.51 \pm 0.07$ & $0.60 \pm 0.07$ & $0.68 \pm 0.02$ \\ 1614433 & {\color{green} $\mathbf{0.46 \pm 0.02}$} & $0.46 \pm 0.02$ & {\color{green} $\mathbf{0.47 \pm 0.02}$} & {\color{green} $\mathbf{0.49 \pm 0.03}$} & {\color{green} $\mathbf{0.52 \pm 0.04}$} & $0.44 \pm 0.01$ & {\color{green} $\mathbf{0.46 \pm 0.03}$} & $0.47 \pm 0.03$ & $0.48 \pm 0.04$ & $0.49 \pm 0.04$ \\ 1614466 & $0.46 \pm 0.01$ & $0.46 \pm 0.02$ & $0.47 \pm 0.02$ & $0.47 \pm 0.02$ & $0.51 \pm 0.03$ & {\color{green} $\mathbf{0.47 \pm 0.01}$} & {\color{green} $\mathbf{0.48 \pm 0.02}$} & {\color{green} $\mathbf{0.49 \pm 0.02}$} & {\color{green} $\mathbf{0.49 \pm 0.02}$} & {\color{green} $\mathbf{0.51 \pm 0.03}$} \\ 1614503 & $0.35 \pm 0.04$ & {\color{green} $\mathbf{0.36 \pm 0.06}$} & $0.37 \pm 0.04$ & $0.56 \pm 0.24$ & nan & {\color{green} $\mathbf{0.37 \pm 0.02}$} & $0.36 \pm 0.03$ & {\color{green} $\mathbf{0.38 \pm 0.04}$} & {\color{green} $\mathbf{0.57 \pm 0.20}$} & nan \\ 1614508 & {\color{green} $\mathbf{0.70 \pm 0.12}$} & $0.77 \pm 0.13$ & {\color{green} $\mathbf{0.80 \pm 0.05}$} & $0.82 \pm 0.09$ & nan & $0.66 \pm 0.08$ & {\color{green} $\mathbf{0.79 \pm 0.07}$} & $0.77 \pm 0.09$ & {\color{green} $\mathbf{0.83 \pm 0.09}$} & nan \\ 1614522 & {\color{green} $\mathbf{0.52 \pm 0.05}$} & {\color{green} $\mathbf{0.53 \pm 0.03}$} & {\color{green} $\mathbf{0.54 \pm 0.06}$} & {\color{green} $\mathbf{0.61 \pm 0.02}$} & {\color{green} $\mathbf{0.62 \pm 0.02}$} & $0.50 \pm 0.03$ & $0.52 \pm 0.02$ & $0.52 \pm 0.04$ & $0.56 \pm 0.03$ & $0.58 \pm 0.03$ \\ 1737951 & $0.49 \pm 0.09$ & $0.46 \pm 0.07$ & {\color{green} $\mathbf{0.61 \pm 0.03}$} & {\color{green} $\mathbf{0.67 \pm 0.06}$} & nan & {\color{green} $\mathbf{0.57 \pm 0.04}$} & {\color{green} $\mathbf{0.57 \pm 0.03}$} & $0.58 \pm 0.04$ & $0.58 \pm 0.07$ & nan \\ 1738079 & $0.48 \pm 0.01$ & $0.47 \pm 0.01$ & $0.47 \pm 0.02$ & $0.49 \pm 0.04$ & nan & {\color{green} $\mathbf{0.52 \pm 0.01}$} & {\color{green} $\mathbf{0.51 \pm 0.01}$} & {\color{green} $\mathbf{0.51 \pm 0.03}$} & {\color{green} $\mathbf{0.52 \pm 0.03}$} & nan \\ 1738362 & $0.31 \pm 0.03$ & $0.34 \pm 0.05$ & $0.34 \pm 0.07$ & {\color{green} $\mathbf{0.64 \pm 0.23}$} & nan & {\color{green} $\mathbf{0.37 \pm 0.01}$} & {\color{green} $\mathbf{0.38 \pm 0.03}$} & {\color{green} $\mathbf{0.40 \pm 0.04}$} & $0.46 \pm 0.19$ & nan \\ 1738395 & $0.49 \pm 0.03$ & {\color{green} $\mathbf{0.50 \pm 0.03}$} & {\color{green} $\mathbf{0.49 \pm 0.03}$} & $0.50 \pm 0.05$ & nan & {\color{green} $\mathbf{0.50 \pm 0.03}$} & $0.48 \pm 0.03$ & $0.48 \pm 0.03$ & {\color{green} $\mathbf{0.50 \pm 0.05}$} & nan \\ 1738485 & {\color{green} $\mathbf{0.49 \pm 0.01}$} & {\color{green} $\mathbf{0.51 \pm 0.02}$} & {\color{green} $\mathbf{0.52 \pm 0.04}$} & {\color{green} $\mathbf{0.54 \pm 0.04}$} & {\color{green} $\mathbf{0.55 \pm 0.06}$} & $0.49 \pm 0.01$ & $0.49 \pm 0.01$ & $0.48 \pm 0.01$ & $0.50 \pm 0.06$ & $0.54 \pm 0.06$ \\ 1738502 & $0.39 \pm 0.01$ & $0.40 \pm 0.02$ & $0.40 \pm 0.02$ & {\color{green} $\mathbf{0.43 \pm 0.04}$} & {\color{green} $\mathbf{0.43 \pm 0.04}$} & {\color{green} $\mathbf{0.41 \pm 0.01}$} & {\color{green} $\mathbf{0.42 \pm 0.02}$} & {\color{green} $\mathbf{0.41 \pm 0.02}$} & $0.41 \pm 0.02$ & $0.41 \pm 0.02$ \\ 1738573 & $0.51 \pm 0.02$ & $0.50 \pm 0.01$ & $0.51 \pm 0.02$ & {\color{green} $\mathbf{0.52 \pm 0.02}$} & {\color{green} $\mathbf{0.53 \pm 0.02}$} & {\color{green} $\mathbf{0.52 \pm 0.01}$} & {\color{green} $\mathbf{0.51 \pm 0.01}$} & {\color{green} $\mathbf{0.52 \pm 0.01}$} & $0.52 \pm 0.01$ & $0.52 \pm 0.01$ \\ 1738579 & {\color{green} $\mathbf{0.54 \pm 0.03}$} & {\color{green} $\mathbf{0.56 \pm 0.02}$} & {\color{green} $\mathbf{0.56 \pm 0.03}$} & {\color{green} $\mathbf{0.60 \pm 0.05}$} & nan & $0.53 \pm 0.03$ & $0.55 \pm 0.03$ & $0.55 \pm 0.04$ & $0.58 \pm 0.04$ & nan \\ 1738633 & $0.55 \pm 0.04$ & $0.56 \pm 0.04$ & $0.60 \pm 0.04$ & $0.57 \pm 0.09$ & nan & {\color{green} $\mathbf{0.59 \pm 0.02}$} & {\color{green} $\mathbf{0.60 \pm 0.02}$} & {\color{green} $\mathbf{0.60 \pm 0.04}$} & {\color{green} $\mathbf{0.63 \pm 0.12}$} & nan \\ 1794324 & {\color{green} $\mathbf{0.52 \pm 0.02}$} & {\color{green} $\mathbf{0.52 \pm 0.01}$} & {\color{green} $\mathbf{0.52 \pm 0.01}$} & {\color{green} $\mathbf{0.53 \pm 0.02}$} & {\color{green} $\mathbf{0.54 \pm 0.02}$} & $0.51 \pm 0.00$ & $0.51 \pm 0.01$ & $0.52 \pm 0.01$ & $0.52 \pm 0.01$ & $0.53 \pm 0.01$ \\ 1794504 & {\color{green} $\mathbf{0.68 \pm 0.01}$} & {\color{green} $\mathbf{0.70 \pm 0.04}$} & {\color{green} $\mathbf{0.71 \pm 0.04}$} & {\color{green} $\mathbf{0.85 \pm 0.24}$} & nan & $0.65 \pm 0.05$ & $0.66 \pm 0.05$ & $0.71 \pm 0.04$ & {\color{green} $\mathbf{0.85 \pm 0.24}$} & nan \\ 1794519 & $0.64 \pm 0.05$ & {\color{green} $\mathbf{0.66 \pm 0.07}$} & {\color{green} $\mathbf{0.69 \pm 0.08}$} & {\color{green} $\mathbf{0.73 \pm 0.13}$} & nan & {\color{green} $\mathbf{0.64 \pm 0.07}$} & $0.62 \pm 0.05$ & $0.65 \pm 0.07$ & $0.71 \pm 0.11$ & nan \\ 1794557 & $0.53 \pm 0.02$ & $0.54 \pm 0.01$ & $0.54 \pm 0.02$ & $0.53 \pm 0.02$ & $0.53 \pm 0.01$ & {\color{green} $\mathbf{0.55 \pm 0.01}$} & {\color{green} $\mathbf{0.55 \pm 0.01}$} & {\color{green} $\mathbf{0.55 \pm 0.01}$} & {\color{green} $\mathbf{0.55 \pm 0.01}$} & {\color{green} $\mathbf{0.55 \pm 0.01}$} \\ 1963701 & {\color{green} $\mathbf{0.60 \pm 0.01}$} & {\color{green} $\mathbf{0.59 \pm 0.02}$} & {\color{green} $\mathbf{0.59 \pm 0.02}$} & {\color{green} $\mathbf{0.60 \pm 0.01}$} & {\color{green} $\mathbf{0.60 \pm 0.02}$} & $0.60 \pm 0.01$ & $0.59 \pm 0.01$ & {\color{green} $\mathbf{0.59 \pm 0.01}$} & $0.59 \pm 0.01$ & $0.59 \pm 0.02$ \\ 1963705 & $0.71 \pm 0.03$ & $0.70 \pm 0.02$ & $0.72 \pm 0.01$ & $0.72 \pm 0.01$ & $0.71 \pm 0.02$ & {\color{green} $\mathbf{0.77 \pm 0.01}$} & {\color{green} $\mathbf{0.77 \pm 0.02}$} & {\color{green} $\mathbf{0.77 \pm 0.01}$} & {\color{green} $\mathbf{0.77 \pm 0.03}$} & {\color{green} $\mathbf{0.76 \pm 0.04}$} \\ 1963715 & {\color{green} $\mathbf{0.63 \pm 0.00}$} & {\color{green} $\mathbf{0.62 \pm 0.03}$} & $0.63 \pm 0.01$ & $0.64 \pm 0.01$ & $0.64 \pm 0.02$ & $0.63 \pm 0.01$ & $0.61 \pm 0.04$ & {\color{green} $\mathbf{0.64 \pm 0.01}$} & {\color{green} $\mathbf{0.64 \pm 0.01}$} & {\color{green} $\mathbf{0.64 \pm 0.02}$} \\ 1963721 & $0.50 \pm 0.02$ & $0.50 \pm 0.02$ & $0.50 \pm 0.02$ & {\color{green} $\mathbf{0.51 \pm 0.04}$} & {\color{green} $\mathbf{0.55 \pm 0.07}$} & {\color{green} $\mathbf{0.52 \pm 0.02}$} & {\color{green} $\mathbf{0.51 \pm 0.01}$} & {\color{green} $\mathbf{0.52 \pm 0.01}$} & $0.51 \pm 0.03$ & $0.54 \pm 0.09$ \\ 1963723 & $0.72 \pm 0.03$ & $0.73 \pm 0.01$ & $0.73 \pm 0.01$ & $0.74 \pm 0.02$ & $0.75 \pm 0.02$ & {\color{green} $\mathbf{0.72 \pm 0.03}$} & {\color{green} $\mathbf{0.74 \pm 0.02}$} & {\color{green} $\mathbf{0.74 \pm 0.01}$} & {\color{green} $\mathbf{0.75 \pm 0.02}$} & {\color{green} $\mathbf{0.77 \pm 0.02}$} \\ 1963731 & $0.70 \pm 0.02$ & $0.70 \pm 0.01$ & $0.70 \pm 0.02$ & $0.76 \pm 0.06$ & $0.76 \pm 0.05$ & {\color{green} $\mathbf{0.71 \pm 0.03}$} & {\color{green} $\mathbf{0.74 \pm 0.02}$} & {\color{green} $\mathbf{0.74 \pm 0.02}$} & {\color{green} $\mathbf{0.76 \pm 0.02}$} & {\color{green} $\mathbf{0.79 \pm 0.03}$} \\ 1963741 & {\color{green} $\mathbf{0.65 \pm 0.02}$} & {\color{green} $\mathbf{0.66 \pm 0.00}$} & {\color{green} $\mathbf{0.66 \pm 0.01}$} & {\color{green} $\mathbf{0.67 \pm 0.01}$} & {\color{green} $\mathbf{0.67 \pm 0.01}$} & $0.65 \pm 0.01$ & $0.65 \pm 0.01$ & $0.66 \pm 0.01$ & $0.65 \pm 0.01$ & $0.65 \pm 0.01$ \\ 1963756 & {\color{green} $\mathbf{0.76 \pm 0.05}$} & {\color{green} $\mathbf{0.75 \pm 0.04}$} & {\color{green} $\mathbf{0.76 \pm 0.04}$} & {\color{green} $\mathbf{0.77 \pm 0.02}$} & {\color{green} $\mathbf{0.77 \pm 0.01}$} & $0.71 \pm 0.02$ & $0.72 \pm 0.03$ & $0.70 \pm 0.04$ & $0.72 \pm 0.02$ & $0.72 \pm 0.03$ \\ 1963773 & $0.60 \pm 0.01$ & $0.59 \pm 0.04$ & $0.60 \pm 0.03$ & $0.60 \pm 0.02$ & $0.60 \pm 0.02$ & {\color{green} $\mathbf{0.62 \pm 0.02}$} & {\color{green} $\mathbf{0.63 \pm 0.02}$} & {\color{green} $\mathbf{0.63 \pm 0.02}$} & {\color{green} $\mathbf{0.64 \pm 0.03}$} & {\color{green} $\mathbf{0.63 \pm 0.02}$} \\ 1963799 & $0.63 \pm 0.01$ & $0.62 \pm 0.01$ & $0.61 \pm 0.03$ & $0.61 \pm 0.02$ & $0.60 \pm 0.05$ & {\color{green} $\mathbf{0.64 \pm 0.02}$} & {\color{green} $\mathbf{0.66 \pm 0.01}$} & {\color{green} $\mathbf{0.66 \pm 0.02}$} & {\color{green} $\mathbf{0.67 \pm 0.03}$} & {\color{green} $\mathbf{0.67 \pm 0.07}$} \\ 1963810 & {\color{green} $\mathbf{0.78 \pm 0.01}$} & {\color{green} $\mathbf{0.77 \pm 0.02}$} & {\color{green} $\mathbf{0.78 \pm 0.01}$} & {\color{green} $\mathbf{0.78 \pm 0.01}$} & {\color{green} $\mathbf{0.78 \pm 0.01}$} & $0.77 \pm 0.01$ & $0.75 \pm 0.03$ & $0.76 \pm 0.02$ & $0.76 \pm 0.02$ & $0.78 \pm 0.02$ \\ 1963818 & {\color{green} $\mathbf{0.71 \pm 0.02}$} & {\color{green} $\mathbf{0.72 \pm 0.01}$} & $0.72 \pm 0.03$ & {\color{green} $\mathbf{0.73 \pm 0.02}$} & {\color{green} $\mathbf{0.73 \pm 0.03}$} & $0.70 \pm 0.04$ & $0.72 \pm 0.01$ & {\color{green} $\mathbf{0.72 \pm 0.03}$} & $0.72 \pm 0.03$ & $0.73 \pm 0.03$ \\ 1963819 & $0.59 \pm 0.04$ & $0.61 \pm 0.03$ & $0.59 \pm 0.01$ & $0.61 \pm 0.03$ & $0.61 \pm 0.03$ & {\color{green} $\mathbf{0.60 \pm 0.02}$} & {\color{green} $\mathbf{0.61 \pm 0.03}$} & {\color{green} $\mathbf{0.62 \pm 0.03}$} & {\color{green} $\mathbf{0.63 \pm 0.04}$} & {\color{green} $\mathbf{0.63 \pm 0.03}$} \\ 1963824 & {\color{green} $\mathbf{0.62 \pm 0.04}$} & $0.63 \pm 0.02$ & {\color{green} $\mathbf{0.65 \pm 0.04}$} & {\color{green} $\mathbf{0.65 \pm 0.04}$} & {\color{green} $\mathbf{0.69 \pm 0.05}$} & $0.62 \pm 0.03$ & {\color{green} $\mathbf{0.64 \pm 0.04}$} & $0.64 \pm 0.04$ & $0.63 \pm 0.03$ & $0.63 \pm 0.04$ \\ 1963825 & $0.73 \pm 0.01$ & $0.72 \pm 0.02$ & $0.73 \pm 0.01$ & $0.74 \pm 0.02$ & $0.75 \pm 0.04$ & {\color{green} $\mathbf{0.77 \pm 0.02}$} & {\color{green} $\mathbf{0.77 \pm 0.02}$} & {\color{green} $\mathbf{0.79 \pm 0.02}$} & {\color{green} $\mathbf{0.79 \pm 0.03}$} & {\color{green} $\mathbf{0.80 \pm 0.04}$} \\ 1963827 & $0.78 \pm 0.03$ & {\color{green} $\mathbf{0.80 \pm 0.01}$} & {\color{green} $\mathbf{0.80 \pm 0.03}$} & {\color{green} $\mathbf{0.79 \pm 0.02}$} & {\color{green} $\mathbf{0.80 \pm 0.02}$} & {\color{green} $\mathbf{0.78 \pm 0.01}$} & $0.76 \pm 0.04$ & $0.76 \pm 0.03$ & $0.77 \pm 0.01$ & $0.76 \pm 0.02$ \\ 1963831 & {\color{green} $\mathbf{0.69 \pm 0.01}$} & {\color{green} $\mathbf{0.69 \pm 0.02}$} & $0.69 \pm 0.01$ & $0.69 \pm 0.02$ & $0.68 \pm 0.06$ & $0.68 \pm 0.02$ & $0.68 \pm 0.02$ & {\color{green} $\mathbf{0.70 \pm 0.02}$} & {\color{green} $\mathbf{0.71 \pm 0.03}$} & {\color{green} $\mathbf{0.72 \pm 0.05}$} \\ 1963838 & $0.49 \pm 0.01$ & $0.49 \pm 0.01$ & $0.51 \pm 0.04$ & {\color{green} $\mathbf{0.55 \pm 0.03}$} & nan & {\color{green} $\mathbf{0.54 \pm 0.02}$} & {\color{green} $\mathbf{0.53 \pm 0.01}$} & {\color{green} $\mathbf{0.55 \pm 0.02}$} & $0.52 \pm 0.04$ & nan \\ \bottomrule \end{tabular} } \vspace{-0.2cm} \label{table:50_maml_fsmol} \end{table*} \subsection{Embedding Space Analysis} While our MPNN model may fit the simulation data, it is unclear if relevant physics-based knowledge is actually encoded into the learned embeddings. Answering this question is the focus of our embedding space analysis. \textbf{Defining Molecular Similarity.} We present \num{3} ways to measure molecular similarity: physics-based, embedding-based, and fingerprint-based. Physics-based docking software implicitly encodes a notion of similarity among small molecules. For instance, one may define ``similar'' small molecules as those that manifest similar binding affinities across many different protein targets; such molecules typically adopt similar 3D conformations and form similar chemical interactions with targets. We quantify the implicitly defined similarity between a pair of molecules $m_1$, $m_2$ in simulation as the relative difference in docking scores across all targets: \begin{equation}\label{eqn:1} d(m_1, m_2) = \sum\limits_{t \in \text{targets}} \frac{|t(m_1) - t(m_2)|}{\max_{m}\{t(m)\} - \min_{m}\{t(m)\}}\, . \end{equation} We compute the relative difference in docking score as opposed to the absolute difference as different targets have different ranges of binding affinities, and we wish to avoid lending more weight to targets with larger ranges than to targets with smaller ranges. Next we define the distance between molecules in the embedding space. Our MPNN embedding model uses a combined graph readout composed of an element-wise max, learned weighted sums, and learned weighted means. Applying any of these pooling operations to the graph embeddings will output a component of the vector used to predict the docking scores associated with this target. Accordingly, we choose the simplest operation --- element-wise max pooling --- to motivate the distance between two arbitrary molecules in our embedding space. Let $m_1, m_2$ be two molecules parameterized by a per-node, learned feature matrix and an adjacency matrix in the embedding space: $m_1^{(e)} = (\mathcal{V}^{(e)}_1, \mathcal{E}^{(e)}_1)$. We define $\rho$ to be the max-pooling operation across the embedding dimension for all nodes in the graph. For node embeddings $\mathcal{V}^{(e)} = \begin{bmatrix} v_{1,1} & ... & v_{1,d} \\ ... & & \\ v_{n,1} & ... & v_{n,d}\end{bmatrix} \in \mathbb{R}^{n\times d}$ , \begin{equation*} \rho(\mathcal{V}^{(e)}) \in \mathbb{R}^{d} ,\,\, \text{where\,\,\,} [\rho(\mathcal{V}^{(e)})]_j = \max_i v_{ij}\,. \end{equation*} We can now define the distance between two molecules in the embedding space as the $l_2$ norm of their element-wise maximum difference: \begin{equation}\label{eqn:2} d_{\rho}(m_1, m_2) = \lVert\rho(\mathcal{V}_1) - \rho(\mathcal{V}_2)\rVert_2 \end{equation} One may also apply \autoref{eqn:2} to the initial feature space used as input to the model: $m^{(f)}_1 = (\mathcal{V}^{(f)}_1, \mathcal{E}^{(f)}_1)$. A model's feature space is simply the initial numerical representation of a molecule. Machine learning models often define an atom-level feature space as a numerical vector encoding an atom's element type atomic charge, atomic mass, valency and/or other atomic-level quantities. \begin{table}[htb!] \vspace{-0.2cm} \centering \small \caption{Kendall Tau Analysis. Scores are averaged across 100 randomly selected small molecules. The number of swaps indicates the average number of swaps made by KT to transform an ordering to the physics-based ordering. Normalized KT is the number of swaps divided by the number of molecules in an ordering.} \label{table:swaps} \begin{tabular}{l|c|c|} \toprule & \# Swaps ({\color{green} \contour{green}{$\downarrow$}}) & Normalized KT ({\color{green} \contour{green}{$\downarrow$}}) \\ \midrule Physics & $0$ & $0$ \\ Embedding $d_{\rho}$ & $2.96\times 10^7$ & $0.386$\\ Feature $d_{\rho}$ & $3.73\times 10^7$ & $0.488$\\ Tanimoto & $3.28\times 10^7$ & $0.429$\\ Random & $3.83 \times 10^7$ & $0.50$ \\ \bottomrule \end{tabular} \vspace{-0.6cm} \end{table} A third metric of the distance between two molecules is the Tanimoto distance $d_{\tau}$ between their extended-connectivity fingerprints (ECFPs). An ECFP is a binary string indicating whether or not each of many 2D chemical substructures is present in a given molecule. This Tanimoto distance---which is one of the most commonly used notions of molecular similarity in both academia and industry ~\cite{ecfp}---is defined as the number of chemical sub-structures shared between a pair of molecules divided by the total number of chemical sub-structures present in either molecule. A high value indicates that a pair of molecules share the same components but does not necessarily indicate that those components are connected to one another in the same way or positioned similarly in 3D. \textbf{Comparing Across Metrics.} While one may define various metrics to determine the distance among molecules within a metric space, comparing distances across metric spaces is more involved. One may abstract the notion of distance between two pairs of molecules to an ordering of all molecules ranked by distance to a single molecule. By ranking the similarity of all molecules to an anchor molecule according to one metric, we may quantify the extent to which other metrics produce a (dis)similar ordering with respect to this same molecule. We employ the Kendall Tau rank distance~\cite{kendall2004course}, also known as the bubble-sort distance, to quantify how similar one ranking of molecular similarity is to the physics-based ordering induced by \autoref{eqn:1} \begin{align*} K_d(\tau_1, \tau_2) = |(i,j) :& \text{ }i < j, \{[\tau_1(i) \wedge \tau_2(i) > \tau_2(j)] \\ &\vee [\tau_1(i) > \tau_1(j) \wedge \tau_2(i) < \tau_2(j)]\}| \end{align*} where $\tau_1(i)$ and $\tau_2(i)$ are the rankings of molecule $i$ given by the rankings $\tau_1$ and $\tau_2$, respectively. Intuitively, this measure counts the number of swaps made during a bubble sort to convert the ordering in the embedding space, feature space, or ECFP space to the ordering in the physics space. As $\{t | \text{ }t \in \tau_1\} = \{t | \text{ }t \in \tau_2\}$, Kendall Tau satisfies the properties of a metric. \paragraph{Findings.} As comparing the product space of (\num{32547} $\times$ \num{32547}) pairs of molecules exceeds our computational resources, we randomly sample \num{100} small molecules from our dataset to compare the orderings induced by $d_{\rho}$ on the embedding space, $d_{\rho}$ on the feature space, and Tanimoto distance on the ECFP space with the ``ground-truth'' orderings induced by \autoref{eqn:1}. Our findings are summarized in \autoref{table:swaps} and indicate ranking molecules by distance in the embedding space is most similar to the rankings induced by distance in the physics space. Rankings ordered by Tanimoto distance require, on average, \num{4.5} million more swaps per molecule than orderings sorted by the distance in the embedding space. Similarly, applying $d_{\rho}$ in the feature space requires, on average, \num{77} million more swaps than orderings derived by applying $d_{\rho}$ in the embedding space. Random represents a randomly ranked list of molecules and requires an expected, on average \num{87} million additional swaps per molecule when compared with the embedding ordering. \subsection{Visualized Example} To supplement our aggregate analysis, we provide an example of two small molecules that have dissimilar 2D chemical structures, but are known to adopt similar 3D conformations when binding to targets. We select CHEMBL200234 and levisoprenaline as the small molecules and the $\beta_1$-adrenergic receptor (B1AR) as the protein target. While these two molecules are chemically very different, as seen in \autoref{fig:2}, examining the experimentally determined structure of each one bound to B1AR reveals they adopt similar 3D conformations and form similar chemical interactions (e.g., hydrogen bonds) with the target. It would be expected that Tanimoto distance determines a low similarity between these two molecules given their disparate chemical structures, but has this type of ``binding similarity'' been encoded into the molecular embeddings learned from simulation data? To rigorously answer this question, we randomly sample \num{100000} small molecules and order all \num{100002} small molecules (the \num{100000} randomly sampled molecules + CHEMBL200234 and levisoprenaline) with respect to distance from CHEMBL200234 as well as levisoprenaline. We then extract and average the index of levisoprenaline in the ranked list of CHEMBL200234 and the index of CHEMBL200234 in the ranked list of levisoprenaline to determine a combined score. Under Tanimoto distance, CHEMBL200234 places levisoprenaline at position \num{50204} while levisoprenaline places CHEMBL200234 at position \num{67119}. In contrast, under the embeddings distance, CHEMBL200234 places levisoprenaline at position \num{31650} while levisoprenaline places CHEMBL200234 at position \num{34551}. This example illustrates that molecules even with dissimilar chemical structures may be placed relatively close to one another in the embedding space, lending support to the hypothesis that the simulation-derived molecular embeddings may encode information about the 3D conformations a molecule may adopt when binding to a target.
\section{Introduction} Complex systems in nature often have an either open or hidden hierarchy between its parts or subparts. Therefore dissections of its structure can help understand its dynamics. This hierarchy may be dictated by size, individual strength, group structure or organization. For instance, in a bee colony, there is queen who is the largest member of the colony by size, males drones, and under-developed female called workers. Another example can be found among different species living in the wild, for instance, there is a hierarchy in strength between lions, hyenas, and say antelopes. In the wild especially, there is a constant displacement of species, either individually or by group, or due to research for food or water, due changes in the environment, or due to mating needs. There is a vast literature on using hierarchical models in biological systems. We will focus in this manuscript on populations dynamics in the ecological world. In particular, we are interested studying the dynamics between species that are subject to immigration and emigration, subject to an Allee effect, with a more structured functional response. For self-containment, we recall that an Allee effects (see \cite{Allee1949}) is a phenomenon in population dynamics where there is a positive correlation between a population density and its relative growth rate. It is sometime divided into weak and strong Allee effect, see for instance \cite{Hutchings2015}. The strong Allee effect occurs when a population has a critical density $A$ below which it declines to extinction and above which it increases towards its carrying capacity $K$. The weak Allee effect occurs when a population lacks such a critical density, but at lower densities, the population growth rate arises with increasing densities. \\ \begin{figure}[H] \centering\includegraphics[scale=0.5]{AlleeEffect111.pdf} \caption{ Represented is the relative capita growth rate as a function of the population density $x$. The red curve represents no Allee effect since there is a negative correlation between the per capita growth rate and the density. The black dashed curve represents the weak Allee effect since at lower densities $x$, the per capita growth rate is increasing but there is no Allee threshold $A$. The blue dashed represents the strong Allee effect since there is positive correlation between the per capita growth rate and the existence of a Threshold under with the population decreases to extinction.} \label{fig:AlleeEffect1} \end{figure} We also recall in that in ecology, a functional response represents the intake rate of a species as a function of food density. \cite{Holling1959} proposed three types of functional responses. Let $x$ and $y$ represents the density of two populations; then a type I functional response is of the form $h_1(x,y)=\mu xy$, where $\mu$ is a constant; a type II functional response is of the form $\displaystyle h_1(x,y)=\frac{\alpha xy}{1+\alpha \beta xy}$, where $\alpha$ represents the attack rate and $\beta$ is the handling time, that is, the time spent by say species $x$ searching and processing food obtained from species $y$. A type III functional response is of the form $\displaystyle h_1(x,y)=\frac{\mu}{1+\alpha e^{-\beta xy}}$, where $\alpha$ and $\beta$ are as above and $\mu$ is a constant representing a saturation level, that is, a rate threshold when species densities are high. \begin{figure}[H] % \centering\includegraphics[scale=0.4]{Holling2D.pdf} \caption{Represented are the three functional response types with chosen parameters. } \label{fig:Holling2D} \end{figure} In ecology, there is already a vast literature on the stability analysis of deterministic models. For hierarchical model with one, two, or more species, the interested reader can see for instance \cite{Kwessi2015_7}, \cite{Kwessi2015_6}, and \cite{Kwessi2018_4}. Considering that species live in habitats that are often subject to demographics fluctuations or perturbations, it is sometime more accurate to consider stochastic models. In this case, persistence and coexistence of species despite environmental fluctuations are of particular interest. Papers such as \cite{Chesson2009}, \cite{Benaim2009}, \cite{Hening2021}, \cite{Hening2022}, the references therein, and their subsequent iterations are great introduction to the understanding of the biological motivations and necessary theoretical underpinnings. The remainder of the paper if organized as follows: In section \ref{sect:DeterMdel}, we discuss the deterministic model by finding its fixed points, then we discuss its stability both local and global , and we propose some numerical results. In section \ref{sect:stochatic}, we discuss the stochastic model. In particular, we show existence of a global solution, we show strong persistence in mean, then we proved the existence of a stationary distribution, and we propose numerical results. These numerical results consist of phase space diagrams, histograms, and level curves of species densities as well a comparative analysis based on the Wasserstein distance. In section \ref{sect:discussion}, we make some concluding remarks. \section{Deterministic Model} \label{sect:DeterMdel} In \cite{Kwessi2015_7}, \cite{Kwessi2015_6}, and \cite{Kwessi2018_4}, hierarchical models for two and three species were discussed. In particular, the following model was discussed \begin{equation}\label{EQ:stocking} \begin{cases} x_{t+1} &= H_1 x_t+x_t e^{\displaystyle r_1 - x_t - \frac{m_1}{1+s_1x_t}} \vspace{0.125cm}\\ y_{t+1} &=H_2 y_t+ y_t e^{\displaystyle r_2 - y_t -bx_t - \frac{m_2}{1+s_2y_t}} \end{cases}\;, \end{equation} In this model, $x_t$ and $y_t$ represent the densities of the two species $x$ and $y$ under consideration with $x$ being the ``stronger" species and $y$ being the weaker one. Moreover, the $H_i$'s are the immigration constants, the $r_i$'s are the species' growth rates, the $m_i$'s are the species' mortality rates, the $s_i$'s are the Allee effect constants, and $b$ is a competition constant. For $i=1,2$, the following assumptions were proposed to guarantee a strong Allee effect on each species: \begin{itemize} \item[(i)] $0<H_i<1, ~~r_is_i>1+s_i\ln(1-H_i)$\;, and $m_i>r_i-\ln(1-H_i)$\;. \item[(ii)] $[r_is_i-1-s_i\ln(1-H_i)]^2>4s_i(m_i-r_i+\ln(1-H_i))$\;. \end{itemize} Each species is subject to a strong Allee effect induced multiplicatively with the terms $\displaystyle e^{\frac{m_1}{1+s_1x_t}}$ and $\displaystyle e^{\frac{m_2}{1+s_2y_t}}$. In this manuscript, we propose to discuss the following model with immigration, and Allee effect on the waker species, and a Hollins type II functional response. The choice of a type II rather than a Type III stems from the fact that type III tends to occurs in experimental data but is rare in nature. \begin{equation} \begin{cases} \displaystyle x_{t+1}=x_te^{\displaystyle r_1-x_t+dh(x,y)+H_1} \\ y_{t+1}=y_te^{\displaystyle r_2-y_t-\frac{m}{a+y_t}-h(x,y)+H_2} \end{cases}\;. \end{equation} with a Holling type II functional response $\displaystyle h(x,y)=\frac{(b+cx_t)y_t}{1+py_t(b+cx_t)}$ and \[ \begin{array}{||l||l||l||} \hline \mbox{Parameters} &\mbox{Denomination} &\mbox{Dimension}\\ \hline r_1,r_2 & \mbox{Populations growth rates} &(\mbox{Time})^{-1}\\ \hline H_1, H_2 & \mbox{Immigration/emigration rates} &(\mbox{Time})^{-1}\\ \hline a & \mbox{Allee Effect constant} & \mbox{Biomass}\\ \hline b &\mbox{Species $x$ attack rate} & (\mbox{Biomass})^{-1}(\mbox{Time})^{-1} \\ \hline c & \mbox{Cooperation intensity between the two species}&(\mbox{Biomass})^{-2}(\mbox{Time})^{-1} \\ \hline d & \mbox{Conversion coefficient} & \mbox{Dimensionless}\\ \hline m & \mbox{Mortality rate of species $y$ due to the Allee Effect}& \mbox{Time}^{-1} \\ \hline p & \mbox{Species $x$ handling time} & \mbox{Time} \\ \hline \end{array} \] \begin{remark} One could also consider a spatial or cluster model for which immigration is dependent on the distance between the center position $\xi$ of the cluster and the center $\eta$ from which the species is immigrating from, using a Laplacian spatial dispersion kernel: \[ K(\xi,\eta,\gamma)=\frac{1}{\gamma}e^{-\frac{\abs{\xi-\eta}}{\gamma}}\;. \] For a given cluster/patch centered a $\eta$, we will assume that the ecosystem has $N$ clusters each centered at $\xi_i$, for $j=1,2,\cdots, N$ and individuals from each species $x$ and $y$ from these clusters move into the cluster centered at $\eta$ according to spatial dispersion kernels $K(\eta, \xi, \gamma)$. We will then have the model. \begin{equation} \begin{cases} \displaystyle x_{t+1}(\eta)=x_t(\eta)\sum_{j=1}^NK(\eta,\xi_j,\gamma_1)e^{\displaystyle r_1-x_t(\xi_j)+dh(x_t(\xi_j),y_t(\xi_j))} \\ \displaystyle y_{t+1}(\eta)=y_t(\eta)\sum_{j=1}^N K_2(\eta,\xi_j,\gamma_2)e^{\displaystyle r_2-y_t(\xi_j)-\frac{m}{a+y_t(\xi_j)}-h(x_t(\xi_j),y_t(\xi_j))} \end{cases}\;. \end{equation} In the presence of multiple preys, say $M$, each with density $y_t^i$, ($i=1, \cdots M$) for the predator with density $x_t$ at time $t$, we could consider the general model \begin{equation} \begin{cases} \displaystyle x_{t+1}(\eta)=x_t(\eta)\sum_{j=1}^NK(\eta,\xi_j,\gamma_1)e^{\displaystyle r_1-x_t(\xi_j)+\sum_{i=1}^Md_ih(x_t(\xi_j),y_t^i(\xi_j))} & \\ \displaystyle y_{t+1}^i(\eta)=y_t^j(\eta)\sum_{j=1}^N K_2(\eta,\xi_j,\gamma_i)e^{\displaystyle r_{i+1}-y_t^i(\xi_j)-\frac{m_i}{a_i+y_t^i(\xi_j)}-h(x_t(\xi_j),y_t^i(\xi_j))} & \end{cases}\;. \end{equation} \end{remark} \subsection{Stability Analysis} \subsection{Fixed Points} Recall that $r_1,r_2,a,b,c,d,p,m$ are all {\bf positive parameters}. \\ We start by finding the fixed points of the model; they are the origin $(0,0)$ and the intersections of the isoclines of equations \begin{eqnarray} \displaystyle r_1+H_1-x+\frac{d(b+cx)y}{1+py(b+cx)}&=& 0\;. \vspace{0.2cm}\\ \displaystyle r_2+H_2-y-\frac{m}{a+y}-\frac{(b+cx)y}{1+py(b+cx)}&=& 0\;. \end{eqnarray} After simplifications, we will have \begin{eqnarray} (C_1): \quad x&=&r_1+H_1+d(r_2+H_2)-dy-\frac{dm}{a+y}\;.\\ (C_2): \quad y &=& \frac{x-(r_1+H_1)}{(b+cx)(-px+d+p(r_1+H_1))}\;. \end{eqnarray} The fixed points will be the intersection between the curve ($C_2$) in the $xy$-plane with the $(C_1)$ in the $yx$-plane. Things to note: \begin{itemize} \item $(C_1)$ has a vertical asymptote $y=-a$ and an asymptote $x=r_1+H_1+d(r_2+H_2)-dy$ is the $yx$-plane. \item $(C_2)$ has two vertical asymptotes $\displaystyle x=-\frac{b}{c}$ and $x=\frac{d+p(r_1+H_1)}{p}$ and a horizontal asymptote $y=0$ in the $xy$plane. \end{itemize} In all, we can expect the following fixed points. \begin{itemize} \item The origin $E_{00}(0,0)$. \item Axial fixed points: \begin{enumerate} \item A predator-free fixed point $E_{10}(0,y)$, \item A prey-free fixed $E_{01}(x,0)$. \end{enumerate} \item At most two interior fixed points $E_{11}(\alpha_{1x},\alpha_{1y})$ and $E_{22}(\alpha_{2x},\alpha_{2y})$. \end{itemize} \begin{figure}[H] \begin{center} \begin{tabular}{cc} ({\bf a})& ({\bf b})\\ \includegraphics[scale=0.3]{NoIntFixedPointsPlot.pdf} & \includegraphics[scale=0.3]{OneAxialXFixedPointsPlot.pdf}\\ \\ ({\bf c}) & ({\bf d})\\ \includegraphics[scale=0.3]{OneIntFixedPointsPlot.pdf} & \includegraphics[scale=0.3]{TwoIntFixedPointsPlot.pdf} \end{tabular} \end{center} \caption{Figure ({\bf a}) represents the case of no interior fixed point, Figure ({\bf b}) represents the case of one axial fixed point, Figure ({\bf b}) represents the case of one interior fixed point, and Figure ({\bf d}) represents the case of two interior fixed points.} \label{fig:AllFixedPoints} \end{figure} \subsubsection{Local Stability} Let \begin{eqnarray*} h(x,y)&=&\frac{(b+cx)y}{1+py(b+cx)}\;,\\ f_1(x,y)&=&e^{\displaystyle r_1+H_1-x+dh(x,y)}\;,\\ f_2(x,y)&=& e^{\displaystyle r_2+H_2-y-\frac{m}{a+y}-h(x,y)}\;,\\ F(x,y)&=&(F_1(x,y), F_2(x,y))=(xf_1(x,y), yf_2(x,y))\;. \end{eqnarray*} The Jacobian matrix of the system above at any given point $M(x,y)$ is given as \[ J(x,y)=\begin{pmatrix} f_1(x,y)\rb{1+x\rb{-1+\frac{dcy}{(1+py(b+cx))^2}}} & xf_1(x,y)\rb{\frac{d(b+cx)}{(1+py(b+cx))^2}}\\ yf_2(x,y)\rb{\frac{-cy^2}{(1+py(b+cx))^2}} & f_2(x,y)\left(1+y\left(-1+\frac{b+cx}{(1+py(b+cx))^2}\right)\right) \end{pmatrix}\;. \] At the origin $E(0,0)$, the Jacobian is \[ J(0,0)=\begin{pmatrix} f_1(0,0) & 0\\ 0 & f_2(0,0) \end{pmatrix}= \begin{pmatrix} e^{r_1+H_1} & 0\\ 0 & e^{\displaystyle r_2+H_2-\frac{m}{a}} \end{pmatrix}\;. \] Thus the eigenvalues are \[ \lambda_1=e^{r_1+H_1} \quad \mbox{and $\lambda_2=e^{r_2+H_2-\frac{m}{a}}$}\;.\] At the predator-free axial fixed point $E(0,y)$ the Jacobian is \[ \begin{array}{ll} J(0,y)&=\begin{pmatrix} f_1(0,y) & 0\\ f_2(0,y)\rb{\displaystyle \frac{-cy^3}{(1+pby))^2}} & f_2(0,y)\left(1+y\left(-1+\frac{b+}{(1+pby))^2}\right)\right) \end{pmatrix}\mbox{}\\ & \mbox{}\\ &=\begin{pmatrix} e^{r_1+H_1} & 0\\ e^{r_2+H_2-\frac{m}{a+y}}\rb{\displaystyle \frac{-cy^3}{(1+pby))^2}} & e^{r_2+H_2-\frac{m}{a+y}}\left(1+y\left(-1+\frac{b}{(1+pby))^2}\right)\right) \end{pmatrix}\;. \end{array} \] Thus the eigenvalues are \[ \lambda_1=e^{r_1+H_1} \quad \mbox{and $\lambda_2=e^{r_2+H_2-\frac{m}{a+y}}\left(1+y\left(-1+\frac{b}{(1+pby))^2}\right)\right)$}\;.\] At the prey-free axial fixed point $E(x,0)$ the Jacobian is \[ \begin{array}{lll} J(x,0)&= \begin{pmatrix} f_1(x,0)(1-x) & xdf_1(x,0)(b+cx)\\ 0 & f_2(x,0) \end{pmatrix} &= \begin{pmatrix} e^{r_1+H_1-x}(1-x) & xd(b+cx)e^{r_1+H_2-x}\\ 0 & e^{r_2+H_2-\frac{m}{a}} \end{pmatrix}\;. \end{array} \] Thus the eigenvalues are \[ \lambda_1=e^{r_1+H_1-x}(1-x) \quad \mbox{and $\lambda_2=e^{r_2+H_2-\frac{m}{a}}$}\;.\] At an interior fixed point $E(x,y)$ with $x,y>0$, the Jacobian is \[ J(x,y)=\begin{pmatrix} 1+x\rb{-1+\frac{dcy}{(1+py(b+cx))^2}} & \frac{dx(b+cx)}{(1+py(b+cx))^2}\\ \frac{-cy^3}{(1+py(b+cx))^2} & 1+y\left(-1+\frac{b+cx}{(1+py(b+cx))^2}\right) \end{pmatrix}\;, \] since $f_1(x,y)=f_2(x,y)=1$. Let $D$ be the determinant and $T$ be the trace of $J(x,y)$ respectively. Then the eigenvalues are\\ \[ \displaystyle \lambda_1=\frac{T-\sqrt{T^2-4D}}{2} \quad \mbox{and $\displaystyle \lambda_2=\frac{T-\sqrt{T^2-4D}}{2}$}\;.\] We the have the following result: \begin{thm} Consider the deterministic system above. Then \begin{itemize} \item[$\blacktriangleright$] The origin $E_{00}(0,0)$ is locally asymptotically stable if and only if $r_1+H_1<0$ and $r_2+H_2<\frac{m}{a}$. \item[$\blacktriangleright$] The Predator-free equilibrium $E_{01}(0,y)$ is locally asymptotically stable if and only if $r_1+H_1<0$ and $\abs{1-y+\frac{yb}{(1+pby)^2}}<e^{\frac{m}{a}-r_2-H_2}$. \item[$\blacktriangleright$] The Prey-free equilibrium $E_{10}(0,y)$ is locally asymptotically stable if and only if $\abs{x-1}<e^{x-r_1-H_1}$ and $r_2+H_2<\frac{m}{a}$. \item[$\blacktriangleright$] From the Determinant-Trace analysis, we know that \begin{itemize} \item If $\abs{\lambda_1}<1$ and $\abs{\lambda_2}>1$ or $\abs{\lambda_1}>1$ and $\abs{\lambda_2}<1$, then $E(x,y)$ is locally a saddle point. \item $\abs{\lambda_1}<1$ and $\abs{\lambda_2}<1$, then $E(x,y)$ is locally asymptotically stable. \item $\abs{\lambda_1}>1$ and $\abs{\lambda_2}>1$, then $E(x,y)$ is locally unstable. \end{itemize} \end{itemize} \end{thm} \subsection{Global Stability} In this section, we discuss global stability condition for the origin and the interior equilibrium point. \begin{thm} \label{thm:GlobalStat} Put \[\mbox{$\alpha=e^{r_1+H_1+\frac{d}{p}}$ and $\beta=e^{r_2+H_2}$}\;.\] \begin{itemize} \item[$\blacktriangleright$] The origin $E_{00}(0,0)$ is globally asymptotically stable if $\alpha^2\leq 1$ and $\beta^2\leq 1$. \item[$\blacktriangleright$] The interior equilibrium $E(x_*,y_*)$ is globally asymptotically stable if $\alpha^2=1$ and $\beta^2= 1$. \end{itemize} \end{thm} \subsection{Simulations} In this section, we illustrate the deterministic model for the different types of equilibrium points. We chose eight starting points with respective $x$ and $y$ coordinates: $X_0=(0.1, 0.1, 0.1, 10, 10, 10, 2.5, 20), Y_0=(10, 0.5, 0.1, 0.1, 0.5,10, 0.1, 3)$. The trajectories are represented by the black, light green, light blue, light red, light cyan, orange, purple, and magenta colors. The solid dots represent the fixed points of the model and the solid blue and light black curves represent the isoclines $(C_2)$ and $C_1$ respectively. \begin{figure}[H] \begin{tabular}{ccc} ({\bf a}) & ({\bf b}) & ({\bf c}) \\ \includegraphics[scale=0.32]{PhaseSpaceNOIntEq.pdf} & \includegraphics[scale=0.32]{PhaseSpaceOneYIntEq.pdf} & \includegraphics[scale=0.32]{PhaseSpaceOneXIntEq.pdf} \\ ({\bf d}) & ({\bf e}) & \\ \includegraphics[scale=0.32]{PhaseSpaceOneIntEq.pdf} & \includegraphics[scale=0.32]{PhaseSpaceTwoIntEq.pdf} & \end{tabular} \caption{Figure ({\bf a}) show convergence of trajectories to the origin $E_00$, Figure ({\bf b}) shows convergence to the predator free axial point $E_{0y}$, Figure ({\bf c}) shows convergence to the prey free axial point $E_{x0}$, Figure ({\bf d}) shows convergence to the interior fixed point $E_{xy}$ Figure ({\bf e}) shows two interior fixed points, one stable and one unstable.} \label{fig-Deterministic} \end{figure} \subsection{Discussion} We can make the following observation from the study above:\\ \noindent 1) The choice of the Holling functional certainly plays a role in this model. Our motivation for choosing type II rather than type III is that type III is found in population dynamics if the prey density is assumed constant, which is hardly the case here. \\ \noindent 2) Another observation is that our choice of type II functional response is different from the model suggested by Holling at inception. However, our functional response accounts for an important parameter in population dynamics such as the cooperation constant $c$.\\ \noindent 3) Our discussion of global stability is limited to using Lyapounov functional approach. It is important to point out that tools such monotone maps could also be used to prove global stability, see \cite{Balreira2014}.\\ \noindent 4) It is known that in standard Ricker model with no immigration term, the intrinsic growth rate parameter is a bifurcation parameter (see for example \cite{Kwessi2018_3}), and in some case, the standard Ricker model possesses deterministic chaos. In the current model, the bifurcations parameters will be $r_1+H_1+\frac{d}{p}$ and $r_2+H_2$ respectively for individual species and it highly likely that this system also possess deterministic chaos. Since this is beyond the investigation we are interested in pursuing, we will not discus it further for sake of brevity. \section{Stochastic Model} \label{sect:stochatic} To take into account environmental fluctuations on the species under consideration, we let \begin{itemize} \item $k\in \mathbb{N}$, we let $t_k=k\Delta t$ for some $\Delta t>0$. \item We define $X_k=(x_{_{t_k}},y_{_{t_k}})$ for $k\in \mathbb{N}$. \item We let the initial condition be $X_0=(x_0,y_0)\in \mathbb{R}^+\times \mathbb{R}^+$. \item We consider sequences of random variables $\displaystyle \set{N_{j,k}(\Delta t),j=1,2, k\in \mathbb{N}}$, normally distributed such that for $j=1,2$ and for all $k\in \mathbb{N}$, \begin{enumerate} \item $E[N_{j,k}(\Delta t)]=0$. \item $E[(N_{j,k}(\Delta t))^2]=\sigma_j^2 \Delta t$ with for $j=1,2$. \item $E[(N_{j,k}(\Delta t))^4]=o(\Delta t)$. \end{enumerate} \item We will assume that within the interval $[t_k, t_{k+1}]$, $X_k$ is affected by random perturbations $(x_{_{t_k}}N_{1,k}(\Delta t), y_{_{t_k}}N_{2,k}(\Delta t))$. \end{itemize} Therefore, for $k\in \mathbb{N}$, we will have \[\begin{cases} x_{_{t_{k+1}}}-x_{t_k}=x_{_{t_k}}N_{1,k}(\Delta t)+x_{t_k}\rb{e^{\displaystyle r_1-x_{t_k}+\frac{d(b+cx_{t_k})x_{t_k}}{1+py_{t_k}(b+cx_{t_k})}+H_1}}\Delta t \\ y_{_{t_{k+1}}}-y_{t_k}=y_{_{t_k}}N_{2,k}(\Delta t) +y_{_{t_k}}\rb{e^{\displaystyle r_2-y_{_{t_k}}-\frac{m}{a+y_{_{t_k}}}-\frac{(b+cx_{_{t_k}})y_{_{t_k}}}{1+py_{_{t_k}}(b+cx_{_{t_k}})}+H_2}}\Delta t \end{cases}\;,\] or in vector form as \[X_{k+1}-X_k=X_k F(X_k)\Delta t+X_kN_k(\Delta t)\;.\] From It\^o's Calculus (see for instance \cite{Durrett1996}, if we put $W_{k+1,j}(\Delta t)-W_{k,j}(\Delta t):=N_{k,j}(\Delta t)$ and let $\Delta t\to 0$, then the equation above converges to an autonomous stochastic differential equation (SDE) \begin{equation}\label{eqn:stochastic} dX(t)=a(X(t))dt+b(X(t))dW(t)\;, \end{equation} with initial condition $X_0=(x_0,y_0)$ and where \[ a(X(t))=\rb{\begin{array}{l} x(t)e^{\displaystyle r_1-x(t)+\frac{d(b+cx(t))y(t)}{1+py(t)(b+cx(t))}+H_1}\\ y(t)e^{\displaystyle r_2-y(t)-\frac{m}{a+y(t)}-\frac{(b+cx(t))y(t)}{1+py(t)(b+cx(t))}+H_2} \end{array}} \;,\] and $b(X(t))=[x(t)\sigma_1,y(t)\sigma_2]$ represents the per-capita magnitude of environmental fluctuations, and $W(t)=[W_1(t), W_2(t)]$ is a vector of Wiener processes. \begin{remark} It would be an important question to ask why the stochastic model cannot be introduced by adding a ``stochastic" or ``random" term to the deterministic model or even to randomize the model parameters by assuming they are selected from specific probability distributions. While it would be a worthwhile effort theoretically, the best answer to this question can be found in \cite{Hening2021}, Remark 2.1. Because of its importance, let us restate it here for self-containment: just adding a stochastic fluctuating term to a deterministic model has some short comings because it does not usually give a mechanism on how different species are influenced by the environment. Instead, following the fundamental work by \cite{Turelli1977}, we see the SDE models as ``approximations for more realistic, but often analytically intractable, models". In particular, SDE's can be seen as scaling limits, or approximations, of difference equations. \end{remark} We will be concerned the existence of global solution, strongly persistence in mean, and the existence of a stationary distribution. \subsection{Existence of global solution} Let us start by recalling the following Theorem on the existence of global solutions to a stochastic differential equation, see for instance \cite{Oksendal2014}, Theorem 5.2.1, p. 66. \begin{thm} Let $T>0$ and $A:\mathbb{R}^n\times [0,T]\to \mathbb{R}^n,\quad B:\mathbb{R}^n\times [0,T]\to \mathbb{R}^{n\times m}$ be measurable functions. Let $X_0\in \mathbb{R}^n$ be a random variable such that $\mathbb{E}[\norm{X_0}^2]<\infty$, where $\norm{\cdot}$ is a norm in $\mathbb{R}^n$. Suppose that for given $t \in[0,T]$ and $X(t), Y(t)\in \mathbb{R}^n$, there exist $K_1, K_2>0$ such that \begin{enumerate} \item Linear growth condition: \[\norm{A(X(t),t)}+\norm{B(X(t),t)}\leq K_1(1+\norm{X(t)})\;.\] \item Local Lipschitz Condition: \[\norm{A(X(t),t)-A(Y(t),t)}+\norm{B(X(t),t)-B(Y(t),t)}\leq K_2\norm{X(t)-Y(t)}\;.\] \end{enumerate} Then the stochastic differential equation $dX(t)=A(X(t),t)+B(X(t),t)dW(t)$ with initial condition $X(0)=X_0$ has a unique solution $X(t)$ such that \[\mathbb{E}\Intv{\int_0^T \norm{X(t)}^2dt}<\infty\;.\] \end{thm} \begin{thm} For any initial value $X_0=(x_0,y_0)\in \mathbb{R}^+\times \mathbb{R}^+$, the above stochastic system has a unique positive global solution $X(t)=(x(t),y(t))\in \mathbb{R}^+\times \mathbb{R}^+$. \end{thm} \begin{proof} For $n=2$, consider the above non-autonomous stochastic differential equation \[dX(t)=a(X(t))+b(X(t))dW(t)\;.\] Put $X(0)=X_0=(x_0,y_0)$, for given $x_0,y_0\in \mathbb{R}^+$. Let $T>0$ be arbitrary.\\ Clearly, $\displaystyle\mathbb{E}[\norm{X_0}^2]=\norm{X_0}^2<\infty$. Recall that \[a(X(t))=[x(t)f_1(x(t),y(t)),y(t)f_2(x(t),y(t)]; \quad b(X(t))=[x(t)\sigma_1,y(t)\sigma_2]\;.\] $\displaystyle f_1(x(t),y(t))=e^{\displaystyle r_1-x(t)+\frac{d(b+cx(t))y(t)}{1+py(t)(b+cx(t))}+H_1}\leq e^{r_1+H_1+\frac{d}{p}}$.\\ $\displaystyle f_2(x(t),y(t))=e^{\displaystyle r_2-y(t)-\frac{m}{a+y(t)}-\frac{(b+cx(t))y(t)}{1+py(t)(b+cx(t))}+H_2}\leq e^{r_2+H_2}$.\\ Using the Mean Value Theorem, we can choose \[K_1=K_2=\max\set{e^{r_1+H_1+\frac{d}{p}}+\sigma_1,e^{r_2+H_2}+\sigma_2}\;.\] Since this is true for any $T>0$, then we conclude that the solution exists and is global. \end{proof} \subsection{Strong Persistence in Mean} Let us start by recalling the notion of strong persistence in mean and an important lemma used to prove that a stochastic differential equation is strongly persistent in mean. \begin{defn} Let $X(t)$ be the solution to a stochastic differential equation. Suppose that for all $t>0$, the normalized occupational measure or mean satisfies \[\scp{X(t)}=\frac{1}{t}\int_0^tX(u)du<\infty\;.\] $X(t)$ is said to be strongly persistent in mean if \[\lim_{t \to \infty} \inf \scp{X(t)}>0 \;.\] \end{defn} \noindent To prove that the solution of a stochastic differential equation is strongly persistent in mean, the following result is often used. \begin{lemma} \label{lemMeanPers} Let $W_i$ be a Wiener Process for all $1\leq i\leq n$. If $X(t)\in (C[0,\infty], \mathbb{R}^+)$ and there exist positive constants $\gamma_1, \gamma_2$ and $T>0$ such that \[ \displaystyle \ln(X(t))\geq \gamma_1 t-\gamma_{2} \int_0^tX(u)du+\sum_{i=1}^n\sigma_iW_i(t), \quad \mbox{\bf for $t\geq T$}\;,\] then by the Strong Law of Large numbers, \[\lim_{t \to \infty} \inf\scp{X(t)}\geq \frac{\gamma_1}{\gamma_2}, \quad \mbox{almost surely}\;.\] \end{lemma} \noindent Now we can state the result on mean persistence pertaining to our system: \begin{thm}\label{thm:MeanPersistence} Let $X(t)$ be the solution of the stochastic differential equation \eqref{eqn:stochastic}. If \[\frac{1}{2}\max\set{\sigma_1^2e^{-r_1-H_1},\sigma_2^2e^{\frac{m}{a}+\frac{1}{p}-r_2-H_2}}<1\;,\] then $X(t)$ is strongly persistent in mean. \end{thm} \begin{remark} \label{rem:Lyapunov:exp}The above theorem can be proved differently. Indeed, the key of our proof is showing that the quantity $\displaystyle \lambda_i(\mu):=\int_0^{\infty}\rb{f_i(X(t))-\frac{\sigma_i^2}{2}}\mu(dX)>0$, where $\mu$ is the Lebesgue measure. This is referred to in \cite{Hening2022} as the {\it external Lyapunov exponent}, which determines the infinitesimal per-capita growth of species not supported by the measure $\mu$. In that paper, it is shown under certain conditions (see section \ref{sect:StatDist} below) that if $\lambda_i(\delta^*)>0$ (where $\delta^*$ is the Dirac measure concentrated at the origin), then $X$ is strongly stochastically persistent. \end{remark} \subsection{Existence of Stationary Distributions}\label{sect:StatDist} We are now concerned with the existence of a stationary distribution for our model. First, let us define the notion of stationary distribution and strongly stochastic persistence along the lines of \cite{Hening2021}. \begin{defn} The probability measure $\xi$ is an invariant probability measure for a process (or a stochastic differential equation with solution) $X(t)$ if, whenever $X(0)=x$ has distribution $\xi$ , then for any time $t \geq 0$, the distribution of $X(t)$ is given by $\xi$. \end{defn} \begin{defn} Let $\Sigma$ be a $\sigma$-algebra on $\mathbb{R}^{n,\circ}_+:=(0, \infty)^n$ and let $E\in \Sigma$. We define the total variation norm as \[\displaystyle \norm{\mu (E)}_{TV}=\sup_{\pi}\set{\sum_{A \in \pi}\abs{\mu(A)}, \quad \mbox{$\pi$ is a countable disjoint partition of $E$}}\;.\] A process $X(t)$ with ${\bf x}=X(0)$ is said to be strongly stochastic persistent if it has a unique invariant probability measure $\xi_0$ defined on $\mathbb{R}^{n,\circ}_+$ and \[\lim_{t\to \infty}\norm{\mathbb{P}(t,X,\cdot)-\xi_0(\cdot)}_{TV}=0, \quad \mbox{for ${\bf x}\in \mathbb{R}^{n,\circ}_+$}\;.\] \end{defn} \noindent We can now state the result on stationary measures related to our model. \begin{thm}\label{thm:StatDist} Let $X(t)$ be the solution of the stochastic differential equation \eqref{eqn:stochastic}. If \[\frac{1}{2}\max\set{\sigma_1^2e^{-r_1-H_1},\sigma_2^2e^{\frac{m}{a}+\frac{1}{p}-r_2-H_2}}<1\;,\] then the stochastic differential equation above has a unique stationary distribution $\xi_0$ with support on $\mathbb{R}^{2,\circ}_+$ and \[\lim_{t\to \infty}\norm{\mathbb{P}(t,X,\cdot)-\xi_0(\cdot)}_{TV}=0, \quad \mbox{for ${\bf x}\in \mathbb{R}^{2,\circ}_+$}\;.\] \end{thm} \begin{remark} The proof relies of checking the key assumptions of Theorem 2.1 in \cite{Hening2021}. This theorem is quite strong in that it proves strong stochastic persistence, which is a stronger notion than persistence in probability and almost sure persistence in probability. Another advantage of Theorem 2.1 is that it is easy to extend it to multiple species. Often, to show existence of a stationary distribution, one would show almost sure persistence as in the proposition below. However, it is not easier to check the second part of the proposition, which technically amounts to proving Theorem 2.1 in \cite{Hening2021} from scratch. \end{remark} \begin{proposition} The Markov process $X(t)$ has a unique stationary distribution $\xi$ if there is a bounded domain $V\in \mathbb{R}^n$ with a regular boundary $\Sigma$ for which the following are hold true: \begin{enumerate} \item In the domain $V$ and some of its neighborhood, the smallest eigenvalue of the associated diffusion matrix $\Gamma(x)$ is far from zero. \item If ${\bf x}\in \mathbb{R}^n\setminus V$, the mean time $\tau({\bf x})$ required for any path emerging from ${\bf x}$ reaching the set $V$ is finite and $\displaystyle \sup_{{\bf x}\in U}\; \mathbb{E}[\tau({\bf x})]<\infty$ for every compact set $U\subset \mathbb{R}^n$, then for any integrable function $f$ with respect to the measure $\xi$, \[\mathbb{P}\rb{\lim_{T\to \infty}\frac{1}{T}\int_0^T f(X(t))dt=\int_{\mathbb{R}^n}f(x)\xi(dx)}=1\quad \mbox{for all $x\in \mathbb{R}^n$}\;.\] \end{enumerate} \end{proposition} \subsection{Simulations} To simulate the behavior of the stochastic model on an interval $[0,T]$ for a given $T>0$, we will use the following algorithm due to \cite{Milstein1975}. \begin{enumerate} \item Select an initial condition $X_0=(x_0,y_0)$ \item Select and integer $N>1$. \item Partition the interval $[0,T]$ as $0=t_0<t_1<t_2<\cdots<t_N=T$ with $t_k=k\Delta t$ with $ \displaystyle \Delta t= \frac{T}{N}$. \item Use Milstein Higher Order Scheme, that is, for $0\leq k\leq N$. \[ \begin{cases} x_{k+1}=&x_k+x_kf_1(x_k,y_k)\Delta t+x_k\sigma_1\Delta W_{1,k}\sqrt{\Delta t}+x_k\frac{\sigma_1^2}{2}[(\Delta W_{1,k})^2-\Delta t]\\ y_{k+1}=&y_k+y_kf_2(x_k,y_k)\Delta t+y_k\sigma_2\Delta W_{2,k}\sqrt{\Delta t}+y_k\frac{\sigma_2^2}{2}[(\Delta W_{2,k})^2-\Delta t] \end{cases}\;. \] \noindent where $\Delta W_{i,k}=W_{k+1}-W_{k}$ are independent normally distributed random variables with zero mean and variance $\Delta t$. \end{enumerate} In all figures below, we consider $N=100, T=1$, and the model parameters corresponding to a two interior fixed points for the deterministic model: $r_1=0.5, r_2=0.1, H_1=1.2, H_2=1.8, m=0.4, a=0.1, b=0.9, c=0.01, d=0.3, p=0.1$.\\ In the first panel on the right, we plot the phase space diagram of the deterministic model overlayed with 100 random trajectories with five initial points with coordinates given by $X_0=(0.25, 0.25, 2.75, 2.75, 2.75), Y_0=(2, 0.25, 2, 0.25, 0.1)$. The deterministic trajectories are represented by the solid thick red curves. The second and fifth panels are histograms of stationary distributions of prey and predator respectively. The third and fourth panels represent the levels curves and three dimensional representation of the stationary distribution to have more perspective. In the third plots, the black lines represent respectively the estimated sample mean of densities of both predator and prey. What they show is how stochasticity shifts the stable fixed points of deterministic models. \subsubsection{Low stochasticity on both species} \begin{figure}[H] \centering \resizebox*{5.9in}{!}{ \begin{tabular}{ccc} \includegraphics[scale=0.29]{SPS4LowLow.pdf} & \includegraphics[scale=0.3, angle =90]{Dens4PreyLowLow.pdf} & \includegraphics[width=2in, height=2.05in]{Heatmap5LowLow.pdf} \\ &\includegraphics[scale=0.4]{3DDensity5LowLow.pdf} & \includegraphics[scale=0.32]{Dens4PredLowLow} \end{tabular}} \caption{In this case, we let $\sigma_1=\sigma_2=0.1$. Unsurprisingly, the trajectories are similar to that of the deterministic model, with densities close to symmetric.} \label{Fig} \end{figure} \subsubsection{\bf Low stochasticity on predator, high on prey} \begin{figure}[H] \centering \resizebox*{5.9in}{!}{ \begin{tabular}{ccc} \includegraphics[scale=0.29]{SPS5LowHigh.pdf} & \includegraphics[scale=0.3, angle =90]{Dens5PreyLowHigh.pdf} & \includegraphics[width=2in, height=2.05in]{Heatmap5LowHigh.pdf} \\ &\includegraphics[scale=0.4]{3DDensity5LowHigh.pdf} & \includegraphics[scale=0.32]{Dens5PredLowHigh} \end{tabular}} \caption{In this case, we let $\sigma_1=6$ and $\sigma_2=0.1$. In this case, the predator survives and the prey quickly approaches limits of extinction. } \label{Fig} \end{figure} \subsubsection{\bf High stochasticity on predator, low on prey} \begin{figure}[H] \centering \resizebox*{5.9in}{!}{ \begin{tabular}{ccc} \includegraphics[scale=0.29]{SPS5HighLow.pdf} & \includegraphics[scale=0.3, angle =90]{Dens5PreyHighLow.pdf} & \includegraphics[width=2in, height=2.05in]{Heatmap5HighLow.pdf} \\ &\includegraphics[scale=0.4]{3DDensity5HighLow.pdf} & \includegraphics[scale=0.32]{Dens5PredHighLow} \end{tabular}} \caption{In this case, we let $\sigma_1=6$ and $\sigma_2=0.1$. In this case, the predator is persistent for trajectories above the deterministic unstable fixed point.} \label{Fig} \end{figure} \subsubsection{\bf High stochasticity on both species} \begin{figure}[H] \centering \resizebox*{5.9in}{!}{ \begin{tabular}{ccc} \includegraphics[scale=0.29]{SPS5HighHigh.pdf} & \includegraphics[scale=0.3, angle =90]{Dens5PreyHighHigh.pdf} & \includegraphics[width=2in, height=2.05in]{Heatmap5HighHigh.pdf} \\ &\includegraphics[scale=0.4]{3DDensity5HighHigh.pdf} & \includegraphics[scale=0.32]{Dens5PredHighHigh} \end{tabular}} \caption{In this case, we let $\sigma_1=6$ and $\sigma_2=6$. In this case, both species will eventually goes extinct, though the species will be extinct quicker than the predator.} \label{Fig} \end{figure} To understand the effect of stochasticity on the densities of the species for different system parameters, one could track the change in density of predator and prey from successive increments of parameters $\sigma_1$ and $\sigma_2$. We can then assess the Wasserstein distance (see \cite{Villani2008}) between the these consecutive distribution to assess how similar or dissimilar they are. This would provide a threshold for stochasticity. At the same time, one could also track the average densities of predator and prey. Let $p>1$ be a real number. Let us recall that the Wasserstein distance $W(\theta_1,\theta_2)$ on a metric space $(\mathcal{M},D)$ between two probability measures $\theta_1$ and $\theta_2$ with joint probability measure $\theta$ defined on a set $\Gamma(\theta_1,\theta_2)$ is given as \[W_p(\theta_1,\theta_2)=\rb{\inf_{\theta \in \Gamma(\theta_1,\theta_2)}\set{ \int_{\mathcal{M}\times \mathcal{M}}\theta(u,v)[D(u,v)]^pdudv}}^{\frac{1}{p}}\;.\] For practical purposes, distributions $\theta_1$ and $\theta_2$ will be taken as the empirical probability measures with samples $U=(U_{(1)},U_{(2)},\cdots, U_{(K)})$ and $V=(V_{(1)},V_{(2)},\cdots, V_{(K)})$ from order statistics. Therefore, an estimator of $W_p(\theta_1,\theta_2)$ is \[\widetilde{W}_p(\theta_1,\theta_2)=\rb{\sum_{i=1}^K\abs{U_{(i)}-V_{(i)}}^p}^{\frac{1}{p}}\;.\] In our case, we will use $p=2$. For the predator, we use the samples $U_1=X(\sigma_{1,i})$ and $V_1=X(\sigma_{1,i+1})$ corresponding to a given stochastic parameter $\sigma_{1,i}\in [0.1,8]$ for $i=1,2,\cdots, K$. Likewise, for the prey we use the samples $U_2=Y(\sigma_{2,i})$ and $V_2=Y(\sigma_{2,i+1})$, for $\sigma_{2,i}\in [0.1,8]$. In the figures below, we chose the starting point of the trajectories to be $x_0=5,y_0=1$ and $K=80$. For $i=1,\cdots, 80$. The parameters $\sigma_{1,\cdot}=\sigma_{2,\cdot}=\sigma$ will be referred to as stochasticity. \noindent The left panels represent the Wasserstein distance between consecutive predator and prey distributions by stochasticity and the right panels stochasticity versus average population densities. \begin{figure}[H] \centering \includegraphics[scale=0.65]{StochasticityVsDensityVsWassY22X22.pdf} \caption{ Here, $r_1=0.5, r_2=0.1, H_1=1.2,H_2=1.8, m=0.4, a=0.1, b=0.9, c=0.01;d=0.3; p=0.1$. corresponding to two interior fixed points in the deterministic case. } \label{fig-Wasserstein1} \end{figure} \begin{figure}[H] \centering \includegraphics[scale=0.65]{StochasticityVsDensityVsWassY11X11.pdf} \caption{$r_1=0.1,r_2=0.1, H_1=0.9, H_2=2, m=0.1, a=0.05, b=0.9, c=0.01, d=2.5, p=1.5$ corresponding to a single interior fixed point in the deterministic case.} \label{fig-Wasserstein2} \end{figure} \begin{figure}[H] \centering \includegraphics[scale=0.65]{StochasticityVsDensityVsWassY1X0.pdf} \caption{$r_1=0.9;, r_2=0.1, H_1=-1, H_2=3.5, m=0.1, a=0.5, b=0.2, c=0.4, d=2.5, p=0.1$ corresponding to the predator-free axial fixed point in the deterministic case. } \label{fig-Wasserstein3} \end{figure} \begin{figure}[H] \centering \includegraphics[scale=0.65]{StochasticityVsDensityVsWassY0X1.pdf} \caption{ $r_1=0.1, r_2=0.8, H_1=0.5, H_2=-.9, m=0.8, a=1.2, b=0.4, c=0.6, d=1, p=10$ corresponding to the prey-free axial fixed point in the deterministic case. } \label{fig-Wasserstein4} \end{figure} \begin{figure}[H] \centering \includegraphics[scale=0.75]{StochasticityVsDensityVsWassY0X0.pdf} \caption{ $r_1=0.1,r_2=0.8, H_1=-0.1, H_2=-1, m=0.9, a=0.4, b=0.5, c=1, d=2.2, p=0.2$. corresponding to no interior fixed point in the deterministic case. } \label{fig-Wasserstein5} \end{figure} \section{Discussion} \label{sect:discussion} \begin{enumerate} \item It is interesting to note the similarities in both Wasserstein distance plots and average population densities plots. \item Indeed, in Figures \ref{fig-Wasserstein1}--\ref{fig-Wasserstein5}, there are critical values for stochasticity from which quantitatively, the average densities of both predator and prey change. They are represented by the solid vertical lines, red for the predator and blue for the prey. This is matched in Wasserstein plots with a drop in distance. \item From a purely bifurcation point of view, this drop suggests that stochasticity seems to produce a supercritical pitchfork bifurcation in both species. \item From a purely statistical point of view, the Wasserstein distance obtained is clearly unimodal and right-skewed when a bifurcation occurs with the right skew being clearly zero. \item Another important takeaway is that persistence of the prey is clearly seen through the Wasserstein distance, see Figure \ref{fig-Wasserstein3}. In fact, the Wasserstein is unimodal with values in the same range except for a single peak due to the disappearance of the predator. \item Figure \ref{fig-Wasserstein4} is interesting in that it shows that while the predator persists for while under environmental stochasticity, it eventually goes extinct due to lack of prey. On the other, the prey quickly goes extinct due to both predation and environmental fluctuations. \item Is important to note that the simulations were done with the parameters of the deterministic case corresponding to the two interior fixed points. Similar observations as above can be drawn from the remaining cases. \item We observe that the per-capita magnitude of the environmental fluctuations are just linear functions of the populations densities. More structured per-capita magnitude functions can be considered, especially polynomial of higher degree without fundamentally altering the conclusions we obtained here. \end{enumerate} Our simulations are just an initial proof of concept that the Wasserstein distance may be used successfully to study bifurcation in stochastic environments. However, further investigations, both theoretically and practically are needed establish a more solid understanding. Since the Wasserstein distance is easy to calculate, it may be worthwhile to see if it can be used to empirically assess chaotic events as an alternative to calculating the largest Lyapunov exponent.
\section{Introduction} The geometric or Berry phase \cite{b1,b2,b3,b3bis}, a concept which was systematized and popularized in the 1980s by Sir Michael Berry \cite{b1}, has permeated through all branches of physics with applications in diverse fields ranging from atomic and molecular physics \cite{b4,b5,b6} to condensed-matter physics \cite{b7,b8,b9}, classical optics \cite{b10,b11,b12}, high energy and particle physics \cite{b13,b14,b15}, gravity and cosmology \cite{b16}. When a quantum or classical system undergoes a cyclic evolution governed by a change of parameters, besides the dynamical phase it acquires an additional phase term, the Berry phase, which depends only on the geometry of the path but not on how the cycle is run. In condensed matter physics, the geometric phase manifests itself in many phenomena, such as the quantum Hall effect, electric polarization, orbital magnetism and exchange statistics \cite{b3,b8,b9}. In a crystal, the application of an electric field changes the quasi-momentum of the electronic wave function over the entire Brillouin zone, and the accumulated geometric phase is known as the Zak phase \cite{b17}. In one-dimensional (1D) lattices, the bulk topological properties of the Bloch bands are characterized by the quantized Zak phase \cite{b18,b19,b20,b21,b22,b23,b23bis}, which can serve as a topological number.\par Several exciting phenomena that are attracting great interest in modern condensed-matter physics and beyond, such as non-Hermitian skin effect, modified bulk-boundary correspondence, exceptional points, nontrivial spectral topology and phase transitions, etc. \cite{b24,b25,b26,b27,b27bis}, appear in non-Hermitian models, i.e. in models where the dynamics is described by an effective non-Hermitian Hamiltonian \cite{b28,b29,b30} which accounts for energy/particle exchange with external reservoirs. A remarkable property of certain classes of non-Hermitian Hamiltonians is to display an entirely real energy spectrum in spite of non-Hermiticity \cite{b31,b32,b33,b34,b35,b36,b37,b38,b39,b39bis,b40}. Among such Hamiltonians, great attention has been devoted to the ones displaying parity-time ($\mathcal{PT}$) symmetry \cite{b31,b32,b33}, a concept that has become very popular in the past decade and found important applications in photonics and beyond \cite{b41,b42,b43,b44,b45,b46,b47}. {\color{black}{For given parity $\mathcal{P}$ and time reversal $\mathcal{T}$ operators, an Hamiltonian $\mathcal{H}$ is said to be $\mathcal{PT}$-symmetric if the commutator $ [\mathcal{H},\mathcal{PT]} $ vanishes, i.e. $ \mathcal{HPT}=\mathcal{PTH}$. However, since the operator $\mathcal{PT}$ is not linear, $\mathcal{PT}$-symmetry itself does not necessarily imply that the $\mathcal{H}$ and $\mathcal{PT}$ operators share the same set of eigenfunctions. {\color{black} This means that, while the underlying Hamiltonian $\mathcal{H}$ possesses $\mathcal{PT}$ symmetry, i.e. $\mathcal{PTH}=\mathcal{HPT}$, the corresponding eigenfunctions $|E \rangle$ of $\mathcal{H}$ can (or cannot) display the same symmetry. When some eigenfunctions of $\mathcal{H}$ break the $\mathcal{PT}$ symmetry, i.e. $\mathcal{PT}|E\rangle$ and $|E \rangle$ are distinct states, we have a typical scenario of spontaneous symmetry breaking} \cite{b33}. Spontaneous $\mathcal{PT}$ symmetry breaking corresponds to a spectral phase transition, from an entirely real energy spectrum in the unbroken $\mathcal{PT}$ phase to a complex energy spectrum in the spontaneously broken $\mathcal{PT}$ phase. {\color{black} {When a control parameter in the system is varied above a critical value, spontaneous $\mathcal{PT}$ symmetry breaking is usually observed and in the broken $\mathcal{PT}$ phase energies appear in complex conjugate pairs. This readily follows from the anti-linear nature of the $\mathcal{T}$ operator}}: {\color{black} if $|E \rangle$ is an eigenfunction of $\mathcal{H}$ with eigenenergy $E$, i.e. $\mathcal{H} |E \rangle= E |E \rangle$, then $\mathcal{HPT} |E \rangle=\mathcal{PT H} | E \rangle=\mathcal{PT} E |E \rangle=E^* \mathcal{PT} |E \rangle$. This means that $\mathcal{PT} |E \rangle$ is an eigenfunction of $\mathcal{H}$ with eigenenergy $E^*$. When the symmetry is not spontaneously broken, $| E \rangle$ and $\mathcal{PT} |E \rangle$ are the same eigenfunction, which necessarily implies $E=E^*$: in the unbroken $\mathcal{PT}$ phase the energy spectrum is entirely real. On the other hand, when the symmetry is spontaneously broken, $|E \rangle$ is not necessarily an eigenfunction of the $\mathcal{PT}$ operator, and thus the eigenfunctions $|E \rangle$ and $\mathcal{PT} |E \rangle$, with non-degenerate eigenenergies $E$ and $E^*$, are linearly independent: in this case the energy spectrum becomes complex and formed by complex conjugate pairs.} {\color{black}{ The spontaneous symmetry breaking phase transition is ubiquitously sharp and the symmetry breaking point corresponds to the appearance of non-Hermitian degeneracies, i.e. exceptional points \cite{b47,b47bis,b59} or spectral singularities \cite{sp1,sp2,sp3}, at the critical point.}}\\ The concept of geometric phase can be generalized to non-Hermitian systems, providing a geometrical description of the quantum evolution of non-Hermitian systems under cyclic variation of parameters \cite{b48,b49,b50,b51,b52,b53,b54,new1,b54noo,b54basta1,b54basta2,b54bis,b55,b56,b55bis,b57}. As compared to Hermitian systems, different forms of Berry phases have been introduced. Here we will use the Berry phase from the biorthogonal basis of the non-Hermitian Hamiltonain, which is thus rather generally complex. An interesting property of adiabatic cycling in non-Hermitian systems is that the energy surface can display a nontrivial topology: when one follows a loop in the space of system parameters, even in the absence of degeneracies the energies and corresponding instantaneous eigenstates may swap places, which renders the evolution non-cyclic. The interchange of energies arises when exceptional points are encircled in the space of system parameters \cite{b47,b58,b59}. The complex Berry phase has been suggested to provide a topological invariant identifying different topological phases and quantum phase transitions in certain non-Hermitian models \cite{b27bis,b60,b61,b62,b62bis,b63,b63bis,b64,b65,b66,b66bis,b66tris,b67,b68,b69,b70}, and some general conditions for the quantization of the Berry phase under certain generalized symmetries have been provided \cite{b71}. In a non-Hermitian lattice, complex Berry phase, i.e. Zak phase, naturally arises under an external dc force or a time-varying magnetic flux \cite{b65}, so that a Bloch eigenstate adiabatically evolves across the entire Brillouin zone accumulating a complex geometric phase. While the related phenomena of Bloch oscillations and Zener tunneling have been investigated at some extent in non-Hermitian lattices \cite{b72,b72bis,b73,b74,b75,b76,b77,b78,b79,b80,b81}, physical signatures of the complex Zak phase have received so far little attention and mostly restricted to some specific lattice models \cite{b54basta1,b65}. \par In this work we show that the complex Berry phase in slow-cycled non-Hermitian $\mathcal{PT}$ symmetric systems can lead to imperfect, i.e. smooth, spectral phase transitions. This phenomenon is first illustrated by considering a general model of two-level $\mathcal{PT}$ symmetric systems, and then applied to explain the imperfect phase transition of Wannier-Stark ladders found in certain two-band non-Hermitian lattices \cite{b81}, which is rooted in the non-vanishing imaginary part of the Zak phase. \section{Phase transitions in a cycled two-level $\mathcal{PT}$ symmetric model} \subsection{Model and $\mathcal{PT}$ symmetry breaking phase transition} We consider a classical or quantum two-level system described by an effective $2 \times 2$ non-Hermitian matrix Hamiltonian $\mathcal{H}=\mathcal{H}(k)$, which depends on a real parameter $k$ and is periodic in $k$ with a period of $ 2 \pi$, i.e. $\mathcal{H}(k+2\pi)=\mathcal{H}(k)$. As we will discuss in the next section, in the Wannier-Stark ladder problem of a non-Hermitian lattice driven by a dc field the matrix Hamiltonian $\mathcal{H}(k)$ corresponds to the Bloch Hamiltonian of a two-band lattice and $k$ is the quasi momentum, that drifts to span the entire Brillouin zone in the presence of the dc field.\\ The temporal dynamics of the system is described by the Schr\"odinger equation \begin{equation} i \frac{d}{dt} \left( \begin{array}{c} \psi_1 \\ \psi_2 \end{array} \right) = \left( \begin{array}{cc} \mathcal{H}_{11} & \mathcal{H}_{12} \\ \mathcal{H}_{21} & \mathcal{H}_{22} \end{array} \right) \left( \begin{array}{c} \psi_1 \\ \psi_2 \end{array} \right) = \mathcal{H}(k) \left( \begin{array}{c} \psi_1 \\ \psi_2 \end{array} \right). \end{equation} We assume that the Hamiltonian is $\mathcal{PT}$ symmetric with parity $\mathcal{P}$ and time reversal $\mathcal{T}$ operators defined by \begin{equation} \mathcal{P}= \sigma_x= \left( \begin{array}{cc} 0 & 1 \\ 1 & 0 \end{array} \right) \; ,\;\; \mathcal{T}=\mathcal{K} \end{equation} where $\sigma_x$ is the Pauli matrix and $\mathcal{K}$ the element-wise complex conjugation operator. $\mathcal{PT}$ symmetry, i.e. the condition $\mathcal{PTH}=\mathcal{H PT}$, is satisfied provided that \begin{equation} \mathcal{H}_{22}= \mathcal{H}^*_{11} \; , \; \; \mathcal{H}_{21}= \mathcal{H}^*_{12} \end{equation} so that the non-Hermiticity in the system is embedded in a non-vanishing imaginary part of $\mathcal{H}_{11}$. The most general form of matrix elements that respect the $\mathcal{PT}$ symmetry is thus \begin{eqnarray} \mathcal{H}_{11}=\mathcal{H}_{22}^*=G(k)+i \lambda W(k) \\ \mathcal{H}_{12}=\mathcal{H}_{21}^{*}=R(k) \exp [i \varphi(k)] \end{eqnarray} where $G(k), W(k)$, $R(k)$ are real and periodic functions of $k$ with period $2 \pi$, $\varphi(k)$ is a real function with $\varphi(k+2 \pi)=\varphi(k)$ mod $ 2 \pi$, and $\lambda \geq 0$ is a real parameter that measures the strength of non-Hermiticity in the system, the case $\lambda=0$ corresponding to $\mathcal{H}(k)$ Hermitian. Further, we assume that $R(k)$ is nonvanishing over the entire range $0 \leq k \leq 2 \pi$.\\ When the parameter $k$ is kept constant, the eigenenergies of $\mathcal{H}(k)$ are given by \begin{equation} E_{\pm}(k)= G(k) \pm \sqrt{R^2(k)-\lambda^2 W^2(k)} \end{equation} with corresponding (right) eigenvectors \begin{eqnarray} \mathbf{u}_{+} (k) & = & \left( \begin{array}{c} \cos \left( \frac{\theta}{2} \right) \\ \sin \left( \frac{\theta}{2} \right) \exp(-i \varphi) \end{array} \right) \\ \mathbf{u}_{-} (k) & = & \left( \begin{array}{c} \sin \left( \frac{\theta}{2} \right) \\ -\cos \left( \frac{\theta}{2} \right) \exp(-i \varphi) \end{array} \right). \end{eqnarray} In the previous equations, the complex angle $\theta=\theta(k)$ is defined by the relation \begin{equation} \tan \theta(k) = \frac{R(k)}{i \lambda W(k)}. \end{equation} Note that the imaginary part of the angle $\theta(k)$ diverges when $R(k)= \pm \lambda W(k)$, corresponding to the simultaneous coalescence of the two energies and eigenstates, i.e. to the appearance of an exceptional point. The left eigenvectors of $\mathcal{H}(k)$, i.e. the (right) eigenvectors of the adjoint $\mathcal{H}^{\dag}(k)$ with eigenvalues $ E_{\pm}^*(k)$, read \begin{eqnarray} \mathbf{v}_{+} (k) & = & \left( \begin{array}{c} \cos^* \left( \frac{\theta}{2} \right) \\ \sin^* \left( \frac{\theta}{2} \right) \exp(-i \varphi) \end{array} \right) \\ \mathbf{v}_{-} (k) & = & \left( \begin{array}{c} \sin^* \left( \frac{\theta}{2} \right) \\ -\cos^* \left( \frac{\theta}{2} \right) \exp(-i \varphi) \end{array} \right) \end{eqnarray} and the biorthogonal conditions \begin{equation} \langle \mathbf{v}_{n} (k) | \mathbf{u}_{m} (k) \rangle = \delta_{n,m} \end{equation} are satisfied for any $k$, with $n,m=+,-$. After letting \begin{equation} \lambda_c(k) \equiv |R(k)/W(k)|, \end{equation} from Eq.(6) it readily follows that the energy spectrum is real for $\lambda < \lambda_c(k)$ (unbroken $\mathcal{PT}$ phase), and complex for $\lambda> \lambda_c(k)$ (broken $\mathcal{PT}$ phase), with the appearance of an exceptional point at the critical point $\lambda=\lambda_c(k)$. \subsection{Phase transition in the cycled system} Let us now consider the two-level system when the Hamiltonian $\mathcal{H}(k)$ is periodically and adiabatically cycled in time. We assume that the parameter $k$ in the Hamiltonian varies in time according to \begin{equation} k= \omega t \end{equation} where $\omega$ is the cycling frequency. The temporal dynamics of the two-level system is thus described by the equation \begin{equation} i \frac{d}{dt} \left( \begin{array}{c} \psi_1 \\ \psi_2 \end{array} \right) = \mathcal{H}( \omega t ) \left( \begin{array}{c} \psi_1 \\ \psi_2 \end{array} \right). \end{equation} {\color{black} In most of our analysis, we will limit our attention considering the system dynamics in the slow-cycling regime $\omega \rightarrow 0$. As we will comment below with reference to some specific examples, the main motivation thereof is that to observe smooth spectral phase transitions the system evolution must be slow enough}. Without loss of generality we can assume $G(k)=0$, i.e. $\mathcal{H}_{11}(k)=\mathcal{H}_{22}^*(k)=i \lambda W(k)$, so that the instantaneous eigenenergies of $\mathcal{H}(k)$ read \begin{equation} E_{\pm}(k)= \pm \sqrt{R^2(k)-\lambda^2 W^2(k)} \end{equation} with $k=\omega t$. In fact, a non-vanishing value of $G(k)$ can be eliminated from the dynamics after the gauge transformation \[ \left( \begin{array}{c} \psi_1(t) \\ \psi_2(t) \end{array} \right) \rightarrow \left( \begin{array}{c} \psi_1(t) \\ \psi_2(t) \end{array} \right) \exp \left\{-\frac{i}{ \omega} \int_0^{\omega t} G(k) dk \right\}. \] According to Floquet theory, the most general solution to the Schr\"odinger equation (15) is given by \begin{equation} \left( \begin{array}{c} \psi_1 (t) \\ \psi_2 (t) \end{array} \right)= \mathcal{U}(t) \exp(-i \mathcal{R} t) \left( \begin{array}{c} \psi_1 (0) \\ \psi_2 (0) \end{array} \right) \end{equation} where $\mathcal{R}$ is a time-independent $2 \times 2 $ matrix while $\mathcal{U}(t)$ is a time-dependent and periodic $ 2 \times 2 $ matrix, $\mathcal{U}(t+ 2 \pi / \omega)= \mathcal{U} (t)$, with $\mathcal{U}(0)= \mathcal{I}$ (the identity matrix). The exponential of the matrix $\mathcal{R}$ can be expressed in terms of the path-ordered integral \[ \exp(-i \mathcal{R} )= \bar{\mathcal{T}} \exp \left[ -i \frac{\omega}{2 \pi} \int_{0}^{2 \pi / \omega} dt \;\mathcal{H}( \omega t) \right] \] where $\bar{\mathcal{T}}$ indicates the time ordering. The two eigenvalues $\mu_{ \pm}=\mu_{\pm}(\lambda)$ of $\mathcal{R}$ are the quasi energies of the time-periodic cycled system. The real parts of the quasi energies are defined apart from integer multiples than $\omega$. Note that for $G(k)=0$ the trace of $\mathcal{H}(k)$ vanishes, so that $\mu_-=-\mu_+$, i.e. the two quasi energies can be assumed to be opposite one another. A non-vanishing value of $G(k)$ would just lead to a shift of the quasi energies by the amount $(1/2 \pi) \int_0^{2 \pi} dk G(k)$. \\ A natural question arises: akin to the non-cycled $\mathcal{PT}$ symmetric system, is there a spectral phase transition, from real to complex quasi energies, as the non-Hermitian parameter $\lambda$ in the system is increased above a critical value? To answer this question, let us indicate by $\bar{\lambda}_c$ the minimum value of $\lambda_c(k)$ as $k$ spans the range $0 \leq k \leq 2 \pi$, i.e. \begin{equation} \bar{\lambda}_c= \min_{0 \leq k \leq 2 \pi} \lambda_c(k)=\min_{0 \leq k \leq 2 \pi} \left| \frac{R(k)}{W(k)} \right|. \end{equation} Intuitively, for a slowly-cycled system one would expect the following scenario: for $\lambda< \bar{\lambda}_c$, the instantaneous eigenenergies $E_{\pm}(k= \omega t)$ of $\mathcal{H}(k=\omega t)$ are real, and thus we expect the quasi energies $\mu_{\pm}$ to remain real as well. On the other hand, for $\lambda> \bar{\lambda}_c$ within the modulation cycle there are time intervals where the instantaneous eigenenergies $E_{\pm}(k= \omega t)$ become complex: in this case we expect the quasi energies to become complex too. Hence, according to such an intuitive picture, we expect a spectral phase transition of the cycled two-level system, from real to complex quasi energies, when the non-Hermitian parameter $\lambda$ is increased above the critical value $\bar{\lambda}_c$. This result is indeed what one observes from a numerical computation of the quasi energies in several examples of cycled two-level $\mathcal{PT}$ symmetric models, as shown in the next subsection. However, in some other models it turns out that, for a small but non-vanishing oscillation frequency $\omega$, the phase transition is smooth, i.e. imperfect: below the critical value $\bar{\lambda}_c$ the imaginary part of the quasi energy takes a small but non-vanishing value, which scales as $ \sim \omega$, i.e. it exactly vanishes only in the limit $\omega \rightarrow 0$. What is the physical origin of such an imperfect phase transition, which is observed in some models but not in others?\\ The answer to this question is rooted in the appearance of a complex Berry phase in certain models (but not in others), and can be gained from an adiabatic analysis of the time evolution of the system in the $\omega \rightarrow 0$ limit, which is detailed in the Appendices A and B. In the adiabatic analysis, the slow evolution of the amplitudes of the instantaneous eigenstates $\mathbf{u}_{\pm}(k= \omega t)$ of the Hamiltonian $\mathcal{H}(k =\omega t)$ is governed by the non-Hermitian Berry connection \begin{equation} \mathcal{A}_{n,l}(k)=-i \langle \mathbf{v}_n | \partial_k \mathbf{u}_l \rangle \end{equation} ($n,l= +,-$), which is defined in the context of the biorthonormal inner product. The integrals of the diagonal terms of Berry connection, $\mathcal{A}_{+,+}(k)$ and $\mathcal{A}_{-,-}(k)$, over the interval $0 \leq k \leq 2 \pi$, i.e. \begin{equation} \gamma_{B_+}= \int_0^{2 \pi} dk \mathcal{A}_{+,+}(k) \; , \; \; \gamma_{B_-}= \int_0^{2 \pi} dk \mathcal{A}_{-,-}(k) \end{equation} are the non-Hermitian Berry phases associated to the two instantaneous eigenstates $\mathbf{u}_{\pm}(k)$. The explicit form of the Berry connection and Berry phases are derived in Appendix A. In particular, one has \begin{equation} \gamma_{B_{\pm}} = \mp \frac{1}{2} \int_{0}^{2 \pi} dk \frac{d \varphi}{dk} \pm \frac{i}{2} \int_{0}^{2 \pi} dk \frac{d \varphi}{dk} \sinh \psi(k) \end{equation} where the function $\psi(k)$ is defined by the relation \begin{equation} \tanh \psi(k)= \frac{\lambda W(k)}{R(k)}. \end{equation} Note that the Berry phase vanishes in any $\mathcal{PT}$-symmetric two-level system with $ (d \varphi / dk) \equiv 0$.\\ {\color{black} The adiabatic analysis shows some subtleties and limitations when applied to our model, owing to the appearance of instantaneous EP on the cycle when $\lambda> \bar{\lambda_c}$. Technical details are given in Appendix B}. The main result of the adiabatic analysis is that, in the limit $\omega \rightarrow 0$ {\color{black} and for $\lambda \neq \bar{\lambda_c}$}, the two quasi energies are given by \begin{equation} \mu_{\pm}= \frac{1}{2 \pi} \int_{0}^{2 \pi} dk E_{\pm} (k) + \frac{\omega}{2 \pi} \gamma_{B_{\pm}}. \end{equation} Note that, since $E_-(k)=-E_+(k)$ and $\gamma_{B_{-}}=-\gamma_{B_{+}}$, one has $\mu_-=-\mu_+$, as it should. The above result provides an approximate form of the quasi energies in the adiabatic limit $\omega \rightarrow 0$ for any strength $\lambda$ of the non-Hermitian parameter far from the critical value $\lambda= \bar{\lambda_c}$, at which the Berry phase term becomes singular and the adiabatic analysis fails; a discussion on this point is given in the Appendix B.\\ According to Eq.(23), each quasi energy is given by the sum of two terms. The first one is related to the dynamical phase accumulated by the adiabatic eigenstates in one cycle and equals the average of the instantaneous energies $E_{\pm}(k)$ over one cycle. The dynamical phase term is clearly independent of the modulation frequency $\omega$ and is real for $\lambda < \bar{\lambda}_c$, while its imaginary part is non-vanishing for $\lambda > \bar{\lambda}_c$. The second term on the right hand side in Eq.(23) is the non-Hermitian Berry phase contribution. This is a small term which vanishes like $ \sim \omega$ as $\omega \rightarrow 0$. Interestingly, for $\lambda < \bar{\lambda}_c$ the imaginary part of the quasi energies is provided solely by the Berry phase term, and vanishes as $ \omega \rightarrow 0$. This explains why in the cycled two-level $\mathcal{PT}$-symmetric system with a vanishing Berry phase the spectral phase transition of the quasi energies, at $\lambda=\bar{\lambda}_c$, is sharp (exact), while it becomes smooth (imperfect) when the non-Hermitian Berry phase along the cycle is non-vanishing. \subsection{Illustrative examples} The main result of the adiabatic analysis is that the spectral phase transition of the quasi energies in the slow-cycled $\mathcal{PT}$-symmetric two-level system turns out be be imperfect (smooth) whenever the Berry phase in the cycle is complex, which requires the derivative $(d \varphi/dk)$ not to identically vanish. On the other hand, the phase transition is sharp (exact) whenever the Berry phase is real. Here we illustrate and confirm the predictions of the adiabatic analysis by considering three examples of cycled two-level $\mathcal{PT}$-symmetric systems.\\ \\ {1. {\it First example}.} The first example is a simple and exactly-solvable model, corresponding to $G(k)=0$, $W(k)=1$, $R(k)=R_0$, $\varphi(k)=k$, i.e. to the $\mathcal{PT}$-symmetric Hamiltonian \begin{equation} \mathcal{H}(k)= \left( \begin{array}{cc} i \lambda & R_0 \exp(ik) \\ R_0 \exp(-ik) & -i \lambda \end{array} \right) \end{equation} where $R_0>0$ is a real parameter. Physically, this model describes a two-level system, in which the two states are Hermitian-coupled by an amplitude $R_0$ and a gauge (Peierls) phase $k$ and with gain ($ \lambda$) and loss ($-\lambda$) rates in the two levels. The system displays a $\mathcal{PT}$ symmetry breaking at a critical value $\lambda_c(k)=\bar{\lambda}_c$, independent of $k$, given by \begin{equation} \bar{\lambda}_c=R_0. \end{equation} In the cycled system with $k= \omega t$, we expect an imperfect phase transition of quasi energies because $(d \varphi / dk)=1 \neq 0$ and the imaginary part of the Berry phase does not vanish. The quasi energies $\mu_{\pm}$ can be calculated in an exact form, given that the time dependence of the Hamiltonian $\mathcal{H}(k=\omega t)$ can be removed from the dynamics after the gauge transformation \begin{equation} \psi_1(t)= \bar{\psi}_1(t) \exp \left( i \frac{ \omega t}{2} \right) \; , \; \psi_2(t)= \bar{\psi}_2(t) \exp \left( - i \frac{\omega t}{2} \right). \end{equation} The exact expression of the quasi energies can be readily computed, yielding \begin{equation} \mu_{\pm}= \pm \sqrt{R_0^2+ \left( \frac{\omega}{2}+i \lambda \right)^2 } \mp \frac{\omega}{2} \end{equation} A typical behavior of the imaginary parts of the quasi energies versus $\lambda$, in the adiabatic limit $ \omega \ll R_0$, is depicted in Fig.1, clearly showing the appearance of an imperfect spectral phase transition near $\lambda=\bar{\lambda}_c$. Note that, when $\lambda$ is not too close to $\bar{\lambda}_c=R_0$, in the adiabatic limit $\omega \rightarrow 0$ we can expand the right hand side of Eq.(27) in power series of $\omega$ and, up to first order in $\omega$, the following approximate expression of quasi energies is obtained \begin{equation} \mu_{\pm} \simeq \pm \sqrt{R_0^2-\lambda^2} \mp \frac{\omega}{2} \pm i \frac{ \lambda \omega}{2 \sqrt{R_0^2-\lambda^2}}. \end{equation} It can be readily shown that Eq.(28) precisely reproduces the result predicted by the adiabatic analysis [Eq.(23)]. In fact, the dynamical phase contribution to the quasi energy is given by \[ \frac{1}{2 \pi} \int_0^{2 \pi} dk E_{\pm}(k)= \pm \sqrt{R_0^2-\lambda^2} \] \begin{figure}[!t] \centering \includegraphics[width=1.0\linewidth]{Fig1.png} \caption{ Behavior of the imaginary part of the quasi energies $\mu_{\pm}$ versus the non-Hermitian parameter $\lambda$ for the cycled $\mathcal{PT}$-symmetric system with Hamiltonian $\mathcal{H}(k)$ given by Eq.(24) for $R_0=1$ and for a modulation frequency (a) $\omega=0.02$, and (b) $\omega=0.1$. Open blue circles and red crosses refer to the exact curves and to the approximate curves obtained from the adiabatic analysis, {\color{black} respectivley}. Note that the spectral phase transition is imperfect around the critical point $\lambda=\bar{\lambda}_c=R_0$, and that near the critical point the adiabatic curves fail to predict the exact behavior of the quasi energies. } \end{figure} while the Berry phase contribution reads \begin{eqnarray} \frac{\omega}{2 \pi} \gamma_{B_{\pm}} & = & \mp \frac{ \omega}{4 \pi} \int_{0}^{2 \pi} dk \frac{d \varphi}{dk} \pm \frac{i \omega}{4 \pi} \int_{0}^{2 \pi} dk \frac{d \varphi}{dk} \sinh \psi(k) \nonumber \\ & = & \mp \frac{\omega}{2} \pm i \frac{\omega}{2} \sinh \psi =\mp \frac{\omega}{2} \pm i \frac{\lambda \omega}{2 \sqrt{R_0^2-\lambda^2}}. \end{eqnarray} In deriving Eq.(29), we used the property that $\psi(k)$, defined by the relation ${\rm tanh} \psi(k)= \lambda/R_0$, is independent of $k$ and $(d \varphi/ dk)=1$. Note that the behavior of the imaginary part of the quasi energies, predicted by the adiabatic analysis, well reproduces the exact curves, except near the phase transition point $\lambda=\bar{\lambda}_c$ where the Berry phase contribution displays a singularity.\\ \\ {2. {\it Second example}.} As a second example, let us consider the $\mathcal{PT}$-symmetric two-level Hamiltonian \begin{equation} \mathcal{H}(k)= \left( \begin{array}{cc} i \lambda & t_1+t_2 \cos k \\ t_1+t_2 \cos k & -i \lambda \end{array} \right) \end{equation} corresponding to $G(k)=0$, $W(k)=1$, $R(k)=t_1+t_2 \cos k$, and $\varphi(k)=0$, where $t_1$ and $t_2$ are real and positive parameters with $t_1>t_2$. Since $(d \varphi /dk)=0$, the Berry phase vanishes and, according to the adiabatic analysis, when the system is slowly cycled with $k= \omega t$ the spectral phase transition of the quasi energies is sharp (exact) and occurs at the critical value $\bar{\lambda}_c=t_1-t_2$ of the non-Hermitian parameter $\lambda$. The numerical computation of the quasi energies $\mu_{\pm}$ versus $\lambda$, as obtained by a direct numerical integration of the Schr\"odinger equation (15) using an accurate variable-step fourth-order Runge-Kutta method, confirms that the phase transition is sharp and the curves ${\rm Im}(\mu_{\pm}(\lambda))$ are well approximated by the behavior predicted by the adiabatic analysis, as shown in Fig.2.\\ \\ \begin{figure}[!t] \centering \includegraphics[width=1.0\linewidth]{Fig2.png} \caption{ Behavior of the imaginary part of the quasi energies $\mu_{\pm}$ versus the non-Hermitian parameter $\lambda$ for the cycled $\mathcal{PT}$-symmetric system with Hamiltonian $\mathcal{H}(k)$ given by Eq.(30) for $t_1=1$, $t_2=0.5$ and for a modulation frequency (a) $\omega=0.02$, and (b) $\omega=0.1$. Open blue circles and red crosses refer to the exact curves, obtained from a numerical computation of quasi energies, and to the approximate curves obtained from the adiabatic analysis, {\color{black} respectivley}. Note that the spectral phase transition is sharp around the critical point $\lambda=\bar{\lambda}_c=t_1-t_2=0.5$. } \end{figure} {3. {\it Third example}.} As a third example, let us consider the $\mathcal{PT}$-symmetric two-level Hamiltonian \begin{equation} \mathcal{H}(k)= \left( \begin{array}{cc} i \lambda +t_0 \cos k & t_1+t_2 \exp(i k) \\ t_1+t_2 \exp(-ik) & -i \lambda+t_0 \cos k \end{array} \right) \end{equation} corresponding to $G(k)=t_0 \cos k$, $W(k)=1$, $R(k)=\sqrt{t_1^2+t_2^2+2 t_1 t_2 \cos k}$, and $\varphi(k)={\rm atan} [t_2 \sin k / (t_1+ t_2 \cos k ]$, where $t_0$, $t_1$ and $t_2$ are real and positive parameters with $t_1 \neq t_2$. Since $(d \varphi /dk) \neq 0$, the imaginary part of the Berry phase does not vanish and, according to the adiabatic analysis, when the system is slowly cycled with $k= \omega t$ the spectral phase transition of the quasi energies is imperfect (smooth). The phase transition occurs at the critical value $\bar{\lambda}_c=|t_2-t_1|$ of the non-Hermitian parameter $\lambda$. The numerical computation of the quasi energies $\mu_{\pm}$ versus $\lambda$, as obtained by a direct numerical integration of the Schr\"odinger equation (15), confirms that the phase transition is imperfect and the curves ${\rm Im}(\mu_{\pm}(\lambda))$ are well approximated by the behavior predicted by the adiabatic analysis for $\lambda \neq \bar{\lambda}_c$, as shown in Fig.3. {\color{black} Note that in the slow-cycling regime [Fig.3(a)] the curves ${\rm Im} (\mu_{\pm})$ versus $\lambda$ display a characteristic knee shape, indicating a smooth spectral phase transition. We remark that the terminology "smooth" phase transition is meaningful in the adiabatic limit $\omega \rightarrow 0$ solely, while when we cycle the system faster, so as $\omega$ becomes comparable to the other characteristic frequencies of the Hamiltonian (such as the separation of adiabatic energies), the knee shape of the curves is continuously spoiled out and there is not any evident sharp transition of the imaginary part of the quasi energies as $\lambda$ is increased; see Fig.3(b).} \\ \begin{figure}[!t] \centering \includegraphics[width=1.0\linewidth]{Fig3.png} \caption{ Behavior of the imaginary part of the quasi energies $\mu_{\pm}$ versus the non-Hermitian parameter $\lambda$ for the cycled $\mathcal{PT}$-symmetric system with Hamiltonian $\mathcal{H}(k)$ given by Eq.(31) for $t_0=0.3$, $t_1=0.5$, $t_2=1$ and for a modulation frequency (a) $\omega=0.02$, and (b) $\omega=0.1$. Open blue circles and red crosses refer to the exact curves, obtained from a numerical computation of quasi energies, and to the approximate curves obtained from the adiabatic analysis. {\color{black} Note that in (a) (slow-cycling limit) the spectral phase transition is smooth around the critical point $\lambda=\bar{\lambda}_c=|t_2-t_1|=0.5$, displaying a characteristic knee shape. In (b) the system is cycled faster and the knee shape of the curves is spoiled out. In both cases the adiabatic theory fails to the predict the correct behavior of the quasi energies near the critical point.} } \end{figure} \section{Wannier-Stark ladder phase transition} The imperfect spectral phase transition, arising from the complex Berry phase in a slowly-cycled two-level system presented in the previous section, finds an interesting illustrative application to the problem of Wannier-Stark ladder formation in non-Hermitian lattices subjected to a {\color{black} weak} external dc field and the transition from periodic to aperiodic Bloch-Zener oscillations recently observed for some models in Ref.\cite{b81}. In this case the Berry phase is also referred to as the Zak phase \cite{b17}, which is the geometric phase acquired during an adiabatic motion of a Bloch particle across the Brillouin zone. \subsection{Model} Let us consider a two-band tight-binding lattice model driven by a dc force $F$. In physical space, the temporal evolution of the single-particle state of the system is described by the Schr\"odinger equation \begin{eqnarray} i \frac{d a_n}{dt} & = & \sum_{l} \rho_{n-l} a_l+ \sum_{l} \sigma_{n-l}b_l-Fna_n \\ i \frac{d b_n}{dt} & = & \sum_{l} \theta_{n-l} a_l+ \sum_{l} \eta_{n-l}b_l-Fnb_n \end{eqnarray} for the amplitudes $a_n$ and $b_n$ in the two sublattices A and B of the $n$-th unit cell of the crystal. In the above equations, {\color{black} the coefficients $\rho_0$ and $\eta_0$ are the on-site energy potentials in the two sublattices A and B, respectively; $\rho_l$ and $\eta_l$ ($l \neq 0$) are the intra-dimer hopping amplitudes; finally, $\sigma_l$ and $\theta_l$ are the inter-dimer hopping amplitudes}. In the absence of the dc force, i.e. for $F=0$, we can assume $a_n(t)=\psi_1(t) \exp(ik n) $ and $b_n(t) = \psi_2(t) \exp(ikn)$, where $k$ is the Bloch wave number that spans the Brillouin zone $0 \leq k \leq 2 \pi$. In this case, from Eqs.(32) and (33) one obtains \begin{equation} i \frac{d}{dt} \left( \begin{array}{c} \psi_1 \\ \psi_2 \end{array} \right)= \mathcal{H}(k) \left( \begin{array}{c} \psi_1 \\ \psi_2 \end{array} \right) \end{equation} where the elements of the $ 2 \times 2 $ Bloch Hamiltonian $\mathcal{H}(k)$ are given by \begin{eqnarray} \mathcal{H}_{11}(k)= \sum_l \rho_l \exp (-ik l) \\ \mathcal{H}_{12}(k)= \sum_l \sigma_l \exp (-ik l) \\ \mathcal{H}_{21}(k)= \sum_l \theta_l \exp (-ik l) \\ \mathcal{H}_{22}(k)= \sum_l \eta_l \exp (-ik l). \end{eqnarray} The Bloch Hamiltonian is $\mathcal{PT}$-symmetric, with $\mathcal{P}=\sigma_x$ and $\mathcal{T}=\mathcal{K}$, provided that \begin{equation} \theta^{*}_{-l}= \sigma_l \; ,\;\; \eta_{-l}^{*}=\rho_l. \end{equation} Such conditions ensure that $\mathcal{H}_{22}(k)=\mathcal{H}^*_{11}(k)$ and $\mathcal{H}_{21}(k)=\mathcal{H}^*_{12}(k)$. In this case, the lattice does not display the non-Hermitian skin effect \cite{skin} and the energy spectrum is absolutely continuous and composed by two energy bands, with the dispersion relation given by Eq.(6). A $\mathcal{PT}$ symmetry breaking phase transition of Bloch bands arises when the non-Hermitian parameter $\lambda$ in the system is increased above the critical value $\bar{\lambda}_c$, alike in the two-level system discussed in Sec.II. \subsection{Wannier-Stark ladders} When the external dc force is applied, i.e. for $F \neq 0$, the energy spectrum becomes pure point and composed by two Wannier-Stark ladders \cite{WS1,WS2}, with the allowed energies given by \begin{equation} E_l=l F \pm \Theta \end{equation} where $l=0, \pm 1, \pm 2, \pm 3,..$ and $\Theta$ describes the energy shift of the two ladders. The corresponding eigenstates are normalizable (localized) with a higher-than-exponential localization.\\ In an Hermitian lattice, the energy shift $\Theta$ is real and the dynamics in the time domain is generally aperiodic and corresponds to a superposition of Bloch oscillations and Zener tunneling between the two bands \cite{WS1,WS2,WS3,WS4,WS5,WS5bis,WS6,WS7}. The dynamics is characterized by two time periods: The first one, $T_1=2 \pi/F$, is determined by the mode spacing of each WS ladder and is related to the Bloch oscillation dynamics, whereas the second one, $T_2= \pi / \Theta$, is determined by the shift of the two interleaved WS ladders.\\ In a non-Hermitian lattice the energy shift $\Theta$ can become complex and, as we show below, in the small-forcing limit $F \rightarrow 0$ it contains the complex Zak phase of the Bloch Hamiltonian $\mathcal{H}(k)$. More precisely, we will show below that $\Theta$ is the quasi energy $\mu_+$ of the Bloch Hamiltonian $\mathcal{H}(k)$, cycled over the Brillouin zone at a frequency $\omega=F$, i.e. with $k=Ft$. This means that the WS energy spectrum undergoes a phase transition as $\lambda$ is increased above $\bar{\lambda}_c$, from real to complex energies, and the phase transition can be either sharp or smooth, depending on whether the imaginary part of the Zak phase for $\lambda <\bar{\lambda}_c$ is vanishing or not.\\ To calculate the WS energy spectrum $E$, let us assume $a_n(t)=\bar{a}_n \exp(-i Et)$, $b_n(t)=\bar{b}_n \exp(-i Et)$ in Eqs.(32-33), and let us introduce the spectral variables \begin{eqnarray} \psi_1(k) & = & \exp(-i E k/F) \sum_n \bar{a}_n \exp(-ikn) \\ \psi_2(k) & = & \exp(-i E k/F) \sum_n \bar{b}_n \exp(-ikn). \end{eqnarray} It readily follows that $\psi_{1,2}(k)$ satisfy the Sturm-Liouville problem \begin{equation} i F \frac{d}{dk} \left( \begin{array}{c} \psi_1 \\ \psi_2 \end{array} \right)= \mathcal{H}(k) \left( \begin{array}{c} \psi_1 \\ \psi_2 \end{array} \right) \end{equation} on the interval $ 0 \leq k \leq 2 \pi$, with the boundary conditions \begin{equation} \psi_{1,2}(2 \pi)=\psi_{1,2}(0) \exp \left( - \frac{2 \pi i E}{F} \right). \end{equation} Once the spectral amplitudes $\psi_{1,2}(k)$ and eigenenergies $E$ have been determined, the eigenvectors $ (\bar{a}_n, \bar{b}_n)$, corresponding to the energy $E$, are determined using the inverse relations \begin{eqnarray} \bar{a}_n & = & \frac{1}{2 \pi} \int_0^{2 \pi} dk \psi_{1}(k) \exp(ikn+iEk/F) \\ \bar{b}_n & = & \frac{1}{2 \pi} \int_0^{2 \pi} dk \psi_{2}(k) \exp(ikn+iEk/F). \end{eqnarray} Interestingly, after letting $k= \omega t$ Eq.(43) indicates that $\psi_{1,2}(k)$ can be viewed as the amplitudes of a two-level $\mathcal{PT}$-symmetric system, with Hamiltonian $\mathcal{H}(k)$, which is slowly cycled in time at the frequency $\omega=F$. This basically corresponds to the fact that in Bloch space the external force introduces a uniform drift of the quasi-momentum $k$ to span the entire Brillouin zone. The Sturm-Liouville problem, defined by Eqs.(43) and (44), can be solved as follows. Let us indicate by $\boldsymbol\psi_+$ and $\boldsymbol\psi_-$ the eigenvectors of the Floquet matrix $\mathcal{R}$, introduced in Sec.II.B, with eigenvalues (quasi energies) $\mu_{\pm}$. Then Eq.(43) is satisfied by letting either \begin{eqnarray} \left( \begin{array}{c} \psi_1(k) \\ \psi_2(k) \end{array} \right)= \mathcal{U} \left( \frac{k}{F}\right) \exp(-i \mathcal{R} k/F) \boldsymbol\psi_+ \nonumber \\ = \exp(-i \mu_+ k/F) \mathcal{U} \left( \frac{k}{R}\right) \boldsymbol\psi_+ \nonumber \end{eqnarray} or \begin{eqnarray} \left( \begin{array}{c} \psi_1(k) \\ \psi_2(k) \end{array} \right)= \mathcal{U} \left( \frac{k}{F}\right) \exp(-i \mathcal{R} k/F) \boldsymbol\psi_- \nonumber \\ = \exp(-i \mu_- k/F) \mathcal{U} \left( \frac{k}{F}\right) \boldsymbol\psi_-. \nonumber \end{eqnarray} Since $\mathcal{U}(0)=\mathcal{U}(2 \pi / F)= \mathcal{I}$ (the $ 2 \times 2$ identity matrix), to satisfy the boundary conditions Eq.(44) one should have \[ \frac{2 \pi}{F} \mu_{\pm}= \frac{2 \pi E}{F}- 2 l \pi \] i.e. \begin{equation} E=lF+\mu_{\pm} \end{equation} where $l=0, \pm 1 , \pm 2, ...$. Equation (47) provides the general form of the Wannier-Stark ladders of allowed energies in terms of the quasi energies $\mu_{\pm}$ of the cycled two-level Bloch Hamiltonian $\mathcal{H}(k)$. It is precisely Eq.(40) with the energy shift parameter $\Theta$ given by $\Theta=\mu_+$.\\ { \color{black} When the external dc force is weak, i.e. in the limit $F \rightarrow 0$, the Bloch wave number $k=Ft$ in the two-level Bloch Hamiltonian $\mathcal{H}(k)$ varies slowly with time, and thus the quasi energies can be approximated by Eq.(23)}. One obtains \begin{equation} E=lF+ \frac{1}{2 \pi} \int_{0}^{2 \pi} dk E_{\pm} (k) + \frac{F}{2 \pi} \gamma_{B_{\pm}} \end{equation} corresponding to the energy shift \begin{equation} \Theta= \mu_+= \frac{1}{2 \pi} \int_{0}^{2 \pi} dk E_{+} (k) + \frac{F}{2 \pi} \gamma_{B_{+}}. \end{equation} \begin{figure}[!t] \centering \includegraphics[width=1.0\linewidth]{Fig4.png} \caption{ Schematic of two binary non-Hermitian lattices displaying (a) perfect, and (b) imperfect Wannier-Stark phase transitions under a dc force. $t_0$, $t_1$ and $t_2$ are Hermitian hopping amplitudes. The non-Hermiticity in the system is provided by the gain and loss terms $\pm \lambda$ in the two sublattices A and B. The Bloch Hamiltonian of the two lattices is given by Eq.(30) for model (a), and by Eq.(31) for model (b).} \end{figure} Therefore, {\color{black} under a weak external driving} the Wannier-Stark energy spectrum undergoes a phase transition at $\lambda=\bar{\lambda}_c$, which is either sharp or smooth depending on whether the imaginary part of the Zak phase $\gamma_{B{_+}}$ is vanishing or not when $\lambda< \bar{\lambda}_c$. We mention that, contrary to other non-Hermitian lattice models where the spectral ($\mathcal{PT}$ symmetry breaking) phase transition coincides with a localization/delocalization phase transition \cite{uffa1,uffa1bis,uffa2}, in the Wannier-Stark ladder problem the spectral phase transition does not correspond to a localization/delocalization phase transition because the eigenstates of the Wannier-Stark Hamiltonian are always localized, for both $\lambda < \bar{\lambda}_c$ and $\lambda \geq \bar{\lambda}_c$. This very general result follows from the fact that the spectral amplitudes $\psi_{1,2}(k) \exp(i E k/F)$, with $\psi_{1,2}(k)$ solutions to the Sturm-Liouville problem [Eqs.(43,44)], are periodic and continuously differentiable functions of $k$ and thus their Fourier coefficients $\bar{a}_n$, $\bar{b}_n$ decay as $n \rightarrow \pm \infty$ at least like $ \sim 1/n$, regardless of the value of $\lambda$.\\ In a non-Hermitian lattice below the Wannier-Stark phase transition point, i.e. for $\lambda < \bar{\lambda}_c$, the dynamical signature of a complex Zak phase can be probed looking at the temporal behavior of Bloch-Zener oscillations \cite{b81}. When the imaginary part of the Zak phase is vanishing, the temporal dynamics is rather generally aperiodic and characterized by the two periods $T_1$ and $T_2$, like in an ordinary Hermitian lattice under a dc field: only accidentally the dynamics can be periodic. On the other hand, when the imaginary part of the complex Zak phase does not vanish, after an initial transient the dynamics becomes periodic with period $T_1$. In fact, a rather arbitrary excitation of the system at initial time $t=0$ can be decomposed as a superposition of localized Wannier-Stark eigenstates belonging to the two ladders, and the dynamics at successive times is governed by the interference of such localized eigenstates. The localized Wannier-Stark eigenstates in one ladder, excited by the initial condition, decay in time with a damping rate $ \sim F {\rm{Im}}( \gamma_{B_+} )$, while the eigenstates in the other ladder are amplified in time with an amplification rate $ \sim F {\rm{Im}} (\gamma_{B_+})$. Therefore, after a transient time of order $ \sim 1/ F {\rm{Im}} (\gamma_{B_+})$ only the Wannier-Stark eigenstates in the former ladder survive and the dynamics become periodic with the period $T_1$ \cite{b81}. As illustrative examples, let us consider the binary lattices depicted in Figs.4(a) and 4(b). The non-Hermiticity in the lattices is introduced by assuming energy gain and loss terms $\pm \lambda$ in the two sub lattices A and B. The binary lattice of Fig.4(a) was introduced in a previous work \cite{b74} and its Bloch Hamiltonian $\mathcal{H}(k)$ is given by Eq.(30), previously introduced in Sec.II.C. Since $( d \varphi / dk) \equiv 0$, the Wannier-Stark ladder phase transition in this model is sharp. The model shown in Fig.4(b) is a non-Hermitian extension of the Rice-Mele model \cite{b54basta1} and its Bloch Hamiltonian is given by Eq.(31). For this model, the spectral phase transition of the Wannier-Stark energies is imperfect. We emphasize that our analysis is very general and could be applied to a generic $\mathcal{PT}$-symmetric binary lattice, also displaying long-range hopping. \section{Conclusions and discussion} In many classical and quantum systems described by an effective non-Hermitian Hamiltonian, where energy and particles can be exchanged with external reservoirs, the energies of the Hamiltonian are rather generally complex. However, in certain classes of non-Hermitian systems the energy spectrum can remain entirely real in spite of non-Hermiticity. A paradigmatic example is provided by systems possessing parity-time symmetry, where the energy spectrum remains entirely real in the unbroken $\mathcal{PT}$ phase. When the strength of non-Hermiticity in the system is increased, a spectral phase transition to complex energies is usually observed, corresponding to the unbroken $\mathcal{PT}$ phase. Such spectral phase transitions are universally sharp. In this work we considered periodically and slowly cycled non-Hermitian models possessing instantaneous $\mathcal{PT}$ symmetry and showed that the phase transition can remain exact (sharp) or become imperfect (smooth) when the strength of non-Hermiticity in the system is increased above a critical value. The imperfect nature of the phase transition in the latter case is universally ascribable to a non-vanishing imaginary part of the complex Berry phase associated to the cyclic adiabatic evolution of the system. This remarkable phenomenon has been illustrated by considering a rather general class of $\mathcal{PT}$-symmetric two-level systems, for which a rigorous adiabatic analysis both below and above the phase transition point has been developed. The results have been applied to describe the spectral phase transitions of the Wannier-Stark ladders in a broad class of $\mathcal{PT}$-symmetric two-band non-Hermitian lattices subjected to an external dc field, {\color{black} however our analysis is expected to hold for more general multi-band systems. In fact, under the adiabatic conditions and assuming no state flip after one adiabatic cycle, the form of quasi energies can be given in terms of dynamic and geometric (Zak) phases, and the complex or real nature of the latter defines the smooth or sharp nature of the spectral phase transitions in the slow-cycling regime.} Our results provide fresh and novel insights into phase transitions of open quantum or classical systems, providing important examples of smooth phase transitions in non-Hermitian physics and unraveling the main role played by the non-Hermitian Berry phase. \acknowledgments S.L. acknowledges the Spanish State Research Agency, through the Severo Ochoa and Maria de Maeztu Program for Centers and Units of Excellence in R\&D (Grant No. MDM-2017-0711). L.F. acknowledges the support from National Science Foundation (NSF) (ECCS-1846766).
\section{Introduction} \label{sec:intro} Multi-armed bandit (MAB) problem has been increasingly recognized as a fundamental and powerful framework in decision theory, where an agent's objective is to make a series of decisions to pull an arm of a $K$ slot machine in order to maximize the total reward. Each of the arms is associated with a fixed but unknown probability distribution \cite{auer2002finite,lai1985asymptotically}. An enormous literature has accumulated over the past decades on the MAB problem, such as clinical trials and drug testing \cite{bastani2020online,durand2018contextual}, recommendation system and online advertising \cite{bouneffouf2012contextual,bouneffouf2014contextual,nguyen2021edge,tang2013automatic,zhou2017large}, information retrieval \cite{bouneffouf2013contextual,losada2017multi}, and finance \cite{huo2017risk, misra2019dynamic,mueller2019low,shen2015portfolio}. From a theoretical perspective, the MAB problem was first studied in the seminal work of \cite{robbins1952some} and followed by a vast line of work to study in regret minimization \cite{agrawal2013thompson,auer2002using, auer2002finite,chapelle2011empirical,chu2011contextual,dudik2011efficient,langford2007epoch,li2010contextual,srinivas2009gaussian,valko2013finite} and pure exploration \cite{chen2017towards,garivier2016optimal,locatelli2016optimal,russo2016simple}. In this paper, we investigate the convex hull feasibility (CHF) problem in a pure exploration (\emph{aka} active sequential multiple composite testing) setting, where a learner sequentially performs experiments in a stochastic multi-armed bandit environment to identify if a given point lies in the convex hull of means of $K$ arms as efficiently and accurately as possible. In particular, we are interested in the minimum expected number of samples required to identify the convex hull feasibility with high probability (at least $1-\delta$), without considering a reward/cost structure. The non-stochastic version of the convex hull feasibility problem, also known as the \emph{convex hull relaxation} (CHR) problem, has attracted significant attention in different scientific areas and proven its crucial applications in image processing \cite{jayaram2016convex,yang1999image}, robot motion planning \cite{lengyel1990real,streinu2000combinatorial} and pattern recognition \cite{katzin2018convex,roy2008convex}. Notably, \cite{kalantari2019equivalence} shows the CHR problem is equivalent to the semidefinite programming feasibility problem. Nevertheless, there is almost no literature on the {\em stochastic} convex hull feasibility problem where we have to sample in order to locate the positions of the means. Recently, \cite{niss2022achieving} provided the first theoretical bounds for the CHF problem. Unfortunately, their results have significant gaps between the upper and lower complexity bounds. \cite{katz2018feasible} addressed a similar problem to determine which of the arms have means belonging to a given polyhedron in the fixed budget setting. To the best of our knowledge, this fundamental primitive of developing the complexity bounds and an (asymptotically) optimal algorithm for the CHF problem in the fixed confidence setting remains open in the literature before this work. To tackle the aforementioned problem and give a complete solution in a one-dimensional case, we introduce Thompson-CHF, a Thompson-Sampling-based algorithm that has asymptotic sample complexity matching the information-theoretic lower bound proved in \cite{garivier2016optimal}. The sample complexity lower bound is modeled as a function of the characteristic time \cite{garivier2016optimal}, which can be captured by the value of a zero-sum pure exploration game between two players \cite{chernoff1959sequential,degenne2019non}. As discussed in Section \ref{sec:lb}, any successful pure exploration player needs to solve this pure exploration game, and therefore, the intuition behind the game is essential to our algorithm design. The design of the strategy to match the lower bound is based on the individual confidence interval for each of the $K$ arms, so that any algorithm using this stopping time can ensure an output of a correct decision with high probability (at least $1-\delta$) no matter what sampling rule the algorithm applies. We remark that \cite{kaufmann2018sequential} first propose an active sequential testing procedure to study the lowest mean of a finite set of distributions, and provide a conditional modification of the popular heuristic Thompson Sampling (names as \emph{Murphy Sampling}) to tackle the limitations of the Lower Confidence Bound algorithm (LCB) and standard Thompson Sampling with different settings. However, {\em a major challenge in extending Thompson Sampling to our CHF problem is to study the largest and lowest mean simultaneously}. To tackle this challenge, we borrow a two-arm sampling construction proposed in the Best-Arm Identification setting. \cite{russo2016simple} pointed out that Thompson Sampling can have a poor asymptotic performance and this defect can be improved by a top-two arm sampling modification to prevent the algorithm from sampling the arm of interest too frequently. This modification automatically controls the measurement effort of each arm and ensures that the long-term asymptotic behavior is closely linked to the optimal allocation of the algorithm. {\em To the best of our knowledge, conditional Thompson sampling and two-arm sampling have never been combined before}. Our novel sampling rule is independent of the confidence parameter $\delta$ and ensures the sampled proportion of each arm asymptotically matches the estimated-best allocation design derived by the pure exploration game. Therefore, it automatically adapts exploration for both feasible and infeasible cases in the one-dimensional CHF problem. We provide a theoretical analysis of the asymptotic optimality and extend it to two more important settings: interval CHF problem (identifying if an interval $(\gamma^-,\gamma^+)$ intersects with the convex hull of the means of $K$ arms) and the Gaussian bandit setting with unknown variance. The former extension generalizes the CHF problem and reproduces the state-of-art results for thresholding bandit \cite{locatelli2016optimal} and sequential test for lowest mean \cite{kaufmann2018sequential}. Moreover, in the multi-armed bandit literature, very few works investigated the Gaussian rewards distribution with unknown variance and were only limited to the Best-Arm Identification problem \cite{jourdan2022dealing}. To highlight and summarize our results, our contribution in this work is threefold: \textbullet \ \ We prove a tight lower bound on the sample complexity of the one-dimensional convex hull feasibility (CHF) problem and reveal an oracle allocation of different arms for algorithm design. \textbullet \ \ We introduce a novel Thompson-Sampling-based algorithm that automatically adapts the right exploration and oracle allocation for both feasible and infeasible cases and we rigorously prove its asymptotic optimality. \textbullet \ \ Our final contribution is to extend the algorithm to two more settings: the one-dimensional interval CHF problem and Gaussian bandits with unknown variance. We present the sample complexity bounds and an analogous asymptotically optimal algorithm. Specifically, the one-dimensional interval CHF problem generalizes some fundamental multi-armed bandit problems in the literature and the tight complexity bound proved in this paper matches their state-of-art bounds. \section{Related Work} \label{sec:related} In this section, we briefly discuss some works and applications that are closely related to the convex hull feasibility problem in the literature. \textbf{Thresholding Bandits:} One closely related previous work is a popular combinatorial pure exploration bandit problem known as the thresholding bandit problem where the learner's objective is to find the set of arms whose means are above a threshold. It was first introduced in \cite{chen2014combinatorial} and has been extensively studied in both fixed-confidence and fixed-budget settings \cite{chen2014combinatorial,garivier2017thresholding,kano2019good,locatelli2016optimal,tao2019thresholding}. Compared to the thresholding bandit problem, the convex hull feasibility problem only requires a boolean decision and needs the existence for both arms above and below the threshold to guarantee feasibility. A naive approach using the thresholding bandit problem to solve the CHF problem is to find the set of arms with means above and below the threshold by applying a thresholding bandit algorithm twice, and use the results to build a conclusion on if the threshold lies in the convex hull of the set of the arm means. Compared to the proposed Thompson-CHF algorithm, this two-step procedure is sub-optimal and expends unnecessary samples to determine the true sets of arms with means above and below the threshold. \textbf{Probabilistic Hyperplane Separability:} The probabilistic hyperplane separability problem \cite{yan2014probabilistic,fink2017hyperplane,sheikhi2017separability} in the field of computational geometry and theoretical computer science shares significant similarities with the convex hull feasibility problem studied in this paper. In contrast with the stochastic setting that sequentially samples from the arms with means in a $K$ dimensional space, the probabilistic hyperplane separability problem concerns more about data geometric uncertainty and imprecision due to environmental factors, device and hardware limitations, and data privacy issues. The practical objectives of the probabilistic hyperplane separability problem also exhibit limited generalization to higher dimensions, however, the similarities and connections between the problems may inspire future research. \textbf{Fair Sampling and Fair Active Learning:} A recent series of works on fairness sampling and fair active learning \cite{abernethy2020adaptive,anahideh2022fair,nargesian2021tailoring} share similar frameworks with the fair data sampling procedure that is related to the CHF problem. As discussed in \cite{niss2022achieving}, the main challenge of fair data sampling is to collect data of desired distribution requirements, therefore it reveals an appropriate representation of majority and minority groups in the data. \cite{anahideh2022fair} propose a fair active learning framework to balance the trade-off between model accuracy and fairness, in order to avoid discrimination in machine learning models. \cite{nargesian2021tailoring} develop an exploration-exploitation strategy with a reward function to tackle the circumstances when the underlying data distribution is unknown. The reward function is carefully chosen to capture the approximations of group distributions in the data source, therefore the reward is high if data is sampled from a minority group and vice versa. \section{Problem Setup and Formulation} \label{sec:defs} We define the problem of efficiently and accurately identifying if a given point lies in (or if a given interval intersects with, respectively) the convex hull of a finite set of $K$ probability distributions $\nu_1,\cdots, \nu_K$ based on their stochastic sequential samples as the $K$-dimensional convex hull feasibility ($K$-$dim$ CHF) problem. In this paper, we restrict our attention to the one-dimensional setting where the probability distributions are in the canonical one-dimensional exponential family. In the canonical one-dimensional exponential family, the marginal distribution of a value $x$ given an unknown parameter $\theta \in \mathbb R$ takes the following form: \[ P(x|\theta) = h(x) \exp\{ \eta(x)\theta-A(\theta) \}, \] where $h(x)$, $\eta(x)$ and $A(\theta)$ are known functions. The exponential family includes many of the most commonly used distributions in different scientific subjects, including Bernoulli, Poisson, exponential, Gaussian, gamma, beta, Chi-squared, etc. Throughout the paper, we denote by $\boldsymbol{\mu}=(\mu_1,\cdots,\mu_K)$ the vector of unknown \emph{true} means of the distributions $\nu_1,\cdots,\nu_K$, and $\boldsymbol \lambda$ will be used as possible alternatives of the mean vector. The Kullback-Leibler divergence is a standard measure of how one probability distribution $P$ differs from another $Q$ with the form $\normalfont\text{KL}(P,Q)=\sum_x P(x) \log(P(x)/Q(x))$. For the canonical one-dimensional exponential family, it induces a bijection between the natural parameter and the mean parameter, and we define the Kullback-Leibler divergence of two distributions with means $\mu_1$ and $\mu_2$ as a function $d:(\mu_1, \mu_2) \rightarrow \mathbb R^+$. Let \[ \text{Conv}(\boldsymbol{\mu}) = \text{Conv}(\mu_1,\cdots,\mu_K) \] denote the convex hull of the mean vector, which is the smallest convex set that contains all the means $\mu_1,\cdots,\mu_K$. At each time $t=1,2,\cdots$, a decision maker choose one arm $A_t \in \{1, \cdots, K\}$ and independently draw a reward from distribution $X_{t,A_t} \sim \nu_{A_t}$. Let $\mathcal F_t$ denote the sigma algebra generated by $(A_1,X_{1,A_1},\cdots,A_t, X_{t,A_t})$. We aim to design a sequential hypothesis testing procedure that consists of a $\mathcal F_{t-1}$-measurable \emph{sampling policy} $\pi_t$, a \emph{stopping rule} $\tau$ with respect to $\mathcal F_t$, and a $\mathcal F_{\tau}$-measurable \emph{decision rule} $I_{\bm \pi}(\bm\mu) \in \{\text{feasible}, \text{infeasible}\}$. We now state the formal definition of feasible and infeasible cases. \begin{definition} (feasibility and infeasibility) Given $\boldsymbol{\mu}=(\mu_1,\cdots,\mu_K)$, where $\mu_i \in \mathbb R^d$ for $i=1,\cdots,K$. For any set $S$, the problem defined above is $S$-feasible if the set $S \cap \text{Conv}(\boldsymbol{\mu}) \neq \emptyset$, otherwise, the problem is $S$-infeasible. When the set only contains a single element $S=\{\gamma\}$, the problem is simply called $\gamma$-feasible and $\gamma$-infeasible, respectively. \end{definition} Given a threshold $\gamma \in \mathbb R$, our objective is to identify whether the unknown mean vector $\boldsymbol \mu$ is $\gamma$-feasible in the one-dimensional case, which is equivalently to determine if $\gamma$ lies in the closed interval between the smallest mean reward $I_*(\boldsymbol{\mu})=\operatorname{argmin}_{1\le k \le K} \mu_i$ and the largest mean reward $I^*(\boldsymbol{\mu})= \operatorname{argmax}_{1\le k \le K} \mu_i$ based on the sequential observations while minimizing the expected stopping time $\tau$ and maximizing the probability to correctly identify the result. For simplicity, we assume the threshold $\gamma$ (and the extreme points of the set $S$, respectively) does not equal $\mu_i$ for $i=1,\cdots, K$. This aims to avoid infinite samples to distinguish any means of the distributions that are too close to the threshold. This assumption can be easily relaxed by introducing a ``precision'' term $\epsilon$ to identify an $\epsilon$-optimal design instead \cite{locatelli2016optimal,russo2016simple}. Additionally, we further assume the extreme points (or the vertices) of the convex hull $\text{Conv}(\boldsymbol{\mu})$ are unique. In the literature, two distinct settings have been extensively studied. In the \emph{fixed-confidence setting}, given a fixed confidence parameter $\delta \in (0,1)$, the forecaster aims for a strategy that achieves the confidence $\delta$ about the quality of the decision rule while minimizing the sample needed, and in the \emph{fixed-budget setting}, the number of exploration rounds is fixed, and the forecaster tries to maximize the probability of making the right decision. We will focus on the \emph{fixed-confidence setting} in this paper and introduce the $\delta$-correct strategy. \begin{definition} ($\delta$-correctness) Let $\mathcal{D}$ be a set of distributions on $\mathbb R^d$. Given $\delta \in (0,1)$, we call an identification strategy is $\delta$-correct on the problem class $\boldsymbol \mu \in \mathcal{D}^K$ if with probability at least $1-\delta$, the strategy returns the correct underlying case in a finite expected stopping time, i.e., $\mathbb P(\mathbb E[\tau] \le \infty)=1$, and when $\bm \mu$ is feasible, $ \mathbb P(I(\pi)=\text{feasible}) \ge 1-\delta, $ otherwise $ \mathbb P(I(\pi)=\text{infeasible}) \ge 1-\delta. $ \end{definition} Before continuing, we pause to introduce some further notations here. We let $N_a(t) = \sum_{s=1}^{t} \mathbbm{1}\{A_s=a\}$ be the number of selections of arm $a$ up to round $t$, and $S_a(t)=\sum_{s=1}^{t}X_s \mathbbm{1}\{A_s=a\}$ be the sum of the gathered observations from that arm and $\hat{\mu}_a(t)=S_a(t)/N_a(t)$ be their empirical mean. For all $1 \le i \le K$ and $n \in \mathbb N^+$. \section{A General Lower Bound} \label{sec:lb} In this section, we extend the general information-theoretical sample complexity lower bound proved in \cite{garivier2016optimal} to work for the one-dimensional convex hull feasibility problem. Define $\text{Alt}(\boldsymbol{\mu}) = \{\boldsymbol{\lambda}| I_\pi(\boldsymbol{\lambda}) \neq I_\pi(\boldsymbol{\mu}) \}$ to be the set of multi-armed bandit models where the identification result is different from that in $\boldsymbol{\mu}$, and $\Delta=\{\boldsymbol w=(w_1,\cdots,w_K) \in R^K_+|w_1+\cdots+w_K=1\}$ is a probability simplex of dimension $K$. The following bound was proved by \cite{garivier2016optimal} that \[ \mathbb{E}_{\boldsymbol{\mu}}[\tau] \ge T^*(\boldsymbol{\mu}) \text{kl}(\delta,1-\delta), \] where $\text{kl}(x,y)=x\log(\frac{x}{y})+(1-x)\log(\frac{1-x}{1-y})$ and \[ T^*(\boldsymbol{\mu})^{-1}=\sup_{\boldsymbol{w}\in \Delta} \inf_{\boldsymbol{\lambda} \in \text{Alt}(\boldsymbol{\mu})} \sum_a w_a d(\mu_a,\lambda_a). \] Note that $\text{kl}(\delta,1-\delta) \sim \log(1/\delta)$ as $\delta \rightarrow 0$, the lower bound above directly implies $ \liminf_{\delta \rightarrow 0} \frac{\mathbb{E}_{\boldsymbol{\mu}}[\tau]}{\log(1/\delta)} \ge T^*(\boldsymbol{\mu}). $ This max-min problem was first discussed in the seminal work of \cite{chernoff1959sequential}, and the value of $T^*(\boldsymbol{\mu})^{-1}$ can be viewed as the value of a zero-sum simultaneous-move pure exploration game between two players. The player SUP aims to choose an optimal proportion of allocations $\boldsymbol w$ to as a mixed strategy, and the adversary player INF tries to choose the worst-case alternative arm means that is hard to distinguish from the underlying truth to mislead SUP to an incorrect answer. This general information-theoretic bound was established to analyze the sample complexity of the Best-Arm Identification problem \cite{garivier2016optimal}, and was studied in different settings \cite{degenne2019non,degenne2020gamification} along with its popular variant that tackles pure exploration bandit problems with multiple correct answers \cite{degenne2019pure}. To match this general lower bound, the sampling proportion $\mathbb{E}[N_{\tau_\delta}]/\mathbb{E}_{\bm \mu}[\tau_\delta]$ must converge to the minimizer $\boldsymbol{w}^*\in \Delta$ of the pure exploration game as $\delta \rightarrow 0$. This intuition inspires works on different sampling rules and their corresponding threshold functions $\beta(t,\delta)$ to ensure correct recommendation with high probability (at least $1-\delta$) \cite{degenne2019non,kaufmann2021mixture}, and novel sampling rules to match the lower bound $\bm N(t)/t \rightarrow \boldsymbol{w}^*$ \cite{kaufmann2018sequential}. With these considerations in mind, we can establish the sample complexity bound and the asymptotically optimal algorithm for the CHF problem. Specifically, following \cite{degenne2020gamification}, we say that a $\delta$-correct algorithm is asymptotically optimal if for all $\bm \mu$, $\limsup_{\delta \rightarrow 0}\frac{\mathbb E_{\bm \mu}[\tau]}{\log(1/\delta)} \le T^*(\bm \mu)$. Without loss of generality, in the one-dimensional CHF problem, we assume that $\mu_1 < \mu_2 \le \mu_3 \le \cdots \le \mu_{K-1} < \mu_K$. The strict inequalities come from the aforementioned assumption of unique extreme points of $\text{Conv}\{\boldsymbol{\mu}\}$. We have the following lower bound of any $\delta$-correct algorithm. The proof is provided in the Section~\ref{sec:appendix}. \begin{theorem}\label{thm:oned} Given a threshold $\gamma \in \mathbb R$, the expected sample complexity $\mathbb{E}_{\boldsymbol{\mu}}[\tau]$ of any $\delta$-correct 1-dimensional CHF strategy satisfies \[ \liminf_{\delta \rightarrow 0} \frac{\mathbb{E}_{\boldsymbol{\mu}}[\tau]}{\log(1/\delta)} \ge T^*(\boldsymbol{\mu}) , \] where \[ T^*(\boldsymbol{\mu}) = \begin{cases} \frac{1}{d(\mu_1,\gamma)}+\frac{1}{d(\mu_K,\gamma)} & \gamma \in \text{Conv}\{\boldsymbol{\mu}\} \\ \sum_{1 \le i \le K} \frac{1}{d(\mu_i,\gamma)} & \gamma \notin \text{Conv}\{\boldsymbol{\mu}\} \end{cases}, \] and \[ w^*_a(\boldsymbol{\mu}) = \begin{cases} \frac{\frac{1}{d(\mu_a,\gamma)}}{\sum_{i \in \{1,K\}} \frac{1}{d(\mu_i,\gamma)}} \mathbbm{1}\{a \in \{1,K\}\} & \gamma \in \text{Conv}\{\boldsymbol{\mu}\} \\ \frac{ \frac{1}{d(\mu_a,\gamma)} }{\sum_{1 \le i \le K} \frac{1}{d(\mu_i,\gamma)} } & \gamma \notin \text{Conv}\{\boldsymbol{\mu}\} \end{cases}. \] \end{theorem} Surprisingly, the characteristic time and oracle weights that match the general information-theoretic sample complexity show completely different behaviors in feasible and infeasible cases. In the feasible case where $\tau$ lies in the convex hull $\text{Conv}(\boldsymbol{\mu})$, the algorithm should only sample the arms with minimum and maximum means, while in the infeasible case, the strategy should sample every single arm with specific fraction inversely proportional to the Kullback-Leibler divergence between its mean and the threshold $\gamma$. We remark that the previous work on sequentially testing and learning the lowest mean \cite{kaufmann2018sequential} demonstrates a similar phenomenon. In essence, this commonality arises from the fact that the one-dimensional CHF problem generalizes the problem of learning the smallest mean (see section \ref{sec:connections} for details). \section{Algorithm} \label{sec:alg} In this section, we introduce an asymptotically optimal Thompson-Sampling-based algorithm for the one-dimensional CHF problem for a given threshold $\gamma \in \mathbb R$. \subsection{Stopping Rule} From a learning point of view, the question of stopping at time $t$ is essentially a classical statistical problem: does the past collected information allows us to assess that the threshold $\gamma$ lies in or outside the convex hull set $\text{Conv}(\boldsymbol{\mu})$ with risk at most $\delta$? Inspired by \cite{kaufmann2018sequential}, a natural design of the stopping rule is to compare separately each arm to the threshold $\gamma$ and stop when either one arm lies significantly below $\gamma$ and one arm lies significantly above $\gamma$, or all arms lie significantly below $\gamma$, or all arms lie significantly above $\gamma$. We denote $d^+(u,v)=d(u,v)\mathbbm{1}\{u\le v\}$ and $d^-(u,v)=d(u,v)\mathbbm{1}\{u \ge v\}$. We define the first stopping time $\tau_1$ when all arms lie significantly above $\gamma$: \[ \tau_1=\inf \{t\in N^-| \forall a, N_a(t)d^-(\hat{\mu}_a(t),\gamma) \ge \text{Tresh}(\delta,N_a(t)) \}. \] Similarly, we define the second stopping time $\tau_2$ when all arms lie significantly below $\gamma$: \[ \tau_2=\inf \{t\in N^+| \forall a, N_a(t)d^+(\hat{\mu}_a(t),\gamma) \ge \text{Tresh}(\delta,N_a(t)) \}. \] The third stopping time is when one arm is significantly below $\gamma$ and another arm lies significantly above $\gamma$: \begin{equation*}\label{eq:stoppingtime31} \begin{aligned} \tau_3=&\inf \{t\in N^+| \exists a_1,a_2, \text{ such that } \\ &N_{a_1}(t)d^+(\hat{\mu}_{a_1}(t),\gamma) \ge \text{Tresh}(\delta,N_{a_1}(t)) \text{ and }\\ &N_{a_2}(t)d^-(\hat{\mu}_{a_2}(t),\gamma) \ge \text{Tresh}(\delta,N_{a_2}(t)) \}. \end{aligned} \end{equation*} Here $\text{Tresh}(\delta,N_a(t))$ is a threshold function to be specified later. Our algorithm stops if any of the three cases happen, i.e., it stops at $\tau=\min\{\tau_1,\tau_2,\tau_3\}$ and returns feasibility or infeasibility based on the case detected. The stopping rule and decision rule ensure that, when the threshold function $\text{Tresh}(\delta,N_a(t))$ is carefully designed and the sampling rule guarantees the sampling allocation proportion converges to the solution $\boldsymbol w$ of the max-min problem, the algorithm Thompson-CHF is $\delta$-correct. \begin{lemma}\label{lem:stoppingrule1} Let $\tau_\delta$ be a stopping rule satisfying $\tau_\delta \leq \tau$. $\normalfont \text{ Tresh}(\delta,r)$ is non-decreasing in $r$ and the following holds: \begin{equation*}\label{eq:stop1} \begin{aligned} \forall r \geq r_0, \ \normalfont\text{Tresh}(\delta, r) \leq \ln(r/\delta) + o(\ln(1/\delta)), \end{aligned} \end{equation*} then for any $\boldsymbol{\bm \mu}$ and an anytime sampling strategy such that $\frac{\boldsymbol{N}_t}{t} \to w^*(\boldsymbol{\mu})$, we have $\limsup_{\delta \rightarrow 0}\frac{\tau_\delta}{\ln(1/\delta)} \le T^*(\mu)$ almost surely, and \hyperref[algo:TSCHF]{Thompson-CHF} is $\delta$-correct for the CHF problem. \end{lemma} \subsection{Sampling Rule} Our contribution is a sampling rule that extends and generalizes a variant of Thompson sampling (called \emph{Murphy Sampling}) introduced in \cite{kaufmann2018sequential} to the one-dimensional CHF problem that ensures the algorithm allocates the optimal proportion to each arm asymptotically, therefore guarantees the asymptotical optimality by Lemma~\ref{lem:stoppingrule1}. The sampling rule can automatically adapt the asymptotic optimality for both feasible cases and infeasible cases. We denote by $\Pi_t = \mathbb{P}(\cdot|\mathcal F_t)$ the posterior distribution of the mean parameters after $t$ rounds. Inspired by \cite{kaufmann2018sequential} that introduces \emph{Murphy Sampling} after Murphy's Law, as it performs some conditioning to the ``worst event'' to learn the smallest mean, we introduce \hyperref[algo:TSCHF]{Thompson-CHF} (Algorithm~\ref{algo:TSCHF}) to tackle the one-dimensional CHF problem. \begin{algorithm}[ht] \caption{Thompson-CHF} \label{algo:TSCHF} \begin{algorithmic} \STATE {\bfseries Input:} probability distributions with mean vector $\bm \mu$, stopping rule $\tau$ with threshold function $\text{Tresh}(\delta,t)$, risk $\delta$, threshold $\gamma$, Bernoulli distribution parameter $\beta_t$. \STATE {\bfseries Output:} decision rule $I_\pi(\bm \mu) \in \{\text{feasible},\text{infeasible}\}$ \FOR {$t=1,\cdots $} \IF{$\text{stopping rule } \tau \text{ holds}$} \IF{$\tau=\tau_3$} \STATE \textbf{return} $I_\pi(\bm \mu)=\{\text{feasible}\}$ \ELSE \STATE \textbf{return} $I_\pi(\bm \mu)=\{\text{infeasible}\}$ \ENDIF \ENDIF \STATE Sample $\bm \theta_t =\left(\theta_{t,1},\cdots,\theta_{t,K}\right) \sim \Pi_{t-1}(\cdot|\bm \mu\text{ feasible})$. \STATE Sample $B \sim \text{Bernoulli}\left( \beta_t \right)$ \IF{$B=1$} \STATE Play arm $A_t=\operatorname{argmin}(\bm \theta_t)$ \ELSE \STATE Play arm $A_t=\operatorname{argmax}(\bm \theta_t)$ \ENDIF \ENDFOR \end{algorithmic} \end{algorithm} Note that the top-two Thompson Sampling conditions the standard Thompson Sampling on the event $\operatorname{argmax} \bm \mu \neq \operatorname{argmax}\bm \theta_t$ with pre-specified probability $\beta$ \cite{russo2016simple}, and the Murphy Sampling conditions on $\min(\bm \mu)$ below the threshold \cite{kaufmann2018sequential}. In contrast, \hyperref[algo:TSCHF]{Thompson-CHF} conditions on the ``feasibility'' of the underlying mean vector $\bm \mu$ and in each round $t$, the algorithm proceeds to pull an arm in the sample $\bm \theta_t=\left(\theta_{t,1},\cdots,\theta_{t,K}\right)$ with largest or smallest mean based on the previous information $\mathcal F_{t-1}$. The next theorem guarantees that following this sampling procedure, the algorithm \hyperref[algo:TSCHF]{Thompson-CHF} can ensure the sampling proportion of each arm converges to the optimal allocation $\bm w^*$ asymptotically, regardless of the position of $\gamma$ with respect to the convex hull $\text{Conv}\{\bm \mu\}$. Therefore, we can conclude that the algorithm \hyperref[algo:TSCHF]{Thompson-CHF} is asymptotically optimal in sample complexity. \begin{theorem}\label{thm:TS.convergence} The algorithm \hyperref[algo:TSCHF]{Thompson-CHF} ensures that $\frac{\bm{N}_t}{t} \to w^*(\bm \mu)$ almost surely \ for any $\bm \mu$ if \[ \beta_t = \frac{d\left(\frac{1}{t} \sum_{r=1}^{t} \min\bm \theta_r,\gamma\right)^{-1}}{ d\left(\frac{1}{t} \sum_{r=1}^{t}\min\bm \theta_r,\gamma\right)^{-1}+d\left(\frac{1}{t} \sum_{r=1}^{t}\max\bm \theta_r,\gamma\right)^{-1}}. \] \end{theorem} We provide a proof sketch of Theorem~\ref{thm:TS.convergence}. We let $\psi_a(t)$ be the posterior probability of sampling arm $a$ at time $t$, i.e. \[ \psi_a(t) = \mathbb P(A_t=a| \mathcal F_{t-1}), \] and define $\Psi_a(t)$ and $\bar{\psi}_a(t)$ as the summation and mean of $\psi_a(t)$ over time $t$. For the feasible case, the first step of the sampling rule performs the same as Thompson Sampling, and the probability of drawing the first arm at time $t$ can be written as a weighted sum (with weights $\beta_t$ and $1-\beta_t$) of the posterior probabilities that the first sample in $\bm \theta_t$ is the maximum and minimum. The asymptotic convergence of sample proportions $N_1(t)/t \rightarrow w_1^*(\bm \mu)$ can be derived by the combination of facts that the former probability converges to 1 and $\beta_t$ converges to $w_1^*(\bm \mu)$. The proof of $N_K(t)/t \rightarrow w_K^*(\bm \mu)$ is symmetric. For the infeasible case when the lowest mean is larger than threshold $\gamma$ or the largest mean is smaller than $\gamma$, the core idea is based on the following proposition. \begin{proposition}\label{thm:prop3}(Simplified version of Lemma 12 of \cite{russo2016simple}) Consider any sampling rule, if for any arm $a \in [K]$ and all $c>0$, \[ \sum_{t} \psi_a(t) \mathbbm{1}\{\bar{\psi}_a(t) \ge w_a^*+c\} < \infty, \] then $\bar{\psi}(t) \rightarrow \bm w^*$. \end{proposition} The above result gives a sufficient condition in which $\bar{\psi}(t)$ converges to the optimal allocation $\bm w^*$, and implies that for any arm $a$ that meets $\bar{\psi}_a(t) \ge w_a^*+c$, the arm has been over-allocated compared to the optimal proportion $w_a^*$. Hence the total measurements the arm gets must be bounded in order to reduce towards $w^*_a$ for optimality. The rest of the proof is to establish the condition holds for \hyperref[algo:TSCHF]{Thompson-CHF} algorithm. We develop the conclusion by showing that, if arm $a$ has been over-allocated compared to $w_a^*$, then $\Pi_t(\theta_{t,a}<\gamma<\theta_{t,b})$ is exponentially small compared to $\max_{a,b}\Pi_t(\theta_{t,a}<\gamma<\theta_{t,b})$. Based on the known result, for any open set $\tilde{\Theta} \subset \Theta$, the posterior concentrates at rate $\Pi_t(\tilde{\Theta}) \doteq \exp\left(-t \min_{\bm \lambda \in \tilde{\Theta}}\sum_a \bar{\psi}_a(t)d(\mu_a,\lambda_a)\right)$, where $x_t \doteq y_t$ means $\frac{1}{t} \ln \frac{x_t}{y_t} \rightarrow 0$. Combined with the properties of $T^*(\bm \mu)$ in the pure exploration game and the concentration rate of the posterior, we can show that there exists $\delta'>0$ such that, \[ \psi_a(t) \sim \frac{\Pi_t(\theta_{t,a}<\gamma<\theta_{t,b})}{\max_{a,b}\Pi_t(\theta_{t,a}<\gamma<\theta_{t,b})} \le \exp(-t (\delta'+\epsilon_t)), \] where $\epsilon_t$ is a sequence converging to 0. This implies for any arm $a$ such that $\bar{\psi}_a(t) \ge w_a^*+c$, $\psi_a(t)$ has an exponential decay rate, and Proposition~\ref{thm:prop3} immediately yields $\bar{\psi}(t) \rightarrow \bm w^*$. The complete proofs of Theorem~\ref{thm:oned}, Lemma~\ref{lem:stoppingrule1}, and Theorem~\ref{thm:TS.convergence} are deferred to Section~\ref{sec:appendix}. \section{Extensions on the Thompson-CHF Algorithm} \label{sec:extensions} \subsection{Interval CHF Problem} \label{sec:twosided} In this section, we generalize our results in Section~\ref{sec:lb} and Section~\ref{sec:alg} to the interval feasibility setting, where our goal is to determine if the open set $(\gamma^-,\gamma^+)$ intersects with the convex hull set of $\bm \mu$. Here, we allow $\gamma^-$ to be $-\infty$ and $\gamma^+$ to be $+\infty$ for better generalization results. \subsubsection{Asymptotic Optimality and the Algorithm} We build the first result on the general sample complexity lower bound. \begin{theorem}\label{thm:oned2} Given thresholds $-\infty \le \gamma^- \le \gamma^+ \le +\infty$, let $(\gamma^*,\mu^*) = \operatorname{argmin}_{\gamma \in \{\gamma^-,\gamma^+\}, \mu \in \bm\mu }|\gamma-\mu|$. The expected sample complexity $\mathbb{E}_{\bm \mu}[\tau]$ of any $\delta$-correct 1-dimensional CHF strategy satisfies \[ \liminf_{\delta \rightarrow 0} \frac{\mathbb{E}_{\boldsymbol{\mu}}[\tau]}{\log(1/\delta)} \ge T^*(\boldsymbol{\mu}) , \] where \[ T^*(\boldsymbol{\mu}) = \begin{cases} \frac{1}{d(\mu_1,\gamma^+)}+\frac{1}{d(\mu_K,\gamma^-)} & (\gamma^-,\gamma^+) \cap \text{Conv}\{\boldsymbol{\mu}\} \neq \emptyset \\ \sum_{1 \le i \le K} \frac{1}{d(\mu_i,\gamma^*)} & (\gamma^-,\gamma^+) \cap \text{Conv}\{\boldsymbol{\mu}\} = \emptyset \end{cases}, \] and \[ \begin{aligned} &w^*_a(\boldsymbol{\mu}) = \\ & \begin{cases} \frac{\frac{1}{d(\mu_1,\gamma^+)} \mathbbm{1}\{a =1\} + \frac{1}{d(\mu_K,\gamma^-)} \mathbbm{1}\{a =K\}}{ \frac{1}{d(\mu_1,\gamma^+)}+\frac{1}{d(\mu_K,\gamma^-)}} & (\gamma^-,\gamma^+) \cap \text{Conv}\{\boldsymbol{\mu}\} \neq \emptyset \\ \frac{ \frac{1}{d(\mu_a,\gamma^*)} }{\sum_{1 \le i \le K} \frac{1}{d(\mu_i,\gamma^*)} } & (\gamma^-,\gamma^+) \cap \text{Conv}\{\boldsymbol{\mu}\} = \emptyset \end{cases}. \end{aligned} \] \end{theorem} The stopping rule is similar with minor adjustments. To be more specific, we again define the first stopping time $\tau_1$ when all arms lie significantly above $\gamma^+$: \[ \tau_1=\inf \{t\in N^-| \forall a, N_a(t)d^-(\hat{\mu}_a(t),\gamma^+) \ge \text{Tresh}(\delta,N_a(t)) \}. \] Similarly, we define the second stopping time $\tau_2$ when all arms lie significantly below $\gamma^-$: \[ \tau_2=\inf \{t\in N^+| \forall a, N_a(t)d^+(\hat{\mu}_a(t),\gamma^-) \ge \text{Tresh}(\delta,N_a(t)) \}. \] To identify the feasible case, the third stopping time is when one arm is significantly below $\gamma^+$ and another arm lies significantly above $\gamma^-$: \begin{equation*}\label{eq:stoppingtime32} \begin{aligned} \tau_3=&\inf \{t\in N^+| \exists a_1,a_2, \text{ such that } \\ &N_{a_1}(t)d^+(\hat{\mu}_{a_1}(t),\gamma^+) \ge \text{Tresh}(\delta,N_{a_1}(t)) \text{ and }\\ &N_{a_2}(t)d^-(\hat{\mu}_{a_2}(t),\gamma^-) \ge \text{Tresh}(\delta,N_{a_2}(t)) \}. \end{aligned} \end{equation*} Again, the algorithm stops if any of the three cases happens and $\tau=\min\{\tau_1,\tau_2,\tau_3\}$, and the following lemma ensures that the algorithm \hyperref[algo:TSCHF]{Thompson-CHF} is $\delta$-correct in the interval feasibility framework. \begin{lemma}\label{lem:stoppingrule2} Let $\tau_\delta$ be a stopping rule satisfying $\tau_\delta \leq \tau$. $\normalfont \text{ Tresh}(\delta,r)$ is non-decreasing in $r$ and the following holds: \begin{equation*}\label{eq:stop1} \begin{aligned} \forall r \geq r_0, \ \normalfont\text{Tresh}(\delta, r) \leq \ln(r/\delta) + o(\ln(1/\delta)), \end{aligned} \end{equation*} then for any $\boldsymbol{\bm \mu}$ and an anytime sampling strategy such that $\frac{\boldsymbol{N}_t}{t} \to w^*(\boldsymbol{\mu})$, we have $\limsup_{\delta \rightarrow 0}\frac{\tau_\delta}{\ln(1/\delta)} \le T^*(\mu)$ almost surely, and \hyperref[algo:TSCHF]{Thompson-CHF} is $\delta$-correct for the interval CHF problem. \end{lemma} The sampling rule in the interval CHF problem remains the same and we have the next theorem. \begin{theorem}\label{thm:TS.convergence2} The algorithm \hyperref[algo:TSCHF]{Thompson-CHF} ensures that $\frac{\bm{N}_t}{t} \to w^*(\bm \mu)$ almost surely \ for any $\bm \mu$ if \[ \beta_t = \frac{ d\left(\frac{1}{t} \sum_{r=1}^{t}\min\bm \theta_r,\gamma^+\right)^{-1} }{ d\left(\frac{1}{t} \sum_{r=1}^{t}\min\bm \theta_r,\gamma^+\right)^{-1}+d\left(\frac{1}{t} \sum_{r=1}^{t}\max\bm \theta_r,\gamma^-\right)^{-1}}. \] \end{theorem} \subsubsection{Connections with Other State-of-art Results} \label{sec:connections} We comment on some important connections of Section~\ref{sec:twosided} with the previous state-of-art results here. Trivially, when $\gamma^-=\gamma^+$, we immediately derive the same results as the CHF problem, implying a direct generalization to the regular CHF problem. If we set $\gamma^-=-\infty$, the Bernoulli parameter $\beta_t$ becomes 0, and this reproduces the same Murphy Sampling results from the state-of-art sequential test paper for learning the minima mean \cite{kaufmann2018sequential}. On the other hand, to better understand how the interval CHF results connect with the thresholding bandit problem, by setting $\gamma^+=+\infty$, the interval CHF problem shares the same setup with the thresholding bandit problem with the threshold $\gamma^-$. In the feasible case when $\gamma^-$ is larger than the largest mean in $\mu$, testing if there exists an arm with a mean above the threshold is essentially equivalent to finding all arms with means above the threshold since to identify both questions, one needs to traverse all arms to conclude that the means of all arms are actually below the threshold, and our complexity bound exactly matches the state-of-art optimal bound of thresholding bandit \cite{locatelli2016optimal}. When $\mu$ is infeasible, the CHF problem is strictly easier than the thresholding bandit, and our complexity is strictly smaller than the state-of-art result. Notably, the Thompson-CHF algorithm adapts both feasible and infeasible cases for the thresholding bandit problem without knowing any information on the threshold as a priori. \subsection{Gaussian Bandits with Unknown Variance in the CHF Problem} In the literature of studying multi-armed Gaussian bandit models, a natural assumption is the variances of the Gaussian reward distributions are known and set to be identical. On the contrary, despite its practical relevance, the exploration of Gaussian bandit models with \emph{unknown variances} is quite limited. A recent work studied the Best-Arm Identification problem when the reward distributions of the arms are Gaussian with unknown variance \cite{jourdan2022dealing}, and it is natural to extend the regular CHF problem to this setting. In this section, we propose an asymptotically optimal algorithm for the one-dimensional CHF problem when all the arms are sampled from Gaussian distributions with unknown variances. We further provide theoretical results (proofs are left to Section~\ref{sec:appendix}) and compare the sample complexities when the variances are known and unknown. \subsubsection{Asymptotic Optimality and the Algorithm} We apply the notations from \cite{jourdan2022dealing} and use $T^*(\bm \mu,\bm \sigma^2)$ (resp. $T^*_{\bm \sigma^2}(\bm \mu)$) to denote the characteristic time for Gaussian distributions with unknown (resp. known) variances. The following result shows a tight lower bound for this case. \begin{theorem}\label{thm:onedGaussian} Define $f(\mu,\sigma^2,\gamma)=\frac{1}{2}\log[1+\frac{(\mu-\gamma)^2}{\sigma^2}]$.Then \noindent(1) $\inf_{\kappa^2>0} \normalfont\text{KL}\left(\normalfont\text{N}(\mu,\sigma^2),\normalfont\text{N}(\gamma, \kappa^2)\right)=f(\mu,\sigma^2,\gamma)$, the equality holds when $\kappa^2=\sigma^2+(\mu-\gamma)^2$. Here $\normalfont\text{N}(\mu,\sigma^2)$ stands for Gaussian distribution with mean $\mu$ and variance $\sigma^2$, and $\normalfont \text{KL}$ is Kullback-Leibler divergence. \noindent(2) The expected sample complexity of any $\delta$-correct 1-dimensional CHF strategy satisfies \[ \liminf_{\delta \rightarrow 0} \frac{\mathbb{E}_{\boldsymbol{\mu}}[\tau]}{\log(1/\delta)} \ge T^*(\bm \mu,\bm \sigma^2) , \] where \[ T^*(\bm \mu,\bm \sigma^2) = \begin{cases} \frac{1}{f(\mu_1,\sigma_1^2, \gamma)}+\frac{1}{f(\mu_K, \sigma_K^2, \gamma)} & \gamma \in \text{Conv}\{\boldsymbol{\mu}\} \\ \sum_{1 \le i \le K} \frac{1}{f(\mu_i, \sigma_i^2, \gamma)} & \gamma \notin \text{Conv}\{\boldsymbol{\mu}\} \end{cases}, \] and \[ w^*_{\sigma^2,a}(\boldsymbol{\mu}) = \begin{cases} \frac{\frac{1}{f(\mu_a, \sigma_a^2, \gamma)}}{\sum_{i \in \{1,K\}} \frac{1}{f(\mu_i, \sigma_i^2, \gamma)}} \mathbbm{1}\{a \in \{1,K\}\} & \gamma \in \text{Conv}\{\boldsymbol{\mu}\} \\ \frac{ \frac{1}{f(\mu_a, \sigma_a^2, \gamma)} }{\sum_{1 \le i \le K} \frac{1}{f(\mu_i, \sigma_i^2, \gamma)} } & \gamma \notin \text{Conv}\{\boldsymbol{\mu}\} \end{cases}. \] \end{theorem} The setup of the stopping rule is similar to the regular CHF problem: we define $d\left((u,\sigma_u^2),(v,\sigma_v^2)\right)=f(u,v,\sigma_u^2) \mathbbm{1}\{\sigma_v^2=\sigma_u^2+(u-v)^2\}$, $d^-\left((u,\sigma_u^2),(v,\sigma_v^2)\right)=f(u,v,\sigma_u^2) \mathbbm{1}\{\sigma_v^2=\sigma_u^2+(u-v)^2\ , u\le v\}$ and $d^+\left((u,\sigma_u^2),(v,\sigma_v^2)\right)=f(u,v,\sigma_u^2) \mathbbm{1}\{\sigma_v^2=\sigma_u^2+(u-v)^2\ , u\ge v\}$. The following stopping times are designed in the same logic, and we once more present a result to ensure the algorithm is $\delta$-correct. The first stopping time $\tau_1$ is when all arms lie significantly above $\gamma$: \begin{equation*}\label{eq:stoppingtime31} \begin{aligned} \tau_1=&\inf \{t\in N^-| \forall a, \\ &N_a(t)d^-\left((\hat{\mu}_a(t),\hat{\sigma}^2_a(t)),(\gamma, \kappa_a^2)\right)\ge \text{Tresh}(\delta,N_a(t)) \}. \end{aligned} \end{equation*} In the same way, we define the second stopping time $\tau_2$ when all arms lie significantly below $\gamma$: \begin{equation*}\label{eq:stoppingtime32} \begin{aligned} \tau_2=&\inf \{t\in N^+| \forall a, \\ &N_a(t)d^+\left((\hat{\mu}_a(t),\hat{\sigma}^2_a(t)),(\gamma, \kappa_a^2)\right) \ge \text{Tresh}(\delta,N_a(t)) \}. \end{aligned} \end{equation*} When one arm is significantly below $\gamma$ and another arm lies significantly above $\gamma$, we apply the third stopping time and confirm feasibility: \begin{equation*}\label{eq:stoppingtime33} \begin{aligned} \tau_3=&\inf \{t\in N^+| \exists a_1,a_2, \text{ such that }\\ &N_{a_1}(t)d^+\left((\hat{\mu}_{a_1}(t),\hat{\sigma}^2_{a_1}(t)),(\gamma, \kappa_{a_1}^2)\right) \ge \text{Tresh}(\delta,N_{a_1}(t)),\\ &N_{a_2}(t)d^-\left((\hat{\mu}_{a_2}(t),\hat{\sigma}^2_{a_2}(t)),(\gamma, \kappa_{a_2}^2)\right) \ge \text{Tresh}(\delta,N_{a_2}(t))\}. \end{aligned} \end{equation*} We let $\tau=\min\{\tau_1,\tau_2,\tau_3\}$ and \hyperref[algo:TSCHF]{Thompson-CHF} is $\delta$-correct with a modified $\beta_t$, as stated in the following theorems. \begin{lemma}\label{lem:stoppingrule3} Let $\tau_\delta$ be a stopping rule satisfying $\tau_\delta \leq \tau$. $\normalfont \text{ Tresh}(\delta,r)$ is non-decreasing in $r$ and the following holds: \begin{equation*}\label{eq:stop1} \begin{aligned} \forall r \geq r_0, \ \normalfont\text{Tresh}(\delta, r) \leq \ln(r/\delta) + o(\ln(1/\delta)), \end{aligned} \end{equation*} then for any $\boldsymbol{\bm \mu}$ and an anytime sampling strategy such that $\frac{\boldsymbol{N}_t}{t} \to w^*(\boldsymbol{\mu})$, we have $\limsup_{\delta \rightarrow 0}\frac{\tau_\delta}{\ln(1/\delta)} \le T^*(\mu)$ almost surely, and \hyperref[algo:TSCHF]{Thompson-CHF} is $\delta$-correct for the CHF-problem with Gaussian bandits and unknown variances. \end{lemma} Parallelly, we state the sampling rule result below. \begin{theorem}\label{thm:TS.convergence3} The algorithm \hyperref[algo:TSCHF]{Thompson-CHF} ensures that $\frac{\bm{N}_t}{t} \to w^*(\bm \mu)$ almost surely \ for any $\bm \mu$ if $\beta_t$ equals \[ \frac{f\left(\frac{1}{t}\sum_{r=1}^{t}\theta_{r,k_r},\sigma_{r,k_r}^2,\gamma\right)^{-1}}{f\left(\frac{1}{t}\sum_{r=1}^{t}\theta_{r,k_r},\sigma_{r,k_r}^2,\gamma\right)^{-1}+f\left(\frac{1}{t}\sum_{r=1}^{t}\theta_{r,l_r},\sigma_{r,l_r}^2,\gamma\right)^{-1}}, \] where $k_r = \operatorname{argmin}_j \theta_{r,j}$, $l_r = \operatorname{argmax}_j \theta_{r,j}$ and $\forall a\in [K]$, \[ \sigma_{r,a}^2 = \frac{1}{t} \sum_{r=1}^{t} \left(\theta_{r,a}-\frac{1}{t}\sum_{r=1}^{t}\theta_{r,a} \right)^2, \] \end{theorem} \subsubsection{Sample Complexities Comparison} We proceed to investigate how much cost in sample complexity we need to pay for unknown variances in the CHF problem. In the Best-Arm Identification problem with Gaussian bandits, \cite{jourdan2022dealing} claims that the sample complexities for known and unknown variances are close in most cases. We build an analogous result for the CHF problem in the following result: \begin{theorem}\label{thm:complexities} Fix $\bm \mu$ and let $s_1= \frac{\max\{ (\mu_1-\gamma)^2,(\mu_K-\gamma)^2 \}}{\min(\sigma_1^2,\sigma_K^2)}$ and $s_2= \frac{\max\{ (\mu_1-\gamma)^2,(\mu_K-\gamma)^2 \}}{\min_{1 \le i \le K} \sigma_i^2}$, \noindent(1) if $\bm \mu$ is feasible, then \[ 1 < \frac{T^*(\bm \mu,\bm \sigma^2)}{T_{\bm\sigma^2}(\bm\mu)} \le \frac{s_1}{\log(1+s_1)}. \] \noindent(2) if $\bm \mu$ is infeasible, then \[ 1 < \frac{T^*(\bm \mu,\bm \sigma^2)}{T_{\bm\sigma^2}(\bm\mu)} \le \frac{s_2}{\log(1+s_2)}. \] \end{theorem} Theorem \ref{thm:complexities} implies when $s_1$ (resp. $s_2$) is small, the two sample complexities are close and the cost of unknown variance is not very high. Similar to the statements for Best-Arm Identification problem \cite{jourdan2022dealing}, a small $s_1$ (resp. $s_2$) also indicates a hard CHF problem, since $\frac{\min_{1 \le i \le K} \sigma_i^2}{\max\{ (\mu_1-\gamma)^2,(\mu_K-\gamma)^2 \}}$ gives a rough approximation of the sample complexity to distinguish the position of $\gamma$ and $\text{Conv}\{\bm \mu\}$. Therefore, when the CHF problem with Gaussian bandits is hard, the sample complexity cost of unknown variances is low, otherwise, the difference is not negligible. \section{Appendix and Proofs} \label{sec:appendix} \subsection{Proofs for one-dimensional $\gamma$-CHF problem} We provide proofs of Theorem~\ref{thm:oned}, Lemme~\ref{lem:stoppingrule1} and Theorem~\ref{thm:TS.convergence} in this Section. As discussed in Section \ref{sec:connections}, the interval CHF problem fully generalizes the regular CHF problem, and the analogous results in the interval CHF problem follow the exactly same proofs and can be derived by properly adjusting $\gamma$ to $\gamma^-$ and $\gamma^+$ in this section. Therefore, we only prove Theorem~\ref{thm:oned}, Lemme~\ref{lem:stoppingrule1} and Theorem~\ref{thm:TS.convergence} for the ease of extensions to the Gaussian bandit setting with unknown variances. \subsubsection{Proof of Theorem~\ref{thm:oned}} We recall $\mu_1=\min \{\mu_1,\cdots,\mu_K\}$ and $\mu_K=\max \{\mu_1,\cdots,\mu_K\}$. In the one-dimensional case, the $\gamma$-CHF problem is to test if $\gamma \in \text{Conv}(\boldsymbol{\mu})$. For the feasible case, \[ \text{Alt}(\boldsymbol{\mu}) =\{\boldsymbol{\lambda}| I_\pi(\boldsymbol{\lambda}) = \text{infeasible} \} = \{\boldsymbol{\lambda}| \max_{1 \leq i \leq K} \lambda_i <\gamma \text{ or } \min_{1 \leq i \leq K} \lambda_i>\gamma \}. \] Therefore, \[ \begin{aligned} T^*(\boldsymbol{\mu})^{-1}=&\max_{\boldsymbol{w}\in \Delta} \min_{\boldsymbol{\lambda} \in \text{Alt}(\boldsymbol{\mu})} \sum_a w_a d(\mu_a,\lambda_a)\\ ={}&\max_{\boldsymbol{w}\in \Delta} \min \left( \sum_{a:\mu_a<\gamma} w_a d(\mu_a,\gamma),\sum_{a:\mu_a>\gamma} w_a d(\mu_a,\gamma)\right)\\ ={}&\max_{w_1+w_K=1} \min \left( w_1d(\mu_1,\gamma),w_Kd(\mu_K,\gamma) \right)\\ ={}&\frac{d(\mu_1,\gamma)d(\mu_K,\gamma)}{d(\mu_1,\gamma)+d(\mu_K,\gamma)}\\ ={}& \frac{1}{d(\mu_1,\gamma)^{-1}+d(\mu_K,\gamma)^{-1}} \,.\\ \end{aligned} \] From the derivation, we can see the optimization problem derives its optimal solution when the strategy only samples arms with maximum and minimum mean with proportions $w_1=\frac{d(\mu_1,\gamma)^{-1}}{d(\mu_1,\gamma)^{-1}+d(\mu_K,\gamma)^{-1}}$ and $w_K=\frac{d(\mu_K,\gamma)^{-1}}{d(\mu_1,\gamma)^{-1}+d(\mu_K,\gamma)^{-1}}$. Now we consider the infeasible case. Without loss of generality, we assume $\mu_1>\tau$ (the case when $\mu_K<\tau$ can be proved in the same way due to symmetry). In this case, \[ \text{Alt}(\boldsymbol{\mu}) =\{\boldsymbol{\lambda}| I_\pi(\boldsymbol{\lambda}) = \text{feasible} \} = \{\boldsymbol{\lambda}| \lambda_1<\gamma<\lambda_K\}. \] and \[ \begin{aligned} T^*(\boldsymbol{\mu})^{-1}=&\max_{\boldsymbol{w}\in \Delta} \min_{\boldsymbol{\lambda} \in \text{Alt}(\boldsymbol{\mu})} \sum_a w_a d(\mu_a,\lambda_a)\\ ={}&\max_{\boldsymbol{w}\in \Delta} \min_{1 \le a \le K} \ w_a d(\mu_a,\gamma)\\ ={}& \frac{1}{\sum_{1 \le a \le K}d(\mu_a,\gamma)^{-1}} \,.\\ \end{aligned} \] We can see from that in the infeasible case, the decision-maker should sample all arms, and for each arm $a \in \{1,\cdots,K\}$, it should be sampled with proportion $w_a = \frac{ \frac{1}{d(\mu_a,\gamma)} }{\sum_{i \in \boldsymbol{\mu}} \frac{1}{d(\mu_i,\gamma)} }$. \subsubsection{Proof of Lemme~\ref{lem:stoppingrule1}} Now we proceed to prove Lemma \ref{lem:stoppingrule1}. We will make use of the following proposition. \begin{proposition}\label{thm:prop1}(Lemma 22 of \cite{kaufmann2016complexity}) For every $\beta,\eta>0$, if \[ x \ge \frac{1}{\beta} \ln \left( \frac{e \ln(1/\beta \eta)}{\beta \eta} \right), \] then we have \[ \beta x \ge \ln \left(\frac{x}{\eta} \right) + o\left(\ln \left(\frac{1}{\eta} \right) \right). \] \end{proposition} Now for the feasible case, on the event that \[ \frac{N_1(t)}{t} \rightarrow w_1^*(\bm \mu), \ \ \hat{\mu}_1(t) \rightarrow \mu_1, \] and \[ \frac{N_K(t)}{t} \rightarrow w_K^*(\bm \mu), \ \ \hat{\mu}_K(t) \rightarrow \mu_K, \] for any $\epsilon>0$, there exists $t_0>0$, such that for any $t>t_0$, we have \[ N_1(t)d^+(\hat{\mu}_1(t),\gamma) \ge (1-\epsilon)tw_1^*(\bm \mu)d(\mu_1,\gamma), \] and \[ N_K(t)d^-(\hat{\mu}_K(t),\gamma) \ge (1-\epsilon)tw_K^*(\bm \mu)d(\mu_K,\gamma). \] Following this, \[ \begin{aligned} \tau \le \tau_3&\le \inf\{t| N_1(t)d^+(\hat{\mu}_1(t),\gamma) \ge \text{Tresh}(\delta,N_1(t)) \text{ and } N_K(t)d^-(\hat{\mu}_K(t),\gamma) \ge \text{Tresh}(\delta,N_K(t)) \} \\ &\le \inf \left\{t| N_1(t)d^+(\hat{\mu}_1(t),\gamma) \ge \text{Tresh}(\delta,t) \text{ and } N_K(t)d^+(\hat{\mu}_K(t),\gamma) \ge \text{Tresh}(\delta,t) \right\} \\ &\le \inf \left\{t| (1-\epsilon)tw^*_1(\bm \mu)d(\mu_1,\gamma) \ge \text{Tresh}(\delta,t) \text{ and } (1-\epsilon)tw^*_K(\bm \mu)d(\mu_K,\gamma) \ge \text{Tresh}(\delta,t) \right\} \\ &\le \inf \left\{t| (1-\epsilon)t \min \left(w^*_1(\bm \mu)d(\mu_1,\gamma),w^*_K(\bm \mu)d(\mu_K,\gamma) \right) \ge \ln\left(\frac{t}{\delta}\right)+o\left(\ln\left(\frac{1}{\delta}\right)\right) \right\}\\ &\le \inf \left\{t| (1-\epsilon)tT^*(\bm \mu)^{-1} \ge \ln\left(\frac{t}{\delta}\right)+o\left(\ln\left(\frac{1}{\delta}\right)\right) \right\}.\\ \end{aligned} \] Hence we have $\tau (1-\epsilon)T^*(\bm \mu)^{-1} \le \ln\left(\frac{t}{\delta}\right)+o\left(\ln\left(\frac{1}{\delta}\right)\right)$. By setting $\beta=(1-\epsilon)T^*(\bm \mu)^{-1}$, $x=\tau$ and $\eta=\delta$, Proposition~\ref{thm:prop1} directly yields \[ \begin{aligned} \tau &\le \frac{1}{(1-\epsilon)T^*(\bm \mu)^{-1}} \ln \left( \frac{e\ln\left(\frac{1}{(1-\epsilon)T^*(\bm \mu)^{-1}\delta}\right)}{(1-\epsilon)T^*(\bm \mu)^{-1}\delta} \right) \\ & \le \frac{1}{(1-\epsilon)T^*(\bm \mu)^{-1}} \left( \ln\left(\frac{e}{(1-\epsilon)T^*(\bm \mu)^{-1}}\right) + \ln\left(\frac{1}{\delta}\right) + \ln\ln\left(\frac{1}{(1-\epsilon)T^*(\bm \mu)^{-1}\delta}\right) \right) \\ &\le \frac{1}{(1-\epsilon)T^*(\bm \mu)^{-1}} \ln\left(\frac{1}{\delta}\right) + o\left(\ln\left( \frac{1}{\delta}\right)\right) \\ \end{aligned} \] Notice that $\epsilon$ is arbitrary, we have \[ \limsup_{\delta \rightarrow 0} \frac{\tau}{\ln(1/\delta)} \le T^*(\bm \mu). \] For the infeasible case, WLOG we assume $\mu_1 >\gamma$ (proof of the symmetric case $\mu_K<\gamma$ is identical). On the event that for any arm $a\in\{1,\cdots,K\}$, \[ \frac{N_a(t)}{t} \rightarrow w_a^*(\bm \mu), \ \ \hat{\mu}_a(t) \rightarrow \mu_a, \] and for arbitrary $\epsilon>0$, similarly, there exists $t_0$, and for any $t>t_0$, we have the following inequality to hold: \[ N_a(t)d^-(\hat{\mu}_a(t),\gamma) \ge (1-\epsilon)tw_a^*(\bm \mu)d(\mu_a,\gamma). \] Using a parallel statement of the feasible case, \[ \begin{aligned} \tau \le \tau_3&\le \inf\{t| \forall a, N_a(t)d(\hat{\mu}_a(t),\gamma) \ge \text{Tresh}(\delta,N_1(t)) \} \\ &\le \inf \left\{t| \forall a, N_a(t)d^-(\hat{\mu}_a(t),\gamma) \ge \text{Tresh}(\delta,t) \right\} \\ &\le \inf \left\{t| \forall a, (1-\epsilon)tw^*_a(\bm \mu)d(\mu_a,\gamma) \ge \ln\left(\frac{t}{\delta}\right)+o\left(\ln\left(\frac{1}{\delta}\right)\right) \right\} \\ &\le \inf \left\{t| (1-\epsilon)t \min_{1 \le a \le K} \left\{w^*_a(\bm \mu)d(\mu_a,\gamma)\right\} \ge \ln\left(\frac{t}{\delta}\right)+o\left(\ln\left(\frac{1}{\delta}\right)\right) \right\}\\ &\le \inf \left\{t| (1-\epsilon)tT^*(\bm \mu)^{-1} \ge \ln\left(\frac{t}{\delta}\right)+o\left(\ln\left(\frac{1}{\delta}\right)\right) \right\}.\\ \end{aligned} \] Following the same statements and by applying Proposition~\ref{thm:prop1}, we have \[ \tau \le \frac{1}{(1-\epsilon)T^*(\bm \mu)^{-1}} \ln\left(\frac{1}{\delta}\right) + o\left(\ln\left( \frac{1}{\delta}\right)\right). \] Thus, in the infeasible case, \[ \limsup_{\delta \rightarrow 0} \frac{\tau}{\ln(1/\delta)} \le T^*(\bm \mu) \] also holds. \subsubsection{Proof of Theorem~\ref{thm:TS.convergence}} We again consider feasible and infeasible cases separately. We recall the following notations \[ \psi_a(t) = \mathbb P(A_t=a| \mathcal F_{t-1}), \ \ \Psi_a(t) = \sum_{i=1}^{t} \psi_a(i), \ \ \text{and } \ \ \bar{\psi}_a(t) = \frac{1}{t} \Psi_a(t). \] Our proof is based on a classic result (see Corollary 1 of \cite{russo2016simple}) that for any arm $a \in [K]$, if $\Psi_a(t) \rightarrow \infty$, then \[ \frac{w_a(t)}{\bar{\psi}_a(t)}= \frac{N_a(t)}{\Psi_a(t)} \rightarrow 1 \ \ \ \text{a.s} \] and the following result from \cite{kaufmann2018sequential}. \begin{proposition}\label{thm:prop2}(Theorem 12 of \cite{kaufmann2018sequential}) Given a threshold $\gamma$, for any $\bm \mu = \{(\mu_1,\cdots,\mu_K)|\mu_1 \le \cdots \le \mu_K, \text{ and } \mu_1 < \gamma \}$. If we sequentially sample as follows: for any $t \in \mathbb N^+$, sample $\bm \theta_t \sim \Pi_{t-1}(\cdot| \min_{1 \le i \le K}\mu_i < \gamma)$, then play the arm $A_t$ with lowest mean in $\bm \theta_t$. Then the sampling procedure ensures that the sampling frequencies satisfy \[ \frac{N_1(t)}{t} \rightarrow 1, \] and for any $2 \le a \le K$, \[ \frac{N_a(t)}{t} \rightarrow 0 \] almost surely. \end{proposition} Back to our proof, now we consider the feasible case first. In this case, we have $\bm \mu$ with property $\mu_1 < \gamma < \mu_K$. For any $n \in \mathbb N^+$, \[ \psi_1(t) = \beta_t \Pi_t\left( \theta_{t,1} < \min_{j \neq 1} \theta_{t,j}| \bm \mu \text{ feasible}\right) + (1-\beta_t)\Pi_t\left( \theta_{t,1} > \max_{j \neq 1} \theta_{t,j}| \bm \mu \text{ feasible}\right). \] Notice that $\{\operatorname{argmin}_a \theta_a = 1\}$ and $\{\mu_K > \gamma\}$ are independent events, \[ \Pi_t\left( \theta_{t,1} < \min_{j \neq 1} \theta_{t,j}| \bm \mu \text{ feasible}\right) \rightarrow 1 \ \ a.s.. \] And $\Pi_t\left( \theta_{t,1} < \min_{j \neq 1} \theta_{t,j}| \bm \mu \text{ feasible}\right) +\Pi_t\left( \theta_{t,1} > \min_{j \neq 1} \theta_{t,j}| \bm \mu \text{ feasible}\right) \le 1$ directly yields \[ \Pi_t\left( \theta_{t,1} > \max_{j \neq 1} \theta_{t,j}| \bm \mu \text{ feasible}\right) \rightarrow 0 \ \ a.s.. \] Combine with the fact that $\beta_t \rightarrow \frac{d^{-1}(\mu_1,\gamma)}{d^{-1}(\mu_1,\gamma)+d^{-1}(\mu_K,\gamma)}$, we get $\frac{N_1(t)}{t} \rightarrow w_1^*(\bm \mu)$. Similarly, \[ \psi_K(t) = \beta_t \Pi_t\left( \theta_{t,K} < \min_{j \neq 1} \theta_{t,j}| \bm \mu \text{ feasible}\right) + (1-\beta_t)\Pi_t\left( \theta_{t,K} > \max_{j \neq 1} \theta_{t,j}| \bm \mu \text{ feasible}\right). \] With the facts that $\Pi_t\left( \theta_{t,K} < \min_{j \neq 1} \theta_{t,j}| \bm \mu \text{ feasible}\right) \rightarrow 0$ and $\Pi_t\left( \theta_{t,K} > \max_{j \neq 1} \theta_{t,j}| \bm \mu \text{ feasible}\right) \rightarrow 1$ almost surely, this leads to $\frac{N_K(t)}{t} \rightarrow w_K^*(\bm \mu)$. Notice that $w_1^*(\bm \mu)+w_K^*(\bm \mu)=1$, we have shown that $\frac{\bm N(t)}{t} \rightarrow w^*(\bm \mu)$ almost sure in the feasible case. For the infeasible case, we use the following proposition. \begin{proposition}(Simplified version of Lemma of \cite{russo2016simple}) Consider any sampling rule, if for any arm $a \in [K]$ and all $c>0$, \[ \sum_{t} \psi_a(t) \mathbbm{1}\{\bar{\psi}_a(t) \ge w_a^*+c\} < \infty, \] then $\bar{\psi}(t) \rightarrow \bm w^*$. \end{proposition} By applying a similar proof strategy in \cite{russo2016simple} and \cite{kaufmann2018sequential}, we aim to prove the precondition in Proposition~\ref{thm:prop3}. For any $a \in [K]$ and $c>0$, consider any round $n$ where $\bar{\psi}_a(t) \ge w_a^*+c$, we have \[ \begin{aligned} \psi_a(t)&= \beta_t \frac{\Pi_{t-1}(a=\operatorname{argmin}_i \theta_{t,i},b=\operatorname{argmax}_i \theta_{t,i}, \min_i \theta_{t,i} <\gamma<\max_i \theta_{t,i})}{\Pi_{t-1}(\min_i \theta_{t,i} <\gamma<\max_i \theta_{t,i})} \\ &+ (1-\beta_t)\frac{\Pi_{t-1}(a=\operatorname{argmax}_i \theta_{t,i}, b=\operatorname{argmin}_i \theta_{t,i},\min_i \theta_{t,i} <\gamma<\max_i \theta_{t,i})}{\Pi_{t-1}(\min_i \theta_{t,i} <\gamma<\max_i \theta_{t,i})} \\ &\le \beta_t \frac{\Pi_{t-1}(\theta_{t,a}<\gamma<\theta_{t,b})}{\max_{a,b}\Pi_{t-1}(\theta_{t,a}<\gamma<\theta_{t,b})} +(1-\beta_t) \frac{\Pi_{t-1}(\theta_{t,b}<\gamma<\theta_{t,a})}{\max_{a,b}\Pi_{t-1}(\theta_{t,b}<\gamma<\theta_{t,a})}.\\ \end{aligned} \] Following \cite{russo2016simple}, recall we use $x_t \doteq y_t$ to denote that $t^{-1}\ln{(x_t/y_t)} \rightarrow 0$. Based on any known posterior concentration rate result (for example, Proposition 5 in \cite{russo2016simple}) that for any open set $\tilde{\Theta} \subset \Theta$, the posterior concentrates at the rate $ \Pi_t(\tilde{\Theta}) \doteq \exp\left(-t \min_{\bm \lambda \in \tilde{\Theta}}\sum_a \bar{\psi}_a(t)d(\mu_a,\lambda_a)\right). $ Moreover, for any $a ,b \in [K]$, \[ \begin{aligned} \Pi_t(\theta_{t,a} <\gamma<\theta_{t,b}) &\doteq \exp \left( -t \min_{\bm \theta_t \text{ feasible}} \sum_a \bar{\psi}_a(t) d(\mu_a,\theta_{t,a}) \right) \\ &= \exp \left(-t \min \left(\ \sum_{a:\mu_a<\gamma}\bar{\psi}_a(t)d(\mu_a,\gamma),\sum_{a:\mu_a>\gamma}\bar{\psi}_a(t)d(\mu_a,\gamma) \right)\right). \end{aligned} \] This means, there is a sequence $\epsilon_t \rightarrow 0$ such that for any $t$, \[ \Pi_t(\theta_a <\gamma<\theta_b) \in \exp \left(-t \left(\min \left(\ \sum_{a:\mu_a<\gamma}\bar{\psi}_a(t)d(\mu_a,\gamma),\sum_{a:\mu_a>\gamma}\bar{\psi}_a(t)d(\mu_a,\gamma) \right)\right) \pm \epsilon_t \right), \] which implies \begin{align*} \psi_a(t)&\le \beta_t \frac{\Pi_{t-1}(\theta_{t,a}<\gamma<\theta_{t,b})}{\max_{a,b}\Pi_{t-1}(\theta_{t,a}<\gamma<\theta_{t,b})} +(1-\beta_t) \frac{\Pi_{t-1}(\theta_{t,b}<\gamma<\theta_{t,a})}{\max_{a,b}\Pi_{t-1}(\theta_{t,b}<\gamma<\theta_{t,a})}.\\ =&\frac{\exp \left(-t \left(\min \left(\ \sum_{a:\mu_a<\gamma}\bar{\psi}_a(t)d(\mu_a,\gamma),\sum_{a:\mu_a>\gamma}\bar{\psi}_a(t)d(\mu_a,\gamma) \right)\right) - \epsilon_t \right)}{\max_a \exp \left(-t \left(\min \left(\ \sum_{a:\mu_a<\gamma}\bar{\psi}_a(t)d(\mu_a,\gamma),\sum_{a:\mu_a>\gamma}\bar{\psi}_a(t)d(\mu_a,\gamma) \right)\right) + \epsilon_t \right)}\\ =&\exp \biggl\{-t \biggl[\min \Bigl(\ \sum_{a:\mu_a<\gamma}\bar{\psi}_a(t)d(\mu_a,\gamma),\sum_{a:\mu_a>\gamma}\bar{\psi}_a(t)d(\mu_a,\gamma) \Bigr)\\ &-\min_a \min \Bigl(\ \sum_{a:\mu_a<\gamma}\bar{\psi}_a(t)d(\mu_a,\gamma),\sum_{a:\mu_a>\gamma}\bar{\psi}_a(t)d(\mu_a,\gamma) \Bigr)\biggr] - 2\epsilon_t \biggr\}\\ \le & \exp \biggl\{-t \biggl[\min \Bigl(\ \sum_{a:\mu_a<\gamma}(w^*_a+c)d(\mu_a,\gamma),\sum_{a:\mu_a>\gamma}(w^*_a+c)d(\mu_a,\gamma) \Bigr)\\ &-\min \Bigl(\ \sum_{a:\mu_a<\gamma}w^*_ad(\mu_a,\gamma),\sum_{a:\mu_a>\gamma}w^*_ad(\mu_a,\gamma) \Bigr)\biggr] - 2\epsilon_t \biggr\}.\\ \le & \exp \biggl\{ -t\biggl[c\min\Bigl(\sum_{a:\mu_a<\gamma}d(\mu_a,\gamma) ,\sum_{a:\mu_a>\gamma}d(\mu_a,\gamma)\Bigr)-2\epsilon_t \biggr]\biggr\} \end{align*} When $\epsilon_t \rightarrow 0$ the $\psi_a(t)$ is bounded by an exponential decay term, therefore \[ \sum_{t} \psi_a(t) \mathbbm{1}\{\bar{\psi}_a(t) \ge w_a^*+c\} \le \infty. \] Therefore, we have $\bar{\psi}(t) \rightarrow \bm w^*$, and by the conclusions above, $\bm N(t)/t \rightarrow \bm w^*$. \subsection{Proofs for the CHF problem in the Gaussian setting with unknown variances} \subsubsection{Proof of Theorem~\ref{thm:onedGaussian}} (1) For two Gaussian distributions $N(\mu,\sigma^2)$ and $N(\gamma,\kappa^2)$, the KL divergence can be written as \[ \text{KL}\left(\normalfont\text{N}(\mu,\sigma^2),\normalfont\text{N}(\gamma,\kappa^2)\right) = \frac{1}{2} \left[\frac{(\mu-\gamma)^2}{\kappa^2}+\frac{\sigma^2}{\kappa^2}-1-\log\left(\frac{\sigma^2}{\kappa^2}\right)\right]. \] Simple calculus directly leads to \[ \inf_{\kappa^2>0} \text{KL}\left(\normalfont\text{N}(\mu,\sigma^2),\normalfont\text{N}(\gamma,\kappa^2)\right) = \text{KL} \left((\mu,\sigma^2),(\gamma,\sigma^2+(\mu-\gamma)^2)\right)=\frac{1}{2}\log\left(1+\frac{\mu-\gamma}{\sigma^2}\right)=f(\mu,\sigma^2,\gamma). \] (2) In the one-dimensional CHF problem with Gaussian bandits and unknown variances, our objective is to determine if $\gamma \in \text{Conv}(\boldsymbol{\mu})$. The characteristic time can be written as \[ T^*(\bm \mu,\bm \sigma^2)^{-1} = \max_{\bm w\in \Delta} \min_{(\bm \lambda,\bm \kappa^2)\in \text{Alt}(\bm \mu,\bm \sigma^2)} \sum_a w_a \text{KL}(\mu_a,\lambda_a). \] When the variances are unknown, the alternative set can be simplified as \[ \text{Alt}(\bm \mu,\bm \sigma^2)=\{\bm \lambda \in \text{Alt}(\bm \mu),\bm \kappa^2>0\}. \] For the feasible case, \[ \begin{aligned} T^*(\boldsymbol{\mu},\bm \sigma^2)^{-1}&=\max_{\boldsymbol{w}\in \Delta} \min_{ (\boldsymbol{\lambda},\bm \kappa^2) \in \text{Alt}(\boldsymbol{\mu}, \bm \sigma^2)} \sum_a w_a \text{KL}\left(\normalfont\text{N}(\mu_a,\sigma_a^2),\normalfont\text{N}(\lambda_a,\kappa_a^2)\right)\\ &=\max_{\boldsymbol{w}\in \Delta} \min_{\bm \lambda \in \text{Alt}(\bm \mu)} \min_{\bm \kappa^2>0} \sum_a w_a \text{KL}\left(\normalfont\text{N}(\mu_a,\sigma_a^2),\normalfont\text{N}(\lambda_a,\kappa_a^2)\right)\\ &=\max_{\boldsymbol{w}\in \Delta} \min_{\bm \lambda \in \text{Alt}(\bm \mu)} \sum_a w_a \text{KL}\left(\normalfont\text{N}(\mu_a,\sigma_a^2),\normalfont\text{N}(\lambda_a,\sigma_a^2+(\mu_a-\lambda_a)^2))\right)\\ &=\max_{w_1+w_K=1} \min \left( w_1f(\mu_1,\sigma_1^2,\gamma),w_K f(\mu_K,\sigma_K^2,\gamma) \right)\\ &=\frac{f(\mu_1,\sigma_1^2,\gamma)f(\mu_K,\sigma_K^2,\gamma)}{f(\mu_1,\sigma_1^2,\gamma)+f(\mu_K,\sigma_K^2,\gamma)}\\ &=\frac{1}{f(\mu_1,\sigma_1^2,\gamma)^{-1}+f(\mu_K,\sigma_K^2,\gamma)^{-1}} \,.\\ \end{aligned} \] Following the same statement, we observe the pure exploration game in the Gaussian bandits setting with unknown mean derives its optimal solution when the strategy only samples arms with maximum and minimum mean with proportions $w_{\sigma^2,1}=\frac{f(\mu_1,\sigma_1^2,\gamma)^{-1}}{f(\mu_1,\sigma_1^2,\gamma)^{-1}+f(\mu_K,\sigma_K^2,\gamma)^{-1}}$ and $w_{\sigma^2,K}=\frac{f(\mu_K,\sigma_K^2,\gamma)^{-1}}{f(\mu_1,\sigma_1^2,\gamma)^{-1}+f(\mu_K,\sigma_K^2,\gamma)}$. In the infeasible case, WLOG we again assume $\mu_1>\tau$, \[ \begin{aligned} T^*(\boldsymbol{\mu},\bm \sigma^2)^{-1}&=\max_{\boldsymbol{w}\in \Delta} \min_{(\boldsymbol{\lambda},\bm \sigma^2) \in \text{Alt}(\boldsymbol{\mu}, \bm \kappa^2)} \sum_a w_a \text{KL}\left(\normalfont\text{N}(\mu_a,\sigma_a^2),\normalfont\text{N}(\lambda_a,\kappa_a^2)\right)\\ &=\max_{\boldsymbol{w}\in \Delta} \min_{\boldsymbol{\lambda} \in \text{Alt}(\boldsymbol{\mu})} \min_{\bm \kappa^2>0} \sum_a w_a \text{KL}\left(\normalfont\text{N}(\mu_a,\sigma_a^2),\normalfont\text{N}(\lambda_a,\kappa_a^2)\right)\\ &=\max_{\boldsymbol{w}\in \Delta} \min_{\bm \lambda \in \text{Alt}(\bm \mu)} \sum_a w_a \text{KL}\left(\normalfont\text{N}(\mu_a,\sigma_a^2),\normalfont\text{N}(\lambda_a,\sigma_a^2+(\mu_a-\lambda_a)^2))\right)\\ &=\max_{\boldsymbol{w}\in \Delta} \min_{1 \le a \le K} \ w_a f(\mu_a,\sigma^2_a,\gamma)\\ &=\frac{1}{\sum_{1 \le a \le K}f(\mu_a,\sigma_a^2,\gamma)^{-1}} \,.\\ \end{aligned} \] We can see from that in the infeasible case, the decision-maker should sample all arms, and for each arm $a \in \{1,\cdots,K\}$, it should be sampled with proportion $w_{\sigma^2,a} = \frac{ \frac{1}{f(\mu_a,\sigma^2_a,\gamma)} }{\sum_{i \in \boldsymbol{\mu}} \frac{1}{f(\mu_i,\sigma_i^2,\gamma)} }$. \subsection{Proof of Lemma~\ref{lem:stoppingrule3}} Due to the fact that function $f$ is the KL divergence between two Gaussian distributions, \[ f(\mu,\sigma^2,\gamma)=\text{KL} \left(\normalfont\text{N}(\mu,\sigma^2),\normalfont\text{N}(\gamma,\sigma^2+(\mu-\gamma)^2)\right), \] the proof of Lemma~\ref{lem:stoppingrule3} follows a similar statement to that of Lemma~\ref{lem:stoppingrule1}. For the feasible case, on the event that \[ \frac{N_1(t)}{t} \rightarrow w_{\sigma^2,1}^*(\bm \mu), \ \ \hat{\mu}_1(t) \rightarrow \mu_1, \] and \[ \frac{N_K(t)}{t} \rightarrow w_{\sigma^2,K}^*(\bm \mu), \ \ \hat{\mu}_K(t) \rightarrow \mu_K, \] for arbitrary $\epsilon>0$, there exists $t_0 \in \mathbb N^+$, for all $t>t_0$, the following inequalities hold: \[ N_1(t)d^+((\hat{\mu}_1(t),\hat{\sigma}^2_1(t)),(\gamma,\kappa^2)) \ge (1-\epsilon)tw_{\sigma^2,1}^*(\bm \mu)d((\mu_1,\sigma_1^2),(\gamma,\kappa^2)), \] \[ N_K(t)d^-( (\hat{\mu}_K(t),\hat{\sigma}^2_K(t)),(\gamma,\kappa^2)) \ge (1-\epsilon)tw_{\sigma^2,K}^*(\bm \mu)d((\mu_K,\sigma_K^2),(\gamma,\kappa^2)). \] Using the same techniques, \[ \begin{aligned} \tau \le \tau_3&\le \inf\{t| N_1(t)d^+((\hat{\mu}_1(t),\hat{\sigma}^2_1(t)),(\gamma,\kappa^2)) \ge \text{Tresh}(\delta,N_1(t))\\ &\ \ \ \ \text{ and } N_K(t)d^-((\hat{\mu}_K(t),\hat{\sigma}^2_K(t)),(\gamma,\kappa^2)) \ge \text{Tresh}(\delta,N_K(t)) \} \\ &\le \inf \left\{t| N_1(t)d^+((\hat{\mu}_1(t),\hat{\sigma}^2_1(t)),(\gamma,\kappa^2)) \ge \text{Tresh}(\delta,t) \text{ and } N_K(t)d^-((\hat{\mu}_K(t),\hat{\sigma}^2_K(t)),(\gamma,\kappa^2)) \ge \text{Tresh}(\delta,t) \right\} \\ &\le \inf \left\{t| (1-\epsilon)t \min \left(w_{\sigma^2,1}^*(\bm \mu)d((\mu_1,\sigma_1^2),(\gamma,\kappa^2)),w_{\sigma^2,K}^*(\bm \mu)d((\mu_K,\sigma_K^2),(\gamma,\kappa^2)) \right) \ge \ln\left(\frac{t}{\delta}\right)+o\left(\ln\left(\frac{1}{\delta}\right)\right) \right\}\\ &\le \inf \left\{t| (1-\epsilon)tT^*(\bm \mu,\bm \sigma^2)^{-1} \ge \ln\left(\frac{t}{\delta}\right)+o\left(\ln\left(\frac{1}{\delta}\right)\right) \right\}.\\ \end{aligned} \] By applying Proposition~\ref{thm:prop1} again gives us \[ \limsup_{\delta \rightarrow 0} \frac{\tau}{\ln(1/\delta)} \le T^*(\bm \mu,\bm \sigma^2). \] For the infeasible case, WLOG we assume $\mu_1 >\gamma$. Define the event that for any arm $a\in\{1,\cdots,K\}$, \[ \frac{N_a(t)}{t} \rightarrow w_{\sigma^2,a}^*(\bm \mu), \ \ \hat{\mu}_a(t) \rightarrow \mu_a, \] and for arbitrary $\epsilon>0$, similarly, there exists $t_0$, and for any $t>t_0$, we have the following inequality to hold: \[ N_a(t)d^-((\hat{\mu}_a(t),\hat{\sigma}^2_a(t)),(\gamma,\kappa^2)) \ge (1-\epsilon)tw_{\sigma^2,a}^*(\bm \mu)d((\mu_a,\sigma^2_a),(\gamma,\kappa^2)). \] Similarly, \[ \begin{aligned} \tau \le \tau_3&\le \inf\{t| \forall a, d((\hat{\mu}_a(t),\hat{\sigma}^2_a(t)),(\gamma,\kappa^2)) \ge \text{Tresh}(\delta,N_1(t)) \} \\ &\le \inf \left\{t| \forall a, d^-((\hat{\mu}_a(t),\hat{\sigma}^2_a(t)),(\gamma,\kappa^2)) \ge \text{Tresh}(\delta,t) \right\} \\ &\le \inf \left\{t| \forall a, (1-\epsilon)tw^*_{\sigma^2,a}(\bm \mu)d((\mu_a,\sigma^2_a),(\gamma,\kappa^2)) \ge \ln\left(\frac{t}{\delta}\right)+o\left(\ln\left(\frac{1}{\delta}\right)\right) \right\} \\ &\le \inf \left\{t| (1-\epsilon)t \min_{1 \le a \le K} \left\{w^*_{\sigma^2,a}(\bm \mu)d((\mu_a,\sigma^2_a),(\gamma,\kappa^2))\right\} \ge \ln\left(\frac{t}{\delta}\right)+o\left(\ln\left(\frac{1}{\delta}\right)\right) \right\}\\ &\le \inf \left\{t| (1-\epsilon)tT_{\sigma^2}^*(\bm \mu)^{-1} \ge \ln\left(\frac{t}{\delta}\right)+o\left(\ln\left(\frac{1}{\delta}\right)\right) \right\}.\\ \end{aligned} \] Following the same statements and by applying Proposition~\ref{thm:prop1}, we have \[ \limsup_{\delta \rightarrow 0} \frac{\tau}{\ln(1/\delta)} \le T^*(\bm \mu,\bm \sigma^2). \] \subsubsection{Discussions of Proof of Theorem~\ref{thm:TS.convergence3}} We notice that in the proof of Theorem~\ref{thm:TS.convergence}, we only use the properties of the characteristic time, and the CHF problem with Gaussian variances and unknown means shares the same properties. So the proof of Theorem~\ref{thm:TS.convergence3} is identical to that of Theorem~\ref{thm:TS.convergence} and we omit it here. \subsection{Proof of Theorem~\ref{thm:complexities}} (1) When $\bm \mu$ is feasible, and for any $a \in \{1,K\}$, we have \[ \frac{\log\left(1+\frac{(\mu_a-\gamma)^2}{\sigma_a^2}\right)}{(\mu_a-\gamma)^2/\sigma_a^2} \ge \frac{\log(1+s_1)}{s_1}. \] Here we use the fact that function $\frac{\log(1+x)}{x}$ is strictly decreasing when $x\ge 0$. This implies that \[ \frac{T^*(\mu,\sigma^2)}{T_{\sigma^2}(\mu)} = \frac{\sum_{a \in \{1,K\}}f(\mu_a,\sigma_a,\gamma)^{-1} }{ \sum_{a \in \{1,K\}} \left(\frac{1}{2} \frac{(\mu_a-\gamma)^2}{\sigma_a^2}\right)^{-1} } \le \frac{s_1}{\log(1+s_1)}. \] Notice that for any $x>0$, $\log(1+x)<x$, thus \[ \frac{T^*(\mu,\sigma^2)}{T_{\sigma^2}(\mu)} = \frac{\sum_{a \in \{1,K\}}f(\mu_a,\sigma_a,\gamma)^{-1} }{ \sum_{a \in \{1,K\}} \left(\frac{1}{2} \frac{(\mu_a-\gamma)^2}{\sigma_a^2}\right)^{-1} } >1. \] Together this shows \[ 1< \frac{T^*(\mu,\sigma^2)}{T_{\sigma^2}(\mu)} \le \frac{s_1}{\log(1+s_1)}. \] (2) When $\bm \mu$ is infeasible, we have \[ \frac{T^*(\mu,\sigma^2)}{T_{\sigma^2}(\mu)} = \frac{\sum_{1 \le a \le K}f(\mu_a,\sigma_a,\gamma)^{-1} }{ \sum_{1 \le a \le K} \left(\frac{1}{2} \frac{(\mu_a-\gamma)^2}{\sigma_a^2}\right)^{-1} } \le \frac{s_2}{\log(1+s_2)}. \] Similarly \[ \frac{T^*(\mu,\sigma^2)}{T_{\sigma^2}(\mu)} = \frac{\sum_{1 \le a \le K}f(\mu_a,\sigma_a,\gamma)^{-1} }{ \sum_{1 \le a \le K} \left(\frac{1}{2} \frac{(\mu_a-\gamma)^2}{\sigma_a^2}\right)^{-1} } >1. \] And combining the results yields \[ 1< \frac{T^*(\mu,\sigma^2)}{T_{\sigma^2}(\mu)} \le \frac{s_2}{\log(1+s_2)}. \] \section{Discussion and Conclusion} This work thoroughly investigates the convex hull feasibility (CHF) problem in the one-dimensional setting in the regime of pure exploration. We propose a novel asymptotically optimal algorithm to tackle this question, which we refer to as Thompson-CHF. In particular, the sampling rule inspired by top-two Thompson sampling \cite{russo2016simple} and Murphy sampling \cite{kaufmann2018sequential} automatically guarantees the sampled proportion of each arm converges to the optimal allocation derived by the information-theoretical lower bound, regardless of relative position between the threshold and the arm mean set. Moreover, we extend our results to two important multi-armed bandit settings that generalize some popular problems in the literature. Our future work will attempt to further generalize the theoretical findings to high-dimensional CHF problems with broader settings. We conjecture that the sample complexity bounds and the asymptotically optimal algorithm are the same as the one-dimensional case. The current theoretical results reveal some challenges in the high-dimensional setting due to the complex geometric structure in the ``alternative'' set. It would be interesting to understand and explore an asymptotic optimal algorithm for the CHF problem in high-dimensional space.
\section{Introduction} \label{sec:intro} Environmental epidemiological studies routinely utilize aggregate health data to assess short-term health effects of environmental exposures. For example, city-wide daily counts of deaths, emergency department (ED) visits, and preterm births have been linked to short-term exposure to air pollution and extreme temperature \citep{alhanti2016ambient, guo2017heat, bekkar2020association, yoo2021association}. The use of aggregate health data represents an ecological design, where the true exposure corresponds to the distribution of individual-level exposure across the at-risk population \citep{richardson2003bayesian, sheppard2003insights}. However, individual environmental exposures cannot be practically measured in large population-based studies. Instead, exposure surrogates that reflect summaries of individual-level exposure (e.g., the mean) are used. This can result in exposure misclassification that leads to biases and incorrect characterization of uncertainties associated with the health effect estimates \citep{dominici2000measurement, richmond2020influence}. In the context of air pollution, ambient pollutant levels are frequently the exposure of interest so that regulatory policies may be developed. Within short-term time-scales of interest, there can be considerable exposure heterogeneity within the population since (1) air pollutants can exhibit spatial variation within the study region, and (2) individuals spend most of their time in different indoor environments, each with unique outdoor to indoor pollution infiltration characteristics. To address the first challenge, spatial-temporal models have been developed to estimate pollutant concentrations at fine spatial resolutions that can provide complete spatial-temporal coverage \citep{jerrett2001gis, jerrett2005review}. Population-weighting is then used to construct short-term exposure values to link with aggregated health outcome data, over spatial units of interest (e.g., ZIP code). Accounting for spatial exposure variability within temporal studies has been shown to result in larger health effect estimates compared to the use of exposure metrics measured by sparse, stationary monitors, especially for pollutants with high degrees of spatial variability (e.g., traffic-related pollutants) \citep{goldman2010ambient, sarnat2013application}. In contrast, less work has been done to address exposure heterogeneity due to individual time spent in different microenvironments. With the development of wearable devices, personal exposure to environmental contaminants can be more easily measured \citep{steinle2013quantifying, steinle2015personal, sugg2018temporal}. While the cost is prohibitive for population-based epidemiological studies, findings from small exposure assessment studies have been used to develop probabilistic models to simulate population-level distributions of personal exposures, incorporating time-activity-location patterns and parameters describing the relationships between ambient and indoor environments. When spatially-refined ambient exposure is used as an input, the resulting simulated personal exposure distributions reflect both spatial heterogeneity in ambient concentrations and population heterogeneity in time-activity-location patterns. Examples of probabilistic models include pCNEM and the Stochastic Human Exposure and Dose Simulation (SHEDS) \citep{burke2001population, zidek2005using, zidek2007framework}, as well as a statistical emulator to reduce the computational burden for large-scale epidemiological studies \citep{chang2012time}. With simulated personal exposures from such probabilistic models, previous studies of aggregate health outcomes have used exposure distribution summary statistics (e.g., daily mean or median) as the covariate in the health model \citep{calder2008relating, chang2012time, sarnat2013application}. However, ecological bias is still present because the daily mean of personal exposures does not fully capture heterogeneity of exposures experienced by the population \citep{sheppard2003insights}. For example, in the special case where personal exposures are normally distributed, inclusion of exposure variance in the health model can result in unbiased estimates \citep{sheppard2003insights, reich2009analysis}. However, the population distribution of environmental exposure is often skewed and poorly approximated by a normal distribution \citep{leiva2008generalized, huang2018multivariate}. Furthermore, all previous methods using population summary statistics implicitly assume that the heath effect of air pollution can be entirely characterized by the summary statistic selected. In other words, health risks only depend on changes in that selected summary statistic. However, health risks may also depend on changes in the expsoure distribution that cannot be reflected by changes in the selected summary statistic. For example, consider a scenario where a short-term increase in air pollution may be more detrimental to individuals who are typically exposed to lower pollution levels. For such scenario, an increase in the lower tail of population-level exposure results in larger increases in the risk of adverse health events, while solely including the population-level mean exposure is insufficient to fully characterize the exposure-response relationship. In this work, we propose a general modeling framework to incorporate within-unit population-level exposure heterogeneity via exposure quantile functions. Instead of only using unit-level population-average or variance, exposure quantile functions comprehensively summarize the entire within-unit exposure distribution throughout the study. In our framework, the exposure quantile function is viewed as a functional covariate with respect to quantile levels. Therefore, we further allow effects of exposure at different quantile levels to vary. Estimation and inference are carried out under a Bayesian hierarchical modeling framework that also propagates uncertainties associated with the estimation of exposure quantile functions into the health effect estimate. \section{Motivating Data and Application} \label{s:data} Ambient air pollution exposure has been identified as a risk factor of various diseases \citep{landrigan2017air, manisalidis2020environmental}, contributing significantly to global disease burden \citep{boogaard2019air}. Here we studied short-term associations between daily ED visits and ambient air pollution exposures in a time-series design \citep{bhaskaran2013time}. We obtained daily counts of ED records during the period January 1st, 1999 - December 31st, 2002 in Atlanta. Counts were also stratified by one on the 40 ZIP code tabulation areas (ZCTAs). We analyzed three causes for ED visits identified using International Classification of Diseases 9th Revision (ICD-9) diagnosis code: (1) respiratory disease (ICD-9 codes: 460-465, 466.0, 477, 466.1, 466.11, 466.19, 480-486, 491-493, 496, 786.07), (2) a subset of respiratory diseases which only includes asthma or wheeze (ICD-9 codes: 493, 786.07), and (3) cardiovascular disease (ICD-9 codes: 410-414, 427-428, 433-437, 440, 443-445, 451-453). We examined four traffic-related air pollutants: particulate matter with aerodynamic diameter $<2.5$ microns (PM$_{2.5}$), carbon monoxide (CO), nitrogen oxides (NO$_\text{x}$), and elemental carbon (EC), a constituent of PM$_{2.5}$. Separately for each pollutant, population-level distributions of personal exposure were obtained from SHEDS model \citep{burke2001population}. This model is a stochastic simulator producing daily personal exposure at the census tract level \citep{ozkaynak1996particle, jenkins1996personal, dionisio2013development}. To estimate the personal exposure distributions of ambient concentrations of an air pollutant, the SHEDS model first simulates exposures for multiple hypothetical individuals for each census tract that reflect the demographic characteristics (e.g., age, sex, work locations) of the at-risk population using Census data. The amount of time each hypothetical individual spends in various microenvironments is obtained by randomly assigning an activity diary from the US Environmental Protection Agency (EPA)'s Consolidated Human Activity Database based on their demographics. Their daily personal exposure is then computed by summing time-weighted average exposure across all thirteen microenvironments that are categorized into four types (outdoors, vehicle, residential indoors, and non-residential indoors microenvironments). For this analysis, the personal exposure distribution at the census tract level were then aggregated to the ZCTA level. For the health analysis, several meteorological variables were obtained from Daymet to account for potential confounding by meteorology \citep{thornton2016daymet}. These include daily minimum temperature, maximum temperature, and dew-point temperature. \section{Method} \subsection{Model for count outcome and mean exposure} We first describe the conventional log-linear model for aggregate outcomes. Let $y_i$ denote the number of events (e.g., ED visits, hospital admissions, deaths) observed for group $i=1,\dots,n$, and let $\boldsymbol{x}_{i} = (x_{i1},\dots,x_{im_i})^T$ denote a vector of exposures (e.g., personal exposures to air pollution) collected from $m_i$ individuals for group $i$. A group can be formed by geographical areas or a time interval. In most applications, the mean of the group-specific exposures are used in an over-dispersed Poisson log-linear regression model such as: \begin{equation} \label{healthmodel_mean} \begin{gathered} Y_i|\lambda_i \sim Poisson(\lambda_i), \quad \lambda_i|\xi, \eta_i \sim Gamma(\xi, \exp(\eta_i)), \text{ and} \\ \eta_i = \alpha \mu_i + \boldsymbol{\gamma}^T\boldsymbol{Z}_i + \epsilon_i, \end{gathered} \end{equation} where $\mu_i$ denotes the true mean exposure of group $i$ often estimated by the sample average $\sum_{j=1}^{m_i} x_{ij}/m_i$, parameter $\alpha$ represents the effect of the mean exposure, $\boldsymbol{Z}_i$ is a vector of other covariates with regression coefficients $\boldsymbol{\gamma}$ (including an intercept), $\xi$ controls the amount of over-dispersion, and $\epsilon_i$ represents a mean-zero spatial/temporal residual process. Using this parametrization, the log of the expectation of $Y_i$ equals to $\log(\xi) + \eta_i$. Model (\ref{healthmodel_mean}) only depicts the association between expected health outcome count and population-wide mean exposure which ignores exposure heterogeneity among individuals. Therefore, model (\ref{healthmodel_mean}) may be an insufficient framework to characterize effects of exposure on health. For example, model (\ref{healthmodel_mean}) fails to capture health effects associated with changes in exposure distributions having same population-wide means. \subsection{Model for count outcome and exposure distribution} To capture effects of the entire exposure distribution and to allow effects to vary by quantile levels, we propose a model treating exposure quantile functions as functional covariates. The proposed scalar-on-quantile-function over-dispersed Poisson log-linear regression model is given as: \begin{equation} \label{healthmodel} \begin{gathered} Y_i|\lambda_i \sim Poisson(\lambda_i), \quad \lambda_i|\xi, \eta_i \sim Gamma(\xi, \exp(\eta_i)), \text{ and} \\ \eta_i = \int_0^1\beta(\tau)Q_i(\tau)d\tau + \boldsymbol{\gamma}^T\boldsymbol{Z}_i + \epsilon_i, \end{gathered} \end{equation} where $Q_i(\cdot)$ denotes the exposure quantile function of a continuous exposure for group $i$. Note that $\beta(\tau)$ represents the effect of the exposure's $\tau$-th percentile on the mean of the health outcome while other parameters were previously described in model (\ref{healthmodel_mean}). To flexibly characterize the association between health outcome and the exposure, the coefficient $\beta(\tau)$ is assumed to be a smooth function of quantile levels and is modeled via a finite number of basis functions. Specifically, $\beta(\tau)$ is specified as: \begin{equation} \label{betataubasis} \beta(\tau) = \sum_{j=0}^{p}K_{j,p}(\tau)\beta_j, \end{equation} where $K_{j,p} = \Big(\sqrt{2(p-j)+1}\Big)(1-\tau)^{p-j}\sum_{k=1}^{j}(-1)^{k}{{2p+1-k}\choose{j-k}}{{j}\choose{k}}\tau^{j-k}$ denotes the orthonormal Bernstein polynomials of degree $p$ defined over the interval $[0, 1]$ \citep{bellucci2014explicit}. With this basis expansion, the proposed model in Eqn. (\ref{healthmodel}) can be written as: \begin{equation} \label{healthmodel1} \eta_i = \boldsymbol{\beta}^{T} \int_0^1 \boldsymbol{K}(\tau) Q_i(\tau)d\tau + \boldsymbol{\gamma}^T\boldsymbol{Z}_i + \epsilon_i, \end{equation} where $\boldsymbol{\beta} = (\beta_0,\dots,\beta_p)^T$ is a vector of basis coefficients and $\boldsymbol{K}(\tau) = (K_{0,p}(\tau),\dots,K_{p,p}(\tau))^T$ is a vector of basis functions. We note that the domain of Bernstein polynomials coincides with the domain of exposure quantile functions, which could facilitate the estimation of $\boldsymbol{\beta}$, compared to B-splines or Gaussian kernels. The Bernstein polynomials are chosen also because they have been shown to accurately approximate various smooth function forms with a small number of basis functions \citep{bellucci2014explicit}. We note one special case where effects of exposure are the same at different quantile levels (i.e., $\beta(\tau)$ is a constant in $\tau$). Then the proposed model (\ref{healthmodel}) will reduce to model (\ref{healthmodel_mean}) because $\int_0^1 Q_i(\tau)d\tau = \mu_i$. \subsection{Estimation and inference} \subsubsection{Quantile functions are known} With known quantile functions, Eqn. (\ref{healthmodel1}) can be reparametrized as a regular scalar-on-scalar model with a covariate vector $\boldsymbol{X}_i^{*}=\int_0^1 \boldsymbol{K}(\tau) Q_i(\tau)d\tau$. For example, in \cite{reich2009analysis}, $Q_{i}(\tau)$ is assumed to be Normal quantile functions. An efficient fully Bayesian inference procedure is available for the over-dispersed Poisson regression by introducing latent Polya-Gamma random variables \citep{polson2013bayesian, neelon2019bayesian}. Using the Polya-Gamma method, coefficients $\boldsymbol{\beta}$ and $\boldsymbol{\gamma}$ can be estimated via Markov Chain Monte Carlo (MCMC) using Gibbs sampling. With independent normal priors introduced for coefficients $\boldsymbol{\beta}$ and $\boldsymbol{\gamma}$, the full conditional distribution for those regression coefficients is a multivariate normal distribution. \subsubsection{Quantile functions are unknown} For the more realistic case of unknown quantile functions, we propose a two-stage Bayesian estimation procedure. In the first stage, quantile function $Q_i(\tau)$ for each group $i$ is again modeled using basis expansion and estimated from individual-level exposures (e.g., SHEDS simulations in our application). In the second stage, the health model (\ref{healthmodel}) is fitted with estimated quantile functions while accounting for the statistical uncertainties associated with the first-stage estimation. Following previous semiparametric Bayesian approaches for modeling quantile processes for continuous variables \citep{reich2012spatiotemporal}, the quantile function for exposures in group $i$ is expanded as: \begin{equation} Q_i(\tau) = \theta_{0,i} + \sum_{l=1}^{L}B_l(\tau)\theta_{l,i}, \end{equation} where $B_l(\tau)$ is the $l$-th basis function, and $\theta_{l,i}$ are basis coefficients. Choices of basis function $B_l(\tau)$ include piecewise Gaussian or piecewise Gamma functions, and their expressions are provided in supplementary materials. Both choices permit us to flexibly characterize the potentially skewed distribution of exposures. However, for exposures that are strictly positive (e.g., ambient air pollution concentration), piecewise Gamma functions are recommended. With the use of piecewise Gaussian or Gamma functions, $\theta_{0,i}$ represents the median of the $i$-th group exposure distribution and $\theta_{l,i}$ for $l=1\dots,L$ characterize the shape of the distribution. The quantile function uniquely defines the density. Let $x_{ij}$ denote the exposure level measured for the $j$-th individual within the $i$-th group. When $x_{ij}$ is assumed to follow a distribution corresponding to a quantile function $Q_i(\tau)$, the likelihood for a set of individual-level exposures is given by \begin{equation} L(\boldsymbol{\theta}_{0,\boldsymbol{\cdot}},\{\boldsymbol{\theta}_{l,\boldsymbol{\cdot}}\}_{l=1}^{L};\{\boldsymbol{x}_i\}_{i=1}^{n}) = \prod_{i=1}^{n} \prod_{j=1}^{m_i}\Big[\frac{d Q_i(\tau)}{d \tau}\Big]^{-1} \biggr\rvert_{\tau^*:Q_{i}(\tau^*) = x_{ij}}, \end{equation} where $\boldsymbol{\theta}_{0,\boldsymbol{\cdot}} = (\theta_{0,1}, \dots,\theta_{0,n})^T$, $\boldsymbol{\theta}_{ l,\boldsymbol{\cdot}} = (\theta_{l,1}, \dots,\theta_{l,n})^T$, and $\boldsymbol{x}_{i} = (x_{i1}, \dots, x_{im_i})^T$ is a vector of personal exposures collected for group $i$ of $m_i$ individuals. It is important to note that quantile functions have to be non-decreasing. To ensure this property, $\theta_{l,i} > 0$ should hold for any $i$ and $l$ \citep{reich2012spatiotemporal}. In the first-stage estimation, this constraint is imposed by introducing an unconstrained latent variable $\theta_{l,i}^{*}$. Specifically, $\theta_{l,i} = \texttt{max}\{\theta_{l,i}^{*}, \nu \}$, where $\nu$ is a small constant (e.g., 0.01). For spatial or time-series data, one can easily introduce spatial or temporal dependence for $\boldsymbol{\theta}_{0,\boldsymbol{\cdot}}$ and $\boldsymbol{\theta}_{l,\boldsymbol{\cdot}}^{*} = (\theta_{l,1}^*,\dots,\theta_{l,n}^{*})^T$ in the Bayesian hierarchical modeling framework to allow quantile processes to vary by time or locations. Estimation of all model parameters is carried out via MCMC algorithms. In the second-stage, the health model is fitted while accounting for the uncertainties associated with estimating exposure quantile functions. When the exposure quantile function is expanded using basis functions, the health model in Eqn. (\ref{healthmodel1}) becomes: \begin{equation} \label{healthmodel2} \eta_i = \boldsymbol{\beta}^{T} \Big[ \int_0^1 \boldsymbol{K}(\tau) \boldsymbol{B}(\tau)^{T} d\tau \Big] \boldsymbol{\theta}_{\boldsymbol{\cdot}, i} + \boldsymbol{\gamma}^T\boldsymbol{Z}_i + \epsilon_i, \end{equation} where $\boldsymbol{B}(\tau) = (1, B_{1}(\tau), \dots, B_{L}(\tau))^{T}$ and $\boldsymbol{\theta}_{\boldsymbol{\cdot},i} = (\theta_{0, i}, \theta_{1,i}, \dots, \theta_{L,i})^{T}$. Since $\boldsymbol{B}(\tau)$ is pre-specified, uncertainties of estimated $\boldsymbol{\theta}_{\boldsymbol{\cdot},i}$, contribute to uncertainties of the estimation of quantile functions. To appropriately propagate uncertainties resulting from the first-stage estimation, we consider an approach which is commonly used in environmental health studies for incorporating uncertainties in estimated exposures \citep{carroll2006measurement, lee2017rigorous}. Specifically, a multivariate normal (MVN) prior is assumed for $\boldsymbol{\theta}_{\boldsymbol{\cdot},i}$ with mean and variance-covariance matrix computed from its posterior predictive distribution obtained from the first-stage estimation. Similarly to the case in which quantile functions are known, we view $\boldsymbol{X}_{i}^{*} = \big[ \int_0^1 \boldsymbol{K}(\tau) \boldsymbol{B}(\tau)^{T} d\tau \big] \boldsymbol{\theta}_{ \boldsymbol{\cdot},i}$ as a random covariate vector. With MVN prior assumed for $\boldsymbol{\theta}_{\boldsymbol{\cdot},i}$, the prior of $\boldsymbol{X}_{i}^{*}$ is also MVN. It is worth noting that posterior distributions of $\boldsymbol{\theta}_{\boldsymbol{\cdot},i}$ are correlated across groups when quantile processes are assumed to vary by groups. As the number of groups increases, this approach becomes computational expensive since the MCMC algorithm requires sampling from a high-dimensional MVN distribution. In the simulation study and real data analysis, we ignore the correlation between groups to facilitate the computation. We find that this does not meaningfully impact inference for the health effect association, as also recently demonstrated in \cite{comess2022bayesian}. As in the case of known quantile functions, the estimation of coefficients $\boldsymbol{\beta}$ and $\boldsymbol{\gamma}$ is carried out by Gibbs sampling with normal priors specified for those coefficients using the Polya-Gamma method. Details of MCMC algorithms for the estimation of quantile functions, and the estimation with known and unknown quantile functions can be found in the supplementary materials. \section{Simulation Studies} \label{s:sim} We conducted simulation studies to examine the impact of not accounting for exposure heterogeneity motivated by our application and evaluated the performance of the two-stage estimation procedure. A variety of associations between exposures and outcomes are considered by specifying different forms of coefficient regression function $\beta(\tau)$. The simulation study assumes that health outcome is collected over $n=1000$ time points and exposure quantile functions are temporally correlated. The temporal dependence was introduced by defining a first-order Gaussian Markov random field process for the unconstrained latent basis coefficients. The true health model and exposure quantile function are: \begin{equation*} \begin{gathered} Y_i|\lambda_i \sim Poisson(\lambda_i), \quad \lambda_i|\xi, \eta_i \sim Gamma(\xi, \exp(\eta_i)), \\ \eta_i = \beta_{0} + \int_0^1\beta(\tau)Q_i(\tau)d\tau, \; i = 1, \dots, 1000, \\ Q_{i}(\tau) = \theta_{0,i} + \sum_{l=1}^{4}B_{l}(\tau)\theta_{l,i},\\ (\theta_{0,1}, \dots, \theta_{0,1000})^T \sim MVN(\theta_{0}, \Sigma_0), \; \Sigma_0 = \sigma_{0}^{2}(D_w - \rho_{0}W)^{-1}, \\ (\theta_{l,1}^{*}, \dots, \theta_{l,1000}^{*})^T \sim MVN(\theta_{l}, \Sigma_1), \; \Sigma_1 = \sigma_{1}^{2}(D_w - \rho_{1}W)^{-1} \; \text{for } l = 1,\dots, 4, \theta_{l,i} = \texttt{max}\{\theta_{l,i}^{*}, \nu=0.01\}, \end{gathered} \end{equation*} where $B_l(\tau)$ are piecewise Gamma functions with 4 basis functions; $W$ is a symmetric matrix with the $(i, i')$ entry equal to 1 if time point $i$ and $i'$ are adjacent, and 0 otherwise; and $D_{w}$ is a diagonal matrix with the $i$-th diagonal element equal to the row sum of $i$-th row of $W$. For each time point $i$, individual exposure data with a sample size of 100 were generated using the quantile function $Q_{i}(\tau)$. To mimic the right-skewed distribution of PM$_{2.5}$ observed in the motivating data, we set $\theta_0 = 7.2$, $\theta_l = 0.9$ for $l=1,\dots, 4$, and parameters controlling temporal correlations of quantile processes $(\sigma_0^2, \rho_0, \sigma_1^2, \rho_1)$ equal to $(1, 0.9, 0.02, 0.9)$. We examined six coefficient regression functions displayed in Figure \ref{Fig:truebetatau}: (1) $\beta(\tau) = 0.5$, (2) $\beta(\tau) = \tau$, (3) $\beta({\tau}) = 1.5\tau^2$, (4) $\beta(\tau) = \frac{4}{3}\tau I(\tau < 0.5) + \frac{2}{3} I(\tau \ge 0.5)$, (5) $\beta(\tau) = \exp(-\frac{\tau^2}{0.328})$, and (6) $\beta(\tau) = -\tau + 1$. These six functions include three types of effects (constant, increasing, and decreasing). We note that $\int_{0}^{1} \beta(\tau) d\tau$ equals to 0.5 under all scenarios, and this quantity is interpreted as the effect of exposures associated with the exposure distribution shifted to the right by one unit (i.e., the mean is increased by one unit). Based on simulated quantile functions $Q_i(\tau)$, 100 health datasets were generated for each of different forms of $\beta(\tau)$ while fixing $\beta_0 = -3.5$. The conventional ``mean" model using the mean of individual exposures at each time point as the covariate was also fitted for the comparison. \begin{figure}[!htbp] \centering \includegraphics[width = 0.9\textwidth]{Fig_truebetatau_colblinded.png} \caption{True coefficient regression functions $\beta(\tau)$ specified for the simulation study} \label{Fig:truebetatau} \end{figure} Three quantities were used for performance evaluation: (a) the effect associated with the exposure distribution shifted to the right by one unit, which is measured by $\int \beta(\tau) d\tau$ for the proposed model and parameter $\alpha$ for the mean model; (b) predictive values of the exposure which is measured by $\int_{0}^{1}\beta(\tau)Q_i(\tau)d\tau$ and $\alpha \mu_i$ for the proposed and mean models, respectively; (c) the total number of exposure-attributable events, which is computed as $\sum_{i=1}^{n}\xi\big\{ \exp \big[\beta_0 + \int_{0}^{1}\beta(\tau)Q_i(\tau)d\tau \big] - \exp(\beta_0)\big \}$ and $\sum_{i=1}^{n} \xi\big[\exp(\beta_0 + \alpha \mu_i) - \exp(\beta_0)\big]$ for the proposed and mean models, respectively. For these quantities, their relative bias, mean squared error (MSE), and 95\% coverage probability (CP) were computed. For $\int_{0}^{1} \beta(\tau) d\tau$ and the total number of exposure-attributable events, their relative bias, MSE, and CP were computed by averaging over simulations. However, for predictive values, we averaged over both simulations and time points. Specifically, when exposure quantile functions were estimated, the MSE of predictive values of the exposure was calculated as: \begin{gather} \frac{1}{n \times D} \sum_{i=1}^{n} \sum_{d=1}^{D} \Big[ \int_0^1 \hat{\beta}^{(d)}(\tau)\hat{Q}_{i}^{(d)}(\tau) d\tau - \int_0^1 \beta(\tau)Q_i(\tau) d\tau \Big ] ^2 \label{quan_MSE} \end{gather} for the proposed model, where subscript $d$ is the index for the simulation with $n=1000$ and $D=100$; $\hat{\beta}^{(d)}(\tau) = \hat{\boldsymbol{\beta}^{(d)}}^{T}\boldsymbol{K}(\tau)$, $\hat{\boldsymbol{\beta}^{(d)}}$ is the vector of estimated basis coefficients defined in Eqn. (\ref{healthmodel1}); $\hat{Q}_i(\tau)^{(d)} = \boldsymbol{B}(\tau)^T \hat{\boldsymbol{\theta}}^{(d)}_{\boldsymbol{\cdot}, i}$, $\hat{\boldsymbol{\theta}}^{(d)}_{\boldsymbol{\cdot}, i}$ are estimated basis coefficients defined in Eqn. (\ref{healthmodel2}). The computation of the relative bias and CP follows a similar manner. Additionally, the estimation performance of $\beta(\tau)$ was examined with respect to its bias, MSE, and CP by averaging over simulations and quantile levels $\tau_j \in \{0, 0.01, \dots, 0.99, 1\}$. For example, MSE of $\beta(\tau)$ is $1/(J \times D) \sum_{j=1}^{J} \sum_{d=1}^{D} \big[ \hat{\boldsymbol{\beta}^{(d)}}^{T}\boldsymbol{K}(\tau_{j}) - \beta(\tau_{j}) \big]^2$. Relative bias was not computed, since $\beta(\tau)$ can take value of 0. In this simulation study, we modeled $\beta(\tau)$ using orthonormal Bernstein polynomials of degree two (i.e., three basis functions) and specified vague normal priors N(0,100) for the corresponding basis coefficients. The over-dispersion parameter included in the health model was updated using Metropolis-Hastings (MH) algorithms with an uniform prior. For the estimation of exposure quantile functions, we used four piecewise Gamma functions to expand quantile functions. Coefficients $\theta_{0,i}$ and $\theta_{l,i}^*$ were assigned N(0, 100) priors and were updated using MH algorithms; $\sigma_{0}^2$ and $\sigma_{1}^2$ were given InvGamma(0.1, 0.1) priors and were updated using Gibbs sampling; discrete priors (i.e., 1000 equally spaced values between 0 and 1) were assigned for $\rho_0$ and $\rho_1$ which were updated using MH algorithms. We generated 10,000 MCMC samples and discarded the first 5,000 samples as burn-in when estimating quantile functions; while 5,000 samples were generated and the first 2,500 samples were discarded as burn-in when estimating health effects regardless of using true or estimated quantile functions. Simulation results from using different exposure covariates (true mean exposures, true exposure quantile functions, and estimated quantile functions) are summarized in Table \ref{t:simres}. We first focus on the case where exposure quantile functions and mean exposures are assumed to be known. Under the scenario where $\beta(\tau)$ is a constant (i.e., S1), results from using quantile functions and mean of exposures are similar. Since $\beta(\tau)$ was modeled using the basis expansion, a larger MSE was observed for the proposed model. For other scenarios, the proposed model resulted in empirically unbiased estimates of health effects. However, we observed biased estimates of health effects when using mean exposures. Specifically, we found positive biases when the upper tail of exposure distributions has larger effects (e.g., S2 and S3), and negative biases when the effects decrease as the quantile level increases (e.g., S5 and S6). The reverse pattern was observed for the total number of events attributed to exposures and predictive values of exposures. In S4 where the health effect first increases and then becomes a constant, the model using mean exposure happened to lead to a nearly unbiased estimate with conservative 95\% credible intervals (CIs) for $\int_{0}^{1} \beta(\tau) d\tau$. However, this model failed to characterize effects of exposures as indicated by the larger MSE and severe under-coverage associated with predictive values of exposures. It is also worth noting that the proposed model performed slightly worse in this scenario, for example, the MSE of $\int_{0}^{1} \beta(\tau) d\tau$ was higher than S2, S3, and S5, likely because $\beta(\tau)$ in S4 is approximated less well by the basis expansion. \begin{singlespace} \begin{table}[!htbp] \footnotesize \begin{center} \caption{Simulation results using different exposure covariates} \label{t:simres} \setlength\tabcolsep{2pt} \renewcommand{\arraystretch}{1.5} \begin{tabular}[1.2\textwidth]{@{}cc ccc l ccc l ccc l ccc@{}} \hline \hline & & \multicolumn{3}{c}{$\int_{0}^{1}\beta(\tau)d\tau$ $^b$} & & \multicolumn{3}{c}{$\beta(\tau)$} & & \multicolumn{3}{c}{\makecell{predictive values \\ of exposures}} & & \multicolumn{3}{c}{\makecell{exposure-attributable \\ events}} \vspace{2pt} \\ \cline{3-5} \cline{7-9} \cline{11-13} \cline{15-17} \vspace*{3pt} Scenario & Covariate $^a$ & \makecell{relative \\ bias} & \makecell{relative\\MSE $^c$} & \makecell{CP \\(\%)} && bias & \makecell{MSE} & \makecell{CP \\ (\%)} && \makecell{relative \\ bias} & \makecell{relative \\ MSE$^c$} & \makecell{CP \\ (\%)} && \makecell{relative \\ bias} & \makecell{relative \\ MSE$^c$} & \makecell{CP \\ (\%)} \\ \hline \multirow{3}{*}{S1} & mean & 0.004 & 1.00 & 94 && - & - & - && 0.004 & 1.000 & 94.00 && 0.001 & 1.000 & 95 \vspace{2pt} \\ & quantile & 0.005 & 1.10 & 96 && 0.002 & 0.016 & 93.70 && -0.002 & 3.889 & 93.39 && 0.000 & 1.069 & 95 \\ & \makecell{quantile \\ with errors} & 0.011 & 1.47 & 92 && 0.004 & 0.031 & 95.48 && 0.004 & 6.475 & 96.41 && 0.001 & 1.101 & 94 \vspace{2pt} \\ \hline \multirow{3}{*}{S2} & mean & 0.009 & 1.00 & 89 && - & - & - && -0.122 & 1.000 & 0.01 && -0.008 & 1.000 & 83\\ & quantile & -0.002 & 0.80 & 96 && -0.001 & 0.015 & 92.17 && -0.002 & 0.052 & 93.66 && -0.000 & 0.610 & 93 \vspace{2pt} \\ & \makecell{quantile \\ with errors} & 0.010 & 1.07 & 91 && 0.003 & 0.032 & 93.13 && 0.010 & 0.108 & 95.50 && 0.000 & 0.620 & 93 \vspace{2pt} \\ \hline \multirow{3}{*}{S3} & mean & 0.019 & 1.00 & 75 && - & - & - && -0.174 & 1.000 & 0.00 && -0.010 & 1.000 & 82\\ & quantile & -0.001 & 0.39 & 97 && -0.000 & 0.013 & 92.92 && -0.003 & 0.023 & 91.74 && 0.000 & 0.408 & 96 \vspace{2pt} \\ & \makecell{quantile \\ with errors} & 0.014 & 0.74 & 90 && 0.005 & 0.036 & 90.47 && 0.017 & 0.056 & 94.12 && 0.001 & 0.398 & 96 \vspace{2pt} \\ \hline \multirow{3}{*}{S4} & mean & 0.003 & 1.00 & 100 && - & - & - && -0.081 & 1.000 & 0.04 && -0.006 & 1.000 & 89 \\ & quantile & -0.001 & 1.01 & 98 && -0.001 & 0.014 & 93.61 && 0.003 & 0.127 & 93.56 && 0.000 & 0.751 & 95 \vspace{2pt} \\ & \makecell{quantile \\ with errors} & 0.008 & 1.38 & 98 && 0.001 & 0.039 & 90.57 && 0.015 & 0.302 & 94.82 && 0.001 & 0.759 & 94 \vspace{2pt} \\ \hline \multirow{3}{*}{S5} & mean & -0.010 & 1.00 & 95 && - & - & - && 0.182 & 1.000 & 0.00 && 0.017 & 1.000 & 77 \\ & quantile & 0.002 & 0.80 & 95 && 0.001 & 0.018 & 95.90 && -0.003 & 0.057 & 95.73 && 0.000 & 0.361 & 95\vspace{2pt} \\ & \makecell{quantile \\ with errors} & 0.003 & 0.85 & 97 && 0.000 & 0.033 & 97.12 && -0.002 & 0.107 & 96.02 && -0.000 & 0.381 & 95 \vspace{2pt} \\ \hline \multirow{3}{*}{S6} & mean & -0.011 & 1.00 & 94 && - & - & - && 0.163 & 1.000 & 0.02 && 0.014 & 1.000 & 80 \\ & quantile & 0.000 & 0.75 & 95 && 0.000 & 0.016 & 95.74 && -0.001 & 0.075 & 95.67 && -0.001 & 0.537 & 95 \\ & \makecell{quantile \\ with errors} & 0.002 & 0.83 & 96 && 0.000 & 0.042 & 94.42 && -0.003 & 0.127 & 95.89 && -0.002 & 0.586 & 93 \\ \hline \hline \end{tabular} \renewcommand{\arraystretch}{1} \end{center} \vspace*{-10pt} {$^a$ \footnotesize mean = true mean exposures, quantile = true exposure quantile functions, quantile with errors = estimated exposure quantile functions.} \\ {$^b$ \footnotesize For the model using mean exposure as the exposure covariate, the parameter $\alpha$ was reported.} \\ {$^c$ \footnotesize Relative MSE was computed by treating the model using the true mean exposure as the reference.} \end{table} \end{singlespace} We also evaluated the decision to select the proposed model over the conventional ``mean" exposure model informed by the widely available information criterion (WAIC) \citep{watanabe2010asymptotic}. Among 100 simulations, the proportion of simulations in which the WAIC favored the mean model is 82\% under S1 where the mean model is a valid and better choice. While for other scenarios, the WAIC favored the proposed model over $95\%$ of the time. When exposure quantile functions were estimated from the simulated dataset containing individual-level exposures, we applied the two-stage estimation procedure to account for uncertainties of estimating exposure quantile functions. Figure~\ref{fig:sim_quan}(a) shows simulated exposure data over nine consecutive days where exposure distributions are right skewed and change over time smoothly. Estimated quantile functions traced the truth well as shown in Figure~\ref{fig:sim_quan}(b). Compared to the case where true quantile functions were used, MSE of those four quantities were increased (Table \ref{t:simres}). However, across all scenarios, coverage probabilities still achieved or were close to the nominal level. We found that without accounting for estimation uncertainties by using the posterior means of the estimated quantile functions can lead to bias and under-coverage (results are not shown). \begin{figure}[!htbp] \centering \includegraphics[width = \textwidth]{Fig_obs_est_quanfun.png} \caption{(a) boxplots of exposures observed on nine consecutive days in the simulated data, (b) true/estimated exposure quantile functions for nine consecutive days} \label{fig:sim_quan} \end{figure} \section{Real Data Analysis} In this section, we analyzed the motivating data introduced in Section~\ref{s:data} using both the proposed scalar-on-quantile-function model and the conventional model using average concentrations of air pollutants as the exposure. \subsection{Estimation of daily exposure quantile functions} Distributions of four air pollutants from SHEDS at one representative ZCTA are presented in Figures \ref{f:box_quan_SHEDS}(a)-(d). We observed different degrees of skewness in exposure distributions for all four air pollutants. We noted that distributions of CO and EC are very different across days compared to NO$_\text{x}$ and PM$_{2.5}$. Hence, for estimating quantile functions, quantile functions of CO and EC were assumed to be independent across days and ZCTAs, while temporal correlations were introduced for quantile functions of NO$_\text{x}$ and PM$_{2.5}$. In this analysis, we used the same priors, the number of MCMC iterations, and burn-in as in Section~\ref{s:sim}. Figures \ref{f:box_quan_SHEDS}(e)-(h) shows the corresponding empirical quantile and estimated quantile functions from using four piecewise Gamma functions. Overall, our use of basis functions sufficiently capture exposure distributions with larger uncertainties in lower and upper tails as expected. \begin{figure}[!htbp] \centering \includegraphics[width = \textwidth]{Boxpl_EstimatedQuan_SHEDS_zip17_30032_7days_laballdates.png} \caption{(a)-(d) Boxplots of concentrations of air pollutants obtained from SHEDS at ZCTA 30032 on seven representative days, (e)-(h) empirical/estimated quantile functions with 95\% credible intervals of air pollutants obtained from SHEDS at ZCTA 30032 on seven representative days (empirical quantile functions are denoted by solid points).} \label{f:box_quan_SHEDS} \end{figure} \subsection{Estimation of health effects for ED visits} Associations between ED visits and same-day air pollution concentrations were examined using the proposed model with estimated quantile functions and uncertainty propagation, and the conventional model using sample mean of individual exposures at the ZCTA level. Following the previous health analysis \citep{sarnat2013application}, the following confounders were controlled for in all models: non-linear effect of year-specific temporal trends using day of year, non-linear effect of same-day dew-point temperature, indicators of day of week, an indicator of federal holidays, non-linear effect of 3-day moving average of minimum temperature (maximum temperature was controlled for cardiovascular disease ED visits). All non-linear effects were modeled with natural cubic splines with four degrees of freedom. Exchangeable ZCTA-specific random intercepts were included for all models. We varied the number of basis functions used for modeling $\beta(\tau)$ from two to three, and results from the model with lower WAIC are reported. The same priors as in Section~\ref{s:sim} were introduced for basis coefficients and the over-dispersion parameter; the variance parameter of spatial random effects were assumed to have InvGamma(0.1, 0.1) prior. We ran for 7,500 iterations, the first 3,500 being discarded as burn-in. Figure \ref{fig:SHEDSbetatau} plots the estimated $\beta(\tau)$ with 95\% CIs for different combinations of air pollutants and causes of ED visits. We observed that the WAIC clearly favors the proposed model under some cases (e.g., panels (b), (c), (e), (f), and (h) of Figure \ref{fig:SHEDSbetatau}). For example, Figure \ref{fig:SHEDSbetatau}(e) shows that lower and upper tails of the distribution of EC concentrations have larger effects on respiratory disease ED visits. The resulting percent (\%) increase in risk associated with one unit shift to right for the distribution of EC concentrations is estimated to be 2.58 (95\% CI: 0.82 - 4.31) and 0.56 (95\% CI: -0.14 - 1.26) using the proposed and the conventional models, respectively. In some cases, the WAIC indicates that the model utilizing quantile functions and the model using sample mean of exposures fitted the data equally. For example, Figure \ref{fig:SHEDSbetatau}(j) shows that estimates of health effects of PM$_{2.5}$ on asthma or wheeze ED visits basically remain the same across quantile levels, matching the estimate obtained from the mean model. Estimates of percent increase in risk for the rest of combinations are presented in Table S1. \begin{figure}[!htbp] \centering \includegraphics[width = \textwidth]{Fig_betatau_SHEDS_091622_neworder.png} \caption{Estimates of $\beta(\tau)$ with 95\% credible intervals from analyzing the motivating data (as\_whz = asthma or wheeze ED visits, resp = respiratory disease ED visits, cvd = cardiovascular disease ED visits).} \label{fig:SHEDSbetatau} \end{figure} Figures \ref{fig:SHEDSRR}(a)-(d) display estimated quantile functions where their corresponding exposure medians are at the 25$^{\text{th}}$, 50$^{\text{th}}$, 75$^{\text{th}}$, and 95$^{\text{th}}$ percentiles of the estimated medians across all ZCTAs and days. Dashed horizontal lines mark mean exposure calculated from SHEDS data used for estimating the quantile functions. These quantile functions were selected to represent different exposure contrasts across ZCTAs and days. Estimates of relative risks associated with changes in selected estimated quantile functions from the proposed and the conventional models are shown in Figures \ref{fig:SHEDSRR}(e)-(h). Two contrasts were selected to represent different exposure effects: (1) comparing quantile functions with medians at the 75$^{\text{th}}$ and 25$^{\text{th}}$ percentiles to represent typical exposure contrast, and (2) comparing quantile functions with medians at the 95$^{\text{th}}$ and 50$^{\text{th}}$ percentiles to represent more extreme exposure effects. \begin{figure}[!htbp] \centering \includegraphics[width = \textwidth]{Fig_quan_RR_SHEDS_091622_neworder_til.png} \caption{Short-term associations between ED visits associated with two observed exposure distributions defined by the exposure median (75$^{\text{th}}$ versus 25$^{\text{th}}$, and 95$^{\text{th}}$ versus 50$^{\text{th}}$ percentiles of the distribution of estimated medians across all ZCTAs and days). Results obtained from models using the mean concentrations as the exposure are also shown. as\_whz = asthma or wheeze, resp = respiratory disease, cvd = cardiovascular disease.} \label{fig:SHEDSRR} \end{figure} For short-term associations between ambient concentrations of CO and respiratory ED visits and cardiovascular disease ED visits, as shown in Figures \ref{fig:SHEDSbetatau}(b) and (c), the proposed model including quantile functions was preferred, and we found that effects of CO at lower quantile levels are more pronounced. The corresponding short-term associations for the two selected contrasts are presented in Figure \ref{fig:SHEDSRR}(e). We observed that simply using average concentrations of CO as the covariate in the health model underestimated relative risk of CO on cardiovascular disease ED visits and respiratory disease ED visits compared with the proposed model that considers the entire exposure distributions. Differences in the estimated number of ED visits attributed to the exposure to air pollution are also present. For example, Figures \ref{fig:mapAD}(a)-(b) illustrates differences in the number of exposure-attributable ED visits by ZCTA when effects of air pollutants vary by their quantile levels. Specifically, the total number of cardiovascular ED visits attributed to CO exposure was estimated to be 798 (95\% CI: 74 - 3,240) using the proposed model, while the mean model yielded an estimate of 640 (95\% CI: -80 - 1,343). In contrast, for PM$_{2.5}$ and asthma or wheeze ED visits where health effects are invariant with respect to quantile levels, the proposed model and the conventional model led to similar results (Figure \ref{fig:mapAD}(c)). \begin{figure}[!htbp] \centering \includegraphics[width = \textwidth]{Fig_map_reldif_AD_091622.png} \caption{Relative differences of the ZCTA-level number of exposure-attributable ED visits between using the proposed exposure-quantile model and the conventional mean-exposure model (as\_whz = asthma or wheeze ED visits, resp = respiratory disease ED visits, cvd = cardiovascular disease ED visits).} \label{fig:mapAD} \end{figure} \section{Discussion} In this work, we propose a scalar-on-quantile-function approach to fully characterize effects of environmental exposures on aggregate health outcomes by treating exposure quantile functions as functional covariates. Compared to methods which solely include summary statistics of personal exposures as the exposure metric of interest, our approach accounts for within-group exposure heterogeneity and allows more flexible associations between exposures and aggregate health outcomes. In addition, parametric distribution assumptions on exposure distributions are not necessary in our approach. With the proposed Bayesian two-stage estimation procedure, estimates of health effects can be obtained while incorporating uncertainties in the estimation of exposure quantile functions. This two-stage procedure also alleviates the computation burden when associations between one exposure and multiple health outcomes are examined, compared to approaches that jointly model exposure and health data. Applying the proposed model to the motivating ED visits data in Atlanta, we identified novel short-term associations between ambient air pollution concentrations and ED visits which were masked when daily population average exposures were linked to ED visits. For example, results suggest that effects of ambient concentrations of CO on respiratory disease ED visits and cardiovascular disease ED visits are highest at lower quantile levels. These new findings may be important for identifying subpopulations most vulnerable to ambient air pollution. For the majority of pollutant and outcome pairs, we found robust and positive associations comparable to the conventional approach, which strengthens prior evidence on the negative health effects of air pollution. The proposed model was motivated by the SHEDS data which provide simulated personal exposure to different air pollutants in Atlanta over four years. While personal exposures are not widely available in large scale population-based epidemiological studies, the proposed model can be applied to more general settings. Specifically, the proposed approach is applicable for scenarios where within group exposure heterogeneity exists and can be characterized using quantile functions. For example, in the scenario where environmental exposures are predicted using spatial-temporal models at finer spatial resolutions compared to spatial resolution of the health data, our proposed approach can be applied with exposure quantile functions derived from predicted exposures and population density. In addition, the health outcome does not have to to be restricted to aggregated counts. For example, in the application of analyzing birthweight data in North Carolina conducted by \cite{berrocal2011use}, the effects of an individual's exposure distribution can be assessed using our approach. In this work, we focus on single environmental exposure. One further extension of the proposed approach is to simultaneously examine effects of multiple exposures on aggregate health outcome. A possible strategy is to incorporate quantile surface of exposures as the functional predictor in the health model, which might account for correlations between exposures. In the real data analysis, we found that the estimation of exposure quantile functions is sensitive to outliers. As a result, larger uncertainties of estimated quantile functions are observed in the distribution tails and the estimation of health effects may be affected. To mitigate the impact of outliers on the exposure quantile estimation, one could consider introducing parametric methods for characterizing tails of exposure distributions \citep{zhou2012estimating}. \section{Acknowledgements} We thank Lisa Baxter and Kathie Dionisio from the US EPA for providing the SHEDS exposure data. \bibliographystyle{apalike} \section*{Supplementary Materials} \renewcommand{\thesection}{S\arabic{section}} \setcounter{equation}{0} \renewcommand{\theequation}{S\arabic{equation}} \setcounter{table}{0} \renewcommand{\thetable}{S\arabic{table}} \setcounter{figure}{0} \renewcommand\thefigure{S\arabic{figure}} \begin{singlespace} \begin{table}[H] \small \begin{center} \caption{Estimates of percent (\%) increase in risk associated with one unit shift to right for the distribution of air pollutant concentrations from analyzing the motivating data.} \label{t:RRincrease_SHEDS} \setlength\tabcolsep{2pt} \renewcommand{\arraystretch}{1.5} \begin{tabular}[1.2\textwidth]{cc cc c cc} \hline \hline & & \multicolumn{2}{c}{using estimated quantile functions} & & \multicolumn{2}{c}{using sample mean of individual exposures} \\ \cline{3-4} \cline{6-7} air pollutant & ED visit $^a$ & estimate & 95\% CI & & estimate & 95\% CI \\ \hline \multirow{3}{*}{CO} & asthma/wheeze & 2.84 & (0.09, 5.67) && 1.44 & (-0.09, 3.00) \\ & resp & 2.42 & (0.79, 4.06) && 0.73 & (-0.15, 1.63) \\ & cvd & 3.29 & (0.53, 6.16) && 1.40 & (-0.17, 2.96) \\ \hline \multirow{3}{*}{EC} & asthma/wheeze & 2.80 & (-0.17, 5.80) && 1.39 & (0.14, 2.65)) \\ & resp & 2.58 & (0.82, 4.31) && 0.56 & (-0.14, 1.26) \\ & cvd & 2.26 & (-0.45, 5.09) && 1.12 & (-0.16, 2.41) \\ \hline \multirow{3}{*}{NO$_\text{x}$} & asthma/wheeze & 135.51 & (-48.37, 965.89) && 42.00 & (-14.03, 132.80) \\ & resp & 1.78 & (-58.17, 144.89) && 0.46 & (-24.49, 33.50) \\ & cvd & -28.37 & (-84.01, 206.99) && 24.07 & (-23.92, 104.32) \\ \hline \multirow{3}{*}{PM$_{2.5}$} & asthma/wheeze & 0.83 & (0.09, 1.60) && 0.82 & (0.53, 1.10) \\ & resp & 0.47 & (0.02, 0.94) && 0.51 & (0.34, 0.68) \\ & cvd & -0.07 & (-0.81, 0.66) && 0.42 & (0.12, 0.72) \\ \hline \hline \end{tabular} \end{center}\vspace*{-10pt} {$^a$ \footnotesize resp = respiratory disease, cvd = cardiovascular disease.} \\ \end{table} \end{singlespace} \section{Basis functions for modeling exposure quantile functions} \label{app:basisfun_quan} Let $0=\kappa_1 < \dots < \kappa_{L+1}=1$ denote two boundaries and $L-1$ equally spaced inner knots over the interval $[0,1]$. The $l$-th basis function $B_l(\tau)$ with $\kappa_l < 0.5$ is defined as: \begin{equation*} B_l(\tau) = [ F^{-1}(\kappa_l) - F^{-1}(\kappa_{l+1}) ] \boldsymbol{I}(\tau < \kappa_l) + [F^{-1}(\tau) - F^{-1}(\kappa_{l+1})]\boldsymbol{I}(\kappa_l \le \tau < \kappa_{l+1}) + 0 \boldsymbol{I}(\kappa_{l+1} \le \tau), \end{equation*} for the $l$-th basis function with $\kappa_l \ge 0.5$, $B_l(\tau)$ is defined as: \begin{equation*} B_l(\tau) = 0 \boldsymbol{I}(\tau < \kappa_l) + [ F^{-1}(\tau) - F^{-1}(\kappa_{l})]\boldsymbol{I}(\kappa_l \le \tau < \kappa_{l+1}) + [F^{-1}(\kappa_{l+1}) - F^{-1}(\kappa_{l})] \boldsymbol{I}(\kappa_{l+1} \le \tau), \end{equation*} where $F^{-1}$ is the standard normal quantile function for piecewise Gaussian functions or the quantile function of Gamma distribution with pre-specified shape and scale parameters for piecewise Gamma functions, and $\boldsymbol{I}(\cdot)$ is an indicator fucntion. Following \cite{smith2013bsquare}, the shape and scale parameters are chosen to be 5 and 1, respectively. \section{MCMC algorithms} \label{app:MCMC} \subsection{Polya-Gamma distributions} The following facts about PG distribution has been presented in \cite{pillow2012fully} and \cite{polson2013bayesian}. \begin{enumerate} \item For any choice of $a$ and a PG random variable $\omega \sim PG(b, 0)$, where $b > 0$, we have \begin{equation} \frac{\exp{(\eta)}^{a}}{[1 + \exp{(\eta)}]^{b}} = 2^{-b}\exp{(\kappa \eta)}\int_{0}^{\infty} \exp{(-\omega\eta^2/2)}p(\omega|b, 0) d\omega, \end{equation} where $p(\omega|b, 0)$ denotes the density function of random variable $\omega$ and $\kappa = a - b/2$. \item The density function of PG random variable $\omega^{*} \sim PG(b, c)$, where $b > 0$ can be written as: \begin{equation} p(\omega^{*} | b, c) = \frac{\exp(-c^2 \omega^{*}/2)p(\omega^{*}|b, 0)}{\int_{0}^{\infty} \exp{(-c^2\omega/2)}p(\omega|b, 0)d\omega} \end{equation} \end{enumerate} \subsection{MCMC algorithm for estimating exposure quantile functions} \label{app:MCMCquan} Consider a case where exposure quantile functions are correlated across groups by allowing the basis coefficients to follow a first-order Gaussian Markov random field process (the same setting as in Section 4 and in the estimation of quantile functions of NO$_{\text{x}}$ and PM$_{2.5}$ in our application). Specifically, the quantile function for group $i$ is specified as: \begin{equation*} \begin{gathered} Q_{i}(\tau) = \theta_{i,0} + \sum_{l=1}^{L}B_{l}(\tau)\theta_{i,l}, \; i=1,\dots,n, \\ (\theta_{0,1}, \dots, \theta_{0,n})^T \sim MVN(\theta_{0}, \Sigma_0), \; \Sigma_0 = \sigma_{0}^{2}(D_w - \rho_{0}W)^{-1}, \\ (\theta_{l,1}^{*}, \dots, \theta_{l,n}^{*})^T \sim MVN(\theta_{l}, \Sigma_1), \; \Sigma_1 = \sigma_{1}^{2}(D_w - \rho_{1}W)^{-1} \; \text{for } l = 1,\dots, L, \theta_{l,i} = \texttt{max}\{\theta_{l,i}^{*}, 0.01\}, \end{gathered} \end{equation*} where $W$ is a symmetric adjacency matrix; and $D_{w}$ is a diagonal matrix with the $i$-th diagonal element equal to the row sum of $i$-th row of $W$. Let $x_{ij}$ denote the exposure for $j$-th observation for group $i$, $j=1,\dots,m_{j}$, $i=1,\dots,n$, and let $\boldsymbol{x}_i$ denote the vector of individual exposures collected for group $i$. \begin{enumerate} \item Update $(\theta_{0,1},\dots,\theta_{0,n})$ using Metropolis-Hasting (MH) algorithms \begin{equation*} \pi \big(\theta_{0,i} | \{\boldsymbol{x}_{i}\}_{i=1,\dots,n}, \{\theta_{l,i}\}_{l=1,\dots,L, i=1,\dots,n}, \{\theta_{0,i': i' \ne i}\} \big) \propto \prod_{j=1}^{m_i} f_i \big(x_{ij}|\theta_{0,i},\{\theta_{l,i}\}_{l=1,\dots,L} \big) \pi(\theta_{0,i}|\{\theta_{0,i': i' \ne i}\}), \end{equation*} where $ f_i \big(x_{ij}|\theta_{0,i},\{\theta_{l,i}\}_{l=1,\dots,L} \big) = \Big[\frac{d Q_i(\tau)}{d \tau}\Big]^{-1} \biggr\rvert_{\tau^*:Q_{i}(\tau^*) = x_{ij}}$, $\pi(\theta_{0,i}|\{\theta_{0,i': i' \ne i}\})$ denotes the conditional normal density function derived by assuming $(\theta_{0,1}, \dots, \theta_{0,n})^T \sim MVN(\theta_{0}, \Sigma_0), \; \Sigma_0 = \sigma_{0}^{2}(D_w - \rho_{0}W)^{-1}$. \item Update $(\theta_{l,1}^{*}, \dots, \theta_{l,n}^{*})$ for $l=1,\dots,L$ \\ Follow the similar step as outlined in Step 1 for updating $(\theta_{0,1},\dots,\theta_{0,n})$ but replacing $\pi(\theta_{0,i}|\{\theta_{0,i': i' \ne i}\})$ with $\pi(\theta_{l,i}^{*}|\{\theta^*_{l,i': i' \ne i}\})$, which is the conditional normal density derived from knowing $(\theta_{l,1}^{*}, \dots, \theta_{l,n}^{*})^T \sim MVN(\theta_{l}, \Sigma_1), \; \Sigma_1 = \sigma_{1}^{2}(D_w - \rho_{1}W)^{-1}$. Finally, letting $\theta_{l,i} = \texttt{max}\{\theta_{l,i}^*, 0.01\}$. \item Update $\theta_{0}$ \\ Introducing the normal prior $N(0, 100)$ for $\theta_{0}$, the conjugate full conditional distribution of $\theta_{0}$ is $N(a_n, A_n)$ \begin{gather*} A_n = (\boldsymbol{X}^T \Sigma_{0}^{-1} \boldsymbol{X} + C^{-1})^{-1}, \\ a_n = A_n \times \big(\boldsymbol{X}^T \Sigma_{0}^{-1} \boldsymbol{\theta}_{0,\boldsymbol{\cdot}} + C^{-1}c\big), \end{gather*} where $\boldsymbol{X}$ is a column vector of 1 with length of $n$, $\boldsymbol{\theta}_{0,\boldsymbol{\cdot}} = (\theta_{0,1}, \dots, \theta_{0, n})^T$, $c$ and $C$ are mean and variance of the normal prior assumed for $\theta_{0}$. \item Update $\theta_{l}$ for $l=1,\dots,L$ \\ Follow the same step as outlined for updating $\theta_{0}$, but replacing $\Sigma_{0}^{-1}$ with $\Sigma_{1}^{-1}$, and $\boldsymbol{\theta}_{0,\boldsymbol{\cdot}}$ with $\boldsymbol{\theta}^{*}_{l,\boldsymbol{\cdot}}$. \item Update $\sigma_0^2$ \\ With Inverse-Gamma(0.1, 0.1) prior for $\sigma_0^2$, the conjugate full conditional distribution is Inverse-Gamma($a_n$, $b_n$) \begin{gather*} a_n = 0.1 + n/2, \\ b_n = 0.1 + \frac{(\boldsymbol{\theta}_{0,\boldsymbol{\cdot}} - \theta_{0})^T (D_w - \rho_0 W) (\boldsymbol{\theta}_{0,\boldsymbol{\cdot}} - \theta_{0}) }{2}. \end{gather*} \item Update $\sigma_1^2$ \\ With Inverse-Gamma(0.1, 0.1) prior for $\sigma_1^2$, the conjugate full conditional distribution is Inverse-Gamma($a_n$, $b_n$) \begin{gather*} a_n = 0.1 + \frac{L\times n}{2}, \\ b_n = 0.1 + \frac{\boldsymbol{z}_i^T (D_w - \rho_1 W) \boldsymbol{z}_i }{2}, \end{gather*} where $\boldsymbol{z}_i = \big( (\boldsymbol{\theta}^{*}_{1,\boldsymbol{\cdot}} - \theta_{1})^T, \dots, (\boldsymbol{\theta}^{*}_{L,\boldsymbol{\cdot}} - \theta_{L})^T \big)^T$ is a column vector of length $L\times n$, $\boldsymbol{\theta}^{*}_{l,\boldsymbol{\cdot}} = (\theta^{*}_{l,1},\dots,\theta^{*}_{l,n})^T$ for $l=1,\dots,L$. \item Update $\rho_0$ \\ Since we assign discrete prior for $\rho_0$, the point density of the full conditional distribution is proportional to $p(\boldsymbol{z}_{0} | \sigma^2, \rho_{0}) \pi(\rho_{0})$. The below equations present an efficient computation of the log density of $\boldsymbol{z}_{0}$. \begin{equation*} \begin{split} &\log \big( p(\boldsymbol{z}_{0} | \sigma_0^2, \rho_{0}) \pi(\rho_{0}) \big ) \\ &\propto -\frac{1}{2}\log|\sigma_0^2(D - \rho_{0})^{-1}| - \frac{1}{2 \sigma_0^2}\boldsymbol{z}_{0}^{T}(D - \rho_{0}W)\boldsymbol{z}_{0} \\ &\propto \frac{1}{2}\log|D - \rho_{0}W| + \frac{\rho_{0}}{2 \sigma_0^2}\boldsymbol{z}_{0}^{T}W \boldsymbol{z}_{0} \\ &= \frac{1}{2}\log|D(I - \rho_{0}D^{-1}W)| + \frac{\rho_{0}}{2 \sigma_0^2}\boldsymbol{z}_{0}^{T}W \boldsymbol{z}_{0} \\ &\propto \frac{1}{2}\log|(I - \rho_{0}D^{-1}W)| + \frac{\rho_{0}}{2 \sigma_0^2}\boldsymbol{z}_{0}^{T}W \boldsymbol{z}_{0} = \frac{1}{2}\sum_{i=1}^{n} \log(1 - \rho_{0} \lambda_{i}) + \frac{\rho_{0}}{2 \sigma_0^2}\boldsymbol{z}_{0}^{T}W \boldsymbol{z}_{0} , \end{split} \end{equation*} where $\boldsymbol{z}_0 = \boldsymbol{\theta_{0, \boldsymbol{\cdot}}} - \theta_0$, and $\lambda_{i}$ is the $i$-th eigenvalue of $I - \rho_{0}D^{-1}W$. \item Update $\rho_1$ \\ Follow the similar step as outlined for updating $\rho_0$. \end{enumerate} \subsection{MCMC algorithm for estimating health effects} \label{app:MCMChealth} Consider a proposed model that has intercept but does not include other covariates $\boldsymbol{Z}_i$ and the mean-zero residual process $\epsilon_i$: \begin{equation*} \begin{gathered} Y_i|\lambda_i \sim Poisson(\lambda_i) \quad \lambda_i|\xi, \eta_i \sim Gamma(\xi, \exp(\eta_i)), \\ \eta_i = \beta_{0} + \int_0^1\beta(\tau)Q_i(\tau)d\tau, \; i = 1, \dots, n, \\ \end{gathered} \end{equation*} The density function, expectation, and variance of $Y_{i}$ can be expressed as: \begin{gather*} p(y_{i}|\xi, \eta_{i}) \propto (1 - q_{i})^{\xi}q_{i}^{y_{i}}, \; \text{where } q_{i} = \frac{\exp(\eta_{i})}{1 + \exp{(\eta_{i}})} \\ E(Y_{i}) = \frac{q_{i}\xi}{1 - q_{i}} = \xi \exp(\eta_{i}) = \mu_{i} \\ Var(Y_{i}) = \frac{q_{i}\xi}{(1-q_{i})^2} = \xi \exp{\eta_{i}}(1 + \exp{\eta_{i}}) = \mu_{i} + \frac{1}{\xi} \mu_{i}^2 \end{gather*} Following \cite{pillow2012fully}, a latent PG random variable is introduced to enable the implementation of Gibbs sampling for full Bayesian inference of over-dispersed log-linear models. Let $\omega_{i}$ denote the latent variable following $PG(y_{i} + \xi, \eta_{i})$. \subsubsection{exposure quantile functions are known} \label{app:MCMChealth_known} Let $\boldsymbol{X}_{i}^* = \int_{0}^{1} \boldsymbol{K}(\tau) Q_i(\tau) d\tau$, where $\boldsymbol{K}(\tau) = \big( K_{0,p}(\tau), \dots, K_{p,p}(\tau) \big)^T$ is a vector of orthonormal Bernstein polynomials of degree $p$, and $\beta(\tau) = \sum_{j=0}^p K_{j,p} (\tau) \beta_{j}$ (refer to Eqn. (3) in the manuscript for more details). \begin{enumerate} \item Update latent variable $\omega_{i}$ \\ $\omega_{i} | y_{i}, \eta_{i}, \xi \sim PG(y_{i} + \xi, \eta_{i})$, draw $\omega_{i}$ for each observation using \texttt{R} function \texttt{rpg} in package \texttt{BayesLogit}. \item Update $\boldsymbol{\beta} = (\beta_0, \beta_{1}, \dots, \beta_{p})^T$ \\ Given $\boldsymbol{y} = (y_{1}, \dots, y_{n})$, $\boldsymbol{\omega} = (\omega_{1}, \dots, \omega_{n})$, $\boldsymbol{\eta} = (\eta_{1}, \dots, \eta_{n})$, the full conditional distribution of $\boldsymbol{\beta}$ is given by \begin{equation*} \begin{split} & \pi(\boldsymbol{\beta} | \boldsymbol{y}, \boldsymbol{\eta}, \boldsymbol{\omega}, \xi) \\ &\propto \pi(\boldsymbol{\beta}) \times \prod_{i=1}^{n} \frac{\exp(\eta_{i})^{y_{i}}}{[1 + \exp(\eta_{i})]^{(y_{i}+\xi)}}p(\omega_{i}| y_{i} + \xi, \eta_{i}) \\ & \stackrel{\text{Eqn. (S1)}}{\propto} \pi({\boldsymbol{\beta}}) \prod_{i=1}^{n} \exp{\{\frac{1}{2}(y_{i}-\xi)\eta_{i}\}} \int_{0}^{\infty} e^{-\omega_{i}\eta_{i}^2/2} p(\omega_{i}|y_{i}+\xi, 0) d\omega_{i} \times p(\omega_{i}| y_{i}+\xi, \eta_{i}) \\ & \stackrel{\text{Eqn. (S2)}}{=} \pi({\boldsymbol{\beta}}) \prod_{i=1}^{n} \exp{\{\frac{1}{2}(y_{i}-\xi)\eta_{i}\}} \frac{e^{-\omega_{i}\eta_{i}^2/2} p(\omega_{i}|y_{i}+\xi, 0)}{p(\omega_{i}| y_{i} + \xi, \eta_{i})} \times p(\omega_{i}| y_{i} + \xi, \eta_{i}) \\ &= \pi({\boldsymbol{\beta}}) \prod_{i=1}^{n} \exp{\{\frac{1}{2}(y_{i}-\xi)\eta_{i}\}} \exp{\{-\omega_{i}\eta_{i}^2/2\}} p(\omega_{i}|y_{i} + \xi, 0) \\ & \propto \pi({\boldsymbol{\beta}}) \prod_{i=1}^{n} \exp{ \big\{ -\frac{\omega_{i}}{2} \big( \frac{y_{i}-\xi}{2\omega_{i}} - \eta_{i}\big)^2 \big\} } \end{split} \end{equation*} Given the prior of $\boldsymbol{\beta}$ is $MVN(\boldsymbol{c}, C)$, where $ \boldsymbol{c} = \boldsymbol{0}$ and $C = \text{diag}(100)$. The conjugate full conditional distribution of $\boldsymbol{\beta}$ is $MVN(\boldsymbol{a}_n, A_n)$, which is given by \begin{gather*} A_{n} = \big( \boldsymbol{X}^{T}\Omega\boldsymbol{X} + C^{-1} \big)^{-1}, \\ \boldsymbol{a}_{n} = A_{n} \big(C^{-1}\boldsymbol{c} + \boldsymbol{X}^{T} \Omega \boldsymbol{z} \big), \end{gather*} where $\Omega = \text{diag}(\boldsymbol{\omega})$ is a $n \times n$ square matrix, $\boldsymbol{X}$ is a design matrix corresponding the parameter vector $\boldsymbol{\beta}$ with size of $n \times (p+1)$. We also define $z_{i} = \frac{y_{i} - \xi}{2\omega_{i}}$ and $\boldsymbol{z} = (z_{1}, \dots, z_{n})$ ($n \times 1$ vector). This Gibbs sampling algorithm can be applied for models that include $\boldsymbol{Z}_i$ and $\epsilon_i$ by modifying the design matrix. \item Update $\xi$ \\ As suggested in \cite{neelon2019bayesian}, we choose zero-truncated normal distribution centered at the current value as the proposal distribution, the corresponding variance (i.e., tuning parameter) is denoted as $d_{\xi}$. Given the uniform prior, the full conditional distribution of $\xi$ is: \begin{equation*} \begin{split} \pi(\xi | \boldsymbol{y}, \boldsymbol{\eta}) \propto \prod_{i=1}^{n} \frac{\exp(\eta_{i})^{y_{i}}}{\{1 + \exp(\eta_{i})\}^{y_{i} + \xi}} \pi(\xi) \end{split} \end{equation*} \end{enumerate} \subsubsection{exposure quantile functions are estimated} \label{app:MCMChealth_est} To propagate uncertainties associated with estimating exposure quantile functions, MVN prior is assumed for $\boldsymbol{\theta}_{\boldsymbol{\cdot}, i} = (\theta_{0,i}, \theta_{1, i}, \dots, \theta_{L,i})$, $L=4$ in our simulation studies and application. With $MVN(\hat{\boldsymbol{\theta}}_{\boldsymbol{\cdot}, i}, \Lambda_i)$ prior introduced for $\boldsymbol{\theta}_{\boldsymbol{\cdot}, i}$, this parameter vector can be updated when fitting the health model with its conjugate full conditional distribution following a MVN distribution, where $\hat{\boldsymbol{\theta}}_{\boldsymbol{\cdot}, i}$ and $\Lambda_i$ are computed from its posterior predictive distribution obtained from estimating exposure quantile functions. For updating other parameters (e.g., $\boldsymbol{\beta}$, $\xi$), following same procedures outlined in Section \ref{app:MCMChealth_known} of the supplementary materials. \begin{comment} \section{Simulation setting} \label{app:simsetup} The true health model and exposure quantile functions used in the simulation study are: \begin{equation*} \begin{gathered} Y_i|\lambda_i \sim Poisson(\lambda_i) \quad \lambda_i|\xi, \eta_i \sim Gamma(\xi, \exp(\eta_i)), \\ \eta_i = \beta_{0} + \int_0^1\beta(\tau)Q_i(\tau)d\tau, \; i = 1, \dots, 1000, \\ Q_{i}(\tau) = \theta_{i,0} + \sum_{l=1}^{4}B_{l}(\tau)\theta_{i,l}, \\ (\theta_{0,1}, \dots, \theta_{0,1000})^T \sim MVN(\theta_{0}, \Sigma_0), \; \Sigma_0 = \sigma_{0}^{2}(D_w - \rho_{0}W)^{-1}, \\ (\theta_{l,1}^{*}, \dots, \theta_{l,1000}^{*})^T \sim MVN(\theta_{l}, \Sigma_1), \; \Sigma_1 = \sigma_{1}^{2}(D_w - \rho_{1}W)^{-1} \; \text{for } l = 1,\dots, 4, \theta_{l,i} = \texttt{max}(\theta_{l,i}^{*}, \nu=0.01), \end{gathered} \end{equation*} where $B_l(\tau)$ are piecewise Gamma functions with 4 basis functions; $W$ is a symmetric matrix with the $(i, i')$ entry equal to 1 if time point $i$ and $i'$ are adjacent, and 0 otherwise; and $D_{w}$ is a diagonal matrix with the $i$-th diagonal element equal to the row sum of $i$-th row of $W$. For each time point $i$, individual exposure data with a sample size of 100 were generated using the quantile function $Q_{i}(\tau)$. To mimic the right-skewed distribution of PM$_{2.5}$ observed in the motivating data, we set $\theta_0 = 7.2$, $\theta_l = 0.9$ for $l=1,\dots, 4$, and parameters controlling temporal correlations of quantile processes $(\sigma_0^2, \rho_0, \sigma_1^2, \rho_1)$ equal to $(1, 0.9, 0.02, 0.9)$. Based on simulated quantile functions $Q_i(\tau)$, 100 health datasets were generated for each of different forms of $\beta(\tau)$ while fixing $\beta_0 = -3.5$. \section{Evaluation metrics used in the simulation study} \label{app:metrics} When exposure quantile functions were estimated, the MSE of predictive values of the exposure was calculated as: \begin{gather*} \frac{1}{n \times D} \sum_{i=1}^{n} \sum_{d=1}^{D} \Big[ \int_0^1 \hat{\beta}^{(d)}(\tau)\hat{Q}_{i}^{(d)}(\tau) d\tau - \int_0^1 \beta(\tau)Q_i(\tau) d\tau \Big ] ^2 \label{quan_MSE} \end{gather*} for the proposed model, where subscript $d$ is the index for the simulation with $n=1000$ and $D=100$; $\hat{\beta}^{(d)}(\tau) = [\hat{\boldsymbol{\beta}}^{(d)}]^{T}\boldsymbol{K}(\tau)$, $\hat{\boldsymbol{\beta}}^{(d)}$ is the vector of estimated basis coefficients defined in Eqn. (\ref{healthmodel1}); $\hat{Q}_i(\tau)^{(d)} = \boldsymbol{B}(\tau)^T \hat{\boldsymbol{\theta}}^{(d)}_{\boldsymbol{\cdot}, i}$, $\hat{\boldsymbol{\theta}}^{(d)}_{\boldsymbol{\cdot}, i}$ are estimated basis coefficients defined in Eqn. (\ref{healthmodel2}). The computation of the relative bias and CP follows a similar manner. For evaluating the performance on estimating $\beta(\tau)$, its bias, MSE, and CP were computed by averaging over simulations and quantile levels $\tau_j \in \{0, 0.01,\dots,0.99,1\}$. For example, MSE of $\beta(\tau)$ is: \begin{equation*} \frac{1}{J \times D} \sum_{j=1}^{J} \sum_{d=1}^{D} \big\{ [\hat{\boldsymbol{\beta}}^{(d)}]^{T}\boldsymbol{K}(\tau_{j}) - \beta(\tau_{j}) \big\}^2. \end{equation*} The computation of the bias and CP follows a similar manner. \end{comment} \bibliographystyle{apalike}
\section{Introduction} Many applications that model large volumes of data are based on tracking cardinalities of events or observations. Consequently, these applications make extensive use of data sketches that support fast, approximate cardinality estimation~\citep{cormode2020small}. For instance, approximate distinct counting is supported via variants of the HyperLogLog (HLL) sketch \citep{flajolet2007hyperloglog,heule2013hyperloglog} in popular data management systems including Amazon Redshift, ClickHouse, Google BigQuery, Splunk, Presto, Redis, and more. At the expense of a small estimation error, these approximate methods drastically reduce the computational cost of distinct counting to run in linear time, using only bounded memory. An additional key feature of distinct-count sketches is the ability to merge two or more sketches to obtain cardinality estimates over their union. This enables not only distributed computation, but also many rich aggregation possibilities from previously computed sketches. As a result, modern data pipelines rely extensively on the performance and functionality of such cardinality sketches. Increasingly, privacy concerns constrain the operation of data processing. Organizations demonstrating commitments to preserving users' privacy require that data collected from individuals be subject to appropriate mitigations before being passed to downstream processing. Specifically, protections such as differential privacy are used to protect sensitive data while still giving accurate query response. Although sketching techniques may appear to offer protection by reducing data, it is well-known that sketching alone does not automatically provide a privacy guarantee \citep{desfontaines2018cardinality}. The summaries---or even the estimates calculated from them---can leak considerable information about whether the specific items belong to the underlying set. Recently, it has been shown that the contents of sketches do meet a privacy standard \textit{if} the associated hash functions are not known to the observer \citep{choi2020differentially,smith2020flajolet,dickens2022nearly}. However, it is not plausible to assume secret hash functions when the computation is shared among multiple entities in a large scale system. In particular, all participants must know the hash when working with sketches that will be merged, and using the same hash in multiple sketches generates correlated randomness that breaks the privacy guarantees. This creates an important gap to make these high-throughput systems private. Previous attempts to construct privacy-preserving sketches \citep{pagh2020efficient} do not offer practical mergeable sketches as the errors are too large (Section \ref{sec:evaluation}). In this work, we present the Sketch-Flip-Merge (SFM) summaries, a practical, mergeable, and provably private approach to distinct-count sketching. In particular, we produce summaries that satisfy the strong definition of $\varepsilon$--differential privacy (DP) \citep{dwork2006calibrating,dwork2008differential} even when the hash function is known publicly. By attaching the privacy guarantee to the summary itself---not just the cardinality estimate---we may safely release summaries corresponding to sensitive multisets, enabling safe cardinality estimation over any union of such sets using the privacy-preserving summaries in lieu of the original sensitive data. The key to our approach is to adapt the sketch of \citet{flajolet1985probabilistic}, which is often referred to as either \textit{FM85} or \textit{probabilistic counting with stochastic averaging (PCSA)}. Although subsequent sketches such as HLL \citep{durand2003loglog, flajolet2007hyperloglog, heule2013hyperloglog} further optimized the space usage, squeezing the space makes them less amenable to privacy protection. In contrast to PCSA where the simple, partitioned binary structure limits the sensitivity to a bit flip, these sketches store extremal hash values where small changes to the input can cause big changes in the summary, requiring more noise and yielding less accurate results. Furthermore, our methods generalize to any bitmap based sketch. \textbf{Related Work.} Privacy-preserving cardinality sketches have been the subject of several earlier works. While recent efforts provide DP guarantees for HLL-like sketches \citep{smith2020flajolet,dickens2022nearly}, they rely on random, secret hash functions that preclude the ability to merge sketches. Using a fixed, public hash, \citet{choi2020differentially} obtain a DP cardinality estimate from a LogLog sketch by adding noise to the cardinality estimator, but the sketch itself remains sensitive and unsafe for release or sharing. \citet{stanojevic2017distributed} design a DP algorithm for obtaining cardinality estimation on the union of two multisets using perturbed Bloom filters, but their method does not generalize and scale to the union of more than two multisets. One line of work extends PCSA with randomized response and subsampling of items to achieve privacy \citep{tschorsch2013algorithm,nunez2019rrtxfm}. However, \citet{tschorsch2013algorithm} fails to achieve a DP guarantee, and \citet{nunez2019rrtxfm} does not address merging sketches. \citet{kreuter2020privacy} design two sketches, including one based on PCSA. While their DP sketches cannot be merged to form a single sketch, multiple sketches may be used to estimate the union's cardinality if all sketches use the same privacy parameters. The PCSA-based sketch of \citet[][Section~6]{pagh2020efficient} achieves DP and supports merging but is impractical. In our experiments, their estimator frequently failed to produce an estimate and returned impractically large errors. Finally, \citet{desfontaines2018cardinality} give an impossibility result where both privacy and high accuracy are impossible, but only when many sketches are merged, which is consistent with our results. \textbf{Contributions.} We propose two practical methods for constructing \textit{mergeable} DP cardinality sketches and obtaining cardinality estimates. The first uses a deterministic bit-merging operation used by \citet{pagh2020efficient}. We prove this merge requires a suboptimal form of randomized response, even after exponential improvement to the prior privacy analysis (Corollary~\ref{cor:equivalent-eps}). Our main methodological contribution is a novel randomized merge allowing for up to a further 75\% variance reduction over the optimized deterministic merge. We generalize our randomized merge to perform to arbitrary bitwise operations on binary data that may be of independent interest. We also develop a composite likelihood-based estimator for cardinality and prove this estimator is asymptotically optimal for both private and non-private sketches based on PCSA. \textbf{Outline.} We give a brief overview of PCSA sketching in Section~\ref{sec:background}, then define privacy and recap randomized response in Section~\ref{sec:privacy}. Merging sketches is enabled through the careful design of randomized response mechanisms and merge operations over collections of randomized bits in Section~\ref{sec:merging}. In Section~\ref{sec:sketches}, we propose a fast cardinality estimator for the private PCSA sketch and analyze its properties. We compare these methods with private and non-private alternatives in Section~\ref{sec:evaluation} and state conclusions in Section~\ref{sec:discussion}. All proofs are deferred to the appendices. \textbf{Notation.} We write $[m] = \{1, \dots, m\}$. $\otimes$ denotes the Kronecker product. Logical operations are denoted $\lor$ (or), $\land$ (and), $\lxor$ (xor), and $\lnot$ (not). We use the natural logarithm $\log = \log_e$. Equality in distribution is denoted $\overset D=$. The cardinality of a set $D$ is denoted $|D|$. \section{Background and Problem Setup} \label{sec:background} Let $D \in \mathcal X^N$ denote a multiset of $N$ items from some universe $\mathcal X$ of objects. The \textit{count-distinct problem} is the task of estimating the number of unique elements in $D$. That is, if $\fn{set}(D)$ denotes the support set of items in $D$, the count-distinct problem aims to approximate $n = |\fn{set}(D)|$ with a data sketch in bounded memory in a single pass over the data. We consider the \emph{private} count-distinct problem for \emph{mergeable} sketches where the information in a sketch satisfies differential privacy (DP) and sketches can be merged to obtain a sketch of the union of underlying datasets. We focus on solutions to the count-distinct problem in which sketches form a binary vector, subject to merge operations performed through element-wise logical operations (e.g., \textit{or}). The class of sketches to which our methods apply include PCSA, linear counting \citep{whang1990linear}, Bloom filters \citep{broder2004network}, and Liquid Legions \citep{kreuter2020privacy}. These are particularly amenable to privacy enhancement through the application of randomized response \citep{warner1965randomized} but require careful design of merge operations for randomized bits. Although this excludes other commonly used sketches such as HyperLogLog and the $k$-minimum value sketch \citep{bar2002counting,giroire2009order}, the richer set of values stored in these sketches make them less suitable for privatization due to their high sensitivity and, hence, higher noise required for privacy. In the remainder of this paper, we focus on the PCSA sketch of \citet{flajolet1985probabilistic}, noting that the results for constructing and merging private sketches in Sections~\ref{sec:privacy} and \ref{sec:merging} apply to related sketches through direct application or simple extensions. The classical PCSA sketch takes the form of a matrix $S = \mathcal S(D) \in \{0, 1\}^{B \times P}$ with $B$ buckets and precision parameter $P$. Given two independent, universal hash functions, $h_1(x) \sim \mathrm{Uniform}([B]), h_2(x) \sim \mathrm{Geometric}(1/2)$, let $\fn{bucket}(x) = h_1(x), \fn{value}(x) = \min \{ P, h_2(x)\}$. Then each bit $S_{ij}$ is equal to 1 iff there exists $x \in D$ such that $\fn{bucket}(x) = i, \fn{value}(x) = j$. Some desirable properties of $S$ are immediate. First, $S$ relies only on the set of hashed values $\{ h_1(x) \}_{x \in D}$ and $\{ h_2(x) \}_{x \in D}$. Hence, it is invariant both to repetitions in $D$ and to the order in which the elements of $D$ are processed. Additionally, two sketches $\mathcal S(D_1)$ and $\mathcal S(D_2)$ may be merged via a simple bitwise-\textit{or}, $\mathcal S(D_1) \lor \mathcal S(D_2) = \mathcal S(D_1 \cup D_2)$, as each entry $S_{ij}$ in the merged sketch is equal to $1$ iff there is an item $x$ in at least one of $D_1, D_2$ for which $\fn{bucket}(x) = i, \fn{value}(x) = j$. Importantly, when an adversary knows $h_1$ and $h_2$, the sketch $\mathcal S(D)$ reveals information about elements in $D$. For example, any $x \in \mathcal X$ for which $S_{\fn{bucket}(x), \fn{value}(x)} = 0$ cannot belong to $D$. In what follows, we extend the PCSA sketch to minimize this sort of privacy leakage. \section{Private Sketches} \label{sec:privacy} Differential privacy (DP) \citep{dwork2006calibrating,dwork2008differential} offers a strong and quantifiable notion of privacy. DP mandates that algorithms (\textit{privacy mechanisms}) acting on a dataset $D$ must be randomized---typically through the addition of some carefully tuned noise---so that the distribution of a privacy mechanism's output cannot be significantly influenced by a single input record. As a result, the ability to reverse-engineer information about a single record is limited, and any analysis performed using only the output of the algorithm also satisfies DP. The strength of the DP guarantee is quantified by the parameter $\varepsilon > 0$, often called the privacy budget, with smaller $\varepsilon$ offering stronger privacy. \begin{definition}[\citet{dwork2006calibrating}] \label{def:dp} A randomized algorithm $\mathcal M$ is said to satisfy \textbf{$\varepsilon$--differential privacy (DP)} if for any two neighboring databases $D, D'$ and any set of outputs $E \subseteq \mathrm{Range}(\mathcal M)$, we have: \[ \Pr(\mathcal M(D) \in E) \leq e^\varepsilon \, \Pr(\mathcal M(D') \in E) . \] \end{definition} In the count-distinct problem, we say two multisets $D, D'$ are neighbors if $D'$ can be obtained by adding or removing one unique item to $D$. Given two neighboring multisets $D, D'$ and their corresponding PCSA sketches $\mathcal S(D), \mathcal S(D')$, it follows from the definition of PCSA that these sketches must agree on all but at most one bit. To create DP sketches from $\mathcal S(D)$, then, we consider general DP mechanisms applied to vectors of $\{0, 1\}$ bits, where two vectors $x, x' \in \{0, 1\}^d$ neighbor if they differ on at most one bit (i.e., have \textit{sensitivity} 1). When restricting our attention to mechanisms whose input and output are both a single bit, every DP mechanism can be viewed as an instance of randomized response (RR) \cite{warner1965randomized}. We describe a generalized form of RR as follows. Let $\mathcal F_{p,q}$ denote a general bit-flipping algorithm, parameterized by two probabilities $p$ and $q$, and where classical RR (in the style of Warner) is recovered when $q=1-p$: \[ \mathcal F_{p,q}(x) \sim \begin{cases} \mathrm{Bernoulli}(p), & x = 1 \\ \mathrm{Bernoulli}(q), & x = 0 \end{cases} . \] \begin{theorem} \label{thm:dp-bit-flip} Assume $q \leq 1/2 \leq p$. Applied to vectors with sensitivity 1, the algorithm $\mathcal M_{p, q} : \{0, 1\}^d \to \{0, 1\}^d$ that independently applies $\mathcal F_{p, q}$ to each element of its input is $\varepsilon$-DP if and only if: \begin{equation} \label{eq:dp-pq-constraints} p, q \in (0, 1) \quad \text{and} \quad \max \left\{ \frac{p}{q}, \frac{1-q}{1-p} \right\} \leq e^\varepsilon . \end{equation} \end{theorem} Theorem~\ref{thm:dp-bit-flip} provides an entire family of privacy mechanisms, any $\mathcal M_{p,q}$ with $p, q$ satisfying Eq. \ref{eq:dp-pq-constraints}, that can be applied to a PCSA sketch or any bit vector to make its output $\varepsilon$-DP. Our contribution is then to address several important questions: How can we merge two sketches if their bits have been perturbed via $\mathcal F_{p, q}$? How can we estimate cardinality from noisy sketches? And how should we choose $p$ and $q$? \section{Merging Perturbed Bit Vectors} \label{sec:merging} While a randomized response mechanism $\mathcal M_{p,q}$ converts a PCSA sketch to a private equivalent, this breaks PCSA's merge operation. For ordinary PCSA and multisets $D_1, D_2$, the bitwise-\textit{or} $\mathcal S(D_1) \lor \mathcal S(D_2) = \mathcal S(D_1 \cup D_2)$ defines a merge operation on sketches that yields the same sketch that would be obtained by first taking the union. However, the same operation on noisy sketches does not satisfy this desirable property. We develop merge operations on noisy sketches and identify under what conditions they exist. In particular, Theorem \ref{thm:unique-deterministic-merge} shows that if a merge operation is deterministic, then \textit{xor} $(\lxor)$ is the only possible merge on noisy sketches, and it only works for certain choices of the mechanism $\mathcal M_{p, q}$. We show these choices imply that, at best, such a noisy sketch's cardinality estimates have $4\times$ worse variance than that for regular PCSA on the same sized sketch, even if the privacy budget is near-infinite. Our main contribution is to provide a novel \textit{randomized} merge operation that adds less noise to the sketch. Furthermore, we generalize this operation to perform arbitrary boolean operations on noisy bit vectors. \subsection{Deterministic Merging} \label{sec:merging-deterministic} Applying the standard randomized response mechanism to a PCSA sketch breaks mergeability. PCSA merges sketches using bitwise-\textit{or}, and in the presence of RR noise, the \textit{or} operation results in non-RR noise that biases bits towards 1. \citet{pagh2020efficient} address this by replacing bitwise-\textit{or} ($\lor$) with bitwise-\textit{xor} ($\lxor$) operations whenever the sketch is updated or merged. However, the \textit{xor} operation destroys cardinality information. In particular, the \textit{xor} of a PCSA sketch with itself is the empty sketch. Rather than ensuring sketches are invariant to duplicates, they ensure the \emph{distribution} of (merged) sketches are invariant. They do this by subsampling items (including duplicates) independently with probability $1/2$. This effectively encodes bits that were 1 in PCSA as $\mathrm{Bernoulli}(1/2)$ values, while 0 bits remain 0. Unfortunately, this subsampling operation introduces a lot of noise. Figure~\ref{fig:head-to-head} shows that even for large $\varepsilon$ the resulting cardinality estimates have $4$ times the variance. We show that this penalty on the accuracy is inherent for any \emph{deterministic} merge. Theorem~\ref{thm:unique-deterministic-merge} shows \textit{xor} is, in fact, the only possible way to merge deterministically, so that randomized merges are the only way to improve merging. Our analysis also improves the \citet{pagh2020efficient} sketch by significantly reducing the noise required for an $\varepsilon$-DP privacy guarantee and demonstrates how to merge sketches with different privacy budgets. \begin{theorem} \label{thm:unique-deterministic-merge} Let $f_1 = \mathcal F_{p_1,q_1}, f_2 = \mathcal F_{p_2,q_2}, f_3 = \mathcal F_{p_3,q_3}$, and let $\circ : \{0, 1\}^2 \to \{0, 1\}$ denote a deterministic and symmetric operation. The following conditions may only be satisfied simultaneously if $\circ = \lxor$ and $p_1 = p_2 = 1/2$: \begin{enumerate} \item $f_1, f_2$ are $\varepsilon_1$-DP and $\varepsilon_2$-DP for $\varepsilon_1, \varepsilon_2 < \infty$. \item $f_1(x) \circ f_2(y) \overset D= f_3(x \lor y)$. \item $f_i(0) \overset D\neq f_i(1)$ for $i = 1, 2, 3$. \end{enumerate} \end{theorem} Using our general family of RR mechanisms, we define a mechanism that adds noise to a PCSA sketch to provide privacy (Lemma~\ref{thm:xor-rr-dp}) while preserving mergeability (Theorem~\ref{thm:xor-rr-merge}). Corollary~\ref{cor:equivalent-eps} shows our privacy analysis is much tighter than that of \citet{pagh2020efficient}. \begin{definition} \label{def:xor-rr} For $\varepsilon > 0$, let $\M^{\operatorname{xor}}_\varepsilon : \{0, 1\}^d \to \{0, 1\}^d$ denote the mechanism that independently applies an asymmetric random response $\mathcal F_{p, q}$ to each element of its input with $p = 1/2, q = 1/(2e^\varepsilon)$. \end{definition} \begin{lemma} \label{thm:xor-rr-dp} $\M^{\operatorname{xor}}_\varepsilon$ is $\varepsilon$--differentially private. \end{lemma} \begin{theorem} \label{thm:xor-rr-merge} $\M^{\operatorname{xor}}_{\varepsilon_1}(x) \lxor \M^{\operatorname{xor}}_{\varepsilon_2}(y) \overset D= \M^{\operatorname{xor}}_{\varepsilon^*}(x \lor y)$, where $\varepsilon^* = -\log(e^{-\varepsilon_1} + e^{-\varepsilon_2} - e^{-(\varepsilon_1 + \varepsilon_2)})$. \end{theorem} \begin{corollary} \label{cor:equivalent-eps} Let $\M^{\operatorname{PS}}_\varepsilon$ denote the $\varepsilon$-DP privacy mechanism of \citet[Section~6]{pagh2020efficient}. Then $\M^{\operatorname{xor}}_\varepsilon = \M^{\operatorname{PS}}_{2(\exp(\varepsilon) - 1)}$ \end{corollary} This tighter privacy analysi \footnote{It is proven in the appendix of \citet{pagh2020efficient} that $q = 1 / (e^\varepsilon + 1)$ satisfies $\varepsilon$-DP, although the recommendation and main results in the paper rely on the choice of $q = 1 / (2 + \varepsilon)$. Our recommendation of $q = 1 / (2e^\varepsilon)$ is optimal under DP constraints.} dramatically reduces noise added to achieve the privacy guarantee, effectively increasing the privacy budget by at least a factor of $2$. Pragmatically, Figure~\ref{fig:head-to-head} shows that error increases exponentially as $\varepsilon \to 0$. \subsection{Randomized Merging} \label{sec:merging-randomized} Theorem~\ref{thm:unique-deterministic-merge} showed that a deterministic merge is only possible if the 1-bits in a PCSA sketch are randomized to $\mathrm{Bernoulli}(1/2)$ values. Thus, even if the privacy budget is nearly infinite, the mergeable DP sketch must add significant noise to the base PCSA sketch. We show that by moving randomness from the base sketch to the merge procedure, we can achieve lower overall noise while using the standard randomized response mechanism (Definition~\ref{def:sym-rr}). \begin{definition} \label{def:sym-rr} For $\varepsilon > 0$, we denote by $\M^{\operatorname{sym}}_\varepsilon : \{0, 1\}^d \to \{0, 1\}^d$ the mechanism that independently applies the standard RR mechanism $\mathcal F_{p, 1-p}$ to each element of its input with $p = e^\varepsilon/(e^\varepsilon + 1)$. \end{definition} \begin{lemma} \label{thm:sym-rr-dp} $\M^{\operatorname{sym}}_\varepsilon$ is $\varepsilon$--differentially private. \end{lemma} A merge is a randomized algorithm $g_{\varepsilon_1, \varepsilon_2} : \{ 0, 1 \}^2 \to \{0, 1\}$ that commutes with $\lor$ in the following sense: \[ g_{\varepsilon_1,\varepsilon_2}(\M^{\operatorname{sym}}_{\varepsilon_1}(x), \M^{\operatorname{sym}}_{\varepsilon_2}(y)) \overset D= \M^{\operatorname{sym}}_{\varepsilon^*}(x \lor y). \] Since $g_{\varepsilon_1, \varepsilon_2} $ is a random mapping from pairs of bits to single bits, we can represent it as a $4 \times 2$ Markov transition matrix. A valid merge operation is the solution of the resulting matrix equality, with $\varepsilon^*$ a free parameter. We obtain a optimal randomized merge operation for $\M^{\operatorname{sym}}$ by solving for the largest $\varepsilon^*$ that generates a valid solution, which is given by: \begin{theorem} \label{thm:sym-rr-merge} Assume $\varepsilon_1, \varepsilon_2 > 0$. Let $q(\varepsilon) = (e^\varepsilon + 1)^{-1}$, \[ \varepsilon^* = -\log(e^{-\varepsilon_1} + e^{-\varepsilon_2} - e^{-(\varepsilon_1 + \varepsilon_2)}), \ q^* = q(\varepsilon^*), \] \[ K_i = \begin{bmatrix} 1 - q(\varepsilon_i) & q(\varepsilon_i) \\ q(\varepsilon_i) & 1 - q(\varepsilon_i) \end{bmatrix} \text{ for } i \in \{1, 2\} \text{, and} \] \[ v^* = (q^*, 1-q^*, 1-q^*, 1-q^*)^T , \] Letting $\otimes$ denote the Kronecker product, define: \[ (t_{00}, t_{01}, t_{10}, t_{11})^T = ( K_1^{-1} \otimes K_2^{-1} ) \, v^* , \text{ and} \] \[ g_{\varepsilon_1,\varepsilon_2}(a, b) \sim \mathrm{Bernoulli}(t_{ab}), \quad a, b \in \{0, 1\}. \] Then $g_{\varepsilon_1,\varepsilon_2}(\M^{\operatorname{sym}}_{\varepsilon_1}(x), \M^{\operatorname{sym}}_{\varepsilon_2}(y)) \overset D= \M^{\operatorname{sym}}_{\varepsilon^*}(x \lor y)$, where $g$ is taken bitwise and independently. \end{theorem} When the original vectors $x$ and $y$ are visible in addition to the merged vector, the $\varepsilon^*$ parameter of Theorems~\ref{thm:xor-rr-merge} and \ref{thm:sym-rr-merge} is best interpreted as a measure of utility in the merged sketch, rather than a privacy budget, since by the post-processing invariance of DP \citep{dwork2006calibrating}, no additional privacy leakage occurs from the release of the merged vector. It is for this reason we seek the maximal $\varepsilon^*$ in merging. Noting that Theorems~\ref{thm:xor-rr-merge} and \ref{thm:sym-rr-merge} produce identical $\varepsilon^*$ and that $\M^{\operatorname{sym}}_\varepsilon$ is less noisy than $\M^{\operatorname{xor}}_\varepsilon$, $\M^{\operatorname{sym}}$ remains the preferred mechanism after merging. \begin{remark} \label{remark:k-way-merge} By induction, the merges prescribed in Theorems~\ref{thm:xor-rr-merge} and \ref{thm:sym-rr-merge} allow any $k$ bit vectors of equal length $x_1, \dots, x_k$ privatized using $\varepsilon_1, \dots, \varepsilon_k$ to be merged, resulting in a vector $v = (x_1 \lor \dots \lor x_k)$ privatized with \[ \varepsilon^* = -\log \left( 1 - \prod_{i=1}^k(1 - e^{-\varepsilon_i} ) \right) . \] A natural question is whether there exists a randomized merge algorithm $g_{\varepsilon_1, \dots, \varepsilon_k} : \{0, 1\}^k \to \{0, 1\}$ that satisfies a property like Theorem~\ref{thm:sym-rr-merge} with a larger $\varepsilon^*$ than given by induction over the pairwise merges. In Appendix~\ref{sec:proofs}, we prove a more general form of Theorem~\ref{thm:sym-rr-merge} (Theorem~\ref{thm:sym-merge-general}), which answers this question in the negative. \end{remark} \subsection{General Boolean Operations} \label{sec:general-boolean-ops} We briefly switch focus from distinct counting to present a generalization to Boolean operations under randomized response that may be of foundational interest, e.g., in designing intersection operations. In distinct-count sketches, set unions correspond to bitwise-\textit{or} operations, and the challenge posed by privacy is performing an equivalent operation over noisy bits. PCSA, like other mergeable sketches, defines a homomorphism $\mathcal S$ from multisets to sketches. The commutative diagram below illustrates this mergeability property, since it does not matter which path one takes from $D_1,D_2$ to $v_1 \lor v_2$. Likewise, our merge operation $g$ from Theorem~\ref{thm:sym-rr-merge} ensures that the privacy mechanism $\mathcal M$ makes the diagram commute. By preserving the structure of the union operation, inferences about the cardinality of the union can be made from merged, private sketches. \begin{center} \begin{tikzpicture} \matrix(m) [ matrix of math nodes, row sep = 2.5em, column sep = 2.5em ] { \text{\small{\textsc{Sets}}} & \text{\small{\textsc{Bit Vectors}}} & \text{\small{\textsc{DP Bit Vectors}}} \\[-2.25em] D_1,D_2 & v_1, v_2 & \mathcal M_{\varepsilon}(v_1), \mathcal M_{\varepsilon}(v_2)\\ D_1 \cup D_2 & v_1 \lor v_2 & \mathcal M_{\varepsilon^*}(v_1 \lor v_2) \\ }; \path[-stealth] (m-2-1) edge node [left] {$\cup$} (m-3-1) (m-2-1.east |- m-2-2) edge node [above] {$\mathcal S$} (m-2-2) (m-3-1) edge node [above] {$\mathcal S$} (m-3-2) (m-2-2) edge node [left] {$\lor$} (m-3-2) (m-2-2) edge node [above] {$\mathcal M_\varepsilon$} (m-2-3) (m-3-2) edge node [above] {$\mathcal M_{\varepsilon^*}$} (m-3-3) (m-2-3) edge node [left] {$g$} (m-3-3) ; \end{tikzpicture} \end{center} Here, we generalize the \textit{or} ($\lor$) merge under $\M^{\operatorname{sym}}$ to any logical operation. In particular, Corollary~\ref{thm:and-sym-rr-merge} shows a simple change in our target probabilities $v^*$ yields the appropriate randomized merge for \textit{and} ($\land$), while Lemmas~\ref{thm:xor-msym} and \ref{thm:not-msym} in Appendix~\ref{sec:and-merging-appendix} demonstrate a merge for \textit{xor} ($\lxor$) and show that \textit{not} ($\lnot$) commutes with $\M^{\operatorname{sym}}$. \begin{corollary} \label{thm:and-sym-rr-merge} Assume the setting of Theorem~\ref{thm:sym-rr-merge}, but set $v^* = (q^*, q^*, q^*, 1-q^*)^T$. Then $g_{\varepsilon_1,\varepsilon_2}(\M^{\operatorname{sym}}_{\varepsilon_1}(x), \M^{\operatorname{sym}}_{\varepsilon_2}(y)) \overset D= \M^{\operatorname{sym}}_{\varepsilon^*}(x \land y)$, where $g$ is taken bitwise and independently. \end{corollary} Formally, for each binary logical operator $\square$, there is a function $\varepsilon^*_\square(\varepsilon_1, \varepsilon_2)$ combining two privacy budgets that endows pairs of bit vectors and privacy budgets with the semigroup structure $(v_1, \varepsilon_1) \cdot (v_2, \varepsilon_2) \ensuremath{:=} (v_1 \,\square\, v_2, \varepsilon^*_\square(\varepsilon_1, \varepsilon_2))$. The privacy mechanism $\M^{\operatorname{sym}}$ then defines a mapping $\phi(v, \varepsilon) := (\M^{\operatorname{sym}}_\varepsilon(v), \varepsilon)$ that is a homomorphism from this semigroup to its noisy counterpart. These operations are summarized in Table~\ref{tab:boolean-operations-on-msym}. \begin{table} \centering \caption{Boolean Operations on Bit Vectors under $\M^{\operatorname{sym}}$} \vskip 0.15in \begin{small} \begin{sc} \begin{tabular}{ccc} \hline Op. ($\square$) & DP Op. & $\varepsilon^*_\square(\varepsilon_1, \varepsilon_2)$ \\ \hline $\lnot$ & Lem.~\ref{thm:not-msym} & --- \\ $\lor$ & Thm.~\ref{thm:sym-rr-merge} & $-\log(e^{-\varepsilon_1} + e^{-\varepsilon_2} - e^{-(\varepsilon_1 + \varepsilon_2)})$ \\ $\land$ & Cor.~\ref{thm:and-sym-rr-merge} & $-\log(e^{-\varepsilon_1} + e^{-\varepsilon_2} - e^{-(\varepsilon_1 + \varepsilon_2)})$ \\ $\lxor$ & Lem.~\ref{thm:xor-msym} & $\log \left( \frac{1 + e^{\varepsilon_1 + \varepsilon_2}}{e^{\varepsilon_1} + e^{\varepsilon_2}} \right)$ \\ \hline \end{tabular} \end{sc} \end{small} \vskip -0.1in \label{tab:boolean-operations-on-msym} \end{table} Our randomized merging technique is crucial in supporting general Boolean operations. Unlike our randomized merge operations, Corollary~\ref{thm:impossible-deterministic-and-or} shows no \textit{deterministic} operations $\circ$ and $\bullet$ can define merge operations for both \textit{or} ($\lor$) and \textit{and} ($\land$) under the same RR mechanism. \begin{corollary} \label{thm:impossible-deterministic-and-or} Assume the setting of Theorem~\ref{thm:unique-deterministic-merge}. Let $\bullet : \{0, 1\}^2 \to \{0, 1\}$ denote a deterministic and symmetric operation. It is impossible to satisfy conditions (1)--(3) of Theorem~\ref{thm:unique-deterministic-merge} in addition to the following: \begin{enumerate}\setcounter{enumi}{3} \item $f_1(x) \bullet f_2(y) \overset D= f_3(x \land y)$. \end{enumerate} \end{corollary} \section{Cardinality Estimation} \label{sec:sketches} The Sketch-Flip-Merge method developed so far satisfies privacy and mergeability requirements, but it remains to show how SFM summaries may be used to estimate cardinalities. We develop a composite likelihood--based estimator that is consistent and asymptotically optimal. We give an analytic estimator of the error that closely matches the true error in our experiments. Likelihood-based approaches to cardinality estimation have been used in the non-private setting \citep{clifford2012statistical,lang2017back,ertl2017new,ting2019approximate}, where they have demonstrated greater accuracy than competing estimators for PCSA. While true maximum likelihood estimation of $n$ given a sketch is computationally infeasible due to non-independence of bits in the sketch \citep{ting2019approximate,ertl2017new}, the marginal likelihood for any bit is easy to derive. Similar to \citet{ting2019approximate}, we derive a composite marginal likelihood estimator \citep{lindsay1988composite,varin2011overview} for $n$. Let $C_{ij}$ denote the number of unique items $x \in D$ mapped to bucket $i$ and value $j$ in the sketch and $\rho_{ij}$ be the probability an item is mapped to that location. Then, assuming the use of universal random hashes, the following generative process describes the SFM summary $T = \mathcal M_{p, q}(\mathcal S(D))$. \begin{align*} (C_{11}, \dots, C_{BP}) &\sim \mathrm{Multinomial}(n, \rho_{11}, \ldots, \rho_{BP}) \\ T_{ij} \mid C_{ij} &\sim \mathcal F_{p,q}( 1(C_{ij} > 0) ) \end{align*} While the joint distribution of $ \{ C_{ij} \}_{i,j}$, and hence the observed $ \{ T_{ij} \}_{i,j}$, involves an intractable sum over integer partitions of $n$ into at most $BP$ parts, the marginal distribution of a single bit $T_{ij}$ is easy to compute. Note that cell $C_{ij}$'s probability of occupancy $\rho_{ij}$ depends only on its level $j$, with $\rho_{ij} = 2^{-\min\{j, P-1\}} / B$. Then $\Pr(C_{ij}=0 \mid n) = \gamma_j^n$, where $\gamma_j = 1-\rho_{ij}$, and \[ T_{ij} \sim \mathrm{Bernoulli}\left( p (1-\gamma_j^n) + q \gamma_j^n \right). \] The composite marginal log-likelihood \citep{lindsay1988composite,varin2011overview} replaces the true log-likelihood by the surrogate $\ell_{p, q}(n; t)$ that sums over marginal log-probabilities, \[ \ell_{p, q}(n; t) = \sum_{ij} (1 - t_{ij}) \log \left( 1 - p + (p-q) \gamma_j^n \right) + \sum_{ij} t_{ij} \log \left( p - (p-q) \gamma_j^n \right), \] where $t = \mathcal M_{p, q}(\mathcal S(D))$ denotes a realized SFM summary. The corresponding composite maximum likelihood estimator is $\hat n = \max_n \ell_{p,q}(n; t)$ and can be optimized by Newton's method. The required first and second derivatives of $\ell_{p,q}$ are \begin{align*} \ell'_{p, q}(n; t) &= \sum_{ij} (1 - t_{ij}) \tfrac{(p-q) \gamma_j^n \log(\gamma_j)}{1 - p + (p-q)\gamma_j^n} - \sum_{ij} t_{ij} \tfrac{(p-q) \gamma_j^n \log(\gamma_j)}{p - (p-q)\gamma_j^n} , \\ \ell''_{p, q}(n; t) &= \sum_{ij} (1 - t_{ij}) \tfrac{(1-p) (p-q) (\log \gamma_j)^2 \gamma_j^n}{(1 - p + (p-q) \gamma_j^n)^2} - \sum_{ij} t_{ij} \tfrac{p (p-q) (\log \gamma_j)^2 \gamma_j^n}{(p - (p-q) \gamma_j^n)^2} . \end{align*} In the absence of privacy (i.e., $p = 1, q = 0$), $\ell_{p, q}(\, \cdot \, ; t)$ is strictly concave. While this is not true in the private case, Theorem~\ref{thm:shape-of-loglik} states that the expectation of $\ell_{p, q}$ remains concave over the interval $(0, n+\Delta)$ for some $\Delta > 0$. \begin{theorem} \label{thm:shape-of-loglik} Let $D$ be a multiset such that $|\fn{set}(D)| = n$. Let $T = \mathcal M_{p, q}(\mathcal S(D))$. Let $f(\hat n) = \mathbb{E}[\ell_{p, q}(\hat n; T)]$, where the expectation is taken over the randomness of the hash functions $h_1, h_2$ and the privacy mechanism $\mathcal M_{p, q}$. Then $f(\hat n)$ attains a global maximum at $\hat n = n$ and is concave on an interval containing $(0, n]$ in its interior. \end{theorem} \subsection{Theoretical Results} \label{sec:theory} We choose to use composite marginal likelihood due to its attractive theoretical properties. In particular, the use of a true likelihood, even if incomplete, ensures that cardinality estimates are asymptotically consistent, and the Hessian of the composite likelihood provides an estimate of the variance \citep{ting2019approximate}. We further show the cardinality estimates are asymptotically optimal in the typical case when the cardinality is large relative to the sketch size. \begin{theorem} \label{thm:sketch convergence in probability} Let $S_n$ denote a PCSA summary of $n$ distinct items with $B(n)$ buckets and $P=\infty$ levels. Let $\overline{S}_n$ denote a modified PCSA summary of $\mathrm{Poisson}(n)$ distinct items, and $\tilde{S}_n$ denote one where the composite marginal likelihood is the true likelihood. If $B \log B =o(\sqrt{n})$, then there exists modified PCSA summaries $\tilde{S}_n, \overline{S}_n$ where \[ \Pr(S_n = \tilde{S}_n = \overline{S}_n) \to 1 \quad \mbox{as $n \to \infty$.} \] \end{theorem} \begin{corollary} \label{cor:asymptotic efficiency} The composite likelihood estimator of the SFM sketch's cardinality is asymptotically efficient in the asymptotic regime in Theorem \ref{thm:sketch convergence in probability}. \end{corollary} We outline the proofs and provide details in Section~\ref{sec:sketch-proofs} of Appendix~\ref{sec:proofs}. The main difficulty is that entries in an SFM summary are dependent, since each item can only be allocated to one cell. By constructing a coupling between sketches $S_n, \overline{S}_n$ with dependent and independent entries, we show they are asymptotically equal. In these coupled processes, the bucket with maximum difference in item allocations can only differ by only a small amount, $O_p(\sqrt{n} /B \log B)$. By showing an item updates its bucket's sketch values with probability $O(1/v_i)$ (where $v_i$ is the number of items in bucket $i$), we conclude the coupled sketches are, in fact, equal with probability going to 1 when the average bucket allocation $v_i \approx n/B$ grows fast enough to make the small differences in item allocation irrelevant. Since $\overline{S}_n, \tilde{S}_n$ have independent bits, we couple them via the inverse CDF method and directly bound the probability that they differ. Since the sketches are the same asymptotically, applying the exact same RR noise to them implies their privatized versions are the same, and any estimator on them has the same asymptotic sampling distribution. Therefore, the asymptotically efficient MLE for the independent-entry sketch, i.e., the composite likelihood estimator, is also asymptotically efficient for the true SFM summary $S_n$. \begin{remark} \label{remark:poissonization} This result also proves the MLE derived under the approximation that each bin has $\mathrm{Poisson}(n/B)$ items is asymptotically efficient. This can be extended to HyperLogLog and other sketches to show pseudo-likelihood based estimators \citep{ertl2017new, ting2019approximate} that have good empirical properties are, in fact, asymptotically optimal. \end{remark} \textbf{Error Estimation.} Like the Fisher information matrix for MLE's, the inverse Godambe (or sandwich) information provides a consistent estimate of the estimator's variance. The Godambe information is $G(n) = H(n) J^{-1}(n) H(n)$ where $-J(n)$ is the Hessian of the expected log composite likelihood at $n$ and $H(n) = \Var(\ell_{p,q}'(n, T))$ is the variance of the composite score functions. In the non-private case, \citet{ting2019approximate} demonstrated that composite marginal likelihood variance estimates for HyperLogLog based on Fisher information and Godambe information are nearly identical for large cardinalities and that the Fisher information overestimates the variance at small cardinalities due to the negative dependence of buckets. Figure \ref{fig:error-by-n} shows this overestimation is much less pronounced when independent randomized response noise is added. Thus, we use only the Hessian to define the \textit{estimated standard error} as \begin{align} \label{eq:fisher-error} \widehat{\mathrm{SE}}_{p, q}(B, P, n) &= \sqrt { 1 / \mathbb{E}[ -\ell''_{p, q}(n; T) ] } \\ &= \left[ B (p-q) \sum_{j=1}^P (\log \gamma_j)^2 \gamma_j^n \left( \tfrac{p}{p - (p-q) \gamma_j^n} - \tfrac{1-p}{1 - p + (p-q) \gamma_j^n} \right) \right]^{-1/2} , \nonumber \end{align} where $T = \mathcal M_{p, q}(S)$ for a random PCSA sketch $S$ of size $B \times P$ and cardinality $n$. Figure \ref{fig:head-to-head} in Section \ref{sec:evaluation} demonstrates empirically that our error estimates $\widehat{\mathrm{SE}}_{p, q}(B, P, n)$ are a good approximation for the error. \section{Evaluation} \label{sec:evaluation} We evaluate our methods on both real-world and synthetic datasets. We demonstrate empirically that the SFM summary is the first mergeable $\varepsilon$-DP distinct counting sketch with practical performance, since the errors for the \citet{pagh2020efficient} sketch are impractically large. Among private sketches, our novel randomized-merge sketch construction dominates the deterministic-merge sketches. Thus, our improvements on the construction, estimation, and privacy analysis yield practical gains. Moreover, our theoretical error closely approximates empirical error. \subsection{Experiment Setup} We consider four different private distinct counting sketches in our experiments. Among our methods, \textit{SFM (sym)}{} pairs $\M^{\operatorname{sym}}_\varepsilon$ with our randomized merge procedure, while \textit{SFM (xor)}{} pairs $\M^{\operatorname{xor}}_\varepsilon$ with the deterministic \textit{xor} merge. Both SFM methods use the estimator of Section~\ref{sec:sketches}. We compare these methods against the sketch and estimator of \citet{pagh2020efficient} implemented two ways: \textit{PS (loose)}{} constructs sketches using $\M^{\operatorname{PS}}_\varepsilon = \mathcal M_{p, q}$ with $p = 1/2, q = 1 / (2 + \varepsilon)$ as prescribed in \citet{pagh2020efficient}, while \textit{PS (tight)}{} uses the tightened $\M^{\operatorname{xor}}_\varepsilon$ (Definition~\ref{def:xor-rr}). By Corollary~\ref{cor:equivalent-eps}, the sketch construction of \textit{PS (tight)}{} at $\varepsilon$ is equivalent to that of \textit{PS (loose)}{} at $\varepsilon' = 2(e^\varepsilon - 1)$. We also consider two non-private sketches as baseline comparisons in our final experiment, noting that we should not expect the accuracy of a private sketch to be as strong as a non-private one. In what follows, \textit{FM85} denotes non-private PCSA using the estimator of \citet{flajolet1985probabilistic}, and \textit{HLL} denotes HyperLogLog \citep{flajolet2007hyperloglog}. We compare HLL sketches against PCSA sketches at equal bucket counts, noting that the HLL sketches are smaller per bucket than the corresponding PCSA sketches. We measure estimation error primarily in the form of \textit{relative root mean squared error (RRMSE)}, defined as \[ \mathrm{RRMSE}(\hat n_1, \dots, \hat n_m; n) = \frac 1n \sqrt{\frac 1m \sum_{i=1}^m(\hat n_i - n)^2} . \] We also measure the \textit{relative efficiency} of two methods as the ratio of their mean squared error, \[ \mathrm{RE}(\hat{n}^{(1)}, \hat{n}^{(2)}) = \frac{\mathrm{MSE}(\hat{n}^{(2)})}{ \mathrm{MSE}(\hat{n}^{(1)})} . \] If two sketches have unbiased estimators, a relative efficiency of $r$ indicates that the less efficient sketch must asymptotically use $r$ times more buckets to get the same accuracy. This is because the asymptotic MSE (variance) decreases proportionally to $1/B$ for these estimators. The simulations use sketches with dimensions $B=4096$, $P=24$ by default, using the xxHash64 \citep{xxhash} hash function, averaged over $m = 1000$ trials. \textbf{Modification to \citet{pagh2020efficient}.} In our experiments, their original estimator frequently failed to produce an estimate. For a desired error tolerance $\beta$, the method computes intervals for all $P$ levels of the sketch and intersects them to produce an estimate. This intersection was frequently empty for small $\beta$. To patch this, we search for the smallest $\beta$ resulting in a non-trivial intersection. We use the midpoint of this interval to estimate $n$. \textbf{Data Sources.} Our experiments use both synthetic and real data. Synthetic data consist of random sets of integers with a fixed cardinality. Real data is taken from the BitcoinHeist paper \citep{akcora2019bitcoinheist}, which provides a database of Bitcoin transactions to $n =$ 2,631,095 unique addresses. The dataset is available in the UCI repository under the CC BY 4.0 license. We note that distinct-count sketches are insensitive to the value distribution of inputs since values are hashed as part of the processing. \subsection{Results} \begin{figure} \centering \includegraphics[width=.5\textwidth]{figures/sfm-rmse-by-n-and-method.pdf} \caption{RRMSE vs. $n$ at $\varepsilon = 1$ on log--log axes, compared across the four methods. RRMSE stabilizes for large $n$.} \label{fig:error-by-n-all} \end{figure} \begin{figure} \centering \includegraphics[width=.5\textwidth]{figures/sfm-rmse-sym-by-n.pdf} \caption{Dashed lines show estimated relative error, $\widehat{\mathrm{SE}}/n$, which is highly accurate for large $n$ and small $\varepsilon$.} \label{fig:error-by-n} \end{figure} \begin{figure} \centering \includegraphics[width=.5\textwidth]{figures/sfm-rmse-by-merge-count.pdf} \caption{RRMSE at $n=10^6$ after merging a given number of \textit{SFM (sym)}{} summaries, each with a given privacy budget $\varepsilon$. Dashed lines show estimated relative error.} \label{fig:merges} \end{figure} Figure~\ref{fig:error-by-n-all} compares the accuracy of the four private methods on synthetic data as the cardinality $n$ ranges from $10^2$ to $10^6$ given a fixed privacy budget of $\varepsilon = 1$. For large cardinalities, RRMSE tends toward a fixed constant for each method. Our methods have error that is an order of magnitude better than \citet{pagh2020efficient} even after we tighten their privacy analysis. For small cardinalities, the relative error increases as the cardinality decreases, which is expected for differentially private methods. Figure~\ref{fig:error-by-n} compares the accuracy for multiple values of $\varepsilon$ but only for the best sketch, \textit{SFM (sym)}{}. It also shows that the RRMSE stabilizes as $n \to \infty$ regardless of the choice of $\varepsilon$. In contrast to DP methods, the SFM summary with infinite privacy budget, which is the same as PCSA with the MDL estimator of \citet{lang2017back}, yields especially accurate estimates at small $n$. Figure~\ref{fig:error-by-n} further shows that the estimated relative error $\widehat{\mathrm{SE}}/n$ (Eq.~\ref{eq:fisher-error}) is an upper bound on the empirical error and yields a good estimate of RRMSE, especially for large cardinalities or small $\varepsilon$. Figure~\ref{fig:merges} demonstrates the tradeoff between merging and privacy in SFM summaries at large cardinality ($n=10^6$). Merge operations result in an accumulation of noise, requiring the use of larger privacy budgets to accommodate greater merge counts. The estimated relative error here is calculated according to Remark~\ref{remark:k-way-merge} and once again closely matches empirical error. We also compare private methods against the real-world BitcoinHeist data over a variety of privacy budgets $\varepsilon$, ranging from 0.25 to 4. The left panel of Figure~\ref{fig:head-to-head} shows the relative efficiency of \textit{SFM (sym)}{} as compared with the other private methods. \textit{SFM (sym)}{} is uniformly more efficient than the PS estimators by at least an order of magnitude. The $100\times$ better efficiency compared to \textit{PS (loose)}{} implies \textit{SFM (sym)}{} would require just 1\% of the space to achieve the same error. Moreover, \textit{SFM (sym)}{} outperforms \textit{SFM (xor)}{} with relative efficiency tending toward 4 for larger $\varepsilon$, indicating that for larger privacy budgets, the randomized-merge \textit{SFM (sym)}{} can achieve comparable accuracy to \textit{SFM (xor)}{} in as little as one fourth the space. The estimation error from this experiment is depicted in absolute terms in the right panel, where we again see that the estimated relative error for SFM is a good approximation for RRMSE. \begin{figure} \centering \includegraphics[width=.6\textwidth]{figures/sfm-error-vs-eps-twice.pdf} \caption{ \textit{(left)} Relative efficiency of \textit{SFM (sym)}{} vs. other methods on BitcoinHeist ($n \approx 2.6\mathrm{M}$). SFM is far more efficient than PS. \textit{SFM (sym)}{} is 4x more efficient than \textit{SFM (xor)}{} for larger privacy budgets. \textit{(right)} RRMSE vs. $\varepsilon$. For SFM, dashed lines show estimated relative error match the true error.} \label{fig:head-to-head} \end{figure} \begin{figure} \centering \includegraphics[width=.5\textwidth]{figures/sfm-error-by-buckets-methods-log-log.pdf} \caption{RRMSE at $n = 10^6$ vs. bucket count $B$ for private sketches at $\varepsilon = 2$ vs. common non-private alternatives (on log--log axes). For SFM, dashed lines show estimated relative error. For all methods, RRMSE scales with $B^{-0.5}$.} \label{fig:buckets} \end{figure} Finally, we compare SFM to popular non-private alternatives and show that error similarly decreases with the bucket count. Using synthetic data with cardinality $n = 10^6$, we construct sketches of varying bucket count $B$, using a privacy budget of $\varepsilon = 2$ for SFM. Figure~\ref{fig:buckets} shows RRMSE as a function of $B$ for each method. Like the familiar non-private distinct counting sketches, our RRMSE decreases with $B^{-0.5}$. Thus, like non-private sketches, the RRMSE of our DP summaries can be easily characterized by a simple formula $c_{\varepsilon} / \sqrt{B}$ at large cardinalities, where $c_{\varepsilon}$ is a constant specific to a method and privacy budget. \section{Discussion and Conclusion} \label{sec:discussion} The Sketch-Flip-Merge summaries demonstrate dramatic improvement over the current state-of-the-art mergeable and differentially private distinct-count sketches. This is achieved through novel merge algorithms (Theorem~\ref{thm:sym-rr-merge} and Section~\ref{sec:general-boolean-ops}), asymptotically optimal estimation (Section~\ref{sec:sketches}), and an improved privacy analysis (Corollary~\ref{cor:equivalent-eps}). An important limitation in mergeable private summaries is the inherent tension between privacy and mergeability. While both are attainable, repeated merging in the private setting degrades accuracy. This tradeoff, argued in the general distinct-count setting by \citet{desfontaines2018cardinality}, is explicitly quantified for SFM in Remark~\ref{remark:k-way-merge} and Figure~\ref{fig:merges}. Finally, we note the generality of some of our findings. In particular, our methods for aggregating noisy binary data provide fundamental machinery and a quantification of the noise-compounding effects of bitwise operations under randomized response that apply to a wide array of problems, particularly in the privacy-preserving space. \pagebreak { \bibliographystyle{plainnat}
\section{Introduction} \label{sec:intro} In an expanding universe, the observed redshift of an object at cosmological distances arises from two separate and independent effects. The first is due to the expansion of the universe and is proportional to the distance to the object \citep{Hub1929}. The other is due to the local (peculiar) velocity that is determined only by the mass distribution around the object. Peculiar velocities \citep{Zwicky1933,RubFor70,ZelSun1980} have been used as a probe of large-scale structure, as they provide information about density perturbations, and hence the mass distribution, on scales of and larger than the effective depths of surveys. To study the mass distribution, one must take into account redshift distortions \citep[RSD][]{Ham1998} that arise from peculiar velocities and thus bias results from redshift surveys. Furthermore, peculiar velocity studies provide a mechanism to identify the possible sources of gravitation attraction in large volumes \citep[{\it e.g.}][]{JacBraCiarDav92,Wil94,StrWil95}. Many groups have surveyed \citep[{\it e.g.}][]{RubFor70,RubThoForRob76,DreFabBurDav87,LP94,RiePreKir95,ZarBerdaC01,KasAtrKoc08,SprMagCol14,TulCouDol13,CF3} and analyzed \citep[{\it e.g.}][]{FelWat94,WatFel95,NusDav95,FelWat98,FelWatMelCha03,HuiGree06,SarFelWat07,WatFel07,FelWat08,Tul08,AbaErd09,WatFelHud09,FelWatHud10,RatKovItz11,DavNusMas11,NusDav11,NusBraDav11,AgaFelWat12,MacFelFerJaf12,TurHudFel12,Nusser14,CarTurLav15,WatFel15a,WatFel15,Nusser16,HelNusFeiBil17,PeeWatFel18,WanRooFelFel2018} peculiar velocity catalogs in the last half a century. To construct a peculiar velocity catalog, one must estimate both the redshift of an object and its distance, usually in the form of the distance modulus. The redshift to galaxies is a reasonably straightforward and accurate measurement, usually using spectroscopic data \citep[{\it e.g.}][]{GelHuc1989}. However, estimating the distance modulus to faraway galaxies is difficult, expensive, and requires a great deal of telescope time. The most common distance indicators, the Tully-Fisher \citep[TF,][]{TF77} and the Fundamental Plane \citep[FP,][]{dressler87} relations, have large uncertainties, around 0.4 in the distance modulus for individual galaxies. Other, more accurate, distance indicators exist, such as SNIa \citep[SNIa,][]{Phillips1993}, Cepheids \citep{LeaPic1912}, Tip of the Red Giant Branch \citep[TRGB,][]{LeeFreMad1993}, and Surface Brightness Fluctuations \citep[SBF,][]{TonSch1988} among others. However, objects with distances measured with these more accurate methods typically make up only a small fraction of most peculiar velocity catalogs. Peculiar velocities of individual objects in a catalog can be combined to find the average velocity (bulk flow) of large volumes that contain some or all of the catalog objects. The value of the bulk flow of a volume of some radius estimated from a catalog can then be compared to that predicted by the standard model of cosmology \citep[$\Lambda$CDM][]{PlanckCosPar16}. It is important to remember that theoretical models predict only the variance of the bulk flow components, since in a homogeneous and isotropic universe the average bulk flow should vanish. This means that adding new distances in order to measure the bulk flow on a given scale more accurately does not usually improve the constraint that the bulk flow can put on models unless the bulk flow is either increased or already larger than expected. However, acquiring more data in order to make an accurate estimation of the bulk flow in a larger volume has the potential to strengthen constraints, since the $\Lambda$CDM model suggests that the variance for the bulk flow of a volume decreases with radius. At a large enough radius, even a modest bulk flow can be in tension with the expected scale of the bulk flow. In Section~\ref{sec:distvel} we discuss our unbiased distance and velocity estimators; in Section~\ref{sec:BFest} we present our methodology for estimating the bulk flow in a spherical volume using radial peculiar velocities; in Section~\ref{sec:data} we describe the \textit{CosmicFlows-4} (CF4) catalog that we are using in our analysis; in Section~\ref{sec:DisdInd} we discuss how we locate catalog objects in space; in Section~\ref{sec:analysis} we show how we estimate the bulk flow from the CF4 using the Minimum Variance (MV) method; in Section~\ref{sec:results} we present the results; we discuss our results in Section~\ref{sec:discussion}. \section{Unbiased Distance and Velocity Estimators} \label{sec:distvel} Distances to galaxies are measured via distance moduli, $\mu$, with Gaussian distributed measurement errors $\sigma_\mu$. The relationship between measured distance modulus and actual distance is \begin{equation} \mu = 5\log_{10}(d) + 25 + \delta, \label{eq:mu} \end{equation} where $d$ is the distance in Mpc and $\delta$ is a measurement error drawn from a Gaussian distribution of width $\sigma_\mu$. We can use Eqn~\ref{eq:mu} to express an estimated distance $d_{est}$, which includes the effect of measurement noise, in terms of the true distance $d$ and the measurement noise $\delta$, \begin{align} d_{est} &= 10^{\frac{\mu}{5} - 5} = 10^{5\log_{10}(d)/5 }10^{\delta/5} \nonumber\\ &= d e^{\delta\ln(10)/5}=d e^{\delta\kappa} \end{align} where $\kappa\equiv\ln(10)/5$. Averaging over measurement errors $\delta$ we find the well-known result that $d_{est}$ is biased, in that \begin{equation} \langle d_{est}\rangle = d\langle e^{\delta\kappa}\rangle \ne d. \label{eq:av1} \end{equation} Using biased distance estimates results in similarly biased peculiar velocities. Several methods have been proposed to deal with this bias \citep[{\it e.g.}][]{WatFel15a}. Here we take the novel approach of calculating the bias exactly so that it can be corrected for. Assuming that $\delta$ is drawn from a Gaussian distribution of width $\sigma_\mu$, the probability density $P(\delta)$ of the measurement error $\delta$ is given by \begin{equation} P(\delta)= \frac{1}{\sqrt{2\pi}\sigma_\mu} e^{-\delta^2/2\sigma_\mu^2}. \end{equation} We can thus write the average in Eqn.~\ref{eq:av1} as \begin{align} \langle d_{est}\rangle &= d\frac{1}{\sqrt{2\pi}\sigma_\mu} \int_{-\infty}^{\infty} e^{\delta\kappa} e^{-\delta^2/2\sigma_\mu^2}\ d\delta \nonumber\\ &= d \frac{1}{\sqrt{2\pi}\sigma_\mu} \int_{-\infty}^{\infty}\exp\left({\delta\kappa -\delta^2/2\sigma_\mu^2}\right)\ d\delta. \end{align} The integral can easily be evaluated by completing the square, giving \begin{equation} \langle d_{est} \rangle = d \ \exp\left({(\kappa\sigma_\mu)^2 /2}\right). \end{equation} Thus we can correct for the bias by multiplying our distance estimates calculated from the distance modulus by a factor, so that the corrected distance estimate $d_c$ given by \begin{equation} d_c = 10^{\frac{\mu}{5} - 5}\ \exp\left(-{(\kappa\sigma_\mu)^2 /2}\right), \label{eq:dc} \end{equation} is unbiased, in that $\langle d_c\rangle = d$. To find the uncertainty in the distance estimate we need to find $\langle d_c^2\rangle$. This is given by \begin{align} \langle d_c^2\rangle &= d^2 \frac{f^2}{\sqrt{2\pi}\sigma_\mu} \int_{-\infty}^{\infty} e^{2\delta\kappa} e^{-\delta^2/2\sigma_\mu^2}\ d\delta \nonumber\\ &= d^2 \frac{f^2}{\sqrt{2\pi}\sigma_\mu} \int_{-\infty}^{\infty}\exp\left({2\delta\kappa -\delta^2/2\sigma_\mu^2}\right)\ d\delta, \end{align} where we have defined the factor $f$ to be \begin{equation} f\equiv \exp\left({-(\kappa\sigma_\mu)^2 /2}\right). \end{equation} Completing the square as we did before gives \begin{equation} \langle d_c^2 \rangle = d^2 f^2 f^{-4} = d^2 f^{-2}, \end{equation} thus, the uncertainty in the distance estimate $d_c$ is given by \begin{equation} \sigma_{c}^2 = \langle d_c^2 \rangle- \langle d_c \rangle^2 = d^2 (f^{-2} - 1). \end{equation} The argument of the exponential in the factor $f$ is much less than 1 for typical uncertainties $\sigma_\mu$, so we can use the Taylor series expansion $e^x \approx 1+x$, giving \begin{equation} f^{-2} = \exp\left({2(\kappa\sigma_\mu)^2 /2}\right)\approx 1+(\kappa\sigma_\mu)^2, \end{equation} so that \begin{equation} \sigma_{c} \approx \kappa\sigma_\mu d. \label{eq:unc} \end{equation} Thus distance uncertainties grow approximately linearly with distance and can be expressed as a percentage of distance. The unbiased distance estimate $d_c$ can be used to calculate peculiar velocities using \begin{equation} v_{c} = cz_{mod} - H_o d_c; \label{eq:vc} \end{equation} where $H_o$ is the Hubble constant, $c$ is the speed of light, and $z_{mod}$ is the redshift modified to account for the deviation from a linear Hubble's Law, \begin{equation} z_{mod} = z\left( 1+ \frac{1}{2}(1-q_o )z-\frac{1}{6}(1- q_o- 3q_o^2 + j_o)z^2\right) \end{equation} where $z$ is the measured redshift and $q_o$ and $j_o$ are the deceleration and jerk parameters. The use of modified redshift is important only for the more distant objects in the CF4 catalog. Peculiar velocities calculated in this way are also unbiased, in that \begin{align} \langle v_c \rangle &= \langle cz_{mod} - H_o d_c\rangle\nonumber = cz_{mod} - H_o \langle d_c\rangle\\ & = cz_{mod}-H_o d = v. \end{align} However, the errors in peculiar velocities estimated in this way are not Gaussian distributed. An alternative approach to calculating unbiased peculiar velocities was given in \cite{WatFel15a}. In terms of the distance modulus $\mu$, that estimator can be written as \begin{equation} v_{f}= cz_{mod}\ln(10)\left( \ln(cz_{mod}/H_o) - \frac{\mu - 25}{5}\right), \label{eq:vf} \end{equation} This formula gives peculiar velocities with Gaussian distributed errors; however, it has the disadvantage of only being unbiased for galaxies where the true velocity $v$ is much less than the redshift $cz$. The uncertainty in this estimator is the same as that given in Eqn.~\ref{eq:unc}. \section{Estimating the Bulk Flow for a Spherical Volume using Radial Peculiar Velocities} \label{sec:BFest} The bulk flow is one of the most basic ways to characterize the peculiar velocity field in the local Universe. The bulk flow is defined as the average velocity in a region, usually taken to be a spherical volume $V$ surrounding the Milky Way galaxy with radius $R$: \begin{equation} U_i= \frac{1}{V}\int_V v_i\ d^3 x, \label{eq:bf} \end{equation} where $v_i$ for $i=1,2,3$ are the cartesian components of the full three dimensional velocity field and $V=\frac{4}{3}\pi R^3$ is the volume of the sphere. If we imagine the peculiar velocity field as being the sum of waves of various wavelengths $\lambda$, then the bulk flow averages out waves with $\lambda \mathrel{\hbox{\rlap{\hbox{\lower2pt\hbox{$\sim$}}}\raise2pt\hbox{$<$}}} R$ and thus mostly reflect the amplitudes of waves with $\lambda > R$. Since homogeneity and isotropy requires the power spectrum to go to zero as $\lambda$ goes to infinity, the bulk flow should decrease with increasing radius $R$. Thus the bulk flow is a probe of the power spectrum on scales that are difficult to probe using redshift surveys, and the measurement of the bulk flow provides an important test of the standard cosmological model. One difficulty in measuring the bulk flow as defined in Eqn.~\ref{eq:bf} is that we can only measure the radial component of the velocity field. However, if we make the assumption that the velocity field is curl-free ($\vec\nabla\times \vec v= 0$), as velocities generated by gravity must be, then the radial velocity carries the same information as the full three dimensional field, and the bulk flow can be written as a weighted average of the \textit{radial peculiar velocity}. The following derivation is taken from \cite{Nusser14,Nusser16}. We begin by writing the velocity field in terms of a scalar potential $\phi$, \begin{equation} \vec v = -\vec\nabla \phi. \end{equation} In terms of $\phi$ the bulk flow becomes \begin{equation} U_i = -\frac{1}{V}\int_V \nabla_i \phi\ d^3 x = -\frac{1}{V}\int_V \vec\nabla\cdot (\hat x_i\phi)\ d^3 x, \end{equation} where $\hat x_i$ are the cartesian unit vectors. The divergence theorem can then be used to convert the volume integral to an integral over the surface $S$ of the region, \begin{equation} U_i = -\frac{1}{V}\int_S \hat r\cdot \hat x_i\phi\ d\Omega = -\frac{1}{V}\int_S \hat r_i \phi\ R^2\ d\Omega, \label{eq:div} \end{equation} where $\hat r$ is the radial unit vector with $\hat r_i$ being its $i$th component. This integral picks out the dipole contribution to $\phi$. We can make this explicit by expanding $\phi$'s angular dependence in terms of real-valued spherical harmonics \begin{equation} \phi({\bf r}) = \phi_o(r) + \sum_i \phi_i (r) \hat r_i + \sum_{l>1,m} \phi_{l,m}(r) Y_{l,m}(\theta,\phi), \label{eq:expand} \end{equation} where the second term is a sum over the $l=1$ real valued spherical harmonics. Plugging this into Eqn.~\ref{eq:div} and using the orthogonality of the spherical harmonics we obtain a simple expression for the bulk flow in terms of the value of $\phi_i$ on the surface of the region, \begin{equation} U_i = - \phi_i (R)/R. \label{eq:bfphi} \end{equation} \cite{Nusser14} showed that the bulk flow can also be written as an integral of the radial peculiar velocity, $s$, times $\hat r_i$ and a radial weight function $w(r)$, \begin{align} \frac{1}{V}\int_V w(r) s\ \hat r_i\ d^3 x &= -\frac{1}{V}\int_V w(r) \frac{\partial}{\partial r}\phi\ \hat r_i\ r^2 drd\Omega \\ &= -\frac{1}{R^3} \int_0^R w(r) \frac{\partial}{\partial r}\phi\ \ r^2 dr, \end{align} where we have plugged in Eqn.~\ref{eq:expand} and used the orthogonality of the spherical harmonics to do the integral over angles \citep[see also][]{PeeWatFel18}. We see that if $w = R^2/r^{2}$, then we can use the fundamental theorem of calculus to show that \begin{equation} \frac{1}{V}\int_V w(r) s\ \hat r_i\ d^3 x = -\phi(R)/R=U_i, \label{eq:bfr} \end{equation} thus showing that the bulk flow can be expressed as a weighted average of the \textit{radial} velocity with weights proportional to $\hat r_i/r^2$. \section{Data} \label{sec:data} \begin{figure} \centering \includegraphics[scale=0.4]{CF4_galactic_plot_smaller.pdf} \caption{Angular distribution of CF4 galaxies in Aitoff-Hammer projection Galactic coordinates. Note the large number of galaxies in the northern Galactic hemisphere from the SDSS galaxy sample.} \label{fig:CF4aitoff} \end{figure} In this paper we analyze the group version of the \textit{CosmicFlows-4} catalog \citep[][hereafter CF4]{CF4-full}. The catalog gives modified redshift $cz_{mod}$, distance modulus $\mu$, uncertainty in distance modulus $\sigma_\mu$, Galactic longitude $l$, and Galactic latitude $b$, for over 38,000 groups and individual galaxies. The majority of distance moduli in the CF4 are estimated using the TF \citep{TF77} and the FP \citep{dressler87} relations, with typical uncertainties of around 0.4 for individual galaxies. The remaining distance moduli in CF4 are estimated using more accurate methods such as SNIa \citep{Phillips1993}, Cepheids \citep{LeaPic1912}, or Tip of the Red Giant Branch \citep{LeeFreMad1993}. When there are multiple measured distance moduli for galaxies in a group, the group distance modulus is a weighted average and can have much smaller uncertainties. The zero-point calibration of the CF4 catalog gives distances consistent with a value of $H_o=74.6$km/s/Mpc \citep{CF4-full}; however, it is important to note that our results are independent of the choice of zero-point of the catalog. \begin{figure} \centering \includegraphics[scale=0.45]{CF4dist.pdf} \caption{The radial distribution of CF4 galaxies and groups. } \label{fig:rdist} \end{figure} The CF4 adds two major new datasets to the \textit{CosmicFlows-3} \citep[CF3, ][]{CF3}: (a) distance moduli of $\simeq 34,000$ galaxies from the Sloan Digital Sky Survey \citep[SDSS, ][]{SDSS2000,HowlettSDSS} using the Fundamental Plane method, and (b) $\simeq 10,000$ distance moduli of spiral galaxies obtained using the Baryonic Tully Fisher Relation \citep{CF4btfr}. The addition of the SDSS galaxies greatly expands the depth of the CF4 relative to the CF3; however, the SDSS galaxies are all in the northern Galactic hemisphere, so that the increase in depth is highly anisotropic. In Fig.~\ref{fig:CF4aitoff} we show the angular distribution of the CF4 groups and galaxies in Galactic coordinates. In Fig.~\ref{fig:rdist} we show the radial distribution of the CF4 objects. In Fig.~\ref{fig:zdist} we show the radial distribution, but this time subdivided into objects in the positive and negative sides of each Galactic cartesian coordinate; this plot shows that while in the $x$ and $y$ directions groups and galaxies are fairly evenly distributed, in the $z$ direction the distribution of objects on the northern Galactic hemisphere is quite different than that in the southern hemisphere. In particular, there are many more objects in the north and they are generally much deeper. The anisotropic distribution of the CF4 galaxies makes it particularly important to use a formalism such as the minimum variance (MV) method that allows us to estimate a physically relevant bulk flow; otherwise the bulk flow would be difficult to interpret and not comparable to other results. \begin{figure} \centering \includegraphics[scale=0.45]{CF4dist-xyz.pdf} \caption{The redshift distribution of CF4 galaxies in Galactic coordinates, dividing galaxies into those with positive and negative values of each cartesian coordinate. We see that while galaxies are distributed fairly evenly in $x$ and $y$, in the $z$ direction the distribution is markedly different in the positive and negative directions. This is mostly due to the SDSS galaxy sample. } \label{fig:zdist} \end{figure} \section{Locating Galaxies within the Volume} \label{sec:DisdInd} In order to theoretically model the data in the CF4 we need to first locate the groups in space. While both galaxies and groups have accurate angular positions, distance estimates to galaxies are less accurate and require more thought. For nearby objects, Eqn.~\ref{eq:av1} provides an unbiased, accurate distance estimate. However, as mentioned above, distance uncertainties grow linearly with distance, so that distances become increasingly uncertain as we consider more distant groups. An alternative distance estimate $d_z$ is obtained from redshift information, \begin{equation} d_z = cz_{mod}/H_o . \label{eq:dz} \end{equation} Redshifts have small measurement uncertainties; the main source of error in $d_z$ is due to peculiar velocities, which contribute to the redshift through the Doppler effect. For distant galaxies, the error in redshift distance due to peculiar velocities is smaller than the error in the distance obtained from the distance modulus. Here we use a novel way of determining the distance to galaxies to locate their positions in space. We use a distance estimate that is a weighted average of the unbiased distance $d_c$ calculated from the distance modulus, given in Eqn.~\ref{eq:dc}, and the redshift distance $d_z$ given in Eqn.~\ref{eq:dz}, using weights that minimize the uncertainty in the average. Our distance estimates are thus given by \begin{equation} d_{est} = (d_c/\sigma_c^2 + d_z/\sigma_v^2)/( 1/\sigma_c^2 + 1/\sigma_z^2), \end{equation} where the distance uncertainty $\sigma_c$ is given in Eqn.~\ref{eq:unc} and $\sigma_z = \sigma_v/H_o$, where $\sigma_v$ is the velocity dispersion of galaxies, which is about $300$km/s. Practically speaking, $d_{est}$ corresponds to $d_c$ at small distances and to $d_z$ at large distances, making a smooth transition between the two for intermediate galaxies. The exact value chosen for $\sigma_v$ does not have a significant effect on our results. To use our method, we also need to assign a peculiar velocity to each group. For nearby objects, the estimate $v_c$, (Eqn.~\ref{eq:vc}), is preferred over $v_f$ (Eqn.~\ref{eq:vf}), since the formula used to calculate $v_f$ is not accurate at small distances. However, at large distances the estimate $v_f$ might be preferred since it has Gaussian distributed errors and thus is a better match to the assumptions behind our method. However, we experimented with using $v_c$ at small distances and then transitioning to $v_f$ at larger distances and it made virtually no difference to our results. It appears that, at least for the current work, that as long as the velocities are unbiased, velocity errors are able average out effectively regardless of their distribution. Thus in this work we use Eqn.~\ref{eq:vc} exclusively to estimate peculiar velocities. \section{Estimating the Bulk Flow using the Minimum Variance (MV) Method} \label{sec:analysis} Estimating the bulk flow is complicated by the fact that galaxies are both unevenly distributed in the volume and have varying uncertainties that generally increase with distance. Simply calculating the weighted average of the radial velocities of galaxies within a given volume using weights proportional to $\hat r/r^2$ will not in general result in a good approximation to the integral over the velocity field given in Eqn.~\ref{eq:bfr}. Instead, we imagine a more general weighted average \begin{equation} u_i = w_{i,n} s_n, \label{bfest} \end{equation} where repeated indices are summed over, the $s_n$ are radial peculiar velocities of groups or individual galaxies in a survey, and $w_{i,n}$ are weights designed so that $u_i$ gives the best possible estimate of the bulk flow $U_i$ in a volume of radius $R$. Here the weights $w_{i,n}$ should account for both the distribution of galaxies and the uncertainties of their peculiar velocity measurements. To determine the optimal weights we will use the minimum variance (MV) method, developed in \cite{WatFelHud09,FelWatHud10,PeeWatFel18}. The idea of the MV method is to calculate the weights that minimize the theoretical average square difference $\langle (u_i - U_i)^2\rangle$ between the estimated bulk flow components in Eqn.~\ref{bfest}, $u_i$, and the bulk flow components calculated for a theoretical ideal survey, $U_i$, consisting of exact peculiar velocity measurements measured at uniformly distributed points weighted by $1/r^2$. In practice, this means generating a random set of $N_p$ points selected so that there are equal number of points per radial shell \citep[see][for details]{PeeWatFel18}. The method allows for constraints to be placed on the weights so that estimated bulk flow components are independent of the value of the Hubble constant. This is particularly important given that we are in an era where the results of different methods of measurement of the Hubble constant are in tension with each other \citep[see {\it e.g.},][]{Freedman17,Di_Valentino2021,RieYuaMac22}. Once the weights for the bulk flow component estimates are determined, we can calculate the tensor angle-averaged window function ${\cal W}^2_{ij}(k)$ for the components, given by \begin{equation} {\cal W}^2_{ij}(k) =w_{i,n}w_{j,m}f_{nm}(k), \label{eq:wf} \end{equation} where repeated indices are summed over, and \begin{equation} f_{nm}(k) = \int {d^2{\hat k}\over 4\pi} ( {\bf \hat r}_n\cdot {\bf \hat k} )( {\bf \hat r}_m\cdot {\bf \hat k} ) e^{ ik\ {\bf \hat k}\cdot ({\bf r}_n - {\bf r}_m)}. \label{eq:fmn} \end{equation} The diagonal elements of the tensor window function ${\cal W}^2_{ii}(k)$ tell us which scales contribute to the bulk flow components. In addition, a comparison of the window function for the bulk flow estimate $u_i$ with the window function for the ideal bulk flow $U_i$ can indicate how well our data can estimate the bulk flow of an ideal survey. We discuss this comparison in more detail when we present our results in section \ref{sec:results}. Given the window functions in Eqn.~\ref{eq:wf} we can calculate the theoretical covariance matrix for the components of the bulk flow \begin{equation} R_{ij}=\langle u_i u_j\rangle ={H_0^2\Omega_{m}^{1.1}\over 2\pi^2}\int dk\ P(k){\cal W}^2_{ij}(k), \label{eq:Rij} \end{equation} where the window function ${\cal W}^2_{ij}(k)$ is given in Eqn.~\ref{eq:wf}. Note that if distances are expressed in units of $h^{-1}$Mpc, the covariance matrix is independent of the value of $H_o$. The covariance matrix can be used together with the bulk flow component estimates $u_i$ to calculate a $\chi^2$ for the three component degrees of freedom, \begin{equation} \chi^2 = u_i R_{ij} u_j, \end{equation} where repeated indices are summed over. From this $\chi^2$ distribution for three degrees of freedom we can find the probability of finding a value of $\chi^2$ that is as large or larger than our calculated value. \section{Results} \label{sec:results} \begin{figure} \centering \includegraphics[scale=0.5]{win-compare-xx.pdf} \caption{Window functions for estimates of the $x$ component of the bulk flow for various radii $R$ calculated for the CF4 catalog. The dashed lines show the window functions for an ideal survey of the same radius.} \label{fig:wfx} \end{figure} \begin{figure} \centering \includegraphics[scale=0.5]{win-compare-yy.pdf} \caption{Same as Fig.~\ref{fig:wfx} for the $y$ component} \label{fig:wfy} \end{figure} \begin{figure} \centering \includegraphics[scale=0.5]{win-compare-zz.pdf} \caption{Same as Fig.~\ref{fig:wfx} for the $z$ component} \label{fig:wfz} \end{figure} As mentioned above, the CF4 is deeper than the CF3, allowing us to measure the bulk flow at greater depth, but also more anisotropic. In order to determine the maximum depth to which we can measure the bulk flow accurately, we need to examine the window functions of our bulk flow estimates. In Figs.~\ref{fig:wfx},~\ref{fig:wfy}, and ~\ref{fig:wfz} we show the window functions for the Galactic cartesian coordinates $x$, $y$, and $z$ bulk flow estimates for various radii $R$. In the figures we see that the bulk flow estimate window functions match well with the ideal window functions out to a radius of about $R=200h^{-1}$Mpc, indicating that the estimates are probing the power spectrum in the same way. Beyond this radius, we start to see a deviation (albeit small) of the estimated window function from the ideal window function, indicating that the catalog has insufficient information at the outer edge of the volume to accurately estimate the bulk flow on this scale. In this work we focus on estimating the bulk flow for $R=150h^{-1}$Mpc and $R=200h^{-1}$Mpc. In Fig.~\ref{fig:bfR} we show the bulk flow components and magnitude (with measurement noise error bars) calculated using the CF4 data as a function of the radius $R$. Included in the plots (dotted blue lines) is the standard deviation of the expected difference between the bulk flow estimates and the bulk flow from an ideal survey calculated using the cosmological standard model with the \textit{Planck} central parameters \citep{PlanckCosPar16}; the total deviation from the ideal bulk flow is given by a quadrature sum of this value and the measurement noise. The dashed red line on the magnitude plot indicates the expectation for the bulk flow magnitude calculated using the cosmological standard model. In Fig.~\ref{fig:chisq} we show the $\chi^2$ for the three bulk flow component degrees of freedom as a function of $R$ calculated using the theoretical covariance matrix (Eqn.~\ref{eq:Rij}). We also show the probability of finding a $\chi^2$ value that is as large or larger. While we have focused on $R=150h^{-1}$Mpc and $R=200h^{-1}$Mpc in this paper, we can see from the figure that the probability of obtaining a bulk flow as large or larger continues to decrease as $R$ increases beyond $200h^{-1}$Mpc. However, as discussed above, one must take our bulk flow results beyond $200h^{-1}$Mpc with a grain of salt, since at these radii the window functions for the bulk flow estimate are beginning to deviate from the ideal window functions. This is mostly due to the lack of data at large distances; without much new information, bulk flow estimates on these scales will seem to change more slowly with radius than the actual bulk flow. \begin{figure} \centering \includegraphics[scale=0.55]{bf.pdf} \caption{The green points with error bars show the bulk flow components and magnitude estimated from the CF4 catalog as a function of radius $R$. The error bars indicate the uncertainty in the estimates due to measurement noise. The dotted blue lines show the theoretical standard deviation of the expected differences between the bulk flow estimates and the bulk flow from an ideal survey calculated using the cosmological standard model (not including measurement noise). The red dashed line indicates the theoretical expectation for the magnitude of the bulk flow calculated using the cosmological standard model. } \label{fig:bfR} \end{figure} \begin{figure} \centering \includegraphics[scale=0.55]{chisq.pdf} \caption{ The $\chi^2$ for the three bulk flow degrees of freedom as a function of radius $R$. Also shown in the corresponding probability to find a $\chi^2$ value that is as large or larger.} \label{fig:chisq} \end{figure} \begin{table} \caption{Summary of Bulk Flows for $R=150$\mamo{h\mone}\mpc\ \ and $R=200$\mamo{h\mone}\mpc. The uncertainties include both the theoretical difference between the estimate and the bulk flow from an ideal survey and the measurement noise. \\ } \centering { \begin{tabular}{lccc} \hline & $R=150$\mamo{h\mone}\mpc& $R=200$\mamo{h\mone}\mpc \\ Expectation (km/s) & 139 & 120\\ Bulk Flow (km/s) & $387\pm 28$ & $419\pm 36$\\ Direction & $l=297^\circ\pm 4^\circ$ &$l=298^\circ\pm 5^\circ$\\ & $b=-6^\circ\pm 3^\circ$ & $b=-8^\circ\pm 4^\circ$ \\ $\chi^2$ with 3 d.o.f. &19.34 & 29.13\\ Probability &0.023\% & 0.00021\%\\ \hline \end{tabular} } \label{tab:prob} \end{table} \section{Discussion} \label{sec:discussion} As shown in Table ~\ref{tab:prob}, our bulk flow estimates in spheres of radii $R=150$\mamo{h\mone}\mpc\ and $R=200$\mamo{h\mone}\mpc\ have magnitudes in excess of $380$km/s and directions that are $\sim20^{\rm o}-30^{\rm o}$ away from the Shapley Concentration. We see that the probability of observing a bulk flow as large or larger for $R=150$\mamo{h\mone}\mpc\ is small, only about 0.023\%. This is significantly smaller than the probability of the CF3 bulk flow at this radius of 2.2\% \citep{PeeWatFel18}; the addition of new data has not only decreased the uncertainty but also increased the estimate of the bulk flow, resulting in a tension with the standard cosmological model at this radius that is significantly stronger. Additionally, the fact that the CF4 is deeper than the CF3 allows us to accurately measure the bulk flow at larger radii. As shown in Table~\ref{tab:prob}, the probability of obtaining a bulk flow as large or larger for $R=200$\mamo{h\mone}\mpc\ is even smaller, 0.00021\%. While this percentage does not quite reach $5\sigma$ significance, it does present a significant challenge to the standard model in addition to the tension seen in the value of the Hubble constant \citep[see {\it e.g.},][]{RieYuaMac22}. Most of the CF4 distances are obtained using either the Fundamental Plane (FP) or the Tully Fisher (TF) distance indicators. In order to test whether these galaxies whose distances have been measured by different distance indicators give significantly different results, we have analyzed two smaller data sets: 1. where all groups and individual galaxies that contain only FP galaxies (26,800 groups and individuals out of 38,058) are removed; and 2. where groups and individual galaxies that contain only TF galaxies (9,060 groups and individuals out of 38,058) are removed. Note that there are a few thousand groups containing galaxies with distance measurements from a mix of distance indicators that are common to both sub-catalogs. The bulk flows estimated from both of these sub-catalogs do not differ significantly from that of the entire catalog (though the errors increase), giving us confidence that it is not a problem with one or the other of these main distance indicators that is causing the larger than expected bulk flow that we observe. Given the current tension in the value of the Hubble constant \citep[{\it e.g.},][]{Di_Valentino2021}, it is important to consider how a different value of $H_o$ might effect our results. First, changing the value of $H_o$ introduces a spurious radial inflow or outflow into our data. While a radial flow does not contribute to the bulk flow estimate in a completely isotropic survey, one might be concerned that in a survey such as the CF4 with different radial distributions in different directions, a radial flow may bleed into a bulk flow estimate. However, as discussed in section~\ref{sec:analysis}, our method contains an explicit constraint making our bulk flow estimate independent of the value of $H_o$. The second place that the value of $H_o$ might effect our results is by changing the scale of redshift distances $d_z$ used to locate groups in space, thus changing how the bulk flow probes the power spectrum. Here, as is also discussed in section ~\ref{sec:analysis}, the power spectrum scales with $H_o$ in just such a way that if distances are measured in units of $h^{-1}$Mpc, theoretical bulk flow estimates are independent of the Hubble constant. Taken together, these two considerations allow us to make bulk flow estimations, and more importantly, estimates of the probability of our bulk flows in the standard model of cosmology, that are completely independent of the Hubble constant. Our results have clarified features of the bulk flow dependence on radius that were hinted at in previous studies \citep[{\it e.g.},][]{PeeWatFel18}. In particular, we see from Fig.~\ref{fig:bfR} that, contrary to expectations, all three bulk flow components increase in magnitude as the radius of the volume increases beyond 100\mamo{h\mone}\mpc. This behavior is difficult to explain in the standard cosmological model, particularly since higher order moments of the velocity field do not appear to be larger than expected \citep{FelWatHud10}. While this behavior is difficult to explain in the standard model, it could be an indication that the particle rest frame of the Universe is not the same as that inferred from the dipole in the cosmic microwave background (CMB) radiation \cite[see {\it e.g.},][]{KasAtrKoc08,MaGorFel11,KasAtr22}. Indeed, significant evidence that the CMB frame is not the rest frame of the Universe can also be seen in the analyses of the distribution of Quasars on the sky \citep{SecVonRam21, SecVonRam22, DamLewBre22}. We should note that the flattening out of the curves in Fig.~\ref{fig:bfR} is not necessarily due to a convergence to a rest frame; there is little information in the CF4 beyond 200\mamo{h\mone}\mpc\ that could change the values of the bulk flow components. One might be concerned that our large bulk flow result is somehow arising from the anisotropic distribution of objects in the CF4 catalog. There are two reasons to think that this is not the case. First, the MV analysis method weights objects in such a way as to compensate for their distribution; regions with more objects are down-weighted and regions with fewer objects are up-weighted by the method. The aim of the MV method is to generate weights to make the resulting bulk flow as close as possible to what would be obtained if there was a uniform distribution of objects in the volume. We have checked that our method has not resulted in a small subset of objects having undue influence on our bulk flow result. Second, Fig.~\ref{fig:zdist} shows that the anisotropy of the CF4 catalog is mainly in the $z$ direction; the sample is much more balanced in the $x$ and $y$ directions. Since we only have radial peculiar velocities, objects along a particular direction make the largest contribution to the bulk flow in that direction; this suggests that if anisotropy were effecting our result, it would have the greatest effect on the $z$-component of the bulk flow. However, we see from Fig.~\ref{fig:bfR} that the $z$-component of the bulk flow is quite consistent with expectations; it is the $y$-component that is unexpectedly large in magnitude. Altogether it is difficult to see how an anisotropy that is primarily in the $z$ direction could cause an unusually large bulk flow in the $y$ direction. Given the greater context of our result being one of several that is contributing to an increasing tension with the standard model of cosmology, it is important to continue to improve our dataset and our analysis methods. Unlike in the case of the Hubble constant, where resolving questions around the zero point of the distance ladder is essential, our result is relatively insensitive to the precise value of the Hubble constant and hence also the zero point. Thus the accuracy of our result is likely to be improved only through the collection of more distance measurements. Given that velocity errors increase with distance, finding distance estimators that give smaller percentage errors would greatly increase the value of new measurements. \\ \noindent{\bf Acknowledgements:} RW, TA,CB, AR, and AW were partially supported by NSF grant AST-1907365. HAF, RC, and YA-S were partially supported by NSF grant AST-1907404. Funding for the \textit{Cosmicflows} project has been provided by the US National Science Foundation grant AST09-08846, the National Aeronautics and Space Administration grant NNX12AE70G, and multiple awards to support observations with HST through the Space Telescope Science Institute. \bibliographystyle{mn2e}
\section{INTRODUCTION} Clutter plus noise covariance matrix estimation is an integral part of radar signal analysis. In a high-dimensional setting, the sample size is of the same order of magnitude as the dimension of the covariance matrix. Therefore, the sample covariance matrix is no longer a reliable estimator of the clutter plus noise covariance matrix as it becomes singular. To mitigate such singular nature of the sample covariance matrix, we exploit the {\em spiked covariance structure} for high dimensional settings proposed in \cite{johnstone2001distribution,paul2007asymptotics,donoho2018optimal} to model the clutter plus noise covariance matrix. We propose a rotation invariant nonlinear shrinkage-based estimator to estimate the clutter plus noise covariance matrix. The {\em bulk} of the eigenvalues of the spiked covariance matrix are identical, corresponding to the noise component of clutter plus noise covariance matrix. A finite number of {\em spiked} eigenvalues significantly exceed the {\em bulk} eigenvalues in magnitude, accounting for the clutter component of the clutter plus noise covariance matrix. We model the clutter in the Challenge Dataset simulated by $\textnormal{RFView}^{\circledR}$ \cite{gogineni2022high,RFView} as a {\em spiked covariance} structure. RFView is a high-fidelity, site-specific, physics based M$\&$S tool, which enables a real time instantiation of the RF environment. This has been extensively vetted using measured data from VHF to X band with one case documented in \cite{gogineni2022high}. As an illustrative example, consider an airborne radar looking down on a heterogeneous terrain, consisting of mountains, water bodies, and foliage simulated by RFView as shown in Fig.\ref{fig:CofarFigure}. Fig.\ref{fig:CofarFigure} displays the relative power of the returned signal from such heterogeneous terrain in Southern California near San Diego. We observe that the regions of high-power returns have less area compared to the regions of low-power return, with noise power higher than the low-power returns. This is evident from the eigenvalue plot of the clutter plus noise covariance matrix in Fig.\,\ref{fig:ClutterNoiseCovar}, computed from the return signal. A large number of eigenvalues of the clutter covariance matrix fall below the noise power. \begin{figure}[h!] \centering \includegraphics[width=\linewidth]{CofarExampleV2.eps} \caption{Clutter returns from the littoral scene with mountains and water showing shadow regions (dark blue) as well as stronger signal components (yellow).} \label{fig:CofarFigure} \end{figure} \begin{figure}[h!] \includegraphics[width=\linewidth,height=6.5cm]{SingularValue.eps} \caption{The clutter plus noise covariance matrix formed by the return signal given in Fig.\,\ref{fig:CofarFigure} gives evidence that most of the components of clutter (red) are below the noise floor. The first 25 components are above the noise floor. Therefore, the covariance matrix exhibits a spiked covariance structure.} \label{fig:ClutterNoiseCovar} \end{figure} In this paper, we use a nonlinear shrinkage-based rotation invariant estimator developed in \cite{donoho2018optimal} to estimate the clutter plus noise covariance matrix in a high dimensional setting. In the spiked covariance model, we only need to estimate the noise power and the spiked components. We show that for the estimation of covariance matrix of dimension $p$, the proposed algorithm performs ${\mathcal{O}}(p)$ real-valued multiplications for the joint noise power-clutter rank estimation as compared to the ${\mathcal{O}}(p^2)$ in the RCML-EL\footnote{RCML-ELrepresents the RCML covariance estimator \cite{kang2014rank} with the clutter rank and noise power obtained by the expected likelihood (EL) approach \cite{kang2016expected}.} algorithm with identical SCNR and error variance. Additionally, we state the convergence results for the estimated eigenvalues and bounds for normalized SCNR for the proposed estimator. We test the target detection performance of the estimator using Low-Rank Adaptive Normalized Matched Filter (LR-ANMF) detector. We empirically show the robustness of the detector against contaminating clutter discretes. We apply the proposed algorithm on the Challenge Dataset simulated by RFView software. \subsection{Related Works} The problem of covariance matrix estimation, \cite{ReedMallet}, with data deficient scenario has received considerable attention in the radar signal processing literature. In the data deficient scenarios, the sample covariance matrix is no longer a reliable estimator as it becomes ill-conditioned. To address such ill-conditioning, methods like diagonal loading\,\cite{abramovich1981analysis,johnson2007matrix,abramovich1981controlled,carlson1988covariance,wicks2006space,gini2008knowledge,Ward1994} and factored space-time approaches\,\cite{dipietro1992extended} have been proposed. Data dependent techniques include Principal Components Inverse\,\cite{kirsteins1994adaptive}, Multistage Wiener Filter\,\cite{goldstein1998multistage}, Parametric Adaptive Matched Filter\,\cite{roman2000parametric}, and EigenCanceler\,\cite{haimovich1996eigencanceler}. Data independent approaches include JDL-GLR\,\cite{wang1994adaptive}. In a high-dimensional setting, the properties of covariance matrices are explained by the Random Matrix Theory as stated in \cite{wainwright2019high,vershynin2018high,bai2010spectral,wang2017asymptotics}. In such high dimensional settings, shrinkage estimators have been developed to estimate covariance matrices in signal processing and finance. Shrinkage estimators have been used in wireless communications\,\cite{tulino2004random} to estimate the channel matrices, in array signal processing to estimate direction of arrival\,\cite{couillet2013joint} and in finance for Markowitz Portfolio optimization\,\cite{ledoit2018optimal,ledoit2022quadratic,ledoit2017nonlinear,ledoit2022power}. Shrinkage methods include Ledoit-Wolf shrinkage estimator\,\cite{ledoit2004well}, regularized PCA\,\cite{bun2016rotational}, Ridge and Lasso shrinkage estimators\,\cite{yuan2020improved} and regularized M-estimators\,\cite{couillet2014robust}. In radar signal processing, the covariance matrices often contains a low-rank structure corresponding to the clutter. The covariance matrices are called clutter plus noise covariance matrices. Covariance estimation algorithms developed in \cite{sen2015low,spClut1,kang2016expected,kang2013constrained,abrahamsson2007enhanced}, propose estimation schemes assuming a rank sparse clutter covariance matrix in a high dimensional setting. These papers use Brennan's Rule which gives an estimate of the rank depending on the dominant components of the clutter and the jammers. However, as demonstrated in \cite{guerci2010cognitive,kang2022adaptive,guerci2016new}, Brennan's rule fails when a plethora of real-world effects such as internal clutter motion, mutual coupling between antenna array elements arise on account of the system and environmental factors. In our paper, the data generated from the high fidelity, site-specific, physics-based, radar scenario simulation software RFview is used where the Brennan rule does not prevail as documented in \cite{gogineni2022high}. To address these issues we exploit the {\textit{spiked covariance}} structure, as proposed in \cite{johnstone2001distribution,paul2007asymptotics,nadler2008finite,benaych2011eigenvalues}, of the clutter plus noise covariance matrix. We use the nonlinear shrinkage estimation techniques of \cite{donoho2018optimal} to estimate the covariance matrix. Spiked covariance models have been used to estimate direction of arrival (DOA) in array signal processing, as demonstrated in \cite{yang2018high}, and for target detection in \cite{robinson2021space}. We are using the spiked covariance model to estimate the clutter plus noise covariance matrix. \subsection{Main Results and Organization} The main results and organization of this paper are as follows: \begin{compactenum} \item In Sec.~\ref{Sec:SignalModel}-\ref{Sec:Beamforming}, we formulate the rotation invariant estimators. The asymptotic model for large random matrices and the spiked covariance model for the clutter plus noise covariance matrix is defined in Sec.~\ref{Sec:SignalModel}-\ref{Sec:SpikedCovar}. \item In Sec.~\ref{Sec:Donohue}, we present the algorithm proposed in \cite{donoho2018optimal} for spiked covariance matrix estimation. In Sec.~\ref{Sec:Donohue}-\ref{Sec:Thm}, Theorem\,\ref{Thm:NonLinBias} shows a strong law of large numbers (namely, the estimated spiked eigenvalues converge almost surely to a constant) and satisfy a Central Limit Theorem. This is due to the fact that, even though we are in a high-dimensional setting, the number of spikes are constant. Empirical verification of the convergence properties for RFview Challenge Dataset is provided. We derive the bounds for normalized SCNR, $\rho$, in Sec.~\ref{Sec:Donohue}-\ref{Sec:rhobound}. In Sec.~\ref{Sec:Donohue}-\ref{Sec:Similar}, we establish that the proposed algorithm and the RCML-EL estimation algorithm in high dimensions have similar performance due to the fact they share a common optimization problem. In Sec.~\ref{Sec:Donohue}-\ref{Sec:Detection}, we employ the LR-ANMF detector for target detection when using a rotation invariant estimator. \item In Sec.~\ref{Sec:Simulations}-\ref{Sec:Challenge}, we demonstrate that the proposed algorithm has identical SCNR compared to the RCML-EL algorithm for the Challenge Dataset simulated using RFView. We further show that the computation time of estimation by the proposed algorithm is less than that of the RCML-EL algorithm. In Sec.~\ref{Sec:Simulations}-\ref{Sec:DetectionNumerical}, we compute the target detection probabilities for various false alarm probabilities and SCNR and empirically show its robustness with respect to contaminating clutter discretes. In Sec.~\ref{Sec:Simulations}-\ref{Sec:ErrorVariance}, we compute the error variance of the MVDR beamformer for the proposed algorithm. \end{compactenum} \section{Rotation Invariant Estimator and Spiked Covariance Model} \label{Sec:SignalModel} This section is organized as follows. Sec.~\ref{Sec:SignalModel}-\ref{Sec:Beamforming} presents a general rotation invariant estimator. Sec.~\ref{Sec:SignalModel}-\ref{Sec:SpikedCovar} describes the high-dimensional spiked covariance model. We use a narrowband baseband equivalent model used in \cite{gogineni2022high}. The radar transmits a complex-valued waveform ${{s}}(k)\,\in{\mathbb{C}}$ and receives a complex-valued return ${{y}}(k)\,\in{\mathbb{C}}$ in discrete time: \begin{equation} \label{eq:SignalModel} {{y}}(k)={{h_t}}(k)\,\circledast\,{{s}}(k)+{{h_c}}(k)\,\circledast\,{{s}}(k)+n(k) \end{equation} Here $\circledast$ is the convolution operator and $k$ denotes discrete time. ${{h_t}}\,\in{\mathbb{C}}$ is the complex valued target impulse response and ${{h_c}}\,\in{\mathbb{C}}$ is the complex valued clutter impulse response. The noisy measurement $n\,\in{\mathbb{C}}$ is the additive white Gaussian noise with variance $\sigma^2$ with zero mean. The noise samples are independent, identically, distributed (${\textit{i.i.d}}$). In matrix-vector notation~\eqref{eq:SignalModel} reads \begin{equation} \label{eq:VecSignalModel} {\mathbf{y}}={\mathbf{H}_t}\,{\mathbf{s}}+{\mathbf{H}_c}\,{\mathbf{s}}+{\mathbf{n}_s} \end{equation} where ${\mathbf{H}_t},\,{\mathbf{H}_c}\in{\mathbb{C}}^{p\times q}$ are Toeplitz matrices constructed by the impulse responses ${{h_t}}(k)$ and ${{h_c}}(k)$, respectively. ${\mathbf{y}}\in{\mathbb{C}}^{p}$ is return signal of length $p$ and ${\mathbf{s}}\in{\mathbb{C}}^{q}$ is the waveform of pulse length $q$. The noise ${\mathbf{n}_s}\in{\mathbb{C}}^{p}$ is a complex valued Gaussian distributed vector where ${\mathbf{n}_s}~\sim~\mathcal{N}(\mathbf{0},{\sigma^2\,\mathbf{I}})$ and has ${\textit{i.i.d}}$ samples. We define the clutter plus noise return as ${\mathbf{y}_c}$ \begin{equation} \label{eq:ChanSig} {\mathbf{y}_c}:={\mathbf{H}_c}\,{\mathbf{s}}+{\mathbf{n}_s} \end{equation} \subsection{Rotation Invariant Estimator} \label{Sec:Beamforming} In this subsection, we describe the rotation invariant estimation for the clutter plus noise covariance estimator. Rotation invariant estimators have the same eigenvectors as that of the sample covariance matrix and the eigenvalues of the estimators are a function of the eigenvalues of the sample covariance matrix. The clutter plus noise covariance matrix is given by \begin{equation} \label{eq:Covariance} {\mathbf{R}}={\mathbf{R}_c}+{\sigma^2\,\mathbf{I}} \end{equation} where the clutter covariance matrix is \begin{equation} \label{eq:Clutter} {\mathbf{R}_c}:={\mathbb{E}}[{\mathbf{H}_c}\,{\mathbf{s}}\vecsignal^{H}\,{\mathbf{H}_c}^{H}] \end{equation} and ${\sigma^2\,\mathbf{I}}$ is the noise component. The eigendecomposition of clutter plus noise covariance is: \begin{equation} \label{eq:EigenDecomTrue}{\mathbf{R}}=\sum_{i=1}^{p}{\lambda}_{i}{\mathbf{u}}_i{\mathbf{u}}_i^{H} \end{equation} with eigenvalues ${\lambda}_i$ and eigenvectors ${\mathbf{u}}_i$. The sample covariance matrix ${\hat{\textbf{R}}}_{n}$ is: \begin{equation} \label{eq:EmpiricalR} {\hat{\textbf{R}}}_{n}=\frac{1}{{n}}\,\sum_{k=1}^{{n}}{\mathbf{y}_c}_{,k}\,{\mathbf{y}_c}_{,k}^H \end{equation} where ${\mathbf{y}_c}$ is the clutter plus noise return defined in \eqref{eq:ChanSig} which will be used as training data samples\footnote{The training data is collected by RFView when no target is present. We assume that the clutter plus noise covariance matrix is stationary and is independent of the target presence. This is due to the fact that eigenvalue component due to the target is independent of the eigenvalues of the clutter plus noise covariance matrix in the spiked covariance model which is defined in Sec.~\ref{Sec:SignalModel}-\ref{Sec:SpikedCovar}.}, $k$ is the discrete time and ${n}$ are the number of training data samples. The spectral decomposition of ${\hat{\textbf{R}}}_{{n}}$ for a given training data size ${n}$ is: \begin{equation} \label{eq:EigenDecompSample} {\hat{\textbf{R}}}_{{n}}=\sum_{i=1}^{p}\,{\hat\lambda}_{i,n}{\mathbf{v}}_{i,{n}}\,{\mathbf{v}}_{i,{n}}^{H} \end{equation} where ${\hat\lambda}_{i,{n}}$ are the eigenvalues and ${\mathbf{v}}_{i,{n}}$ are the eigenvectors of ${\hat{\textbf{R}}}_{n}$. The spiked covariance matrix estimate for a given number of data samples ${n}$ is: \begin{equation} \label{eq:EigenDecompEst} {\bar{\mathbf{R}}}_{{n}}=\sum_{i=1}^{p}\,{\bar{\lambda}}_{i,n}\,{\mathbf{v}}_{i,{n}}\,{\mathbf{v}}_{i,{n}}^{H} \end{equation} where ${\bar{\lambda}}_{i,{n}}$ are the eigenvalues of ${\bar{\mathbf{R}}}_{n}$, with eigenvectors ${\mathbf{v}}_{i,{n}}$ identical to those of the ${\hat{\textbf{R}}}_{{n}}$ in \eqref{eq:EigenDecompSample}. The spiked covariance estimator is a rotation invariant estimator. Additionally, we use normalized SCNR to compare covariance estimation methods. We denote $\rho$ to define the normalized SCNR as: \begin{equation} \label{eq:rho} \rho=\frac{({\mathbf{y}_t}^{H}\,{\bar{\mathbf{R}}}^{-1}\,{\mathbf{y}_t})^2}{({\mathbf{y}_t}^{H}\,{{\mathbf{R}}}^{-1}\,{\mathbf{y}_t})({\mathbf{y}_t}^{H}\,{\bar{\mathbf{R}}}^{-1}\,{\mathbf{R}}\,{\bar{\mathbf{R}}}^{-1}\,{\mathbf{y}_t})}. \end{equation} where ${\mathbf{y}_t}=A_{\theta}\otimes\,A_{f}$ is the Kronecker product of angle steering vector $[A_{\theta}]_{i}=\exp[-j\pi i \sin(\theta)],\,1\leq i\leq N$ and the Doppler steering vector $[A_{f}]_{i}=\exp[-j2\pi i f_{d}], 1\leq i\leq K$. $N$ and $K$ are defined in Sec.~\ref{Sec:Simulations}. The dimension of the covariance matrix is $p=N\times K$. In the next section, we will show that ${\bar{\lambda}}$ is a nonlinear function of ${\hat\lambda}$, where the nonlinearity depends on the loss function. \subsection{Clutter Plus Noise Covariance Matrix Modelling using Large Random Matrices} \label{Sec:SpikedCovar} In this subsection, we define the spiked covariance model and the asymptotic regime for the high dimensional setting. We use this framework to model the clutter plus noise covariance matrix. \begin{definition} \label{Def:SpikedCovariance} A spiked covariance matrix ${\mathbf{R}}$ is a $p\times p$ positive definite Hermitian matrix with eigenvalues $({\lambda}_{1},\,{\lambda}_{2}\,\cdots,\,{\lambda}_{p})$ such that for a finite $r\ll p$, ${\lambda}_{1}\geq{\lambda}_{2}\geq{\lambda}_{r}>\sigma^2$ and ${\lambda}_{r+1}=\cdots={\lambda}_{p}=\sigma^2>0$. \end{definition} We make two assumptions \begin{compactenum} \item \label{Sec:Clutter} The clutter plus noise covariance matrix has a spiked covariance structure given in Definition\,\ref{Def:SpikedCovariance}. The clutter plus noise covariance matrix is given in \eqref{eq:Covariance} where clutter covariance matrix ${\mathbf{R}_c}$ has rank $r$ with eigenvalues ${\lambda}_i-\sigma^2$, $1\leq i\leq r$. The noise covariance matrix ${\sigma^2\,\mathbf{I}}$ is diagonal. \item \label{Sec:Asym}There exists a $\gamma\in(0,1)$ such that for given training data size ${n}$ with the dimension of the covariance matrix as $p$ such that: \begin{equation} \label{eq:Kolmogorov} \frac{p}{{n}}\rightarrow \gamma,\quad p,\,{n}\rightarrow\infty,\quad p<{n} \end{equation} \end{compactenum} Data displayed in Fig.\,\ref{fig:CofarFigure} and Fig.\,\ref{fig:ClutterNoiseCovar} satisfies these conditions. In Fig.\,\ref{fig:ClutterNoiseCovar}, we see that the clutter covariance matrix can be approximated by a rank $r$ positive semi-definite matrix as the remaining $p-r$ components are below the noise floor. We assume that clutter plus noise covariance matrix is spiked if the rank of the clutter matrix is less than a fraction $\chi$ of the clutter plus noise covariance matrix. For convenience, we choose $\chi= 0.1$, since it empirically fits with the data simulated by RFView. A more general approach involves model order (dimension) estimation. In the classical statistical setting, this is well studied in terms of penalized likelihood methods such as Akaike Information Criterion (AIC)\,\cite{akaike1974new}, Minimum Description Length (MDL)\,\cite{grunwald2007minimum}, information theoretic criteria\,\cite{wax1985detection}, statistical techniques\,\cite{bai1989rates}, data dependent techniques\,\cite{shah1994determination}, and min-max approaches such as the Embedded Exponential Families\,\cite{kay2005exponentially}. However, in the high dimensional setting considered in this paper, estimating the model order (number of spikes) is a difficult problem not addressed in this paper. In \cite{kang2016expected}, the RCML-EL algorithm uses Brennan's rule,\,\cite{ReedMallet}, as an initial estimate for the rank of the clutter covariance matrix to determine the model order. RCML-EL algorithm correctly estimates the rank as compared to the AIC and MDL techniques. In Sec.~\ref{Sec:Donohue}-\ref{Sec:Similar}, since the proposed algorithm and RCML-EL algorithm share similar optimization problem, the proposed algorithm correctly estimates the model order. The spiked covariance property helps us to deal with the clutter plus noise covariance matrices in high dimensions, which is frequently encountered in radar signal processing. With this knowledge, we define the nonlinear shrinkage-based rotation invariant estimator. \section{Nonlinear Shrinkage Estimation} \label{Sec:Donohue} In this section, we propose the rotation invariant estimator using nonlinear shrinkage of the eigenvalues of the sample covariance matrix. We state the convergence of the estimated eigenvalues in Theorem\,\ref{Thm:NonLinBias} in Sec.~\ref{Sec:Donohue}-\ref{Sec:Thm}. It is to be noted that we use the terms spiked eigenvalues and the leading $r$ eigenvalues of the covariance matrix interchangeably for a fixed clutter covariance matrix with rank $r$. We outline the computation cost of the proposed algorithm. We propose bounds for the normalized SCNR($\rho$) in Sec.~\ref{Sec:Donohue}-\ref{Sec:rhobound}. We show the similarity of SCNR performance between the proposed algorithm and the RCML-EL algorithm in high dimensions in Sec.~\ref{Sec:Donohue}-\ref{Sec:Similar}. We conclude this section by stating the Adaptive Normalized Matched Filter for target detection for the proposed algorithm in Sec.~\ref{Sec:Donohue}-\ref{Sec:Detection}. \label{Sec:Shrinkage} \label{Sec:ShrinkageEst} The spiked covariance matrix ${\mathbf{R}}$ is stated in Definition~\ref{Def:SpikedCovariance}. Estimation of the spiked covariance matrix ${\bar{\mathbf{R}}}_{n}$ as defined in \eqref{eq:EigenDecompEst}, consists of two sub-problems: estimation of the spiked eigenvalues and the estimation of the noise power $\sigma^2$. \begin{enumerate} \item The estimate of the noise power is given as stated in \cite{donoho2018optimal} is \begin{equation} \label{eq:NoisePower} \hat{\sigma}^2=\frac{{\hat\lambda}_{med}}{\mu_{med}} \end{equation} where ${\hat\lambda}_{med}$ is the median of the eigenvalues of the sample covariance matrix ${\hat{\textbf{R}}}_{n}$ and $\mu_{med}$ is the median of the Marchenko-Pastur distribution with parameter $\gamma$ stated in \eqref{eq:Kolmogorov}. The proof of the consistency of the noise power estimator is given in \cite[Sec.\,9]{donoho2018optimal}.\\ \item The shrinkage function ${\eta}^{*}(\cdot)$ as stated in \cite{donoho2018optimal} is \begin{equation} \label{eq:GeneralShrinker1} {\eta}^{*}(\Tilde\lambda_i)=\begin{cases} {\eta}(f(\Tilde\lambda_i))& \Tilde\lambda_i>(1+\sqrt{\gamma})^{2}\\ 1 & \Tilde\lambda_i\leq(1+\sqrt{\gamma})^{2} \end{cases} \end{equation} where $\Tilde\lambda_i={\hat\lambda}_i/\hat\sigma^2$, ${\hat\lambda}_i$ are the eigenvalues of the sample covariance matrix ${\hat{\textbf{R}}}$ and $\hat\sigma^2$ is defined in \eqref{eq:NoisePower}. The function $f(\cdot)$ given by \begin{equation} \label{eq:fx} \footnote{It is to be noted that \eqref{eq:fx} is the inverse mapping for \begin{equation} \label{eq:gx} g(x)=\begin{cases}x+\frac{\gamma\,x}{x-1}& x> 1+\sqrt{\gamma}\\ (1+\sqrt{\gamma})^{2}&1\leq x\leq1+\sqrt{\gamma} \end{cases} \end{equation} when $x>(1+\sqrt{\gamma})^{2}$, it is the relationship between the ${\hat\lambda}$ and ${\lambda}$ and has been explained in \cite{donoho2018optimal}.}f(x)=\frac{x+1-\gamma+\sqrt{(x+1-\gamma)^2-4x}}{2} \end{equation} and ${\eta}(\cdot)$ for Stein loss as stated in \cite{donoho2018optimal}, $\text{L}^{St}={\textnormal{tr}}({\mathbf{R}}^{-1}\,{\bar{\mathbf{R}}}-{\mathbf{I}})-\log\det({\mathbf{R}}^{-1}\,{\bar{\mathbf{R}}})$, is given by \begin{equation} \label{eq:Shrinker1} {\eta}^{\text{St}}(x)=\frac{x}{c(x)^2+s(x)^2\,x} \end{equation} where $c(\cdot)$ is given by \begin{equation} \label{eq:Cosine} c(x)=\begin{cases} \sqrt{\frac{1-\gamma/(x-1)^2}{1+\gamma/(x-1)}}&x> 1+\sqrt{\gamma}\\ 0&x\leq1+\sqrt{\gamma} \end{cases} \end{equation} $s(\cdot)^2={1-c(\cdot)^2}$ and $\gamma$ is given in \eqref{eq:Kolmogorov}.\\ The eigenvalues ${\bar{\lambda}}_{i,{n}}$ of the estimator ${\bar{\mathbf{R}}}_{{n}}$ are given by: \begin{equation} \label{eq:EstEig} {\bar{\lambda}}_{i,{n}}=\hat\sigma^{2}\,\eta^{*}(\Tilde\lambda_i) \end{equation} where $\hat\sigma^{2}$ is given in \eqref{eq:NoisePower} and $\eta^{*}(\Tilde{\lambda}_i)$ is given in \eqref{eq:GeneralShrinker1}. The proof of optimality of this estimator is given in \cite[Sec.\,6]{donoho2018optimal}. \end{enumerate} A pseudo-code to compute the estimator is stated in Algorithm~\ref{alg:Donohue}. \begin{algorithm}[h!] \caption{Nonlinear Shrinkage Algorithm for Spiked Covariance Matrix Estimation}\label{alg:Donohue} \begin{algorithmic}[1] \State Evaluate the eigenvalue decomposition of sample covariance matrix ${\hat{\textbf{R}}}_{{n}}$ as done in \eqref{eq:EigenDecompSample} for a given number of data samples ${n}$. \State Compute the noise power $\hat{\sigma}^2$ by \eqref{eq:NoisePower}. \State Compute the eigenvalues ${\bar{\lambda}}_{i,{n}}$ of the estimator as in \eqref{eq:EstEig}. \State Using eigenvalues computed in Step 3, the estimated covariance matrix ${\bar{\mathbf{R}}}_{{n}}$ is given by \eqref{eq:EigenDecompEst}. \end{algorithmic} \end{algorithm} \subsection{Convergence of Eigenvalues of the Proposed Estimator} \label{Sec:Thm} Although we are dealing with finite $p$ and ${n}$, in Theorem\,\ref{Thm:NonLinBias} we state that the spiked eigenvalues converge almost surely to a constant and satisfy a Central Limit Theorem when both $p,{n}\rightarrow\infty$, given that the number of spikes $r$ is fixed. We assume the following for a covariance matrix ${\mathbf{R}}$ with dimension $p$: \begin{compactenum \item[A1.] Leading $r$ distinct eigenvalues ${\lambda}_1,\,{\lambda}_2,\,\cdots,\,{\lambda}_r$ with multiplicity 1 and lower bounded by $1+\sqrt{\gamma}$. \item[A2.] Eigenvalues ${\lambda}_{r+1}=1,\cdots,{\lambda}_{p}=1$. \end{compactenum} \begin{theorem} \label{Thm:NonLinBias} Consider the estimator ${\bar{\mathbf{R}}}_{{n}}$ of dimension $p$ with eigenvalues $({\bar{\lambda}}_{1,{n}},\,{\bar{\lambda}}_{2,{n}},\,\cdots,\,{\bar{\lambda}}_{p,{n}})$ that estimates the spiked covariance matrix ${\mathbf{R}}$ satisfying the assumptions (A1) and (A2). Assume $p/n\rightarrow\gamma\in(0,1),\,p,n\rightarrow\infty$. Then ${\bar{\lambda}}_{i,{n}}$'s,$\,\,1\leq i\leq r$ satisfy \begin{equation} \label{eq:evLimit} {\bar{\lambda}}_{i,{n}}\xrightarrow{a.s.}{\eta}^{*}(\beta_i) \end{equation} Additionally, if $p/{n}-\gamma=o({n}^{-1/2})$, then \begin{equation} \label{eq:NonlinearCLT} \sqrt{{n}}({\bar{\lambda}}_{i,n}-{\eta}^{*}(\beta_i))\xrightarrow{d}\mathcal{N}(0,\alpha^2_i\,({\eta}^{'}(\beta_i))^2) \end{equation} where ${\eta}^{*}(\cdot)$ is given by \eqref{eq:GeneralShrinker1} and ${\eta}(\cdot)$ is given by \eqref{eq:Shrinker1}. $\beta_i={\lambda}_i+\frac{\gamma\,{\lambda}_i}{{\lambda}_i-1}$, $\alpha^2_i=~2\,{\lambda}_i^2\left(1-\frac{\gamma}{({\lambda}_{i}-1)^2}\right)$ and $\gamma$ is given \eqref{eq:Kolmogorov}. \end{theorem} \textbf{Proof}: Almost sure convergence can be proved by applying Continuous Mapping Theorem on \cite[Thm.\,2]{paul2007asymptotics} with function ${\eta}$. The in-distribution convergence can be proved by applying the delta method on \cite[Thm.\,3]{paul2007asymptotics} with function ${\eta}$.\hfill$\blacksquare$ We empirically showed the validity of assumptions of Theorem~\ref{Thm:NonLinBias} for the Challenge Dataset using the double version of the Kolmogorov-Smirnov~(K-S) test with significance level $5\%$ and 1024 Monte Carlo simulations. The reference data was generated from the prescribed distribution in \eqref{eq:NonlinearCLT} and the test data was generated from the Challenge Dataset. The CDF plot in Fig.\ref{fig:CDFPlot} for the test and reference data reveals that the Challenge Dataset satisfies the assumptions for Theorem~\ref{Thm:NonLinBias}. \begin{figure} \centering \includegraphics[width=\linewidth]{CDFPlot.eps} \caption{The double version of the K-S test with reference data from the prescribed distribution \eqref{eq:NonlinearCLT} and the test data from the Challenge Dataset verifies that the Challenge Dataset satisfies the assumptions for Thm.\ref{Thm:NonLinBias} with $p$-value of 0.8390.} \label{fig:CDFPlot} \end{figure} \subsection*{Computation Cost} Algorithm~\ref{alg:Donohue} does not require prior knowledge of the number of spikes. Step (2) and Step (3) in Algorithm~\ref{alg:Donohue} determine the eigenvalues that are above the noise floor. The computation cost of the algorithm is given below: \begin{enumerate} \item The eigenvalue decomposition requires ${\mathcal{O}}(p^3)$ real-valued multiplications. \item The noise power estimation, step (2), is a median finding algorithm that requires $O(p)$ real-valued multiplications. \item The nonlinear shrinkage, step (3), requires ${\mathcal{O}}(r)$ real-valued multiplications, $r$ being the rank of the clutter covariance matrix. \end{enumerate} We compare algorithm \ref{alg:Donohue} to the RCML-EL algorithm whose computational cost is given as follows: \begin{enumerate} \item The eigenvalue decomposition step takes ${\mathcal{O}}(p^3)$ real valued multiplications. \item The joint noise and rank estimation step takes ${\mathcal{O}}(p^2)$ real valued multiplications. \end{enumerate} The difference is in the noise and rank estimation step; Algorithm \ref{alg:Donohue} takes ${\mathcal{O}}(p)$ real-valued multiplications and the RCML-EL algorithm takes ${\mathcal{O}}(p^2)$. This will be demonstrated in Sec.~\ref{Sec:Simulations}-\ref{Sec:Challenge} empirically. \subsection{Bounds for $\rho$} \label{Sec:rhobound} In this section, we derive the lower and upper bounds for the normalized SCNR($\rho$) using results from \cite{donoho2018optimal1}. We rewrite $\rho$ from \eqref{eq:rho} \begin{eqnarray}\label{eq:raw_form} \rho&=& \frac{\Vert \mathbf{x}\Vert_{2}^{2}}{(\mathbf{x}^H{\bar{\mathbf{R}}}^{-\frac{1}{2}}{\mathbf{R}}{\bar{\mathbf{R}}}^{-\frac{1}{2}}\mathbf{x})(\mathbf{x}^H{\bar{\mathbf{R}}}^{\frac{1}{2}}{\mathbf{R}}^{-1}{{\bar{\mathbf{R}}}}^{\frac{1}{2}}\mathbf{x})}, \end{eqnarray} where $\mathbf{x} = \hat{{\mathbf{R}}}^{-\frac{1}{2}}{\mathbf{y}_t}$. Without loss of generality, assume $\Vert \mathbf{x}\Vert=1$. We use the matrix version of Kantorovich's inequality to bound the denominator. For a positive semi-definite matrix, $\textbf{A}$, and a unit vector $\textbf{x}$, $\|\textbf{x}\|_2=1$, $ (\textbf{x}^H\mathbf{Ax})(\textbf{x}^H\textbf{A}^{-1}\textbf{x})\leq\frac{1}{4}(\kappa(\textbf{A})+\frac{1}{\kappa(\textbf{A})}+2), $ where $\kappa(\textbf{A})$ is the condition number of the matrix $A$. By Cauchy-Schwartz Inequality $(\textbf{x}^H\mathbf{Ax})(\textbf{x}^H\textbf{A}^{-1}\textbf{x})\geq 1$. We lower bound $\rho$ by: \begin{equation} \label{eq:rhobound} \rho\geq\frac{1}{\frac{1}{4}(\kappa(\textbf{A})+\frac{1}{\kappa(\textbf{A})}+2)}\end{equation} where $\textbf{A}={\bar{\mathbf{R}}}^{-\frac{1}{2}}{\mathbf{R}}{\bar{\mathbf{R}}}^{-\frac{1}{2}}$. From \cite{donoho2018optimal1}, we have \begin{equation} \label{eq:optpivot} \kappa(\textbf{A}) = \frac{ \max \left[ 1,\max_{1 \leq i \leq r} \nu_+({\lambda}_{i}^{\ast},{\eta}_{i}) \right] }{\min \left[ 1, \min_{1\leq i \leq r} \nu_-({\lambda}_{i}^{\ast},{\eta}_{i}) \right]} \end{equation} where \[ \nu_\pm({\lambda}_{i}^{\ast},{\eta}_{i}) = T/2 \pm \sqrt{T^2/4-D} \] \[ D= {{\eta}^{\text{St}}}/{{\lambda}^{\ast}},\quad T = (\frac{s^2 + {{\eta}^{\text{St}}}c^2}{{\lambda}^\ast}+c^2+ {{\eta}^{\text{St}}} s^2)\] ${\eta}^{\text{St}}$ defined in \eqref{eq:Shrinker1} and ${\lambda}_{i}^{\ast}={\lambda}_i/\sigma^2$. In Sec.~\ref{Sec:Simulations} we shall demonstrate that the proposed algorithm performs within the derived bounds. \subsection{Performance similarity between Proposed Algorithm and RCML-EL Algorithm} \label{Sec:Similar} In this section, we show that the proposed algorithm and the RCML-EL algorithm will give similar SCNR performance. The optimization problem for clutter plus noise covariance matrix estimation assuming noise power to be unity defined in \cite[(35)]{kang2014rank} is: \begin{equation} \label{eq:OptKang} \begin{aligned} \min_{\boldsymbol{{\bar{\lambda}}}} \quad & \textbf{d}^{T}\,\boldsymbol{{\bar{\lambda}}}-\mathbf{1}^{T}\,\log{\boldsymbol{{\bar{\lambda}}}}\\ \textrm{s.t.} \quad & \textbf{F}\,\boldsymbol{{\bar{\lambda}}}\preceq\textbf{g}\\ &\textbf{E}\,\boldsymbol{{\bar{\lambda}}}=\textbf{h}\\ \end{aligned} \end{equation} where $d_{i}={\hat\lambda}_{i}$, recall from Sec.~\ref{Sec:SignalModel} that ${\bar{\lambda}}$ is eigenvalue of the estimator and ${\hat\lambda}$ is the eigenvalue of the sample covariance matrix. \[\textbf{F}=\begin{bmatrix}\textbf{U}^{T}&\hspace{-0.3cm}-\textbf{I}_{p\times p}&\textbf{I}_{p\times p} \end{bmatrix}^{T}\in{\mathbb{R}}^{3p\times p}\]\[\textbf{g}=\begin{bmatrix}\mathbf{0}_{p\times 1}^{T}&\hspace{-0.3cm}-\boldsymbol{\epsilon}_{p\times 1}^{T}&\hspace{-0.2cm}\mathbf{1}_{p\times 1}^{T} \end{bmatrix}^{T}\in{\mathbb{R}}^{3p\times 1}\] $\boldsymbol{\epsilon}_{p\times 1}=[\epsilon,\ldots,\epsilon]_{p\times 1},\, \epsilon>0$, \[\textbf{U}=\begin{bmatrix} 1&-1&0&0&\ldots&0\\ 0&1&-1&0&\ldots&0\\ \vdots&\ddots&\ddots&\ddots&\vdots&\vdots\\ 0&\ldots&\ldots&\ldots&1&-1 \end{bmatrix}\in {\mathbb{R}}^{p\times p}\] \[\textbf{E}=\begin{bmatrix}\mathbf{0}_{r\times r}&\mathbf{0}_{r\times p-r}\\ \mathbf{0}_{(p-r)\times r}&\textbf{I}_{p-r}\end{bmatrix}\in {\mathbb{R}}^{p\times p}\]\[\textbf{h}=\begin{bmatrix}0,\,0,\,\cdots,0_r,1,\,1,\cdots,1\end{bmatrix}^{T}\in {\mathbb{R}}^{p\times 1}.\] The first constraint in \eqref{eq:OptKang} enforces ${\bar{\lambda}}_i$ to be positive in descending order and the second constraint enforces the last $p-r$ eigenvalues of the estimator to be equal. These constraints enforce a spiked covariance matrix structure on the estimator, stated in Definition \ref{Def:SpikedCovariance}, in a high dimensional setting. In \cite{donoho2018optimal}, the optimization problem for estimating leading $r$ eigenvalues for Stein loss under a spiked covariance model is given by: \begin{equation} \label{eq:OptDon} \begin{aligned} \min_{{\bar{\lambda}}_i,\,1\leq i\leq r} \quad & a_i\,{\bar{\lambda}}_i-b_i\,\log{{\bar{\lambda}}_i}+m_i \end{aligned} \end{equation} where $a_i=c^2/g({\hat\lambda}_{i})+s^2$, $b_i=1$ and $m_i=1/g({\hat\lambda}_i)-1-a_i+\log(f({\hat\lambda}_i))$; $f(\cdot)$ is given in \eqref{eq:fx}, $g(\cdot)$ is given in \eqref{eq:gx}, $c(\cdot)$ and $s(\cdot)$ are given in \eqref{eq:Cosine}. Since the cost function of \eqref{eq:OptKang} is identical to \eqref{eq:OptDon} within a constant and the constraints of \eqref{eq:OptKang} are implicit to the optimization problem of \eqref{eq:OptDon}, the normalized SCNR, $\rho$ and the rank of the clutter covariance matrix, $r$, will be identical. In Sec.~\ref{Sec:Simulations} we shall demonstrate that the SCNR performance for the proposed algorithm is identical to the RCML-EL algorithm with a reduced computation time. \subsection{Low-Rank Adaptive Normalized Matched Filter Detection} \label{Sec:Detection} In this section, we shall use the Low-Rank Adaptive Normalized Matched Filter (LR-ANMF) detector for a rotation-invariant estimator as stated in \cite{vallet2019improved}. This detection scheme is independent of the eigenvalue shrinkage in \eqref{eq:GeneralShrinker1} and only depends on the eigenvectors of the sample covariance matrix in high dimensions. This detector is the same for both the proposed algorithm and the RCML-EL algorithm. We have the following binary hypothesis for a single target: \begin{align} \label{eq:hypo} \begin{split} {\mathcal{H}_0}:\,& {\mathbf{y}}\sim\mathcal{N}(0,{\mathbf{R}}) \\ {\mathcal{H}_1}:\,&{\mathbf{y}}\sim\mathcal{N}(h_t{\mathbf{s}},{\mathbf{R}}) \end{split} \end{align} where ${\mathcal{H}_0}$ is the null hypothesis when no target is present and ${\mathcal{H}_1}$ is the alternate hypothesis when the target is present. The target signal ${\mathbf{s}}$ is defined in the same way as ${\mathbf{y}_t}$ in \eqref{eq:rho} with a complex-valued amplitude $h_t$ and ${\mathbf{R}}$ is the clutter plus noise covariance matrix. The test statistics for the LR-ANMF with $n$ data samples, as stated in \cite{rangaswamy2004robust}, is \begin{equation} \label{eq:TS} T_n=\frac{|{\mathbf{s}}\,\hat{\Pi}_n\,{\mathbf{y}}|^2}{\|\hat{\Pi}_n\,{\mathbf{s}}\|^2}>\delta \end{equation} where \[\hat\Pi_n={\mathbf{I}}-\sum_{i=1}^{r}{\mathbf{v}}_{i,n}\,{\mathbf{v}}_{i,n}^{H}\] is a projection matrix constructed using the eigenvectors ${\mathbf{v}}_{i,n}$ defined in \eqref{eq:EigenDecompSample} corresponding to the $r$ spikes of the spiked covariance matrix and $\delta$ is the detection threshold. Recall from Sec.~\ref{Sec:SignalModel}-\ref{Sec:SpikedCovar} that $r$ is the rank of the clutter covariance matrix. The knowledge of noise power $\sigma^2$ is not impacting the detection since we are using assumption (A1) in Sec.~\ref{Sec:Donohue}-\ref{Sec:Thm} where $\sigma^2$ has already been estimated. We present the convergence theorems from \cite{vallet2019improved} that state the in-distribution convergence of the test statistics under ${\mathcal{H}_0}$ and ${\mathcal{H}_1}$. \begin{theorem}[\cite{vallet2019improved}, Thm\,2] Under ${\mathcal{H}_0}$ and assumption (A1) the test statistics $T_n$ satisfies: \begin{equation} T_n\xrightarrow{D}\chi^2(2) \end{equation} where $\chi^2(2)$ is a chi-squared distribution with one complex degree of freedom. The probability of false alarm with detection threshold $\delta$ is: \begin{equation} \begin{split} P_{{FA}}&=\lim_{n\rightarrow{}\infty}\mathbb{P}(T_n>\delta|{\mathcal{H}_0})=\int_{\delta}^{\infty}\exp({-x})\,dx\\ &=\exp{(-\delta)} \end{split} \end{equation} \end{theorem} \begin{theorem}[\cite{vallet2019improved}, Thm\,3] Under ${\mathcal{H}_1}$ and assumption (A1) the test statistics $T_n$ satisfies: \begin{equation} \lim_{n\xrightarrow{}\infty}\sup_{x\in{\mathbb{R}}}\left|\mathbb{P}(T_n<x)-F\left(x;2,\Delta\right)\right|\xrightarrow{}0 \end{equation} where $F(x;2,\Delta)$ denotes the cumulative distribution of a non-central $\chi^2$ distribution with one complex degree of freedom and non-centrality parameter $\Delta$. \begin{equation} \Delta=\frac{2|h_t|^2}{\nu} \end{equation} $h_t$ is defined in \eqref{eq:hypo}, \begin{align*} \begin{split} \nu=&\frac{1}{\|\Pi{\mathbf{s}}\|^2+\sum_{i=1}^{r}(1-c^2({\lambda}_i))|{\mathbf{s}}^{H}\,{\mathbf{u}}_i|^2}\\&+\frac{\sum_{i=1}^{r}({\lambda}_i-1)(1-c^2({\lambda}_i))|{\mathbf{s}}^{H}\,{\mathbf{u}}_i|^2}{(\|\Pi{\mathbf{s}}\|^2+\sum_{i=1}^{r}(1-c^2({\lambda}_i))|{\mathbf{s}}^{H}\,{\mathbf{u}}_i|^2)^2} \end{split} \end{align*} where $\Pi={\mathbf{I}}-\sum_{i}^{r}{\mathbf{u}}_i{\mathbf{u}}_i^H$, $c(\cdot)$ is defined in \eqref{eq:Cosine}, ${\mathbf{u}}_{i}$ defined in \eqref{eq:EigenDecomTrue}, $r$ is rank of the clutter covariance matrix and ${\mathbf{s}}$ defined in \eqref{eq:hypo}. The corresponding target detection probability with detection threshold $\delta$ is: \begin{align} \begin{split} P_{{D}}&=\exp(-\Delta)\sum_{k=0}^{\infty}\frac{\Delta^k}{k!}\left[1-\frac{\int_{0}^{\delta}x^{k}\exp(-x)\,dx}{\Gamma(k+1)}\right]\\ &=\lim_{n\rightarrow{}\infty}\mathbb{P}(T_n>\delta|{\mathcal{H}_1}) \end{split} \end{align} where $\Gamma(\cdot)$ is the gamma function. \end{theorem} In Sec.~\ref{Sec:Simulations}-\ref{Sec:DetectionNumerical}, we compute the detection probabilities for different false alarm probabilities over a range of signal-to-noise ratios (SNR), we empirically evaluate the robustness of the detector for detecting a single target in the presence of multiple targets that act as contaminating clutter discretes. Contaminating clutter discretes are additional spikes that are present due to undesired targets. They are not part of clutter spikes and change the clutter covariance matrix rank from $r$ to $\hat{r}$. To conclude this section, we proposed the nonlinear shrinkage-based rotation invariant estimator by using the sample covariance matrix. We stated the convergence of the spiked eigenvalues of the estimator. We stated the bounds for the normalized SCNR. The equivalence of the RCML-EL algorithm in a high dimensional setting to the proposed algorithm was established. A detector for target detection was stated for the proposed algorithm. \section{NUMERICAL EXAMPLES} \label{Sec:Simulations} We use a dataset generated using $\textnormal{RFView}^{\circledR}$ software that provides an accurate characterization of complex RF environments. It uses stochastic transfer functions \cite{gogineni2022high} to simulate the high-fidelity RF clutter encountered in practice. The dataset consists of a data cube in the time domain and is a multi-dimensional $N\times K\times {n}$ matrix, where $N$ is the total number of (fast-time), $K$ is the slow time and ${n}$ is the number of range gates in a specified coherent processing interval. For our case, we use the range gates as the number of data samples ${n}$. In Sec.~\ref{Sec:Simulations}-\ref{Sec:Challenge}, we use the Challenge Dataset generated by RFView. We compare the performance of the Algorithm~\ref{alg:Donohue} against the RCML-EL based estimation algorithm given in \cite{kang2016expected}. We plot the normalized SCNR ($\rho$), stated in \eqref{eq:rho}, as a function of training data size ${n}$, the normalized Doppler, and the normalized angle. For all the plots we are simulating in the regime where ${n}={\mathcal{O}}(p)$, i.e., $1/10<p/n<1$. We also demonstrate the computation times for our proposed algorithm and the RCML-EL algorithm for various ${n}$. In Sec.~\ref{Sec:Simulations}-\ref{Sec:DetectionNumerical}, we compute the target detection probabilities over a range of false alarm probabilities and SCNR. In Sec.~\ref{Sec:Simulations}-\ref{Sec:ErrorVariance}, we compute the error variance of the minimum variance distortionless response beamformer using the proposed algorithm and compare it with the error variance corresponding to the RCML-EL algorithm and the true covariance matrix. We only compare with the RCML-EL algorithm because it outperforms the Sample covariance matrix SMI, FML\,\cite{steiner2000fast}, Chen's algorithm\,\cite{chen2001development} and AIC\,\cite{akaike1974new}, as documented in \cite{kang2016expected} in all metrics. Since the theory underlying Theorem \ref{Thm:NonLinBias} holds only in the regime of $n>p$, no definitive statements can be made for the case of $n<p$. Therefore, the validity of the proposed algorithm is restricted to the case of $n>p$. We simulated our results $\textnormal{Matlab}^{\circledR}$-R2021b on Windows-11 OS running on AMD Ryzen 7 5800H microprocessor with 16GB RAM. \subsection{SCNR Performance} \label{Sec:Challenge} The Challenge dataset contains radar target and clutter returns generated by $\textnormal{RFView}^{\circledR}$. The scenario in Challenge Dataset has 4 targets and ground clutter containing buildings. This scenario involves an airborne monostatic radar flying over the Pacific Ocean near the coast of San Diego looking down for ground moving targets. The data spans several coherent processing intervals as the platform is moving with constant velocity along the coastline. In Table~\ref{Table:RadarPlatformLocation}-\ref{Table:Clutter2}, Appendix we state all the parameters used for this scenario. The data set consists of a $32\times64\times2335$ data cube matrix which has the clutter impulse response over 32 channels with 64 pulses and 2335 data samples. We concatenate $8$ channels to get a clutter impulse response matrix of size $512\times2335$. We convolve the rows of the clutter impulse response matrix with a waveform of pulse length $1000$ to get a clutter return matrix of dimension $512\times 3334$. We add additive white Gaussian noise with zero-mean and variance $\sigma^2=5\times10^{-14}$ to the resulting clutter return matrix. The dimension of the clutter plus noise covariance matrix is $512\times 512$. We vary ${n}$ in the multiples of $p$ till $n<3334$ to get the sample covariance matrix. For each plot, we use 1024 Monte Carlo simulations. For normalized Doppler, we fix the angle interval at $\frac{\pi}{180}$ and marginalize over it. For the normalized angle, we fix the Doppler interval at $\frac{\pi}{50}$ and marginalize over it. For both cases, we fix ${n}=1024$. Fig.\,\ref{fig:SDS12Compare} displays the average normalized SCNR vs. the number of data samples ${n}$. The run-time for different ${n}$ is given in Table \ref{table:SDS12}. Normalized SCNR vs. normalized Doppler is given in Fig.\,\ref{fig:SDS12Doppler} and normalized SCNR vs. normalized angle in Fig.\,\ref{fig:SDS12Angle}. \begin{table}[h!] \centering \begin{tabular}{|p{2cm}|l|l|} \hline Training Data Size\,(${n}$) & Proposed Algorithm & RCML-EL algorithm \\\hline 512 & 0.012035s & 0.107116s \\\hline 1024 & 0.003046s & 0.070876s \\\hline 1536 & 0.002028s & 0.053037s \\\hline 2048 & 0.002026s & 0.050819s \\\hline 2560 & 0.002095s & 0.050504s \\\hline \end{tabular} \caption{Algorithm \ref{alg:Donohue} takes less computation time as compared to the RCML-EL algorithm for the Challenge Data set.} \label{table:SDS12} \end{table} \begin{figure}[h!] \centering \includegraphics[width=\linewidth]{rhoBounds.eps} \caption{The Proposed algorithm has identical SCNR compared to the RCML-EL algorithm. SCNR for both estimators is within the derived bounds.} \label{fig:SDS12Compare} \end{figure} \begin{figure}[h!] \centering \includegraphics[width=\linewidth]{SDS12Doppler.eps} \caption{Algorithm \ref{alg:Donohue} has identical SCNR compared to the RCML-EL algorithm.} \label{fig:SDS12Doppler} \end{figure} \begin{figure}[h!] \centering \includegraphics[width=\linewidth]{SDS12Angle.eps} \caption{Algorithm \ref{alg:Donohue} has identical SCNR compared to the RCML-EL algorithm.} \label{fig:SDS12Angle} \end{figure} \subsection{Target Detection} \label{Sec:DetectionNumerical} In this section, we use results from Sec.~\ref{Sec:Donohue}-\ref{Sec:Detection} with the target having a Doppler of $f_d=0.2$ and an angle of $\theta=30^{\circ}$. We plot the target detection probability $P_D$ as we vary false alarm probability $P_{FA}$ from $10^{-5}$ to $10^{-1}$ in the multiples of 10 from SCNR=-10dB to 30dB. We use $n=1024$ data samples with 1024 Monte Carlo Simulations. The Challenge Dataset contains 4 targets. We consider detecting a single target with remaining targets constituting contaminating clutter discretes. These contaminating clutter discretes do not share the same characteristics as the target of interest so there is no self-target cancellation. Recall from Sec.~\ref{Sec:Donohue}-\ref{Sec:Detection} that the contaminating clutter discretes change the clutter rank to an unknown $\hat{r}$. By introducing multiple targets as contaminating clutter discretes we demonstrate the robustness of the detector. The detection probabilities are the same for both the RCML-EL algorithm and the proposed algorithm as the detector uses only the eigenvectors of the sample covariance matrix. The detection probabilities are illustrated in Fig.\ref{fig:PdPfa}. \begin{figure}[ht!] \centering \includegraphics[width=\linewidth]{Pd.eps} \caption{As $P_{FA}$ is decreased, higher SNR is required to get a fixed $P_D$ for a single target. The presence of other targets is not affecting the detection probabilities as they are projected into the null space of the target subspace. This empirically shows that the detector is robust to the presence of contaminating clutter discretes.} \label{fig:PdPfa} \end{figure} \subsection{Empirical Error Variance} \label{Sec:ErrorVariance} In this section, we empirically present the minimum variance distortionless beamformer (MVDR) error variance due to the proposed algorithm with the error variance of the beamformer of the RCML-EL algorithm and the true covariance matrix. The error variance for the beamformer is \begin{equation} \label{eq:MSE} \text{Error Variance}=1/|{\mathbf{s}}^H\,\textbf{M}^{-1}{\mathbf{s}}|\end{equation} where $\textbf{M}={\bar{\mathbf{R}}}_{\text{proposed}}$ for the proposed algorithm, ${\bar{\mathbf{R}}}_{\text{RCML-EL}}$ for the RCML-EL algorithm and ${\mathbf{R}}$ for the true covariance matrix, respectively. The target signal ${\mathbf{s}}$, as defined like ${\mathbf{y}_t}$ in \eqref{eq:rho}, has Doppler $f_d=0.3$ and angle $\theta=30^{\circ}$. In Fig.\ref{fig:MSE}, the error variance for RCML-EL and the proposed algorithm is identical to the true covariance matrix. The error variance does not change as the training data size is increased since we are working in the asymptotic regime. This is due to the fact that in the asymptotic regime, the estimated covariance matrix converges to the true covariance matrix with probability 1. Hence, the error variance in \eqref{eq:MSE} merely becomes the reciprocal of the SNR from \eqref{eq:rho} when ${\bar{\mathbf{R}}}={\mathbf{R}}$. \begin{figure} \centering \includegraphics[width=\linewidth]{MSE.eps} \caption{The normalized error variance due to the proposed algorithm and the RCML-EL algorithm is identical to that of the true covariance matrix. We normalize error variance in \eqref{eq:MSE} by the error variance of the true covariance matrix. } \label{fig:MSE} \end{figure} To conclude this section, we demonstrated that with reduced covariance computation time, Algorithm \ref{alg:Donohue} gives identical SCNR performance compared to the EL-based covariance estimation algorithm within the proposed bounds. However, the noise computation step requires some pre-computed values of the medians of Marchenko Pastur distributions for various values of $\gamma$. This also makes our algorithm less robust to a sudden change in the parameters of the scenario as data samples can vary depending on the range swath. We demonstrated the target detection probabilities for different false alarm probabilities using the LR-ANMF detector. We empirically demonstrated the robustness with respect to contaminating clutter discretes in the Challenge Dataset. We empirically demonstrated that the error variance of the proposed algorithm is identical to the true covariance matrix. \section*{CONCLUSION} We exploited the spiked covariance structure for the clutter plus noise covariance matrix in a high dimensional setting and proposed a nonlinear shrinkage-based rotation invariant estimator. We stated the convergence of the spiked eigenvalues of the estimator. We demonstrated the reduced covariance computation times compared to the RCML-EL algorithm. Our proposed algorithm had identical SCNR performance compared to the RCML-EL algorithm. We employed the LR-ANMF detector for robust target detection and empirically showed that the error variance of the algorithm is identical to the true covariance matrix. Our proposed algorithm is a batch-wise algorithm. In future work it is worthwhile developing an adaptive version of the algorithm. We will also investigate other kinds of loss functions for various scenarios by introducing various constraints and deriving the concentration bounds for the proposed algorithm. The number of contaminating clutter discretes and their relative strength in the challenge dataset is not sufficient to provide a comprehensive analysis of the robustness feature of the LR-ANMF detector. This facet of the technique will be explored in more detail in the future.
\section{Introduction} \label{sec:intro} Vision and sound play essential roles in human perception of the surrounding scene. These two modalities contain not only semantic information (\eg, the class of objects and the content of speech) but also spatial information (\eg, the position of sound sources). Our brain can analyze and integrate different modalities to thoroughly understand the surrounding environment. Naturally, the absence of either modality hinders our sense of the physical world. Recognizing this, the machine perception research community has seen a spectrum of works~\cite{owens2018audio,localization_easy,tian2018audio,soundspaces,semantic_navigation,sound_pixel,2.5D,zhou2020sep,guo2021ad,song2021tacr,song2021fsft} proposed to learn and model auditory and visual signals jointly. Different from past audio-visual learning works, this paper focuses on the synthesis of novel audio-visual scenes in the real world. We define novel audio-visual scene synthesis as a task to synthesize a target video, including visual frames and the corresponding spatial audio, along an arbitrary camera trajectory from given source videos and trajectories. Learning from source video in a real-world environment with binaural audio, the generated target spatial audio and video frames are expected to be consistent with the given camera trajectory visually as well as acoustically to ensure perceptual realism and immersion. Although there are some similar works\cite{naf,du2021gem}, these methods have some constraints that limit their usage in solving our problem. Luo \textit{et al.} \cite{naf} propose neural acoustic fields to model sound propagation in a room. However, their model works in a simulation environment and relies on ground-truth acoustic labels that are difficult to obtain in a real-world scene. Du \textit{et al.} \cite{du2021gem} propose a manifold learning method that can map a latent vector to a pair of image and audio. However, the latent vectors are uninterpretable and the manifold cannot support the controllable generation of audio-visual pairs. In this paper, we propose a novel NeRF-based method for synthesizing real-world audio-visual scenes, dubbed AV-NeRF. NeRF \cite{nerf} implicitly and continuously represents the visual scene using neural fields and the neural fields can be used to render novel views. Although NeRF has achieved impressive success in the vision domain, directly using NeRF in our task does not yield the best performance because of the lack of prior knowledge and acoustic supervision. NeRF uses the classical volume rendering method \cite{classical_render} to render the color of a ray based on the physical property of light propagation. However, there is no prior knowledge for NeRF-based audio synthesis. Moreover, the recording mechanisms of these two signals are different. At a given camera pose, we can capture an image with millions of pixels but can only record one acoustic signal (assuming the acoustic property of the environment is time-invariant). Each pixel can serve as visual supervision while the whole acoustic signal is the auditory supervision. The imbalance between the amounts of visual data and audio data hinders the optimization of NeRF for audio synthesis. To tackle these challenges, we propose an acoustic-aware audio generation module that incorperates our prior knowledge of audio propagation into NeRF, a coordinate transformation mechanism that encourages NeRF learning sound source-centric neural fields, and a binaural audio augmentation method to improve acoustic supervision. To this end, our AV-NeRF is capable of generating audio-visual consistent scenes using the same amount of data. Considering that 3D geometry and material property of an environment determine the sound propagation (\eg, the existence of a barrier between the sound source and the sound receiver indicates the decay of sound energy), we propose an acoustic-aware audio generation module, named as AV-Bridge, that correlates the spatial effects of the sound with the 3D visual geometry. Visual NeRF can generate not only the color $\mathbf{c}$ of one point in 3D space but also its density $\sigma$ \cite{nerf}. The density function of an environment serves as an important indicator of 3D geometry. Our AV-Bridge extracts density information from the visual NeRF to obtain a voxel grid and learns its latent representation. We feed this latent representation to audio NeRF and enforce audio NeRF learning acoustic-aware audio generation. In vanilla NeRF \cite{nerf}, viewing direction $(\theta, \phi)$ is expressed in an absolute coordinate system. This coordinate expression is a natural practice in visual space such that the same orientation at different spatial positions is expressed equally. However, this expression method in audio space is sub-optimal. Human perception of the sound direction is based on the relative direction to the sound source instead of the absolute direction. For example, when a person walks around an omnidirectional sound source and keeps facing the sound source, his sensation of the sound source position is constant but his absolute orientation varies. Considering this fact, we propose a coordinate transform mechanism that expresses the viewing direction relative to the sound source to encourage our model to learn a sound source-centric acoustic field. Unlike simulation environments \cite{soundspaces,soundspaces2} where the ground-truth acoustic information is easily accessible, samples in real-world scenes are captured sparsely and often can not cover the whole environment. To render a realistic video at novel poses, we utilize a head-related impulse response function (HRIR) to augment training data. HRIR serves as a sound filter that represents changes in sound with respect to the position of the sound source. This augmentation strategy can improve acoustic supervision and enhance the spatial effects of rendered audio at novel poses. In summary, our contributions include: (1) proposing a novel method of synthesizing real-world audio-visual scenes at novel positions and directions; (2) introducing a novel acoustic-aware audio generation method to encode our prior knowledge of sound propagation; (3) proposing a coordinate transformation mechanism for effective direction expression; (4) introducing a binaural audio augmentation method to improve the acoustic supervision; (5) quantitatively and qualitatively demonstrating advantages of our method. In the paper, we target modeling acoustic fields and establishing the correlation between visual and acoustic worlds. The rendering of the purely visual world has been well studied \cite{sitzmann2019scene,nerf,niemeyer2020differentiable,yariv2020multiview} and is not the main focus of our work. \section{Related Work} \label{sec:related} \noindent \textbf{Neural Fields.} Our method is based on the neural fields, especially Neural Radiance Fields (NeRF) \cite{nerf}. NeRF learns an implicit and continuous representation of visual scenes using a neural network and synthesizes novel views based on the trained neural network. After the presence of NeRF, several works extend NeRF to broader domains, such as video (silent video)\cite{li2020neural,Gao-ICCV-DynNeRF,multivideonerf}, audio \cite{naf}, and audio-visual~\cite{du2021gem}. Luo \textit{et al.} \cite{naf} propose neural acoustic fields (NAF) to capture how sound propagates in an environment. Although NAF achieves convincing results, its reliance on synthetic environments and ground truth impulse response functions hinder its application in real-world scenes. Their discretization of position and direction (the listener can only move in a fixed x-y grid and rotate $0\degree$, $90\degree$, $180\degree$, and $270\degree$) restricts the camera motion while our model can handle continuous position and direction input. Du \textit{et al.} \cite{du2021gem} propose a manifold learning method that maps vectors in the latent space to audio and image space. While the learned manifold can be used for audio-visual interpolation, the model does not support controllable audio-visual generation because the latent space does not contain interpretable spatial and temporal information. Our method instead learns implicit neural representations that are explicitly conditioned on spatial coordinates enabling controllable real-world scene generation. \vspace{1mm} \noindent \textbf{Visually Informed Spatial Audio Generation.} Spatial audio can not only help people localize the sound source but also establish an immersive experience in 3D environments. Recently, many visually informed audio spatialization approaches \cite{2.5D,zhou2020sepsteero,xu2021visually,MorgadoVLW18} have been proposed. Among them, Gao \textit{et al.} \cite{2.5D} focus on normal field-of-view video and binaural audio. Zhou \textit{et al.} \cite{zhou2020sepsteero} propose a unified framework to solve the sound separation and stereo sound generation at the same time. Xu \textit{et al.} \cite{xu2021visually} propose a PseudoBinaural pipeline that correlates spatial locations with binaural audio people receive using HRIR function \cite{hrir}. Although these methods generate good binaural audio, they assume the ground-truth visual frames are available, which does not hold when the model generates audio at a novel pose. Our method does not rely on ground-truth images for audio spatialization because our AV-NeRF learns an acoustic field that is only conditioned on the pose. Moreover, our model uses two orders of magnitude less data for training than their methods. \begin{figure*}[htbp] \centering \includegraphics[width=\textwidth]{figs/pipeline.png} \vspace{-8mm} \caption{The pipeline of our method. Given the position $(x,y,z)$ and viewing direction $(\theta,\phi)$ of a listener, our method can render an image the listener would see and the corresponding binaural audio the listener would hear. Our model consists of V-NeRF, A-NeRF, and AV-Bridge. V-NeRF learns to generate acoustic masks, A-NeRF learns to generate visual frames and AV-Bridge is optimized to extract geometric information from V-NeRF and incorporate this information into A-NeRF.} \vspace{-3mm} \label{fig:pipeline} \end{figure*} \vspace{1mm} \noindent \textbf{Geometry and Material Based Acoustic Simulation.} Another line of work \cite{soundspaces,soundspaces2,360audio,tang2020scene} focuses on acoustic simulation by modeling an environment's 3D geometry and material property. Chen \textit{et al.} \cite{soundspaces} propose a SoundSpaces audio platform where the room impulse response function of given discrete listener and sound source positions can be calculated by modeling the geometry and material property of an environment. Extending the work, Chen \textit{et al.} \cite{soundspaces2} further propose SoundSpaces 2.0, which supports realistic acoustic generation for arbitrary sounds captured from arbitrary microphone locations in 3D environments. Li \textit{et al.}~\cite{360audio} propose blending the early reverberation part modeled by geometric acoustic simulation and frequency modulation with a late reverberation tail extracted from recorded impulse response. Tang \textit{et al.} \cite{tang2020scene} propose estimating reverberation time ($T_{60}$) and equalization (EQ) using a learning-based acoustic analysis method. The predicted $T_{60}$ and EQ are then used for material optimization enabling audio rendering. Unlike these virtual rendering approaches, our method learns from and synthesizes real-world audio-visual scenes conditioned on the learned 3D geometry of an environment. \section{Method} \label{sec:method} Our method learns neural fields for synthesizing real-world audio-visual scenes at novel poses. When training AV-NeRF, we feed the model with several video clips (with binaural audio) and corresponding camera trajectories when capturing these video clips. We encourage AV-NeRF learning a mapping from camera trajectories to video clips. At inference time, we feed AV-NeRF with an arbitrary camera trajectory and expect the model to output a target video that is consistent with the input camera trajectory visually and acoustically. The whole pipeline is illustrated in Fig.~\ref{fig:pipeline}. Our model consists of three trainable modules: V-NeRF, A-NeRF and AV-Bridge. V-NeRF learns to generate acoustic masks, A-NeRF learns to generate visual frames and AV-Bridge is optimized to extract geometric information from V-NeRF and integrate this information into A-NeRF. \subsection{V-NeRF} \label{sec:vnerf} NeRF \cite{nerf} uses a Multi-Layer Perceptron (MLP) to represent a visual scene implicitly and continuously. It learns a mapping from camera poses to colors and densities: \begin{equation} \mathrm{NeRF}: (x,y,z,\theta,\phi) \rightarrow (\mathbf{c}, \sigma)\enspace, \end{equation} where $\mathbf{X}=(x,y,z)$ is the 3D position, $\mathbf{d}=(\theta, \phi)$ is the direction, $\mathbf{c}=(r,g,b)$ is the color, and $\sigma$ is the density. To render view-dependent color $\mathbf{c}$ and ensure multiview consistency, NeRF first maps a 3D coordinate $(x,y,z)$ (we apply positional encoding to all input coordinates, unless otherwise noted) to density $\sigma$ and a feature vector; then NeRF maps the feature vector and 2D direction $(\theta, \phi)$ to a color $\textbf{c}$. This process is illustrated in Fig.~\ref{fig:vnerf}. NeRF then uses the volume rendering method \cite{classical_render} to generate the color of any ray $\mathbf{r}(t) = \mathbf{o} + t\mathbf{d}$ marching through the visual scene with near and far bounds $t_n$ and $t_f$: \begin{equation} C(\mathbf{r}) = \int_{t_n}^{t_f}T(t)(\mathbf{r}(t))\mathbf{c}(\mathbf{r}(t),\mathbf{d})dt \enspace, \end{equation} where $T(t) = \exp(-\int_{t_n}^{t}(\mathbf{r}(s))ds)$ and $\mathbf{d}=(\theta, \phi)$ (expressed as a 3D Cartesian unit vector). This continuous integral is estimated by quadrature in practice. Considering that our model learns a neural representation of real-world scenes, we do not apply normalized device coordinate (NDC) transformation to 3D coordinates. \begin{figure}[tbp] \centering \begin{subfigure}[b]{0.99\columnwidth} \centering \includegraphics[width=\textwidth]{figs/vnerf.png} \caption{V-NeRF} \label{fig:vnerf} \end{subfigure} \vfill \begin{subfigure}[b]{\columnwidth} \centering \includegraphics[width=\textwidth]{figs/anerf.png} \caption{A-NeRF} \label{fig:anerf} \end{subfigure} \vspace{-5mm} \caption{Architecture of V-NeRF and A-NeRF.} \vspace{-8mm} \end{figure} \subsection{A-NeRF} \label{sec:anerf} The target of A-NeRF\ is to learn a neural acoustic representation that can map 5D coordinates $(x,y,z,\theta, \phi)$ to corresponding acoustic masks $\mathbf{m}_m, \mathbf{m}_d \in \mathcal{R}^{2\times F}$, where $\mathbf{m}_m$ means the change of magnitude and phase of sound w.r.t. the position $(x,y,z)$ while $\mathbf{m}_d$ means the change of magnitude and phase of sound w.r.t. the direction $(\theta, \phi)$, and $F$ is the number of frequency bins: \begin{equation} \mathrm{NeRF}: (x,y,z, \theta, \phi) \rightarrow (\mathbf{m}_m, \mathbf{m}_d) \enspace. \end{equation} In practice, as shown in Fig.~\ref{fig:anerf}, we feed A-NeRF with 3D position $(x,y,z)$ to obtain a mixture mask $\textbf{m}_m$ and a feature vector. Then we concatenate this feature vector with the input direction $(\theta, \phi)$ and pass it to the rest part of A-NeRF to generate a difference mask $\textbf{m}_d$. For the sake of clarity, we use $\hat{a}$ to represent predicted audio and $a$ to represent ground-truth audio in the rest of paper. Given a sound $a_s$, we first utilize short-time Fourier transform (STFT) to convert input audio from the time domain to the time-frequency domain $\mathrm{STFT}(a_s)=s_s\in \mathcal{R}^{2\times F \times W}$, where $W$ is the number of time frames. Then, we multiply $s_s$ and $\mathbf{m}_m$ using complex multiplication to predict the spectrum of the mix sound $\hat{s}_m \in \mathcal{R}^{2\times F \times W}$ at target position $(x,y,z)$. To enable binaural audio generation, we further multiply the predicted spectrum $\hat{s}_m$ and $\mathbf{m}_d$ to calculate the difference between left and right channels $\hat{s}_d \in \mathcal{R}^{2\times F \times W}$. Finally, we use inverse short-time Fourier transform (ISTFT) to generate binaural audio $\hat{a}_l, \hat{a}_r$. We define $\hat{a}_m=\hat{a}_l + \hat{a}_r$ and $\hat{a}_d = \hat{a}_l - \hat{a}_r$, so $(\hat{a}_m+\hat{a}_d)/2=(\hat{a}_l + \hat{a}_r + \hat{a}_l - \hat{a}_r)/2=\hat{a}_l$ and $(\hat{a}_m-\hat{a}_d)/2=(\hat{a}_l + \hat{a}_r - \hat{a}_l + \hat{a}_r)/2=\hat{a}_r$. This process can be formulated mathematically in Eq.~\ref{eq:anerf}. Instead of estimating the left and right channels of the target audio directly, we predict the mix of target audio $\hat{a}_m$ and the difference between two channels of the target audio $\hat{a}_d$. Gao and Grauman \cite{2.5D} indicate that directly predicting two channels makes audio spatialization network learn some shortcuts. \begin{equation} \begin{split} \hat{a}_m &= \mathrm{ISTFT}(\hat{s}_m) \\ &= \mathrm{ISTFT}(s_s * \mathbf{m}_m) \enspace,\\ \hat{a}_d &= \mathrm{ISTFT}(\hat{s}_d) \\ &= \mathrm{ISTFT}(\hat{s}_m * \mathbf{m}_d) \\ &= \mathrm{ISTFT}(s_s * \mathbf{m}_m * \mathbf{m}_d) \enspace,\\ \hat{a}_l &= (\hat{a}_m + \hat{a}_d) / 2 \enspace,\\ \hat{a}_r &= (\hat{a}_m - \hat{a}_d) / 2 \enspace.\\ \end{split} \label{eq:anerf} \end{equation} \subsection{AV-Bridge} \label{sec:ev} Given the fact that 3D geometry and material property determine the sound propagation in an environment, we propose an acoustic geometry-aware audio generation method by integrating 3D visual geometry information learned by V-NeRF with A-NeRF. When V-NeRF learns to represent visual scenes, thanks to the multiview consistency constraint, it can capture the density function $\mathbf{\sigma}$ of the environment. Such density function represents the existence of objects within the environment. So we extract geometric information from V-NeRF and encode it into a feature vector for acoustic-aware audio generation. Specifically, we query V-NeRF\ with discrete 3D points that are uniformly scattered in the environment. We compose the output volume density into an environment voxel grid, which represents the 3D structure of the scene. We then use a convolutional neural network to encode this voxel grid into a compact environment vector. After obtaining the environment vector, we propose a Hypernetwork \cite{hypernetwork} to utilize this geometric information for acoustic-aware audio generation. We design a Hypernetwork $\psi$ to convert the environment vector $v$ into parameters $\mathbf{W}_A$ of A-NeRF inspired by \cite{du2021gem}: \begin{equation} \psi: v \rightarrow \mathbf{W}_A \enspace. \end{equation} For each learnable linear layer $\mathbf{W}_i \in \mathcal{R}^{m\times n}$ in A-NeRF, we train a three-layer MLP to output a weight matrix $M$ of the same shape as $\mathbf{W}_i$. The input of each MLP is the environment vector $v$. The matrix $M$ is fused with the parameters $\mathbf{W}_i$ to generate new parameters for guiding audio generation: \begin{equation} \mathbf{W}_i \leftarrow \mathbf{W}_i \odot M \enspace, \end{equation} where $\odot$ is Hadamard product. Directly predicting high-dimensional matrix $M$ is not only computation-consuming but also difficult to optimize. So we decompose the high-dimensional matrix $M \in \mathcal{R}^{m\times n}$ into two low-dimensional matrices $A \in \mathcal{R}^{m \times k}$ and $B \in \mathcal{R}^{k \times n}$ \cite{decompose}, where $k<m$ and $k<n$, and express matrix $M$ as $M=\sigma(A\times B)$. We optimize MLP to generate these two low-dimensional matrices instead of the original matrix. \subsection{Coordinate Transformation} \label{sec:ct} Viewing direction $(\theta, \phi)$ in V-NeRF is expressed in an absolute coordinate system. This is a natural practice in visual space such that the same orientation at different spatial positions is expressed equally. As discussed in the introduction, however, this expression method in audio space is sub-optimal because the human perception of the sound direction is based on the relative direction to the sound source instead of the absolute direction. To overcome this shortage, we propose expressing viewing direction relative to the sound source. This coordinate transformation encourages A-NeRF learning a sound source-centric acoustic field. Given the 3D position of the sound source $\mathbf{X}_s=(x_s, y_s, z_s)$ and camera pose $(\mathbf{X}, \mathbf{d})=(x,y,z,\theta,\phi)$, we obtain two direction vectors: $\mathbf{V}_1=\mathbf{X}_s - \mathbf{X} = (x_s-x, y_s-y,z_s-z)$ and $\mathbf{V}_2=(\sin(\theta)\cos(\phi),\sin(\theta)\sin(\phi),\cos(\theta))$. We calculate the angle between $\mathbf{V}_1$ and $\mathbf{V}_2$ as the relative direction coordinates $\angle(\mathbf{V}_1, \mathbf{V}_2)$. This angle $\angle(\mathbf{V}_1, \mathbf{V}_2)$ represents the rotation angle relative to the sound source. With this coordinate transformation, different camera poses can share the same view direction encoding if they face the sound source at the same angle. We will express this angle as a 2D Cartesian unit vector when feeding it to A-NeRF. \subsection{Binaural Audio Augmentation} \label{sec:aug} Capturing high-quality binaural audio requires a professional recording system such as a binaural microphone and dummy head that mimics the sound people can hear \cite{2.5D}. This requirement restricts the application of our method in videos captured by commodity devices such as iPhones and GoPro. Although several commodity devices support recording stereo sound, the microphone arrangement is arbitrary and can not imitate the sound effects caused by human heads. So we apply head-related impulse response (HRIR) to the stereo audio to generate binaural audio with rich spatial information following Xu \textit{et al.} \cite{xu2021visually}. HRIR is a response function that characterizes the influence of the human head and sound position on sound propagation. We exploit an open-sourced HRIR database \cite{hrir} for binaural audio augmentation. Specifically, we retrieve a pair of HRIR functions $h_l$ and $h_r$ of a given angle from the database and convolve $h_l$ and $h_r$ with the mixed ground-truth stereo audio $(a_l+a_r)/2$ to generate a binaural audio (Eq.~\ref{eq:aug}). Please note that the mix of audio for data augmentation is different from that for modeling training. We devide the mix of two channels by 2 to get the average signal for data augmentation. \begin{equation} \begin{aligned} a_l &\leftarrow h_l \circledast (a_l+a_r)/2 \enspace,\\ a_r &\leftarrow h_r \circledast (a_l+a_r)/2 \enspace,\\ \end{aligned} \label{eq:aug} \end{equation} where $\circledast$ is the convolution operator. By augmenting training audio, we encourage our model to correlate acoustic effects with the position of the sound source. \subsection{Learning Objective} We refer to the combination of V-NeRF (Sec.~\ref{sec:vnerf}) and A-NeRF (Sec.~\ref{sec:anerf}) as the baseline method. We integrate AV-Bridge (Sec.~\ref{sec:ev}), coordinate transformation module (Sec.\ref{sec:ct}), and data augmentation mechanism (Sec.~\ref{sec:aug}) into the baseline method to assemble our AV-NeRF model. Because AV-Bridge is optimized together with A-NeRF and the coordinate transformation module and data augmentation mechanism do not contain learnable parameters, the baseline method and AV-NeRF are optimized using the same learning objective. The loss function of V-NeRF is the same as \cite{nerf}: \begin{equation} \mathcal{L}_V = ||C(\mathbf{r})-\hat{C}(\mathbf{r})||^2 \enspace, \end{equation} where $C(\mathbf{r})$ is the ground-truth color along the ray $\mathbf{r}$ and $\hat{C}(\mathbf{r})$ is the color rendered by V-NeRF. We use the L2 loss function to supervise A-NeRF. Given a mono source audio $a_s$ and a binaural target audio $a_t$, we calculate the mix audio $a_m=a_{t(l)}+a_{t(r)}$, the difference audio $a_d=a_{t(l)}-a_{t(r)}$, and spectrums of $a_s$, $a_m$, and $a_d$, which are $s_s$, $s_m$, and $s_d$, respectively. Then we minimize the distance between calculated spectrums and predicted spectrums: \begin{equation} \begin{aligned} &\mathcal{L}_A = ||s_m - \hat{s}_m||^2 + ||s_d - \hat{s}_d||^2 \\ &= ||s_m - s_s * \mathbf{m}_m||^2 + ||s_d - s_s * \mathbf{m}_m * \mathbf{m}_d||^2. \end{aligned} \end{equation} The first term of $L_A$ encourages A-NeRF predicting masks that represent spatial effects caused by distance, and the second term encourages A-NeRF generating masks that capture the difference between two channels. \begin{figure}[t] \centering \begin{subfigure}{0.32\columnwidth} \centering \includegraphics[width=\textwidth]{figs/recording_device.jpg} \end{subfigure} \hfill \begin{subfigure}{0.65\columnwidth} \centering \includegraphics[width=\textwidth]{figs/data.png} \end{subfigure} \vspace{-3mm} \caption{Recording devices and two representative indoor scenes.} \label{fig:recording_device} \end{figure} \begin{figure}[t] \centering \includegraphics[width=\columnwidth]{figs/harp.png} \caption{Example scene re-collected from FAIR-PLAY dataset. We collect video clips belonging to the same scene but recorded at different camera poses.} \label{fig:harp} \vspace{-5mm} \end{figure} \section{Experiments} \label{sec:exp} \label{sec:real} \begin{figure*}[htbp] \centering \includegraphics[width=\textwidth]{figs/real.png} \vspace{-8mm} \caption{Results on Real-World Audio-Visual Scenes. We synthesize audio-visual scenes at novel camera poses that have no spatial overlap with the training camera poses. We visualize both the rendered visual frames and binaural audio. The first column of both figures is the camera poses, including training poses (colored red) and novel poses (colored otherwise). We mark the sound source as a black pentagram. Starting from the second column, we show rendered images and rendered binaural audio. The color of rendered results corresponds to that of the camera pose. } \label{fig:real} \vspace{-5mm} \end{figure*} \subsection{Experimental Settings} \label{sec:setup} \noindent \textbf{Datasets.} To the best of our knowledge, our method is the first NeRF-based system capable of synthesizing real-world videos with perceptually spatial binaural audio at arbitrary poses. No publicly available dataset satisfies our experimental needs. So we validate our method on two representative real-world indoor scenes collected by ourselves. Since our model can generate binaural audio, we also train our AV-NeRF on FAIR-PLAY dataset~\cite{2.5D} for objective comparisons. \textbf{(1) Real-World Indoor Scenes.} We collect two representative indoor scenes in rooms of different sizes. The medium room is $7\times 7 m^2$ ($23 \times 23 \mathrm{ft}^2$) and the large room is $40 \times 20 m^2$ ($130\times 64 \mathrm{ft}^2$). As shown in Fig.~\ref{fig:recording_device}, we mount a Zoom H3-VR Ambisonic microphone to a GoPro Max camera to assemble our recording system. The audio is recorded as binaural audio at $48$kHz. The video is captured at 30 fps in GoPro's linear Field of View mode to prevent image distortion. We move this system around in the environment to record both auditory and visual signals at different positions and from different viewing directions. We use a loudspeaker playing music as a sound source. For each scene, we collect 2 minutes of data. \textbf{(2) FAIR-PLAY} FAIR-PLAY dataset \cite{2.5D} is collected in a music room consisting of 1,871 10s video clips of people playing instruments. Each video is accompanied by binaural audio recorded by a professional binaural microphone. We re-organize this dataset by selecting video clips that belong to the same scene. Such video clips can capture people playing instruments at different camera poses, which provides our model with rich spatial information. Fig.~\ref{fig:harp} shows an example scene composed of several video clips capturing a person playing the harp. We collect four representative scenes from FAIR-PLAY for training and evaluation (harp, cello, drum, and guitar). Please note that we only use solo videos. We use ``split1" provided by FAIR-PLAY authors to split training and test samples. \vspace{1mm} \noindent \textbf{Architectures.} We instantiate A-NeRF and V-NeRF as Multilayer Perceptron (MLP). A-NeRF has $6$ fully-connected layers with 256 neurons per layer. V-NeRF has $8$ fully-connected layers with $256$ neurons per layer. Given a 3D environment voxel grid, we use a CNN to extract geometric information. CNN has $4$ 2D convolution layers with ReLU activations and 2D max pooling layers between two consecutive layers. Hypernetwork is a stack of 3-layer MLPs. For each fully-connected layer of A-NeRF, we use a 3-layer MLP to generate a low-rank matrix $M$. Additional details are provided in the Appendix. \vspace{1mm} \noindent \textbf{Training Details. } Given an audio-visual scene (e.g.\ several video clips), we first train V-NeRF to learn the visual world. We extract visual frames from input videos and use COLMAP structure-from motion library \cite{colmap} to estimate the intrinsic and extrinsic of the camera. We set the initial learning rate as $1e-3$ and optimize V-NeRF for $200$K iterations. For easy optimization, we only use one NeRF model instead of a pair of coarse and fine models proposed by Mildenhall et al. \cite{nerf}. After training V-NeRF, we freeze the parameters of V-NeRF and train the rest of our framework. We randomly sample $0.63$s audio clips from videos and average poses of each clip. We set the batch size as $8$, the learning rate as $1e-3$ and train A-NeRF for $50$K iterations. We apply binaural audio augmentation to real-world indoor scenes but do not use it on the FAIR-PLAY dataset because the head-related impulse response function open-sourced by Algazi \textit{et al.}\cite{hrir} is inconsistent with the head model of the recording system used by Gao and Grauman \cite{2.5D}. Additional details are provided in the Appendix. \begin{figure}[t] \centering \includegraphics[width=\columnwidth]{figs/user_study.png} \caption{User study of our method. We ask participants to select videos with the best consistency between rendered audio and video. We compare our method with Mono-Mono and baseline. This figure exhibits the distinct advantage of our method.} \label{fig:user_study} \vspace{-5mm} \end{figure} \begin{table*}[t] \centering \scalebox{0.9}{ \begin{tabular}{l|cc|cc|cc|cc|cc} \toprule \multicolumn{1}{l|}{\multirow{2}{*}{Methods}} & \multicolumn{2}{c|}{Harp} & \multicolumn{2}{c|}{Cello} & \multicolumn{2}{c|}{Drum} & \multicolumn{2}{c|}{Guitar} & \multicolumn{2}{c}{Overall} \\ \multicolumn{1}{l|}{} & STFT & \multicolumn{1}{c|}{ENV} & STFT & \multicolumn{1}{c|}{ENV} & STFT & \multicolumn{1}{c|}{ENV} & STFT & \multicolumn{1}{c|}{ENV} & STFT & ENV \\ \midrule M2B \cite{2.5D} w/ GT image & 0.551 & 0.119 & 0.630 & 0.131 & 0.103 & 0.048 & 0.839 & 0.142 & 0.531 & 0.110 \\ P2B \cite{xu2021visually} w/ GT image & 0.498 & 0.118 & 0.819 & 0.140 & 0.093 & 0.045 & 0.818 & 0.138 & 0.557 & 0.110\\ \midrule Mono-Mono & 0.939 & 0.149 & 0.702 & 0.133 & 0.155 & 0.063 & 0.966 & 0.150 & 0.691 & 0.124\\ Right-Left & 3.728 & 0.241 & 1.915 & 0.187 & 0.375 & 0.073 & 3.068 & 0.218 & 2.272 & 0.180\\ M2B \cite{2.5D} w/ retrieved image & 0.872 & 0.168 & \underline{0.644} & \underline{0.131} & 0.145 & \underline{0.058} & 0.873 & 0.143 & \underline{0.634} & 0.125\\ P2B \cite{xu2021visually} w/ retrieved image & \underline{0.661} & \underline{0.139} & 0.920 & \underline{0.131} & \underline{0.135} & \underline{0.058} & \textbf{0.822} & \textbf{0.138} & 0.635 & \underline{0.117}\\ Ours & \textbf{0.638} & \textbf{0.121} & \textbf{0.635} & \textbf{0.124} & \textbf{0.123} & \textbf{0.053} & \underline{0.865} & \underline{0.141} & \textbf{0.565} & \textbf{0.110}\\ \bottomrule \end{tabular} } \vspace{-2mm} \caption{We compare our AV-NeRF with other methods of binaural audio generation. M2B is an abbreviation of MONO2BINAURAL\cite{2.5D} and P2B is an abbreviation of PSEUDO2BINAURAL \cite{xu2021visually}. We feed M2B and P2B models with two kinds of images: ground-truth images, and retrieved images with the nearest camera pose. We highlight the top two results in each column.} \vspace{-3mm} \label{tab:fp} \end{table*} \subsection{Results on Real-World Audio-Visual Scenes} We validate our method qualitatively on real-world audio-visual scenes. We compose A-NeRF and V-NeRF as our baseline, which does not contain AV-Bridge (Sec.~\ref{sec:ev}), coordinate transformation (Sec.~\ref{sec:ct}), or binaural audio augmentation (Sec.~\ref{sec:aug}). The top half of Fig.~\ref{fig:real} shows the rendering results of the large room. The first column shows the camera poses used for training and novel view synthesis from a bird's eye view. The direction of a triangle's sharp angle is the camera's orientation, and the position of the triangle's sharp angle is the camera's position. Red triangles represent camera poses of training samples. Triangles of other colors are camera poses used for novel audio-visual scene synthesis. There is no spatial overlap between training poses and novel poses. The position of the sound source is marked with a black pentagram. We show audio and visual rendering results at different camera poses starting from the second column. The first row is the rendered image. The second and third rows are binaural audio rendered by our baseline method. The fourth and fifth rows show binaural audio rendered by our AV-NeRF. Our AV-NeRF can render binaural audio with rich spatial information compared to the baseline method. When the sound source is on the right side of the camera view (camera pose \ding{172} and \ding{176}), AV-NeRF can generate two channels with a distinct difference -- the amplitude of the right channel is clearly larger than that of the left channel. When the sound source is on the left side of the camera view (camera pose \ding{173} and \ding{174}), the amplitude of the left channel is clearly larger than that of the right channel. AV-NeRF can also generate balanced binaural audio when the camera faces the sound source directly. The bottom half of Fig.~\ref{fig:real} shows the rendering results of the medium room. Similarly, we show the training camera poses, novel camera poses, and sound source on the left side. We rotate the camera to generate novel 360-degree audio-visual scenes. Please note that the camera position is fixed when we change the camera orientation. As shown in the figure, our AV-NeRF can render binaural audio consistent with the camera orientations. When the camera is rotated gradually from pose \ding{172} to \ding{176}, the amplitude ratio (energy ratio) of the left channel to the right channel will first increase (from pose \ding{172} to pose \ding{174}) and then decrease (from pose \ding{174} to pose \ding{176}). \noindent \textbf{Perceptual User Studies.} We also conduct user studies to validate the fidelity of our generated audio-visual scenes. For each room, we generate $4$ audio-visual scenes with different camera motion trajectories. We compare scenes generated by AV-NeRF with those generated by the baseline. We also include a Mono-Mono method that directly copies an input mono audio twice to generate fake binaural audio. We totally recruited $22$ participants with normal hearing. We ask participants to watch videos generated by three methods and select the video with the spatial consistency between rendered audio and video. Considering different methods may achieve comparable performance, we allow participants to select multiple options. As shown in Fig.~\ref{fig:user_study}, our method receives the most preference and exhibits a distinct advantage over other methods. \subsection{Results on FAIR-PLAY} \label{sec:fairplay} For numerical comparisons, we evaluate our AV-NeRF on FAIR-PLAY dataset. We use two metrics to evaluate the audio generation quality of a model: STFT distance and envelope (ENV) distance. For the definitions of these two metrics, please refer to \cite{2.5D}. Table \ref{tab:fp} shows the quantitative results of our AV-NeRF on four scenes. We compare our model with other methods of binaural audio generation. We select the original method MONO2BINAURAL (M2B) proposed in \cite{2.5D} and a recently proposed method PSEUDO2BINAURAL (P2B) \cite{xu2021visually} for comparison. We also use Mono-Mono and Right-Left as two baseline methods. Mono-Mono copies the input mixed audio twice to generate fake binaural audio and Right-Left switches two channels to generate binaural audio. We use Right-Left as the upper bound of STFT and ENV distance. There is no surprise that our model does not surpass M2B and P2B because these two models are trained on the entire dataset with nearly 1,500 training samples and the visual encoder is pre-trained on ImageNet \cite{deng2009imagenet} while our model is trained on less than $10$ samples per scene from scratch. Even with much less training data, our model achieves competitive results to M2B and P2B. M2B and P2B models rely on ground-truth images for audio spatialization. However, our model does not have access to ground-truth images. For a fair comparison, we adapt M2B and P2B to generate audio at novel poses. Instead of feeding M2B and P2B with ground-truth images, we input them with retrieved images with the nearest camera poses. After the absence of ground-truth images, their models have a clear performance degradation and fall behind our AV-NeRF. AV-NeRF outperforms M2B and P2B with distinct advantages. \noindent \textbf{Ablation Studies.} We conduct ablation studies on FAIR-PALY to further validate the proposed pipeline. We decompose AV-NeRF into the baseline model, AV-Bridge, and coordinate transformation module. As shown in Fig.~\ref{fig:ablation}, adding AV-Bridge and coordinate transformation module to AV-NeRF can boost our model performance. \begin{table}[t] \centering \resizebox{\columnwidth}{!}{ \begin{tabular}{l|cc|cc|cc|cc} \toprule \multicolumn{1}{l|}{\multirow{2}{*}{Methods}} & \multicolumn{2}{c|}{Harp} & \multicolumn{2}{c|}{Cello} & \multicolumn{2}{c|}{Drum} & \multicolumn{2}{c}{Guitar} \\ \multicolumn{1}{l|}{} & STFT & \multicolumn{1}{c|}{ENV} & STFT & \multicolumn{1}{c|}{ENV} & STFT & \multicolumn{1}{c|}{ENV} & STFT & ENV \\ \hline Baseline & 0.702 & 0.135 & 0.776 & 0.130 & 0.154 & 0.063 & 0.877 & 0.138 \\ w/ AVB & 0.635 & 0.129 & 0.642 & 0.126 & 0.149 & 0.060 & 0.877 & 0.141 \\ w/ AVB \& CT & 0.638 & 0.121 & 0.635 & 0.124 & 0.123 & 0.053 & 0.865 & 0.141\\ \bottomrule \end{tabular}} \vspace{-3mm} \caption{Ablation study on different components of our method. We report results on four FAIR-PLAY scenes. \textbf{AVB}: AV-Bridge, \textbf{CT}: Coordinate Transformation.} \label{fig:ablation} \vspace{-5mm} \end{table} \vspace{-2mm} \section{Discussion} In this work, we propose a first-of-its-kind NeRF system that is capable of synthesizing real-world audio-visual scenes accompanied by binaural audio. Our model can generate audio with rich spatial information at novel camera poses. We demonstrate the effectiveness of our method on FAIR-PLAY and real-world indoor scenes. There is a range of promising future directions. First, our method learns and models the spatial audio effects caused by distance and orientation. The reverberation that exists in environments is not modeled. It would be interesting to future extend our work to address sound propagation. Second, we focus on static scenes with a fixed sound source in our study. However, there could be multiple sounding objects in a single environment, and these sound sources may move. How to learn implicit neural representations for audio-visual scenes with multiple dynamic sound sources is still an open question. Third, there are power audio-visual simulation platforms (e.g., SoundSpaces 2.0~\cite{soundspaces2}) that can render realistic audio and visual scenes in virtual environments. An interesting direction is to explore how to integrate the AV-NeRF with virtual simulation to strengthen learning robustness and generalization ability. {\small \bibliographystyle{ieee_fullname}
\section{Introduction} \label{sec:intro} The discovery of tiny neutrino masses, with non-explanation within the Standard Model~(SM) of the particle physics, is regarded as one of the most direct evidence points towards new physics beyond the SM. In efforts to explain the neutrino masses, additional right-handed neutrinos, also referred as the heavy neutral leptons~(HNL) $N$ are widely considered~\cite{Balaji:2019fxd,Balaji:2020oig,Delgado:2022fea,Barducci:2022gdv,Ding:2019tqq,Shen:2022ffi,Deppisch:2018eth,Deppisch:2019kvs,Liu:2022kid,Liu:2021akf,Liu:2022ugx,Beltran:2022ast,Zhou:2021ylt,Abada:2018sfh,Fernandez-Martinez:2022gsu,Abada:2022wvh,Arganda:2015ija,Bai:2022lbv,Das:2017nvm,Das:2012ze,Das:2015toa,Das:2016hof}. They are singlets under the SM gauge groups. However, the HNLs can still interact with SM leptons $L$ and Higgs field~$H$ via a Yukawa interaction, $\mathcal{L} \supset NHL$, which accounts for the generation of the tiny Dirac neutrino masses. The experimental searches for such HNLs have received a lot attention, see Ref.~\cite{Abdullahi:2022jlv} for a recent review. Among them, the production of the HNL from the Yukawa interaction, so called the neutrino portal is widely considered. New interactions to the $N$ can lead to novel signatures and features in their production and decay. For example, HNLs with gauge interactions are studied in Refs.~\cite{Deppisch:2018eth,Amrith:2018yfb,Deppisch:2019kvs,Liu:2021akf,Liu:2022kid,Liu:2022ugx}. In this work, we focus on another case, where the HNLs couple to the SM via the so-called diople portal, $\mathcal{L} \supset d \bar\nu_L \sigma_{\mu \nu} F^{\mu \nu} N$, where $F^{\mu \nu}$ stands for the electromagnetic field strength tensor, $d$ is the strength of magnetic dipole, and $\nu_L$ is the SM neutrino~\cite{Magill:2018jla}. This case is interesting, especially if the neutrino portal is subdominant. The dipole portal models have been investigated at different existing experiments in various literature~\cite{Aparici:2009fh, Giunti:2014ixa, Aparici:2013xga, Coloma:2017ppo, Abazajian:2017tcc,Shoemaker:2018vii, Magill:2018jla, Brdar:2020quo, Plestid:2020vqf,Jodlowski:2020vhr, Schwetz:2020xra, Ismail:2021dyp,Miranda:2021kre,Dasgupta:2021fpn,Atkinson:2021rnp,Kamp:2022bpt,Gustafson:2022rsz,Huang:2022pce,Li:2022bqr,Acero:2022wqg,Feng:2022inv,Hati:2022tfo,Mathur:2021trm,Bolton:2021pey,Ovchynnikov:2022rqj,Zhang:2022spf, Zhang:2023nxy,Ovchynnikov:2023wgg,Guo:2023bpo}. Ref.~\cite{Magill:2018jla} summarises the limits on the neutrino magnetic dipole based at colliders, beam-dump and neutrino experiments, astrophysics, cosmology, dark matter searches as well as future projection at the proposed SHiP detector. Ref.~\cite{Brdar:2020quo} revisits the limits at a neutrino or dark matter experiment by the detection of an upscattering event mediated via a transition magnetic moment. Ref.~\cite{Plestid:2020vqf} discussed the possibility at experiments aiming for solar neutrinos. Ultrahigh energy neutrino telescopes can also be used to probe the dipole models, sensitive to very massive HNLs~\cite{Huang:2022pce}. Meanwhile, projections at other proposed future experiments are also investigated for Forward LHC Detectors \cite{Jodlowski:2020vhr, Ismail:2021dyp}, Icecube \cite{Coloma:2017ppo}, SuperCDMS \cite{Shoemaker:2018vii}, DUNE \cite{Schwetz:2020xra}, CE$\nu$NS and E$\nu$ES \cite{Miranda:2021kre}, as well as electron colliders \cite{Zhang:2022spf,Zhang:2023nxy,Ovchynnikov:2023wgg}. In most of scenarios considered by the existing literature, the dipole models can be simplified, only including the coupling $d_\gamma$between the sterile, active neutrinos and electromagnetic field strength tensor, as the energy scale is below the electroweak~(EW) scale. Nonetheless, if the energy possessed by the HNLs is comparable or even higher than the electroweak scale, e.g. HNLs produced at colliders, the SM gauge invariant dipole couplings $d_W$ and $d_Z$ should also be considered. In this work, we investigate the possibility where the HNLs are produced at the Large Hadron Collider~(LHC), and detected at the proposed detectors aiming for searching long-lived particles~(LLP), including FASER~\cite{FASER:2018eoc}, MoEDAL-MAPP~\cite{Pinfold:2019nqj, Acharya:2022nik}, FACET~\cite{Cerci:2021nlb}, and MATHUSLA~\cite{Curtin:2018mvb} at the high luminosity runs of the LHC~(HL-LHC). The beam-dump experiments can also be sensitive to the case where the HNLs are LLPs. Comparing to the existing studies using beam-dump experiments, owing to the high energy scale at the LHC, the SM gauge invariant dipole couplings can play a crucial role. {As we will shown in the rest of the paper, depending on the SM gauge invariant dipole couplings, better sensitivity on the electromagnetic dipole couplings than the current limits can be yielded using LLP detectors.} We orangise the paper in the following order. In section~\ref{sec:model}, we briefly introduce the neutrino dipole portal model. The LLP detectors at the LHC is discussed at section~\ref{sec:detector}, followed by the investigation of their sensitivity for the dipole portal model at section~\ref{sec:sen}. And we conclude this paper in section~\ref{sec:con}. \section{Neutrino Dipole Portal Model} \label{sec:model} The effective Lagrangian of the neutrino dipole $\mathcal{L} \supset d \bar\nu_L \sigma_{\mu \nu} F^{\mu \nu} N$ is only applicable at low energies. The Lagrangian of the neutrino dipole, which respect the full gauge symmetries of the SM can be written as~\cite{Magill:2018jla} \begin{equation} \mathcal{L} \supset \bar{L}(d_{{\cal W}}^k {\cal W}_{\mu \nu}^a \tau^a + d_B^k B^{\mu \nu}) \tilde{H}\sigma_{\mu \nu} N+\mathrm{H.c.}, \end{equation} $\tilde{H}=i\sigma_2H^*$ and $\tau^a=\sigma^a/2$, where $\sigma^a$ is the Pauli matrix, ${\cal W}_{\mu \nu}^a \equiv \partial_\mu {\cal W}_{ \nu}^a \partial_\nu {\cal W}_{ \mu}^a$ and $B_{\mu \nu}^a \equiv \partial_\mu B_{ \nu}^a \partial_\nu B_{ \mu}^a$ are the field tensors for $SU(2)_L$ and $U(1)_Y$ respectively. In this form, it can describe the new physics beyond the EW scale. After spontaneous symmetry breaking, the Lagrangian becomes \begin{equation} \mathcal{L} \supset d_W^k(\bar{\ell^k} W^-_{\mu \nu} \sigma_{\mu \nu} N) + \bar{\nu}_L^k(d_\gamma^k F_{\mu \nu}-d_Z^k Z_{\mu \nu}) \sigma_{\mu \nu} N +\mathrm{H.c.}. \label{eq:LWB} \end{equation} Hence, the right-handed neutrinos $N$ couple to SM photon, $Z$ and $W$ bosons via the dipole couplings $d_\gamma^k$,$d_Z^k$, and $d_W^k$ respectively. For a given lepton flavor $k$, the dipole couplings $d_\gamma^k$,$d_Z^k$, and $d_W^k$ in the broken phase are linearly dependent by only two parameters $d_{\cal W}$ and $d_B$ in the unbroken phase, such that~\footnote{The superscript $k$ of the lepton flavor is omitted in the rest of the paper to simplify the notation, otherwise stated.} \begin{eqnarray} d_\gamma&=&\frac{v}{\sqrt{2}}\left(d_B\cos\theta_{w}+\frac{d_{{\cal W}}}{2}\sin\theta_w\right), \nonumber\\ d_Z&=&\frac{v}{\sqrt{2}}\left(\frac{d_{{\cal W}}}{2}\cos\theta_{w}-d_B\sin\theta_w\right), \nonumber\\ d_W&=&\frac{v}{\sqrt{2}}\frac{d_{{\cal W}}}{2}\sqrt{2}. \end{eqnarray} By further assuming $d_{{\cal W}}=a\times d_B$, we have \begin{eqnarray} d_Z &=&\frac{d_\gamma(a\cos\theta_w-2\sin\theta_w)}{2\cos\theta_w+a\sin\theta_w}, \nonumber\\ d_W &=& \frac{\sqrt{2}a d_\gamma}{2\cos\theta_w+a\sin\theta_w} . \end{eqnarray} Thus, we have three independent free parameters in our model \begin{eqnarray} (m_N, d_\gamma, a), \end{eqnarray} where $m_N$ is the mass of the HNL. \section{Signals of the HNLs at the LHC} \label{sec:detector} \subsection{Production and Decay of the HNL} \begin{figure}[t!] \centering \includegraphics[width=0.49\textwidth]{figs/FeynW} \includegraphics[width=0.49\textwidth]{figs/FeynZ} \caption{The Feynman diagrams of the production of the right-handed neutrinos $N$ at the LHC.} \label{fig:feyn} \end{figure} The HNL at the LHC is mainly produced by the decay of the gauge bosons, i.e. $pp \rightarrow W^{\pm} \rightarrow N l^{\pm}$, and $pp \rightarrow Z, \gamma \rightarrow N \nu$, as shown in Fig.~\ref{fig:feyn}~\footnote{Although $N$ are Dirac particles, we omit the sign of them as well as their decay products, unless stated.}. The production cross section depends on the couplings of $N$ to the gauge bosons, $d_W$, $d_Z$ and $d_\gamma$ as well as $m_N$, therefore by $(m_N, d_\gamma, a)$. The $N$ subsequently decays via the same couplings, with the decay width \begin{eqnarray} \Gamma_{N \rightarrow \nu \gamma} &=& \frac{|d_\gamma|^2 m_N^3}{4 \pi} ,\\ \Gamma_{N \rightarrow \nu Z} &=& \frac{|d_Z|^2 (m_N^2-M_Z^2)^2 (2m_N^2+M_Z^2)}{8 \pi m_N^3} \Theta(m_N > M_Z),\\ \Gamma_{N \rightarrow W \ell } &=& \frac{|d_W|^2}{8 \pi m_N^3} \sqrt{(m_N^2-(M_W-m_\ell)^2(m_N^2+(M_W-m_\ell)^2))} \\\nonumber &\times& (2 m_\ell^2(2m_\ell^2-4m_N^2-M_W^2)+(m_N^2-M_W^2)(2m_N^2+M_W^2))\Theta(m_N > M_W+m_\ell). \label{eq:decay} \end{eqnarray} $N$ can also decay via off-shell $W$ and $Z$~\cite{Atre:2009rg, Bondarenko:2018ptm}, \begin{eqnarray} \Gamma_{N \rightarrow \text{2body} } &\propto& |d_{W,Z}|^2 \frac{G_F^2 m_N^3 f_M^2}{10 \pi},\\ \Gamma_{N \rightarrow \text{3body} } &\propto& |d_{W,Z}|^2 \frac{G_F^2 m_N^5}{100 \pi^3} , \end{eqnarray} where $G_F$ and $f_M$ are Fermi constant and meson decay width, respectively. As we focus on the $N$ which can lead to LLP signals at the LHC, for most of the parameter space with $m_N \lesssim 2$~GeV, we only have appreciable $\Gamma_{N \rightarrow \nu \gamma}$, hence ${\rm Br}(N \rightarrow \nu \gamma)\simeq\text{100 \%}$ and $\Gamma(N) \propto |d_\gamma|^2$. Having understood the expressions of the production and decay of the $N$, Monte-Carlo simulations are performed to analyse the kinematics and later on the sensitivity. We use the Universal FeynRules Output~(UFO)~\cite{Alloul:2013bka, Degrande:2011ua} of the neutrino dipole model developed in Ref.~\cite{Zhang:2022spf}, which is fed to the event generator {\tt MadGraph5aMC$@$NLO} -v2.6.7~\cite{Alwall:2014hca} to generate events at parton level. Shower, hadronization, etc are handled by {\tt PYTHIA v8.306}~\cite{Sjostrand:2014zea}. Detector level simulation and the clustering of the events by later purpose is performed by {\tt Delphes v3.5.0}~\cite{deFavereau:2013fsa} and {\tt FastJet v3.2.1}~\cite{Cacciari:2011ma}, respectively. \begin{figure}[t!] \centering \includegraphics[width=0.49\textwidth]{figs/RunA} \includegraphics[width=0.49\textwidth]{figs/RunmN} \caption{Left: The cross section of the processes $pp \rightarrow W^{\pm} \rightarrow N l^{\pm}$~(blue line), and $pp \rightarrow Z,\gamma \rightarrow N \nu $~(orange line) at the 13 TeV LHC as a function of $a$, when $d_\gamma = 10^{-5}$ and $m_N = 0.1$ GeV. Right: Same but as a function of $m_N$ when $d_\gamma = 10^{-5}$ for Scenario A~($a=0$) and B~($a=-3.73$).} \label{fig:funa} \end{figure} The cross sections of the processes $pp \rightarrow W^{\pm} \rightarrow N l^{\pm} $~(blue line), and $pp \rightarrow Z/\gamma \rightarrow N \nu$~(orange line) at the 13 TeV LHC as a function of $a$ when $d_\gamma = 10^{-5}$ and $m_N = 0.1$ GeV, are shown in Fig.~\ref{fig:funa} left. It is clear that the cross sections depend strongly on $a$. For the $W$ mediated processes, they are only controlled by $d_W$, which has a singularity with $a = -2 \cot \theta_w \approx -3.73$. {Whereas their cross section becomes vanishing when $a$ approaches zero leading to $d_W\sim 0$.} The $Z,\gamma$ mediated processes have shown similar behavior, only they get minimum cross section where $a = 2 \tan \theta_w$ with $d_Z =$0. The minimum is non-vanishing since the $\gamma$ mediated processes still exist. To this end, we take two typical scenarios to reflect the dependence on the high energy couplings $d_W$ and $d_Z$, where $a=0$ for Scenario A, and $a=-3.73$ for Scenario B, as summarised in Table.\ref{tab:scen}. We further show the dependence on the HNL mass $m_N$ for the two scenarios in Fig.~\ref{fig:funa} right {with $d_\gamma = 10^{-5}$}. For Scenario A, $W$ mediated processes vanish, while $Z,\gamma$ mediated processes can still get a constant value about $30$ fb when $m_N < m_W$, and drop off gradually to below 1 fb when $m_N$ approaches 1 TeV. Things becomes dramatic different when look at Scenario B, now $W$ mediated processes get larger cross section than $Z/\gamma$, reaches $\mathcal{O}(10^5 )$ fb, while dropping sharply to below 1 fb when $m_N$ approaches 1 TeV. The $Z,\gamma$ mediated processes have similar behavior. \begin{table}[] \centering \begin{tabular}{c|c|c} \hline\hline Scenario & Assumptions & Relations\\ \hline\hline A & $d_{{\cal W}}=0$ & $d_Z=-d_\gamma \tan\theta_w$; $d_W=0$\\ \hline B & $d_{{\cal W}}=-3.73 \times d_B$ & $d_Z \approx 139.55 \times d_\gamma $; $d_W \approx 173.52 \times d_\gamma $ \\\hline\hline \end{tabular} \caption{The two scenarios we taken in this paper.} \label{tab:scen} \end{table} {Fig.~\ref{fig:fdecay}, we present the radiative decay branching ratio ${\rm Br}(N \rightarrow \nu \gamma)$ as a function of $m_N$ for Scenarios A and B. It can be found that in Scenario A there always be ${\rm Br}(N \rightarrow \nu \gamma)\simeq 1$ until $m_N > M_Z$ in which the decay channel into on-shell $Z$ boson $N\to Z\nu$ opens. Whereas in Scenario B, the radiative decay branching ratio starts to decrease rapidly from $m_N\gtrsim 10$ GeV, since the decays via an off-shell $W,Z$ become sizeable. } Due to the large {ratio of $d_{W,Z}/d_\gamma$ } for Scenario B, ${\rm Br}(N \rightarrow \nu \gamma)$ is vanishing once $m_N > M_{W}$, opposite to Scenario A where it is still appreciable. And {decays into} on-shell $W,Z$ become the dominant channels. We show the proper decay length of HNL, $L_N^0$ in ($m_N$,$d_\gamma$) plane. {Current limits from Ref.~\cite{Magill:2018jla, Jodlowski:2020vhr} are overlaid for Scenario A, while the limits for Scenario B will be shown later.} From the figure, we obtain a useful analytical approximation of $L_N^0$ for $m_N \ll m_W$ no matter what value of $a$, \begin{eqnarray} L_N^0 \approx 2.5~\text{cm} \times \left(\frac{d_\gamma}{10^{-5}}\right)^{-2} \times \left( \frac{m_N}{0.1~\text{GeV}}\right)^{-3}. \label{eq:length} \end{eqnarray} It is evident to find that under current limits, the HNLs can have decay length of $\mathcal{O}$(m), which means they can be regarded as candidates of LLPs. The difference between the two scenarios in decay length do not enter into the parameter space interesting for LLPs consideration where $m_N < 10$ GeV, as shown that the decay length are only different between Scenario A and B when $L_N^0 \lesssim 10^{-6}$~m. \begin{figure}[t!] \centering \includegraphics[width=0.49\textwidth]{figs/RunmNbr.pdf} \includegraphics[width=0.49\textwidth]{figs/Length} \caption{Left: ${\rm Br}(N \rightarrow X Y)$ as a function of $m_N$ for Scenarios A and B. Right: Proper decay length of the HNL in ($m_N$,$d_\gamma$) plane. The solid~(dashed) lines correspond to Scenario A~(B). Current limits from Ref.~\cite{Magill:2018jla,Jodlowski:2020vhr} are overlaid for comparison, only for Scenario A.} \label{fig:fdecay} \end{figure} This is important for the following analyses of the LLP signals. To generate macroscopic decay length of one particle for it to become a LLP, feeble interactions are required. If the LLPs are produced and decayed via the same interactions, this will leads to insignificant signal events in most cases. Nevertheless, in the model we consider, the production is controlled by $d_{Z,W,\gamma}$ or $(a, d_{\gamma})$, whereas the decay does not depend on $a$ in our consideration of LLP signals. This means that without making the $N$ not long-lived anymore, the production rates of $N$ at LHC can be larger depending on the value of $a$ in our model. \subsection{Analyses for the Long-lived Particle Detectors at the LHC} Bear that in mind, we proceed the detailed analyses for LLP signals in this section. Although there exists quite a lot searches for LLPs at the multi-purpose detectors at the LHC, i.e. ATLAS, CMS and LHCb, no signatures of LLPs are found so far~\cite{Alimena:2019zri}. Benefited from their large distance to the interaction point~(IP) and shields to stop the SM final states, specialized detectors aimed at probing LLPs might lead to more positive prospect of the discovery of the LLPs. Among them, the FASER and MoEDAL-MAPP detectors are already installed and operated since Run-3 of the LHC. The FASER detector is located about 480 meters away from the IP of the ATLAS experiment, at a very forward direction. The MoEDAL-MAPP~(MAPP) detector is a new subdetector of the MoEDAL experiment, which is located about 50-100 meters away from the IP of the LHCb. In the meantime, other designs of LLP detectors such as AL3X~\cite{Gligorov:2018vkc}, ANUBIS~\cite{Bauer:2019vqk}, CODEX-b~\cite{Gligorov:2017nwh}, FACET~\cite{Cerci:2021nlb} and MATHUSLA~\cite{Curtin:2018mvb} detectors are also proposed. A short review for all of these detectors can be found in Ref.~\cite{Abdullahi:2022jlv}. Considering the proposed detectors, we take FACET to compare with FASER, since they are both at the forward direction, and MATHUSLA as it has the largest geometrical coverage. We focus on the phase two designs of the FASER~(FASER-2) and MAPP~(MAPP-2) detectors at the HL-LHC, since they have larger geometrical coverage and luminosity, providing optimistic reach of the LLP signals. FACET and MATHUSLA are also considered to be operated at the HL-LHC. We summarise the geometrical coverage and luminosity for the detectors we considered in Table~\ref{tab:LLP}~{\footnote{{To detect the signal in this paper, FASER, MAPP and FACET can reconstruct photon~\cite{Barducci:2022gdv}, and MATHUSLA has considered it as an optional feature of its original design plan~\cite{Curtin:2018mvb, Bauer:2018uxu}, while not included in the updated one~\cite{MATHUSLA:2022sze}. Nevertheless, we still take MATHUSLA into account for comparison.}}}~\footnote{The original MAPP detector actually has a ring-like shape, here we roughly consider it as a cuboid to simplify the calculation.}. \begin{table} \centering \begin{tabular}{|l|c|c|c|c|c|c|} \hline Detectors & $L_x$~[m] & $L_y$~[m] & $L_{xy}$~[m] & $L_z$~[m] & Luminosity~[fb$^{-1}$]\\ \hline FASER-2 & $-$ & $-$ & $[0,1]$ & $[475, 480]$ & 3000 \\ \hline MAPP-2 & $[3,6]$ & $[-2,1]$ & $-$ & $[48, 61]$ & 300 \\ \hline FACET & - & - & [0.18, 0.5] & $[101, 119]$ & 3000 \\ \hline MATHUSLA & $[100,120]$ & $[-100,100]$ & - & [100,300] & 3000 \\ \hline \end{tabular} \caption{The geometrical coverage and luminosity corresponding for FASER-2~\cite{FASER:2018eoc}, MAPP-2~\cite{Pinfold:2019nqj, Acharya:2022nik}, FACET~\cite{Cerci:2021nlb}, and MATHUSLA~\cite{Curtin:2018mvb}. } \label{tab:LLP} \end{table} The expected number of the observed events at these LLP detectors can be expressed as \begin{eqnarray} N_{\text{signal}}/\mathcal{L} = \sigma(pp \rightarrow W/Z, \gamma \rightarrow N \ell/\nu) \times \epsilon_{\text{kin}} \times \epsilon_{\text{geo}} \times \epsilon_{\text{recon}}, \label{eq:nsignal} \end{eqnarray} here $\mathcal{L}$ is the integrated luminosity. $\epsilon_{\text{kin, geo, recon}}$ are the efficiencies due to the trigger requirement, geometrical acceptance and reconstruction, respectively. Although in the original literature of the FASER, there is a $p >$ 100 GeV trigger requirement~\cite{FASER:2018eoc}, we nevertheless take an optimistic view by only require $E_{\text{vis}} >$ 0.6 GeV as suggested in Ref.~\cite{Gligorov:2017nwh} for all detectors which leads to $\epsilon_{\text{kin}} \approx$ 100~\%. And we also take $\epsilon_{\text{recon}} =$ 100~\%~\footnote{{This can be regarded as an optimistic view, as it might be quite hard to identify a mono-photon signal, especially for MATHUSLA.} }. The geometrical acceptance is estimated as follows. In principle, $\epsilon_{\text{geo}}$ is related to the probability of the HNL to decay inside the detector volume, which is a function of the momentum $p$, angle to the beam line $\theta$, and lab frame decay length $L_N^\text{lab}$, such as~\cite{FASER:2018eoc} \begin{eqnarray} \mathcal{P}(p,\theta) = \left( e^{-(L-\Delta)/L_N^\text{lab} }- e^{-L/L_N^\text{lab}} \right) \Theta(R-\tan\theta L) \approx \frac{\Delta}{d} e^{-L/L_N^\text{lab}} \Theta(R- \theta L) \ , \label{eq:decayinvolume} \end{eqnarray} where $\Theta$ is the Heaviside step function, $L$, $R$, and $\Delta$ are the distance to the IP, radius in the $xoy$ plane and length of the detector. $L_N^\text{lab}=c\tau\beta\gamma = c \tau p/m$ is the lab frame decay length of the LLP, where $c \tau$ is the proper decay length. However, Eq.~\ref{eq:decayinvolume} requires $L$ and $R$, being constants for different $\theta$, so it is only applicable for detectors like FASER-2 and FACET placed at a very forward direction and symmetric around the beam line. For MAPP-2 and MATHUSLA, which have more complicated shape, we apply Monte-Carlo methods by inverse sampling of the cumulative distribution function according to the lifetime of the HNL. \begin{figure} \centering \includegraphics[width=0.49\textwidth]{figs/his2Dps1.pdf} \includegraphics[width=0.49\textwidth]{figs/his2Ds1.pdf} \caption{In Scenario A, the distribution of the $p$ and $\theta$~(left) for $10^5$ events, as well as $L_N^\text{lab}$ and $\theta$~(right) for $10^6$ events of the HNLs from $pp \rightarrow W/Z,\gamma \rightarrow N \ell/\nu$ process. The approximate coverage of the FASER-2~(blue), MAPP-2~(orange), FACET~(green) and MATHUSLA~(red) detectors is overlaid for comparison. The colours represent the weight of each bin, which is normalised to one. We fix $m_N =$ 0.1 GeV, and $d_\gamma = 10^{-5}$.} \label{fig:pdis} \end{figure} \begin{figure} \centering \includegraphics[width=0.49\textwidth]{figs/his2Dps373.pdf} \includegraphics[width=0.49\textwidth]{figs/his2Ds373.pdf} \caption{The same but for Scenario B. } \label{fig:pdisB} \end{figure} To roughly illustrate how the probability varies for different detectors, we show the distribution of the momentum $p$, angle to the beam line $\theta$, and lab frame decay length $L_N^\text{lab}$ for the HNLs in Fig.~\ref{fig:pdis} and~\ref{fig:pdisB} , at one benchmark where $m_N =$ 0.1 GeV and $d_\gamma = 10^{-5}$ for Scenario A and B, respectively. The approximate coverage of the FASER-2~(blue), MAPP-2~(orange), FACET~(green) and MATHUSLA~(red) detectors is overlaid for comparison. Nonetheless, the coverage on the $\phi$~($xoy$ plane) is not been shown, thus the resulting geometrical acceptance should be smaller comparing to the ones estimated from the figure. In Fig.~\ref{fig:pdis}~left, we show the distribution of $p$ and $\theta$ of the HNLs for $10^5$ events in Scenario A. As shown in Eq.~\ref{eq:length}, the proper decay length $L_N^0$ is about $ 2.5~ \text{cm}$ for this benchmark. The lab frame decay length equals to $L_N^0 \times p/m_N$, therefore each detector requires the $p$ to be inside certain range to make the HNLs likely to decay within its volume. Nevertheless, the HNLs can still decay inside the detector volume for other values of $L_N^\text{lab}$, since their decay follow exponential distribution, but the probability is rather low. Both the $Z$ and $\gamma$ mediated processes contribute to the distribution for Scenario A. The distribution from $Z$ mediated process peaks around the line where $p_T = M_{Z}/2$ , since the transverse momentum of the $N$ is approximately half the mass of the mother particle $Z$ for a 1$\rightarrow$2 process, when $m_N \ll M_{Z}$. However, for $\gamma$ mediated process, the distribution peaks where $p_T = p_T(\gamma)/2$, which can come from the remnant of the mesons masses, therefore covers a broader parameter space, especially for low $\theta$ region. Among these detectors, MATHUSLA and MAPP-2 located the closet to the peak of the $Z$ mediated distribution, and MATHUSLA has the largest volume in the logarithmic scale, thus likely to yield the largest geometrical acceptance. Whereas FACET and FASER-2 are located too far away from the $Z$ peak, but benefited from the coverage of low $\theta$ of the $\gamma$ mediated distribution, therefore can still obtain appreciable acceptance. Although we do not consider significant trigger, which can lead to lower kinemetical efficiency $\epsilon_{\text{eff}}$, we can evaluate their effects by Fig.~\ref{fig:pdis}~left. For an example, the original trigger employed by the FASER detector, i.e.~$p>$ 100 GeV is indicated in the figure. At this benchmark, we can see that this trigger does not result in any difference, since the requirement for the HNLs to decay inside detector volume already ask them to be energetic enough. Especially, $p \sim 2$~TeV is needed for FASER-2. However, when discuss other parameters, the proper decay length can be larger, so lower Lorentz factor subsequently lower $p$ of the HNLs are required. Since $L_N^0 \propto d_\gamma^{-2} \times m_N^{-3}$, so the momentum required $p \propto d_\gamma^{2} \times m_N^{3}$. For instance, when $m_N = $~0.1 GeV, if $d_\gamma = 10^{-6}$ instead of $10^{-5}$, FASER-2 now requires $p \sim 20$~GeV, which makes the $p>$ 100 GeV trigger effective to cut almost all the events. Generally speaking, trigger effects for the kinematical efficiencies $\epsilon_{\text{eff}}$ make the lowest $d_\gamma$ the detectors can reach larger, i.e. worse sensitivity. For a $p>$ $p_\text{low}$ trigger, the lowest $d_\gamma$ becomes $\sqrt{p_\text{low}}$ times larger, and about one magnitude for the $p>$ 100 GeV trigger. In Fig.~\ref{fig:pdis}~right, we show the distribution of $L_N^\text{lab}$ and $\theta$ of the HNL for Scenario A. This figure is quite similar to the left one, only the $x$ axis is scaled with a factor of $0.25$~m $\times$ GeV$^{-1}$, and the $L_N^\text{lab}$ contains exponential distribution since each $N$ decays exponentially. For each HNL, we simulate 10 events for the exponential distribution, so the statistics is higher, reaching $10^6$ events. Due to the exponential distribution, the distribution is modified, the parameter space far away from the peak now gets the tail from the exponential distribution. For example, FASER-2 now locates inside the bins with weight about $10^{-2}$, which is larger from Fig.~\ref{fig:pdis}~left. It severs as a more direct view of the geometrical acceptance of these detectors. Comparing the distribution between Scenario A and B with Fig.~\ref{fig:pdis} and~\ref{fig:pdisB}, both the distribution of the momentum $p$, angle to the beam line $\theta$, and lab frame decay length $L_N^\text{lab}$ has shown appreciable difference. The contribution from $\gamma$ mediated process is insignificant in Scenario B since its cross section are much lower than the ones mediated by $W$ and $Z$, therefore the distribution only surround where $p_T = M_{W,Z}/2$. For Scenario B, as shown in Fig.~\ref{fig:pdisB}, now FASER-2 and FACET locate too far away from the peak, only get the tail of the exponential distribution. On the other hand, MATHUSLA and MAPP-2 are closer to the peak, thus still covers similar weight of events as in Scenario A. \begin{figure} \centering \includegraphics[width=0.49\textwidth]{figs/effs1.pdf} \includegraphics[width=0.49\textwidth]{figs/effs373.pdf} \caption{The geometrical efficiencies of the aforementioned detectors for Scenario A~(left) and B~(right). The $\epsilon_{\text{geo}}$ required to make $N_{\text{signal}}=$~3 for Scenario A and B is demonstrated as the dashed~(dotted) black lines at 3000~(300) fb$^{-1}$ luminosity. We fix $m_N =$ 0.1 GeV.} \label{fig:feff} \end{figure} We refer to Fig.~\ref{fig:feff} for the detailed geometrical acceptance $\epsilon_{\text{geo}}$ of each detector at the same benchmark for Scenarios A and B. When $d_\gamma = 10^{-5}$ and $m_N =$ 0.1~GeV, the geometrical acceptance $\epsilon_{\text{geo}}$ is about $10^{-4}$ for MAPP-2, $10^{-4}$ for MATHUSLA, $10^{-3~(-5)}$ for FACET, and $10^{-4~(-7)}$ for FASER-2, in Scenario A~(B). This is smaller as than it shown up in Fig.~\ref{fig:pdis} and~\ref{fig:pdisB}~right, because MATHUSLA only covers about 10\% in the $\phi$ direction, and FASER-2, MAPP-2 as well as FACET only gets small fraction of bins in Fig.~\ref{fig:pdis}~right. The difference between Scenario A and B, is from the different contribution of the $\gamma$ mediated process. The $\gamma$ mediated process can lead to appreciable distribution of HNLs for low $\theta$ as shown in Fig.~\ref{fig:pdis}~left, therefore FASER-2 and FACET get larger acceptance in Scenario A where the contribution of this process is significant. The number of signal events $N_{\text{signal}}$ can be obtained from Eq.~\ref{eq:nsignal}. $\sigma(pp \rightarrow W/ Z, \gamma \rightarrow N \ell/\nu) $ is about $(d_{\gamma}/10^{-5})^2 \times 10^{1(6)}$~fb, when $a = 0~(-3.73)$ for Scenario A~(B) and $m_N = 0.1$~GeV from Fig.~\ref{fig:funa}~left. To obtain the sensitivity which is to be discussed at the following section, we roughly estimate the values of $d_\gamma$ needed to get sufficient signal events. Since the LLP detectors are all far away from the IP, and have shield to further reduce the background, we take an optimistic view regarding the signal as background free. Thus, one would require $N_{\text{signal}} > 3$ events at 95\% confidence level to have sensitivity at certain parameter space~\cite{ParticleDataGroup:2020ssz}. At the HL-LHC, with 3000~(300) fb$^{-1}$ integrated luminosity for the IP of the MATHUSLA, FACET and FASER-2~(MAPP-2), the $\epsilon_{\text{geo}}$ required to make $N_{\text{signal}}=$~3 for Scenario A and B are demonstrated as the dashed black lines. Below the lines, the detectors suffer in low geometrical acceptance, leading to low signal events and vice versa. The range of $d_\gamma$ to make $N_{\text{signal}} > $~3 can be estimated from the intersection points of the $\epsilon_{\text{geo}}$ curves of the detectors and the $N_{\text{signal}}=$~3 lines. For Scenario A, when $m_N =$ 0.1~GeV, we get $d_\gamma \gtrsim 10^{-5~(-6)}$ for FASER-2 and MAPP-2~(MATHUSLA and FACET) detectors. For Scenario B, we have $d_\gamma \gtrsim 10^{-6~(-7)}$ in order to make $N_{\text{signal}}>$~3 for FASER-2, MAPP-2 and FACET~(MATHUSLA). \section{Sensitivity at the HL-LHC} \label{sec:sen} Now we estimate the sensitivity of the aforementioned detectors in probing the neutrino dipole couplings at the HL-LHC . According to the Lagrangian in Eq.~\ref{eq:LWB}, $d_\gamma$ can vary for different lepton flavours $k$, where $k = e, \mu, \tau$. Several existing limits depends on the lepton flavours, and we lack of the limits for the $\tau$. The sensitivity from the LLP detectors does not depend on the them at the stage we are considering. Therefore, for each scenarios, we show two different sensitivity figures, one for the case when $d_\gamma$ is universal, another one when $d_\gamma$ corresponds to $\tau$ flavour. The current limits are taken from Ref.~\cite{Magill:2018jla, Jodlowski:2020vhr} considering the CHARM-II~\cite{CHARM-II:1989srx}, LSND~\cite{LSND:1996ubh}, MineBooNE~\cite{MiniBooNE:2007uho}, NOMAD~\cite{Vannucci:2014wna,NOMAD:1997pcg,NOMAD:1998pxi}, LEP~ \cite{OPAL:1994kgw, L3:1997exg} , ATLAS and CMS at the LHC~\cite{ATLAS:2017nga,CMS:2015loa}~\footnote{The limits from CMS/ATLAS can be updated using new analyses~\cite{ATLAS:2020uiq,CMS:2018fon}, but there are no significant difference to the limits from Ref.~\cite{Magill:2018jla}, so not shown. } and Supernova SN 1987~\cite{Kamiokande-II:1987idp,Alekseev:1988gp,Bionta:1987qt} experiments. \begin{figure} \centering \includegraphics[width=0.49\textwidth]{figs/dg} \includegraphics[width=0.49\textwidth]{figs/dgtau.pdf} \caption{Projected sensitivity of the LLP detectors including the FASER-2~(blue), MAPP-2~(orange), FACET~(green) and MATHUSLA~(red) at the HL-LHC, in the ($m_N$, $d_\gamma$) plane for the Scenario A. Current limits taken from Ref.~\cite{Magill:2018jla, Jodlowski:2020vhr} are overlaid for comparison. Left: For the universal coupling case. Right: For the case where the dipole portal couples to $\tau$ only.} \label{fig:fdg} \end{figure} The results for Scenario A is demonstrated in Fig.~\ref{fig:fdg}. For the universal coupling case as displayed in Fig.~\ref{fig:fdg}~left, the sensitivity from the LLP detectors, FASER-2, MAPP-2, FACET and MATHUSLA roughly tracks the curves where $L_N^{0} \sim \mathcal{O}(\text{m})$ as shown in Fig.~\ref{fig:fdecay}, until the coupling $d_\gamma \lesssim 10^{-5}$, becoming too small to yield sufficient cross section for $m_N \gtrsim 10^{-1}$ GeV. Among these detectors, MATHUSLA and FACET can reach the coupling as small as $d_\gamma \approx 2 \times 10^{-6}$, while MAPP-2 and FASER-2 can only get where $d_\gamma \approx 10^{-5}$. The reason is already explained in Fig.~\ref{fig:feff}. In Fig.~\ref{fig:fdg}~left, the sensitivity is shown in comparison with the current limits for the universal coupling case. The coverage of the LLP detectors in $m_N$ coincides with the ones of the CHARM experiment and neutrino scattering experiments, LSND~\cite{LSND:1996ubh} and MiniBooNE~\cite{MiniBooNE:2007uho}. Due to the enormous number of events using by these experiments, they have very high precision, therefore reaching lower $d_\gamma$ comparing to the LLP detectors. Anyway, our efforts are not in vain, when we consider the case where the dipole portal couples to $\tau$ only in Fig.~\ref{fig:fdg}~right. Now only the limits from the LEP and SN 1987 are effective, only excluding $d_\gamma \gtrsim 10^{-4}$. Therefore, our results from the LLP detectors are proved to be fairly useful, since they exceed the current limits by more than one magnitude, when $m_N \lesssim 0.1$~GeV. \begin{figure} \centering \includegraphics[width=0.49\textwidth]{figs/dg373.pdf} \includegraphics[width=0.49\textwidth]{figs/dg373tau.pdf} \caption{Same as Fig.~\ref{fig:fdg}, but for Scenario B. {The original limits from LEP, CMS and ATLAS are scaled for Scenario B, and hence shown prominently.}} \label{fig:fdg373} \end{figure} Now we move to the Scenario B, where the high scale couplings $d_{W,Z}$ are effective. Since these couplings are about 100 times {larger than $d_\gamma$} as indicated in Table~\ref{tab:scen}, the cross section {of $N$ production at LHC} is more than $10^{4}$ times larger {the one in Scenario A}. The larger cross section subsequently results in better sensitivity at $d_\gamma$. From Fig.~\ref{fig:fdg373}, the lowest $d_\gamma$ can be probed is $10^{-6}$ for FASER-2, $10^{-7}$ for MAPP-2 and FACET, and $10^{-8}$ for MATHUSLA. We compare them with the current limits, finding that the LLP detectors can probe one to two orders magnitude lower $d_\gamma$, than the low energy neutrino scattering and the CHARM experiments. Except FASER-2, since its geometrical acceptance is weak. Additionally for Scenario B, we redraw the current limits at high energy environment via analyses for prompt final states. We adopt ATLAS and CMS analyses, as well as the LEP analysis. Now these analyses benefited from the enlarged cross section as well, reaches to $d_\gamma \approx 10^{-(5-{7})}$, only when $m_N \sim 1-90$~GeV . This is because these analyses is only sensitive to the HNL with $L_N^{\text{lab}} \lesssim 1$~m~\cite{ATLAS:2020uiq, CMS:2018fon, Zhang:2023nxy}, {and ${\rm Br}(N \rightarrow \nu \gamma)$ drops sharply once $m_N > M_Z$ as shown in Fig.~\ref{fig:fdecay}~left. CMS analysis has shown better sensitivity than the ATLAS, since the production cross section $pp \rightarrow W$~(CMS), is larger than $pp \rightarrow Z$~(ATLAS) as shown in Fig.~\ref{fig:funa}~right.} Thus, the LLP and prompt analyses are complementary to each other. The LLP analyses can probe the parameter space when $m_N$ is low, whereas the prompt analyses probe the opposite. When look at the case where the dipole portal couples to $\tau$ only in Fig.~\ref{fig:fdg373}~right, the CMS limits do not apply, as it is sensitive to the $e, \mu$ final states only. {Now, the LLP detectors reach to more than one magnitude lower $d_\gamma$ than the limits from the LEP when $m_N \sim 2$~GeV.} \section{Conclusion} \label{sec:con} In pursuit of the explanation for the observed neutrino masses, many models assuming the existence of the HNLs are brought up. Among them, we focus on the neutrino dipole models within a dimension-6 EFT framework. This model contains high scale operators containing the couplings $d_{W,Z}$, which control the production of the HNLs at a high energy environment, e.g. the LHC. The current constraints are stringent on such models, with the upper limits $d_\gamma \sim 10^{-6}$ for $m_N < 1$~GeV, have already brought us to where the HNLs are long-lived. Although this case is already considered in Ref.~\cite{Jodlowski:2020vhr}, which employ the FASER-2 detector to search for the HNLs produced secondarily in neutrino interactions at the FASER$\nu$, the dependence on the high scale operators $d_{W,Z}$ is however not considered. In this paper, we discuss the effects of different relations between $d_{W,Z}$, and the low scale coupling $d_\gamma$, then estimate the sensitivity reach of the LLP detectors including FASER-2, MAPP-2, FACET and MATHUSLA at the HL-LHC to probe $d_\gamma$. The LLP detectors, located far away from the IP of the LHC, can be senstive to new particles which are light and weak coupled to the SM, leading to long decay length. Although weak couplings can lead to low statistics, this is overcome since the high scale couplings can produce large number of the HNLs, no matter the low scale decay coupling is. We choose two scenarios for comparison to show the dependence on the relations between $d_{W,Z}$ and $d_\gamma$. In one scenario, the production is dominantly controlled by the $d_\gamma$, and another one by $d_{W,Z}$. For the former scenario, we show that the LLP detectors can reach $d_\gamma \approx 10^{-6}$ when $m_N \lesssim 0.1$~GeV. Although this parameter space is already ruled out by neutrino scattering experiments, e.g. MiniBooNE and LSND, as well as the CHARM experiment, for $d_\gamma$ corresponds to the $e, \mu$ flavours or if it is universal, it is about two magnitude lower than the current limits when the dipole only couples to $\tau$. For the latter scenario, since the production is enhanced by the choices of $d_{W,Z}$, the LLP detectors can now reach $d_\gamma \approx 10^{-8}$ for $m_N \lesssim {2}$~GeV, {which is two magnitude lower than the current ones}. Among the LLP detectors, due to its long distance to the IP and large volume, the MATHUSLA has shown about one magnitude better sensitivity than the others. And the detectors located at the forward direction, including FASER-2 and FACET, have shown drastic different geometrical efficiencies in these two scenarios, due to the different contribution from the $\gamma$ mediated processes. \acknowledgments We thank Zeren Simon Wang for useful discussions. WL is supported by National Natural Science Foundation of China (Grant No.12205153), and the 2021 Jiangsu Shuangchuang (Mass Innovation and Entrepreneurship) Talent Program (JSSCBS20210213). YZ is supported in part by the National Natural Science Foundation of China (Grant No. 11805001). \bibliographystyle{JHEP} \section{Introduction} \label{sec:intro} The discovery of tiny neutrino masses, with non-explanation within the Standard Model~(SM) of the particle physics, is regarded as one of the most direct evidence points towards new physics beyond the SM. In efforts to explain the neutrino masses, additional right-handed neutrinos, also referred as the heavy neutral leptons~(HNL) $N$ are widely considered~\cite{Balaji:2019fxd,Balaji:2020oig,Delgado:2022fea,Barducci:2022gdv,Ding:2019tqq,Shen:2022ffi,Deppisch:2018eth,Deppisch:2019kvs,Liu:2022kid,Liu:2021akf,Liu:2022ugx,Beltran:2022ast,Zhou:2021ylt,Abada:2018sfh,Fernandez-Martinez:2022gsu,Abada:2022wvh,Arganda:2015ija,Bai:2022lbv,Das:2017nvm,Das:2012ze,Das:2015toa,Das:2016hof}. They are singlets under the SM gauge groups. However, the HNLs can still interact with SM leptons $L$ and Higgs field~$H$ via a Yukawa interaction, $\mathcal{L} \supset NHL$, which accounts for the generation of the tiny Dirac neutrino masses. The experimental searches for such HNLs have received a lot attention, see Ref.~\cite{Abdullahi:2022jlv} for a recent review. Among them, the production of the HNL from the Yukawa interaction, so called the neutrino portal is widely considered. New interactions to the $N$ can lead to novel signatures and features in their production and decay. For example, HNLs with gauge interactions are studied in Refs.~\cite{Deppisch:2018eth,Amrith:2018yfb,Deppisch:2019kvs,Liu:2021akf,Liu:2022kid,Liu:2022ugx}. In this work, we focus on another case, where the HNLs couple to the SM via the so-called diople portal, $\mathcal{L} \supset d \bar\nu_L \sigma_{\mu \nu} F^{\mu \nu} N$, where $F^{\mu \nu}$ stands for the electromagnetic field strength tensor, $d$ is the strength of magnetic dipole, and $\nu_L$ is the SM neutrino~\cite{Magill:2018jla}. This case is interesting, especially if the neutrino portal is subdominant. The dipole portal models have been investigated at different existing experiments in various literature~\cite{Aparici:2009fh, Giunti:2014ixa, Aparici:2013xga, Coloma:2017ppo, Abazajian:2017tcc,Shoemaker:2018vii, Magill:2018jla, Brdar:2020quo, Plestid:2020vqf,Jodlowski:2020vhr, Schwetz:2020xra, Ismail:2021dyp,Miranda:2021kre,Dasgupta:2021fpn,Atkinson:2021rnp,Kamp:2022bpt,Gustafson:2022rsz,Huang:2022pce,Li:2022bqr,Acero:2022wqg,Feng:2022inv,Hati:2022tfo,Mathur:2021trm,Bolton:2021pey,Ovchynnikov:2022rqj,Zhang:2022spf, Zhang:2023nxy,Ovchynnikov:2023wgg,Guo:2023bpo}. Ref.~\cite{Magill:2018jla} summarises the limits on the neutrino magnetic dipole based at colliders, beam-dump and neutrino experiments, astrophysics, cosmology, dark matter searches as well as future projection at the proposed SHiP detector. Ref.~\cite{Brdar:2020quo} revisits the limits at a neutrino or dark matter experiment by the detection of an upscattering event mediated via a transition magnetic moment. Ref.~\cite{Plestid:2020vqf} discussed the possibility at experiments aiming for solar neutrinos. Ultrahigh energy neutrino telescopes can also be used to probe the dipole models, sensitive to very massive HNLs~\cite{Huang:2022pce}. Meanwhile, projections at other proposed future experiments are also investigated for Forward LHC Detectors \cite{Jodlowski:2020vhr, Ismail:2021dyp}, Icecube \cite{Coloma:2017ppo}, SuperCDMS \cite{Shoemaker:2018vii}, DUNE \cite{Schwetz:2020xra}, CE$\nu$NS and E$\nu$ES \cite{Miranda:2021kre}, as well as electron colliders \cite{Zhang:2022spf,Zhang:2023nxy,Ovchynnikov:2023wgg}. In most of scenarios considered by the existing literature, the dipole models can be simplified, only including the coupling $d_\gamma$between the sterile, active neutrinos and electromagnetic field strength tensor, as the energy scale is below the electroweak~(EW) scale. Nonetheless, if the energy possessed by the HNLs is comparable or even higher than the electroweak scale, e.g. HNLs produced at colliders, the SM gauge invariant dipole couplings $d_W$ and $d_Z$ should also be considered. In this work, we investigate the possibility where the HNLs are produced at the Large Hadron Collider~(LHC), and detected at the proposed detectors aiming for searching long-lived particles~(LLP), including FASER~\cite{FASER:2018eoc}, MoEDAL-MAPP~\cite{Pinfold:2019nqj, Acharya:2022nik}, FACET~\cite{Cerci:2021nlb}, and MATHUSLA~\cite{Curtin:2018mvb} at the high luminosity runs of the LHC~(HL-LHC). The beam-dump experiments can also be sensitive to the case where the HNLs are LLPs. Comparing to the existing studies using beam-dump experiments, owing to the high energy scale at the LHC, the SM gauge invariant dipole couplings can play a crucial role. {As we will shown in the rest of the paper, depending on the SM gauge invariant dipole couplings, better sensitivity on the electromagnetic dipole couplings than the current limits can be yielded using LLP detectors.} We orangise the paper in the following order. In section~\ref{sec:model}, we briefly introduce the neutrino dipole portal model. The LLP detectors at the LHC is discussed at section~\ref{sec:detector}, followed by the investigation of their sensitivity for the dipole portal model at section~\ref{sec:sen}. And we conclude this paper in section~\ref{sec:con}. \section{Neutrino Dipole Portal Model} \label{sec:model} The effective Lagrangian of the neutrino dipole $\mathcal{L} \supset d \bar\nu_L \sigma_{\mu \nu} F^{\mu \nu} N$ is only applicable at low energies. The Lagrangian of the neutrino dipole, which respect the full gauge symmetries of the SM can be written as~\cite{Magill:2018jla} \begin{equation} \mathcal{L} \supset \bar{L}(d_{{\cal W}}^k {\cal W}_{\mu \nu}^a \tau^a + d_B^k B^{\mu \nu}) \tilde{H}\sigma_{\mu \nu} N+\mathrm{H.c.}, \end{equation} $\tilde{H}=i\sigma_2H^*$ and $\tau^a=\sigma^a/2$, where $\sigma^a$ is the Pauli matrix, ${\cal W}_{\mu \nu}^a \equiv \partial_\mu {\cal W}_{ \nu}^a \partial_\nu {\cal W}_{ \mu}^a$ and $B_{\mu \nu}^a \equiv \partial_\mu B_{ \nu}^a \partial_\nu B_{ \mu}^a$ are the field tensors for $SU(2)_L$ and $U(1)_Y$ respectively. In this form, it can describe the new physics beyond the EW scale. After spontaneous symmetry breaking, the Lagrangian becomes \begin{equation} \mathcal{L} \supset d_W^k(\bar{\ell^k} W^-_{\mu \nu} \sigma_{\mu \nu} N) + \bar{\nu}_L^k(d_\gamma^k F_{\mu \nu}-d_Z^k Z_{\mu \nu}) \sigma_{\mu \nu} N +\mathrm{H.c.}. \label{eq:LWB} \end{equation} Hence, the right-handed neutrinos $N$ couple to SM photon, $Z$ and $W$ bosons via the dipole couplings $d_\gamma^k$,$d_Z^k$, and $d_W^k$ respectively. For a given lepton flavor $k$, the dipole couplings $d_\gamma^k$,$d_Z^k$, and $d_W^k$ in the broken phase are linearly dependent by only two parameters $d_{\cal W}$ and $d_B$ in the unbroken phase, such that~\footnote{The superscript $k$ of the lepton flavor is omitted in the rest of the paper to simplify the notation, otherwise stated.} \begin{eqnarray} d_\gamma&=&\frac{v}{\sqrt{2}}\left(d_B\cos\theta_{w}+\frac{d_{{\cal W}}}{2}\sin\theta_w\right), \nonumber\\ d_Z&=&\frac{v}{\sqrt{2}}\left(\frac{d_{{\cal W}}}{2}\cos\theta_{w}-d_B\sin\theta_w\right), \nonumber\\ d_W&=&\frac{v}{\sqrt{2}}\frac{d_{{\cal W}}}{2}\sqrt{2}. \end{eqnarray} By further assuming $d_{{\cal W}}=a\times d_B$, we have \begin{eqnarray} d_Z &=&\frac{d_\gamma(a\cos\theta_w-2\sin\theta_w)}{2\cos\theta_w+a\sin\theta_w}, \nonumber\\ d_W &=& \frac{\sqrt{2}a d_\gamma}{2\cos\theta_w+a\sin\theta_w} . \end{eqnarray} Thus, we have three independent free parameters in our model \begin{eqnarray} (m_N, d_\gamma, a), \end{eqnarray} where $m_N$ is the mass of the HNL. \section{Signals of the HNLs at the LHC} \label{sec:detector} \subsection{Production and Decay of the HNL} \begin{figure}[t!] \centering \includegraphics[width=0.49\textwidth]{figs/FeynW} \includegraphics[width=0.49\textwidth]{figs/FeynZ} \caption{The Feynman diagrams of the production of the right-handed neutrinos $N$ at the LHC.} \label{fig:feyn} \end{figure} The HNL at the LHC is mainly produced by the decay of the gauge bosons, i.e. $pp \rightarrow W^{\pm} \rightarrow N l^{\pm}$, and $pp \rightarrow Z, \gamma \rightarrow N \nu$, as shown in Fig.~\ref{fig:feyn}~\footnote{Although $N$ are Dirac particles, we omit the sign of them as well as their decay products, unless stated.}. The production cross section depends on the couplings of $N$ to the gauge bosons, $d_W$, $d_Z$ and $d_\gamma$ as well as $m_N$, therefore by $(m_N, d_\gamma, a)$. The $N$ subsequently decays via the same couplings, with the decay width \begin{eqnarray} \Gamma_{N \rightarrow \nu \gamma} &=& \frac{|d_\gamma|^2 m_N^3}{4 \pi} ,\\ \Gamma_{N \rightarrow \nu Z} &=& \frac{|d_Z|^2 (m_N^2-M_Z^2)^2 (2m_N^2+M_Z^2)}{8 \pi m_N^3} \Theta(m_N > M_Z),\\ \Gamma_{N \rightarrow W \ell } &=& \frac{|d_W|^2}{8 \pi m_N^3} \sqrt{(m_N^2-(M_W-m_\ell)^2(m_N^2+(M_W-m_\ell)^2))} \\\nonumber &\times& (2 m_\ell^2(2m_\ell^2-4m_N^2-M_W^2)+(m_N^2-M_W^2)(2m_N^2+M_W^2))\Theta(m_N > M_W+m_\ell). \label{eq:decay} \end{eqnarray} $N$ can also decay via off-shell $W$ and $Z$~\cite{Atre:2009rg, Bondarenko:2018ptm}, \begin{eqnarray} \Gamma_{N \rightarrow \text{2body} } &\propto& |d_{W,Z}|^2 \frac{G_F^2 m_N^3 f_M^2}{10 \pi},\\ \Gamma_{N \rightarrow \text{3body} } &\propto& |d_{W,Z}|^2 \frac{G_F^2 m_N^5}{100 \pi^3} , \end{eqnarray} where $G_F$ and $f_M$ are Fermi constant and meson decay width, respectively. As we focus on the $N$ which can lead to LLP signals at the LHC, for most of the parameter space with $m_N \lesssim 2$~GeV, we only have appreciable $\Gamma_{N \rightarrow \nu \gamma}$, hence ${\rm Br}(N \rightarrow \nu \gamma)\simeq\text{100 \%}$ and $\Gamma(N) \propto |d_\gamma|^2$. Having understood the expressions of the production and decay of the $N$, Monte-Carlo simulations are performed to analyse the kinematics and later on the sensitivity. We use the Universal FeynRules Output~(UFO)~\cite{Alloul:2013bka, Degrande:2011ua} of the neutrino dipole model developed in Ref.~\cite{Zhang:2022spf}, which is fed to the event generator {\tt MadGraph5aMC$@$NLO} -v2.6.7~\cite{Alwall:2014hca} to generate events at parton level. Shower, hadronization, etc are handled by {\tt PYTHIA v8.306}~\cite{Sjostrand:2014zea}. Detector level simulation and the clustering of the events by later purpose is performed by {\tt Delphes v3.5.0}~\cite{deFavereau:2013fsa} and {\tt FastJet v3.2.1}~\cite{Cacciari:2011ma}, respectively. \begin{figure}[t!] \centering \includegraphics[width=0.49\textwidth]{figs/RunA} \includegraphics[width=0.49\textwidth]{figs/RunmN} \caption{Left: The cross section of the processes $pp \rightarrow W^{\pm} \rightarrow N l^{\pm}$~(blue line), and $pp \rightarrow Z,\gamma \rightarrow N \nu $~(orange line) at the 13 TeV LHC as a function of $a$, when $d_\gamma = 10^{-5}$ and $m_N = 0.1$ GeV. Right: Same but as a function of $m_N$ when $d_\gamma = 10^{-5}$ for Scenario A~($a=0$) and B~($a=-3.73$).} \label{fig:funa} \end{figure} The cross sections of the processes $pp \rightarrow W^{\pm} \rightarrow N l^{\pm} $~(blue line), and $pp \rightarrow Z/\gamma \rightarrow N \nu$~(orange line) at the 13 TeV LHC as a function of $a$ when $d_\gamma = 10^{-5}$ and $m_N = 0.1$ GeV, are shown in Fig.~\ref{fig:funa} left. It is clear that the cross sections depend strongly on $a$. For the $W$ mediated processes, they are only controlled by $d_W$, which has a singularity with $a = -2 \cot \theta_w \approx -3.73$. {Whereas their cross section becomes vanishing when $a$ approaches zero leading to $d_W\sim 0$.} The $Z,\gamma$ mediated processes have shown similar behavior, only they get minimum cross section where $a = 2 \tan \theta_w$ with $d_Z =$0. The minimum is non-vanishing since the $\gamma$ mediated processes still exist. To this end, we take two typical scenarios to reflect the dependence on the high energy couplings $d_W$ and $d_Z$, where $a=0$ for Scenario A, and $a=-3.73$ for Scenario B, as summarised in Table.\ref{tab:scen}. We further show the dependence on the HNL mass $m_N$ for the two scenarios in Fig.~\ref{fig:funa} right {with $d_\gamma = 10^{-5}$}. For Scenario A, $W$ mediated processes vanish, while $Z,\gamma$ mediated processes can still get a constant value about $30$ fb when $m_N < m_W$, and drop off gradually to below 1 fb when $m_N$ approaches 1 TeV. Things becomes dramatic different when look at Scenario B, now $W$ mediated processes get larger cross section than $Z/\gamma$, reaches $\mathcal{O}(10^5 )$ fb, while dropping sharply to below 1 fb when $m_N$ approaches 1 TeV. The $Z,\gamma$ mediated processes have similar behavior. \begin{table}[] \centering \begin{tabular}{c|c|c} \hline\hline Scenario & Assumptions & Relations\\ \hline\hline A & $d_{{\cal W}}=0$ & $d_Z=-d_\gamma \tan\theta_w$; $d_W=0$\\ \hline B & $d_{{\cal W}}=-3.73 \times d_B$ & $d_Z \approx 139.55 \times d_\gamma $; $d_W \approx 173.52 \times d_\gamma $ \\\hline\hline \end{tabular} \caption{The two scenarios we taken in this paper.} \label{tab:scen} \end{table} {Fig.~\ref{fig:fdecay}, we present the radiative decay branching ratio ${\rm Br}(N \rightarrow \nu \gamma)$ as a function of $m_N$ for Scenarios A and B. It can be found that in Scenario A there always be ${\rm Br}(N \rightarrow \nu \gamma)\simeq 1$ until $m_N > M_Z$ in which the decay channel into on-shell $Z$ boson $N\to Z\nu$ opens. Whereas in Scenario B, the radiative decay branching ratio starts to decrease rapidly from $m_N\gtrsim 10$ GeV, since the decays via an off-shell $W,Z$ become sizeable. } Due to the large {ratio of $d_{W,Z}/d_\gamma$ } for Scenario B, ${\rm Br}(N \rightarrow \nu \gamma)$ is vanishing once $m_N > M_{W}$, opposite to Scenario A where it is still appreciable. And {decays into} on-shell $W,Z$ become the dominant channels. We show the proper decay length of HNL, $L_N^0$ in ($m_N$,$d_\gamma$) plane. {Current limits from Ref.~\cite{Magill:2018jla, Jodlowski:2020vhr} are overlaid for Scenario A, while the limits for Scenario B will be shown later.} From the figure, we obtain a useful analytical approximation of $L_N^0$ for $m_N \ll m_W$ no matter what value of $a$, \begin{eqnarray} L_N^0 \approx 2.5~\text{cm} \times \left(\frac{d_\gamma}{10^{-5}}\right)^{-2} \times \left( \frac{m_N}{0.1~\text{GeV}}\right)^{-3}. \label{eq:length} \end{eqnarray} It is evident to find that under current limits, the HNLs can have decay length of $\mathcal{O}$(m), which means they can be regarded as candidates of LLPs. The difference between the two scenarios in decay length do not enter into the parameter space interesting for LLPs consideration where $m_N < 10$ GeV, as shown that the decay length are only different between Scenario A and B when $L_N^0 \lesssim 10^{-6}$~m. \begin{figure}[t!] \centering \includegraphics[width=0.49\textwidth]{figs/RunmNbr.pdf} \includegraphics[width=0.49\textwidth]{figs/Length} \caption{Left: ${\rm Br}(N \rightarrow X Y)$ as a function of $m_N$ for Scenarios A and B. Right: Proper decay length of the HNL in ($m_N$,$d_\gamma$) plane. The solid~(dashed) lines correspond to Scenario A~(B). Current limits from Ref.~\cite{Magill:2018jla,Jodlowski:2020vhr} are overlaid for comparison, only for Scenario A.} \label{fig:fdecay} \end{figure} This is important for the following analyses of the LLP signals. To generate macroscopic decay length of one particle for it to become a LLP, feeble interactions are required. If the LLPs are produced and decayed via the same interactions, this will leads to insignificant signal events in most cases. Nevertheless, in the model we consider, the production is controlled by $d_{Z,W,\gamma}$ or $(a, d_{\gamma})$, whereas the decay does not depend on $a$ in our consideration of LLP signals. This means that without making the $N$ not long-lived anymore, the production rates of $N$ at LHC can be larger depending on the value of $a$ in our model. \subsection{Analyses for the Long-lived Particle Detectors at the LHC} Bear that in mind, we proceed the detailed analyses for LLP signals in this section. Although there exists quite a lot searches for LLPs at the multi-purpose detectors at the LHC, i.e. ATLAS, CMS and LHCb, no signatures of LLPs are found so far~\cite{Alimena:2019zri}. Benefited from their large distance to the interaction point~(IP) and shields to stop the SM final states, specialized detectors aimed at probing LLPs might lead to more positive prospect of the discovery of the LLPs. Among them, the FASER and MoEDAL-MAPP detectors are already installed and operated since Run-3 of the LHC. The FASER detector is located about 480 meters away from the IP of the ATLAS experiment, at a very forward direction. The MoEDAL-MAPP~(MAPP) detector is a new subdetector of the MoEDAL experiment, which is located about 50-100 meters away from the IP of the LHCb. In the meantime, other designs of LLP detectors such as AL3X~\cite{Gligorov:2018vkc}, ANUBIS~\cite{Bauer:2019vqk}, CODEX-b~\cite{Gligorov:2017nwh}, FACET~\cite{Cerci:2021nlb} and MATHUSLA~\cite{Curtin:2018mvb} detectors are also proposed. A short review for all of these detectors can be found in Ref.~\cite{Abdullahi:2022jlv}. Considering the proposed detectors, we take FACET to compare with FASER, since they are both at the forward direction, and MATHUSLA as it has the largest geometrical coverage. We focus on the phase two designs of the FASER~(FASER-2) and MAPP~(MAPP-2) detectors at the HL-LHC, since they have larger geometrical coverage and luminosity, providing optimistic reach of the LLP signals. FACET and MATHUSLA are also considered to be operated at the HL-LHC. We summarise the geometrical coverage and luminosity for the detectors we considered in Table~\ref{tab:LLP}~{\footnote{{To detect the signal in this paper, FASER, MAPP and FACET can reconstruct photon~\cite{Barducci:2022gdv}, and MATHUSLA has considered it as an optional feature of its original design plan~\cite{Curtin:2018mvb, Bauer:2018uxu}, while not included in the updated one~\cite{MATHUSLA:2022sze}. Nevertheless, we still take MATHUSLA into account for comparison.}}}~\footnote{The original MAPP detector actually has a ring-like shape, here we roughly consider it as a cuboid to simplify the calculation.}. \begin{table} \centering \begin{tabular}{|l|c|c|c|c|c|c|} \hline Detectors & $L_x$~[m] & $L_y$~[m] & $L_{xy}$~[m] & $L_z$~[m] & Luminosity~[fb$^{-1}$]\\ \hline FASER-2 & $-$ & $-$ & $[0,1]$ & $[475, 480]$ & 3000 \\ \hline MAPP-2 & $[3,6]$ & $[-2,1]$ & $-$ & $[48, 61]$ & 300 \\ \hline FACET & - & - & [0.18, 0.5] & $[101, 119]$ & 3000 \\ \hline MATHUSLA & $[100,120]$ & $[-100,100]$ & - & [100,300] & 3000 \\ \hline \end{tabular} \caption{The geometrical coverage and luminosity corresponding for FASER-2~\cite{FASER:2018eoc}, MAPP-2~\cite{Pinfold:2019nqj, Acharya:2022nik}, FACET~\cite{Cerci:2021nlb}, and MATHUSLA~\cite{Curtin:2018mvb}. } \label{tab:LLP} \end{table} The expected number of the observed events at these LLP detectors can be expressed as \begin{eqnarray} N_{\text{signal}}/\mathcal{L} = \sigma(pp \rightarrow W/Z, \gamma \rightarrow N \ell/\nu) \times \epsilon_{\text{kin}} \times \epsilon_{\text{geo}} \times \epsilon_{\text{recon}}, \label{eq:nsignal} \end{eqnarray} here $\mathcal{L}$ is the integrated luminosity. $\epsilon_{\text{kin, geo, recon}}$ are the efficiencies due to the trigger requirement, geometrical acceptance and reconstruction, respectively. Although in the original literature of the FASER, there is a $p >$ 100 GeV trigger requirement~\cite{FASER:2018eoc}, we nevertheless take an optimistic view by only require $E_{\text{vis}} >$ 0.6 GeV as suggested in Ref.~\cite{Gligorov:2017nwh} for all detectors which leads to $\epsilon_{\text{kin}} \approx$ 100~\%. And we also take $\epsilon_{\text{recon}} =$ 100~\%~\footnote{{This can be regarded as an optimistic view, as it might be quite hard to identify a mono-photon signal, especially for MATHUSLA.} }. The geometrical acceptance is estimated as follows. In principle, $\epsilon_{\text{geo}}$ is related to the probability of the HNL to decay inside the detector volume, which is a function of the momentum $p$, angle to the beam line $\theta$, and lab frame decay length $L_N^\text{lab}$, such as~\cite{FASER:2018eoc} \begin{eqnarray} \mathcal{P}(p,\theta) = \left( e^{-(L-\Delta)/L_N^\text{lab} }- e^{-L/L_N^\text{lab}} \right) \Theta(R-\tan\theta L) \approx \frac{\Delta}{d} e^{-L/L_N^\text{lab}} \Theta(R- \theta L) \ , \label{eq:decayinvolume} \end{eqnarray} where $\Theta$ is the Heaviside step function, $L$, $R$, and $\Delta$ are the distance to the IP, radius in the $xoy$ plane and length of the detector. $L_N^\text{lab}=c\tau\beta\gamma = c \tau p/m$ is the lab frame decay length of the LLP, where $c \tau$ is the proper decay length. However, Eq.~\ref{eq:decayinvolume} requires $L$ and $R$, being constants for different $\theta$, so it is only applicable for detectors like FASER-2 and FACET placed at a very forward direction and symmetric around the beam line. For MAPP-2 and MATHUSLA, which have more complicated shape, we apply Monte-Carlo methods by inverse sampling of the cumulative distribution function according to the lifetime of the HNL. \begin{figure} \centering \includegraphics[width=0.49\textwidth]{figs/his2Dps1.pdf} \includegraphics[width=0.49\textwidth]{figs/his2Ds1.pdf} \caption{In Scenario A, the distribution of the $p$ and $\theta$~(left) for $10^5$ events, as well as $L_N^\text{lab}$ and $\theta$~(right) for $10^6$ events of the HNLs from $pp \rightarrow W/Z,\gamma \rightarrow N \ell/\nu$ process. The approximate coverage of the FASER-2~(blue), MAPP-2~(orange), FACET~(green) and MATHUSLA~(red) detectors is overlaid for comparison. The colours represent the weight of each bin, which is normalised to one. We fix $m_N =$ 0.1 GeV, and $d_\gamma = 10^{-5}$.} \label{fig:pdis} \end{figure} \begin{figure} \centering \includegraphics[width=0.49\textwidth]{figs/his2Dps373.pdf} \includegraphics[width=0.49\textwidth]{figs/his2Ds373.pdf} \caption{The same but for Scenario B. } \label{fig:pdisB} \end{figure} To roughly illustrate how the probability varies for different detectors, we show the distribution of the momentum $p$, angle to the beam line $\theta$, and lab frame decay length $L_N^\text{lab}$ for the HNLs in Fig.~\ref{fig:pdis} and~\ref{fig:pdisB} , at one benchmark where $m_N =$ 0.1 GeV and $d_\gamma = 10^{-5}$ for Scenario A and B, respectively. The approximate coverage of the FASER-2~(blue), MAPP-2~(orange), FACET~(green) and MATHUSLA~(red) detectors is overlaid for comparison. Nonetheless, the coverage on the $\phi$~($xoy$ plane) is not been shown, thus the resulting geometrical acceptance should be smaller comparing to the ones estimated from the figure. In Fig.~\ref{fig:pdis}~left, we show the distribution of $p$ and $\theta$ of the HNLs for $10^5$ events in Scenario A. As shown in Eq.~\ref{eq:length}, the proper decay length $L_N^0$ is about $ 2.5~ \text{cm}$ for this benchmark. The lab frame decay length equals to $L_N^0 \times p/m_N$, therefore each detector requires the $p$ to be inside certain range to make the HNLs likely to decay within its volume. Nevertheless, the HNLs can still decay inside the detector volume for other values of $L_N^\text{lab}$, since their decay follow exponential distribution, but the probability is rather low. Both the $Z$ and $\gamma$ mediated processes contribute to the distribution for Scenario A. The distribution from $Z$ mediated process peaks around the line where $p_T = M_{Z}/2$ , since the transverse momentum of the $N$ is approximately half the mass of the mother particle $Z$ for a 1$\rightarrow$2 process, when $m_N \ll M_{Z}$. However, for $\gamma$ mediated process, the distribution peaks where $p_T = p_T(\gamma)/2$, which can come from the remnant of the mesons masses, therefore covers a broader parameter space, especially for low $\theta$ region. Among these detectors, MATHUSLA and MAPP-2 located the closet to the peak of the $Z$ mediated distribution, and MATHUSLA has the largest volume in the logarithmic scale, thus likely to yield the largest geometrical acceptance. Whereas FACET and FASER-2 are located too far away from the $Z$ peak, but benefited from the coverage of low $\theta$ of the $\gamma$ mediated distribution, therefore can still obtain appreciable acceptance. Although we do not consider significant trigger, which can lead to lower kinemetical efficiency $\epsilon_{\text{eff}}$, we can evaluate their effects by Fig.~\ref{fig:pdis}~left. For an example, the original trigger employed by the FASER detector, i.e.~$p>$ 100 GeV is indicated in the figure. At this benchmark, we can see that this trigger does not result in any difference, since the requirement for the HNLs to decay inside detector volume already ask them to be energetic enough. Especially, $p \sim 2$~TeV is needed for FASER-2. However, when discuss other parameters, the proper decay length can be larger, so lower Lorentz factor subsequently lower $p$ of the HNLs are required. Since $L_N^0 \propto d_\gamma^{-2} \times m_N^{-3}$, so the momentum required $p \propto d_\gamma^{2} \times m_N^{3}$. For instance, when $m_N = $~0.1 GeV, if $d_\gamma = 10^{-6}$ instead of $10^{-5}$, FASER-2 now requires $p \sim 20$~GeV, which makes the $p>$ 100 GeV trigger effective to cut almost all the events. Generally speaking, trigger effects for the kinematical efficiencies $\epsilon_{\text{eff}}$ make the lowest $d_\gamma$ the detectors can reach larger, i.e. worse sensitivity. For a $p>$ $p_\text{low}$ trigger, the lowest $d_\gamma$ becomes $\sqrt{p_\text{low}}$ times larger, and about one magnitude for the $p>$ 100 GeV trigger. In Fig.~\ref{fig:pdis}~right, we show the distribution of $L_N^\text{lab}$ and $\theta$ of the HNL for Scenario A. This figure is quite similar to the left one, only the $x$ axis is scaled with a factor of $0.25$~m $\times$ GeV$^{-1}$, and the $L_N^\text{lab}$ contains exponential distribution since each $N$ decays exponentially. For each HNL, we simulate 10 events for the exponential distribution, so the statistics is higher, reaching $10^6$ events. Due to the exponential distribution, the distribution is modified, the parameter space far away from the peak now gets the tail from the exponential distribution. For example, FASER-2 now locates inside the bins with weight about $10^{-2}$, which is larger from Fig.~\ref{fig:pdis}~left. It severs as a more direct view of the geometrical acceptance of these detectors. Comparing the distribution between Scenario A and B with Fig.~\ref{fig:pdis} and~\ref{fig:pdisB}, both the distribution of the momentum $p$, angle to the beam line $\theta$, and lab frame decay length $L_N^\text{lab}$ has shown appreciable difference. The contribution from $\gamma$ mediated process is insignificant in Scenario B since its cross section are much lower than the ones mediated by $W$ and $Z$, therefore the distribution only surround where $p_T = M_{W,Z}/2$. For Scenario B, as shown in Fig.~\ref{fig:pdisB}, now FASER-2 and FACET locate too far away from the peak, only get the tail of the exponential distribution. On the other hand, MATHUSLA and MAPP-2 are closer to the peak, thus still covers similar weight of events as in Scenario A. \begin{figure} \centering \includegraphics[width=0.49\textwidth]{figs/effs1.pdf} \includegraphics[width=0.49\textwidth]{figs/effs373.pdf} \caption{The geometrical efficiencies of the aforementioned detectors for Scenario A~(left) and B~(right). The $\epsilon_{\text{geo}}$ required to make $N_{\text{signal}}=$~3 for Scenario A and B is demonstrated as the dashed~(dotted) black lines at 3000~(300) fb$^{-1}$ luminosity. We fix $m_N =$ 0.1 GeV.} \label{fig:feff} \end{figure} We refer to Fig.~\ref{fig:feff} for the detailed geometrical acceptance $\epsilon_{\text{geo}}$ of each detector at the same benchmark for Scenarios A and B. When $d_\gamma = 10^{-5}$ and $m_N =$ 0.1~GeV, the geometrical acceptance $\epsilon_{\text{geo}}$ is about $10^{-4}$ for MAPP-2, $10^{-4}$ for MATHUSLA, $10^{-3~(-5)}$ for FACET, and $10^{-4~(-7)}$ for FASER-2, in Scenario A~(B). This is smaller as than it shown up in Fig.~\ref{fig:pdis} and~\ref{fig:pdisB}~right, because MATHUSLA only covers about 10\% in the $\phi$ direction, and FASER-2, MAPP-2 as well as FACET only gets small fraction of bins in Fig.~\ref{fig:pdis}~right. The difference between Scenario A and B, is from the different contribution of the $\gamma$ mediated process. The $\gamma$ mediated process can lead to appreciable distribution of HNLs for low $\theta$ as shown in Fig.~\ref{fig:pdis}~left, therefore FASER-2 and FACET get larger acceptance in Scenario A where the contribution of this process is significant. The number of signal events $N_{\text{signal}}$ can be obtained from Eq.~\ref{eq:nsignal}. $\sigma(pp \rightarrow W/ Z, \gamma \rightarrow N \ell/\nu) $ is about $(d_{\gamma}/10^{-5})^2 \times 10^{1(6)}$~fb, when $a = 0~(-3.73)$ for Scenario A~(B) and $m_N = 0.1$~GeV from Fig.~\ref{fig:funa}~left. To obtain the sensitivity which is to be discussed at the following section, we roughly estimate the values of $d_\gamma$ needed to get sufficient signal events. Since the LLP detectors are all far away from the IP, and have shield to further reduce the background, we take an optimistic view regarding the signal as background free. Thus, one would require $N_{\text{signal}} > 3$ events at 95\% confidence level to have sensitivity at certain parameter space~\cite{ParticleDataGroup:2020ssz}. At the HL-LHC, with 3000~(300) fb$^{-1}$ integrated luminosity for the IP of the MATHUSLA, FACET and FASER-2~(MAPP-2), the $\epsilon_{\text{geo}}$ required to make $N_{\text{signal}}=$~3 for Scenario A and B are demonstrated as the dashed black lines. Below the lines, the detectors suffer in low geometrical acceptance, leading to low signal events and vice versa. The range of $d_\gamma$ to make $N_{\text{signal}} > $~3 can be estimated from the intersection points of the $\epsilon_{\text{geo}}$ curves of the detectors and the $N_{\text{signal}}=$~3 lines. For Scenario A, when $m_N =$ 0.1~GeV, we get $d_\gamma \gtrsim 10^{-5~(-6)}$ for FASER-2 and MAPP-2~(MATHUSLA and FACET) detectors. For Scenario B, we have $d_\gamma \gtrsim 10^{-6~(-7)}$ in order to make $N_{\text{signal}}>$~3 for FASER-2, MAPP-2 and FACET~(MATHUSLA). \section{Sensitivity at the HL-LHC} \label{sec:sen} Now we estimate the sensitivity of the aforementioned detectors in probing the neutrino dipole couplings at the HL-LHC . According to the Lagrangian in Eq.~\ref{eq:LWB}, $d_\gamma$ can vary for different lepton flavours $k$, where $k = e, \mu, \tau$. Several existing limits depends on the lepton flavours, and we lack of the limits for the $\tau$. The sensitivity from the LLP detectors does not depend on the them at the stage we are considering. Therefore, for each scenarios, we show two different sensitivity figures, one for the case when $d_\gamma$ is universal, another one when $d_\gamma$ corresponds to $\tau$ flavour. The current limits are taken from Ref.~\cite{Magill:2018jla, Jodlowski:2020vhr} considering the CHARM-II~\cite{CHARM-II:1989srx}, LSND~\cite{LSND:1996ubh}, MineBooNE~\cite{MiniBooNE:2007uho}, NOMAD~\cite{Vannucci:2014wna,NOMAD:1997pcg,NOMAD:1998pxi}, LEP~ \cite{OPAL:1994kgw, L3:1997exg} , ATLAS and CMS at the LHC~\cite{ATLAS:2017nga,CMS:2015loa}~\footnote{The limits from CMS/ATLAS can be updated using new analyses~\cite{ATLAS:2020uiq,CMS:2018fon}, but there are no significant difference to the limits from Ref.~\cite{Magill:2018jla}, so not shown. } and Supernova SN 1987~\cite{Kamiokande-II:1987idp,Alekseev:1988gp,Bionta:1987qt} experiments. \begin{figure} \centering \includegraphics[width=0.49\textwidth]{figs/dg} \includegraphics[width=0.49\textwidth]{figs/dgtau.pdf} \caption{Projected sensitivity of the LLP detectors including the FASER-2~(blue), MAPP-2~(orange), FACET~(green) and MATHUSLA~(red) at the HL-LHC, in the ($m_N$, $d_\gamma$) plane for the Scenario A. Current limits taken from Ref.~\cite{Magill:2018jla, Jodlowski:2020vhr} are overlaid for comparison. Left: For the universal coupling case. Right: For the case where the dipole portal couples to $\tau$ only.} \label{fig:fdg} \end{figure} The results for Scenario A is demonstrated in Fig.~\ref{fig:fdg}. For the universal coupling case as displayed in Fig.~\ref{fig:fdg}~left, the sensitivity from the LLP detectors, FASER-2, MAPP-2, FACET and MATHUSLA roughly tracks the curves where $L_N^{0} \sim \mathcal{O}(\text{m})$ as shown in Fig.~\ref{fig:fdecay}, until the coupling $d_\gamma \lesssim 10^{-5}$, becoming too small to yield sufficient cross section for $m_N \gtrsim 10^{-1}$ GeV. Among these detectors, MATHUSLA and FACET can reach the coupling as small as $d_\gamma \approx 2 \times 10^{-6}$, while MAPP-2 and FASER-2 can only get where $d_\gamma \approx 10^{-5}$. The reason is already explained in Fig.~\ref{fig:feff}. In Fig.~\ref{fig:fdg}~left, the sensitivity is shown in comparison with the current limits for the universal coupling case. The coverage of the LLP detectors in $m_N$ coincides with the ones of the CHARM experiment and neutrino scattering experiments, LSND~\cite{LSND:1996ubh} and MiniBooNE~\cite{MiniBooNE:2007uho}. Due to the enormous number of events using by these experiments, they have very high precision, therefore reaching lower $d_\gamma$ comparing to the LLP detectors. Anyway, our efforts are not in vain, when we consider the case where the dipole portal couples to $\tau$ only in Fig.~\ref{fig:fdg}~right. Now only the limits from the LEP and SN 1987 are effective, only excluding $d_\gamma \gtrsim 10^{-4}$. Therefore, our results from the LLP detectors are proved to be fairly useful, since they exceed the current limits by more than one magnitude, when $m_N \lesssim 0.1$~GeV. \begin{figure} \centering \includegraphics[width=0.49\textwidth]{figs/dg373.pdf} \includegraphics[width=0.49\textwidth]{figs/dg373tau.pdf} \caption{Same as Fig.~\ref{fig:fdg}, but for Scenario B. {The original limits from LEP, CMS and ATLAS are scaled for Scenario B, and hence shown prominently.}} \label{fig:fdg373} \end{figure} Now we move to the Scenario B, where the high scale couplings $d_{W,Z}$ are effective. Since these couplings are about 100 times {larger than $d_\gamma$} as indicated in Table~\ref{tab:scen}, the cross section {of $N$ production at LHC} is more than $10^{4}$ times larger {the one in Scenario A}. The larger cross section subsequently results in better sensitivity at $d_\gamma$. From Fig.~\ref{fig:fdg373}, the lowest $d_\gamma$ can be probed is $10^{-6}$ for FASER-2, $10^{-7}$ for MAPP-2 and FACET, and $10^{-8}$ for MATHUSLA. We compare them with the current limits, finding that the LLP detectors can probe one to two orders magnitude lower $d_\gamma$, than the low energy neutrino scattering and the CHARM experiments. Except FASER-2, since its geometrical acceptance is weak. Additionally for Scenario B, we redraw the current limits at high energy environment via analyses for prompt final states. We adopt ATLAS and CMS analyses, as well as the LEP analysis. Now these analyses benefited from the enlarged cross section as well, reaches to $d_\gamma \approx 10^{-(5-{7})}$, only when $m_N \sim 1-90$~GeV . This is because these analyses is only sensitive to the HNL with $L_N^{\text{lab}} \lesssim 1$~m~\cite{ATLAS:2020uiq, CMS:2018fon, Zhang:2023nxy}, {and ${\rm Br}(N \rightarrow \nu \gamma)$ drops sharply once $m_N > M_Z$ as shown in Fig.~\ref{fig:fdecay}~left. CMS analysis has shown better sensitivity than the ATLAS, since the production cross section $pp \rightarrow W$~(CMS), is larger than $pp \rightarrow Z$~(ATLAS) as shown in Fig.~\ref{fig:funa}~right.} Thus, the LLP and prompt analyses are complementary to each other. The LLP analyses can probe the parameter space when $m_N$ is low, whereas the prompt analyses probe the opposite. When look at the case where the dipole portal couples to $\tau$ only in Fig.~\ref{fig:fdg373}~right, the CMS limits do not apply, as it is sensitive to the $e, \mu$ final states only. {Now, the LLP detectors reach to more than one magnitude lower $d_\gamma$ than the limits from the LEP when $m_N \sim 2$~GeV.} \section{Conclusion} \label{sec:con} In pursuit of the explanation for the observed neutrino masses, many models assuming the existence of the HNLs are brought up. Among them, we focus on the neutrino dipole models within a dimension-6 EFT framework. This model contains high scale operators containing the couplings $d_{W,Z}$, which control the production of the HNLs at a high energy environment, e.g. the LHC. The current constraints are stringent on such models, with the upper limits $d_\gamma \sim 10^{-6}$ for $m_N < 1$~GeV, have already brought us to where the HNLs are long-lived. Although this case is already considered in Ref.~\cite{Jodlowski:2020vhr}, which employ the FASER-2 detector to search for the HNLs produced secondarily in neutrino interactions at the FASER$\nu$, the dependence on the high scale operators $d_{W,Z}$ is however not considered. In this paper, we discuss the effects of different relations between $d_{W,Z}$, and the low scale coupling $d_\gamma$, then estimate the sensitivity reach of the LLP detectors including FASER-2, MAPP-2, FACET and MATHUSLA at the HL-LHC to probe $d_\gamma$. The LLP detectors, located far away from the IP of the LHC, can be senstive to new particles which are light and weak coupled to the SM, leading to long decay length. Although weak couplings can lead to low statistics, this is overcome since the high scale couplings can produce large number of the HNLs, no matter the low scale decay coupling is. We choose two scenarios for comparison to show the dependence on the relations between $d_{W,Z}$ and $d_\gamma$. In one scenario, the production is dominantly controlled by the $d_\gamma$, and another one by $d_{W,Z}$. For the former scenario, we show that the LLP detectors can reach $d_\gamma \approx 10^{-6}$ when $m_N \lesssim 0.1$~GeV. Although this parameter space is already ruled out by neutrino scattering experiments, e.g. MiniBooNE and LSND, as well as the CHARM experiment, for $d_\gamma$ corresponds to the $e, \mu$ flavours or if it is universal, it is about two magnitude lower than the current limits when the dipole only couples to $\tau$. For the latter scenario, since the production is enhanced by the choices of $d_{W,Z}$, the LLP detectors can now reach $d_\gamma \approx 10^{-8}$ for $m_N \lesssim {2}$~GeV, {which is two magnitude lower than the current ones}. Among the LLP detectors, due to its long distance to the IP and large volume, the MATHUSLA has shown about one magnitude better sensitivity than the others. And the detectors located at the forward direction, including FASER-2 and FACET, have shown drastic different geometrical efficiencies in these two scenarios, due to the different contribution from the $\gamma$ mediated processes. \acknowledgments We thank Zeren Simon Wang for useful discussions. WL is supported by National Natural Science Foundation of China (Grant No.12205153), and the 2021 Jiangsu Shuangchuang (Mass Innovation and Entrepreneurship) Talent Program (JSSCBS20210213). YZ is supported in part by the National Natural Science Foundation of China (Grant No. 11805001). \bibliographystyle{JHEP}
\section{Introduction}\label{sec:intro} Solar flares and other forms of solar magnetic activity often generate high-energy particles, with energies far in excess of the highest mean energies ($kT \approx 1$~keV) for any collisionally relaxed solar plasma population \citep[e.g.,][]{2012RSPTA.370.3241V}. The bremsstrahlung continuum allows us to observe electrons above $E\sim10$~keV by the techniques of X-ray astronomy, and to characterize them spatially, spectrally, and temporally \citep[reviews in the solar flare context include][]{2011SSRv..159..107H,2011SSRv..159..301K}. This knowledge underpins the development of ``thick target'' beam models \citep[e.g.][]{1971SoPh...18..489B,1972SoPh...24..414H,1978ApJ...224..241E}, which have had an extensive theoretical development. The particularly close spatial and temporal association between deka-keV hard X-ray sources and flare ribbons and footpoints observed in the UV/optical/infrared \citep[e.g.][]{2011SSRv..159...19F} supports the idea that accelerated electrons dominate the transport and dissipation of flare energy during the impulsive phase \citep{1970ApJ...162.1003K} of an event. In some flares we also observe strong emissions from high-energy ions -- protons and, to a lesser extent, $\alpha$ particles and other heavier ions -- \citep[e.g.][]{2009ApJ...698L.152S}. In such cases they may well carry energy comparable to non-thermal electrons \citep[][]{2012ApJ...759...71E}. By excluding non-thermal ions in flare models, we are potentially ignoring up to half of the flare energy transported through the Sun’s atmosphere, or at least an energetically important constituent. Unfortunately, characterising their properties (or even their presence in chromospheric flare footpoints), is more challenging as non-thermal ions do not have such convenient signatures as non-thermal electrons do. \cite{1981ApJ...244L.171C} initially discovered solar $\gamma$-ray line emission in the form of the 2.223~MeV line produced by deuterium formation ($n + p \rightarrow {^2}H$). This implied the existence of free neutrons as a part of the flare process, and these could only have come from nuclear reactions: hence, the acceleration of high-energy ions (as already well known from ``solar cosmic rays,'' now known as ``solar energetic particles'', SEPs). These first observations also showed the presence of the positron-annihilation line at 511~keV and of inelastic-scattering (spallation) lines, such as the 4.43~MeV line of ${^{12}}C$, as well. These processes had all been anticipated theoretically, based on the prior knowledge of SEPs, but the $\gamma$-radiation gave us hints about the interactions of such particles in the lower solar atmosphere and of their possible role in flare dynamics. Limitations of detector sensitivity generally make it almost impossible to use $\gamma$~rays to detect ions from thin-target processes in the corona. The positron-annihilation and deuterium-formation lines result from secondary processes; the initial spallation reactions produce unstable nuclei that emit positrons and neutrons, respectively, and these must slow down collisionally before they interact. The interpretation of these delayed emission lines therefore involves additional model assumptions \citep[e.g.][]{1975SSRv...18..341R}. The $\gamma$-ray observations (for ions) have severe limitations in comparison with the hard X-ray bremsstrahlung (for electrons), however. In addition to the major technical problems of astronomy in this photon energy range, the inelastic-scattering lines alone provide almost no spectral information. Thus our remote-sensing knowledge of non-thermal ions actually in the solar flare volume basically only really reflects the proton population at about 10~MeV, the typical energy threshold for these reactions. Given coronal values of $kT_e \approx 100$~eV, or at most a few keV in flares, this leaves a huge gap in our knowledge. Extrapolating down to 1~MeV/nucleon, the energy of the flare ion population already rivals that of the non-thermal electrons in some cases at least \citep[e.g.,][]{1995ApJ...455L.193R}, suggesting orders-of-magnitude uncertainty in total particle energy if one were to consider (still highly non-thermal) particles at 10-100~keV/nucleon. In spite of the challenges of working in the few-MeV range of photon energies, the Reuven Ramaty High-Energy Spectroscopic Imager \citep[RHESSI;][]{2002SoPh..210....3L} succeeded in obtaining useful images of solar flares in a small number of events \citep{2003ApJ...595L..77H,2006ApJ...644L..93H}. These results localized high-energy ions, with their sources consistent with the flare loops \citep{2011SSRv..159..421L}, confirming the conclusion drawn from the rapid time variability previously observed. The 2.223~MeV line proved to come from flare footpoint regions, as expected theoretically, though with centroids curiously offset from the 200-300~keV X-ray (i.e. electron) sources by some $[14-20]^{\prime\prime}\pm5^{\prime\prime}$ in the three events studied. The RHESSI data also strongly suggested that the acceleration mechanism for the flare ions had a close relationship with that observed via the relatively well-observed X-ray bremsstrahlung above about 300~keV \citep{2009ApJ...698L.152S}. This key observation, identifying high-energy particles within closed magnetic field regions (the flare loops), makes the study of ion beams interesting, many decades after this was proposed on the basis of early observations of SEPs \citep{1970SoPh...13..471S,1970SoPh...15..176N,1995SSRv...73..387S}. \begin{figure} \centering {\includegraphics[width = 0.5\textwidth, clip = true, trim = 0cm 0.cm 0cm 0.cm]{OZSchematic}} \caption{\textsl{A schematic of the Orrall-Zirker (OZ) Effect, in which a distribution of non-thermal protons streams through the solar atmosphere until it reaches a population of neutral hydrogen atoms. Due to charge exchange with this ambient population, and subsequent collisions with ambient particles (hydrogen, protons, electrons) some fraction of the precipitating non-thermal protons is transformed into a non-thermal hydrogen atom (an energetic neutral atom, ENA) in an excited state. Spontaneous radiative de-excitation subsequently produces a highly Doppler shifted photon (e.g. of Ly~$\alpha$, Ly~$\beta$, H~$\alpha$).}} \label{fig:OZSchematic} \end{figure} The likely existence of ion beams in flares provides a crucial motivation for the work presented in this paper. Here we study the Orrall-Zirker effect (hereinafter OZ), as proposed by \cite{1976ApJ...208..618O}. Briefly, successful observations of OZ, via the Ly~$\alpha$\ line wings, would permit remote sensing of the potentially dominant low-energy ions in the energy range $\sim0.01-1$~MeV for the first time. Figure~\ref{fig:OZSchematic} sketches the OZ process: precipitating ions enter the partially ionized lower atmosphere, pick up electrons from neutral H atoms by atomic charge exchange reactions, and then spontaneously radiate a bound-bound photon in flight. This photon would be Doppler shifted by some amount depending on the original energy (velocity) of the proton. In the simplest picture this would enhance the red wing of Ly~$\alpha$\ or Ly~$\beta$\ because of the essentially downward motion of the beam particle. At exact beam alignment (the observer on the beam axis) 10-100 keV protons would appear as displacements of 5.6--17.7~\AA\ in the red wing of Ly~$\alpha$, well beyond likely flaring line widths of a few \AA; we do not yet have enough direct observation of this line to be more precise about this. We note that stellar Ly~$\alpha$\ spectra obtained by the Hubble Space Telescope \citep{2005ApJS..159..118W} show flare-star Ly~$\alpha$\ line profiles no more than a few \AA\ wide in quiescent conditions. Follow on studies by \cite{1985ApJ...295..275C}, \cite{1995A&A...297..854F}, and \cite{1999ApJ...514..430B} confirmed and expanded upon the initial theoretical work of \cite{1976ApJ...208..618O}. \cite{1995A&A...297..854F} noted that the predictions of the strength of non-thermal emission from models that assumed a homogeneous, and low, ionization fraction, were overstimated. However, even though they used a more realistic ionization stratification, they used static semi-empirical flare atmospheres and did not model self-consistently the feedback between the non-thermal protons and the atmospheric stratification. \cite{1985ApJ...295..275C} and \cite{1999ApJ...514..430B}, investigated the effect that different proton beam distributions had on the appearance of the non-thermal feature, indicating diagnostic potential. \cite{1999ApJ...514..430B} looked at the temporal evolution of the non-thermal emission, resulting from the atmospheric evolution, using a more sophisticated treatment of the non-thermal proton thermalisation than employed by the other studies. They focused on weaker energy fluxes than \cite{1985ApJ...295..275C}, and noted an initially strong source, that quickly diminished but then increased somewhat. However, they did not calculate the ambient emission\footnote{When we refer to `ambient' emission throughout, we mean the intensity in the absence of non-thermal emission following charge exchange; that is the Lyman line enhancements following flare heating in the original \texttt{RADYN+FP}\ simulations.} in their flare simulations, to compare against the strength of the non-thermal emission. The only tantalizing signature of the OZ effect from \textsl{bona-fide} red-shifted feature of the OZ effect was reported by \cite{1992ApJ...397L..95W}, who used data from the Goddard High Resolution spectrograph (GHRS) on the Hubble Space Telescope (HST). Those observations of Ly~$\alpha$\ from a moderately strong stellar flare that occurred on the dMe star AU Mic revealed a short ($t\sim3$~s), but clear, enhancement to redward of line core relative to the blueward side. Unfortunately, follow up studies of flares on AU Mic had null detections of non-thermal Ly~$\alpha$\ emission \citep{1993ApJ...414..872R,2001ApJ...554..368R,2022AJ....164..110F}. As regards solar flares, we have lacked routine high-quality observations of the Lyman lines in flares, and those that we do possess have not revealed the OZ effect. Searching for the equivalent feature from charge exchange between a non-thermal $\alpha$-particle beam producing non-thermal \ion{He}{2}~304~\AA\ emission \citep{1990ApJ...351..317P}, \cite{2001ApJ...555..435B} found no evidence using SOHO/CDS data (which observed this line in second order). Similarly, \cite{2012ApJ...752...84H} was unable to detect non-thermal \ion{He}{2}~304~\AA\ emission in large $\gamma$-ray events using SDO/EVE observations. Outwith the solar flare context, a similar process results in proton aurorae on Mars, where charge exchange between the solar wind and the Martian exosphere results in enhancements to Ly~$\alpha$\ \citep[see the recent observations and discussions of this effect by][]{2019JGRA..12410533H}. While there is not a track record of successful solar flare detections, it is important that we revisit the Orrall-Zirker effect now that we have more sophisticated numerical tools with which to attack the problem. Performing rigorous modern studies, of which this manuscript is the first, could lead to constraints on low-energy cutoffs of the non-thermal proton distribution, and thus total energetics and acceleration mechanisms. If our modern calculations confirm prior numerical studies that suggest that the OZ effect is, in principle, eminently observable then we must address the null detections. The solar physics community also has a renewed interest in solar Lyman line observations with several new and upcoming missions set to provide Ly~$\alpha$\ or Ly~$\beta$\ data (including Solar Orbiter, Solar-C/EUVST, ASO-S, and the SNIFS sounding rocket). In this study we revisit the predictions of the strength of the non-thermal Lyman line emission over time in flare simulations, and importantly we compare this to the predicted ambient flare emission in the same wavelength range. In Section~\ref{sec:radynfp} we describe our proton beam-driven flare models, and in Section~\ref{sec:ozeffect} discuss in detail the processes relevant to the Orrall-Zirker effect. The results of applying our Orrall-Zirker numerical code are shown in Section~\ref{sec:nthmemission}, where we synthesize Ly~$\alpha$\ and Ly~$\beta$\ emission. Our results confirm the earlier findings that non-thermal H$\alpha$ emission is far too weak to be detected \citep{1985ApJ...295..275C,1999ApJ...514..430B}, so we do not discuss that line in detail here. Finally, in Section~\ref{sec:spice} we degrade our predictions to the resolution of the SPICE instrument on board Solar Orbiter. \section{Numerical Flare Experiments}\label{sec:radynfp} \begin{figure*} \centering {\includegraphics[width = 0.8\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{OZ_AtmosProps_ForPaper}} \caption{\textsl{The atmospheric stratification for each simulation in our study. The top row (A-C) shows temperature, middle row (D-F) shows electron density, and bottom row (G-I) shows ionization fraction. Color represents time, where we show lines at $t=1$~s cadence during the heating phase of the flares. The first column shows the $F = 1\times10^{11}$~erg~s$^{-1}$~cm$^{-2}$ simulation, the middle column shows the $F = 1\times10^{10}$~erg~s$^{-1}$~cm$^{-2}$ simulation, and the final column shows the $F = 1\times10^{9}$~erg~s$^{-1}$~cm$^{-2}$ simulation.}} \label{fig:protonflares} \end{figure*} The field-aligned radiation hydrodynamics (RHD) code \texttt{RADYN}\ \citep{1992ApJ...397L..59C,1995ApJ...440L..29C,1997ApJ...481..500C,1999ApJ...521..906A,2005ApJ...630..573A,2015ApJ...809..104A} is a well established resource that models the solar atmosphere's response to energy injection. The coupled, non-linear equations of hydrodynamics, charge conservation, radiation transfer and non-equilibrium atomic level populations are solved on an adaptive grid (capable of resolving the steep gradients and shocks that form during flares) spanning the sub-photosphere through corona. In the pre-flare atmosphere the $z=0$ point is defined as where the standard optical depth is unity, $\tau_{5000} = 1$. Crucially, a NLTE, non-equilibrium chromosphere is modelled, with feedback between radiative heating and cooling, the hydrodynamics, and on the energy transport mechanisms. \texttt{RADYN}\ has been used extensively to study many aspects of flares, from details of energy transport, driving of mass flows, and the evolution of the flaring plasma, to the formation of radiation and sources of energy losses \citep[e.g.][]{2016ApJ...827..101K,2019ApJ...885..119K,2019ApJ...883...57K,2020ApJ...900...18K,2021ApJ...912..153K,2022ApJ...931...60A,2018ApJ...856..178P,2019ApJ...879L..17P,2018ApJ...862...59B,2020ApJ...895....6G,2015SoPh..290.3487K,2017ApJ...836...12K,2022ApJ...928..190K,2015ApJ...813..125K,2017A&A...605A.125S}. For a complete description of the base level of the code see \cite{2015ApJ...809..104A}. \texttt{RADYN}\ has been modified somewhat since \cite{2015ApJ...809..104A}, for example to include suppression of thermal conduction \citep{2022ApJ...931...60A}, more accurate Stark broadening of Balmer lines \citep{2022ApJ...928..190K}, and to model the transport of energetic particles via the \texttt{FP}\ (Fokker-Planck) code \citep[][]{2020ApJ...902...16A}. Of those we employ the latter in this work. For a comprehensive review of flare loop modelling, including \texttt{RADYN}, in the context of observations from the Interaface Region Imaging Spectrograph \citep[IRIS;][]{2014SoPh..289.2733D} see \cite{2022FrASS...960856K,2023FrASS...960862K}. When simulating solar or stellar flares driven by non-thermal particles \texttt{RADYN}\ now uses \texttt{FP}\ to model the propagation, evolution, and thermalisation of that particle population. \texttt{FP}\ is a standalone, open source, code that has been merged with \texttt{RADYN}, that while being similar to the approach used in \cite{2015ApJ...809..104A} offers an upgraded treatment of the solution of the Fokker-Planck kinetic theory, in particular more accurate warm target physics, the inclusion of return currents, and the ability to model particles of arbitrary mass and charge. A non-thermal particle distribution is injected at loop apex, which propagates through the loop, with energy lost via Coulomb collisions transferred to the plasma. This distribution is a power-law defined by the total energy flux $F$ [erg~s$^{-1}$~cm$^{-2}$] above some low-energy cutoff $E_{c}$ [keV], with a spectral index $\delta$. \texttt{FP}\ (and hence \texttt{RADYN+FP}) now has the ability to model a multi-species beam, but here we restrict ourselves to a proton-only distribution to simplify this initial study. Also, the only flare footpoints imaged at MeV $\gamma$-ray energies by RHESSI (from which we infer the presence of non-thermal protons) have an offset relative to the centroid positions of hard X-rays (i.e. the electron population). With the caveat that these are only a few events, such a separation may suggest that different species were accelerated along different flux tubes. In addition to energy losses, non-thermal particle distributions can cause collisional ionization or excitation of ambient species. For non-thermal collisional rates from the ground state of neutral hydrogen impacted by the proton beams we follow the treatment of \cite{1993A&A...274..923H}. \texttt{RADYN+FP}\ provides us with the time-dependent NLTE ionization stratification alongside the full spectral distribution of non-thermal protons, and self-consistently models the feedback between them. Armed with these we can make predictions of the production of energetic neutral atoms in a more accurate manner than previous codes. In this paper we focus on studying how detectable the non-thermal Lyman line emission might be for different injected energy fluxes. As mentioned in the Introduction, we do not have a firm grasp of the total energy flux carried by non-thermal protons and so, for the time being, elect to study the impact on the various physical processes of three regimes of flare heating where the energy flux varies over three orders of magnitude, $F = [10^{9}, 10^{10}, 10^{11}]$~erg~s$^{-1}$~cm$^{-2}$. The smallest energy flux could represent the initial stages of energy injection into a flare footpoint before some ramp up to a higher energy flux, or it could represent the total flux injected in some small scale heating event. \subsection{Proton Beam-Driven Flares} Three proton beam-driven flares were simulated using \texttt{RADYN+FP}, varying the injected flux $F = [10^{9}, 10^{10}, 10^{11}]$~erg~s$^{-1}$~cm$^{-2}$ with fixed $E_{c} = 150$~keV and $\delta = 5$. In this initial study we explore the potential of detection based on energy flux, and a fuller exploration of the parameters defining the proton distributions can be performed at a later date. Hereafter we refer to these experiments as 1F9, 1F10, 1F11, for the $F = [10^{9}, 10^{10}, 10^{11}]$~erg~s$^{-1}$~cm$^{-2}$ models, respectively. Energy was injected at a constant rate for $t_{inj} = 20$~s, with each loop allowed to cool over a further $t_{decay}=80$~s. Return current effects were not included in these models. A return current would appear as a downward propagating electron beam in order to neutralize the current introduced by the non-thermal proton beam. As discussed in \cite{2020ApJ...902...16A}, this could result in energy losses of the proton beam itself, or in Joule heating (operating primarily in the corona or upper transition region). Since return current losses are typically on the order of $10$~keV \citep{2020ApJ...902...16A}, which is a small fraction of the energy of the protons, it is safe to neglect return-current-induced energy losses of the non-thermal protons in our experiments. Any Joule heating of the corona or upper transition region would also likely be small and not impact our conclusions regarding the chromospheric footpoints. The evolution of the stratification of temperature, electron density, and H ionization fraction is shown in Figure~\ref{fig:protonflares} for each experiment, where color represents time. It is clear that increasing the magnitude of the energy flux carried by the non-thermal protons has more dramatic effect on the atmospheres. In the 1F10 and 1F11 flares the chromosphere is strongly compressed, and the transition region is pushed deeper in altitude, with a steeper transition region in the 1F11 case. The electron density increases by orders of magnitude, with a narrow region exceeding $n_{e} = [2.5\times10^{13},2.5\times10^{14}]$~cm$^{-3}$ for F10 and 1F11, respectively, with the location of the peak being pushed ever deeper as the chromospheres compress. There is a more extended region of more moderately elevated electron density towards greater depths, of a few $\times10^{12-13}$ cm$^{-3}$. Due to both the increased temperatures and the presence of non-thermal collisional ionisations the ionization fraction rapidly increases, particularly so for the 1F11 simulation. Even by $t=1$~s there is a `wall' of ionization present in both of those simulations, where the ionization climbs from $\chi_{H} \sim 0.5$ to $\chi_{H} \sim 1$ in only a few meters, which occurs $z\sim100$~km deeper for the 1F11 simulation compared to the 1F10. As time goes on the location of this ionization front pushes increasingly deeper, such that it is located at $0.71$~Mm and $0.96$~Mm in the 1F11 and 1F10 simulations, respectively, by the end of the heating phase. The gradient from $\chi_{H} \sim 0.1$ to $\chi_{H} \sim 1$ is steeper for the 1F11 simulation, so that for $t \gtrsim10$~s seconds this change in ionization fraction occurs over a span of only $\Delta Z \sim [10-30]$~km, compared to $\Delta z\sim[50-130]$~km for the 1F10 simulation. Compared to those simulations, the dynamics in the 1F9 simulation is much more modest. The flare transition region does not really change location substantially, eventually residing $z\sim100$~km higher in altitude than it did before the flare. However, it is more extended, with $40$~kK$<T<1$~MK over a span of $\Delta z \sim130$~km. Given the modest temperature rise and smaller rate of non-thermal collisions, electron densities were commensurately smaller than the other simulations, peaking at only $n_{e} \sim 4.5\times10^{12}$~cm$^{-3}$, and with a tail of only a few $\times10^{11}$~cm$^{-3}$ through the lower chromosphere. Consequently, the ionization stratification is less sharp, with the `wall' feature being softened to occur over a span of $\Delta z\sim10-20$~km, with a similarly more gentle gradient down to $\chi_{H} \sim 0.1$. Since we inject non-thermal protons with energies $\sim150$~keV, their speed is intermediate between the thermal electron and ion speeds for plasma with temperature greater than $\sim1$ MK. This is the warm-target regime described in \citet{1986ApJ...309..409T}. Warm-target collisions are much less effective at slowing non-thermal particles than cold target collisions \citep{1986ApJ...309..409T, 2020ApJ...902...16A}. Therefore, the protons are able to transport through the corona relatively unimpeded until they reach the transition region where they encounter cooler plasma and are stopped, thereby heating the transition region and upper chromosphere, evaporating more plasma into the corona and forcing the transition region increasingly deeper. We briefly note that the momentum of a non-thermal proton is larger than that of a non-thermal electron, which should be accounted for. With \texttt{FP}\ we include the particle momentum self-consistently \citep{1986ApJ...309..409T, 2020ApJ...902...16A}. Comparing the acceleration induced to that of mass flows resulting from plasma heating indicates that plasma heating dominates, and that it is plasma heating that ultimately results in pushing the transition region to greater depths. \subsection{Ambient Lyman Emission in Flares} Since \texttt{RADYN}\ truncates the Lyman line profiles at 10 Doppler widths in order to mimic the effects of partial frequency redistribution (PRD) for the purposes of energetics (to avoid overestimating radiative losses in the wings), we use \texttt{RH15D}\ \citep{2001ApJ...557..389U,2015A&A...574A...3P} with our \texttt{RADYN}\ flare atmospheres as input to synthesize the Lyman lines and the region around them. \texttt{RH15D}\ solves the radiation transport equation and atomic level populations for a desired species, given an atmosphere (the depth scale, temperature, electron density, gas velocity and hydrogen populations). We have modified \texttt{RH15D}\ to keep the hydrogen and \ion{Ca}{2} populations from \texttt{RADYN}\ fixed so that non-equilibrium effects and non-thermal collisions are accounted for, while still solving the statistical equilibrium atomic level populations of other species. Full NLTE radiation transport was solved for the following species \citep[with PRD for certain transitions as appropriate, including Ly~$\alpha$\ and Ly~$\beta$, using the hybrid scheme of][]{2012A&A...543A.109L}: \ion{H}{1}, \ion{C}{1}+\ion{C}{2}, \ion{O}{1}, \ion{Si}{1}+\ion{Si}{2}, \ion{Ca}{2}, \ion{He}{1}+\ion{He}{2} \& \ion{Mg}{2}. Other species were included as sources of background opacity. The opacity `fudge' factors of \cite{1992A&A...265..237B}, that are typically included in \texttt{RH}\ and \texttt{RH15D}\ by default to mimic the UV line haze, were not used as these are rather specific to a VAL-C type atmosphere \citep{1981ApJS...45..635V} and likely not appropriate for more complex flare-like atmospheres. Instead we include opacity from the myriad of bound-bound lines not solved in detail via the Kurucz linelists\footnote{\url{http://kurucz.harvard.edu/linelists.html}}, where hundreds of thousands of lines were included in the range $\lambda = [20-8000]$~\AA. The intensities of those lines surrounding the Ly~$\alpha$\ and Ly~$\beta$\ lines were estimated in LTE (though with two-level scattering) with a wavelength sampling of at least 0.1~\AA\ (finer sampling was present where there was overlap with the model atoms included in the solution). Microturbulent broadening of $v_{\mathrm{nthm}} = 8$~km~s$^{-1}$ was included, and lines were Doppler shifted as appropriate. In addition to the \texttt{RH15D}\ solution we synthesize the \ion{O}{6} doublet at $\lambda = 1031.9$~\AA\ and $\lambda = 1037.6$~\AA, which are two strong optically thin lines that appear in the vicinity of the peak of the non-thermal emission in the red wing of Ly~$\beta$. The contribution functions, $G(n_{e}, T)$, which encapsulate various atomic processes that populate the relevant levels, were computed for each line from the CHIANTI atomic database \citep[V8.07;][]{1997A&AS..125..149D,2015A&A...582A..56D} for various values of temperature and electron density. These were tabulated with grid spacings of $\delta \log T$ [K]$ = 0.05$ and $\delta \log n_{e} $ [cm$^{-3}$] $=0.5$, and at each grid cell in the \texttt{RADYN}\ atmospheres we interpolate $G(n_{e}, T)$ to the local values of temperature and electron density. The intensity emitted within each cell, $I_{\lambda,z}$ is then: \begin{equation} I_{\lambda,z} = A_{O}G(n_{e},T)n_{e(z)}n_{H}(z)\delta z, \end{equation} \noindent where $A_{O}$ is the elemental abundance relative to hydrogen\footnote{We used the abundance value from \cite{2012ApJ...755...33S}, $A_{O,log}=8.61$, defined on the usual logarithmic scale, where $A_{H,log}=12$ (the abundance is then $A_{O} = 10^{A_{O,log} - A_{H,log}} = 4.1\times10^{-4}$). There is much debate over whether to use the coronal or photospheric abundance values during flares, with the intensity varying by some factor based on the choice. Since we are synthesising these lines for the purpose of determining if there is a region between them that permits identification of non-thermal emission, it will not affect our conclusions if their intensity is over- or under-estimated by some relatively small factor.}, $\delta z$ is the length of the cell, and $n_{H}$ is the hydrogen density. The spectral lines were thermally broadened according to the local temperature, and Doppler-shifted as appropriate. The total emergent intensity was then $I_{\lambda} = \Sigma_z I_{\lambda,z}$. Note that we only include these lines to help assess whether the non-thermal emission can be identified at wavelengths surrounding them, and that a more rigorous sythesis would include resonant scattering of chromospheric radiation. From \texttt{RADYN+FP}+\texttt{RH15D}\ we obtained the ambient Lyman line plus surrounding emission as a function of time in our flares, on top of which the non-thermal OZ emission would appear. \section{Orrall-Zirker Effect}\label{sec:ozeffect} \subsection{Overview of the Problem} As discussed in Section~\ref{sec:intro} and sketched in Figure~\ref{fig:OZSchematic}, the non-thermal protons streaming through the solar atmosphere may undergo charge exchange with ambient hydrogen once they reach the chromosphere. These charge exchange interactions may occur both to the ground or excited states. Subsequent collisions can also excite a non-thermal hydrogen atom into an excited state, or cause transitions between bound excited states. Following the discussions laid out in \cite{1976ApJ...208..618O} and \cite{1985ApJ...295..275C}, we assume that the non-thermal hydrogen atoms created through charge exchange share the same velocity (i.e. energy) as their parent non-thermal proton, and that the de-excitation of a non-thermal hydrogen atom occurs over a very short distance. This latter point means that the creation and destruction of non-thermal hydrogen is an inherently local process, such that advection terms can be ignored along with time-dependent terms \citep[see the demonstration that de-excitation occurs much faster than deceleration in][]{1976ApJ...208..618O}. These two assumptions allow us to write the population equation of non-thermal hydrogen levels in the form of a statistical equilibrium equation, with the total number of non-thermal particles (protons plus hydrogen atoms) within some energy range $[E,E+\delta E]$, located within some height range $[z, z+\delta z]$, conserved. This also means that we can assume any emitted photon is red-shifted by an amount equal to the velocity of the original non-thermal proton that underwent charge exchange. The number density of a non-thermal hydrogen atom, with energy $E$ at height $z$, is $\eta_{j}(E,z)$ [cm$^{-3}$], where $j = (1, ..., m)$ is the atomic level. Similarly, the non-thermal proton density is $\eta_{p}(E,z)$ [cm$^{-3}$]. Here we follow the convention in \cite{1985ApJ...295..275C} that $\eta$ symbols refer to number densities in $(E,z)$ space as opposed to the thermal population with number densities of particles defined solely on $(z)$ space, for example the ambient electron density $n_{e}(z)$ or ambient hydrogen densities $n_{j}(z)$. Assuming statistical equilibrium for a total creation term $C$ (e.g. charge exchange, collisional excitation, etc.,) and total destruction term $D$ (e.g. spontaneous radiative de-excitation, collisional de-excitation, etc.,): \begin{equation} \sum_{j \ne i}^{m} \eta_{j} C_{ji} - \eta_{i}D_{i} = 0 \end{equation} Collating creation and destruction terms (detailed below) to a total rates matrix $P$, and including $j = (1, ..., m)$ then: \begin{equation}\label{eq:nonthermpops} P\cdot N = X, \end{equation} \begin{equation*} \begin{pmatrix} P_{11} & P_{12} & P_{13} & P_{1p} \\ P_{21} & P_{22} & P_{23} & P_{2p} \\ P_{31} & P_{31} & P_{32} & P_{33} \\ P_{p1} & P_{p2} & P_{p3} & P_{pp}\end{pmatrix} \begin{pmatrix} \eta_{1} \\ \eta_{2} \\ \eta_{3} \\ \eta_{p} \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \\ 0 \\ 0 \end{pmatrix} \end{equation*} \noindent where we dropped the $(E,z)$ dependence for clarity. To solve this system we replace one of the equations with the particle conservation equation so that the total number of non-thermal particles at $(E,z)$ is conserved. We choose the final equation so that $P_{p1} = P_{p2} = P_{p3} = P_{pp} = 1$ and $X_{p} = \eta_{p,FP}$, for $\eta_{p,FP}$ the non-thermal proton distribution number density from \texttt{RADYN+FP}. Once we know the non-thermal populations $\eta$, the photon emissivity, $\Phi(\Delta \lambda, z)$, of transition $j\rightarrow i$, at some $\Delta \lambda$~\AA\ from line center, at height $z$ in the atmosphere, in photons~s$^{-1}$~cm$^{-3}$~sr$^{-1}$~\AA$^{-1}$ is given by \begin{equation} \Phi(\Delta \lambda, z) = \frac{\sqrt{2m_{p}c^{2}}}{4\pi \lambda_{ji}}~E^{1/2}~\eta_{j}(E,z)A_{ji}, \end{equation} \noindent where $A_{ji}$ is the Einstein coefficient for spontaneous emission and $m_{p}$ is the proton mass (or particle mass in the more general sense). In the above we have used the fact that $\mathrm{d} (\Delta \lambda) = \lambda_{ji} \mathrm{d}\nu/c = \lambda_{ji} \mathrm{d}E/(c\sqrt{2m_{p}E})$. This becomes an emissivity in terms of energy, $\psi_{ji}(\Delta \lambda, z)$ erg~s$^{-1}$~cm$^{-3}$~sr$^{-1}$~\AA$^{-1}$, via the conversion, \begin{equation} \psi_{ji}(\Delta \lambda, z) = \frac{hc}{\lambda_{ji}} \Phi_{ji}(\Delta \lambda, z). \end{equation} \noindent the emergent intensity is then simply, \begin{equation} I_{\mathrm{nthm},ji}(\Delta \lambda) = \int_{z_1}^{z_2}\psi_{ji}(\Delta \lambda, z)\mathrm{d}z, \end{equation} \noindent where $z_{1}$ an $z_{2}$ are two pre-selected height ranges (e.g. $z_{1} = 0$ and $z_{2} = \infty$ if we sum over the full atmosphere). If we assume the chromosphere is optically thin a few angstroms from the Lyman line cores then this non-thermal intensity can be added as straight sum to the emergent intensity from the ambient flaring emission. Note also the assumption here that the protons are streaming almost vertically near disk center. In the event that the flare is located with increasing heliocentric angle towards the solar limb then the $\Delta \lambda$ would be somewhat different due to the dependence on the non-thermal particle velocity, $v$. Despite the ideal nature of the setup we are presently investigating, including angular effects would not be expected to markedly reduce the peak intensity of the emission. \subsection{Atomic Processes and Cross-Sections} \subsubsection{Populating non-thermal Hydrogen Excited Levels} Here we lay out the relevant atomic processes that populate a three level non-thermal hydrogen atom, allowing us to then synthesize Ly~$\alpha$\ and Ly~$\beta$\ emission. These processes are: charge exchange (both to ground and excited levels); collisional excitation of bound levels by ambient particles; collisional ionization by ambient particles; collisional de-excitation by ambient particles; spontaneous radiative de-excitation of an excited level; stimulated radiative de-excitation of an excited level; radiative recombination of $\eta_{p} \rightarrow \eta_{j}$; three-body recombination of $\eta_{p} \rightarrow \eta_{j}$. \cite{1985ApJ...295..275C} looked in detail at these processes, noting that charge exchange predominantly occurred to the ground levels, and that collisional excitation of $\eta_{1}\rightarrow \eta_{2},\eta_{3}$ was an important pathway to creating excited non-thermal hydrogen. Charge exchange was orders of magnitude more efficient than both three-body and spontaneous radiative recombination so we ignore those processes going forward. Spontaneous radiative de-excitation from the excited levels was far more rapid than any other destruction process so we additionally ignore collisional de-excitation. Radiative excitation of $\eta_{1}$ is also safely neglected. So, we are left with charge exchange, collisional excitation and ionisation, and spontaneous radiative de-excitation as the important atomic processes to include in our model. In the expressions that follow, terms such as $C_{ij}$ refer to rates of collisional processes from level $i \rightarrow j$, in s$^{-1}$. For our three level model hydrogen atom $j = (1, 2, 3)$, and $p$ refers to a non-thermal proton. Charge exchange rates in s$^{-1}$ are labelled $CX_{pj}$, where the electron is captured to the $j$-th level. Radiative terms are listed in terms of the Einstein coefficients for spontaneous emission rates $A_{ji}$ in s$^{-1}$. Collisional rates are individually comprised of interactions between the beam particle, with velocity $v$ in cm~s$^{-1}$, and a target of ambient protons (density $n_{p}$), hydrogen atoms (density $n_{H}$) and electrons (density $n_{e}$). Atomic cross sections are defined as $Q_{ij}^{P,E,H,CX}$ cm$^{2}$ where the index refers to a collision with a proton, electron, or neutral hydrogen respectively, or that a charge exchange interaction takes place. The ground state of non-thermal hydrogen $\eta_{1}$ is populated by charge exchange, and de-populated by collisional excitation or ionisation; \begin{equation} \eta_{1} \rightarrow \eta_{p}CX_{p1} - \eta_{1}(C_{12} + C_{13} + C_{1p}) = 0, \end{equation} \noindent where in the above \begin{equation} \begin{split} CX_{p1} = n_{H}Q_{p1}^{CX}v\\ C_{12} = (n_{p}Q_{12}^{P} + n_{H}Q_{12}^{H} + n_{e}Q_{12}^{E})v\\ C_{13} = (n_{p}Q_{13}^{P} + n_{H}Q_{13}^{H} + n_{e}Q_{13}^{E})v\\ C_{1p} = (n_{p}Q_{1p}^{P} + n_{H}Q_{1p}^{H} + n_{e}Q_{1p}^{E})v \end{split} \end{equation} The first excited state of non-thermal hydrogen $\eta_{2}$ is populated by direct charge exchange and by collisional excitation from $\eta_{1}$, and de-populated by collisional excitation or ionization plus spontaneous emission; \begin{equation} \eta_{2} \rightarrow \eta_{p}CX_{p2} + \eta_{1}C_{12} - \eta_{2}(C_{23} + C_{2p} + A_{21}) = 0, \end{equation} \noindent where in the above \begin{equation} \begin{split} CX_{p2} = n_{H}Q_{p2}^{CX}v\\ C_{23} = (n_{p}Q_{23}^{P} + n_{H}Q_{23}^{H} + n_{e}Q_{23}^{E})v\\ C_{2p} = (n_{p}Q_{2p}^{P} + n_{H}Q_{2p}^{H} + n_{e}Q_{2p}^{E})v \end{split} \end{equation} The second excited state of non-thermal hydrogen $\eta_{3}$ is populated by direct charge exchange and by collisional excitation from $\eta_{1}$ and $\eta_{2}$, and de-populated by collisional ionization plus spontaneous emission; \begin{equation} \eta_{3} \rightarrow \eta_{p}CX_{p3} + \eta_{1}C_{13} + \eta_{2}C_{23} - \eta_{3}(C_{3p} + A_{31} + A_{32}) = 0, \end{equation} \noindent where in the above \begin{equation} \begin{split} CX_{p3} = n_{H}Q_{p3}^{CX}v\\ C_{3p} = (n_{p}Q_{3p}^{P} + n_{H}Q_{3p}^{H} + n_{e}Q_{3p}^{E})v \end{split} \end{equation} \subsubsection{Cross-Sections Used in This Study}\label{sec:csec} \begin{figure} \centering \vbox{ \subfloat{\includegraphics[width = .5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CompareFits_Kerr_BW99_Fang95_Qp1_ForPaper_logx_logy}} } \vbox{ \subfloat{\includegraphics[width = .5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CompareFits_Kerr_BW99_Fang95_Qp2_ForPaper_logx_logy}} } \vbox{ \subfloat{\includegraphics[width = .5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CompareFits_Kerr_BW99_Fang95_Qp3_ForPaper_logx_logy}} } \caption{\textsl{Charge exchange cross-sections used in this study, where the black line shows the fit to data (diamonds). The functions used by \cite{1995A&A...297..854F} are shown as dot-dashed red lines, and by \cite{1999ApJ...514..430B} as blue dashed lines. Panel (A) is charge exchange to the ground state, panel (B) is to the first excited state (n=2), and panel (C) is to the second excited state (n=3).}} \label{fig:csec_cx} \end{figure} The cross-sections are an important element in the prediction of the non-thermal hydrogen level populations, so we compiled more up-to-date values than used previously, where available, particularly for the charge exchange cross sections. As seen in Figures~\ref{fig:csec_cx} and \ref{fig:csec_other}, both charge exchange and collisional excitation/ionization peak in the deka-keV to 100~keV range, so that the relevant wavelengths for the Lyman lines are roughly $\Delta \lambda \approx [5-50]$~\AA. For certain cross-sections we fit polynomial functions to data (sometimes from multiple sources), allowing us to subsequently evaluate the cross-sections at any energy within the bounds of the data, for example at the non-thermal energies used by the \texttt{RADYN+FP}\ grid. Those polynomial fits were performed in $\log Q$ and $\log E$ space, for $Q$ in $10^{-17}$~cm$^{2}$ and $E$ in keV, and have the form: \begin{equation} \log Q = a_{0} + \sum_{i} a_{i}~(\log E)^{i}. \end{equation} \noindent For other cross-sections we used functions from the International Atomic Energy Agency's (IAEA) supplement series \cite{international1993iaea}, who provide functions fit to data that they compiled from multiple sources for each process (see their references). As discussed below, where relevant we extrapolated beyond the energy bounds quoted by various authors but fit the decay so that extrapolations are a straight line in log-log space, which seems justified by the $Q(E)$ values at high energies. We did not fit beyond the IAEA functions but did check that extrapolating beyond the energy bounds that they quote provided sensible results. This is only really required when considering collisions with ambient electrons, and for other processes we were able to locate $Q(E)$ values in the energy range appropriate for the problem at hand. We were unable to locate cross-sections for $Q_{2p}^{H}$, $Q_{23}^{H}$, or $Q_{3p}^{H}$, at suitably high energies, and so omit those in the rates matrix. This should not have a major impact as we do consider the same collisional processes where the targets are protons or electrons. Those missing processes were not included by previous models. Below we show the cross-sections, and comment on their sources. For those that we fit polynomial functions to, their coefficients are listed in Table~\ref{tab:csec_tab}. These data, either fit by us or by the IAEA, come from both experiments and theoretical calculations. \begin{table*} \begin{rotatetable*} \caption{Parameters of polynomial fits of certain cross-sections used in this study. Numbers in parentheses are the indices of the powers of ten to which the values are raised. For example $2.19952(-1) = 2.19952\times10^{-1}$. The valid energy ranges for each fit are indicated in the final column. Fits were performed in $\log Q$ \& $\log E$ space, for $Q$ in $\times10^{-17}$~cm$^{2}$ and $E$ in keV.} \begin{center} \begin{tabular}{{ l | l | l | l | l | l | l | l | l | l | l }} \toprule & {\multirow{2}{*}{$a_0$}} & {\multirow{2}{*}{$a_1$}} & {\multirow{2}{*}{$a_2$}} & {\multirow{2}{*}{$a_3$}} & {\multirow{2}{*}{$a_4$}} & {\multirow{2}{*}{$a_5$}} & {\multirow{2}{*}{$a_6$}} & {\multirow{2}{*}{$a_7$}} & {\multirow{2}{*}{$a_8$}}& E [keV] \\ & & & & & & & & & & \\ \toprule \toprule $\mathbf{Q_{p1}^{CX}}$ & $2.22694$ & $2.19952(-1)$ & $-2.61594$ & $4.88315$ & $-4.06255$ & $1.49092$ & $-2.50756(-1)$ & $1.43542(-1)$ & $3.20664(-4)$ & $1-8000$ \\ $\mathbf{Q_{p2}^{CX}}$ & $ 3.52822(-1)$ & $1.64356$ & $-7.98958$ & $1.55848(1)$ & $-1.33785(1)$ & $5.69352$ & $-1.28934$ & $1.48437(-1)$ & $-6.77411(-3)$ & $1-8000$ \\ $\mathbf{Q_{p3}^{CX}}$ & $ -1.33340$ & $1.81849$ & $-3.20438$ & $8.73242$ & $-8.72014$ & $3.83963$ & $-8.43943(-1)$ & $8.84133(-2)$ & $-3.29639(-3)$ & $1-8000$ \\ \midrule $\mathbf{Q_{1p}^{P}}$ & $-1.55347$ & $1.36699$ & $1.85672$ & $-5.69725$ & $9.64059$ & $-8.12511$ & $3.44612$ & $-7.16542(-1)$ & $5.84099(-2)$ & $1-1500$ \\ & $2.76008$ & $-8.22412(-1)$ & & & & & & & & $>1500$\\ $\mathbf{Q_{1p}^{H}}$ & $-2.64545(-2)$ & $1.52462$ & $-4.62208$ & $1.03086(1)$ & $-1.04104(1)$ & $5.36558$ & $-1.49664$ & $2.15950(-1)$ & $-1.26636(-2)$ & $1-10^{4}$ \\ \midrule $\mathbf{Q_{12}^{H}}$ & $1.29154(-1)$ & $1.59680$ & $2.19750$ & $-1.06375(1)$ & $1.50168(1)$ & $-1.13679(1)$ & $4.78532$ & $-1.01709$ & $8.03237(-2)$ & $2-100$ \\ & $1.35631$ & $-6.05696(-1)$ & & & & & & & & $>100$\\ \midrule $\mathbf{Q_{13}^{H}}$ & $-5.91530(-1)$ & $3.09401$ & $-2.40878$ & $7.40410(-1)$ & $-2.21064$ & $2.89666$ & $-1.53333$ & $3.67348(-1)$ & $-3.33341(-2)$ & $1-1024$ \\ & $1.49527$ & $-9.23204(-1)$ & & & & & & & & $>1024$\\ \midrule \bottomrule \end{tabular}\label{tab:csec_tab} \end{center} \end{rotatetable*} \end{table*} \noindent \textbf{Cross-Sections for Charge Exchange}: Charge exchange cross-section data were taken from \cite{2009PhRvA..80c2701W} for $E = [1-100]$~keV, and \cite{1992ADNDT..51...59B} for $E = [125-8000]$~keV. Those energy ranges were combined and an 8-degree polynomial fit from $E=[1-8000]$~keV performed, the results of which are shown in Figure~\ref{fig:csec_cx}. Prior studies of the OZ effect used data from various sources including \cite{1953PPSA...66..972B}, \cite{1974eiip.book.....M}, \cite{1956PhRv..103..896S}, \cite{1970JPhB....3..813C}, \cite{1978PhRvA..18.1930S}, and \cite{1982JPhB...15.2703L} For comparison, on each panel of Figure~\ref{fig:csec_cx} we also show the polynomial fits by \cite{1995A&A...297..854F} and by \cite{1999ApJ...514..430B}, the latter of which are comparable to those used by \cite{1976ApJ...208..618O} and \cite{1985ApJ...295..275C}, to illustrate the differences with the more up-to-date cross-sections (which can be large at times). Though the functions from \cite{1995A&A...297..854F} are not ideal at certain energies, the most important energies were mostly adequately fit.\\ \noindent \textbf{Cross-Sections for Collisional ionization of $\eta_{1}~ (\mathrm{Q_{1p}})$}: Cross-sections for collisional ionization of $\eta_{1}$ by ambient protons ($Q_{1p}^{P}$) were combined from \cite{1981JPhB...14.2361S}, \cite{1987JPhB...20.2481S}, \cite{1998JPhB...31L.757S}, with $E = [38-1500]$~keV, $E = [9-75]$~keV, $E = [1.25-9]$~keV, respectively. An 8-degree polynomial fit from $E = [1-1500]$~keV was performed. Since in $\log Q - \log E$ space the range $E = [500-1500]$~keV is a straight line, a 1-degree polynomial was fit to that range, so that an extrapolation to $E > 1500$~keV can be performed if required (though in practice we really only care about $E< 1$~MeV). $Q_{1p}^{P}$ is shown in Figure~\ref{fig:csec_other}(A), alongside the underlying data. Cross-sections for collisional ionization of $\eta_{1}$ by ambient hydrogen ($Q_{1p}^{H}$) are the recommended values from \cite{2021ApJS..252....7C}, in the energy range $E = [0.0362 - 10000]$~keV. An 8-degree polynomial fit was performed over that range, the result of which is shown in Figure~\ref{fig:csec_other}(A), alongside the underlying data. Cross-sections for collisional ionization of $\eta_{1}$ by ambient electrons ($Q_{1p}^{E}$) are the values from the IAEA. We used their functional form, which is shown in Figure~\ref{fig:csec_other}(A), and can be found on page 28 of \cite{international1993iaea}.\\ \noindent \textbf{Cross-Sections for Collisional Excitation of $\eta_{1} \rightarrow \eta_{2}~ (\mathrm{Q_{12}})$}: Cross-sections for collisional excitation of $\eta_{1}\rightarrow \eta_{2}$ by ambient protons ($Q_{12}^{P}$) are the values from the IAEA. We used their functional form, which is shown in Figure~\ref{fig:csec_other}(B), and can be found on page 46 of \cite{international1993iaea}. Cross-sections for collisional excitation of $\eta_{1}\rightarrow \eta_{2}$ by ambient hydrogen atoms ($Q_{12}^{H}$) are taken from \cite{Hill_1979} and \cite{McLaughlin_1983}. For the $2s$ level the \cite{Hill_1979} experimental results are used for $E = [2-25]$~keV with \cite{McLaughlin_1983}'s calculations used for $E = [36-100]$~keV. For the $2p$ level \cite{McLaughlin_1983} is used for the full range $2-100$~keV. The $2s$ and $2p$ cross-sections are summed to obtain the total $n=2$ values. These data were fit with an 8-degree polynomial within the range $E = [2-100]$~keV. Since there is a linear decay (in log space) at higher energies, a 1-degree polynomial was fit to $E = [36-100]$~keV allowing extrapolation to $E>100$~keV. The fit results are shown in Figure~\ref{fig:csec_other}(B) alongside the underlying data. Cross-sections for collisional excitation of $\eta_{1}\rightarrow \eta_{2}$ by ambient electrons ($Q_{12}^{E}$) are the values from the IAEA. We used their functional form, which is shown in Figure~\ref{fig:csec_other}(B), and can be found on page 6 of \cite{international1993iaea}.\\ \noindent \textbf{Cross-Sections for Collisional Excitation of $\eta_{1} \rightarrow \eta_{3}~ (\mathrm{Q_{13}})$}: Cross-sections for collisional excitation of $\eta_{1}\rightarrow \eta_{3}$ by ambient protons ($Q_{13}^{P}$) are the values from the IAEA. We used their functional form, which is shown in Figure~\ref{fig:csec_other}(C), and can be found on page 48 of \cite{international1993iaea}. Cross-sections for collisional excitation of $\eta_{1}\rightarrow \eta_{2}$ by ambient hydrogen atoms ($Q_{12}^{H}$) are taken from \cite{McLaughlin_1987}, in the energy range $E = [1-1024]$~keV. Data from the $3s, 3p, 3d$ levels were summed to obtain the cross-sections for $n=3$. These data were fit with an 8-degree polynomial. Since there is a linear decay (in log space) at higher energies, a 1-degree polynomial was fit to $E = [324-1024]$~keV allowing extrapolation to $E>1024$~keV.The fit results are shown in Figure~\ref{fig:csec_other}(C) alongside the underlying data. Cross-sections for collisional excitation of $\eta_{1}\rightarrow \eta_{3}$ by ambient electrons ($Q_{13}^{E}$) are the values from the IAEA. We used their functional form, which is shown in Figure~\ref{fig:csec_other}(C), and can be found on page 14 of \cite{international1993iaea}.\\ \noindent \textbf{Cross-Sections for Collisional ionization of $\eta_{2}~ (\mathrm{Q_{2p}})$}: Cross-sections for collisional ionization of $\eta_{2}$ by ambient protons ($Q_{2p}^{P}$) are the values from the IAEA. We used their functional form, which is shown in Figure~\ref{fig:csec_other}(D), and can be found on page 70 of \cite{international1993iaea}. Cross-sections for collisional ionization of $\eta_{2}$ by ambient electrons ($Q_{2p}^{E}$) are the values from the IAEA. We used their functional form, which is shown in Figure~\ref{fig:csec_other}(D), and can be found on page 34 of \cite{international1993iaea}.\\ \noindent \textbf{Cross-Sections for Collisional Excitation of $\eta_{2}\rightarrow \eta_{3}~ (\mathrm{Q_{23}})$}: Cross-sections for collisional excitation of $\eta_{2}\rightarrow \eta_{3}$ by ambient protons ($Q_{23}^{P}$) are the values from the IAEA. We used their functional form, which is shown in Figure~\ref{fig:csec_other}(E), and can be found on page 56 of \cite{international1993iaea}. Cross-sections for collisional excitation of $\eta_{2}\rightarrow \eta_{3}$ by ambient electrons ($Q_{23}^{E}$) are the values from the IAEA. We used their functional form, which is shown in Figure~\ref{fig:csec_other}(E), and can be found on page 22 of \cite{international1993iaea}.\\ \noindent \textbf{Cross-Sections for Collisional ionization of $\eta_{3}~ (\mathrm{Q_{3p}})$}: Cross-sections for collisional ionization of $\eta_{3}$ by ambient protons ($Q_{3p}^{P}$) are the values from the IAEA. We used their functional form, which is shown in Figure~\ref{fig:csec_other}(F), and can be found on page 72 of \cite{international1993iaea}. Cross-sections for collisional ionization of $\eta_{3}$ by ambient electrons ($Q_{3p}^{E}$) are the values from the IAEA. We used their functional form, which is shown in Figure~\ref{fig:csec_other}(F), and can be found on page 36 of \cite{international1993iaea}.\\ \begin{figure*} \centering \vbox{ \hbox{ \subfloat{\includegraphics[width = .5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CompareFits_Kerr_Q1p_ForPaper_logx_logy}} \subfloat{\includegraphics[width = .5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CompareFits_Kerr_Q12_ForPaper_logx_logy}} } } \vbox{ \hbox{ \subfloat{\includegraphics[width = .5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CompareFits_Kerr_Q13_ForPaper_logx_logy}} \subfloat{\includegraphics[width = .5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CompareFits_Kerr_Q2p_ForPaper_logx_logy}} } } \vbox{ \hbox{ \subfloat{\includegraphics[width = .5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CompareFits_Kerr_Q23_ForPaper_logx_logy}} \subfloat{\includegraphics[width = .5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CompareFits_Kerr_Q3p_ForPaper_logx_logy}} } } \caption{\textsl{Cross-sections for collisional excitation and ionization with ambient electrons, protons, and hydrogen ($E, P, H$ superscripts, respectively) used in this study. Solid lines are our own polynomial fits, or are the functions from the IAEA \citep[IAEA93 on each panel;][]{international1993iaea}, as indicated. The underlying data are shown as symbols, and are as described in the text. Shah81,87,98 refers to \cite{1981JPhB...14.2361S}, \cite{1987JPhB...20.2481S}, \cite{1998JPhB...31L.757S}. MB83 refers to \cite{McLaughlin_1983}. Hill79 refers to \cite{Hill_1979}. MB87 refers to \cite{McLaughlin_1987}. An asterisk in the transition descriptions indicate a non-thermal particle.}} \label{fig:csec_other} \end{figure*} \subsection{Comments on \texttt{OrrallZirkerPy}} The model described above was implemented via a python package that we call \texttt{OrrallZirkerPy}, which can be used to post-process flare simulations such as \texttt{RADYN+FP}\ to obtain the non-thermal \ion{H}{1} emission resulting from bombardment of the chromosphere by non-thermal protons. This code takes as input a model atmosphere, from any source not just from \texttt{RADYN+FP}, that is the ambient hydrogen, electron, and proton number densities in cm$^{-3}$. Those can be defined either as a point, or on a depth scale. If input as a depth scale, the height of each grid cell must be provided in also (in cm). A single snapshot, or a series of snapshots can be input, where the time of each snapshot should be provided (in seconds). Additionally, the distribution of precipitating non-thermal particles must be input, (in units of particles~cm$^{-3}$~sr$^{-1}$~keV$^{-1}$), along with the energy grid on which that distribution is defined (in keV), and the pitch angle grid if the particle distribution's pitch angle is resolved. The non-thermal particle distribution should be defined on the same height and time grids as the ambient atmosphere. A default set of cross-sections is included (those described in Section~\ref{sec:csec}), defined for either a two- or three-level hydrogen atom alongside other necessary atomic information (particle mass, wavelengths, Einstein coefficients etc.,). Those defaults can be straightforwardly substituted to any cross-sections contained within the \texttt{CrossSections} module, to which the user can append any additional cross-sections. That module also contains methods to fit the data from the various sources of cross-sections. From the input atmosphere and non-thermal particle distribution, and defined cross-sections, \texttt{OrrallZirkerPy}\ solves the set of Equations~\ref{eq:nonthermpops} to obtain the non-thermal hydrogen atom level populations, where by default the final equation is replaced by the non-thermal particle conservation equation though this can be defined by the user. Using those populations the emissivity is calculated as a function of energy, and converted to a Doppler shift (in \AA\ and km~s$^{-1}$). Currently \texttt{OrrallZirkerPy}\ can model the emissivity of Ly~$\alpha$, Ly~$\beta$, and H~$\alpha$. There are further methods to return either the intensity within each grid cell, or to integrate through the entire loop to obtain the total emergent intensity. Of course, the user can integrate the emissivity over any desired height range outside of \texttt{OrrallZirkerPy}. There are plans to extend this to model non-thermal \ion{He}{2}~304~\AA\ emission, created in the same manner as non-thermal \ion{H}{1} emission, but by a precipitating $\alpha$-particle beam rather than protons. \texttt{OrrallZirkerPy}\ is available from \url{https://github.com/grahamkerr/OrrallZirkerPy/releases/tag/v1.0.1}. \section{Non-thermal Lyman Emission}\label{sec:nthmemission} Outputs from each of the \texttt{RADYN+FP}\ flare simulations were used as input to \texttt{OrrallZirkerPy}, producing the non-thermal Ly~$\alpha$\ \& Ly~$\beta$\ emission as functions of height and time, that is a non-thermal emissivity produced by the proton beam. The non-thermal intensity produced by the beam is then the integral of the emissivity through the full extent of the chromosphere. Here the general characteristics and formation properties of the non-thermal emission are presented, along with a comparison to the ambient thermal Lyman line emission. \subsection{Characteristics of Non-Thermal Ly Emission} \begin{figure*} \centering {\includegraphics[width = \textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{OZ_LymanSpecta_CompareFlux_ForPaper}} \caption{\textsl{Non-thermal spectra of Ly~$\alpha$\ (top row, panels A-C) and Ly~$\beta$\ (bottom, panels D-F) as a function of time where color represents time at $0.5$~s cadence. The black dashed line is the emission at $t=0$~s which is the moment that the proton beam first impacts the chromosphere. Each column represents a different injected energy flux (i.e. flare strength). Panels (A,D) are the 1F11 simulations, panels (B,E) are 1F10, and panels (C,F) are 1F9. The x-axis is the wavelength from the core of each line. The dotted vertical line on each panel shows $\Delta\lambda = 12$~\AA, which is the wavelength used as reference when showing various formation properties in other figures.}} \label{fig:OZSpectra_nthmonly} \end{figure*} \begin{figure} \centering {\includegraphics[width = 0.5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CFn_OZ_Lyman_LightcurvesIntegrated_CompareFlux_wref12_ForPaper}} \caption{\textsl{Lightcurves of non-thermal Ly~$\alpha$\ (solid lines) and Ly~$\beta$\ (dashed lines) integrated over the range $\Delta\lambda = [2-50]$~\AA. Black and grey are the 1F11 simulations, red and gold are the 1F10 simulations and green and blue are the 1F9 simulations.}} \label{fig:OZ_lightcurves} \end{figure} \begin{figure*} \centering {\includegraphics[width = 0.85\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CFn_OZ_Lyman_CompareFlux_ForPaper_lya}} \caption{\textsl{The emissivity on a $\log_{10}$ scale (represented by color) of non-thermal Ly~$\alpha$\ emission at $t = 0$~s (top row, A-C) and $t = 8$~s (bottom row, D-F) as functions of both wavelength from line center and height in the atmosphere. Integrating through height yields the total emergent non-thermal Lyman line intensity shown in Figure~\ref{fig:OZSpectra_nthmonly}. Each column is a different flare simulation, (A,D) are the 1F11, (B,E) are the 1F10, and (C,F) are the 1F9 flares. The $t=0$~s panels show the first instant of non-thermal emission caused by the proton beams. The sharp upper boundary represents the location of the flare transition region, above which there are insufficient neutrals to allow significant charge exchange interactions to take place (i.e. there is little to no non-thermal emission). The $t=8$~s shows a time during the heating phase where atmospheric dynamics have greatly changed the interaction of the non-thermal distribution and ambient plasma.}} \label{fig:OZSpectra_contrib1} \end{figure*} Non-thermal spectra are shown in Figure~\ref{fig:OZSpectra_nthmonly}, as functions of $\Delta\lambda$ from line center of Ly~$\alpha$\ (A-C; top row) and Ly~$\beta$\ (D-F; bottom row). Color represents time. Though there is a slight drift over time, the wavelength of peak intensity is relatively stable. For Ly~$\alpha$\ the peak is initially $\Delta\lambda = 11.4$~\AA. In the 1F11 simulation this initially rises to $\Delta\lambda = 11.6$~\AA, then shortens to $\Delta\lambda = 9.6$~\AA\ for the first few seconds, before settling to $\Delta\lambda \sim11$~\AA. The weaker simulations show less scatter, with the 1F10 simulation initially exhibiting a shortening to $\Delta\lambda = 10.6$~\AA, before settling to $\Delta\lambda = 11$~\AA\ by $t = 5.1$~s. The 1F9 shows even less scatter, though settles somewhat to a longer wavelength at $\Delta\lambda = 11.15$~\AA. Since the line core of Ly~$\beta$\ is around $\sim190$~\AA\ shorter than Ly~$\alpha$\, the non-thermal Ly~$\beta$\ emission peaks with a somewhat shorter displaceent, initially at $\Delta\lambda = 9.8$~\AA. As before, in the 1F11 flare this initially lengthens (within the first $t = 1$~s) to $\Delta\lambda = 10$~\AA, before shortening to a minimum value of $\Delta\lambda = 9.3$~\AA, finally settling at around $\Delta\lambda = 10.25$~\AA\ by $t = 5$~s. The 1F10 simulation initially has a decreasing peak to $\Delta\lambda = 9.5$~\AA, but by $t=5$~s has settled back to $\Delta\lambda = 9.8$. Finally, the 1F9 simulation settles quickly to $\Delta\lambda = 9.5$. While the variations in the Doppler shift of the peak emission are small, there is a significant change in the intensity over time, with the strongest emission occurring immediately at flare onset. At that time the non-thermal protons have reached the chromosphere and some portion of the beam is neutralized before the ambient flaring Lyman emission has brightened and before the ionization fraction increases. Non-thermal Ly~$\alpha$\ emission peaks at $I_{nthm,Ly\alpha} = [3\times10^{6}, 3\times10^{5},3\times10^{4}]$~erg~s$^{-1}$~cm$^{-2}$~sr$^{-1}$~\AA$^{-1}$, for the 1F11, 1F10, 1F9 flares respectively. Just 0.25~s later this emission has dropped significantly so that each simulation actually has a comparable peak intensity of $I_{nthm,Ly\alpha} \approx 5\times10^{3}$~erg~s$^{-1}$~cm$^{-2}$~sr$^{-1}$~\AA$^{-1}$. Over the next few seconds the 1F10 and 1F11 flares continue to drop in intensity, but then both increase to peak values of $I_{nthm,Ly\alpha} = [4\times10^{3}, 2.6\times10^{4}]$~erg~s$^{-1}$~cm$^{-2}$~sr$^{-1}$~\AA$^{-1}$, respectively. The 1F9 simulation instead continues to decrease, such that by $t=10$~s, $I_{nthm,Ly\alpha} = 4.25\times10^{2}$~erg~s$^{-1}$~cm$^{-2}$~sr$^{-1}$~\AA$^{-1}$. This temporal evolution can be more clearly seen in Figure~\ref{fig:OZ_lightcurves}, which shows lightcurves integrated over the range $\Delta\lambda = [2-50]$~\AA. Non-thermal Ly~$\beta$\ emission behaves similarly, with the following peak intensities: at $t = 0$~s for 1F11, 1F10, and 1F9, $I_{nthm,Ly\beta} = [6.4\times10^{5}, 6.4\times10^{4},6.4\times10^{3}]$~erg~s$^{-1}$~cm$^{-2}$~sr$^{-1}$~\AA$^{-1}$; at $t = 0.25$~s all flares have a peak near $I_{nthm,Ly\beta} \approx 1.16\times10^{3}$~erg~s$^{-1}$~cm$^{-2}$~sr$^{-1}$~\AA$^{-1}$; at $t = 10$~s for 1F11, 1F10, and 1F9, the peaks intensities are $I_{nthm,Ly\beta} = [2.9\times10^{3}, 6.5\times10^{2},8.8\times10^{1}]$~erg~s$^{-1}$~cm$^{-2}$~sr$^{-1}$~\AA$^{-1}$. Lightcurves of Ly~$\beta$\ are shown as dashed lines on Figure~\ref{fig:OZ_lightcurves}, indicating that non-thermal Ly~$\beta$\ emission follows the temporal pattern of Ly~$\alpha$, but is weaker. \begin{figure*} \centering {\includegraphics[width = 0.85\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CFn_OZ_Lyman_CompareFlux_ForPaper_lyb}} \caption{\textsl{Same as Figure~\ref{fig:OZSpectra_contrib1} but showing non-thermal Ly~$\beta$\ emission.}} \label{fig:OZSpectra_contrib3} \end{figure*} \subsection{Formation Properties of Non-Thermal Ly Emission} To better understand the non-thermal emission characteristics we look at where in the atmosphere this emission forms, and what the plasma properties are at those times. Figures~\ref{fig:OZSpectra_contrib1} and \ref{fig:OZSpectra_contrib3} show the emissivity of non-thermal Ly~$\alpha$\ and Ly~$\beta$, respectively, for each simulation (1F11, 1F10, 1F9 for each column left-to-right), as functions of height and wavelength, at $t = 0$~s (top rows), and $t = 8$~s (bottom rows). Integrating through height for each wavelength yields the total emergent intensity. Initially, there is a broad emitting region around the peak wavelengths, spanning a few tens of km (note the log scale on the color bar of these images). Very quickly the intensity drops, and the altitude of peak emissivity shifts deeper, more so for the stronger flare. By the latter stages of the simulation, emission from the stronger flares forms over a vanishingly narrow extent, and form progressively deeper, whereas the 1F9 simulation has a broader emitting region located at higher altitude. \begin{figure} \centering \vbox{ \hbox{ \subfloat{\includegraphics[width = .5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CFn_OZ_Lyman_CompareFlux_wref12_ForPaper_0000}} } } \vbox{ \hbox{ \subfloat{\includegraphics[width = .5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CFn_OZ_Lyman_CompareFlux_wref12_ForPaper_0001}} } } \vbox{ \hbox{ \subfloat{\includegraphics[width = .5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CFn_OZ_Lyman_CompareFlux_wref12_ForPaper_0002}} } } \caption{\textsl{The emissivity as a function of height for a wavelength $\Delta\lambda = 12$~\AA\ from line cores of Ly~$\alpha$\ (first column, panels: A,C,E) and Ly~$\beta$\ (second column, panels: B,D,F) for three different times. Color represents the flare strength, with the black solid line being the 1F11 simulation, the red dashed line being the 1F10 simulation, and the green dot-dashed line being the 1F9 simulation.}} \label{fig:OZSpectra_contrib_wref} \end{figure} Selecting a reference wavelength of $\Delta\lambda = 12$~\AA, Figure~\ref{fig:OZSpectra_contrib_wref} shows a more detailed view of the stratification of emissivity. Here we see that the emissivity initially drops through the mid-upper chromosphere, but the lower atmosphere does not vary greatly. In the stronger simulations the peak emissivity rebounds, regaining some strength while the peak height occurs deeper and deeper. Once it has rebounded, though, the peak region is vanishingly narrow compared to the broader emitting region of the 1F9 simulation. Following \cite{2017ApJ...836...12K} we construct the normalized cumulative distribution function of the emissivity through height $NCDF_{j}(z)$, and define the emitting region as the region bounded by $NCDF_{j}(z)=0.05$ and $NCDF_{j}(z)=0.95$; that is, the region where the bulk of the emergent intensity originates. Labelling these heights as $z_{upp}$ and $z_{low}$, the mean formation height can be found by \begin{equation} <z> = \frac{\int_{z_{low}}^{z_{upp}}j(z)~z~\mathrm{d}z}{\int_{z_{low}}^{z_{upp}}j(z)\mathrm{d}z}, \label{eq:avz} \end{equation} \noindent where we weight by the emissivity. This is shown for $\Delta\lambda = 12$~\AA\ in Figure~\ref{fig:OZSpectra_formheights}, where we see that non-thermal emission for the stronger flares forms significantly deeper in the atmosphere compared to the 1F9 simulation, which barely changes in altitude. Both Lyman lines form essentially at the same altitude. If we then take the width of the formation region to be $\Delta z = z_{upp} - z_{low}$, shown in panel (B), we see that for the two stronger flares when the non-thermal Lyman emission intensity drops in strength, the formation region widens up to $100-150$~km. Over time, the widths of the formation region drop to only a few km, or down to metres, at which times the magnitude of the non-thermal intensity has risen somewhat but is not as strong as at the early phase of the flare. The weaker flare, however, exhibits a gradually increasing $\Delta z$ such that the non-thermal Ly~$\beta$\ emission originates from a somewhat broader region. \begin{figure} \centering \vbox{ \hbox{ \subfloat{\includegraphics[width = .5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CFn_OZ_Lyman_MeanFormHeight_CompareFlux_wref12_ForPaper}} } } \vbox{ \hbox{ \subfloat{\includegraphics[width = .5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CFn_OZ_Lyman_MeanFormWidth_CompareFlux_wref12_ForPaper}} } } \caption{\textsl{Panel (A) shows the mean formation height of $\Delta\lambda = 12$~\AA\ from line cores of Ly~$\alpha$\ (solid lines) and Ly~$\beta$\ (dashed lines) as a function of time. The black and grey lines show the 1F11 simulation, the red and gold lines show the 1F10 simulation, and the green and blue lines show the 1F9 simulation. Panel (B) shows the widths of the formation region, where colors and lines are the same as panel (A).}} \label{fig:OZSpectra_formheights} \end{figure} Performing a similar calculation to obtain the mean ionization fraction in the non-thermal emission forming region we can understand the patterns we see above. The mean ionization fraction is: \begin{equation} <\chi_{H}> = \frac{\int_{z_{low}}^{z_{upp}}j(z)~\chi_{H}~\mathrm{d}z}{\int_{z_{low}}^{z_{upp}}j(z)\mathrm{d}z}. \label{eq:avion} \end{equation} \noindent These results are shown in Figure~\ref{fig:OZSpectra_ionfrac}. For the 1F11 simulation, the mean ionization fraction initially drops before peaking close to unity. Recall, though, that this is the mean over the full formation region, and that the formation region of the 1F11 non-thermal emission rapidly broadened, such that a larger fraction of the lower atmosphere influences the mean. The ionization fraction in the upper chromosphere has, however, increased. Consequently there are fewer charge exchange interactions, which require a supply of neutrals, and the non-thermal emissivity drops. As the temperature in the mid-upper chromosphere climbs, the ionization fraction climbs and emissivity continues to fall. However, as we noted before there is a rebounding of non-thermal emission in the 1F11 simulation. This occurs due to the severe compression of the chromosphere. The proton beam encounters a fresh supply of neutrals once the transition region is pushed deeper, which picks up pace after a few seconds. At these times $<\chi_{H}>$ is only somewhat larger than at the time of peak emission, but crucially, the formation region width $\Delta z$ is significantly reduced (itself due to where protons are predominantly thermalized by the increase in atmospheric density there). Consequently, integrating the emissivity through height produces only a modest total intensity. The 1F10 simulation behaves similarly and with the same end result, though in less dramatic fashion, only achieving a maximum ionization fraction of $<\chi_{H}> \approx 0.6$. Since the atmospheric dynamics are less extreme in the 1F9 flare, the reduction in emissivity is smaller compared to the drop seen in the strong flares, owing to the smaller increase in ionization fraction. While the peak emissivity continues to drop due to the increasing ionization fraction, the formation region widens due to lack of compression in the chromosphere, which combats the decreasing peak. A gradually declining emergent intensity results. \begin{figure} \centering {\includegraphics[width = 0.5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CFn_OZ_Lyman_IonFrac_CompareFlux_wref12_ForPaper}} \caption{\textsl{The mean hydrogen ionization fraction in the formation region of $\Delta\lambda = 12$~\AA\ from line cores of Ly~$\alpha$\ (solid lines) and Ly~$\beta$\ (dashed lines) as a function of time. The black and grey lines show the 1F11 simulation, the red and gold lines show the 1F10 simulation, and the green and blue lines show the 1F9 simulation.}} \label{fig:OZSpectra_ionfrac} \end{figure} Finally, to confirm that the rising ionization fraction is met by a reduction in the number of charge exchange interactions (and hence emissivity of non-thermal emission) we show, in Figure~\ref{fig:OZSpectra_CXrate}, the product of the charge exchange rate to the ground state and the non-thermal proton population at an energy equivalent to a Doppler shift of $\Delta\lambda = 12$~\AA. Each panel represents a different simulation and the color of each line is a different snapshot within that simulation. As expected, we see the same patterns as found for the emissivities. In summary, although the non-thermal emission is initially very strong, with intensity directly related to the strength of the flare (due to the number of non-thermal protons injected), the increase in ionization fraction rapidly reduces the intensity. In the case of the stronger flares, the compression of the atmosphere results in a slight rebounding of intensity as the beam encounters new neutrals, but since this happens in a very narrow extent the emergent intensity never reaches that of the onset. \begin{figure*} \centering {\includegraphics[width = \textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CFn_OZ_Lyman_CXRates_CompareFluxTimes_ForPaper}} \caption{\textsl{The rate of charge exchange interactions to the ground state, at the energy responsible for producing a Doppler shift of $\Delta\lambda = 12$~\AA\ from Ly~$\alpha$, as a function of height, for 4 times (black is $t=0$~s, red is $t=1$~s, blue is $t=3$~s, and gold is $t=10$~s) in each simulation. Panel (A) is the 1F11 simulation, (B) is 1F10, and (C) is 1F9.}} \label{fig:OZSpectra_CXrate} \end{figure*} \subsection{Comparison to Ambient Solar Flare Ly Emission} \begin{figure*} \centering \hbox{ \subfloat{\includegraphics[width = .5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{OZ_SummedEmission_LyBeta_small_wOVI_ForPaper_V3}} \subfloat{\includegraphics[width = .5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{OZ_SummedEmission_LyAlpha_small_ForPaper_V3}} } \caption{\textsl{Ambient flare emission (greyscale; darkest is 1F11, lightest is 1F9) surrounding the Ly~$\beta$\ (left column) and Ly~$\alpha$\ (right column) lines, compared to the total emission (ambient summed with the non-thermal Lyman lines from the OZ effect), shown in colored lines (blue is 1F11, red is 1F10, and gold is 1F9). Each row shows a snapshot during the flare. }} \label{fig:OZSpectra_summedemission} \end{figure*} \begin{figure} \centering \vbox{ \subfloat{\includegraphics[width = .5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CFn_OZ_Lyman_lightcurves_r1_wOVI_ForPaper_V3}} } \vbox{ \subfloat{\includegraphics[width = .5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CFn_OZ_LymanAlpha_lightcurves_r2_wOVI_ForPaper.pdf}} } \vbox{ \subfloat{\includegraphics[width = .5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CFn_OZ_Lyman_lightcurves_r1_wOVI_ForPaper_V3diff.pdf}} } \caption{\textsl{The temporal evolution of non-thermal OZ emission + thermal emission (colored lines; blue is 1F11, red is 1F10, and gold is 1F9), compared to the evolution of thermal emission alone (greyscale; darkest is 1F11, palest is 1F9). Clearly, strong OZ enhancements are short-lived, persisting only a fraction of a second in the strongest flare (1F11), and only a few seconds in the weakest simulation (1F9). Panel (A) shows Ly~$\alpha$\ integrated between $[12.5-13.5]$~\AA, and panel (B) shows Ly~$\beta$\ integrated between $[8.5-9.5]$~\AA. Panel (C) shows the contrast between non-thermal and thermal emission for Ly~$\beta$\ integrated between $[8.5-9.5]$~\AA, scaled to focus on the latter part of the simulations, illustrating that after the initial onset, the differences drop substantially.}} \label{fig:OZSpectra_summedemission_lcurve} \end{figure} Now that we understand the temporal characteristics of the non-thermal Lyman line emission, the natural question is can we observe it over and above the ambient Lyman line emission? Summing thermal and non-thermal Lyman line emission, and comparing to the thermal by itself, shows us that this is likely going to be a very difficult detection to make. Figure~\ref{fig:OZSpectra_summedemission} shows those comparisons, where colored lines show the sum (gold is 1F9, red is 1F10, and blue is 1F11) and greyscale shows the ambient emission. The left column is Ly~$\beta$, and the right is Ly~$\alpha$, with each row showing a different time. At flare onset the emission is orders of magnitude above the background, but this is only true for a very short time. By $t=0.5$~s in the 1F11 simulations the combination of the strong enhancement of the background emission and the reduction in non-thermal emission makes it difficult to distinguish the non-thermal feature, which is now only a small factor larger than the thermal emission, not an order of magnitude. Non-thermal emission can still be distinguished in the 1F10 simulation and in the 1F9 simulation. It is only in the weakest flare simulation (1F9), however, that the non-thermal emission can be seen easily against the background by $t=3-5$~s. It is easier to do so for the Ly~$\beta$\ line owing to the smaller wings and less intense nearby emission. At later times the difference between thermal and non-thermal emission in the 1F9 simulation is also likely too small to easily detect. Integrating over a region of the spectrum where non-thermal emission appears, which is free of strong lines, and comparing to the same region in the simulations without non-thermal OZ emission illustrates these timescales. Figure~\ref{fig:OZSpectra_summedemission_lcurve} shows these lightcurves, with the same color scales as Figure~\ref{fig:OZSpectra_summedemission}, where panel (A) shows Ly~$\beta$\ and panel (B) shows Ly~$\alpha$. In those figures compare the following pairs of lines: blue solid with black dashed (F11), red solid with dark grey dashed (1F10), and gold solid with light grey dashed (1F9). After a short time each solid line is only some small factor above their greyscale counterpart. In all cases the Ly~$\beta$\ non-thermal emission shows a larger contrast to the thermal emission alone. Figure~\ref{fig:OZSpectra_summedemission_lcurve}(C) shows the contrast introduced by the non-thermal emission. That is, ($I_{total} - I_{ambient})/I_{ambient}$. The scale on that figure has been chosen to illustrate the contrasts present at later times in the simulations ($>10$~s), where the 1F11 is only around $\sim2.5$\%, compared to $\sim15$\% for 1F10 and $30$~\% for 1F9. \begin{figure*} \centering \vbox{ \hbox{ {\includegraphics[width = 0.5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CFn_OZ_Lyman_Asymmetry_r1_wOVI_ForPaper_V3}} {\includegraphics[width = 0.5\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CFn_OZ_Lyman_Asymmetry_r2_wOVI_ForPaper_V3}} } } \vbox{ {\includegraphics[width = 0.65\textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{CFn_OZ_Lyman_Asymmetry_showregion_wOVI_ForPaper_V3}} } \caption{\textsl{The red-blue (RB) wing asymmetries, $A$, of Ly~$\beta$\ with (solid colored lines; gold is the 1F9 flare, red is the 1F10 flare, and blue is the 1F11 flare) and without (dashed greyscale; darkest is 1F11, palest is 1F9) non-thermal emission. Panel (A) shows $A$ determined from $\Delta\lambda \pm [8.5-9.5]$~\AA, and panel (B) shows $A$ from $\Delta\lambda \pm [12-13]$~\AA. Panel (C) shows the line emission at $t=2$~s, indicating the regions selected (shaded grey regions bounded by dotted lines) for the asymmetry calculation.}} \label{fig:asymms} \end{figure*} If the intensity in the region near the Lyman lines is only a small factor larger than it would otherwise be due to the presence of non-thermal emission then it is problematic to unambiguously observe, especially if the signal-to-noise of the photometry is small. Asymmetries present between the red and blue line wings, caused by the presence of non-thermal emission only redward of the line cores, may help us more clearly identify the non-thermal emission beyond the first few seconds of heating in each the footpoint. To quantify these asymmetries we define the asymmetry as \begin{equation} A = \frac{I_{R} - I_{B}}{I_{R} + I_{B}}, \end{equation} \noindent where $I_{R}$ and $I_{B}$ are the intensities integrated over some $\Delta \lambda$ from line center in the red and blue wings, respectively. This is illustrated for Ly~$\beta$\ in Figure~\ref{fig:asymms}, for two values of $\Delta \lambda$. Those two regions are mostly free of strong lines: (1) $\Delta\lambda\pm [12.5-13.5]$~\AA\ and (2) $\Delta\lambda\pm [8.5-9.5]$~\AA. In the $\Delta\lambda\pm [8.5-9.5]$~\AA\ region, very quickly ($t>0.5$~s) the large asymmetry present in strongest flare footpoint (F11) disappears, and approaches the value to be expected from ambient Ly~$\beta$\ emission. Similarly, the 1F10 asymmetry decreases sharply after $t\sim1-2$~s, but does remain somewhat above the asymmetry present in the ambient emission. The asymmetry of the 1F9 flare shows a more gradual decrease out to $t\sim5-6$~s, and does lie above the background throughout the heating phase. The maximum asymmetry in the ambient flare emission around $\Delta\lambda\pm [8.5-9.5]$~\AA\ was $A\sim[0.02-0.04]$. After 10s or so the asymmetries caused by the addition of non-thermal emission were on the order $A\sim[0.14, 0.08, 0.06]$ for 1F9, 1F10, and 1F11 simulations, respectively. For the two weaker flares these do seem comfortably above the typical ambient asymmetries. Careful study of the typical asymmetries in observations is needed to indicate if these small excess asymmetries caused by the non-thermal emission at later times is indeed detectable. In the $\Delta\lambda\pm [12.5-13.5]$~\AA\ region, the initial very large asymmetries are also present, but some small lines in the region makes the asymmetry more influenced by ambient flare emission. A more rigorous study when using actual observations could remove these lines, and we show our simple asymmetry calculation just to indicate that the very large asymmetry at the onset of particle precipitation into each footpoint should appear in multiple locations along the spectrum, even with the influence of these other features. \section{Solar Orbiter / SPICE Predictions}\label{sec:spice} \begin{figure*} \centering {\includegraphics[width = \textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{OZ_SummedEmission_SPICERes_tau1s_wOVI_ForPaper_V3}} \caption{\textsl{Comparing the level of non-thermal Ly~$\beta$\ emission to ambient emission around the Ly~$\beta$\ line for each of our three simulations, degraded to SPICE resolution assuming $\tau_{exp} = 1$~s, and slit width of $2^{\prime\prime}$. In each panel black is the ambient emission (i.e. without OZ emission), and the colored lines are the sum of ambient plus OZ emission. The top row shows 1F11 (blue), the middle show shows 1F10 (red), and the bottom row shows 1F9 (gold). As discussed in the text, in these synthetic observations there is $10$~s of pre-flare to facilitate averaging over exposure time, so that the flare starts at $t=10$~s here. Three consecutive exposures, starting at flare onset, are shown demonstrating the very transient nature of non-thermal emission, that does outshine the ambient emission for a brief time around and between the \ion{O}{6} doublet at 1032~\AA\ \& 1038~\AA.}} \label{fig:OZSpectra_SPICEres_1s} \end{figure*} \begin{figure*} \centering {\includegraphics[width = \textwidth, clip = true, trim = 0.cm 0.cm 0.cm 0.cm]{OZ_SummedEmission_SPICERes_tau5s_wOVI_ForPaper_V3}} \caption{\textsl{Same as Figure~\ref{fig:OZSpectra_SPICEres_1s}, but for SPICE exposures with $\tau_{exp} = 5$~s.}} \label{fig:OZSpectra_SPICEres_5s} \end{figure*} \subsection{The Spectral Imaging of the Coronal Environment (SPICE) Instrument} The SPICE instrument \citep{2020A&A...642A..14S} on board Solar Orbiter observes the Sun spectroscopically in the EUV in two passbands, the short-wavelength channel (SW; $\lambda = [700-792]$~\AA) and long-wavelength channel (LW; $\lambda = [970-1053]$~\AA), the latter of which includes the Ly~$\beta$\ and \ion{O}{6} doublet. Though flare ribbons have, at the time of writing, not yet been observed by SPICE, this instrument does offer the best hope of detecting the OZ effect. SPICE offers relatively high temporal resolution, with typical exposure times for dynamic studies of $\tau_{exp} = [1,5]$~s, and can also provide spatial information within the flare ribbons, unlike the Sun-as-a-star Ly~$\beta$\ observations from the EUV Variability Experiment \citep[EVE;][]{2012SoPh..275..115W}, onboard SDO. Solar Orbiter has tight telemetry and observing constraints, owing to the uniqueness of its orbit, and most remote sensing observations take place during 30 day windows during each perihelion. These constraints limit the time available for flare observations. However, Solar Orbiter's observing program does include targeting active region and flares, making it worth determining if SPICE would be able to detect the transient OZ effect. \subsection{Degrading to SPICE Resolution} The ambient plus non-thermal emission in the region around the Ly~$\beta$\ line in each simulation was degraded to SPICE level-2 count rates, assuming two exposure times of $\tau_{exp} = [1,5]$~s, and that a sit-and-stare observing mode was used (i.e. continuous observation of a single source). Here, level-2 refers to the science-ready data provided to the community by the SPICE team, in which a common wavelength dispersion, spectral resolution and other properties are applied. The data for the following steps were obtained from both \cite{2020A&A...642A..14S} and from the information provided by the SPICE consortium following the second data release \citep{SPICE_DR2}. The pre-flare ambient Ly~$\alpha$\ emission was repeated for $10$~s at a cadence of $\delta t = 0.25$~s, and added to the original simulation time series, so that the flare footpoint heating phase in our synthetic SPICE observations was between $t_{spice}=[10-30]$~s. This new time series was degraded to SPICE resolution as follows. For each $0.25$~s snapshot, the wavelength scale was recast to the SPICE spectral plate scale ($0.09623$~\AA~pixel$^{-1}$), and the emission smeared by a spectral point spread function (PSF) assumed to be a Gaussian with full width at half maximum (FWHM) of 9.4 SPICE wavelength pixels. This was converted from an energy flux to a photon flux (using $hc/\lambda$ as the energy per photon for each SPICE wavelength bin). Our simulated intensities are per solid angle, which was removed by multiplying out the solid angle subtended by a pixel along the SPICE slit, where we assumed the $2^{\prime\prime}$ wide slit was being used (SPICE also has $4^{\prime\prime}$, $6^{\prime\prime}$, and $30^{\prime\prime}$ slits). The spatial plate scale along the slit is $1.098^{\prime\prime}$. We did not apply any spatial PSF at this stage as this would require making a number of assumptions about the ribbon width and elongation. The emission was multiplied by the effective area of the LW channel, which can be seen in Figure 24 of \cite{2020A&A...642A..14S}. From this output in photons~s$^{-1}$~pixel$^{-1}$ we then integrated the emission in time for each our modelled exposure times (ignoring the readout time, which is up to $0.42$~s if the full detector is read, but shorter if only a subset of lines and slit pixels are read). Poisson noise was added to the intensities in photons~pixel$^{-1}$, which were then converted to DN~pixel$^{-1}$ assuming 7.5~DN~photon$^{-1}$. \subsection{Can SPICE Detect OZ Emission?} Performing the same exercise as we did earlier to compare the sum of thermal to non-thermal emission to just the ambient emission, but this time degrading each to SPICE resolution, indicates that SPICE does offer the potential for a detection of the OZ effect. Figure~\ref{fig:OZSpectra_SPICEres_1s} shows our experiment assuming $\tau_{exp} = 1$~s. The top row is the 1F11 flare footpoint, the middle row is the 1F10 flare footpoint, and the bottom row is the 1F9 flare footpoint. Each column shows a different snapshot (recall that here the flare starts at $t=10$~s). Since the non-thermal emission at flare onset is so much larger than the ambient emission, the red-shifted feature is quite evident. It is only clearly present for one frame in the strongest flare, but persists for two frames in the 1F10 and 1F9 flares. Even if we use a longer exposure time of $\tau_{exp} = 5$~s (Figure~\ref{fig:OZSpectra_SPICEres_5s}), the emission is clearly visible in each flare for one frame. Whilst acknowledging the very transient nature of the OZ features, these results are encouraging. Depending on the orientation of the slit to the flare ribbon propagation direction we might expect to see a propagation of the redshifted feature in consecutive frames, in effect tracking the ribbon front (where energy is first deposited when new field lines reconnect). For this experiment we varied the exposure time, but there are other considerations such as the slit width. Increasing the slit width will gather more photons, increasing the signal-to-noise, which might be necessary as the instrument response degrades over the course of the mission. The obvious downside is reduction of spatial resolution but this might become a necessary tradeoff. Similarly, we did not bin in the spectral direction, but since we are looking for a broad feature we can likely safely increase count rates that way. \section{Summary \& Conclusions}\label{sec:conc} New and upcoming observatories are set to provide Lyman line observations in flares, for example from Solar Orbiter/EUI (Ly~$\alpha$; though imaging without spectra), Solar Orbiter/SPICE (Ly~$\beta$), Solar-C/EUVST (Ly~$\alpha$), ASO-S Ly~$\alpha$, and the SNIFS sounding rocket (Ly~$\alpha$). Further, Ly~$\alpha$\ profiles from line scans observed by SORCE/SOLTICE are now available, and SDO/EVE sun-as-a-star observations cover the Ly~$\beta$\ lines but have been relatively little studied. Given the potential of new solar flare Lyman line observations, and the existence of untapped datasets, alongside recent important improvements to flare radiation hydrodynamic modelling (namely proton beam-driven flares including warm-target effects), we have revisited the possibility of using the Ly~$\alpha$\ and Ly~$\beta$\ lines to detect the presence of deka-keV non-thermal protons in the flaring chromosphere. To achieve this revisit of the Orrall-Zirker effect, we employ modern atomic cross-sections, and state-of-the-art numerical flare models, initially focussing on the impact of varying the magnitude of energy deposited into each footpoint. Our results have demonstrated that while a very difficult detection, accelerated protons present in the flaring chromosphere could produce transient non-thermal Lyman line emission lying above the ambient flare emission, following neutralisation of some fraction of the proton beam via charge exchange. In our model, a precipitating population of non-thermal protons is injected at the apex of a flare loop, assumed to be vertical and near disk-center. The transport and thermalisation of these particles is modelled using the \texttt{FP}\ code, with energy lost through Coulomb collisions heating the plasma, the evolution of which was modelled using the radiation hydrodynamics code \texttt{RADYN}. Together \texttt{RADYN+FP}\ provided the non-equilibrium ionization stratification and non-thermal proton distribution function over time during our flare simulations, vital improvements over previous attempts to model the OZ effect. These were used as input to a new package developed by us, \texttt{OrrallZirkerPy}, that models the effects of the neutralisation of some fraction of the non-thermal proton distribution via charge exchange interactions between the beam and ambient plasma. This new population of energetic neutral atoms subsequently emits extremely redshifted photons of Ly~$\alpha$\ and Ly~$\beta$. Our model is open-source and freely available, and can be used to study OZ hydrogen emission given any ambient plasma stratification and non-thermal proton distribution. That is, it is flexible and can be used with inputs resulting from codes other than \texttt{RADYN+FP}, or from toy models, and could potentially be adapted to investigate similar processes on Martian aurorae as observed by MAVEN \citep[e.g.][]{2019JGRA..12410533H}. It was found that, contrary to expectations based on the first calculations of \cite{1976ApJ...208..618O} and \cite{1985ApJ...295..275C}, this broad non-thermal `bump' in the red wings of Ly~$\alpha$\ and Ly~$\beta$\ will be noteable only for an extremely short time in strongly heated flare footpoints (sub-second), but noteable emission will persist for somewhat longer ($t\sim3-5$~s) in weaker flare footpoints. This is due to the rapid ionization of the atmosphere, quenching charge exchange interactions. Though in the strongly heated flare footpoints the precipitating protons push ever-deeper (due to warm-target effects), thus encountering a fresh supply of ambient neutrals, the compression of the atmosphere means that the emitting layer is narrow and the emergent intensity weak compared to the initial burst of non-thermal emission. Coupled to the fact that emission from the thermal Ly~$\alpha$\ and Ly~$\beta$\ wings and nearby continuum becomes enhanced, the non-thermal emission does not stand out from the background after a short time. That said, the asymmetries caused by non-thermal emission did persist, and for the 1F9 and 1F10 simulations they are $\gtrsim2$ that of the largest ambient asymmetries. These could potentially be observable by high-cadence instruments with high signal-to-noise. Degrading our synthetic emission to the resolution of the SPICE instrument onboard Solar Orbiter indicates that for short exposure times ($\tau_{exp} \le 5$~s, though ideally $\tau_{exp} \le 1$~s) it should be possible to observe the presence of non-thermal Ly~$\beta$\ emission, albeit for only one or two consecutive frames. Perhaps focusing on the leading edge of flare ribbons in small-to-moderate flares offers the best chance of detection. These are the locations of initial energy deposition, representing a `pristine', not yet ionized target, and recent modelling results indicate that flare ribbon fronts likely undergo injection by a relatively weak energy flux \citep[e.g.][]{2022arXiv221105333P}. Since the initial onset of non-thermal emission is so large compared to the pre-flare, even a stronger flare source should be detectable in one SPICE exposure at each ribbon location (though obviously this presents a difficult observation to obtain). Very high cadence imaging, if a sufficiently broad passband is used, might also reveal this non-thermal emission as a transient flash, followed by a decay and further brightening. In general, to detect and fully exploit these signatures as diagnostics during flares we need an instrument capable of high signal-to-noise, exceptional cadence (0.1~s) and very high spatial resolution (certainly sub-arcsecond). There are a number of fruitful avenues for investigation beyond this exploratory initial study. Here we have compared the magnitude of injected energy, but not the other parameters that define the non-thermal proton distribution. As indicated by prior investigations \citep[][]{1985ApJ...295..275C, 1999ApJ...514..430B} varying $E_{c}$ and $\delta$ should result in changes to the appearance of the broad non-thermal feature. Therefore using \texttt{OrrallZirkerPy}\ and a large number of \texttt{RADYN+FP}\ flare models, the influence of those parameters can be investigated. Extension to stellar flares, including modelling synthetic Hubble Space Telescope observables is also an exciting direction, especially given that the only confirmed detection of the OZ effect thus far has been on a dMe star \citep{1992ApJ...397L..95W} and that follow on searches produced null detections \citep[e.g.][]{1993ApJ...414..872R,2022AJ....164..110F}. There are of course model limitations and idealisations that can be improved upon, such as modelling multi-species particle beams\footnote{If both energetic electrons and protons bombard a chromsopheric footpoint then ionization may be more rapid. Multi-species beams are are novel experiments that have yet to be performed, but which are now possible with very recent updates to \texttt{RADYN+FP}.}, and moving away from the assumptions of a near disk-center vertical beam. Finally, we speculate that the ratio of the \ion{O}{6} doublet may vary in the presence of highly redshifted Ly~$\beta$\ emission. These lines are formed by both collisional processes as well as resonant scattering of chromospheric radiation \citep[e.g. see discussions in][]{2000JGR...105.2345S,2004ApJ...606L.159R}. Pumping of the \ion{O}{6} 1032~\AA\ line by Ly~$\beta$\ during fast coronal mass ejections (CMEs), and the resulting change to the $I_{1032}:I_{1038}$ ratio has been exploited to estimate the electron density during a CME \citep[][]{2004ApJ...606L.159R}. A similar effect may occur in our OZ scenario, with pumping of \ion{O}{6} 1032~\AA\ by the proton beam-produced Ly~$\beta$\ emission observable as a transient variation of the \ion{O}{6} doublet ratio. Characteristics of this change to the doublet ratio could also be diagnostically useful, since it presumably would vary depending on properties of the non-thermal component, which itself varies with properties of the injected non-thermal proton distribution. Further study of this would require more advanced modelling of the \ion{O}{6} doublet than we have performed here, but would be a very interesting endeavour. \textsc{Acknowledgments:} \small{We thank the anonymous referee for their insightful comments. GSK acknowledges the financial support from a NASA Early Career Investigator Program award (Grant\# 80NSSC21K0460). GSK and ROM acknowledge financial support from the Heliophysics Supporting Research program (Grant\# 80NSSC21K0010). JCA, NZP, TAK and JWB acknowledge NASA funding for the SPICE instrument team at GSFC. NZP and JWB were funded through cooperative agreement 80NSSC21M0180. JCA acknowledges funding through NASA's Heliophysics Supporting Research and Heliophysics Innovation Fund programs. HSH is grateful for the hospitality of the School of Physics and Astronomy at the University of Glasgow. This manuscript benefited from discussions held at a meeting of International Space Science Institute team: ``Interrogating Field-Aligned Solar Flare Models: Comparing, Contrasting and Improving,'' led by Dr. G. S. Kerr and Dr. V. Polito. The authors thank Dr. William Thompson for helpful discussions regarding SPICE. Solar Orbiter is a space mission of international collaboration between ESA and NASA, operated by ESA. The development of SPICE has been funded by ESA member states and ESA. It was built and is operated by a multi-national consortium of research institutes supported by their respective funding agencies: STFC RAL (UKSA, hardware lead), IAS (CNES, operations lead), GSFC (NASA), MPS (DLR), PMOD/WRC (Swiss Space Office), SwRI (NASA), UiO (Norwegian Space Agency). Resources supporting this work were provided by the NASA High-End Computing (HEC) Program through the NASA Advanced Supercomputing (NAS) Division at Ames Research Center.} \bibliographystyle{aasjournal}
\section{Introduction} The Internet of Things (IoT) is the network between physical devices and cyberspace, such as smart ring bells, smart light bulbs, surveillance cameras, thermostats, smart medical devices, and traffic control systems. It is the automation of all kinds of devices. IoT is also considered a communication system that is interconnected via wireless or wired communication technologies~\cite{hussain2020machine}. The main concept of the Internet of things first appeared in 1982 through the Carnegie Mellon University project that modified a Coca-Cola vending machine to be able to report the machine inventory and whether newly loaded drinks were cold or not~\cite{machine2014only}. This idea became the first ARPANET-connected appliance~\cite{machine2014only}. Then, in 1999, Kevin Ashton from Procter and Gamble Cooperation (P\&G) coined the term "Internet of Things" to describe the system where the physical world connected to the Internet via ubiquitous sensors~\cite{ashton2009internet}. \begin{figure}[t] \centerline{\includegraphics[width=5cm,height=4cm]{./IoT_architecture.jpg}} \caption{The three layered architecture framework of the IoT security~\cite{azumah2021deep}.} \label{IoT_architecture} \end{figure} Regardless of the simple design of the IoT device, it contains a complex architecture, connection layers, and network components that transfer data and requires a robust security architecture design~\cite{hassija2019survey}. As the number of different types of applications and cloud-based systems involve IoT, the security threats on IoT inherently grow. Further, one of the most critical issues of the Internet of Things (IoT) systems has become security due to IoT hardware and software resource limitations~\cite{sandell2018application}. Maintaining the security of IoT devices is crucial since IoT devices may contain sensitive data such as a user's personal information, location, and activity. \begin{figure*}[t] \centerline{\includegraphics[width=11cm,height=6cm]{./IoT_botnet_overview.png}} \caption{A diagram of how the IoT botnet attack is performed.} \label{IoTBotnet_Overview} \end{figure*} Distributed Denial of Service Attack (DDoS) is one of the most common attacks on IoT devices~\cite{abomhara2015cyber,meneghello2019iot,kolias2017ddos}. Such attacks are primarily performed using different IoT botnets, a group of computers that have been infected by malware and come under the control of a malicious actor. Botnets can be designed to accomplish illegal or malicious tasks, including sending spam, stealing data, ransomware, fraudulently clicking on ads, or distributed denial-of-service (DDoS) attacks. Mirai, Omni, EmemyBot, Persirai, and Hide'n Seek are examples of such botnets~\cite{kolias2017ddos,mcnulty2022iot}. Network security monitoring and IoT botnet detection systems are crucial to prevent such malicious attacks~\cite{zaghloul2021green,soltan2018blackiot,elsayed2021autonomous}. In this paper, we proposed an ecomonic deep learning based model for IoT botnet detection. The proposed model achieves a significant accuracy to detect IoT botnets using a significant smaller implementation budget compared to the state-of-the-art models. The contribution of this paper can be summarized as follows: 1) We proposed an IoT botnet detection system that can classify the botnet attack category and sub category using deep learning. 2) The proposed model reduce the implemenration budget by approximate 76\% compared to the current state-of-the-art models in addition to increasing the detection performance. This paper's structure is as follows: Section~\ref{IoT_layers} describes the IoT architecture components. Section~\ref{IoT_botnets} describes the IoT botnets and the IoT botnet attacks threats. Section\ref{proposed_model} describes the proposed model components and architecture. Finally, Section~\ref{results_section} provides the experimental results and analysis of the proposed IoT botnet detection model. \section{IoT Security Layers}\label{IoT_layers} The IoT security layered architecture consists of three layers: the physical/perception layer, the network layer, and the application layer. Figure~\ref{IoT_architecture} demonstrated the IoT security architecture layers. The perception layer contains the physical component of the IoT environment, including the sensors and different sensing devices. The network layer consists of the network devices, servers, and the smart things of the IoT. The application layer is responsible for providing the user with specific services via different applications~\cite {sethi2017internet}. \subsection{Botnets}\label{IoT_botnets} The IoT botnet consists of two primary components and an additional (optional) component. The first primary component is the Bot itself which can be an agent or an end zombie IoT device that performs the DDoS attacks on a command~\cite{angrishi2017turning}. The second primary component is the command-and-control servers (C2Cs) that are used to control the bots. The four optional components are the scanners, the reporting server, the loaders, and the malware distribution server. The scanners are used for scanning vulnerable IoT devices. The reporting server scan reports or collects the results or scan reports from external scammers or IoT bots. The loaders first log on to the vulnerable IoT device and then start to instruct the vulnerable IoT device to download malware. The malware distribution server is the location where the malware code is stored so that the loader navigates the infected IoT device to download it~\cite{angrishi2017turning}. Figure~\ref{IoTBotnet_Overview} shows a diagram of how the IoT botnet attack is performed~\cite{marzano2018evolution,al2020lightgbm}. There are several IoT botnet attacks that cause different types of cyber attacks, exploits, or both. Table~\ref{IoTBots} describes the IoT botnets from 2009 to 2023, including their attack types, the type of exploit that they are performed, the year of the first infection, the source of infection, and whether it is open-source or not. The IoT botnets are ordered in the table from the oldest to the newest, followed by the alphabetical order for the same year occurrence. \begin{figure}[t] \centerline{\includegraphics[width=\linewidth,height=8cm]{./model_architecture.png}} \caption{The proposed model architecture diagram.} \label{model_architecture} \end{figure} \begin{table*}[t] \caption{IoT botnets and their attack types.} \begin{center} \resizebox{\textwidth}{!}{ \begin{tabular}{|l|c|c|c|c|} \hline \textbf{IoT Botnet}&\textbf{Attack Types}& \textbf{Exploit Types} & \textbf{Open} & \textbf{First}\\ \textbf{}&\textbf{}& \textbf{} & \textbf{Source} & \textbf{Occured}\\ \hline Chuck Norris~\cite{ChuckNorris} & DDoS& SSH, Telnet& No & 2009\\ PsybOt~\cite{vdurfina2013psybot} & DDoS&SSH, Telnet& No& 2009\\ Tsunami/Kaiten~\cite{kaiten,kambourakis2017mirai}& DDoD&SSH, Telnet& No &2010\\ Aidra~\cite{vignau201910} & DDoD& Telnet & Yes & 2012\\ Carana~\cite{malecot2013carna}& N/A & Telnet & No & 2013 \\ Bashlite/Gafgyt/Qbot~\cite{mcnulty2022iot} &DDoS &Telnet&Yes &2014\\ LightAidra~\cite{coltellese2019triage}& DDoS& Telnet& Yes&2014\\ muBoT~\cite{arivudainambi2019malware} & DDoD& SSH, Injection & Yes&2014\\ Wifach~\cite{ferronato2020iot} & Secure endpoint& Telnet &Yes&2014\\ XOR DDoS~\cite{bederna2020cyber}&DDoS & SSH& No & 2014\\ Amnesia~\cite{prokofiev2018method}&DDoS& RCE &No&2016\\ Bashlite II~\cite{spring2016bashlite}&DDoS&SSH, Telnet&No&2016\\ BillGates botnet~\cite{dehoneynet}&DDoS&SSH&No&2016\\ Hajime~\cite{edwards2016hajime}&Secure endpoint& Telnet, TR-069& No& 2016\\ IRC Telnet~\cite{hamza2020iot}&DDoS& Telnet&No&2016\\ Lua Bot~\cite{geenens2019iot}&DDoS&N/A&No&2016\\ NyaDrop~\cite{matthews2021analysis}&N/A&Telnet&No&2016\\ Mirai~\cite{kambourakis2017mirai}&DDoS&Telnet&Yes&2016\\ Remaiten~\cite{paganini2016linux,cozzi2020tangled}&DDoS&Telnet&No&2016\\ TheMoon~\cite{TheMoon}&Spying, MPAB-for-hire, PDoS&4 CVs&No&2016\\ BrickerBot~\cite{cimpanu2017brickerbot,shobana2018iot}&DDoS, PDoS endpoint&Telnet&No&2017\\ Persirai~\cite{yeh2017persirai}&DDoS&UPnP BF&No&2017\\ Reaper~\cite{torabi2018inferring,berasaluce2019cybercrime}&DoS& HTTP& No& 2017\\ Satori~\cite{geenens2019iot,satori}&DDoS& Brutforce&Yes&2017\\ DoubleDoor~\cite{backdoorbotNet}& N/A &password & No &2018\\ Hide and seek~\cite{hideAndSeek,csendroiu2018hide}& Spying& Telnet, HTTP &No &2018\\ JenX~\cite{jenx}& DDoS, DDo-for-hire & TCP & Yes&2018\\ Masuta~\cite{pereira2009machine}& BF & DDoS, DDoS-for-hire& Yes &2018\\ Omni~\cite{farooq2019modeling}& Cryptojacking & N/A & No &2018\\ Owari~\cite{owari}& MPAB-for-hire & password & Yes &2018\\ Sora~\cite{sora}&DDoS, MPAB-for-hire& Brutforce &No&2018\\ VPNFilter~\cite{VPNFilter}&Apying, PDoS&14 CVEs&No&2018\\ Wicked~\cite{mcdermott2019evaluating}&DDoS&N/A&No&2018\\ Bashlite III~\cite{javed2019multi}&DDoS, Cryptojacking& Telnet, UPnP&No& 2019\\ Echobot~\cite{Echobot}&DDoS&+50 RCE exploits&No&2019\\ Stealthworker~\cite{Stealthworker}&Ransomeware&SSH, Brutforce&No&2019\\ Dark Nexus~\cite{DarkNexus}&DDoS&Telnet&No&2020\\ Fronton~\cite{Fronton}&DDoS, Dosinformation&N/A&No&2020\\ Kaiji~\cite{Kaiji}&DDoS&SSH&No&2020\\ Mozi~\cite{Mozi}&DDoS, Data Exfiltration, Payload execution&Telnet&No&2020\\ Ttint~\cite{Ttint}&DDoS&zero-day&No&2020\\ Dark.IoT~\cite{darkIoT}&DDoS& zero-day, CVE &No&2021\\ Meris~\cite{meris,najar2022ddos}&DDoS &RouterOS&No&2021\\ EnemyBot~\cite{EnemyBot}&DDoS& SSH, Telnet, Brutforce, RCE&Yes&2022\\ Zerobot~\cite{zeroBot1,zeroBot2,zeroBot3}&DDoS&SSH, Telnet&No&2022\\ \hline \end{tabular} } \label{IoTBots} \end{center} \end{table*} \begin{table}[t] \caption{The proposed model summary.} \begin{center} \small \begin{tabular}{|l|l|l|} \hline \textbf{Layer (type) } & \textbf{Output Shape} & \textbf{Param \#} \\ \hline InputLayer & [(None, 16, 1)] & 0 \\ Conv1D & (None, 16, 128) & 512 \\ BatchNormalization & (None, 16, 128) & 512 \\ GRU & (None, 16, 10) & 390 \\ Activation & (None, 16, 128) & 0 \\ Flatten & (None, 160) & 0 \\ GlobalMaxPooling1D& (None, 128) & 0 \\ Concatenate & (None, 288) & 0 \\ dense (Dense) & (None, 10) & 2890 \\ dense\_1 (Dense) & (None, 6) & 66 \\ \hline \end{tabular} \label{model_summary} \end{center} \end{table} \begin{table}[t] \caption{The proposed model overall results and statistics} \begin{center} \small \begin{tabular}{|l|c|} \hline \textbf{Metrics}&\textbf{Value}\\ \hline Train accuracy& 99.73\%\\ Test Accuracy& 99.25\%\\ 95\% CI&(0.99239,0.99279) \\ F1-Score&0.9925\\ Hamming Loss&0.00741\\ RCI &0.9828 \\ \#Parameters&4370\\ Train time& 25.21 (minutes)\\ \hline \end{tabular} \label{model_results} \end{center} \end{table} \section{Proposed Model}\label{proposed_model} In this paper, we proposed an economic system to detect IoT botnets using a deep learning model. Our proposed model reduces the implementation budget by approximately 79\% compared to the state-of-the-art deep learning-based models for IoT botnet detection. Our proposed model used efficient, low-cost implementation deep learning architecture, which is able to achieve efficiency and outperform the state-of-the-art. The proposed model summary is shown in Table~\ref{model_summary}, where each layer of the proposed model, its corresponding output shape, and the number of trainable parameters are provided. Thus, the total number of parameters of the proposed model is 4370, where 4114 parameters are trainable, and 256 are non-trainable parameters. The proposed model architecture is shown in Figure.~\ref{model_architecture}. The model concatenates the gated recurrent neural network capable of learning the temporal information in the data and the spatial information captured via the convolution neural network. Selecting the GRU over other recurrent architecture based on the findings in~\cite{elsayed2018deep} where combining the GRU with the CNN has higher accuracy results compared to combining the LSTM with CNN. Moreover, the GRU requires less time and implementation budget from software and hardware aspects as it has a smaller architecture than the LSTM~\cite{chung2014empirical,zaghloul2021fpga}. Thus, the model achieves high detection accuracy using a low implementation budget compared to the current state-of-the-art models. \begin{table*}[t] \caption{The proposed model testing stage classes statistics.} \begin{center} \small \begin{tabular}{|l|c|c|c|c|c|c|} \hline \textbf{}&\textbf{Class 0}&\textbf{Class 1}&\textbf{Class 2}&\textbf{Class 3}&\textbf{Class 4}&\textbf{Class 5}\\ \hline ACC(Accuracy) & 0.99993 & 0.99984 & 0.99287 & 0.9928 & 0.99989 & 0.99985 \\ AGF(Adjusted F-score) & 0.99997 & 0.99983 & 0.68433 & 0.86309 & 0.94874 & 0.0 \\ AGM(Adjusted geometric mean) & 0.99991 & 0.99985 & 0.85544 & 0.92441 & 0.97189 & 0 \\ AUC(Area under the ROC curve) & 0.99993 & 0.99984 & 0.75543 & 0.86312 & 0.94542 & 0.5 \\ AUCI(AUC value interpretation) & Excellent & Excellent & Good & Very Good & Excellent & Poor \\ ERR(Error rate) & 7e-05 & 0.00016 & 0.00713 & 0.0072 & 0.00011 & 0.00015 \\ F1-Score & 0.99994 & 0.99982 & 0.41423 & 0.77933 & 0.91446 & 0.0 \\ Precision & 0.99989 & 0.99982 & 0.34615 & 0.83744 & 0.93933 & None \\ False Negative &4 & 60 & 1734 & 3463 & 55 & 107 \\ False Positive & 4 & 57 & 3487 & 1806 & 29 & 0 \\ True Positive & 396568 & 318277 & 1846 & 9304 & 449 & 0 \\ True Negative & 335251 & 413473 & 724800 & 717294 & 731334 & 731760 \\ Y(Youden index) & 0.99986 & 0.99967 & 0.51085 & 0.72624 & 0.89083 & 0.0 \\ dInd(Distance index) & 0.00013 & 0.00023 & 0.48438 & 0.27126 & 0.10913 & 1.0 \\ sInd(Similarity index) & 0.99991 & 0.99983 & 0.65749 & 0.80819 & 0.92284 & 0.29289 \\ \hline \end{tabular} \label{class_statistics} \end{center} \end{table*} \section{Experiments and Results}\label{results_section} \subsection{Dataset} For our model design and testing, we used the UNSW 2018 IoT Botnet Dataset benchmark~\cite{koroniotis2019towards}. This data has been created using a realistic network environment in the Cyber Range Lab of UNSW Canberra. Thus, this dataset is sufficient to create IoT botnet detection models than the non-realistic network environment datasets. The dataset's full description and details are provided in~\cite{koroniotis2019towards}. \subsection{Experiment Parameters} The proposed IoT botnet detection model was implemented on Google Colab using Python 3.8, Tensorflow 2.9.2, Keras 2.9.0, and NumPy 1.21.6. In order to set a fair comparison between our model and the state-of-the-art models for IoT botnet detection~\cite{koroniotis2019towards}. The model was trained for four epochs, and the batch size was set to 10. The UNSW 2018 IoT Botnet Dataset benchmark has already been split into training, and testing datasets with sizes 2927524 and 731867 attributes, respectively. We split the training dataset to train and validation datasets with ratios of 90\% and 10\%, respectively. For the GRU, the number of unrollments was set to 10, and the weights were initialized using a Truncated Normal initializer. The 1D convolutional layer kernel size was set to three, and the weights were initialized using the he uniform initializer. We used the RMSProp optimization function to compile the model, and the loss was calculated using the categorical cross-entropy function. Table~\ref{model_results} shows the proposed model's overall results and statistics. Table~\ref{class_statistics} shows the statistical analysis of the proposed model results over detecting each class (six classes) of the dataset. Table~\ref{comparison_table} shows a comparison between the proposed model and the current state-of-the-art architectures for IoT botnet attack detection where N/A indicates that the particular information has not been provided by its authors. Our proposed economic model has exceeded the current models' accuracy. In addition, it has a significant reduction in the implementation budget. Moreover, it is faster in both training and testing aspects which is substantial for monitoring the IoT network traffic. \begin{table*}[t] \caption{Comparison between the proposed model and the state-fo-the-art training IoT botnet attack detection models.} \small \begin{center} \begin{tabular}{|l|l|c|c|c|c|} \hline \textbf{Model}&\textbf{Technique}&\textbf{ Dataset}&\textbf{\#Parameters}&\textbf{Accuracy} & \textbf{Train Time (seconds)}\\ \hline \cite{koroniotis2018towards}&Association Rule Mining&UNSW 2015&N/A&86.45\%&N/A\\ \cite{koroniotis2018towards}&Decision Tree&UNSW 2015&N/A&93.23\%&N/A\\ \cite{koroniotis2018towards}&Naiive Bayes & UNSW 2015&N/A&72.73\% &N/A\\ \cite{zeeshan2021protocol}& LSTM-CNN & UNSW 2015&N/A&96.32\%&N/A\\ \cite{koroniotis2018towards}&ANN &UNSW 2015&N/A&63.97\%& N/A\\ \cite{koroniotis2019towards}&SVM-based& UNSW 2018&N/A & 88.372\% & \textbf{1270 }\\ \cite{koroniotis2019towards}&RNN-CNN &UNSW 2018& 14316 &99740\%& 8035\\ \cite{koroniotis2019towards}&LSTM-CNN &UNSW 2018&14,676 & 99.7419\%& 10482\\ Our model& GRU-CNN&UNSW 2018&\textbf{4370} & \textbf{99.753\%} & \textbf{1592} \\ \hline \end{tabular} \label{comparison_table} \end{center} \end{table*} \section{Conclusion} The Internet of Things cybersecurity challenges have increased rapidly due to the rapid growth of IoT systems and the lack of IoT-focused security tools. In this paper, we focused on designing an economic deep learning-based model to detect IoT botnet attacks along with different types of attacks. Our proposed model has exceeded the accuracy of state-of-the-art IoT botnet detection approaches using only 25\% of the implementation budget. Thus, it reduces the implementation budget by approximately 75\%. In addition, it exceeds the state-of-the-art accuracy in detecting the IoT botnet types that help to find a sufficient strategy to suppress the attack. Moreover, it accelerates the model training and testing time. Furthermore, it is simple to implement on both hardware and software. \section*{Acknowledgment} The acknowledgment is hidden to maintain the anonymity of the authors and the affiliations. The full acknowledgment will be added to the final version. \section{Copyright} Copyright Year by the authors. All rights reserved. \section{Formatting Requirements in Brief} We need source and PDF files that can be used in a variety of ways and can be output on a variety of devices. FLAIRS imposes some requirements on your source and PDF files that must be followed. Most of these requirements are based on our efforts to standardize conference manuscript properties and layout. These requirements are as follows, and all papers submitted to FLAIRS for publication must comply: \begin{itemize} \item Your .tex file must compile in PDF\LaTeX{} --- \textbf{ no .ps or .eps figure files.} \item All fonts must be embedded in the PDF file --- \textbf{ this includes your figures.} \item Modifications to the style sheet (or your document) in an effort to avoid extra page are NOT allowed. \item No type 3 fonts may be used (even in illustrations). \item Your title must follow US capitalization rules. \item \LaTeX{} documents must use the Times or Nimbus font package (do not use Computer Modern for the text of your paper). \item Fonts that require non-English language support (CID and Identity-H) must be converted to outlines or removed from the document (even if they are in a graphics file embedded in the document). \item Two-column format is required for all papers. \item The paper size for final submission must be US letter. No exceptions. \item The source file must exactly match the PDF. \item The document margins must be as specified in the formatting instructions. \item The number of pages and the file size must be as specified for your event. \item No document may be password protected. \item Neither the PDFs nor the source may contain any embedded links or bookmarks. \item Your source and PDF must not have any page numbers, footers, or headers. \item Your PDF must be compatible with Acrobat 5 or higher. \item Your \LaTeX{} source file (excluding references) must consist of a \textbf{single} file (use of the ``input" command is not allowed. \item Your graphics must be sized appropriately outside of \LaTeX{} (do not use the ``clip" command) . \end{itemize} If you do not follow the above requirements, it is likely that we will be unable to publish your paper. \section{What Files to Submit} You must submit the following items to ensure that your paper is published: \begin{itemize} \item A fully-compliant PDF file. \item Your \LaTeX{} source file submitted as a \textbf{single} .tex file (do not use the ``input" command to include sections of your paper --- every section must be in the single source file). The only exception is the bibliography, which you may include separately. Your source must compile on our system, which includes the standard \LaTeX{} support files. \item All your graphics files. \item The \LaTeX{}-generated files (e.g. .aux and .bib file, etc.) for your compiled source. \item All the nonstandard style files (ones not commonly found in standard \LaTeX{} installations) used in your document (including, for example, old algorithm style files). If in doubt, include it. \end{itemize} Your \LaTeX{} source will be reviewed and recompiled on our system (if it does not compile, you may incur late fees). \textbf{Do not submit your source in multiple text files.} Your single \LaTeX{} source file must include all your text, your bibliography (formatted using flairs.bst), and any custom macros. Accompanying this source file, you must also supply any nonstandard (or older) referenced style files and all your referenced graphics files. Your files should work without any supporting files (other than the program itself) on any computer with a standard \LaTeX{} distribution. Place your PDF and source files in a single tar, zipped, gzipped, stuffed, or compressed archive. Name your source file with your last (family) name. \textbf{Do not send files that are not actually used in the paper.} We don't want you to send us any files not needed for compiling your paper, including, for example, this instructions file, unused graphics files, and so forth. \section{Using \LaTeX{} to Format Your Paper} The latest version of the FLAIRS style file is available on FLAIRS's website. Download this file and place it in a file named ``flairs.sty" in the \TeX\ search path. Placing it in the same directory as the paper should also work. You must download the latest version. \subsection{Document Preamble} In the \LaTeX{} source for your paper, you \textbf{must} place the following lines as shown in the example in this subsection. This command set-up is for three authors. Add or subtract author and address lines as necessary, and uncomment the portions that apply to you. In most instances, this is all you need to do to format your paper in the Times font. The helvet package will cause Helvetica to be used for sans serif, and the courier package will cause Courier to be used for the typewriter font. These files are part of the PSNFSS2e package, which is freely available from many Internet sites (and is often part of a standard installation). Leave the setcounter for section number depth commented out and set at 0 unless you want to add section numbers to your paper. If you do add section numbers, you must uncomment this line and change the number to 1 (for section numbers), or 2 (for section and subsection numbers). The style file will not work properly with numbering of subsubsections, so do not use a number higher than 2. \begin{quote} \begin{small} \textbackslash documentclass[letterpaper]{article}\\ \% \textit{Required Packages}\\ \textbackslash usepackage\{flairs\}\\ \textbackslash usepackage\{times\}\\ \textbackslash usepackage\{helvet\}\\ \textbackslash usepackage\{courier\}\\ \textbackslash setlength\{\textbackslash pdfpagewidth\}\{8.5in\} \textbackslash setlength\{\textbackslash pdfpageheight\}\{11in\}\\ \%\%\%\%\%\%\%\%\%\%\\ \% \textit{PDFINFO for PDF\LaTeX{}}\\ \% Uncomment and complete the following for metadata (your paper must compile with PDF\LaTeX{})\\ \textbackslash pdfinfo\{\\ /Title (Input Your Paper Title Here)\\ /Author (John Doe, Jane Doe)\\ /Keywords (Input your paper's keywords in this optional area)\\ \}\\ \%\%\%\%\%\%\%\%\%\%\\ \% \textit{Section Numbers}\\ \% Uncomment if you want to use section numbers\\ \% and change the 0 to a 1 or 2\\ \% \textbackslash setcounter\{secnumdepth\}\{0\}\\ \%\%\%\%\%\%\%\%\%\%\\ \% \textit{Title, Author, and Address Information}\\ \textbackslash title\{Title\}\\ \textbackslash author\{Author 1 \textbackslash and Author 2\textbackslash\textbackslash \\ Address line\textbackslash\textbackslash\\ Address line\textbackslash\textbackslash \\ \textbackslash And\\ Author 3\textbackslash\textbackslash\\ Address line\textbackslash\textbackslash\\ Address line\}\\ \%\%\%\%\%\%\%\%\%\%\\ \% \textit{Body of Paper Begins}\\ \textbackslash begin\{document\}\\ \textbackslash maketitle\\ ...\\ \%\%\%\%\%\%\%\%\%\%\\ \% \textit{References and End of Paper}\\ \textbackslash bibliography\{Bibliography-File\}\\ \textbackslash bibliographystyle\{flairs\}\\ \textbackslash end\{document\} \end{small} \end{quote} \subsection{Inserting Document Metadata with \LaTeX{}} PDF files contain document summary information that enables us to create an Acrobat index (pdx) file, and also allows search engines to locate and present your paper more accurately. \textbf{Document Metadata for Author and Title are REQUIRED.} If your paper includes illustrations that are not compatible with PDF\TeX{} (such as .eps or .ps documents), you will need to convert them. The epstopdf package will usually work for eps files. You will need to convert your ps files to PDF however. \textit{Important:} Do not include \textit{any} \LaTeX{} code or nonascii characters (including accented characters) in the metadata. The data in the metadata must be completely plain ascii. It may not include slashes, accents, linebreaks, unicode, or any \LaTeX{} commands. Type the title exactly as it appears on the paper (minus all formatting). Input the author names in the order in which they appear on the paper (minus all accents), separating each author by a comma. You may also include keywords in the Keywords field. \subsection{Preparing Your Paper} After the preamble above, you should prepare your paper as follows: \begin{quote} \begin{small} \textbackslash begin\{document\}\\ \textbackslash maketitle\\ ...\\ \textbackslash bibliography\{Bibliography-File\}\\ \textbackslash bibliographystyle\{flairs\}\\ \textbackslash end\{document\}\\ \end{small} \end{quote} \subsection{Incompatible Packages} The following packages are incompatible with flairs.sty and/or flairs.bst and must not be used (this list is not exhaustive --- there are others as well): \begin{itemize} \item hyperref \item natbib \item geometry \item titlesec \item layout \item caption \item titlesec \item T1 fontenc package (install the CM super fonts package instead) \end{itemize} \subsection{Illegal Commands} The following commands may not be used in your paper: \begin{itemize} \item \textbackslash input \item \textbackslash vspace (when used before or after a section or subsection) \item \textbackslash addtolength \item \textbackslash columnsep \item \textbackslash top margin (or text height or addsidemargin or even side margin) \end{itemize} \subsection{Paper Size, Margins, and Column Width} Papers must be formatted to print in two-column format on 8.5 x 11 inch US letter-sized paper. The margins must be exactly as follows: \begin{itemize} \item Top margin: .75 inches \item Left margin: .75 inches \item Right margin: .75 inches \item Bottom margin: 1.25 inches \end{itemize} The default paper size in most installations of \LaTeX{} is A4. However, because we require that your electronic paper be formatted in US letter size, you will need to alter the default for this paper to US letter size. Assuming you are using the 2e version of \LaTeX{}, you can do this by including the [letterpaper] option at the beginning of your file: \textbackslash documentclass[letterpaper]{article}. This command is usually sufficient to change the format. Sometimes, however, it may not work. Use PDF\LaTeX{} and include \textbackslash setlength\{\textbackslash pdfpagewidth\}\{8.5in\} \textbackslash setlength\{\textbackslash pdfpageheight\}\{11in\} in your preamble. \textbf{Do not use the Geometry package to alter the page size.} Use of this style file alters flairs.sty and will result in your paper being rejected. \subsubsection{Column Width and Margins.} To ensure maximum readability, your paper must include two columns. Each column should be 3.3 inches wide (slightly more than 3.25 inches), with a .375 inch (.952 cm) gutter of white space between the two columns. The flairs.sty file will automatically create these columns for you. \subsection{Overlength Papers} If your paper is too long, turn on \textbackslash frenchspacing, which will reduce the space after periods. Next, shrink the size of your graphics. Use \textbackslash centering instead of \textbackslash begin\{center\} in your figure environment. If these two methods don't work, you may minimally use the following. For floats (tables and figures), you may minimally reduce \textbackslash floatsep, \textbackslash textfloatsep, \textbackslash abovecaptionskip, and \textbackslash belowcaptionskip. For mathematical environments, you may minimally reduce \textbackslash abovedisplayskip, \textbackslash belowdisplayskip, and \textbackslash arraycolsep. You may also alter the size of your bibliography by inserting \textbackslash fontsize\{9.5pt\}\{10.5pt\} \textbackslash selectfont right before the bibliography. Commands that alter page layout are forbidden. These include \textbackslash columnsep, \textbackslash topmargin, \textbackslash topskip, \textbackslash textheight, \textbackslash textwidth, \textbackslash oddsidemargin, and \textbackslash evensizemargin (this list is not exhaustive). If you alter page layout, you will be required to pay the page fee \textit{plus} a reformatting fee. Other commands that are questionable and may cause your paper to be rejected include \textbackslash parindent, and \textbackslash parskip. Commands that alter the space between sections are also questionable. The title sec package is not allowed. Regardless of the above, if your paper is obviously ``squeezed" it is not going to to be accepted. Before using every trick you know to make your paper a certain length, try reducing the size of your graphics or cutting text instead. \subsection{Figures} Your paper must compile in PDF\LaTeX{}. Consequently, all your figures must be .jpg, .png, or .pdf. You may not use the .gif (the resolution is too low), .ps, or .eps file format for your figures. When you include your figures, you must crop them \textbf{outside} of \LaTeX{}. The command \textbackslash includegraphics*[clip=true, viewport 0 0 10 10]{...} might result in a PDF that looks great, but the image is \textbf{not really cropped.} The full image can reappear when page numbers are applied or color space is standardized. \subsection{Type Font and Size} Your paper must be formatted in Times Roman or Nimbus. We will not accept papers formatted using Computer Modern or Palatino or some other font as the text or heading typeface. Sans serif, when used, should be Courier. Use Symbol or Lucida or Computer Modern for \textit{mathematics only. } Do not use type 3 fonts for any portion of your paper, including graphics. Type 3 bitmapped fonts are designed for fixed resolution printers. Most print at 300 dpi even if the printer resolution is 1200 dpi or higher. They also often cause high resolution imagesetter devices and our PDF indexing software to crash. Consequently, FLAIRS will not accept electronic files containing obsolete type 3 fonts. Files containing those fonts (even in graphics) will be rejected. Fortunately, there are effective workarounds that will prevent your file from embedding type 3 bitmapped fonts. The easiest workaround is to use the required times, helvet, and courier packages with \LaTeX{}2e. (Note that papers formatted in this way will still use Computer Modern for the mathematics. To make the math look good, you'll either have to use Symbol or Lucida, or you will need to install type 1 Computer Modern fonts --- for more on these fonts, see the section ``Obtaining Type 1 Computer Modern.") If you are unsure if your paper contains type 3 fonts, view the PDF in Acrobat Reader. The Properties/Fonts window will display the font name, font type, and encoding properties of all the fonts in the document. If you are unsure if your graphics contain type 3 fonts (and they are PostScript or encapsulated PostScript documents), create PDF versions of them, and consult the properties window in Acrobat Reader. The default size for your type should be ten-point with twelve-point leading (line spacing). Start all pages (except the first) directly under the top margin. (See the next section for instructions on formatting the title page.) Indent ten points when beginning a new paragraph, unless the paragraph begins directly below a heading or subheading. \subsubsection{Obtaining Type 1 Computer Modern for \LaTeX{}.} If you use Computer Modern for the mathematics in your paper (you cannot use it for the text) you may need to download type 1 Computer fonts. They are available without charge from the American Mathematical Society: http://www.ams.org/tex/type1-fonts.html. \subsection{Title and Authors} Your title must appear in mixed case (nouns, pronouns, and verbs are capitalized) near the top of the first page, centered over both columns in sixteen-point bold type (twenty-four point leading). This style is called ``mixed case." Author's names should appear below the title of the paper, centered in twelve-point type (with fifteen point leading), along with affiliation(s) and complete address(es) (including electronic mail address if available) in nine-point roman type (the twelve point leading). (If the title is long, or you have many authors, you may reduce the specified point sizes by up to two points.) You should begin the two-column format when you come to the abstract. \subsubsection{Formatting Author Information} Author information can be set in a number of different styles, depending on the number of authors and the number of affiliations you need to display. For several authors from the same institution, use \textbackslash and: \begin{quote} \begin{small} \textbackslash author\{Author 1 \textbackslash and ... \textbackslash and Author \textit{n}\textbackslash \textbackslash \\ Address line \textbackslash \textbackslash ~... \textbackslash \textbackslash ~Address line\} \end{small} \end{quote} \noindent If the names do not fit well on one line use: \begin{quote} \begin{small} \textbackslash author\{Author 1\}\textbackslash \textbackslash \\ \{\textbackslash bf Author 2\}\textbackslash \textbackslash ~ ... \textbackslash \textbackslash ~\{\textbackslash bf Author \textit{n}\}\textbackslash \textbackslash \\ Address line \textbackslash \textbackslash ~ ... \textbackslash \textbackslash ~ Address line\} \end{small} \end{quote} \noindent For authors from different institutions, use \textbackslash And: \begin{quote} \begin{small} \textbackslash author\{Author 1\textbackslash \textbackslash ~ Address line \textbackslash \textbackslash ~... \textbackslash \textbackslash ~ Address line \textbackslash And ... \textbackslash And Author \textit{n}\textbackslash \textbackslash \\ Address line\textbackslash \textbackslash ~ ... \textbackslash \textbackslash ~ Address line\} \end{small} \end{quote} \noindent To start a separate ``row" of authors, use \textbackslash AND: \begin{quote} \begin{small} \textbackslash author\{Author 1\textbackslash\textbackslash ~ Address line \textbackslash\textbackslash ~ ... \textbackslash \textbackslash ~ Address line\textbackslash\textbackslash \\ \textbackslash AND\\ Author 2 \textbackslash\textbackslash ~ Address line \textbackslash\textbackslash ~ ... \textbackslash \textbackslash ~ Address line\textbackslash\textbackslash \\ \textbackslash And\\ Author 3 \textbackslash\textbackslash ~ Address line \textbackslash\textbackslash ~ ... \textbackslash \textbackslash ~ Address line\textbackslash\textbackslash \\\} \end{small} \end{quote} \noindent If the title and author information does not fit in the area allocated, place \textbackslash setlength\textbackslash titlebox\{\textit{height}\} after the \textbackslash documentclass line where \{\textit{height}\} is something like 2.5in. \subsection{\LaTeX{} Copyright Notice} The copyright notice automatically appears if you use FLAIRS.sty. If you are creating a technical report, it is not necessary to include this notice. You may disable the copyright line using the \verb+\+nocopyrightcommand. To change the entire text of the copyright slug, use: \textbackslash copyrighttext \{\emph{text}\}. Either of these must appear before \textbackslash maketitle. Please be advised, however, that \textit{if you disable or change the copyright line and transfer of copyright is required, your paper will not be published.} \subsection{Credits} Any credits to a sponsoring agency should appear in the acknowledgments section, unless the agency requires different placement. If it is necessary to include this information on the front page, use \textbackslash thanks in either the \textbackslash author or \textbackslash title commands. For example: \begin{quote} \begin{small} \textbackslash title\{Very Important Results in AI\textbackslash thanks\{This work is supported by everybody.\}\} \end{small} \end{quote} Multiple \textbackslash thanks commands can be given. Each will result in a separate footnote indication in the author or title with the corresponding text at the botton of the first column of the document. Note that the \textbackslash thanks command is fragile. You will need to use \textbackslash protect. Please do not include \textbackslash pubnote commands in your document. \subsection{Abstract} The abstract must be placed at the beginning of the first column, indented ten points from the left and right margins. The title ÒAbstractÓ should appear in ten-point bold type, centered above the body of the abstract. The abstract should be set in nine-point type with ten-point leading. This concise, one-paragraph summary should describe the general thesis and conclusion of your paper. A reader should be able to learn the purpose of the paper and the reason for its importance from the abstract. The abstract should be no more than two hundred fifty words in length. (Authors who are submitting short one- or two-page extended extracts should provide a short abstract of only a sentence or so.) \textbf{Do not include references in your abstract!} \subsection{Page Numbers} Do not \textbf{ever} print any page numbers on your paper. \subsection{Text } The main body of the paper must be formatted in ten-point with twelve-point leading (line spacing). \subsection{Citations} Citations within the text should include the author's last name and year, for example (Newell 1980). Append lower-case letters to the year in cases of ambiguity. Multiple authors should be treated as follows: (Feigenbaum and Engelmore 1988) or (Ford, Hayes, and Glymour 1992). In the case of four or more authors, list only the first author, followed by et al. (Ford et al. 1997). \subsection{Extracts} Long quotations and extracts should be indented ten points from the left and right margins. \begin{quote} This is an example of an extract or quotation. Note the indent on both sides. Quotation marks are not necessary if you offset the text in a block like this, and properly identify and cite the quotation in the text. \end{quote} \subsection{Footnotes} Avoid footnotes as much as possible; they interrupt the reading of the text. When essential, they should be consecutively numbered throughout with superscript Arabic numbers. Footnotes should appear at the bottom of the page, separated from the text by a blank line space and a thin, half-point rule. \subsection{Headings and Sections} When necessary, headings should be used to separate major sections of your paper. Remember, you are writing a short paper, not a lengthy book! An overabundance of headings will tend to make your paper look more like an outline than a paper. First-level heads should be twelve-point Times Roman bold type, mixed case (initial capitals followed by lower case on all words except articles, conjunctions, and prepositions, which should appear entirely in lower case), with fifteen-point leading, centered, with one blank line preceding them and three additional points of leading following them. Second-level headings should be eleven-point Times Roman bold type, mixed case, with thirteen-point leading, flush left, with one blank line preceding them and three additional points of leading following them. Do not skip a line between paragraphs. Third-level headings should be run in with the text, ten-point Times Roman bold type, mixed case, with twelve-point leading, flush left, with six points of additional space preceding them and no additional points of leading following them. \subsubsection{Section Numbers} The use of section numbers is optional. To use section numbers in \LaTeX{}, uncomment the setcounter line in your document preamble and change the 0 to a 1 or 2. Section numbers should not be used in short poster papers. \subsubsection{Section Headings.} Sections should be arranged and headed as follows: \subsubsection{Acknowledgments.} The acknowledgments section, if included, appears after the main body of text and is headed ``Acknowledgments." This section includes acknowledgments of help from associates and colleagues, credits to sponsoring agencies, financial support, and permission to publish. Please acknowledge other contributors, grant support, and so forth, in this section. Do not put acknowledgments in a footnote on the first page. If your grant agency requires acknowledgment of the grant on page 1, limit the footnote to the required statement, and put the remaining acknowledgments at the back. Please try to limit acknowledgments to no more than three sentences. \subsubsection{Appendices.} Any appendices follow the acknowledgments, if included, or after the main body of text if no acknowledgments appear. \subsubsection{References} The references section should be labeled ``References" and should appear at the very end of the paper (don't end the paper with references, and then put a figure by itself on the last page). A sample list of references is given later on in these instructions. Please use a consistent format for references. Poorly prepared or sloppy references reflect badly on the quality of your paper and your research. Please prepare complete and accurate citations. \subsection{Illustrations and Figures} Figures, drawings, tables, and photographs should be placed throughout the paper near the place where they are first discussed. Do not group them together at the end of the paper. If placed at the top or bottom of the paper, illustrations may run across both columns. Figures must not invade the top, bottom, or side margin areas. Figures must be inserted using the \textbackslash usepackage\{graphicx\}. Number figures sequentially, for example, figure 1, and so on. The illustration number and caption should appear under the illustration. Labels, and other text in illustrations must be at least nine-point type. \subsubsection{Low-Resolution Bitmaps.} You may not use low-resolution (such as 72 dpi) screen-dumps and GIF files---these files contain so few pixels that they are always blurry, and illegible when printed. If they are color, they will become an indecipherable mess when converted to black and white. This is always the case with gif files, which should never be used. The resolution of screen dumps can be increased by reducing the print size of the original file while retaining the same number of pixels. You can also enlarge files by manipulating them in software such as PhotoShop. Your figures should be a minimum of 266 dpi when incorporated into your document. \subsubsection{\LaTeX{} Overflow.} \LaTeX{} users please beware: \LaTeX{} will sometimes put portions of the figure or table or an equation in the margin. If this happens, you need to scale the figure or table down, or reformat the equation. Check your log file! You must fix any overflow into the margin (that means no overfull boxes in \LaTeX{}). If you don't, the overflow text will simply be eliminated. \textbf{Nothing is permitted to intrude into the margins.} \subsubsection{Using Color.} Your paper will be printed in black and white and grayscale. Consequently, because conversion to grayscale can cause undesirable effects (red changes to black, yellow can disappear, and so forth), we strongly suggest you avoid placing color figures in your document. Of course, any reference to color will be indecipherable to your reader. \subsubsection{Drawings.} We suggest you use computer drawing software (such as Adobe Illustrator or, (if unavoidable), the drawing tools in Microsoft Word) to create your illustrations. Do not use Microsoft Publisher. These illustrations will look best if all line widths are uniform (half- to two-point in size), and you do not create labels over shaded areas. Shading should be 133 lines per inch if possible. Use Times Roman or Helvetica for all figure call-outs. \textbf{Do not use hairline width lines} --- be sure that the stroke width of all lines is at least .5 pt. Zero point lines will print on a laser printer, but will completely disappear on the high-resolution devices used by our printers. \subsubsection{Photographs and Images.} Photographs and other images should be in grayscale (color photographs will not reproduce well; for example, red tones will reproduce as black, yellow may turn to white, and so forth) and set to a minimum of 266 dpi. Do not prescreen images. \subsubsection{Resizing Graphics.} Resize your graphics \textbf{before} you include them with LaTeX. You may \textbf{not} use trim or clip options as part of your \textbackslash includgraphics command. Resize the media box of your PDF using a graphics program instead. \subsubsection{Fonts in Your Illustrations} You must embed all fonts in your graphics before including them in your LaTeX document. \subsection{References} The flairs.sty file includes a set of definitions for use in formatting references with BibTeX. These definitions make the bibliography style fairly close to the one specified below. To use these definitions, you also need the BibTeX style file ``flairs.bst," available in the author kit on the FLAIRS web site. Then, at the end of your paper but before \textbackslash end{document}, you need to put the following lines: \begin{quote} \begin{small} \textbackslash bibliographystyle\{flairs\} \textbackslash bibliography\{bibfile1,bibfile2,...\} \end{small} \end{quote} The list of files in the \textbackslash bibliography command should be the names of your BibTeX source files (that is, the .bib files referenced in your paper). The following commands are available for your use in citing references: \begin{quote} \begin{small} \textbackslash cite: Cites the given reference(s) with a full citation. This appears as ``(Author Year)'' for one reference, or ``(Author Year; Author Year)'' for multiple references.\\ \textbackslash shortcite: Cites the given reference(s) with just the year. This appears as ``(Year)'' for one reference, or ``(Year; Year)'' for multiple references.\\ \textbackslash citeauthor: Cites the given reference(s) with just the author name(s) and no parentheses.\\ \textbackslash citeyear: Cites the given reference(s) with just the date(s) and no parentheses. \end{small} \end{quote} \textbf{Warning:} The flairs.sty file is incompatible with the hyperref and natbib packages. If you use either, your references will be garbled. Formatted bibliographies should look like the following examples. \smallskip \noindent \textit{Book with Multiple Authors}\\ Engelmore, R., and Morgan, A. eds. 1986. \textit{Blackboard Systems.} Reading, Mass.: Addison-Wesley. \smallskip \noindent \textit{Journal Article}\\ Robinson, A. L. 1980a. New Ways to Make Microcircuits Smaller. \textit{Science} 208: 1019--1026. \smallskip \noindent \textit{Magazine Article}\\ Hasling, D. W.; Clancey, W. J.; and Rennels, G. R. 1983. Strategic Explanations in Consultation. \textit{The International Journal of Man-Machine Studies} 20(1): 3--19. \smallskip \noindent \textit{Proceedings Paper Published by a Society}\\ Clancey, W. J. 1983b. Communication, Simulation, and Intelligent Agents: Implications of Personal Intelligent Machines for Medical Education. In Proceedings of the Eighth International Joint Conference on Artificial Intelligence, 556--560. Menlo Park, Calif.: International Joint Conferences on Artificial Intelligence, Inc. \smallskip \noindent \textit{Proceedings Paper Published by a Press or Publisher}\\ Clancey, W. J. 1984. Classification Problem Solving. In \textit{Proceedings of the Fourth National Conference on Artificial Intelligence,} 49--54. Menlo Park, Calif.: AAAI Press. \smallskip \noindent \textit{University Technical Report}\\ Rice, J. 1986. Poligon: A System for Parallel Problem Solving, Technical Report, KSL-86-19, Dept. of Computer Science, Stanford Univ. \smallskip \noindent \textit{Dissertation or Thesis}\\ Clancey, W. J. 1979b. Transfer of Rule-Based Expertise through a Tutorial Dialogue. Ph.D. diss., Dept. of Computer Science, Stanford Univ., Stanford, Calif. \smallskip \noindent \textit{Forthcoming Publication}\\ Clancey, W. J. 1986a. The Engineering of Qualitative Models. Forthcoming. \section{Producing Reliable PDF\\Documents with \LaTeX{}} Generally speaking, PDF files are platform independent and accessible to everyone. When creating a paper for a proceedings or publication in which many PDF documents must be merged and then printed on high-resolution PostScript RIPs, several requirements must be met that are not normally of concern. Thus to ensure that your paper will look like it does when printed on your own machine, you must take several precautions: \begin{itemize} \item Use type 1 fonts (not type 3 fonts) \item Use only standard Times, Nimbus, and CMR font packages (not fonts like F3 or fonts with tildes in the names or fonts---other than Computer Modern---that are created for specific point sizes, like Times\~{}19) or fonts with strange combinations of numbers and letters \item Embed all fonts when producing the PDF \item Do not use the [T1]{fontenc} package (install the CM super fonts package instead) \end{itemize} \subsection{Creating Output Using PDF\LaTeX{} Is Required} By using the PDF\TeX{} program instead of straight \LaTeX{} or \TeX{}, you will probably avoid the type 3 font problem altogether (unless you use a package that calls for metafont). PDF\LaTeX{} enables you to create a PDF document directly from \LaTeX{} source. The one requirement of this software is that all your graphics and images must be available in a format that PDF\LaTeX{} understands (normally PDF). PDF\LaTeX{}'s default is to create documents with type 1 fonts. If you find that it is not doing so in your case, it is likely that one or more fonts are missing from your system or are not in a path that is known to PDF\LaTeX{}. \subsubsection{dvipdf Script} Scripts such as dvipdf which ostensibly bypass the Postscript intermediary should not be used since they generally do not instruct dvips to use the config.pdf file. \subsubsection{dvipdfm} Do not use this dvi-PDF conversion package if your document contains graphics (and we recommend you avoid it even if your document does not contain graphics). \subsection{Ghostscript} \LaTeX{} users should not use GhostScript to create their PDFs. \subsection{Graphics} If you are still finding type 3 fonts in your PDF file, look at your graphics! \LaTeX{} users should check all their imported graphics files as well for font problems. \section{Proofreading Your PDF} Please check all the pages of your PDF file. Is the page size A4? Are there any type 3, Identity-H, or CID fonts? Are all the fonts embedded? Are there any areas where equations or figures run into the margins? Did you include all your figures? Did you follow mixed case capitalization rules for your title? Did you include a copyright notice? Do any of the pages scroll slowly (because the graphics draw slowly on the page)? Are URLs underlined and in color? You will need to fix these common errors before submitting your file. \section{Improperly Formatted Files } In the past, FLAIRS has corrected improperly formatted files submitted by the authors. Unfortunately, this has become an increasingly burdensome. Consequently, if your file is improperly formatted, it may not be possible to include your paper in the publication. If time allows, however, you will be notified via e-mail (with a copy to the program chair) of the problems with your file and given the option of correcting the file yourself If you opt to correct the file yourself, please note that we cannot provide you with any additional advice beyond that given in your packet. Files that are not corrected after a second attempt will be withdrawn. \subsection{\LaTeX{} 209 Warning} If you use \LaTeX{} 209 we will not be able to publish your paper. Convert your paper to \LaTeX{}2e. \section{Naming Your Electronic File} We request that you name your \LaTeX{} source file with your last name (family name) so that it can easily be differentiated from other submissions. If you name your files with the name of the event or ``flairs" or ``paper" or ``camera-ready" or some other generic or indecipherable name, you bear all risks of loss --- it is extremely likely that your file may be overwritten. \section{Submitting Your Electronic Files to FLAIRS} Submitting your files to FLAIRS is a two-step process. It is explained fully in the author registration and submission instructions. Please consult this document for details on how to submit your paper. \section{Inquiries} If you have any questions about the preparation or submission of your paper as instructed in this document, please contact FLAIRS. If you have technical questions about implementation of the flairs style file, please contact an expert at your site. We do not provide technical support for \LaTeX{} or any other software package. To avoid problems, please keep your paper simple, and do not incorporate complicated macros and style files. \section{Additional Resources} \LaTeX{} is a difficult program to master. If you've used that software, and this document didn't help or some items were not explained clearly, we recommend you read Michael Shell's excellent document (testflow doc.txt V1.0a 2002/08/13) about obtaining correct PS/PDF output on \LaTeX{} systems. (It was written for another purpose, but it has general application as well). It is available at www.ctan.org in the tex-archive. \section{ Acknowledgments} The acknowledgment is hidden to maintain the anonymity of the authors and the affiliations. The full acknowledgment will be added to the final version. \end{document}
\section{Introduction} Let $\mathcal{H}$ be a Hilbert space endowed with the scalar product $\< \cdot,\cdot\>$ and norm $\|\cdot\|$ and let $f:\mathcal{H}\To\overline{\R}$ be a convex proper lower semicontinuous function whose solution set $\argmin f$ is nonempty. Consider the minimization problem $$\mbox{(P)}\,\,\,\inf_{x\in\cH}f(x)$$ and associate to (P) the following inertial proximal algorithm: for all $k\ge 1$ \begin{align}\label{algo} \begin{cases} x_0,x_{1}\in\mathcal{H}\\ y_k= x_k+\left(1-\frac{\a}{k^q}\right)(x_k - x_{k-1})\\ x_{k+1}={ \rm prox}_{\l_k f}\left( y_k - \frac{c}{k^p}x_k\right), \end{cases} \end{align} where $\a,\,q,\,a,\,p>0$ and $(\l_k)$ is a sequence of positive real numbers. Further, $\prox\nolimits_{s f} : {\cH} \rightarrow {\cH}, \quad \prox\nolimits_{s f}(x)=\argmin_{y\in {\cH}}\left(f(y)+\frac{1}{2s}\|y-x\|^2\right),$ denotes the proximal point operator of the convex function $s f$. By rewriting $\prox\nolimits_{s f}$ as the resolvent operator of the subdifferential of the convex function $sf$, that is $\prox\nolimits_{s f}(x)=(I+s\p f)^{-1}(x),$ algorithm \eqref{algo} can be reformulated as \begin{equation}\label{formx} x_{k+1}\in\a_k(x_{k}-x_{k-1})-\l_k \p f(x_{k+1}) +\left(1- c_k\right) x_k,\mbox{ for all }k\ge 1, \end{equation} where we denote $\a_k=1-\frac{\a}{k^q}$ and $c_k=\frac{c}{k^p}.$ For a better insight in inertial proximal algorithms we refer to \cite{MM,APR,BT,BCL1,CD,LP,JM,MO} Note that $c_k x_k$ is a Tikhonov regularization term, which may assure the strong convergence of a generated sequence to the minimizer of minimal norm of the objective function $f$, (see \cite{Tikh,TA,ACR,AL-siopt,att-com1996,AC,AL-nemkoz,BCL,BGMS,CPS,L-jde,abc2,JM-Tikh}). We emphasize that in case $q=1$ algorithm \eqref{algo} is the Tikhonov regularized version of the inertial proximal algorithm (IPA) studied in \cite{ACR1} (see also \cite{APmathpr,ACPR,ABotCest}). Further, for constant $\l_k$ algorithm \eqref{algo} is an implicit discretization of the dynamical system studied in \cite{L-jde}, that is \begin{align}\label{DynSys} \begin{cases} \ddot{x}(t) + \frac{\a}{t^q} \dot{x}(t) +\nabla f\left(x(t)\right) +\frac{c}{t^p}x(t)=0\\ x(t_0) = u_0, \, \dot{x}(t_0) = v_0, \end{cases} \end{align} where $t_0 > 0$, $(u_0,v_0) \in \mathcal{H} \times \mathcal{H}$. However, in our algorithm we do not assume that the objective function is smooth, moreover, throughout this paper we assume that the stepsize parameter has the form $\l_k=\l k^\d,\,\l>0,\,\d\in\R.$ As it was expected, the most important features of a trajectory generated by the dynamical system \eqref{DynSys} are inherited by the sequences generated by algorithm \eqref{algo}. This underlines again the importance of the study of the continuous case (see \cite{ACR,BCL,AL-siopt,ABCR,CPS,ACR1}), when one ought to design an optimization algorithm with desirable properties. Our analysis reveals that the inertial coefficient $\a_k$ and the Tikhonov regularization coefficient $c_k$ are strongly correlated. More precisely, if $q+1<p$, (and $\d\ge 0$), then the sequence $(x_k)$ generated by algorithm \eqref{algo} converges weakly to a minimizer of our objective function $f.$ Further, fast convergence of the potential energy $f(x_k)-\min_{\cH}f$ and discrete velocity $\|x_k-x_{k-1}\|$ to zero is assured. Our results, (for this setting of parameters), are in concordance with the results obtained by G\"uler in \cite{Gu2}, (see also \cite{Gu1}), but our parameters have a much simpler form. Further, in case $q=1$ we reobtain the results from \cite{ACR1}. However, we show that the best choice of $q$ in the inertial parameter $\a_k$ is not $q=1$, but rather $0<q<1.$ Indeed, in the case $0<q<1$ , according to Theorem \ref{convergencealgorithm}, arbitrary large convergence rate for the potential energy $f(x_k)-\min_{\cH}f$ can be obtained, for a fixed inertial parameter $\a>0.$ However, this cannot be done in case $q=1$ (see \cite{ACR1} or Theorem \ref{convergencealgorithm}), since in this case the inertial parameter $\a_k$ and the stepsize parameter $\l_k$ are correlated. In other words, for obtaining a desired convergence rate, beside the stepsize one must also change the inertial parameter. Because of the fact that for a fixed inertial parameter one can obtain arbitrary large convergence rates is an important and new feature of our algorithm, let us give some details in what follows. In one hand, in \cite{ACR1} and also in Theorem \ref{convergencealgorithm}, for the constellation $q=1,$ $\a>3$ and $\l_k=\mathcal{O}(k^\d)\,\mbox{ as }k\to+\infty,$ for $\d<\a-3$ is obtained the rate $f(x_k)-\min_{\cH}f=o(k^{-2-\d}),\,\mbox{ as }k\to+\infty.$ This means that for a fixed $\a$ one can obtain at most $f(x_k)-\min_{\cH}f=\mathcal{O}(k^{1-\a}),\,\mbox{ as }k\to+\infty.$ On the other hand, according to Theorem \ref{convergencealgorithm}, for $0<q<1$ and $q+1<p\le 2$ one has $f(x_k)-\min_{\cH} f=\mathcal{O}(k^{-q-\d-1}),\,\mbox{ as }k\to+\infty$, which indeed can be arbitrary large. Even more, our proof works also when $c=0$, that is, we do not have Tikhonov regularization, and of course then the assumption $q+1<p\le 2$ can be dropped. Further, if $1<p<q+1$, (and $\d\le 0$), then the strong convergence result $\liminf_{k\to+\infty}\|x_k-x^*\|=0$, where $x^*$ is the minimum norm minimizer of the objective function $f$, is obtained. Also in this case fast convergence of the potential energy $f(x_k)-\min_{\cH}f$ and discrete velocity $\|x_k-x_{k-1}\|$ to zero is assured. Due to our best knowledge, similar results were obtained only in \cite{AL-nemkoz}, for the case $q=1$ and $p=2$, which is not covered by our analysis. The case $p=q+1$ is critical, in the sense that neither weak nor strong convergence of the generated sequences cannot be obtained. Nevertheless, convergence rates for the potential energy $f(x_k)-\min_{\cH}f$ and discrete velocity $\|x_k-x_{k-1}\|$ can be provided. The paper is organized as follows. In the next section we treat the case $q+1\le p$ in order to obtain fast convergence rates for the function values in the sequence generated by algorithm \eqref{algo} but also for the discrete velocity and subgradient. Further, if $p<q+1$ then the weak convergence of the generated sequences to a minimizer of the objective function is also obtained. In section 3 we deal with the case $1< p\le q+1$. We obtain fast convergence results concerning the potential energy, discrete velocity and subgradient. Moreover, if $1<p<q+1$ strong convergence results for the sequence generated by \eqref{algo} to the minimum norm minimizer of the objective function is shown. Finally we conclude our paper by underlying some possible further researches. \section{Convergence rates and weak convergence for the case $ q+1\le p$} In this section we analyze the weak convergence properties of the sequence generated by the algorithm \eqref{algo}. We obtain fast convergence to zero of the discrete velocity and subgradient. We also show that the function values in the generated sequences converge to the global minimum of the objective function $f.$ Even more, the variable stepsize parameter $\l_k=\l k^\d,\,\l,\d>0$ allows to obtain the estimate of order $\mathcal{O}(k^{-q-\d-1})$ for the decay $f(x_n)-\min_{\cH} f$ which can be arbitrary large, depending on parameter $\d.$ \subsection{Convergence rates} Concerning fast convergence of the function values, discrete velocity and subgradient, we have the following result. \begin{Theorem}\label{convergencealgorithm} Assume that $0<q\le 1$, $q+1\le p$, $\l_k=\l k^\d,\,\l>0,\,\d\ge 0$ and let $(x_k)$ be a sequence generated by \eqref{algo}. For every $k\ge 2$ let us denote $u_k$ the element from $\p f(x_k)$ that satisfies \eqref{formx} with equality, i.e., $$x_{k}=\a_{k-1}(x_{k-1}-x_{k-2})-\l_{k-1} u_k +\left(1- c_{k-1}\right) x_{k-1}.$$ Then the following results are valid. \begin{enumerate} \item[(i)] If $\a>0,\,\d\ge0,$ $0<q<1,\,q+1<p\le 2$ and for $p=2$ one has $c>q(1-q)$, or $\a>3,\,0\le\d<\a-3,$ $q=1$ and $p>2$ then \[f(x_k)-\min_{\cH} f=\mathcal{O}(k^{-q-\d-1}),\,\|x_{k}-x_{k-1}\|=\mathcal{O}(k^{-\frac{q+1}{2}})\mbox{ and }\|u_k\|=o(k^{-\frac{q+1}{2}-\d})\mbox{ as } k\to+\infty.\] Further, \[\ds\sum_{k=1}^{+\infty} k^{q+\d}(f(x_k)-\min_{\cH} f)<+\infty,\,\ds\sum_{k=1}^{+\infty} k\|x_k-x_{k-1}\|^2<+\infty\mbox{ and }\ds\sum_{k=2}^{+\infty} k^{q+2\d+1}\|u_k\|^2<+\infty.\] \item[(ii)] If $\a>0,\,\d\ge0,$ $0<q<1$ and $q+1\le p$, or $\a>3,\,0\le\d<\a-3,$ $q=1$ and $p\ge 2$ then for all $s\in\left]\frac12,\frac{q+1}{2}\right[$ one has $$f(x_k)-\min_{\cH} f=o(k^{-2s-\d}),\,\|x_{k}-x_{k-1}\|=o(k^{-s})\mbox{ and }\|u_k\|=o(k^{-s-\d})\mbox{ as } k\to+\infty.$$ Further, $$\ds\sum_{k=1}^{+\infty} k^{2s+\d-1}(f(x_k)-\min_{\cH} f)<+\infty,\,\ds\sum_{k=1}^{+\infty} k^{2s-q}\|x_k-x_{k-1}\|^2<+\infty\mbox{ and }\ds\sum_{k=2}^{+\infty} k^{2s+2\d}\|u_k\|^2<+\infty.$$ \end{enumerate} \end{Theorem} \begin{proof} Given $x^*\in\argmin f$, set $f^*=f(x^*)=\min_{\cH} f$. For $k\ge 2$, consider the discrete energy \begin{align}\label{discreteenergy} E_k=&\mu_{k-1}(f(x_{k-1})-f^*)+\|a_{k-1}(x_{k-1}-x^*)+b_{k-1}(x_k-x_{k-1}+\l_{k-1}u_k)\|^2\\ \nonumber&+\nu_{k-1}\|x_{k-1}-x^*\|^2+\s_{k-1}\|x_{k-1}\|^2, \end{align} where $a_k=ak^{r-1},\,b_k=k^r$, $r\in \left(\frac12,\frac{q+1}{2}\right],\,2r+\d<a$, $\mu_k:=(2b_{k}^2-2a_{k}b_{k})\l_{k},$ $\nu_k:=-\a_{k+1}a_{k+1}b_{k+1} -a_{k}^2+a_{k}b_{k}$ and $\sigma_k=\a_{k+1}b_{k+1}^2c_{k+1}$, for all $k\ge 1.$ If $q=1$, hence $\a>3,$ we also assume that $a<\a-1,$ hence $\d<\a-1-2r.$ Let us develop $E_k$. We show first, that there exists $k_0\ge 1$ such that the coefficients $\mu_k,\nu_k$ and $\s_k$ are nonnegative for all $k\ge k_0.$ According to the form of $(a_k)$ and $(b_k)$, there exists $k_1\ge 1$ such that $b_k\ge a_k$ for all $k \geq k_1$, hence \begin{equation}\label{signmu} \mu_k=(2b_{k}^2-2a_{k}b_{k})\l_{k}\ge 0\mbox{ for all }k\ge k_1\mbox{ and }\mu_k=\mathcal{O}(k^{2r+\d})\mbox{ as }k\to+\infty. \end{equation} \vskip0.3cm Obviously $\nu_k=-\a_{k+1}a_{k+1}b_{k+1} -a_{k}^2+a_{k}b_{k}=-a(k+1)^{2r-1}+\a a(k+1)^{2r-1-q}-a^2k^{2r-2}+a k^{2r-1}$ and we show that $\phi(x,r)=-a(x+1)^{2r-1}+\a a(x+1)^{2r-1-q}-a^2x^{2r-2}+a x^{2r-1}\ge 0$ for $x$ big enough and that $\phi(x,r)=\mathcal{O}(x^{2r-1-q})$ as $x\to+\infty.$ Indeed, one has \begin{align*} \lim_{x\to+\infty}\frac{\phi(x,r)}{x^{2r-1-q}}&=\lim_{x\to+\infty}\frac{a x^{2r-1}-a(x+1)^{2r-1}+\a a(x+1)^{2r-1-q}-a^2x^{2r-2}}{x^{2r-1-q}}\\ &=\lim_{x\to+\infty}\left(\frac{a -a\left(1+\frac{1}{x}\right)^{2r-1}}{x^{-q}}+\a a\left(1+\frac{1}{x}\right)^{2r-1-q}-a^2x^{q-1}\right)\\ &=\lim_{x\to+\infty}\left(-\frac{a(2r-1)}{q}\frac{\left(1+\frac{1}{x}\right)^{2r-2}}{x^{1-q}}+\a a-a^2x^{q-1}\right)=L, \end{align*} where $L=\a a>0$ if $q<1$ and $L=-a(2r-1)+\a a-a^2$ if $q=1.$ However, if $q=1$ one has $a<\a-1$ and consequently $0< \a+1-a-2r$ hence $L>0$ also in this case. Hence, there exist $k_2\ge 1$ such that for all $\frac12< r\le \frac{q+1}{2}$ one has \begin{equation}\label{signnu} \nu_k=-\a_{k+1}a_{k+1}b_{k+1} -a_{k}^2+a_{k}b_{k}\ge 0,\mbox{ for all }k\ge k_2\mbox{ and }\nu_k=\mathcal{O}(k^{2r-1-q})\mbox{ as }k\to+\infty. \end{equation} Finally, it is obvious that there exists $k_3\ge 1$ such that $\a_{k+1}b_{k+1}^2c_{k+1}=c\left(1-\frac{\a}{(k+1)^q}\right)(k+1)^{2r-p}\ge 0$ for all $k\ge k_3$, hence for all $\frac12< r\le \frac{q+1}{2}$ one has \begin{equation}\label{signsigma} \sigma_k=\a_{k+1}b_{k+1}^2c_{k+1}\ge 0\mbox{ for all }k\ge k_3\mbox{ and }\sigma_k=\mathcal{O}(k^{2r-p})\mbox{ as }k\to+\infty. \end{equation} Now, take $k_0=\max(k_1,k_2,k_3)$ and one has $\m_k,\nu_k,\s_k\ge0$ for all $k\ge k_0.$ \vskip0.3cm For simplicity let us denote $v_k=\|a_{k-1}(x_{k-1}-x^*)+b_{k-1}(x_k-x_{k-1}+\l_{k-1}u_k)\|^2.$ Then, \begin{align}\label{forEk} v_k=&a_{k-1}^2\|x_{k-1}-x^*\|^2+b_{k-1}^2\|x_k-x_{k-1}\|^2+b_{k-1}^2\l_{k-1}^2\|u_k)\|^2+2a_{k-1}b_{k-1}\<x_k-x_{k-1},x_{k-1}-x^*\>\\ \nonumber &+2a_{k-1}b_{k-1}\l_{k-1}\<u_k,x_{k-1}-x^*\>+2b_{k-1}^2\l_{k-1}\<u_k,x_k-x_{k-1}\>. \end{align} Further $$ 2a_{k-1}b_{k-1}\<x_k-x_{k-1},x_{k-1}-x^*\>=a_{k-1}b_{k-1}(\|x_k-x^*\|^2-\|x_k-x_{k-1}\|^2-\|x_{k-1}-x^*\|^2)$$ and $$2a_{k-1}b_{k-1}\l_{k-1}\<u_k,x_{k-1}-x^*\>=2a_{k-1}b_{k-1}\l_{k-1}\<u_k,x_{k}-x^*\>-2a_{k-1}b_{k-1}\l_{k-1}\<u_k,x_{k}-x_{k-1}\>.$$ Consequently, \eqref{forEk} becomes \begin{align}\label{forEk1} v_k=&a_{k-1}b_{k-1}\|x_k-x^*\|^2+(a_{k-1}^2-a_{k-1}b_{k-1})\|x_{k-1}-x^*\|^2+(b_{k-1}^2-a_{k-1}b_{k-1})\|x_k-x_{k-1}\|^2\\ \nonumber&+b_{k-1}^2\l_{k-1}^2\|u_k\|^2+2a_{k-1}b_{k-1}\l_{k-1}\<u_k,x_{k}-x^*\>+(2b_{k-1}^2-2a_{k-1}b_{k-1})\l_{k-1}\<u_k,x_k-x_{k-1}\> . \end{align} Let us proceed similarly with $v_{k+1}$. First notice that from (\ref{discreteenergy}) we have $$v_{k+1}=\|a_{k}(x_{k}-x^*)+b_{k}(\a_k(x_k-x_{k-1})-c_k x_k)\|^2.$$ Therefore, after development we get \begin{align}\label{forEk+1} v_{k+1}=&a_k^2\|x_k-x^*\|^2+\a_k^2b_k^2\|x_k-x_{k-1}\|^2+b_k^2c_k^2\|x_k\|^2+2\a_k a_kb_k\<x_k-x_{k-1},x_k-x^*\> \\ \nonumber&-2\a_kb_k^2c_k\<x_k-x_{k-1},x_k\>-2a_kb_kc_k\<x_k,x_k-x^*\>. \end{align} Further, \begin{eqnarray*} &&2\a_k a_kb_k\<x_k-x_{k-1},x_k-x^*\>=-\a_k a_kb_k(\|x_{k-1}-x^*\|-\|x_k-x_{k-1}\|^2-\|x_k-x^*\|^2) \\ &&-2\a_kb_k^2c_k\<x_k-x_{k-1},x_k\>=\a_kb_k^2c_k(\|x_{k-1}\|^2-\|x_k-x_{k-1}\|^2-\|x_k\|^2) \\ &&-2a_kb_kc_k\<x_k,x_k-x^*\>=a_kb_kc_k(\|x^*\|^2-\|x_k-x^*\|^2-\|x_k\|^2). \end{eqnarray*} Hence, (\ref{forEk+1}) yields \begin{align}\label{forEk+11} v_{k+1}&=(a_k^2+\a_k a_kb_k-a_kb_kc_k)\|x_k-x^*\|^2-\a_k a_kb_k\|x_{k-1}-x^*\|^2 \\ \nonumber& +(\a_k^2b_k^2+\a_k a_kb_k-\a_kb_k^2c_k)\|x_k-x_{k-1}\|^2+(b_k^2c_k^2-\a_kb_k^2c_k -a_kb_kc_k)\|x_k\|^2\\ \nonumber&+\a_kb_k^2c_k\|x_{k-1}\|^2+a_kb_kc_k\|x^*\|^2. \end{align} Hence, \eqref{forEk+11} and \eqref{forEk1} lead to \begin{align}\label{energdif} v_{k+1}-v_k=&(a_k^2+\a_k a_kb_k-a_kb_kc_k-a_{k-1}b_{k-1})\|x_k-x^*\|^2\\ \nonumber&+(-\a_k a_kb_k -a_{k-1}^2+a_{k-1}b_{k-1})\|x_{k-1}-x^*\|^2\\ \nonumber& +(\a_k^2b_k^2+\a_k a_kb_k-\a_kb_k^2c_k-b_{k-1}^2+a_{k-1}b_{k-1})\|x_k-x_{k-1}\|^2\\ \nonumber&+(b_k^2c_k^2-\a_kb_k^2c_k -a_kb_kc_k)\|x_k\|^2+\a_kb_k^2c_k\|x_{k-1}\|^2-b_{k-1}^2\l_{k-1}^2\|u_k\|^2\\ \nonumber&+2a_{k-1}b_{k-1}\l_{k-1}\<u_k,x^*-x_{k}\>+(2b_{k-1}^2-2a_{k-1}b_{k-1})\l_{k-1}\<u_k,x_{k-1}-x_k\>\\ \nonumber&+a_kb_kc_k\|x^*\|^2. \end{align} From the subgradient inequality we have $$\<u_k,x^*-x_{k}\>\le f^*-f(x_k)\mbox{ and }\<u_k,x_{k-1}-x_k\>\le f(x_{k-1})-f(x_k).$$ Consequently, we get for all $k>k_0$ that \begin{align}\label{forfrate} &2a_{k-1}b_{k-1}\l_{k-1}\<u_k,x^*-x_{k}\>+(2b_{k-1}^2-2a_{k-1}b_{k-1})\l_{k-1}\<u_k,x_{k-1}-x_k\>\\ \nonumber&\le(2b_{k-1}^2-2a_{k-1}b_{k-1})\l_{k-1}(f(x_{k-1})-f^*)-2b_{k-1}^2\l_{k-1}(f(x_k)-f^*)\\ \nonumber&=\mu_{k-1}(f(x_{k-1})-f^*)-(\mu_k+(2b_{k-1}^2\l_{k-1}-2b_{k}^2\l_{k}+2a_{k}b_{k}\l_{k}))(f(x_{k})-f^*). \end{align} Let us denote $m_k:=2b_{k-1}^2\l_{k-1}-2b_{k}^2\l_{k}+2a_{k}b_{k}\l_{k}$ and let us show that for all $\frac12< r\le \frac{q+1}{2}$ one has $2b_{k-1}^2\l_{k-1}-2b_{k}^2\l_{k}+2a_{k}b_{k}\l_{k}\ge 0$ for all $k\ge 1$. We can write equivalently as $ k^{2r+\d}-ak^{2r+\d-1}-(k-1)^{2r+\d} \leq 0 $ for all $k\ge 1$. Since $ 2 r +\d< a $, by convexity of the function $x\mapsto x^{2r+\d}$, the gradient differential inequality gives $$ (x-1)^{2r+\d} \geq x^{2r+\d} -(2r+\d) x^{2r+\d -1} \geq x^{2r+\d} -a x^{2r+\d -1} $$ and the claim follows. Hence, \begin{equation}\label{signm} m_k\ge 0\mbox{ for all }k\ge k_0\mbox{ and observe that }m_k=\mathcal{O}(k^{2r+\d-1})\mbox{ as }k\to+\infty. \end{equation} Combining \eqref{energdif} and \eqref{forfrate} we get for all $k\ge k_0$ that \begin{align}\label{forfrate1} &v_{k+1}-v_k+\mu_k(f(x_{k})-f^*)-\mu_{k-1}(f(x_{k-1})-f^*)+m_k(f(x_{k})-f^*)\le\\ \nonumber&(a_k^2+\a_k a_kb_k-a_kb_kc_k-a_{k-1}b_{k-1})\|x_k-x^*\|^2\\ \nonumber&+(-\a_k a_kb_k -a_{k-1}^2+a_{k-1}b_{k-1})\|x_{k-1}-x^*\|^2\\ \nonumber& +(\a_k^2b_k^2+\a_k a_kb_k-\a_kb_k^2c_k-b_{k-1}^2+a_{k-1}b_{k-1})\|x_k-x_{k-1}\|^2\\ \nonumber&+(b_k^2c_k^2-\a_kb_k^2c_k -a_kb_kc_k)\|x_k\|^2+\a_kb_k^2c_k\|x_{k-1}\|^2-b_{k-1}^2\l_{k-1}^2\|u_k\|^2\\ \nonumber&+a_kb_kc_k\|x^*\|^2. \end{align} Let us analyze now the sign of the coefficients of the right hand side of \eqref{forfrate1}. We have, \begin{align*} a_k^2+\a_k a_kb_k-a_kb_kc_k-a_{k-1}b_{k-1}&=(\a_{k+1}a_{k+1}b_{k+1} +a_{k}^2-a_{k}b_{k})\\ \nonumber&+(\a_k a_kb_k-a_kb_kc_k-a_{k-1}b_{k-1}-\a_{k+1}a_{k+1}b_{k+1}+a_{k}b_{k})\\ \nonumber& =-\nu_k-n_k, \end{align*} where $n_k:=-(\a_k a_kb_k-a_kb_kc_k-a_{k-1}b_{k-1}-\a_{k+1}a_{k+1}b_{k+1}+a_{k}b_{k}).$ Now, one has $$n_k=-(2ak^{2r-1}-\a ak^{2r-1-q}-ack^{2r-1-p}-a(k-1)^{2r-1}- a(k+1)^{2r-1}+\a a(k+1)^{2r-1-q}).$$ We show that for all $\frac12< r\le \frac{q+1}{2}$ one has $$\phi(x,r)=-2ax^{2r-1}+\a ax^{2r-1-q}+acx^{2r-1-p}+a(x-1)^{2r-1}+a(x+1)^{2r-1}-\a a(x+1)^{2r-1-q}\ge 0$$ for $x$ big enough. Indeed, if $q=1$ then one can take $r=1$ and we have $\phi(x,1)=acx^{1-p}>0$. Otherwise, for $\frac12<q\le 1,r<1$ one has \begin{align}\label{flimhalfsign} &\lim_{x\to+\infty}\frac{a(x-1)^{2r-1}+a(x+1)^{2r-1}-2ax^{2r-1}}{x^{2r-3}}=\lim_{x\to+\infty}\frac{a\left(1-\frac{1}{x}\right)^{2r-1}+a\left(1+\frac{1}{x}\right)^{2r-1}-2a}{x^{-2}}\\ \nonumber&=\lim_{x\to+\infty}\frac{a(2r-1)}{x^2}\frac{\left(1-\frac{1}{x}\right)^{2r-2}-\left(1+\frac{1}{x}\right)^{2r-2}}{-2x^{-3}}=\lim_{x\to+\infty}\frac{a(2r-1)}{-2}\frac{\left(1-\frac{1}{x}\right)^{2r-2}-\left(1+\frac{1}{x}\right)^{2r-2}}{x^{-1}}\\ \nonumber&=\lim_{x\to+\infty}\frac{a(2r-1)(2r-2)}{-2x^2}\frac{\left(1-\frac{1}{x}\right)^{2r-3}+\left(1+\frac{1}{x}\right)^{2r-3}}{-x^{-2}}=a(2r-1)(2r-2)<0. \end{align} Consequently, there exists $C_1>0$ such that \begin{equation}\label{fhalfsign} a(x-1)^{2r-1}+a(x+1)^{2r-1}-2ax^{2r-1}\ge -C_1 x^{2r-3}\mbox{ for }x\mbox{ big enough.} \end{equation} Further, if $r=\frac{q+1}{2}$, then $\a ax^{2r-1-q}-\a a(x+1)^{2r-1-q}=0$, otherwise \begin{align}\label{slimhalfsign} &\lim_{x\to+\infty}\frac{ \a ax^{2r-1-q}-\a a(x+1)^{2r-1-q}}{x^{2r-2-q}}=\lim_{x\to+\infty}\a a\frac{1-\left(1+\frac{1}{x}\right)^{2r-1-q}}{x^{-1}}\\ \nonumber&=-\a a\lim_{x\to+\infty}(2r-1-q)\left(1+\frac{1}{x}\right)^{2r-2-q}=\a a(1+q-2r)>0. \end{align} Consequently, there exists $C_2>0$ such that \begin{equation}\label{shalfsign} \a ax^{2r-1-q}-\a a(x+1)^{2r-1-q}\ge C_2x^{2r-2-q}\mbox{ for }x\mbox{ big enough.} \end{equation} From the above relations one can deduce the following: \begin{enumerate} \item[(N1)] If $q=1$ and $r=1$ we have $p>2$ and $\phi(x,r)=acx^{1-p}>0$, hence $\phi(x,r)=\mathcal{O}(x^{1-p})$ as $x\to +\infty.$ \item[(N2)] If $q=1$ and $\frac12<r<1$ then $p\ge 2$ and according to \eqref{flimhalfsign} and \eqref{slimhalfsign} and the fact that $\a>3$ we have \begin{align*} &\lim_{x\to+\infty}\frac{(a(x-1)^{2r-1}+a(x+1)^{2r-1}-2ax^{2r-1})+(\a ax^{2r-1-q}-\a a(x+1)^{2r-1-q})}{x^{2r-3}}\\ &=a(2r-1)(2r-2)+\a a(2-2r)=a(2-2r)(\a+1-2r)>0. \end{align*} Hence, $\phi(x,r)\ge Cx^{2r-3}+acx^{2r-1-p}$ for some $C>0$ and for $x$ big enough. Consequently, also in this case $\phi(x,r)>0$ if $x$ is big enough and since $p\ge 2$ one has $\phi(x,r)=\mathcal{O}(x^{2r-3})$ as $x\to +\infty.$ \item[(N3)] If $0<q<1,\,r=\frac{q+1}{2}$ then $q+1<p\le 2$ and according to \eqref{fhalfsign} one has \begin{align*} &(a(x-1)^{2r-1}+a(x+1)^{2r-1}-2ax^{2r-1})+(\a ax^{2r-1-q}-\a a(x+1)^{2r-1-q})\\ &\ge-C_1 x^{q-2}\mbox{ for }x\mbox{ big enough.} \end{align*} Hence, $\phi(x,r)\ge acx^{q-p}-C_1 x^{q-2}\mbox{ for }x\mbox{ big enough.}$ Obviously $\phi(x,r)>0$ if $p<2$ and $x$ is big enough. Further, if $p=2$ then \eqref{flimhalfsign} gives $\lim_{x\to\infty}\frac{\phi(x,r)}{x^{q-2}}=a(c+q(q-1))>0$, hence one has $\phi(x,r)>0$ if $x$ is big enough. Observe that in this case one has $\phi(x,r)=\mathcal{O}(x^{q-p})$ as $x\to +\infty.$ \item[(N4)] If $0<q<1,\,\frac12<r<\frac{q+1}{2}$ then $q+1\le p$ and according to \eqref{fhalfsign} and \eqref{shalfsign} one has \begin{align*} &\phi(x,r)\ge-C_1 x^{2r-3}+C_2x^{2r-2-q}+acx^{2r-1-p}\ge Cx^{2r-2-q}\mbox{ for some }C>0\mbox{ and for }x\mbox{ big enough.} \end{align*} Consequently, also in this case $\phi(x,r)>0$ if $x$ is big enough and observe that $\phi(x,r)=\mathcal{O}(x^{2r-2-q})$ as $x\to +\infty.$ \end{enumerate} We conclude that there exist $K_1\ge k_0$ such that for all $\frac12< r\le \frac{q+1}{2}$ one has \begin{equation}\label{forstrxk} n_k\ge 0,\mbox{ for all }k\ge K_1\mbox{ and the appropriate estimates emphasized at (N1)-(N4) hold.} \end{equation} For the coefficient of discrete velocity $\|x_k-x_{k-1}\|^2$ we have \begin{align*} \a_k^2b_k^2+\a_k a_kb_k-\a_kb_k^2c_k-b_{k-1}^2+a_{k-1}b_{k-1}&= k^{2r}-(k-1)^{2r}-2\a k^{2r-q} +ak^{2r-1}\\ &+a(k-1)^{2r-1}+\a^2 k^{2r-2q} -\a a k^{2r-q-1}-ck^{2r-p}\\ &+\a ck^{2r-q-p}. \end{align*} We show that for all $\frac12< r\le \frac{q+1}{2}$ one has \begin{align*} \phi(x,r)=&(x-1)^{2r}- x^{2r}+2\a x^{2r-q} -ax^{2r-1}-a(x-1)^{2r-1}-\a^2 x^{2r-2q} +\a a x^{2r-q-1}+cx^{2r-p}\\ &-\a cx^{2r-q-p}\ge 0,\mbox{ if }x\mbox{ is big enough.} \end{align*} Even more, $\phi(x,r)=\mathcal{O}(x^{2r-q})$ as $x\to+\infty.$ Indeed \begin{align*} &\lim_{x\to+\infty}\frac{(x-1)^{2r}- x^{2r}+2\a x^{2r-q} -ax^{2r-1}-a(x-1)^{2r-1}-\a^2 x^{2r-2q} +\a a x^{2r-q-1}-\a cx^{2r-q-p}}{x^{2r-q}}\\ &=\lim_{x\to+\infty}\frac{\left(1-\frac{1}{x}\right)^{2r}- 1 -ax^{-1}-\frac{a}{x}\left(1-\frac{1}{x}\right)^{2r-1}}{x^{-q}}+2\a \\ &=\lim_{x\to+\infty}\frac{-\frac{2r}{q}\left(1-\frac{1}{x}\right)^{2r-1}-\frac{a}{q}-\frac{a}{q}\left(1-\frac{1}{x}\right)^{2r-1}}{x^{1-q}}+2\a=L. \end{align*} Obviously, $L=2\a>0$ if $q<1$ and $L=-2r-2a+2\a$ if $q=1.$ But then $\a>3,$ $a< \a-1$ and $r\le 1$, hence also in this case $L=-2r-2a+2\a>0.$ Consequently, there exists $C>0$ such that $$\phi(x,r)\ge Cx^{2r-q}+cx^{2r-p}>0\mbox{ if }x\mbox{ is big enough}$$ and since $p>1$ one has $$\phi(x,r)=\mathcal{O}(x^{2r-q})\mbox{ as }x\to+\infty.$$ We conclude that there exist $K_2\ge k_0$ such that for all $\frac12< r\le\frac{q+1}{2}$ one has \begin{equation}\label{forspeed} \eta_k\ge0,\mbox{ for all }k\ge K_2\mbox{ and }\eta_k=\mathcal{O}(k^{2r-q})\mbox{ as }k\to+\infty, \end{equation} where $\eta_k:=-\a_k^2b_k^2-\a_k a_kb_k+\a_kb_k^2c_k+b_{k-1}^2-a_{k-1}b_{k-1}.$ The coefficient of $\|x_{k-1}\|^2$ is $\s_{k-1}=\a_kb_k^2c_k$, hence we write the coefficient of $\|x_k\|^2$ as $$b_k^2c_k^2-\a_kb_k^2c_k -a_kb_kc_k=-\sigma_k+(b_k^2c_k^2+\a_{k+1}b_{k+1}^2c_{k+1}-\a_kb_k^2c_k -a_kb_kc_k).$$ We have \begin{align*} b_k^2c_k^2+\a_{k+1}b_{k+1}^2c_{k+1}-\a_kb_k^2c_k -a_kb_kc_k&=c^2k^{2r-2p}+ c(k+1)^{2r-p}-\a c(k+1)^{2r-p-q}\\ &-ck^{2r-p}+\a ck^{2r-p-q}-ack^{2r-1-p}. \end{align*} We show that for all $\frac12< r\le \frac{q+1}{2}$ one has $$\phi(x,r)=c(x+1)^{2r-p}-cx^{2r-p}-\a c(x+1)^{2r-p-q}+\a cx^{2r-p-q}-acx^{2r-1-p}+c^2x^{2r-2p}\le 0$$ for $x$ big enough. Even more, $\phi(x,r)=\mathcal{O}(x^{2r-p-1})$ as $x\to+\infty.$ Indeed, since $1<2r\le q+1\le p$ we have, \begin{align*} &\lim_{x\to+\infty}\frac{c(x+1)^{2r-p}-cx^{2r-p}-\a c(x+1)^{2r-p-q}+\a cx^{2r-p-q}-acx^{2r-1-p}}{x^{2r-p-1}}\\ &=\lim_{x\to+\infty}\left(\frac{c\left(1+\frac{1}{x}\right)^{2r-p}- c}{x^{-1}} +\a c\frac{-\left(1+\frac{1}{x}\right)^{2r-p-q}+1}{x^{q-1}}\right)-ac \\ &=\lim_{x\to+\infty}\frac{c(2r-p)x^{-2}\left(1+\frac{1}{x}\right)^{2r-p-1}}{x^{-2}}-ac=c(2r-p-a)<0. \end{align*} Obviously, there exists $C>0$ such that $$c(x+1)^{2r-p}-cx^{2r-p}-\a c(x+1)^{2r-p-q}+\a cx^{2r-p-q}-acx^{2r-1-p}\le -Cx^{2r-p-1}$$ for $x$ big enough, and from the fact that $p>1$ we get that $\phi(x,r)\le 0$ for $x$ big enough. We conclude that there exist $K_3\ge k_0$ such that for all $\frac12< r\le\frac{q+1}{2}$ one has \begin{equation}\label{signxk} s_k\ge 0\mbox{ for all }k\ge K_3\mbox{ and }s_k=\mathcal{O}(k^{2r-p-1})\mbox{ as }k\to+\infty, \end{equation} where $s_k:=-(b_k^2c_k^2+\a_{k+1}b_{k+1}^2c_{k+1}-\a_kb_k^2c_k -a_kb_kc_k).$ Let $K_0=\max(K_1,K_2,K_3).$ Combining \eqref{forfrate1}, \eqref{forstrxk}, \eqref{forspeed} and \eqref{signxk} we obtain that for all $k\ge K_0$ and $r\in\left(\frac12,\frac{q+1}{2}\right]$ it holds \begin{align}\label{forfrate2} v_{k+1}-v_k\le& -(\mu_k(f(x_{k})-f^*)-\mu_{k-1}(f(x_{k-1})-f^*))-m_k(f(x_{k})-f^*)\\ \nonumber&-(\nu_k\|x_k-x^*\|^2-\nu_{k-1}\|x_{k-1}-x^*\|^2)-n_k\|x_k-x^*\|^2\\ \nonumber&-(\sigma_k\|x_k\|^2-\sigma_{k-1}\|x_{k-1}\|^2)-s_k\|x_k\|^2\\ \nonumber& -\eta_k\|x_k-x_{k-1}\|^2-b_{k-1}^2\l_{k-1}^2\|u_k\|^2+ a_kb_kc_k\|x^*\|^2. \end{align} Consequently \begin{align}\label{energi} E_{k+1}&-E_k+m_k(f(x_{k})-f^*)+\eta_k\|x_k-x_{k-1}\|^2+b_{k-1}^2\l_{k-1}^2\|u_k\|^2+n_k\|x_k-x^*\|^2+s_k\|x_k\|^2\\ \nonumber&\le a_kb_kc_k\|x^*\|^2=ac\|x^*\|^2 k^{2r-1-p}, \end{align} for all $k\ge K_0.$ Now in concordance to the hypotheses of the theorem we take $r<\frac{q+1}{2}$ if $p=q+1$, consequently one has $2r-1-p<-1$, hence $$ac\|x^*\|^2\sum_{k\ge K_0}k^{2r-1-p}<+\infty.$$ By summing up \eqref{energi} from $k=K_0$ to $k=n>K_0$, we obtain that there exists $C_1>0$ such that $$E_{n+1}\le C_1,$$ consequently $$\mu_n(f(x_{n})-f^*)\le C_1,\mbox{ hence }f(x_{n})-f^*=\mathcal{O}(n^{-2r-\d})\mbox{ as }n\to+\infty,$$ $$\nu_n\|x_n-x^*\|^2\le C_1,\mbox{ hence }\|x_n-x^*\|^2=\mathcal{O}(n^{q+1-2r})\mbox{ as }n\to+\infty,$$ $$\s_n\|x_n\|^2\le C_1,\mbox{ hence }\|x_n\|^2=\mathcal{O}(n^{p-2r})\mbox{ as }n\to+\infty$$ and $$\sup_{n\ge 1}\|an^{r-1}(x_n-x^*)+n^{r}(x_{n+1}-x_{n}+\l n^{\d}u_{n+1})\|<+\infty.$$ Further, \begin{align*}&\sum_{k= K_0}^n m_k(f(x_{k})-f^*)\le C_1,\mbox{ hence according to \eqref{signm} one has }\sum_{k\ge 1}k^{2r+\d-1}(f(x_{k})-f^*)<+\infty,\\ &\sum_{k= K_0}^n \eta_k\|x_k-x_{k-1}\|^2\le C_1,\mbox{ hence according to \eqref{forspeed} one has }\sum_{k\ge 1}k^{2r-q}\|x_k-x_{k-1}\|^2<+\infty,\\ &\sum_{k= K_0}^n b_{k-1}^2\l_{k-1}^2\|u_k\|^2\le C_1,\mbox{ hence one has }\sum_{k\ge 1}k^{2r+2\d}\|u_k\|^2<+\infty,\\ &\sum_{k= K_0}^n s_k\|x_k\|^2\le C_1,\mbox{ hence according to \eqref{signxk} one has }\sum_{k\ge 1}k^{2r-p-1}\|x_k\|^2<+\infty. \end{align*} Moreover, $\sum_{k= K_0}^n n_k\|x_k-x^*\|^2\le C_1,$ hence according to \eqref{forstrxk} one has $$\sum_{k\ge 1}k^{q-p}\|x_k-x^*\|^2<+\infty,\mbox{ if }r=\frac{q+1}{2}$$ and $$\sum_{k\ge 1}k^{2r-2-q}\|x_k-x^*\|^2<+\infty,\mbox{ if }r<\frac{q+1}{2}.$$ Since $\sum_{k\ge 1}k^{2r+2\d}\|u_k\|^2<+\infty$ one has $\|u_n\|=o(n^{-r-\d})$ as $n\to +\infty$ which yields $$\sup_{n\ge 1}\|an^{r-1}(x_n-x^*)+n^{r}(x_{n+1}-x_{n})\|<+\infty.$$ Combining the latter relation with the facts that $\|x_n-x^*\|^2=\mathcal{O}(n^{q+1-2r})\mbox{ as }n\to+\infty$ and $n^{r-1}\le n^{\frac{2r-q-1}{2}}$ we obtain $$\|x_{n+1}-x_n\|=\mathcal{O}(n^{-r})\mbox{ as }n\to+\infty.$$ Let us show now, that for $\frac12<r<\frac{q+1}{2}$ one has $f(x_n)-f^*= o(n^{-2r-\d})$ and $\|x_n-x_{n-1}\|=o(n^{-r}).$ From \eqref{energi} we get $$\sum_{k\ge 1} [(E_{k+1}-E_{k}]_+<+\infty,\mbox{ where }[s]_+=\max(s,0).$$ Therefore, the following limit exists \begin{equation}\label{foroest} \lim_{k\to+\infty}(\|ak^{r-1}(x_k-x^*)+k^{r}(x_{k+1}-x_{k}+\l k^{\d}u_{k+1})\|^2+\s_k\|x_k\|^2+\mu_k (f(x_{k})-f^*)+\nu_k\|x_k-x^*\|^2). \end{equation} Note that according to \eqref{signsigma}, \eqref{signmu} and \eqref{signnu} one has $\s_k=\mathcal{O}(k^{2r-p}),\,\mu_k=\mathcal{O}(k^{2r+\d})$ and $\nu_k=\mathcal{O}(k^{2r-1-q}),$ respectively. Further, we have $\sum_{k\ge 1} k^{2r-2-q}\|x_k-x^*\|^2<+\infty$, if $r<\frac{q+1}{2}$, $\sum_{k\ge 1} k^{2r-q}\|x_k-x_{k-1}\|^2<+\infty$, $\sum_{k\ge 1} k^{2r+2\d}\|u_k\|^2< +\infty$, $\sum_{k\ge 1}k^{2r+\d-1}(f(x_{k})-f^*)< +\infty$ and $\sum_{k\ge 1} k^{2r-1-p}\|x_k\|^2<+\infty$, hence \begin{align}\label{foroest1} &\sum_{k\ge 1}\frac{1}{k}(\|ak^{r-1}(x_k-x^*)+k^{r}(x_{k+1}-x_{k}+\l k^{\d}u_{k+1})\|^2+\s_k\|x_k\|^2+\mu_k (f(x_{k})-f^*)+\nu_k\|x_k-x^*\|^2)\\ \nonumber&\le \sum_{k\ge 1}2a^2k^{2r-3}\|x_k-x^*\|^2+\sum_{k\ge 1}4 k^{2r-1}\|x_{k+1}-x_{k}\|^2+\sum_{k\ge 1}4 \l^2(k+1)^{2r+2\d-1}\|u_{k+1})\|^2\\ \nonumber&+C\left(\sum_{k\ge 1}k^{2r-p-1}\|x_k\|^2+\sum_{k\ge 1}k^{2r+\d-1} (f(x_{k})-f^*)+\sum_{k\ge 1}k^{2r-2-q}\|x_k-x^*\|^2\right)<+\infty, \end{align} for some constant $C>0.$ Combining the facts that $\sum_{k\ge 1}\frac{1}{k}=+\infty$ and $\|u_n\|=o(n^{-r-\d})$ as $n\to +\infty$ with \eqref{foroest1} and \eqref{foroest} we get $$\lim_{k\to+\infty}(\|ak^{r-1}(x_k-x^*)+k^{r}(x_{k+1}-x_{k}+\l k^\d u_{k+1})\|^2+\s_k\|x_k\|^2+\mu_k (f(x_{k})-f^*)+\nu_k\|x_k-x^*\|^2)=0$$ and the claim follows. \end{proof} \subsection{Weak convergence of the generated sequences} In this section we provide sufficient conditions that assure that the sequence $(x_k)$ generated by the algorithm \eqref{algo} converges weakly to a minimizer of $f.$ In order to continue our analysis we need the following lemma, which is an extension of Lemma 8.3 from \cite{ACR1}. \begin{lemma}\label{lforwconv} Assume that $(a_k)_{k\ge 1},\,(\omega_k)_{k\ge 1}$ are nonnegative real sequences that after an index $k_0$ satisfy $$a_{k+1}\le \left(1-\frac{\a}{k^q}\right) a_k+\omega_k,\mbox{ for all }k\ge k_0,$$ where $q\in\left]0,1\right]$ and for $q=1$ one has $\a>1.$ Assume further, that $\sum_{k\ge k_0}k^q\omega_k<+\infty.$ Then, $$\sum_{k\ge 1} a_k<+\infty.$$ \end{lemma} \begin{proof} We have $k^qa_{k+1}-k^q a_k+\a a_k\le k^q\omega_k,\mbox{ for all }k\ge k_0.$ If $q=1$ then $\a>1$ hence we have for all $k\ge k_0$ that $k a_{k+1}-k a_k+\a a_k= ka_{k+1}-(k-1) a_k+(\a-1) a_k,$ consequently $$ka_{k+1}-(k-1) a_k+(\a-1) a_k\le k\omega_k,\mbox{ for all }k\ge k_0.$$ By summing up the latter relation from $k=k_0$ to $k=n>k_0$ we get $$na_{n+1}+(\a-1)\sum_{k=k_0}^n a_k\le (k_0-1)a_{k_0}+\sum_{k=k_0}^n k\omega_k.$$ Now, we omit the term $na_{n+1}$ and we take the limit $n\to+\infty$ in order to show that $$\sum_{k=k_0}^{+\infty} a_k\le \frac{(k_0-1)a_{k_0}}{\a-1}+\frac{1}{\a-1}\sum_{k=k_0}^{+\infty} k\omega_k<+\infty.$$ If $q<1$ then, since $\lim_{k\to+\infty}\frac{k^q-(k-1)^q}{k^{q-1}}=q>0,$ we conclude that there exists $C>0$ and $k_1\ge k_0$ such that $k^q-(k-1)^q\le C k^{q-1}$ for all $k\ge k_1.$ Hence, there exists $k_2\ge k_1$ such that for all $k\ge k_2$ one has $$-k^q\ge -(k-1)^q-C k^{q-1}\ge -(k-1)^q-\frac{\a}{2}.$$ Consequently $k^qa_{k+1}-(k-1)^q a_k+\frac{\a}{2} a_k\le k^q\omega_k,\mbox{ for all }k\ge k_2.$ By summing up the latter relation from $k=k_2$ to $k=n>k_2$ we get $$n^q a_{n+1}+\frac{\a}{2}\sum_{k=k_2}^n a_k\le (k_2-1)^q a_{k_2}+\sum_{k=k_2}^n k^q\omega_k$$ and the conclusion follows. \end{proof} Now we can prove the weak convergence of the sequences generated by algorithm \eqref{algo} to a minimizer of the objective function $f.$ \begin{Theorem}\label{weakconvergencealgorithm} Assume that $\a>0,$ $0<q<1,0\le \d,\,q+1<p\le 2$ and for $p=2$ one has $c>q(1-q)$, or $q=1$, $p>2$, $\a>3,\,0\le\d<\a-3.$ Then the sequence $(x_n)$ generated by \eqref{algo} converges weakly to a minimizer of $f.$ \end{Theorem} \begin{proof} We use the Opial lemma (see \cite{opial}). To this purpose first we show that for all $x^*\in\argmin f$ the limit $\lim_{k\to+\infty}\|x_k-x^*\|$ exists. Let $x^*\in\argmin f$ and for all $k\ge 1$ consider the sequence $h_k=\frac12\|x_k-x^*\|^2.$ Then, by using \eqref{algo} we have \begin{align}\label{forwconv} h_{k+1}-h_k&=\frac12\|x_{k+1}-x_k\|^2+\<x_{k+1}-x_k,x_k-x^*\>\\ \nonumber&=\frac12\|x_{k+1}-x_k\|^2+\<\a_k(x_{k}-x_{k-1})-\l_k u_{k+1}-c_k x_k,x_k-x^*\>. \end{align} Further, one has $$\<\a_k(x_{k}-x_{k-1}),x_k-x^*\>=\frac{\a_k}{2}(\|x_{k}-x_{k-1}\|^2+\|x_k-x^*\|^2-\|x_{k-1}-x^*\|^2),$$ $$\<-\l_k u_{k+1},x_k-x^*\>\le\frac{\l}{2}(k^{1-q}\|x_{k+1}-x_k\|^2+k^{q+2\d-1}\|u_{k+1}\|^2)$$ and $$\<-c_k x_k,x_k-x^*\>=\frac{c_k}{2}(\|x^*\|^2-\|x_k\|^2-\|x_k-x^*\|^2).$$ Consequently, \eqref{forwconv} leads to \begin{align}\label{forwconv1} h_{k+1}-h_k&\le \a_k(h_k-h_{k-1})+\frac{\a_k}{2}\|x_{k}-x_{k-1}\|^2+\frac12\|x_{k+1}-x_k\|^2+\frac{\l}{2}k^{1-q}\|x_{k+1}-x_k\|^2\\ \nonumber&+\frac{\l}{2}k^{q+2\d-1}\|u_{k+1}\|^2+\frac{c_k}{2}\|x^*\|^2. \end{align} We use Lemma \ref{lforwconv} with $a_k=[h_k-h_{k-1}]_+$ and $\omega_k=\frac{\a_k}{2}\|x_{k}-x_{k-1}\|^2+\frac12\|x_{k+1}-x_k\|^2+\frac{\l}{2}k^{1-q}\|x_{k+1}-x_k\|^2+\frac{\l}{2}k^{q+2\d-1}\|u_{k+1}\|^2+\frac{c_k}{2}\|x^*\|^2.$ Hence, we need to show that $\sum_{k\ge 1}k^q\omega_k<+\infty.$ According to Theorem \ref{convergencealgorithm} (i) and the fact that $p>q+1$ we have $$\sum_{k\ge 1}k\|x_{k}-x_{k-1}\|^2<+\infty,\,\sum_{k=1}^{+\infty} k^{q+2\d+1}\|u_k\|^2<+\infty\mbox{ and }\sum_{k\ge 1}k^q c_k=\sum_{k\ge 1}\frac{c}{k^{p-q}}<+\infty.$$ Now, it is obvious that $\sum_{k=1}^{+\infty} k^{2q+2\d-1}\|u_{k+1}\|^2<+\infty.$ Consequently, $\sum_{k\ge 1}k^q\omega_k<+\infty$ and by Lemma \ref{lforwconv} we get that $$\sum_{k\ge 1}[h_k-h_{k-1}]_+<+\infty,$$ which shows that $\lim_{k\to+\infty}\|x_k-x^*\|$ exists. Next we show that every weak sequential cluster point of $(x_k)$ belongs to $\argmin f.$ Indeed, let $x^*$ a weak sequential cluster point of $(x_k).$ Then there exists an increasing sequence of natural numbers $(k_n)$ with $k_n\to+\infty,\mbox{ as }n\to+\infty$, such that $x_{k_n}\rightharpoonup x^*\mbox{ as }n\to+\infty,$ where "$\rightharpoonup$" denotes the convergence with respect of weak topology of $\cH.$ Since $f$ is convex and lower semicontinuos it is also lower semicontinuous with respect to the weak topology of $\cH$. Further, according to Theorem \ref{convergencealgorithm} one has $\lim_{n\to+\infty}f(x_{k_n})=\min_{\cH}f,$ hence $$f(x^*)\le\liminf_{n\to+\infty}f(x_{k_n})=\min_{\cH}f,$$ which shows that $x^*\in\argmin f.$ Consequently, Opial's lemma yields that the sequence $(x_n)$ converges weakly to a minimizer of our objective function $f.$ \end{proof} \section{Convergence rates and strong convergence results for the case $p\le q+1$} We continue the present section by emphasizing the main idea behind the Tikhonov regularization, which will assure strong convergence results for the sequence generated our algorithm \eqref{algo} to a minimizer of the objective function of minimal norm. By $\ox_{k}$ we denote the unique solution of the strongly convex minimization problem \begin{align*} \min_{x \in \mathcal{H}} \left( f(x) + \frac{c}{2k^p} \| x \|^2 \right). \end{align*} We know, (see for instance \cite{att-com1996}), that $\lim\limits_{k \to +\infty} \ox_{k}=x^\ast$, where $x^\ast = \argmin\limits_{x \in \argmin f} \| x \|$ is the minimal norm element from the set $\argmin f.$ Obviously, $\{x^*\}=\pr_{\argmin f} 0$ and we have the inequality $\| \ox_{k} \| \leq \| x^\ast \|$ (see \cite{BCL}). Since $\ox_{k}$ is the unique minimum of the strongly convex function $f_k(x)=f(x)+\frac{c}{2k^p}\|x\|^2,$ obviously one has \begin{equation}\label{fontos0} \p f_k(\ox_{k})=\p f(\ox_{k})+\frac{c}{k^p}\ox_{k}\ni0. \end{equation} Further, a discrete version of Lemma 2 from \cite{ABCR} is the following. \begin{lemma}\label{lfos} For all $k\ge 1$ one has $$\left(\left(1+\frac{1}{k}\right)^p-1\right)\<\ox_k,\ox_{k+1}-\ox_{k}\>\ge\|\ox_{k+1}-\ox_{k}\|^2$$ and $$\left(1-\left(1-\frac{1}{k+1}\right)^p\right)\<\ox_{k+1},\ox_{k+1}-\ox_{k}\>\ge\|\ox_{k+1}-\ox_{k}\|^2$$ Consequently, for every $p_1>p$ there exists $k_0\ge 1$ such that \begin{equation* \left\|\ox_{k+1}-\ox_k\right\|\le\min\left(\frac{p_1}{k}\|\ox_{k}\|,\frac{p_1}{k+1}\|\ox_{k+1}\|\right)\mbox{ for every } k\ge k_0. \end{equation*} \end{lemma} \begin{proof} Indeed, we have $-\frac{c}{k^p}\ox_{k}\in \p f(\ox_{k})$ and $-\frac{c}{(k+1)^p}\ox_{k+1}\in \p f(\ox_{k+1})$ and by using the monotonicity of $\p f$ we get $$\left\<\left(-\frac{c}{(k+1)^p}\ox_{k+1}\right)-\left(-\frac{c}{k^p}\ox_{k}\right),\ox_{k+1}-\ox_{k}\right\>\ge 0.$$ In other words $$-\frac{c}{(k+1)^p}\<\ox_{k+1}-\ox_{k},\ox_{k+1}-\ox_{k}\>+\left(\frac{c}{k^p}-\frac{c}{(k+1)^p}\right)\<\ox_k,\ox_{k+1}-\ox_{k}\>\ge 0$$ or, equivalently $$\left(\left(1+\frac{1}{k}\right)^p-1\right)\<\ox_k,\ox_{k+1}-\ox_{k}\>\ge\|\ox_{k+1}-\ox_{k}\|^2.$$ But, $\<\ox_k,\ox_{k+1}-\ox_{k}\>=-\|\ox_{k+1}-\ox_{k}\|^2+\<\ox_{k+1},\ox_{k+1}-\ox_{k}\>$ hence $$\left(\left(1+\frac{1}{k}\right)^p-1\right)\<\ox_{k+1},\ox_{k+1}-\ox_{k}\>\ge\left(1+\frac{1}{k}\right)^p\|\ox_{k+1}-\ox_{k}\|^2.$$ Equivalently, we can write $$\left(1-\left(1-\frac{1}{k+1}\right)^p\right)\<\ox_{k+1},\ox_{k+1}-\ox_{k}\>\ge\|\ox_{k+1}-\ox_{k}\|^2.$$ Now, since $\lim_{k\to+\infty}\frac{\left(1+\frac{1}{k}\right)^p-1}{k^{-1}}=\lim_{k\to+\infty}\frac{1-\left(1-\frac{1}{k+1}\right)^p}{{(k+1)}^{-1}}=p$, we conclude that for all $p_1>p$ there exists $k_0\ge 1$ such that $$\left(1+\frac{1}{k}\right)^p-1\le \frac{p_1}{k}\mbox{ and }1-\left(1-\frac{1}{k+1}\right)^p\le\frac{p_1}{k+1}\mbox{ for all }k\ge k_0.$$ Consequently $$\left(\left(1+\frac{1}{k}\right)^p-1\right)\<\ox_k,\ox_{k+1}-\ox_{k}\>\le \frac{p_1}{k}\|\ox_k\|\|\ox_{k+1}-\ox_k\|\mbox{ for all }k\ge k_0,$$ $$\left(1-\left(1-\frac{1}{k+1}\right)^p\right)\<\ox_{k+1},\ox_{k+1}-\ox_{k}\>\le\frac{p_1}{k+1}\|\ox_{k+1}\|\|\ox_{k+1}-\ox_{k}\|\mbox{ for all }k\ge k_0$$ and the conclusion follows. \end{proof} Note that since $f_k$ is strongly convex, from the subgradient inequality we have \begin{equation}\label{fontos2} f_k(y)-f_k(x)\ge\<u_k,y-x\>+\frac{c}{2k^p}\|x-y\|^2,\mbox{ for all }x,y\in\mathcal{H}\mbox{ and }u_k\in\p f_k(x). \end{equation} In particular \begin{equation}\label{fontos3} f_k(x)-f_k(\ox_k)\ge\frac{c}{2k^p}\|x-\ox_k\|^2,\mbox{ for all }x\in\mathcal{H}. \end{equation} Finally, observe that for all $x,y\in\mathcal{H}$, one has \begin{equation}\label{fontos5} f(x)-f(y)=(f_k(x)-f_k(\ox_k))+(f_k(\ox_k)-f_k(y))+\frac{c}{2k^p}(\|y\|^2-\|x\|^2)\le f_k(x)-f_k(\ox_k)+\frac{c}{2k^p}\|y\|^2. \end{equation} \subsection{Convergence rates} Concerning convergence rates for the function values, discrete velocity and subgradient even for this restrictive case we obtain some results that are comparable to the convergence rates obtained for the famous Nesterov algorithm \cite{Nest1}. The main result of the present section is the following. \begin{Theorem}\label{strconvergencerates} Assume that $0<q< 1$, $1<p\le q+1$, $\l_k=\l k^\d,\,\l>0,\,\d\le 0$ and if $\d=0$ then $\l\in]0,1[.$ Let $(x_k)$ be a sequence generated by \eqref{algo}. For every $k\ge 2$ let us denote by $u_k$ the element from $\p f(x_k)$ that satisfies \eqref{formx} with equality, i.e., $$x_{k}=\a_{k-1}(x_{k-1}-x_{k-2})-\l_{k-1} u_k +\left(1- c_{k-1}\right) x_{k-1}.$$ Then the following results are valid. \begin{enumerate} \item[(i)] If $p<q+1$ then $(x_k)$ is bounded and \[f(x_k)-\min_{\cH} f=\mathcal{O}(k^{-p-\d}),\,\|x_{k}-x_{k-1}\|=\mathcal{O}(k^{-\frac{p}{2}})\mbox{ and }\|u_k\|=\mathcal{O}(k^{-\frac{p}{2}-\d})\mbox{ as } k\to+\infty.\] Further, for all $s\in\left]\frac12,\frac{p}{2}\right[$ one has \[\ds\sum_{k=1}^{+\infty} k^{2s+\d-1}(f(x_k)-\min_{\cH} f)<+\infty,\,\ds\sum_{k=1}^{+\infty} k^{2s-q}\|x_k-x_{k-1}\|^2<+\infty\mbox{ and }\ds\sum_{k=2}^{+\infty} k^{2s+2\d}\|u_k\|^2<+\infty.\] Moreover, the following ergodic type convergence results hold. $$\limsup_{n\to+\infty}\frac{\sum_{k=1}^n k^{q+\d}(f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))}{n^{q+1-p}}<+\infty, \limsup_{n\to+\infty}\frac{\sum_{k=1}^n k\|x_{k}-x_{k-1}\|^2}{n^{q+1-p}}<+\infty$$ $$\mbox{ and } \limsup_{n\to+\infty}\frac{\sum_{k=1}^n k^{q+1+2\d}\|u_k\|^2}{n^{q+1-p}}<+\infty.$$ \item[(ii)] If $p=q+1$ then \[f(x_k)-\min_{\cH} f=\mathcal{O}(k^{-p-\d}\ln k),\,\|x_{k}-x_{k-1}\|=\mathcal{O}(k^{-\frac{p}{2}}\sqrt{\ln k})\mbox{ and }\|u_k\|=\mathcal{O}(k^{-\frac{p}{2}-\d}\sqrt{\ln k})\mbox{ as } k\to+\infty.\] Further, for all $s\in\left]\frac12,\frac{p}{2}\right[$ one has \[\ds\sum_{k=1}^{+\infty} k^{2s+\d-1}(f(x_k)-\min_{\cH} f)<+\infty,\,\ds\sum_{k=1}^{+\infty} k^{2s-q}\|x_k-x_{k-1}\|^2<+\infty\mbox{ and }\ds\sum_{k=2}^{+\infty} k^{2s+2\d}\|u_k\|^2<+\infty.\] Moreover, the following ergodic type convergence results hold. $$\limsup_{n\to+\infty}\frac{\sum_{k=1}^n k^{q+\d}(f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))}{\ln n}<+\infty, \limsup_{n\to+\infty}\frac{\sum_{k=1}^n k\|x_{k}-x_{k-1}\|^2}{\ln n}<+\infty$$ $$\mbox{ and } \limsup_{n\to+\infty}\frac{\sum_{k=1}^n k^{q+1+2\d}\|u_k\|^2}{\ln n}<+\infty.$$ Additionally, if $\d<0$ one has $$\limsup_{n\to+\infty}\frac{\sum_{k=1}^n k^{q+\d}(f(x_{k-1})-\min_{\cH} f)}{\ln n}<+\infty.$$ \end{enumerate} \end{Theorem} \begin{proof} Consider $a_k=ak^{r-1},\,b_k=k^{r},\, a>1+q,\,r\in\left(\frac12, \frac{q+1}{2}\right]$ and define, for every $k \geq 2$, the following discrete energy functional. \begin{align}\label{Lyapunovstr} E_k&=\mu_{k-1}(f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))+ \| a_{k-1}(x_{k-1}-\ox_{k-1}) +b_{k-1} (x_k-x_{k-1}+\l_{k-1}u_k)\|^2\\ \nonumber&+\nu_{k-1}\|x_{k-1}-\ox_{k-1}\|^2+\sigma_{k-1}\|x_{k-1}\|^2, \end{align} where $\mu_k=2b_{k-1}^2\l_{k-1}$, $\nu_k=-a_k^2-\a_k a_kb_k+a_kb_kc_k+a_{k-1}b_{k-1}$ and $\sigma_k=-b_k^2c_k^2+\a_kb_k^2c_k +a_kb_kc_k-b_{k-1}^2\l_{k-1}c_k$ for all $k\ge 1.$ Next we show that all the sequences defined above are positive after an index $K_0$ big enough. For an easier readability we emphasize that by $h_k-\mathcal{O}(k^l)$ we understand the difference of a sequence $h_k$ and a positive sequence of order $\mathcal{O}(k^l)$ as $k\to+\infty.$ Similarly, by $h_k+\mathcal{O}(k^l)$ we understand the sum of a sequence $h_k$ and a positive sequence of order $\mathcal{O}(k^l)$ as $k\to+\infty.$ Further, by $s\mathcal{O}(k^l),\,s>0$ we understand the positive sequences $u_k$ that after an index satisfy $u_k\le s k^l.$ All the estimates bellow hold after an index $K_0$ big enough. Obviously, one has \begin{align}\label{ordmu} &\mu_k=2\l(k-1)^{2r+\d}>0\mbox{ and }\mu_k=\mathcal{O}(k^{2r+\d}). \end{align} Further, since $q<1<p$ one has \begin{align}\label{ordnu} \nu_k&=-a^2k^{2r-2}-\left(1-\frac{\a}{k^q}\right) ak^{2r-1}+ack^{2r-1-p}+a(k-1)^{2r-1}\\ \nonumber&=a\a k^{2r-1-q}-\mathcal{O}(k^{2r-2})+\mathcal{O}(k^{2r-1-p})>0\mbox{ and }\nu_k=\mathcal{O}(k^{2r-1-q}). \end{align} Now, since $\l_k=\l k^\d<1$, for $k$ big enough, i.e. $\d\le 0$ and $0<\l<1$ if $\d=0$, one has \begin{align}\label{ordsigma} \sigma_k&=-c^2k^{2r-2p}+\left(1-\frac{\a}{k^q}\right)ck^{2r-p} +ack^{2r-1-p}-\l c(k-1)^{2r+\d}k^{-p}\\ \nonumber&=ck^{-p}(k^{2r}-\l(k-1)^{2r+\d})+ack^{2r-1-p} -\a ck^{2r-q-p}-c^2k^{2r-2p}\\ \nonumber&=ck^{-p}(k^{2r}-\l(k-1)^{2r+\d})+\mathcal{O}(k^{2r-1-p})-\mathcal{O}(k^{2r-q-p})-\mathcal{O}(k^{2r-2p})>0\mbox{ and }\s_k=\mathcal{O}(k^{2r-p}). \end{align} Consequently, $E_k\ge 0$ for all $k\ge K_0.$ \vskip0.3cm {\bf I. Lyapunov analysis} \vskip0.3cm Now, if we denote $v_k= \| a_{k-1}(x_{k-1}-\ox_{k-1}) +b_{k-1} (x_k-x_{k-1}+\l_{k-1}u_k)\|^2$ then proceeding as in the proof of Theorem \eqref{convergencealgorithm} we obtain \begin{align}\label{forEk1str} v_k=&a_{k-1}b_{k-1}\|x_k-\ox_{k-1}\|^2+(a_{k-1}^2-a_{k-1}b_{k-1})\|x_{k-1}-\ox_{k-1}\|^2+(b_{k-1}^2-a_{k-1}b_{k-1})\|x_k-x_{k-1}\|^2\\ \nonumber&+b_{k-1}^2\l_{k-1}^2\|u_k\|^2+2a_{k-1}b_{k-1}\l_{k-1}\<u_k,x_{k}-\ox_{k-1}\>\\ \nonumber&+(2b_{k-1}^2-2a_{k-1}b_{k-1})\l_{k-1}\<u_k,x_k-x_{k-1}\>. \end{align} Further, from (\ref{discreteenergy}) we have $$v_{k+1}=\|a_{k}(x_{k}-\ox_k)+b_{k}(\a_k(x_k-x_{k-1})-c_k x_k)\|^2.$$ Therefore, after development we get \begin{align}\label{forEkstr+1} v_{k+1}=&a_k^2\|x_k-\ox_k\|^2+\a_k^2b_k^2\|x_k-x_{k-1}\|^2+b_k^2c_k^2\|x_k\|^2+2\a_k a_kb_k\<x_k-x_{k-1},x_k-\ox_k\> \\ \nonumber&-2\a_kb_k^2c_k\<x_k-x_{k-1},x_k\>-2a_kb_kc_k\<x_k,x_k-\ox_k\>. \end{align} Further, \begin{eqnarray*} &&2\a_k a_kb_k\<x_k-x_{k-1},x_k-\ox_k\>=-\a_k a_kb_k(\|x_{k-1}-\ox_k\|-\|x_k-x_{k-1}\|^2-\|x_k-\ox_k\|^2) \\ &&-2\a_kb_k^2c_k\<x_k-x_{k-1},x_k\>=\a_kb_k^2c_k(\|x_{k-1}\|^2-\|x_k-x_{k-1}\|^2-\|x_k\|^2) \\ &&-2a_kb_kc_k\<x_k,x_k-\ox_k\>=a_kb_kc_k(\|\ox_k\|^2-\|x_k-\ox_k\|^2-\|x_k\|^2). \end{eqnarray*} Hence, (\ref{forEkstr+1}) yields \begin{align}\label{forEkstr+11} v_{k+1}&=(a_k^2+\a_k a_kb_k-a_kb_kc_k)\|x_k-\ox_k\|^2-\a_k a_kb_k\|x_{k-1}-\ox_k\|^2 \\ \nonumber& +(\a_k^2b_k^2+\a_k a_kb_k-\a_kb_k^2c_k)\|x_k-x_{k-1}\|^2+(b_k^2c_k^2-\a_kb_k^2c_k -a_kb_kc_k)\|x_k\|^2\\ \nonumber&+\a_kb_k^2c_k\|x_{k-1}\|^2+a_kb_kc_k\|\ox_k\|^2. \end{align} Consequently, one has \begin{align}\label{forEkstrdecay} v_{k+1}-v_k&=(a_k^2+\a_k a_kb_k-a_kb_kc_k)\|x_k-\ox_k\|^2-a_{k-1}b_{k-1}\|x_k-\ox_{k-1}\|^2\\ \nonumber&-\a_k a_kb_k\|x_{k-1}-\ox_k\|^2-(a_{k-1}^2-a_{k-1}b_{k-1})\|x_{k-1}-\ox_{k-1}\|^2 \\ \nonumber& +(\a_k^2b_k^2+\a_k a_kb_k-\a_kb_k^2c_k-b_{k-1}^2+a_{k-1}b_{k-1})\|x_k-x_{k-1}\|^2\\ \nonumber&+(b_k^2c_k^2-\a_kb_k^2c_k -a_kb_kc_k)\|x_k\|^2+\a_kb_k^2c_k\|x_{k-1}\|^2-b_{k-1}^2\l_{k-1}^2\|u_k\|^2\\ \nonumber&+(2b_{k-1}^2-2a_{k-1}b_{k-1})\l_{k-1}\<u_k,x_{k-1}-x_k\>\\ \nonumber& +2a_{k-1}b_{k-1}\l_{k-1}\<u_k,\ox_{k-1}-x_{k}\>+a_kb_kc_k\|\ox_k\|^2. \end{align} Now, by using the sub-gradient inequality we get \begin{align}\label{fforEK3} (2b_{k-1}^2&-2a_{k-1}b_{k-1})\l_{k-1}\<u_k,x_{k-1}-x_k\>+2a_{k-1}b_{k-1}\l_{k-1}\<u_k,\ox_{k-1}-x_{k}\>\\ \nonumber\le& -2b_{k-1}^2\l_{k-1}f(x_k)+(2b_{k-1}^2-2a_{k-1}b_{k-1})\l_{k-1}f(x_{k-1})+2a_{k-1}b_{k-1}\l_{k-1}f(\ox_{k-1})\\ \nonumber=& -2b_{k-1}^2\l_{k-1}(f_k(x_k)-f_k(\ox_k))+2b_{k-2}^2\l_{k-2}(f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))\\ \nonumber&+[(2b_{k-1}^2-2a_{k-1}b_{k-1})\l_{k-1}-2b_{k-2}^2\l_{k-2}](f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))\\ \nonumber&+2b_{k-1}^2\l_{k-1}(f_{k-1}(\ox_{k-1})-f_k(\ox_{k}))\\ \nonumber&+b_{k-1}^2\l_{k-1}c_k\|x_k\|^2+(a_{k-1}b_{k-1}\l_{k-1}c_{k-1}-b_{k-1}^2\l_{k-1}c_{k-1})\|x_{k-1}\|^2\\ \nonumber&-a_{k-1}b_{k-1}\l_{k-1}c_{k-1}\|\ox_{k-1}\|^2. \end{align} Further, according to (30) one has $f_{k-1}(\ox_{k})-f_{k-1}(\ox_{k-1})\ge\frac{c_{k-1}}{2}\|\ox_k-\ox_{k-1}\|^2$ hence \begin{align*} 2b_{k-1}^2\l_{k-1}(f_{k-1}(\ox_{k-1})-f_k(\ox_{k}))&=2b_{k-1}^2\l_{k-1}\left(f_{k-1}(\ox_{k-1})-f_{k-1}(\ox_{k})+\frac{c_{k-1}-c_k}{2}\|\ox_{k}\|^2\right)\\ &\le 2b_{k-1}^2\l_{k-1}\left(-\frac{c_{k-1}}{2}\|\ox_k-\ox_{k-1}\|^2+\frac{c_{k-1}-c_k}{2}\|\ox_{k}\|^2\right) \end{align*} hence \eqref{fforEK3} becomes \begin{align}\label{fforEK4} (2b_{k-1}^2&-2a_{k-1}b_{k-1})\l_{k-1}\<u_k,x_{k-1}-x_k\>+2a_{k-1}b_{k-1}\l_{k-1}\<u_k,\ox_{k-1}-x_{k}\>\\ \nonumber\le& -2b_{k-1}^2\l_{k-1}(f_k(x_k)-f_k(\ox_k))+2b_{k-2}^2\l_{k-2}(f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))\\ \nonumber&+[(2b_{k-1}^2-2a_{k-1}b_{k-1})\l_{k-1}-2b_{k-2}^2\l_{k-2}](f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))\\ \nonumber&+b_{k-1}^2\l_{k-1}c_k\|x_k\|^2+(a_{k-1}b_{k-1}\l_{k-1}c_{k-1}-b_{k-1}^2\l_{k-1}c_{k-1})\|x_{k-1}\|^2\\ \nonumber&+b_{k-1}^2\l_{k-1}(c_{k-1}-c_k)\|\ox_{k}\|^2-a_{k-1}b_{k-1}\l_{k-1}c_{k-1}\|\ox_{k-1}\|^2-b_{k-1}^2\l_{k-1}c_{k-1}\|\ox_k-\ox_{k-1}\|^2. \end{align} Combining \eqref{forEkstrdecay} and \eqref{fforEK4} we get \begin{align}\label{forEkstrdecay1} &v_{k+1}-v_k +2b_{k-1}^2\l_{k-1}(f_k(x_k)-f_k(\ox_k))-2b_{k-2}^2\l_{k-2}(f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))\\ \nonumber&-[(2b_{k-1}^2-2a_{k-1}b_{k-1})\l_{k-1}-2b_{k-2}^2\l_{k-2}](f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))+b_{k-1}^2\l_{k-1}^2\|u_k\|^2\\ \nonumber&\le (a_k^2+\a_k a_kb_k-a_kb_kc_k)\|x_k-\ox_k\|^2-a_{k-1}b_{k-1}\|x_k-\ox_{k-1}\|^2\\ \nonumber&-\a_k a_kb_k\|x_{k-1}-\ox_k\|^2-(a_{k-1}^2-a_{k-1}b_{k-1})\|x_{k-1}-\ox_{k-1}\|^2\\ \nonumber& +(\a_k^2b_k^2+\a_k a_kb_k-\a_kb_k^2c_k-b_{k-1}^2+a_{k-1}b_{k-1})\|x_k-x_{k-1}\|^2\\ \nonumber&+(b_k^2c_k^2-\a_kb_k^2c_k -a_kb_kc_k+b_{k-1}^2\l_{k-1}c_k)\|x_k\|^2\\ \nonumber&+(a_{k-1}b_{k-1}\l_{k-1}c_{k-1}-b_{k-1}^2\l_{k-1}c_{k-1}+\a_kb_k^2c_k)\|x_{k-1}\|^2\\ \nonumber&+[b_{k-1}^2\l_{k-1}(c_{k-1}-c_k)+a_kb_kc_k]\|\ox_{k}\|^2-a_{k-1}b_{k-1}\l_{k-1}c_{k-1}\|\ox_{k-1}\|^2\\ \nonumber&-b_{k-1}^2\l_{k-1}c_{k-1}\|\ox_k-\ox_{k-1}\|^2. \end{align} We estimate in what follows the entities $-a_{k-1}b_{k-1}\|x_k-\ox_{k-1}\|^2$ and $-\a_k a_kb_k\|x_{k-1}-\ox_k\|^2.$ Using the straightforward inequality $\pm 2\<a,b\>\le \frac{1}{s}\|a\|^2+s\|b\|^2$ for all $s>0$ we obtain that \begin{align}\label{interm1} -a_{k-1}b_{k-1}\|x_k-\ox_{k-1}\|^2&=-a_{k-1}b_{k-1}\|(x_k-\ox_k)+(\ox_k-\ox_{k-1})\|^2=-a_{k-1}b_{k-1}\|x_k-\ox_{k}\|^2\\ \nonumber&-a_{k-1}b_{k-1}\|\ox_k-\ox_{k-1}\|^2-2a_{k-1}b_{k-1}\<x_k-x_{k-1},\ox_k-\ox_{k-1}\>\\ \nonumber&-2a_{k-1}b_{k-1}\<x_{k-1}-\ox_{k-1},\ox_k-\ox_{k-1}\>+2a_{k-1}b_{k-1}\<\ox_k-\ox_{k-1},\ox_k-\ox_{k-1}\>\\ \nonumber&\le -a_{k-1}b_{k-1}\|x_k-\ox_{k}\|^2+2 a_{k-1}b_{k-1}\|x_k-x_{k-1}\|^2\\ \nonumber&+ \left(1+\frac{1}{2}\right)a_{k-1}b_{k-1}\|\ox_k-\ox_{k-1}\|^2+2a_{k-1}b_{k-1}\<x_{k-1}-\ox_{k-1},\ox_{k-1}-\ox_k\>. \end{align} Further, \begin{align}\label{interm2} -\a_k a_kb_k\|x_{k-1}-\ox_k\|^2&=-\a_k a_kb_k\|x_{k-1}-\ox_{k-1}\|^2-\a_k a_kb_k\|\ox_{k-1}-\ox_k\|^2\\ \nonumber&-2\a_k a_kb_k\<x_{k-1}-\ox_{k-1},\ox_{k-1}-\ox_k\>, \end{align} and for $s_{k-1}=\frac{1}{(k-1)^s}$ with $1>s>p-q$ if $1+q>p$ and $s=1$ if $1+q=p$ and $k$ big enough one has \begin{align}\label{interm3} (2a_{k-1}b_{k-1}-2\a_k a_kb_k)&\<x_{k-1}-\ox_{k-1},\ox_{k-1}-\ox_k\>\le\\ \nonumber&(a_{k-1}b_{k-1}-\a_k a_kb_k)\left(s_{k-1}\|x_{k-1}-\ox_{k-1}\|^2+\frac{1}{s_{k-1}}\|\ox_{k-1}-\ox_k\|^2\right) \end{align} Now, combining \eqref{interm1} and \eqref{interm2} and \eqref{interm3} it holds \begin{align}\label{interm4} &-a_{k-1}b_{k-1}\|x_k-\ox_{k-1}\|^2-\a_k a_kb_k\|x_{k-1}-\ox_k\|^2\le-a_{k-1}b_{k-1}\|x_k-\ox_{k}\|^2\\ \nonumber&+2a_{k-1}b_{k-1}\|x_k-x_{k-1}\|^2+(-\a_k a_kb_k+(a_{k-1}b_{k-1}-\a_k a_kb_k)s_{k-1})\|x_{k-1}-\ox_{k-1}\|^2\\ \nonumber&+\left(\left(1+\frac{1}{s_{k-1}}\right)(a_{k-1}b_{k-1}-\a_k a_kb_k)+\frac{a_{k-1}b_{k-1}}{2}\right)\|\ox_{k}-\ox_{k-1}\|^2. \end{align} Injecting \eqref{interm4} in \eqref{forEkstrdecay1} we get \begin{align}\label{forEkstrdecay11} &v_{k+1}-v_k +2b_{k-1}^2\l_{k-1}(f_k(x_k)-f_k(\ox_k))-2b_{k-2}^2\l_{k-2}(f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))\\ \nonumber&-[(2b_{k-1}^2-2a_{k-1}b_{k-1})\l_{k-1}-2b_{k-2}^2\l_{k-2}](f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))+b_{k-1}^2\l_{k-1}^2\|u_k\|^2\\ \nonumber&\le (a_k^2+\a_k a_kb_k-a_kb_kc_k-a_{k-1}b_{k-1})\|x_k-\ox_{k}\|^2\\ \nonumber&+(-a_{k-1}^2+(1+s_{k-1})(a_{k-1}b_{k-1}-\a_k a_kb_k))\|x_{k-1}-\ox_{k-1}\|^2\\ \nonumber& +(\a_k^2b_k^2+\a_k a_kb_k-\a_kb_k^2c_k-b_{k-1}^2+3a_{k-1}b_{k-1})\|x_k-x_{k-1}\|^2\\ \nonumber&+(b_k^2c_k^2-\a_kb_k^2c_k -a_kb_kc_k+b_{k-1}^2\l_{k-1}c_k)\|x_k\|^2\\ \nonumber&+(a_{k-1}b_{k-1}\l_{k-1}c_{k-1}-b_{k-1}^2\l_{k-1}c_{k-1}+\a_kb_k^2c_k)\|x_{k-1}\|^2\\ \nonumber&+\left(b_{k-1}^2\l_{k-1}(c_{k-1}-c_k)+a_kb_kc_k\right)\|\ox_{k}\|^2-a_{k-1}b_{k-1}\l_{k-1}c_{k-1}\|\ox_{k-1}\|^2\\ \nonumber&+\left(\left(1+\frac{1}{s_{k-1}}\right)(a_{k-1}b_{k-1}-\a_k a_kb_k)+\frac{a_{k-1}b_{k-1}}{2}-b_{k-1}^2\l_{k-1}c_{k-1}\right)\|\ox_{k}-\ox_{k-1}\|^2. \end{align} In other words \begin{align}\label{forEkstrdecay111} &E_{k+1}-E_k +(-\a_k^2b_k^2-\a_k a_kb_k+\a_kb_k^2c_k+b_{k-1}^2-3a_{k-1}b_{k-1})\|x_k-x_{k-1}\|^2 \\ \nonumber&+b_{k-1}^2\l_{k-1}^2\|u_k\|^2+(2a_{k-1}b_{k-1}\l_{k-1}+2b_{k-2}^2\l_{k-2}-2b_{k-1}^2\l_{k-1})(f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))\\ \nonumber&+(-\a_{k-1} a_{k-1}b_{k-1}+a_{k-1}b_{k-1}c_{k-1}+a_{k-2}b_{k-2}-(1+s_{k-1})(a_{k-1}b_{k-1}-\a_k a_kb_k))\|x_{k-1}-\ox_{k-1}\|^2\\ \nonumber&+(-b_{k-1}^2c_{k-1}^2+\a_{k-1}b_{k-1}^2c_{k-1} +a_{k-1}b_{k-1}c_{k-1}-b_{k-2}^2\l_{k-2}c_{k-1}-a_{k-1}b_{k-1}\l_{k-1}c_{k-1}+\\ \nonumber&+b_{k-1}^2\l_{k-1}c_{k-1}-\a_kb_k^2c_k)\|x_{k-1}\|^2\\ \nonumber&\le\left(b_{k-1}^2\l_{k-1}(c_{k-1}-c_k)+a_kb_kc_k\right)\|\ox_{k}\|^2-a_{k-1}b_{k-1}\l_{k-1}c_{k-1}\|\ox_{k-1}\|^2\\ \nonumber&+\left(\left(1+\frac{1}{s_{k-1}}\right)(a_{k-1}b_{k-1}-\a_k a_kb_k)+\frac{a_{k-1}b_{k-1}}{2}-b_{k-1}^2\l_{k-1}c_{k-1}\right)\|\ox_{k}-\ox_{k-1}\|^2. \end{align} For simplicity, let us denote \begin{align*} &\xi_k=b_{k-1}^2\l_{k-1}^2\\ &m_k=2a_{k-1}b_{k-1}\l_{k-1}+2b_{k-2}^2\l_{k-2}-2b_{k-1}^2\l_{k-1}\\ &n_k=-\a_{k-1} a_{k-1}b_{k-1}+a_{k-1}b_{k-1}c_{k-1}+a_{k-2}b_{k-2}-(1+s_{k-1})(a_{k-1}b_{k-1}-\a_k a_kb_k)\\ &\eta_k=-\a_k^2b_k^2-\a_k a_kb_k+\a_kb_k^2c_k+b_{k-1}^2-3a_{k-1}b_{k-1}\\ &t_k=-b_{k-1}^2c_{k-1}^2+\a_{k-1}b_{k-1}^2c_{k-1} +a_{k-1}b_{k-1}c_{k-1}-b_{k-2}^2\l_{k-2}c_{k-1}-a_{k-1}b_{k-1}\l_{k-1}c_{k-1}+\\ &+b_{k-1}^2\l_{k-1}c_{k-1}-\a_kb_k^2c_k, \end{align*} and we show that all the sequences above are positive after an index $K_1\ge K_0$ big enough. First, \begin{align}\label{ordxi} \xi_k&=\l^2(k-1)^{2r+2\d}>0\mbox{ and }\xi_k=\mathcal{O}(k^{2r+2\d}). \end{align} Obviously, since $a>1+q\ge 2r$ one has \begin{align}\label{ordm} m_k&=2a\l(k-1)^{2r-1+\d}+2\l((k-2)^{2r+\d}-(k-1)^{2r+\d})\\ \nonumber&=2a\l(k-1)^{2r-1+\d}-2\l(2r+\d)\mathcal{O}(k^{2r-1+\d})>0\mbox{ and }m_k=\mathcal{O}(k^{2r-1+\d}). \end{align} If $q<1$, $1+q>p>1$ and $s>p-q$, by taking into account that $(k-1)^{2r-1-q}-k^{2r-1-q}=0$ if $r=\frac{q+1}{2}$ and $(k-1)^{2r-1-q}-k^{2r-1-q}=\mathcal{O}(k^{2r-2-q})$ if $r<\frac{q+1}{2}$ one has \begin{align}\label{ordn} n_k&=-\left(1-\frac{\a}{(k-1)^q}\right) a(k-1)^{2r-1}+ac(k-1)^{2r-1-p}+a(k-2)^{2r-1}\\ \nonumber&-\left(1+\frac{1}{(k-1)^s}\right)\left(a(k-1)^{2r-1}-\left(1-\frac{\a}{k^q}\right)ak^{2r-1}\right)\\ \nonumber&=ac(k-1)^{2r-1-p}+a((k-2)^{2r-1}+k^{2r-1}-2(k-1)^{2r-1})\\ \nonumber&-\frac{a}{(k-1)^s}((k-1)^{2r-1}-k^{2r-1}+\a k^{2r-1-q})+a\a((k-1)^{2r-1-q}-k^{2r-1-q})\\ \nonumber&=ac(k-1)^{2r-1-p}-\mathcal{O}(k^{2r-3})-a\a\mathcal{O}(k^{2r-1-q-s})+a \a\mathcal{O}((k-1)^{2r-1-q}-k^{2r-1-q})>0\\ \nonumber&\mbox{ and }n_k=\mathcal{O}(k^{2r-1-p}). \end{align} If $q<1$, $1+q=p$ and $s=1$, by taking into account that $(k-1)^{2r-1-q}-k^{2r-1-q}=0,\,c>\a$ if $r=\frac{q+1}{2}$ and $(k-1)^{2r-1-q}-k^{2r-1-q}=(1+q-2r)\mathcal{O}(k^{2r-2-q})$ if $r<\frac{q+1}{2}$ one has \begin{align}\label{ordnpq1} n_k&=ac(k-1)^{2r-2-q}+a((k-2)^{2r-1}+k^{2r-1}-2(k-1)^{2r-1})\\ \nonumber&-\frac{a}{k-1}((k-1)^{2r-1}-k^{2r-1}+\a k^{2r-1-q})+a\a((k-1)^{2r-1-q}-k^{2r-1-q})\\ \nonumber&=ac(k-1)^{2r-2-q}-\frac{a\a}{k-1}k^{2r-1-q}+\mathcal{O}(k^{2r-3})-\mathcal{O}(k^{2r-3})\\ \nonumber&+a \a\mathcal{O}((k-1)^{2r-1-q}-k^{2r-1-q})>0\mbox{ and }n_k=\mathcal{O}(k^{2r-2-q}). \end{align} Concerning $\eta_k$, since $p>1>q$ one has \begin{align}\label{ordeta} \eta_k&=-\left(1-\frac{\a}{k^q}\right)^2 k^{2r}-\left(1-\frac{\a}{k^q}\right)ak^{2r-1}+\left(1-\frac{\a}{k^q}\right)ck^{2r-p}+(k-1)^{2r}-3a(k-1)^{2r-1}\\ \nonumber&=2\a k^{2r-q}+((k-1)^{2r}-k^{2r})-\a^2k^{2r-2q} -ak^{2r-1}+\a ak^{2r-1-q}+\left(1-\frac{\a}{k^q}\right)ck^{2r-p}\\ \nonumber&-3a(k-1)^{2r-1}=2\a k^{2r-q}-\mathcal{O}(k^{2r-1})>0\mbox{ and }\eta_k=\mathcal{O}(k^{2r-q}). \end{align} Now, since $\l_k=\l k^\d\le 1$, for $k$ big enough, i.e. $\d\le 0$ and $0<\l< 1$ if $\d=0$, further $a>1+q\ge 2r$, hence $a>|2r-p|$ if $\d<0$ and if $\d=0$ then $a>\frac{(2r-p)-2\l r}{1-\l}$, one has \begin{align}\label{ordt} t_k&=-c^2(k-1)^{2r-2p}+\left(1-\frac{\a}{(k-1)^q}\right)c(k-1)^{2r-p}+ac(k-1)^{2r-1-p}-\l c(k-2)^{2r+\d}(k-1)^{-p}\\ \nonumber&-a\l c(k-1)^{2r-1+\d-p}+\l c(k-1)^{2r+\d-p}-\left(1-\frac{\a}{k^q}\right)ck^{2r-p}\\ \nonumber&=(ac(k-1)^{2r-1-p}-a\l c(k-1)^{2r-1+\d-p})+c((k-1)^{2r-p}-k^{2r-p})\\ \nonumber&+\l c(k-1)^{-p}((k-1)^{2r+\d}-(k-2)^{2r+\d})+\a c(k^{2r-q-p}-(k-1)^{2r-q-p})-c^2(k-1)^{2r-2p}\\ \nonumber&=(ac(k-1)^{2r-1-p}-a\l c(k-1)^{2r-1+\d-p})-c(2r-p)\mathcal{O}(k^{2r-1-p})+\l c(2r+\d)\mathcal{O}(k^{2r-1-p+\d})\\ \nonumber&-\mathcal{O}(k^{2r-q-1-p})-\mathcal{O}(k^{2r-2p})>0\mbox{ and }t_k=\mathcal{O}(k^{2r-1-p}). \end{align} \vskip0.3cm Concerning the right hand side of \eqref{forEkstrdecay111}, in what follows we show that $$\sum_{k=1}^{+\infty}\left(\left(1+\frac{1}{s_{k-1}}\right)(a_{k-1}b_{k-1}-\a_k a_kb_k)+\frac{a_{k-1}b_{k-1}}{2}\right)\|\ox_{k}-\ox_{k-1}\|^2< +\infty.$$ Let us denote \begin{equation}\label{Sk} S_k:=\left(\left(1+\frac{1}{s_{k-1}}\right)(a_{k-1}b_{k-1}-\a_k a_kb_k)+\frac{a_{k-1}b_{k-1}}{2}\right)\|\ox_{k}-\ox_{k-1}\|^2. \end{equation} Note that according to Lemma \ref{lfos} one has $\left\|\ox_{k}-\ox_{k-1}\right\|\le\frac{p_1}{k}\|\ox_{k}\|$ for some $p_1>p$ and all $k$ big enough. Further $\|\ox_{k}\|^2\le \|x^*\|^2$, hence we have $$\left\|\ox_{k}-\ox_{k-1}\right\|^2\le\frac{p_1^2}{k^2}\|x^*\|^2.$$ Therefore, it is enough to show that $\left(1+\frac{1}{s_{k-1}}\right)(a_{k-1}b_{k-1}-\a_k a_kb_k)+\frac{a_{k-1}b_{k-1}}{2}=\mathcal{O}(k^l)$ as $k\to+\infty$, with $l<1.$ Indeed, \begin{align*} &\left(1+\frac{1}{s_{k-1}}\right)(a_{k-1}b_{k-1}-\a_k a_kb_k)+\frac{a_{k-1}b_{k-1}}{2}=\left(1+(k-1)^s\right)\left(a(k-1)^{2r-1}-\left(1-\frac{\a}{k^q}\right)ak^{2r-1}\right)\\ &+\frac{a}{2}(k-1)^{2r-1}\le C_1(k-1)^{\max(2r-1-q+s,2r-1)}. \end{align*} Observe that by assumption $s<1$ and $2r\le q+1$ if $p<q+1$, hence one can take $l=\max(2r-1-q+s,2r-1)<1$ and we obtain that $(S_k)$ is summable. Further, for $p=q+1$ one has $s=1$ and if $2r<q+1$ we obtain that $l=\max(2r-1-q+s,2r-1)<1$, so also in this case $(S_k)$ is summable. However, in case $p=q+1$, $s=1$ and $2r=q+1$ one has $l=1$, hence $S_k=\mathcal{O}(k^{-1}).$ Now, since $\|\ox_{k}\|^2\le\|x^*\|^2$ and \begin{align*} b_{k-1}^2\l_{k-1}(c_{k-1}-c_k)+a_kb_kc_k&=c\l(k-1)^{2r+\d}((k-1)^{-p}-k^{-p})+ack^{2r-1-p}\\ &=\mathcal{O}(k^{2r-1-p}), \end{align*} the right hand side of \eqref{forEkstrdecayf} leads to \begin{align*} &\left(b_{k-1}^2\l_{k-1}(c_{k-1}-c_k)+a_kb_kc_k\right)\|\ox_{k}\|^2-a_{k-1}b_{k-1}\l_{k-1}c_{k-1}\|\ox_{k-1}\|^2\\ &-b_{k-1}^2\l_{k-1}c_{k-1}\|\ox_k-\ox_{k-1}\|^2+S_k\le C_2 k^{2r-1-p}+S_k\mbox{ for some }C_2>0. \end{align*} Consequently, \eqref{forEkstrdecay111} leads to \begin{align}\label{forEkstrdecayf} &E_{k+1}-E_k +\xi_k\|u_k\|^2+m_k(f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))+n_k\|x_{k-1}-\ox_{k-1}\|^2\\ \nonumber& +\eta_k\|x_k-x_{k-1}\|^2+t_k\|x_{k-1}\|^2 \le C_2k^{2r-1-p}+S_k\mbox{ for all }k\ge K_1. \end{align} Summing up \eqref{forEkstrdecayf} from $k=K_1$ to $k=n\ge K_1$ we obtain \begin{align}\label{forEkstrdecayfi} &E_{n+1} +\sum_{k=K_1}^n \xi_k\|u_k\|^2+\sum_{k=K_1}^n m_k(f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))+\sum_{k=K_1}^n n_k\|x_{k-1}-\ox_{k-1}\|^2\\ \nonumber& +\sum_{k=K_1}^n \eta_k\|x_k-x_{k-1}\|^2+\sum_{k=K_1}^nt_k\|x_{k-1}\|^2\le C_2\sum_{k=K_1}^n k^{2r-1-p}+\sum_{k=K_1}^n S_k+E_{K_1}\\ \nonumber&\le C_2\sum_{k=K_1}^n k^{2r-1-p}+C\mbox{ for some }C>0. \end{align} \vskip0.3cm {\bf II. Rates} \vskip0.3cm In what follows $x^*$ denotes the element of minimum norm from the set $\argmin f.$ We treat first the case $p<q+1.$ Now, if $2r-1-p>-1$, that is $r\in\left(\frac{p}{2},\frac{q+1}{2}\right],$ it is obvious that $\sum_{k=K_1}^n k^{2r-1-p}\to+\infty\mbox{ as }n\to+\infty.$ However, easily can by seen that $\sum_{k=K_1}^n k^{2r-1-p}=\mathcal{O}(n^{2r-p}).$ Hence, dividing \eqref{forEkstrdecayfi} with $n^{2r-p}$ we obtain at once that there exists $L>0$ such that $\frac{E_{n+1}}{n^{2r-p}}<L$, consequently $$\frac{\mu_n}{n^{2r-p}}(f_n(x_n)-f_n(\ox_n))\le L\mbox{ and }\frac{\s_n}{n^{2r-p}}\|x_n\|^2\le L\mbox{ for all }n\ge K_1.$$ But according to \eqref{ordsigma} one has $\s_n=\mathcal{O}(n^{2r-p})$ consequently $(x_n)$ is bounded. From \eqref{ordmu} we have $\mu_n=\mathcal{O}(n^{2r+\d})$, hence $$f_n(x_n)-f_n(\ox_n)=\mathcal{O}(n^{-p-\d}).$$ Consequently, for every $\rho<p+\d-1$ one has $$\sum_{k=1}^{+\infty}k^\rho(f_k(x_k)-f_x(\ox_k))<+\infty.$$ Now, according to \eqref{fontos5} one has $f(x_n)-f(x^*)\le f_n(x_n)-f_n(\ox_n)+\frac{c}{2n^p}\|x^*\|^2$ hence, since $\d\le0$ we obtain $$f(x_n)-f(x^*)=\mathcal{O}(n^{-p-\d}).$$ Further, one has $\frac{v_{n+1}}{n^{2r-p}}<L$, hence $$\frac{\| a_{n}(x_{n}-\ox_n)+b_{n}(\a_n(x_n-x_{n-1})-c_n x_n)\|^2}{n^{2r-p}}<L\mbox{ for all }n\ge K_1.$$ Consequently, $\|an^{\frac{p}{2}-1}(x_{n}-\ox_{n}) +n^{\frac{p}{2}} (\a_n(x_n-x_{n-1})-cn^{-p} x_n)\|^2$ is bounded. But $(x_n)$ is bounded and $p<2$, hence $an^{\frac{p}{2}-1}(x_{n}-\ox_{n})\to0\mbox{ as }n\to+\infty$ and $-cn^{-\frac{p}{2}} x_n\to0\mbox{ as }n\to+\infty$, consequently $\|n^{\frac{p}{2}} \a_n(x_n-x_{n-1})\|^2$ is bounded. In other words $$\|x_n-x_{n-1}\|^2=\mathcal{O}(n^{-p}).$$ Hence, for every $\rho<p-1$ one has $$\sum_{k=1}^{+\infty}k^\rho\|x_k-x_{k-1}\|^2<+\infty.$$ Now, using the definition of $u_n$ we have $\l_{n-1} u_n =(x_{n}-x_{n-1})-\a_{n-1}(x_{n-1}-x_{n-2})+c_{n-1} x_{n-1}$ hence $$\|\l(n-1)^\d u_n\|\le\|x_{n}-x_{n-1}\|+\a_{n-1}\|x_{n-1}-x_{n-2}\|+c_{n-1}\| x_{n-1}\|=\mathcal{O}(n^{-\frac{p}{2}}).$$ Consequently, $\|u_n\|^2=\mathcal{O}(n^{-p-2\d})$ and for every $\rho<p+2\d-1$ one has $$\sum_{k=1}^{+\infty}k^\rho\|u_k\|^2<+\infty.$$ Further, by taking $r=\frac{q+1}{2}$ we obtain the following ergodic convergence results. $$\limsup_{n\to+\infty}\frac{\sum_{k=1}^n m_k(f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))}{n^{q+1-p}}<+\infty.$$ But according to \eqref{ordm} we have $m_k=\mathcal{O}(k^{q+\d})$, hence $$\limsup_{n\to+\infty}\frac{\sum_{k=1}^n k^{q+\d}(f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))}{n^{q+1-p}}<+\infty.$$ Similarly, according to \eqref{ordeta} one has $\eta_k=\mathcal{O}(k^{1})$, hence $$\limsup_{n\to+\infty}\frac{\sum_{k=1}^n k\|x_{k}-x_{k-1}\|^2}{n^{q+1-p}}<+\infty.$$ Finally, according to \eqref{ordxi} one has $\xi_k=\mathcal{O}(k^{q+1+2\d})$, hence $$\limsup_{n\to+\infty}\frac{\sum_{k=1}^n k^{q+1+2\d}\|u_k\|^2}{n^{q+1-p}}<+\infty.$$ \vskip0.3cm Now, if $2r-1-p<-1$, that is $r\in\left(\frac12,\frac{p}{2}\right),$ then the right hand side of \eqref{forEkstrdecayfi} is finite, hence there exists $C_3>0$ such that \begin{align}\label{forEkstrdecayfi1} &E_{n+1} +\sum_{k=K_1}^n \xi_k\|u_k\|^2+\sum_{k=K_1}^n m_k(f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))+\sum_{k=K_1}^n n_k\|x_{k-1}-\ox_{k-1}\|^2\\ \nonumber& +\sum_{k=K_1}^n \eta_k\|x_k-x_{k-1}\|^2+\sum_{k=K_1}^nt_k\|x_{k-1}\|^2\le C_2\sum_{k=K_1}^n k^{2r-1-p}+\sum_{k=K_1}^n S_k+E_{K_1}\le C_3. \end{align} From \eqref{forEkstrdecayfi1} by using \eqref{ordxi}, \eqref{ordm} and \eqref{ordeta} we obtain the estimates $$\sum_{k=1}^{+\infty} k^{2r+2\d}\|u_k\|^2<+\infty,$$ $$\sum_{k=1}^{+\infty} k^{2r-1+\d}(f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))<+\infty$$ and $$\sum_{k=1}^{+\infty} k^{2r-q}\|x_{k}-x_{k-1}\|^2<+\infty.$$ But according to \eqref{fontos5} we have $f(x_{k-1})-f(x^*)\le f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1})+\frac{c}{2k^p}\|x^*\|^2.$ Further $\sum_{k=1}^{+\infty} k^{2r-1+\d}\frac{c}{2 k^p}\|x^*\|^2<+\infty$ therefore $$\sum_{k=1}^{+\infty} k^{2r-1+\d}(f(x_{k-1})-\min_{\cH}f)<+\infty.$$ \vskip0.5cm In case $p=q+1$ we have seen earlier, that $S_k$ defined by \eqref{Sk} is summable provided $2r<q+1.$ Further, for $2r=q+1$ one has $S_k=\mathcal{O}(k^{-1}).$ Consequently, the right hand side of \eqref{forEkstrdecayfi}, that is $C_2\sum_{k=K_1}^n k^{2r-1-p}+\sum_{k=K_1}^n S_k+E_{K_1}$ is finite for $2r<q+1$ and is of order $\mathcal{O}(k^{-1})$ for $2r=q+1.$ So assume first that $r\in\left(\frac12,\frac{q+1}{2}\right).$ Then \eqref{forEkstrdecayfi} becomes: \begin{align}\label{forEkstrdecayfipq1} &E_{n+1} +\sum_{k=K_1}^n \xi_k\|u_k\|^2+\sum_{k=K_1}^n m_k(f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))+\sum_{k=K_1}^n n_k\|x_{k-1}-\ox_{k-1}\|^2\\ \nonumber& +\sum_{k=K_1}^n \eta_k\|x_k-x_{k-1}\|^2+\sum_{k=K_1}^nt_k\|x_{k-1}\|^2\le C,\mbox{ for some }C>0. \end{align} From \eqref{forEkstrdecayfipq1}, for all $r\in\left(\frac12,\frac{q+1}{2}\right)$ we obtain at once the following estimates: $\sum_{k=1}^{+\infty}k^{2r+2\d}\|u_k\|^2<+\infty,$ $\sum_{k=1}^{+\infty}k^{2r-1+\d}(f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))<+\infty$ and $\sum_{k=1}^{+\infty}k^{2r-q}\|x_k-x_{k-1}\|^2<+\infty.$ But according to \eqref{fontos5} we have $f(x_{k-1})-f(x^*)\le f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1})+\frac{c}{2k^p}\|x^*\|^2.$ Further $\sum_{k=1}^{+\infty} k^{2r-1+\d}\frac{c}{2 k^p}\|x^*\|^2<+\infty$ therefore $$\sum_{k=1}^{+\infty}k^{2r-1+\d}(f(x_{k-1})-\min_{\cH} f)<+\infty.$$ Assume now that $r=\frac{q+1}{2}.$ Then \eqref{forEkstrdecayfi} becomes: \begin{align}\label{forEkstrdecayfipq1str} &E_{n+1} +\sum_{k=K_1}^n \xi_k\|u_k\|^2+\sum_{k=K_1}^n m_k(f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))+\sum_{k=K_1}^n n_k\|x_{k-1}-\ox_{k-1}\|^2\\ \nonumber& +\sum_{k=K_1}^n \eta_k\|x_k-x_{k-1}\|^2+\sum_{k=K_1}^nt_k\|x_{k-1}\|^2\le C\sum_{k=K_1}^n \frac{1}{k},\mbox{ for some }C>0. \end{align} But $\sum_{k=1}^n \frac{1}{k}=\mathcal{O}(\ln n)$, hence by dividing \eqref{forEkstrdecayfipq1str} with $\ln n$ we get at once that there exists $L>0$ such that $\frac{E_{n+1}}{\ln n}<L$. Consequently by arguing analogously as in the case $p<q+1$ we have $$f_n(x_n)-f_n(\ox_n)=\mathcal{O}(n^{-p-\d}\ln n)$$ and $$f(x_n)-f(x^*)=\mathcal{O}(n^{-p-\d}\ln n).$$ Further, in this case $\nu_n=\mathcal{O}(1)$ and $\sigma_n=\mathcal{O}(1)$ hence $\frac{1}{\ln n}\|x_n-\ox_n\|^2<L$ and $\frac{1}{\ln n}\|x_n\|^2<L$. Combining the latter relations with the fact that $\frac{v_{n+1}}{\ln n}<L$ we obtain that $$\|x_n-x_{n-1}\|^2=\mathcal{O}(n^{-p}\ln n).$$ Now, using the definition of $u_n$ we have $$\|u_n\|^2=\mathcal{O}(n^{-p-2\d}\ln n).$$ Finally, also here the following average convergence results hold. $$\limsup_{n\to+\infty}\frac{\sum_{k=1}^n k^{q+\d}(f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))}{\ln n}<+\infty,$$ $$\limsup_{n\to+\infty}\frac{\sum_{k=1}^n k\|x_{k}-x_{k-1}\|^2}{\ln n}<+\infty$$ and $$\limsup_{n\to+\infty}\frac{\sum_{k=1}^n k^{q+1+2\d}\|u_k\|^2}{\ln n}<+\infty.$$ Also here, for $\d<0$ it holds $\sum_{k=1}^{+\infty} k^{q+\d}\frac{c}{2 k^p}\|x^*\|^2<+\infty$, hence according to \eqref{fontos5} one has $$\limsup_{n\to+\infty}\frac{\sum_{k=1}^n k^{q+\d}(f(x_{k-1})-\min_{\cH} f)}{\ln n}<+\infty.$$ \end{proof} \subsection{Strong convergence results} Now, in order to show the strong convergence of the sequences generated by \eqref{algo} to an element of minimum norm of the nonempty, convex and closed set $\argmin f$, we state our main result of the present section. \begin{Theorem}\label{strconvergencealgorithm} Assume that $0<q< 1$, $1<p< q+1$ and $\l_k=\l k^\d$ with $p-q-1<\d<0,\,\l>0$ or $\d=0$ and $\l\in]0,1[$. Let $(x_k)$ be a sequence generated by \eqref{algo}. Let $x^*$ be the minimal norm element from $\argmin f$. Then, $\liminf_{k\to+\infty}\|x_k-x^*\|=0$. Further, $(x_k)$ converges strongly to $x^*$ whenever $(x_k)$ is in the interior or the complement of the ball $B(0,\|x^*\|)$ for $k$ big enough. \end{Theorem} \begin{proof} We will use the notations and the energy functional $E_k$ used in the proof of Theorem \ref{strconvergencerates}. {\bf Case I.} Assume that $\|x_k\|\ge \|x^*\|$ for all $k\ge K_2$, where $K_2\ge K_1$ and $K_1$ was defined in the proof of Theorem \ref{strconvergencerates}. Let us ad $-\s_k\|x^*\|^2+\s_{k-1}\|x^*\|^2$ to the both side of \eqref{forEkstrdecay111}. Note that $E_k-\s_{k-1}\|x^*\|^2\ge0$ for all $k>K_2.$ Further, since $\|\ox_k\|\le \|x^*\|$, we get that $\|x_k\|^2-\|\ox_k\|^2\ge 0$ for all $k\ge K_2.$ Then we obtain for all $k>K_2$ that \begin{align}\label{strconv} &(E_{k+1}-\s_k\|x^*\|^2)-(E_k-\s_{k-1}\|x^*\|^2) +\xi_k\|u_k\|^2+m_k(f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))\\ \nonumber& +n_k\|x_{k-1}-\ox_{k-1}\|^2+\eta_k\|x_k-x_{k-1}\|^2+t_k\|x_{k-1}\|^2\\ \nonumber&\le\left(b_{k-1}^2\l_{k-1}(c_{k-1}-c_k)+a_kb_kc_k\right)\|\ox_{k}\|^2-a_{k-1}b_{k-1}\l_{k-1}c_{k-1}\|\ox_{k-1}\|^2+(-\s_k+\s_{k-1})\|x^*\|^2+S_k. \end{align} The right hand side of \eqref{strconv} can be written as \begin{align*} &\left(b_{k-1}^2\l_{k-1}(c_{k-1}-c_k)+a_kb_kc_k\right)\|\ox_{k}\|^2-a_{k-1}b_{k-1}\l_{k-1}c_{k-1}\|\ox_{k-1}\|^2+(-\s_k+\s_{k-1})\|x^*\|^2+S_k\\ &=\left(\left(b_{k-1}^2\l_{k-1}(c_{k-1}-c_k)+a_kb_kc_k\right)\|\ox_{k}\|^2-\left(b_{k-2}^2\l_{k-2}(c_{k-2}-c_{k-1})+a_{k-1}b_{k-1}c_{k-1}\right)\right)\|\ox_{k-1}\|^2\\ &+\left(b_{k-2}^2\l_{k-2}(c_{k-2}-c_{k-1})+(1-\l_{k-1})a_{k-1}b_{k-1}c_{k-1}\right)\|\ox_{k-1}\|^2+(-\s_k+\s_{k-1})\|x^*\|^2+S_k, \end{align*} hence \eqref{strconv} becomes \begin{align}\label{strconv1} &(E_{k+1}-\s_k\|x^*\|^2)-(E_k-\s_{k-1}\|x^*\|^2) +\xi_k\|u_k\|^2+m_k(f_{k-1}(x_{k-1})-f_{k-1}(\ox_{k-1}))\\ \nonumber& +n_k\|x_{k-1}-\ox_{k-1}\|^2+\eta_k\|x_k-x_{k-1}\|^2+t_k(\|x_{k-1}\|^2-\|x^*\|^2)\\ \nonumber&\le \left(\left(b_{k-1}^2\l_{k-1}(c_{k-1}-c_k)+a_kb_kc_k\right)\|\ox_{k}\|^2-\left(b_{k-2}^2\l_{k-2}(c_{k-2}-c_{k-1})+a_{k-1}b_{k-1}c_{k-1}\right)\right)\|\ox_{k-1}\|^2\\ \nonumber &+\left(b_{k-2}^2\l_{k-2}(c_{k-2}-c_{k-1})+(1-\l_{k-1})a_{k-1}b_{k-1}c_{k-1}-\s_k+\s_{k-1}-t_k\right)\|x^*\|^2+S_k. \end{align} Now, according to \eqref{ordt}, \eqref{ordsigma} and the form of $a_k,\,b_k,\, c_k$ and $\l_k$ we deduce that there exists $K_3>K_2$ such that \begin{align}\label{forstrconv} & b_{k-2}^2\l_{k-2}(c_{k-2}-c_{k-1})+(1-\l_{k-1})a_{k-1}b_{k-1}c_{k-1}-\s_k+\s_{k-1}-t_k\\ \nonumber&=\l c(k-2)^{2r+\d}((k-2)^{-p}-(k-1)^{-p})+(1-\l(k-1)^\d)ac(k-1)^{2r-1-p}\\ \nonumber& -ck^{-p}(k^{2r}-\l(k-1)^{2r+\d})-ack^{2r-1-p} +\a ck^{2r-q-p}+c^2k^{2r-2p}\\ \nonumber&+c(k-1)^{-p}((k-1)^{2r}-\l(k-2)^{2r+\d})+ac(k-1)^{2r-1-p} -\a c(k-1)^{2r-q-p}-c^2(k-1)^{2r-2p}\\ \nonumber&-(ac(k-1)^{2r-1-p}-a\l c(k-1)^{2r-1+\d-p})-c((k-1)^{2r-p}-k^{2r-p})\\ \nonumber&-\l c(k-1)^{-p}((k-1)^{2r+\d}-(k-2)^{2r+\d})-\a c(k^{2r-q-p}-(k-1)^{2r-q-p})+c^2(k-1)^{2r-2p}\\ \nonumber&=\l c((k-2)^{2r+\d-p}-(k-1)^{2r+\d-p}+k^{-p}(k-1)^{2r+\d}-(k-1)^{-p}(k-2)^{2r+\d})\\ \nonumber&+ac((k-1)^{2r-1-p}-k^{2r-1-p}) +c^2k^{2r-2p}= c^2k^{2r-2p}+\mathcal{O}(k^{2r-2-p})<C k^{2r-2p}\mbox{ for some }C>0. \end{align} Hence, $\sum_{k=K_3}^{+\infty}\left(b_{k-2}^2\l_{k-2}(c_{k-2}-c_{k-1})+(1-\l_{k-1})a_{k-1}b_{k-1}c_{k-1}-\s_k+\s_{k-1}-t_k\right)\|x^*\|^2<+\infty,$ provided $2r-2p<-1.$ So in what follows we assume that $\max(p-\d,1)<2r<\min(q+1,2p-1).$ Then, by summing \eqref{strconv1} by $k=K_3$ to $k=n>K_3$ we obtain that there exists $L>0$ such that $$\mu_n(f_n(x_n)-f_n(\ox_n))\le L,\mbox{ for all }n> K_3.$$ Now, by \eqref{fontos3} we get $$\|x_n-\ox_n\|^2<L\frac{2n^p}{c\mu_n}=\frac{L}{\l}\frac{n^p}{(n-1)^{2r+\d}} \mbox{ for all }n> K_3.$$ Consequently, $\|x_n-\ox_n\|\to 0\mbox{ as }n\to+\infty$ which combined with the fact that $\ox_n \to x^*\mbox{ as }n\to+\infty$ lead to $$\|x_n-x^*\|\to 0\mbox{ as }n\to+\infty.$$ {\bf Case II.} Assume that there exists $k_0\in \N$ such that $\|x_n\|<\|x^*\|$ for all $n\ge k_0.$ Now, we take $\bar{x} \in \mathcal{H}$ a weak sequential cluster point of $(x_n),$ which exists since $(x_n)$ is bounded. This means that there exists a sequence $\left(k_{n}\right)_{n \in \mathbb{N}} \subseteq[k_0,+\infty)\cap \N$ such that $k_{n} \to +\infty$ and $x_{k_{n}}$ converges weakly to $\bar{x}$ as $n \to +\infty$. According to Theorem \ref{strconvergencerates} and the fact that $f$ is lower semicontinuous one has $$ f(\bar{x}) \le\liminf_{n \rightarrow+\infty} f\left(x_{k_{n}}\right) = \lim_{n \rightarrow+\infty} f\left(x_{k_{n}}\right)=\min f \, ,$$ hence $\bar{x} \in \operatorname{argmin} f.$ Now, since the norm is weakly lower semicontinuous one has that $$ \begin{array}{c} \|\bar{x}\| \leq \liminf _{n \rightarrow+\infty}\left\|x_{k_{n}}\right\| \leq\left\|x^\ast \right\| \end{array} $$ which, from the definition of $x^\ast$, implies that $\bar{x}=x^{*}.$ This shows that $(x_n)$ converges weakly to $x^\ast$. So $$ \left\|x^\ast \right\| \leq \liminf _{n \rightarrow+\infty}\|x_n\| \leq \limsup _{n \rightarrow+\infty}\|x_n\| \leq\left\|x^\ast \right\|,$$ hence we have $$ \lim _{n \rightarrow+\infty}\|x_n\|=\left\|x^\ast \right\|.$$ From the previous relation and the fact that $x_n\rightharpoonup x^\ast$ as $n \to +\infty,$ we obtain the strong convergence, that is $$ \lim _{n \rightarrow+\infty} x_n=x^\ast.$$ {\bf Case III.} We suppose that there exists $k_0\in\N$ such that for every $n \geq k_0$ there exists $l \geq n$ such that $\left\|x^\ast \right\|>\|x_l\|$ and also there exists $m \geq n$ such that $\left\|x^{*}\right\| \leq\|x_m\|$. So let $k_1\ge k_0$ and $l_1\ge k_1$ such that $\left\|x^\ast \right\|>\|x_{l_1}\|.$ Let $k_2>l_1$ and $l_2\ge k_2$ such that $\left\|x^\ast \right\|>\|x_{l_2}\|.$ Continuing the procedure we obtain $(x_{l_n})$, a subsequence of $(x_n)$ with the property that $\|x_{l_n}\|<\|x^*\|$ for all $n\in\N.$ Now reasoning as in {\bf Case II} we obtain that $\lim _{n \rightarrow+\infty} x_{l_n}=x^\ast.$ Consequently, $$\liminf_{k \rightarrow+\infty} \|x_n-x^\ast\|=0.$$ \end{proof} \section{Conclusions, perspectives} Observe that according to Theorem \ref{strconvergencerates} and Theorem \ref{strconvergencealgorithm} we are able to obtain both fast convergence of the function values and strong convergence of the sequences generated by Algorithm \eqref{algo} for the same Tikhonov regularization parameter. For a long time this was an unsolved problem in the literature. However, recently Attouch and L\'aszl\'o \cite{AL-nemkoz} (see also \cite{ABCR}), studied a dynamical system in connection to the optimization problem (P) and succeeded to obtain rapid convergence towards the infimal value of the smooth objective function $f$, and the strong convergence of the trajectories towards the element of minimum norm of the set of minimizers of $f$. Further, the proximal point algorithm obtained from this dynamical system via implicit discretization (with $q=1,\,p=2$ and $\l_k\equiv 1$ which is not covered by our analysis), share similar properties as Algorithm \eqref{algo} for the case $p<q+1.$ In our context, one can observe that the case $p=q+1$ is critical, in the sense that separates the two cases: the case when we obtain fast convergence of the function values and weak convergence of the generated sequences to a minimizer and the case when the strong convergence of the generated sequences to a minimizer of minimum norm is assured. These results are in concordance with the results obtained in \cite{ACR}, \cite{BCL} and \cite{AL-siopt}. Moreover, according to Theorem \ref{strconvergencerates} our algorithm provides arbitrary convergence rate for the decay $f(x_k)-\min_{\cH} f$.
\section{An example appendix} \begin{lemma} Test Lemma. \end{lemma} \section{Conclusions} \label{sec:conclusions} We have developed AONN, an adjoint-oriented neural network method, for computing all-at-once solutions to parametric optimal control problems. That is, the optimal control solutions for arbitrary parameters can be obtained by solving only once. The key idea of AONN is to employ three neural networks to approximate the control function, the adjoint function, and the state function in the optimality conditions, which allows this method to integrate the idea of the direct-adjoint looping (DAL) approach in neural network approximation. In this way, three parametric surrogate models using neural networks provide all-at-once representations of optimal solutions, which avoids mesh generation for both spatial and parametric spaces and thus can be generalized to high-dimensional problems. With the integration of DAL, AONN also avoids the penalty-based loss function of the complex Karush–Kuhn–Tucker (KKT) system, thereby reducing the training difficulty of neural networks and improving the accuracy of solutions. Numerical experiments have shown that AONN can solve parametric optimal control problems all at once with high accuracy in several application scenarios, including control parameters, physical parameters, model parameters, and geometrical parameters. Many questions remain open, e.g., choosing the step size and the scaling factor are heuristic, and solving some complex problems requires a higher computational cost. Future works could include the analysis of the convergence rate to better understand the properties of AONN, the introduction of adaptive sampling strategies to further improve both robustness and effectiveness, and the generalization and application of AONN to more challenging problems such as shape or topology optimizations. \section{Comparison with other methods} \label{sec:analysis} Unlike solving the deterministic optimal control problems, the existence of parameters in $\mathrm{OCP}(\boldsymbol{\mu})$ causes difficulties for traditional grid-based numerical methods. A straightforward way is to convert the $\mathrm{OCP}(\boldsymbol{\mu})$ into the deterministic optimal control problem. For each realization of parameters, the $\mathrm{OCP}(\boldsymbol{\mu})$ is reduced to the following \begin{linenomath*}\begin{equation}\label{OCP} \mathrm{OCP}:\quad \left\{\begin{aligned} &\min _{(y,u) \in Y \times U} J(y,u),\\ &\text { s.t. } \mathbf{F}(y,u) = 0 \ \text{ in }\Omega, \ \text{ and } u\in U_{ad}. \end{aligned}\right. \end{equation}\end{linenomath*} The classical direct-adjoint looping (DAL) method \cite{mitter1971optimal,jameson1988aerodynamic} is a popular approach for solving this problem, where an iterative scheme is adopted to converge toward the optimal solution by solving subproblems in the KKT system with numerical solvers (e.g. finite element methods). At each iteration in the direct-adjoint looping procedure, one first solves the governing PDE \eqref{DAL-state} and then solves the adjoint PDE \eqref{DAL-adjoint} which formulates the total gradient \eqref{DAL-grad} for the update of the control function. \begin{linenomath*} \postdisplaypenalty=0 \begin{subequations}\label{DAL} \begin{align} &\mathbf{F}(y,u) = 0, \label{DAL-state}\\ &J_y(y,u) - \mathbf{F}^{*}_{y}(y,u)p = 0, \label{DAL-adjoint}\\ &\mathrm{d}_{u}J(y,u) = J_u(y,u) - \mathbf{F}^{*}_{u}(y,u)p. \label{DAL-grad} \end{align} \end{subequations} \end{linenomath*} Despite its effectiveness, DAL is not able to handle the $\mathrm{OCP}(\boldsymbol{\mu})$ problem, directly due to the curse of dimensionality of the discretization of $\Omega_{\mathcal{P}}$. An alternative strategy is the reduced order model (ROM) \cite{negri2013reduced}, which rely on surrogate models for parameter-dependent PDEs. The idea is that the solution of PDE for any parameter can be computed based on a few basis functions that are constructed from the solutions corresponding to some pre-selected parameters. However, it is still computationally unaffordable for ROM when the parameter-induced solution manifold does not lie on a low-dimensional subspace. Recently, some deep learning algorithms are used to solve the optimal control problem for a fixed parameter \cite{lu2021physics, mowlavi2022optimal}. By introducing two deep neural networks, the state function $y$ and the control function $u$ can be approximated by minimizing the following objective functional: \begin{linenomath*}\begin{equation} \min_{(y,u) \in Y \times U} J(y,u) + \beta_{1} \mathbf{F}(y,u)^2 + \beta_{2} \|u-\mathbf{P}_{U_{ad}}(u)\|_{U}, \label{eq_pinn_oc} \end{equation}\end{linenomath*} where two penalty terms are added, and $\beta=(\beta_{1}, \beta_{2})$ are two parameters that need tuning. As the penalty parameters increase to $+ \infty$, the solution set of this unconstrained problem approaches to the solution set of the constrained one. However, this penalty approach has a serious drawback. On the one hand, as the penalty parameters increase, the optimal solution becomes increasingly difficult to obtain. On the other hand, the constraint is not satisfied well if the penalty parameter is small. To alleviate this difficulty, one can use hPINN \cite{lu2021physics} which employs the augmented Lagrangian method to solve \eqref{eq_pinn_oc}. However, it is still challenging to directly extend this approach to $\mathrm{OCP}(\boldsymbol{\mu})$ due to the presence of parameters. This is because it is extremely hard to optimize a series of objective functionals with a continuous range of parameters simultaneously. \subsection{PINN for OCP(\texorpdfstring{\(\boldsymbol{\mu}\)}{μ})} For handling the parametric optimal control problems, an extended PINN method \cite{demo2021extended} with augmented inputs is used to obtain a more accurate parametric prediction. That is, the inputs of the neural networks consist of two parts: the spatial coordinates and the parameters. The optimal solution for any parameter is approximated by a deep neural network that is obtained from solving the parameter-dependent KKT system \eqref{KKT}. In particular, when there is no restriction on the control function $u(\boldsymbol{\mu})$ (e.g., $U_{ad}(\boldsymbol{\mu})$ is the full Banach space), the KKT system is \begin{linenomath*}\begin{equation}\label{KKT_PINN} \mathcal{F}(y(\boldsymbol{\mu}),u(\boldsymbol{\mu}),p(\boldsymbol{\mu});\boldsymbol{\mu}) = \left[\begin{gathered} J_y(y(\boldsymbol{\mu}),u(\boldsymbol{\mu}); \boldsymbol{\mu}) - \mathbf{F}_{y}^*(y(\boldsymbol{\mu}),u(\boldsymbol{\mu}); \boldsymbol{\mu})p(\boldsymbol{\mu})\\ \mathbf{F}(y(\boldsymbol{\mu}),u(\boldsymbol{\mu}); \boldsymbol{\mu})\\ \mathrm{d}_u J(y(\boldsymbol{\mu}),u(\boldsymbol{\mu}); \boldsymbol{\mu}) \end{gathered}\right]=\boldsymbol{0}, \end{equation}\end{linenomath*} where the total gradient $d_u J$ is given in \cref{grad}. In such cases, one can use the PINN algorithm to obtain the optimal solution through minimizing the least-square loss derived from the KKT system. Nevertheless, to apply this method to the cases where there are some additional constraints on the control function $u$, such as the box constraint \eqref{box-constraint}, one may need to introduce the Lagrange multipliers $\lambda(\boldsymbol{\mu}) = (\lambda_a(\boldsymbol{\mu}), \lambda_b(\boldsymbol{\mu}))$ corresponding to the constraints $u(\boldsymbol{\mu}) \geq u_a(\boldsymbol{\mu})$ and $u(\boldsymbol{\mu}) \leq u_b(\boldsymbol{\mu})$. For such cases, the KKT system is \begin{linenomath*} \postdisplaypenalty=0 \begin{subequations}\label{KKT_PINN_box} \begin{align} \mathcal{F}(y(\boldsymbol{\mu}),u(\boldsymbol{\mu}),p(\boldsymbol{\mu}), \lambda(\boldsymbol{\mu}); \boldsymbol{\mu})& = \left[\begin{gathered} J_y(y(\boldsymbol{\mu}),u(\boldsymbol{\mu}); \boldsymbol{\mu}) - \mathbf{F}_{y}^*(y(\boldsymbol{\mu}),u(\boldsymbol{\mu}); \boldsymbol{\mu})p(\boldsymbol{\mu})\\ \mathbf{F}(y(\boldsymbol{\mu}),u(\boldsymbol{\mu}); \boldsymbol{\mu})\\ \mathrm{d}_u J(y(\boldsymbol{\mu}),u(\boldsymbol{\mu}); \boldsymbol{\mu}) - \lambda_a(\boldsymbol{\mu}) + \lambda_b(\boldsymbol{\mu})\\ \lambda_a(\boldsymbol{\mu})(u_a(\boldsymbol{\mu})-u(\boldsymbol{\mu}))\\ \lambda_b(\boldsymbol{\mu})(u_b(\boldsymbol{\mu})-u(\boldsymbol{\mu})) \end{gathered}\right]=\boldsymbol{0}, \label{KKT_PINN_box1}\\ \text{ and } \quad & \left\{\begin{aligned} u_a(\boldsymbol{\mu})\leq u(\boldsymbol{\mu}) \leq u_b(\boldsymbol{\mu}),\\ \lambda_a(\boldsymbol{\mu}) \geq0, \lambda_b(\boldsymbol{\mu}) \geq 0. \end{aligned}\right. \label{KKT_PINN_box2} \end{align} \end{subequations} \end{linenomath*} Applying the framework of PINN to solve the system \eqref{KKT_PINN_box} needs to deal with several penalty terms in the loss function including the penalties of equality terms \eqref{KKT_PINN_box1} and inequality terms \eqref{KKT_PINN_box2}, leading to an inaccurate solution even for the problem with fixed parameters, which will be presented in the next section. In addition, the extra constraint of $U_{ad}(\boldsymbol{\mu})$ often introduces inequality terms and nonlinear terms and brings more singularity to the optimal control function \cite{ali2020reduced, bader2016certified}, which limits the application of PINN for solving $\mathrm{OCP}(\boldsymbol{\mu})$ with control constraints. \subsection{PINN+Projection for OCP(\texorpdfstring{\(\boldsymbol{\mu}\)}{μ})} To find a better baseline for comparison, we propose to improve the performance of PINN by introducing a projection operator. In this way, the KKT system \eqref{KKT} can be reformulated to a more compactly stated condition \cite{nocedal1999numerical}: \begin{linenomath*}\begin{equation}\label{projectedKKT} \mathcal{F}(y(\boldsymbol{\mu}),u(\boldsymbol{\mu}),p(\boldsymbol{\mu}),c; \boldsymbol{\mu}) = \left[\begin{gathered} J_y(y(\boldsymbol{\mu}),u(\boldsymbol{\mu}); \boldsymbol{\mu}) - \mathbf{F}_{y}^*(y(\boldsymbol{\mu}),u(\boldsymbol{\mu}); \boldsymbol{\mu})p(\boldsymbol{\mu})\\ \mathbf{F}(y(\boldsymbol{\mu}),u(\boldsymbol{\mu}); \boldsymbol{\mu})\\ u(\boldsymbol{\mu}) - \mathbf{P}_{U_{ad}(\boldsymbol{\mu})}\left(u(\boldsymbol{\mu})-c \mathrm{d}_{u}J(y(\boldsymbol{\mu}),u(\boldsymbol{\mu}); \boldsymbol{\mu})\right) \end{gathered}\right]=\boldsymbol{0}, \end{equation}\end{linenomath*} where $c$ could be any positive number. Note that choosing an appropriate $c$ can accelerate the convergence of the algorithm. For example, the classic way is to choose $c=1/\alpha$ for canceling out the control function $u$ inside the projection operator, where $\alpha$ is the coefficient of the Tikhonov regularization term (see the experiment in Section~\ref{sec_test1}). The complementary conditions and inequalities caused by the control constraints are avoided in \cref{projectedKKT}, thus significantly reducing the difficulty of optimization. In this paper, we call the method PINN+Projeciton, which combines the projection strategy with the KKT system to formulate the PINN residual loss. Although PINN+Projection alleviates the solving difficulty brought by control constraints to PINN, it still has limitations on nonsmooth optimal control problems. For nonsmooth optimization such as sparse $L_1$-minimization, the KKT system can no longer be described by \eqref{projectedKKT} because of the nondifferentiable property of the $L_1$-norm \cite{de2015numerical}. Instead, the dual multiplier for the $L_1$-cost term is required. The difficulty arises from the third nonsmooth variational equation of \eqref{projectedKKT}, which makes the neural network difficult to train. AONN reduces this difficulty by leveraging the update scheme in the DAL method without the implicit variational equation in \eqref{projectedKKT}. Numerical results also show that the KKT system \eqref{projectedKKT} cannot be directly used to formulate the loss functions of neural networks. Such results of $L_1$-minimization involved in $\mathrm{OCP}$($\boldsymbol{\mu}$) (see Section~\ref{sec_test5_sparse}) strongly suggest that AONN is a more reliable and efficient framework. The proposed AONN method has all the advantages of the aforementioned approaches while avoiding their drawbacks. By inheriting the structure of DAL, the AONN method can obtain an accurate solution through solving the KKT system in an alternative minimization iterative manner. So it does not require the Lagrange multipliers corresponding to the additional control constraints and thus can reduce the storage cost as well as improve the accuracy. Moreover, AONN can accurately approximate the optimal solutions of parametric optimal control problems for any parameter and can be generalized to cases with high-dimensional parameters. \section{A detailed example} Here we include some equations and theorem-like environments to show how these are labeled in a supplement and can be referenced from the main text. Consider the following equation: \begin{equation} \label{eq:suppa} a^2 + b^2 = c^2. \end{equation} You can also reference equations such as \cref{eq:matrices,eq:bb} from the main article in this supplement. \lipsum[100-101] \begin{theorem} An example theorem. \end{theorem} \lipsum[102] \begin{lemma} An example lemma. \end{lemma} \lipsum[103-105] Here is an example citation: \cite{KoMa14}. \section[Proof of Thm]{Proof of \cref{thm:bigthm}} \label{sec:proof} \lipsum[106-112] \section{Additional experimental results} \Cref{tab:foo} shows additional supporting evidence. \begin{table}[htbp] {\footnotesize \caption{Example table} \label{tab:foo} \begin{center} \begin{tabular}{|c|c|c|} \hline Species & \bf Mean & \bf Std.~Dev. \\ \hline 1 & 3.4 & 1.2 \\ 2 & 5.4 & 0.6 \\ \hline \end{tabular} \end{center} } \end{table} \bibliographystyle{siamplain} \section{Introduction} \label{sec:intro} Optimal control modeling has been playing an important role in a wide range of applications, such as aeronautics \cite{xu2021machine}, mechanical engineering \cite{troltzsch2010optimal}, haemodynamics \cite{rozza2012reduction}, microelectronics \cite{pinnau2017quasi}, reservoir simulations \cite{yang2016nonlinear}, and environmental sciences \cite{strazzullo2018model}. Particularly, to solve a PDE-constrained optimal control problem, one needs to find an optimal control function that can minimize a given cost functional for systems governed by partial differential equations (PDEs). Popular approaches for solving PDE-constrained optimal control problems include the direct-adjoint looping (DAL) method \cite{mitter1971optimal,jameson1988aerodynamic} that iteratively solves the adjoint systems, the Newton conjugate gradient method \cite{sternberg2010memory} that exploits the Hessian information, the semismooth Newton method \cite{yang2017nonlinearly, de2007optimal} that includes control and state constraints, and the alternating direction method of multipliers \cite{chen2019fe} designed for convex optimization. In practice, the cost functionals and PDE systems often entail different configurations of physical or geometrical parameters, leading to parametric optimal control modeling. These parameters usually arise from certain desired profiles such as material properties, boundary conditions, control constraints, and computational domains \cite{karcher2016certified,karcher2018certified,strazzullo2018model, negri2015reduced,stadler2009elliptic,pinnau2017quasi,milani2008reduced}. Most of the aforementioned methods cannot be directly applied to parametric optimal control problems. The main reason is that, in addition to the already costly process of solving the PDEs involved in the optimal control modeling, the presence of parameters introduces extra prominent complexity, making the parametric optimal control problems much more challenging than the nonparametric ones \cite{hesthaven2016certified}. An efficient method for solving parametric optimal control problems is the reduced order model (ROM) \cite{quarteroni2015reduced, rozza2012reduction, strazzullo2018model, negri2013reduced}, which relies on surrogate models for the parametric model order reduction, and can provide both efficient and stable approximations if the solutions lie on a low-dimensional subspace \cite{hesthaven2016certified}. However, because of the coupling of the spatial domain and the parametric domain, the discretization in ROM still suffers from the curse of dimensionality, thus is unable to obtain all-at-once solutions to parametric optimal control problems \cite{karcher2016certified, rozza2012reduction, quarteroni2015reduced}. Numerical methods based on deep learning have been receiving increasingly more attentions in solving PDEs \cite{raissi2018hidden,raissi2019physics, weinan2018deep,han2018solving, zhu2019physics,sheng2021pfnn,sheng2022pfnn}. Recently, several successes have been made in solving PDE-constrained optimal control problems with deep-learning-based approaches. For example, a physics-informed neural network (PINN) method is designed to solve optimal control problems by adding the cost functional to the standard PINN loss \cite{mowlavi2022optimal, lu2021physics}. Meanwhile, deep-learning-based surrogate models \cite{xu2021machine,lye2021iterative} and operator learning methods \cite{wang2021fast,hwang2022solving} are proposed to achieve fast inference for the optimal control solution without intensive computations. Although these methods are successful for solving optimal control problems, few of which can be directly applied in parametric optimal control modeling. In a recent work \cite{demo2021extended}, an extended PINN is proposed to augment neural network inputs with parameters, so that the Karush–Kuhn–Tucker (KKT) conditions and neural networks can be combined. In this way, the optimal solution with a continuous range of parameters could be obtained for parametric optimal control problems with simple constraints. However, it is difficult for this method to generalize to solve more complex parametric optimal control problems, especially when the control function has additional inequality constraints \cite{ali2020reduced, bader2016certified}. In such scenarios, too many penalty terms have to be introduced into the loss function to fit the complex KKT system, which is very hard to optimize \cite{krishnapriyan2021characterizing}. A more detailed discussion of aforementioned methods can be found in Section~\ref{sec:analysis}. To tackle the challenges in solving parametric optimal control problems and avoid the curse of dimensionality, we propose AONN, an adjoint-oriented neural network method that combines the advantages of both the classic DAL method and the deep learning technique. In AONN, we construct three neural networks with augmented parameter inputs, and integrate them into the framework of the DAL method to get an all-at-once approximation of the control function, the adjoint function, and the state function, respectively. On the one hand, neural networks enable the classic DAL framework to solve parametric problems simultaneously with the aid of random sampling rather than the discretization of the coupled spatial domain and parametric domain. On the other hand, unlike the PINN-based penalty methods \cite{raissi2019physics,lu2021physics,mowlavi2022optimal,demo2021extended}, the introduction of DAL avoids directly solving the complex KKT system with various penalty terms. Numerical results will show that, AONN can obtain high precision solutions to a series of parametric optimal control problems. The remainder of the paper is organized as follows. In Section~\ref{sec:problem}, the problem setting is introduced. After that, we will present the AONN framework in Section~\ref{sec:method}. Some further comparisons between AONN and several recently proposed methods are discussed in Section~\ref{sec:analysis}. Then, numerical results are presented in Section~\ref{sec:results} to demonstrate the efficiency of the proposed AONN method. The paper is concluded in Section~\ref{sec:conclusions}. \section*{Acknowledgments} This study was funded in part by National Natural Science Foundation of China (\#12131002) and China Postdoctoral Science Foundation (2022M711730). \bibliographystyle{siamplain} \section{Methodology} \label{sec:method} Let $\hat{y}\left(\mathbf{x}(\boldsymbol{\mu}); \boldsymbol{\theta}_{y}\right), \hat{u}\left(\mathbf{x}(\boldsymbol{\mu}); \boldsymbol{\theta}_{u}\right)$, and $\hat{p}\left(\mathbf{x}(\boldsymbol{\mu}); \boldsymbol{\theta}_{p}\right)$ be three independent deep neural networks parameterized with $\boldsymbol{\theta}_y, \boldsymbol{\theta}_u$ and $\boldsymbol{\theta}_p$ respectively. Here, $\mathbf{x}(\boldsymbol{\mu})$ is the augmented input of neural networks, which is given by \begin{linenomath*} \begin{equation*} \mathbf{x}(\boldsymbol{\mu})=\left[\begin{array}{llllll} x_{1}, & \ldots, & x_{d}, & \mu_{1}, & \ldots, & \mu_{D} \end{array}\right]. \end{equation*} \end{linenomath*} We then use $\hat{y}\left(\mathbf{x}(\boldsymbol{\mu}); \boldsymbol{\theta}_{y}\right), \hat{u}\left(\mathbf{x}(\boldsymbol{\mu}); \boldsymbol{\theta}_{u}\right)$, and $\hat{p}\left(\mathbf{x}(\boldsymbol{\mu}); \boldsymbol{\theta}_{p}\right)$ to approximate $y^{*}(\boldsymbol{\mu}), u^{*}(\boldsymbol{\mu})$ and $p^{*}(\boldsymbol{\mu})$ through minimizing three loss functions defined as \begin{linenomath*} \postdisplaypenalty=0 \begin{subequations}\label{eq_resloss} \begin{align} \mathcal{L}_{s}(\boldsymbol{\theta}_y,\boldsymbol{\theta}_u) &= \left(\frac{1}{N}\sum_{i = 1}^{N} | r_{s}\left(\hat{y}(\mathbf{x}(\boldsymbol{\mu})_i;\boldsymbol{\theta}_y),\hat{u}(\mathbf{x}(\boldsymbol{\mu})_i;\boldsymbol{\theta}_u);\boldsymbol{\mu}_i\right) |^{2}\right)^{\frac{1}{2}}, \label{lossstate}\\ \mathcal{L}_{a}(\boldsymbol{\theta}_y,\boldsymbol{\theta}_u,\boldsymbol{\theta}_p) &= \left(\frac{1}{N}\sum_{i = 1}^{N} | r_{a}\left(\hat{y}(\mathbf{x}(\boldsymbol{\mu})_i;\boldsymbol{\theta}_y),\hat{u}(\mathbf{x}(\boldsymbol{\mu})_i;\boldsymbol{\theta}_u), \hat{p}(\mathbf{x}(\boldsymbol{\mu})_i;\boldsymbol{\theta}_p);\boldsymbol{\mu}_i\right) |^{2}\right)^{\frac{1}{2}}, \label{lossadjoint}\\ \mathcal{L}_{u}(\boldsymbol{\theta}_u, u_{\mathsf{step}}) &= \left(\frac{1}{N}\sum_{i = 1}^{N} | \hat{u}(\mathbf{x}(\boldsymbol{\mu})_i;\boldsymbol{\theta}_u) - u_{\mathsf{step}}(\mathbf{x}(\boldsymbol{\mu})_i)|^{2}\right)^{\frac{1}{2}}, \label{lossu} \end{align} \end{subequations} \end{linenomath*} where $\{\mathbf{x}(\boldsymbol{\mu})_i\}_{i=1}^N$ denote the collocation points. The functionals $r_s$ and $r_a$ represent the residuals for the state equation and the adjoint equation induced by the KKT conditions, i.e., \begin{linenomath*} \postdisplaypenalty=0 \begin{subequations}\label{res} \begin{align} r_{s}(y(\boldsymbol{\mu}),u(\boldsymbol{\mu});\boldsymbol{\mu}) &\triangleq \mathbf{F}(y(\boldsymbol{\mu}),u(\boldsymbol{\mu});\boldsymbol{\mu}), \label{res_s}\\ r_{a}(y(\boldsymbol{\mu}),u(\boldsymbol{\mu}),p(\boldsymbol{\mu});\boldsymbol{\mu}) &\triangleq J_y(y(\boldsymbol{\mu}),u(\boldsymbol{\mu});\boldsymbol{\mu}) - \mathbf{F}^{*}_{y}(y(\boldsymbol{\mu}),u(\boldsymbol{\mu});\boldsymbol{\mu})p(\boldsymbol{\mu}), \label{res_a} \end{align} \end{subequations} \end{linenomath*} and $u_{\mathsf{step}}(\mathbf{x}(\boldsymbol{\mu}))$ is an intermediate variable during the update procedure of the control function for the third variational inequality in the KKT conditions \eqref{KKT}, which will be discussed in Section~\ref{sec_proj}. These three loss functions try to fit the KKT conditions by adjusting the parameters of the three neural networks $\hat{y}\left(\mathbf{x}(\boldsymbol{\mu}); \boldsymbol{\theta}_{y}\right), \hat{u}\left(\mathbf{x}(\boldsymbol{\mu}); \boldsymbol{\theta}_{u}\right)$, and $\hat{p}\left(\mathbf{x}(\boldsymbol{\mu}); \boldsymbol{\theta}_{p}\right)$, and the training procedure is performed in a sequential way. The derivatives involved in the loss functions can be computed efficiently by automatic differentiation in deep learning libraries such as TensorFlow \cite{abadi2016tensorflow} or PyTorch \cite{paszke2017automatic}. \subsection{Deep learning for parametric PDEs} The efficient solution of parametric PDEs is crucial for parametric optimal control modeling because of extra parameters involved in the physical system \eqref{OCPmu}. To deal with parametric PDEs, we augment the input space of the neural networks by taking the parameter $\boldsymbol{\mu}$ as additional inputs, along with the coordinates $\mathbf{x}$ to handle the parameter-dependent PDEs. In addition, the penalty-free techniques \cite{lagaris1998artificial,sheng2021pfnn} are employed to enforce boundary conditions in solving parametric PDEs. Next, we illustrate how to apply penalty-free deep neural networks to solve the parametric state equation \eqref{res_s}, which can be directly generalized to the solution of the adjoint equation \eqref{res_a}. The key point of the penalty-free method is to introduce two neural networks to approximate the solution, of which one neural network $\hat{y}_{B}$ is used to approximate the essential boundary conditions and the other $\hat{y}_{I}$ deals with the rest part of the computational domain. In this way, the training difficulties from the boundary conditions are eliminated, which improves the accuracy and robustness for complex geometries. For problems with simple geometries, we can also construct an analytical expression for $\hat{y}_{B}$ to further reduce the training cost (see Section~\ref{sec:results} for examples). The approximate solution of the state equation is constructed by \begin{linenomath*}\begin{equation}\label{eq-pfnn} \hat{y}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{y}\right) = \hat{y}_{B}(\mathbf{x}(\boldsymbol{\mu});\boldsymbol{\theta}_{y_B})+\ell(\mathbf{x}(\boldsymbol{\mu})) \hat{y}_{I}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{y_I}\right), \end{equation}\end{linenomath*} where $\boldsymbol{\theta}_y = \{\boldsymbol{\theta}_{y_B}, \boldsymbol{\theta}_{y_I}\}$ collects all parameters of two sub-neural networks $\hat{y}_{B}$ and $\hat{y}_{I}$, and $\ell$ is a length factor function that builds the connection between $\hat{y}_{B}$ and $\hat{y}_{I}$, satisfying the following two conditions: \begin{linenomath*} \begin{equation*} \left\{\begin{array}{l} \ell(\mathbf{x}(\boldsymbol{\mu})) > 0, \quad \mbox{in}\;\Omega(\boldsymbol{\mu}),\\ \ell(\mathbf{x}(\boldsymbol{\mu})) = 0 ,\quad \mbox{on} \;\partial \Omega(\boldsymbol{\mu}). \end{array}\right.\\ \end{equation*} \end{linenomath*} The details of constructing the length factor function $\ell$ can be found in ref.\cite{sheng2021pfnn}. With these settings, training $\hat{y}_{B}$ and $\hat{y}_{I}$ can be performed separately, i.e., one can first train $\hat{y}_{B}$, and then fix $\hat{y}_{B}$ to train $\hat{y}_{I}$. For a fixed $u(\boldsymbol{\mu})$, we have \begin{linenomath*} \begin{equation*} \begin{aligned} \mathbf{F}(\hat{y}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{y}\right), u(\boldsymbol{\mu});\boldsymbol{\mu}) = \left[\begin{array}{l} \mathbf{F}_I(\hat{y}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{y}\right),u(\boldsymbol{\mu});\boldsymbol{\mu}) \\ \mathbf{F}_B(\hat{y}_{B}(\mathbf{x}(\boldsymbol{\mu});\boldsymbol{\theta}_{y_B}),u(\boldsymbol{\mu});\boldsymbol{\mu}) \end{array}\right], \end{aligned} \end{equation*} \end{linenomath*} and the residual of the state equation can be rewritten as \begin{linenomath*} \begin{equation*} r_{s}(\hat{y}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{y}\right), u(\boldsymbol{\mu});\boldsymbol{\mu}) = \left[\begin{array}{l} r_{s_I}(\hat{y}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{y}\right),u(\boldsymbol{\mu});\boldsymbol{\mu}) \\ r_{s_B}(\hat{y}_{B}(\mathbf{x}(\boldsymbol{\mu});\boldsymbol{\theta}_{y_B}),u(\boldsymbol{\mu});\boldsymbol{\mu}) \end{array}\right]. \end{equation*} \end{linenomath*} We then sample a set $\{\mathbf{x}(\boldsymbol{\mu})_i\}_{i=1}^N$ of collocation points to optimize $\boldsymbol{\theta}_y$ through minimizing the state loss function \eqref{lossstate} if $\boldsymbol{\theta}_u$ is fixed. For parametric problems, we take parameters as the additional inputs of neural networks. This approach is used to solve parametric forward problems \cite{khodayi2020varnet} and control problems \cite{sun2020surrogate}. A typical way for sampling training points is to separately sample data in $\Omega$ and $\mathcal{P}$ to get $\{\mathbf{x}_i\}$ and $\{\boldsymbol{\mu}_j\}$, and then compose product data $\{(\mathbf{x}_i, \boldsymbol{\mu}_j)\}$ in $\Omega\times\mathcal{P}$. Rather than taken from each slice of $\Omega(\boldsymbol{\mu})$ for a fixed $\boldsymbol{\mu}$, collocation points are sampled in space $\Omega_{\mathcal{P}}$ in this work, where \begin{linenomath*} \begin{equation*} \Omega_{\mathcal{P}} = \{\mathbf{x}(\boldsymbol{\mu}):\mathbf{x}\in \Omega(\boldsymbol{\mu})\} \end{equation*} \end{linenomath*} represents the joint spatio-parametric domain. The reason is that, for parametric geometry problems, as the spatial domain $\Omega(\boldsymbol{\mu})$ is parameter-dependent, the sampling space cannot be expressed as the Cartesian product of $\Omega$ and $\mathcal{P}$. \subsection{Projection gradient descent} \label{sec_proj} Due to the additional inequality constraints $ u \in U_{ad}(\boldsymbol{\mu})$ for the control function, the zero gradient condition $\mathrm{d}_{u}J(y^{*}(\boldsymbol{\mu}),u^{*}(\boldsymbol{\mu});\boldsymbol{\mu})=0$ cannot be directly applied to the optimal solution to get the update scheme for $u$. One way to resolve this issue is to introduce additional Lagrange multipliers with some slack variables to handle the inequality constraints. However, this will bring additional penalty terms that could affect the procedure of optimization \cite{chen2020multi}. Furthermore, the inequality constraints also lead to the non-smoothness of the control function, making it more difficult to capture the singularity by penalty methods \cite{lu2021physics, haghighat2021physics}. To avoid these issues, we here use a simple iterative method to handle the variational inequality without utilizing a Lagrange multiplier, where a projection gradient descent method is employed, based on which we can obtain the update scheme for $u$. The projection operator onto the admissible set $U_{ad}(\boldsymbol{\mu})$ is defined as: \begin{linenomath*} \begin{equation*} \mathbf{P}_{U_{ad}(\boldsymbol{\mu})}(u(\boldsymbol{\mu})) = \arg\min_{v(\boldsymbol{\mu})\in U_{ad}(\boldsymbol{\mu})}\|u(\boldsymbol{\mu})-v(\boldsymbol{\mu})\|_{2}, \end{equation*} \end{linenomath*} which performs the projection of $u(\boldsymbol{\mu})$ onto the convex set $U_{ad}(\boldsymbol{\mu})$. In practice, the above projection is implemented in a finite dimensional vector space, i.e., $u(\boldsymbol{\mu})$ is discretized on a set of collocation points (e.g. grids on the domain $\Omega$). So it is straightforward to build this projection since $U_{ad}(\boldsymbol{\mu})$ is a convex set. For example, if \begin{linenomath*}\begin{equation}\label{box-constraint} U_{ad}(\boldsymbol{\mu}) = \{u\in U:u_a(\mathbf{x}(\boldsymbol{\mu}))\leq u(\mathbf{x}(\boldsymbol{\mu})) \leq u_b(\mathbf{x}(\boldsymbol{\mu})),\forall \mathbf{x} \in \Omega(\boldsymbol{\mu}) \} \end{equation}\end{linenomath*} provides a box constraint for $u$, where $u_a$ and $u_b$ are the lower bound function and the upper bound function respectively, both of which are dependent on $\boldsymbol{\mu}$, and $[u_1, \ldots, u_N]^{\mathsf{T}}$ represents the control function values at $N$ collocation points $\{\mathbf{x}(\boldsymbol{\mu})_{i}\}_{i=1}^{N}$ in $\Omega_{\mathcal{P}}$, then we can construct the projection $\mathbf{P}_{U_{ad}(\boldsymbol{\mu})}$ in an entry-wise way \cite{troltzsch2010optimal,hinze2008optimization}: \begin{linenomath*}\begin{equation}\label{eqn_proj} \mathbf{P}_{U_{ad}(\boldsymbol{\mu})}(u_i) = \begin{cases} u_a(\mathbf{x}(\boldsymbol{\mu})_{i}), \quad \mathrm{if} \ u_i < u_a(\mathbf{x}(\boldsymbol{\mu})_{i}) ,\\ u_i, \quad \mathrm{if} \ u_b(\mathbf{x}(\boldsymbol{\mu})_{i}) \geq u_i \geq u_a(\mathbf{x}(\boldsymbol{\mu})_{i}) , \\ u_b(\mathbf{x}(\boldsymbol{\mu})_{i}), \quad \mathrm{if} \ u_i > u_b(\mathbf{x}(\boldsymbol{\mu})_{i}). \end{cases} i = 1, \ldots, N. \end{equation}\end{linenomath*} The projection gradient step can be carried out according to the above formula, so as to obtain the update of the control function denoted by $u_{\mathsf{step}}$, which is \begin{linenomath*}\begin{equation} \label{eq_uproj} u_{\mathsf{step}}(\boldsymbol{\mu}) = \mathbf{P}_{U_{ad}(\boldsymbol{\mu})}\left(u(\boldsymbol{\mu}) - c \mathrm{d}_{u}J(y(\boldsymbol{\mu}),u(\boldsymbol{\mu});\boldsymbol{\mu})\right), \end{equation}\end{linenomath*} and the loss for updating the control function is naturally defined as in \eqref{lossu}, making an approximation of $\hat{u}$ obtained through minimizing \eqref{lossu}. The optimal control function $u^*(\boldsymbol{\mu})$ satisfies the following variational property: \begin{linenomath*} \begin{equation*} u^*(\boldsymbol{\mu}) - \mathbf{P}_{U_{ad}(\boldsymbol{\mu})}\left(u^*(\boldsymbol{\mu})-c \mathrm{d}_{u}J(y^*(\boldsymbol{\mu}),u^*(\boldsymbol{\mu});\boldsymbol{\mu})\right) = 0, \quad \forall c\geq 0. \end{equation*} \end{linenomath*} Here $\mathrm{d}_{u}J$ is associated with the adjoint function $p^{*}(\boldsymbol{\mu})$ from total derivative expression \eqref{grad}, and thus we define the residual for the control function \begin{linenomath*}\begin{equation}\label{eq_rescontrol} r_{v}(y(\boldsymbol{\mu}),u(\boldsymbol{\mu}),p(\boldsymbol{\mu}),c;\boldsymbol{\mu})\triangleq u(\boldsymbol{\mu}) - \mathbf{P}_{U_{ad}(\boldsymbol{\mu})}\left(u(\boldsymbol{\mu})-c \mathrm{d}_{u}J(y(\boldsymbol{\mu}),u(\boldsymbol{\mu});\boldsymbol{\mu})\right), \end{equation}\end{linenomath*} and its corresponding variational loss is defined as \begin{linenomath*}\begin{equation}\label{lossvar} \mathcal{L}_{v}(\boldsymbol{\theta}_y,\boldsymbol{\theta}_u,\boldsymbol{\theta}_p,c) = \left(\frac{1}{N}\sum_{i = 1}^{N} | r_{v}\left(\hat{y}(\mathbf{x}(\boldsymbol{\mu})_i;\boldsymbol{\theta}_y),\hat{u}(\mathbf{x}(\boldsymbol{\mu})_i;\boldsymbol{\theta}_u), \hat{p}(\mathbf{x}(\boldsymbol{\mu})_i;\boldsymbol{\theta}_p),c;\boldsymbol{\mu}_i\right) |^{2}\right)^{\frac{1}{2}}. \end{equation}\end{linenomath*} The first two losses in \eqref{eq_resloss} together with \eqref{lossvar} reflect how well $y(\boldsymbol{\mu}), u(\boldsymbol{\mu})$ and $p(\boldsymbol{\mu})$ approximate the optimal solution governed by the KKT system \eqref{KKT}. Note that $r_{v}$ and $\mathcal{L}_{v}$ are dependent on the constant $c$, which is actually the step size for gradient descent. For verification, the variational loss is constructed to verify the convergence of algorithm, and $c$ is often chosen as the last step size. \subsection{AONN algorithm} Now putting all together, we are ready to present our algorithm. Our goal is to efficiently approximate the minimizer of \eqref{OCPmu} via adjoint-oriented neural networks (AONN). The overall training procedure of AONN consists of three steps: training $\hat{y}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{y}\right)$, updating $\hat{p}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{p}\right)$ and refining $\hat{u}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{u}\right)$. The schematic of AONN for solving the parametric optimal control problems is shown in Figure~\ref{AONN-flow}. The three neural networks $(\hat{y}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{y}\right), \hat{p}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{p}\right), \hat{u}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{u}\right))$ with augmented parametric input, as illustrated in panels A and B, are optimized to iteratively minimizing the objective functional with respect to the corresponding variables once at a time. More specifically, according to the loss functions derived by the three equations shown in panel C, the training procedure is performed as in panel D. Starting with three initial neural networks $\hat{y}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}^0_{y}\right), \hat{p}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}^0_{p}\right)$, and $\hat{u}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}^0_{u}\right)$, we train and obtain the state function $\hat{y}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}^1_{y}\right)$ through minimizing $\mathcal{L}_{s}\left(\boldsymbol{\theta}_{y}, \boldsymbol{\theta}_{u}^0\right)$ (see \eqref{lossstate}), which is equivalent to solving the parameter-dependent state equation. With $\hat{y}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}^1_{y}\right)$, we minimize the loss $\mathcal{L}_{a}\left(\boldsymbol{\theta}_{y}^{1}, \boldsymbol{\theta}_{u}^{0}, \boldsymbol{\theta}_{p}\right)$ (see \eqref{lossadjoint}) for the adjoint equation to get $\hat{p}\left(\mathbf{x} ; \boldsymbol{\theta}^1_{p}\right)$, corresponding to solving the parameter-dependent adjoint equation. To update the control function $\hat{u}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{u}\right)$, $u^0_{\mathsf{step}}(\mathbf{x}(\boldsymbol{\mu}))$ is computed first by gradient descent followed by a projection step (see \eqref{eq_uproj}), and then $\hat{u}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}^1_{u}\right)$ is obtained by minimizing $\mathcal{L}_{u}(\boldsymbol{\theta}_u, u^0_{\mathsf{step}}(\mathbf{x}(\boldsymbol{\mu})))$ (see \eqref{lossu}). Then another iteration starts using $\boldsymbol{\theta}_y^1, \boldsymbol{\theta}_p^1, \boldsymbol{\theta}_u^1$ as the initial parameters. In general, the iterative scheme is specified as follows: \begin{linenomath*} \begin{equation*} \begin{aligned} \text{training } \hat{y}: &&\boldsymbol{\theta}_{y}^{k} &= \arg \min_{\boldsymbol{\theta}_{y}} \mathcal{L}_{s}\left(\boldsymbol{\theta}_{y}, \boldsymbol{\theta}_{u}^{k-1}\right),\\ \text{updating } \hat{p}: &&\boldsymbol{\theta}_{p}^{k} &= \arg \min_{\boldsymbol{\theta}_{p}} \mathcal{L}_{a}\left(\boldsymbol{\theta}_{y}^{k}, \boldsymbol{\theta}_{u}^{k-1}, \boldsymbol{\theta}_{p}\right),\\ \text{refining } \hat{u}: &&\boldsymbol{\theta}_{u}^{k} &= \arg \min_{\boldsymbol{\theta}_{u}} \mathcal{L}_{u}\left(\boldsymbol{\theta}_u, u^{k-1}_{\mathsf{step}}\right), \end{aligned} \end{equation*} \end{linenomath*} where \begin{linenomath*}\begin{equation} u^{k-1}_{\mathsf{step}}(\mathbf{x}(\boldsymbol{\mu})) = \mathbf{P}_{U_{ad}(\boldsymbol{\mu})}\left(\hat{u}(\mathbf{x}(\boldsymbol{\mu});\boldsymbol{\theta}_{u}^{k-1})-c^k \mathrm{d}_{u}J(\hat{y}(\mathbf{x}(\boldsymbol{\mu});\boldsymbol{\theta}_{y}^{k}),\hat{u}(\mathbf{x}(\boldsymbol{\mu});\boldsymbol{\theta}_{u}^{k-1});\boldsymbol{\mu})\right), \label{ustep1} \end{equation}\end{linenomath*} and \begin{linenomath*}\begin{equation}\label{ustep2} \begin{aligned} \mathrm{d}_{u}J\left(\hat{y}(\mathbf{x}(\boldsymbol{\mu});\boldsymbol{\theta}_{y}^{k}),\hat{u}(\mathbf{x}(\boldsymbol{\mu});\boldsymbol{\theta}_{u}^{k-1});\boldsymbol{\mu}\right) &= J_u\left(\hat{y}(\mathbf{x}(\boldsymbol{\mu});\boldsymbol{\theta}_{y}^{k}),\hat{u}(\mathbf{x}(\boldsymbol{\mu});\boldsymbol{\theta}_{u}^{k-1});\boldsymbol{\mu}\right) \\ &- \mathbf{F}_u^*\left(\hat{y}(\mathbf{x}(\boldsymbol{\mu});\boldsymbol{\theta}_{y}^{k}),\hat{u}(\mathbf{x}(\boldsymbol{\mu});\boldsymbol{\theta}_{u}^{k-1});\boldsymbol{\mu}\right)\hat{p}(\mathbf{x}(\boldsymbol{\mu});\boldsymbol{\theta}_{p}^{k}). \end{aligned} \end{equation}\end{linenomath*} The iteration of AONN revolves around the refinement of $\hat{u}$ with the aid of $\hat{y}$ and $\hat{p}$, forming the direct-adjoint looping (DAL) ,which is indicated by red lines in Figure~\ref{AONN-flow}. This procedure shares similarities to the classical DAL framework, but there is a crucial difference between AONN and DAL. That is, a reliable solution of $\mathrm{OCP}(\boldsymbol{\mu})$ for any parameter can be efficiently computed from the trained neural networks in our AONN framework, while DAL cannot achieve this. More details can be found in the discussions of Section~\ref{sec:analysis}. The training process is summerized in Algorithm~\ref{alg_AONN}, where the loss function $\mathcal{L}_{v}(\boldsymbol{\theta}_y,\boldsymbol{\theta}_u,\boldsymbol{\theta}_p,c)$ (see \eqref{lossvar}) is used for the verification. In our practical implementation, we employ the step size decay technique with a decay factor $\gamma$ for robustness. The AONN method can be regarded as an inexact DAL to some extent since the state equation and the adjoint equation are not accurately solved but approximated with neural networks at each iteration. So the number of epochs is increased by $n_{\mathrm{aug}}$ compared with the previous step (on line 9 of Algorithm~\ref{alg_AONN}) to ensure the accuracy and convergence. It is worth noting that the training of network $\hat{u}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}^*_{u}\right)$ can be put after the while loop, if the collocation points are always fixed, since training the state function only uses the value of $u$ at the collocation points (the calculation of line $5$ in Algorithm~\ref{alg_AONN}). \begin{figure}[htbp] \label{AONN-flow} \centering \includegraphics[height=7.5cm]{pic/fig3.1_flow.jpg} \caption{$\text{\rm{The schematic of AONN for solving the parametric optimal control problems.}}$ $\rm{(A)}$ Spatial coordinates and parameters form the input of neural networks. $\rm{(B)}$ AONN consists of three separate neural networks $\hat{y}, \hat{p}, \hat{u}$ and return the approximation of state, adjoint and control respectively. $\rm{(C)}$ The state equation, the adjoint eqaution and the projected gradient equation are derived to formulate the corresponding loss functions. $\rm{(D)}$ The gradients in the state PDE and the adjoint PDE are computed via automatic differentiation \cite{paszke2017automatic}. $\hat{y},\hat{p},\hat{u}$ are then trained sequentially via the Adam \cite{kingma2014adam} or the BFGS optimizer.} \end{figure} \begin{algorithm}[H] \caption{AONN for $\mathrm{OCP(\boldsymbol{\mu})}$} \label{alg_AONN} \begin{algorithmic}[1] \REQUIRE Initial $\boldsymbol{\theta}_y^0, \boldsymbol{\theta}_u^0, \boldsymbol{\theta}_p^0$, collocation points$\{\mathbf{x}(\boldsymbol{\mu})_i\}_{i=1}^N$, decay factor $\gamma \in (0,1]$, initial step size $c^0$, initial number of epochs $n^0$, positive integer $n_{\mathrm{aug}}$ and total iterations $N_{\mathrm{iter}}$. \STATE $k \longleftarrow 1$ \WHILE{$k<N_{\mathrm{iter}}+1$} \STATE $\boldsymbol{\theta}_{y}^{k} \longleftarrow \arg \min_{\boldsymbol{\theta}_{y}} \mathcal{L}_{s}\left(\boldsymbol{\theta}_{y}, \boldsymbol{\theta}_{u}^{k-1}\right)$: Train network $\hat{y}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{y}\right)$ with initialization $\boldsymbol{\theta}_{y}^{k-1}$ for $n^k$ epochs. \STATE $\boldsymbol{\theta}_{p}^{k} \longleftarrow \arg \min _{\boldsymbol{\theta}_{p}} \mathcal{L}_{a}\left(\boldsymbol{\theta}_{y}^{k}, \boldsymbol{\theta}_{u}^{k-1}, \boldsymbol{\theta}_{p}\right)$: Train network $\hat{p}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{p}\right)$ with initialization $\boldsymbol{\theta}_{p}^{k-1}$ for $n^k$ epochs. \STATE Compute $u_{\mathsf{step}}^{k-1}(\mathbf{x}(\boldsymbol{\mu}))$ by \eqref{ustep1} and \eqref{ustep2}. \STATE $\boldsymbol{\theta}_{u}^{k} \longleftarrow \arg \min _{\boldsymbol{\theta}_{u}} \mathcal{L}_{u}(\boldsymbol{\theta}_u, u^{k-1}_{\mathsf{step}})$: Train network $\hat{u}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{u}\right)$ with initialization $\boldsymbol{\theta}_{u}^{k-1}$ for $n^k$ epochs. \STATE $c^{k+1} \longleftarrow \gamma c^k$. \STATE $n^{k+1} \longleftarrow n^k + n_{\mathrm{aug}}$. \STATE $k \longleftarrow k+1$. \ENDWHILE \STATE $\hat{y}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}^*_{y}\right) \longleftarrow \hat{y}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}^k_{y}\right)$. \STATE $\hat{u}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}^*_{u}\right) \longleftarrow \hat{u}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}^k_{u}\right)$. \ENSURE $\hat{y}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}^*_{y}\right), \hat{u}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}^*_{u}\right)$. \end{algorithmic} \end{algorithm} \begin{remark} A post-processing step can be applied to continue training $\boldsymbol{\theta}^*_{y}$ until a more accurate solution of the state function (or the adjoint function) is found. That is, we can fix $\hat{u}\left(\mathbf{x}; \boldsymbol{\theta}^*_{u}\right)$ and train $\boldsymbol{\theta}^*_{y}$ by minimizing the state loss \eqref{lossstate} . We can also fix $\boldsymbol{\theta}^*_{y}, \boldsymbol{\theta}^*_{u}$ and train $\boldsymbol{\theta}^*_{p}$ using \eqref{lossadjoint}. The initial step size $c^0$ is crucial for the convergence of Algorithm \ref{alg_AONN}. A large step size may lead to divergence of the algorithm, while a small one could result in slow convergence. \end{remark} \section{Problem setup} \label{sec:problem} Let $\boldsymbol{\mu} \in \mathcal{P} \subset \mathbb{R}^D$ denote a vector that collects a finite number of parameters. Let $\Omega(\boldsymbol{\mu}) \subset \mathbb{R}^d$ be a spatial domain depending on $\boldsymbol{\mu}$, that is bounded, connected and with boundary $\partial \Omega(\boldsymbol{\mu})$, and $\mathbf{x} \in \Omega(\boldsymbol{\mu})$ denote a spatial variable. Consider the following parametric optimal control problem \begin{linenomath*}\begin{equation}\label{OCPmu} \mathrm{OCP}(\boldsymbol{\mu}):\quad \left\{\begin{aligned} &\min _{(y(\mathbf{x}, \boldsymbol{\mu}), u(\mathbf{x}, \boldsymbol{\mu})) \in Y \times U} J(y(\mathbf{x}, \boldsymbol{\mu}), u(\mathbf{x}, \boldsymbol{\mu}) ; \boldsymbol{\mu}),\\ &\text { s.t. } \ \mathbf{F}(y(\mathbf{x}, \boldsymbol{\mu}),u(\mathbf{x}, \boldsymbol{\mu});\boldsymbol{\mu}) = 0 \ \text{ in } \Omega(\boldsymbol{\mu}), \text{ and } \ u(\mathbf{x}, \boldsymbol{\mu})\in U_{ad}(\boldsymbol{\mu}), \end{aligned}\right. \end{equation}\end{linenomath*} where $J: Y \times U \times \mathcal{P} \mapsto \mathbb{R}$ is a parameter-dependent objective functional, $Y$ and $U$ are two proper function spaces defined on $\Omega(\boldsymbol{\mu})$, with $y \in Y$ being the state function and $u \in U$ the control function, respectively. Both $y$ and $u$ are dependent on $\mathbf{x}$ and $\boldsymbol{\mu}$. To simplify the notation, we denote $y(\boldsymbol{\mu}) = y(\mathbf{x}, \boldsymbol{\mu})$ and $u(\boldsymbol{\mu}) = u(\mathbf{x}, \boldsymbol{\mu})$. In $\mathrm{OCP}(\boldsymbol{\mu})$ \eqref{OCPmu}, $\mathbf{F}$ represents the governing equation, such as, in our case, parameter-dependent PDEs, including the partial differential operator $\mathbf{F}_I$ and the boundary operator $\mathbf{F}_B$ (see Section~\ref{sec:results} for examples). The admissible set $U_{ad}(\boldsymbol{\mu})$ is a parameter-dependent bounded closed convex subset of $U$, which provides an additional inequality constraint for $u$, e.g., the box constraint $U_{ad}(\boldsymbol{\mu})=\{u(\boldsymbol{\mu})\in U : u_a(\boldsymbol{\mu})\leq u(\boldsymbol{\mu}) \leq u_b(\boldsymbol{\mu})\}$. Since the $\mathrm{OCP}(\boldsymbol{\mu})$ \eqref{OCPmu} is a constrained minimization problem, the necessary condition for the minimizer $(y^{*}(\boldsymbol{\mu}), u^*(\boldsymbol{\mu}))$ of \eqref{OCPmu} is the following KKT system \cite{troltzsch2010optimal,de2015numerical,hinze2008optimization}: \begin{linenomath*}\begin{equation}\label{KKT} \left\{\begin{aligned} &J_y(y^{*}( \boldsymbol{\mu}),u^{*}( \boldsymbol{\mu}); \boldsymbol{\mu}) - \mathbf{F}^{*}_{y}(y^{*}( \boldsymbol{\mu}),u^{*}(\boldsymbol{\mu});\boldsymbol{\mu})p^{*}(\boldsymbol{\mu}) =0, \\ &\mathbf{F}(y^{*}( \boldsymbol{\mu}),u^{*}( \boldsymbol{\mu});\boldsymbol{\mu}) = 0, \\ &(\mathrm{d}_u J(y^{*}(\boldsymbol{\mu}),u^{*}(\boldsymbol{\mu});\boldsymbol{\mu}),v(\boldsymbol{\mu})-u^{*}(\boldsymbol{\mu})) \geq 0, \ \forall v(\boldsymbol{\mu}) \in U_{ad}(\boldsymbol{\mu}), \end{aligned}\right. \end{equation}\end{linenomath*} where $p^{*}(\boldsymbol{\mu})$ is the adjoint function which is also known as the Lagrange multiplier, and $\mathbf{F}^{*}_{y}(y(\boldsymbol{\mu}),u(\boldsymbol{\mu});\boldsymbol{\mu})$ denotes the adjoint operator of $\mathbf{F}_{y}(y(\boldsymbol{\mu}),u(\boldsymbol{\mu});\boldsymbol{\mu})$. As $y(\boldsymbol{\mu})$ can always be uniquely determined by $u(\boldsymbol{\mu})$ through the state equation $\mathbf{F}$, the total derivative of $J$ with respect to $u$ in \eqref{KKT} can be formulated as \begin{linenomath*}\begin{equation}\label{grad} \mathrm{d}_{u}J(y^{*}(\boldsymbol{\mu}),u^{*}(\boldsymbol{\mu});\boldsymbol{\mu}) = J_u(y^{*}(\boldsymbol{\mu}),u^{*}(\boldsymbol{\mu});\boldsymbol{\mu}) - \mathbf{F}_u^*(y^{*}(\boldsymbol{\mu}),u^{*}(\boldsymbol{\mu});\boldsymbol{\mu})p^{*}(\boldsymbol{\mu}). \end{equation}\end{linenomath*} The solution of OCP($\boldsymbol{\mu}$) satisfies the system \eqref{KKT}. So the key point is to solve this KKT system, based on which it is expected to find a minimizer for the OCP($\boldsymbol{\mu}$). In general, it is not a trivial task to solve \eqref{KKT} directly, and solving the parametric PDE involved in the KKT system poses additional computational challenges (e.g. the discretization of parametric spaces). In this work, we focus on the deep learning method to solve \eqref{KKT}. More specifically, we use three deep neural networks to approximate $y^{*}(\boldsymbol{\mu}), u^{*}(\boldsymbol{\mu})$ and $p^{*}(\boldsymbol{\mu})$ separately with an efficient training algorithm. \section{Numerical study} \label{sec:results} In this section, we present results of five numerical experiments to illustrate the effectiveness of AONN, where different types of PDE constraints, objective functionals and control constraints under different parametric settings are studied. In the following, AONN is first validated by solving OCP, and further applied to solving OCP($\boldsymbol{\mu})$ with continuous parameters changing over a specific interval. For comparison purposes, we also use the PINN method and the PINN+Projecton method to solve OCP($\boldsymbol{\mu}$). We employ the ResNet model \cite{he2016deep} with sinusoid activation functions to build the neural networks for AONN and other neural network based algorithms. Unless otherwise specified, the quasi Monte-Carlo method is used to generate collocation points from $\Omega_{\mathcal{P}}$ by calling the SciPy module \cite{virtanen2020scipy}. Analytical length factor functions (see \eqref{eq-pfnn}) are constructed for all test problems to make the approximate solution naturally satisfy Dirichlet boundary conditions. The training of neural networks is performed on a Geforce RTX 2080 GPU with PyTorch 1.8.1. The Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm with a strong Wolfe line search strategy is used to update the neural network parameters to speed up the convergence, where the maximal number of iterations for BFGS is set to $100$. \subsection{Test 1: Optimal control for the semilinear elliptic equations}\label{sec_test1} We start with the following nonparametric optimal control problem: \begin{linenomath*}\begin{equation}\label{test1} \left\{\begin{aligned} &\min_{y,u} J(y, u):=\frac{1}{2}\left\|y-y_{d}\right\|_{L_{2}(\Omega)}^{2}+\frac{\alpha}{2}\|u\|_{L_{2}(\Omega)}^{2} ,\\ &\text { subject to } \left\{\begin{aligned} -\Delta y + y^3&=u+f &&\text{ in } \Omega \\ y &=0 &&\text { on } \partial \Omega, \end{aligned}\right.\\ &\text{and}\quad u_a \leq u \leq u_b \quad \text { a.e. in } \Omega.\\ \end{aligned}\right. \end{equation}\end{linenomath*} The total derivative of $J$ with respect to $u$ is $\mathrm{d}_{u}J(y,u) = \alpha u + p$, where $p$ is the solution of the corresponding adjoint equation: \begin{linenomath*}\begin{equation} \label{test1-adjoint} \left\{\begin{aligned} -\Delta p + 3py^2 &= y-y_d &&\text{ in } \Omega, \\ p &=0 &&\text { on } \partial \Omega. \end{aligned}\right. \end{equation}\end{linenomath*} We take the same configuration as in ref.\cite{gong2015multilevel}, where $\Omega=(0,1)^2$, $\alpha=0.01$, $u_a=0$, and $u_b=3$. The analytical optimal solution is given by \begin{linenomath*}\begin{equation}\label{case1} \begin{aligned} &y^{*} = \sin \left(\pi x_{1}\right) \sin \left(\pi x_{2}\right),\\ &u^{*} = \mathbf{P}_{[u_a,u_b]}(2\pi^{2}y^{*}),\\ &p^{*} = -2\alpha\pi^{2}y^{*},\\ \end{aligned} \end{equation}\end{linenomath*} where $\mathbf{P}_{[u_a,u_b]}$ is the pointwise projection operator onto the interval $[u_a,u_b]$. The desired state $y_d = (1+4\pi^4\alpha)y^{*}-3y^{*2}p^{*}$ and the source term $f = 2\pi^2 y^{*} + y^{*3} - u^{*}$ are given to satisfy the state equation and the adjoint equation. To solve the optimal control problem with AONN, we construct three networks $\hat{y}_{I}\left(\mathbf{x}(\boldsymbol{\mu}); \boldsymbol{\theta}_{y_I}\right), \hat{p}_{I}\left(\mathbf{x}(\boldsymbol{\mu}); \boldsymbol{\theta}_{p_I}\right)$ and $\hat{u}\left(\mathbf{x}(\boldsymbol{\mu}); \boldsymbol{\theta}_{u}\right)$, whose network structures are all comprised of two ResNet blocks, each of which contains two fully connected layers with $15$ neurons and a residual connection. We randomly sample $N = 4096$ points inside $\Omega$ to form the training set. A uniform meshgrid with size $256\times256$ in $\Omega$ is generated for testing and visualization. We use fixed step size and training epochs in subproblems, i.e. $c^k \equiv 1/\alpha = 100, n^k\equiv500$. The loss behavior and the relative error $\|u - u^*\|/\|u^*\|$ with $\ell_2$-norm and $\ell_{\infty}$-norm are reported in Figure~\ref{fig:test1-ocp-1}, while Figure~\ref{fig:test1-ocp-2} evaluates the difference between the AONN solution and the analytical solution. As reported in ref.\cite{gong2015multilevel}, to achieve the error $1 \times 10^{-4}$ in the $\ell_2$ sense requires $7733$ degrees of freedom with the finite element method, while the AONN method needs only $781$ neural network parameters to approximate the control function. \begin{figure}[!htbp] \centering \subfigure[] {\includegraphics[width=0.38\textwidth]{pic/fig5.1_test1-1.png}\label{fig:test1-ocp-1}} \subfigure[] {\includegraphics[width=0.58\textwidth]{pic/fig5.1_test1-2.png}\label{fig:test1-ocp-2}} \caption{Test 1: training loss and test error of problem \ref{test1}. Test error is evaluated at 256$\times$256 grid points. (a) Loss behaviour measured in terms of \eqref{lossstate}-\eqref{lossadjoint}, and test errors in both $\ell_2$-norm and $\ell_{\infty}$-norm during training process. (b) The AONN solution and its absolute errors compared with the analytical solution.} \end{figure} \subsection{Test 2: Optimal control for the semilinear elliptic equations with control constraint parametrization}\label{sec_test2} We then consider the same optimal control problem with control constraint parametrization. The control constraint upper bound $u_b$ is set to be a continuous variable $\boldsymbol{\mu}$ ranging from $3$ to $20$ instead of a fixed number. Thus \eqref{test1} actually constructs a series of optimal control problems and the optimal solutions \eqref{case1} are dependent on $\boldsymbol{\mu}$. We now verify whether the all-at-once solutions can be obtained by AONN when $\boldsymbol{\mu}$ changes continuously over the interval $3\leq \boldsymbol{\mu} \leq 20$. We seek optimal $y(\boldsymbol{\mu}), u(\boldsymbol{\mu})$ defined by the following problem: \begin{linenomath*}\begin{equation} \left\{\begin{aligned} &\min_{y(\boldsymbol{\mu}),u(\boldsymbol{\mu})} J(y(\boldsymbol{\mu}), u(\boldsymbol{\mu})):=\frac{1}{2}\left\|y(\boldsymbol{\mu})-y_{d}(\boldsymbol{\mu})\right\|_{L_{2}(\Omega)}^{2}+\frac{\alpha}{2}\|u(\boldsymbol{\mu})\|_{L_{2}(\Omega)}^{2}, \\ &\text { subject to } \left\{\begin{aligned} -\Delta y(\boldsymbol{\mu}) + y(\boldsymbol{\mu})^3&=u(\boldsymbol{\mu})+f(\boldsymbol{\mu}) &&\text{ in } \Omega \\ y(\boldsymbol{\mu}) &=0 &&\text { on } \partial \Omega, \end{aligned}\right.\\ &\text{and}\quad u_a \leq u(\boldsymbol{\mu}) \leq \boldsymbol{\mu} \quad \text { a.e. in } \Omega.\\ \end{aligned}\right. \label{test1-pocp} \end{equation}\end{linenomath*} To naturally satisfy the homogeneous Dirichlet boundary conditions in the state equation and the adjoint equation, three neural networks for approximating the AONN solutions of $\mathrm{OCP}(\boldsymbol{\mu})$ \eqref{test1-pocp} are defined as follows: \begin{linenomath*}\begin{equation} \begin{aligned} \hat{y}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{y_I}\right)&=\ell(\mathbf{x}) \hat{y}_{I}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{y_I}\right),\\ \hat{p}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{p_I}\right)&=\ell(\mathbf{x}) \hat{p}_{I}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{p_I}\right),\\ \hat{u}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{u}\right)&= \hat{u}_{I}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{u}\right), \end{aligned}\\ \end{equation}\end{linenomath*} where the length factor function is formed by \begin{linenomath*}\begin{equation} \ell(\mathbf{x}) = x_0(1 - x_0)x_1(1 - x_1). \end{equation}\end{linenomath*} The network structures of $\hat{y}_{I}\left(\mathbf{x}(\boldsymbol{\mu}); \boldsymbol{\theta}_{y_I}\right), \hat{p}_{I}\left(\mathbf{x}(\boldsymbol{\mu}); \boldsymbol{\theta}_{p_I}\right)$ and $\hat{u}\left(\mathbf{x}(\boldsymbol{\mu}); \boldsymbol{\theta}_{u}\right)$ are the same as those of the previous test except for the input dimension being $3$ and the number of neurons in each hidden layer being $20$, resulting in $1361$ undecided parameters. To evaluate the loss, we sample $N = 20480$ points in the spatio-parametric space $\Omega_{\mathcal{P}}$. We keep the same step size $c^k$ and training epochs $n^k$ as the previous test, and perform $N_{\mathrm{iter}}=20$ iterations until Algorithm \ref{alg_AONN} converges. The test errors are computed on the uniform meshgrid with size $256 \times256$ for each realization of $\boldsymbol{\mu}$. In Figure \ref{fig:test1-pocp}, we plot the analytical solutions, the AONN solutions and the PINN solutions for eight equidistant realizations of $\boldsymbol{\mu}$, where it can be seen that the AONN solutions are better than the PINN solutions in the sense of absolute error. Looking more closely, the large errors are concentrated around the location of singularity of $u$, i.e., the curve of active constraints $\{\mathbf{x} : u(\mathbf{x}(\boldsymbol{\mu}))=\boldsymbol{\mu}\}$, except for the case $\boldsymbol{\mu}=20$ where the inequality constraint is nonactive, keeping the smoothness of the optimal control function. Note that adaptive sampling strategies~\cite{tang2021das, adda_2022, gao2022failure} may be used to improve the accuracy in the singularity region, which will be left for future study. \begin{figure}[htbp] \centering \includegraphics[width=14cm]{pic/fig5.2_test2.png} \caption{Test 2: the control solutions $u(\boldsymbol{\mu})$ of AONN and PINN with eight realizations of $\boldsymbol{\mu}\in[3,20]$, and their absolute errors.} \label{fig:test1-pocp} \end{figure} \subsection{Test 3: Optimal control for the Navier-Stokes equations with physical parametrization}\label{sec_test3} The next test case is the parametric optimal control problem \begin{linenomath*}\begin{equation} \min _{y(\boldsymbol{\mu}), u(\boldsymbol{\mu})} J(y(\boldsymbol{\mu}),u(\boldsymbol{\mu}))=\frac{1}{2}\left\|y(\boldsymbol{\mu})-y_{d}(\boldsymbol{\mu})\right\|_{L_2(\Omega)}^{2}+\frac{1}{2}\|u(\boldsymbol{\mu})\|_{L_2(\Omega)}^{2}, \end{equation}\end{linenomath*} subject to the following steady-state incompressible Navier-Stokes (NS) equations: \begin{linenomath*}\begin{equation}\label{NS} \left\{ \begin{aligned} -\boldsymbol{\mu} \Delta y(\boldsymbol{\mu})+(y(\boldsymbol{\mu}) \cdot \nabla) y(\boldsymbol{\mu})+\nabla p(\boldsymbol{\mu}) &=u(\boldsymbol{\mu}) + f(\boldsymbol{\mu}) & & \text { in } \Omega, \\ \operatorname{div} y(\boldsymbol{\mu}) &=0 & & \text { in } \Omega, \\ y(\boldsymbol{\mu}) &=0 & & \text { on } \partial \Omega, \end{aligned} \right. \end{equation}\end{linenomath*} in $\Omega=(0,1)^2$ with parameter $\boldsymbol{\mu}$ representing the reciprocal of the Reynolds number. Note that the nonparametric problems without control constraint for $\boldsymbol{\mu} = 0.1$ and $\boldsymbol{\mu} = 1.0$ were studied in refs.\cite{lowe2011projection,wachsmuth2006optimal}. We set the physical parameter $\boldsymbol{\mu}\in[0.1, 100]$ and in addition, we consider the following constraint for $u(\boldsymbol{\mu})=(u_1(\boldsymbol{\mu}), u_2(\boldsymbol{\mu}))$: \begin{linenomath*}\begin{equation}\label{u-constrain} u_1(\boldsymbol{\mu})^2 + u_2(\boldsymbol{\mu})^2 \leq r^2, \end{equation}\end{linenomath*} with $r = 0.2$, posing additional challenges to this problem. The desired state $y_{d}(\boldsymbol{\mu})$ and the source term $f(\boldsymbol{\mu})$ are given in advance to ensure that the analytical solution of the above OCP($\boldsymbol{\mu}$) is given by \begin{linenomath*} \begin{equation*} \begin{aligned} y^{*}(\boldsymbol{\mu})&=e^{-0.05 \boldsymbol{\mu}}\left(\begin{array}{c} \sin ^{2} \pi x_{1} \sin \pi x_{2} \cos \pi x_{2} \\ -\sin ^{2} \pi x_{2} \sin \pi x_{1} \cos \pi x_{1} \end{array}\right),\\ \lambda^{*}(\boldsymbol{\mu})&=\left(e^{-0.05 \boldsymbol{\mu}}-e^{-\boldsymbol{\mu}}\right)\left(\begin{array}{c} \sin ^{2} \pi x_{1} \sin \pi x_{2} \cos \pi x_{2} \\ -\sin ^{2} \pi x_{2} \sin \pi x_{1} \cos \pi x_{1}, \end{array}\right). \end{aligned} \end{equation*} \end{linenomath*} The adjoint equation is specified as \begin{linenomath*}\begin{equation}\label{NSadjoint} \left\{ \begin{aligned} -\boldsymbol{\mu} \Delta \lambda(\boldsymbol{\mu})-(y(\boldsymbol{\mu}) \cdot \nabla) \lambda(\boldsymbol{\mu})+(\nabla y(\boldsymbol{\mu}))^{T} \lambda(\boldsymbol{\mu})+\nabla \nu(\boldsymbol{\mu}) &=y(\boldsymbol{\mu})-y_{d}(\boldsymbol{\mu}) & & \text { in } \Omega, \\ \operatorname{div} \lambda(\boldsymbol{\mu}) &=0 & & \text { in } \Omega, \\ \lambda(\boldsymbol{\mu}) &=0 & & \text { on } \partial \Omega, \end{aligned} \right. \end{equation}\end{linenomath*} where $\lambda(\boldsymbol{\mu})$ denotes the adjoint velocity and $\nu(\boldsymbol{\mu})$ denotes the adjoint pressure. The optimal pressure and adjoint pressure $p^{*}(\boldsymbol{\mu}), \nu^{*}(\boldsymbol{\mu})$ are both zero. In order to satisfy the state equation and the adjoint equation, $y_{d}(\boldsymbol{\mu})$ and $f(\boldsymbol{\mu})$ are chosen as \begin{linenomath*}\begin{equation} \begin{aligned} f(\boldsymbol{\mu}) &= -\boldsymbol{\mu} \Delta y^{*}(\boldsymbol{\mu})+(y^{*}(\boldsymbol{\mu}) \cdot \nabla) y^{*}(\boldsymbol{\mu})-u^{*}(\boldsymbol{\mu}), \\ y_{d}(\boldsymbol{\mu})&=y^{*}(\boldsymbol{\mu})-\left(-\boldsymbol{\mu} \Delta \lambda^{*}(\boldsymbol{\mu})+(y^{*}(\boldsymbol{\mu}) \cdot \nabla) \lambda^{*}(\boldsymbol{\mu})-(\nabla y^{*}(\boldsymbol{\mu}))^{T} \lambda^{*}(\boldsymbol{\mu})\right). \end{aligned} \end{equation}\end{linenomath*} It is easy to check that the optimal control is $u^{*}(\boldsymbol{\mu})=\mathbf{P}_{B(0,r)}(\lambda^{*}(\boldsymbol{\mu}))$, where $B(0,r)$ is a ball centered at the origin of radius $r$. The state equation \eqref{NS} and the adjoint equation \eqref{NSadjoint} together with the variational inequality where $\mathrm{d}_{u}J(\boldsymbol{\mu})= u(\boldsymbol{\mu}) - \lambda(\boldsymbol{\mu})$ formulate the optimality system. For AONN, we use a neural network to approximate $y$, and it is constructed by two ResNet blocks, each of which contains two fully connected layers with $20$ units and a residual connection, resulting in $1382$ parameters. The neural network for approximating $p$ has two ResNet blocks built by two fully connected layers with $10$ units, resulting in $381$ parameters. The architectures of the neural networks for $\lambda$ and $\nu$ are the same as those of $y$ and $p$ respectively. We select $N=20000$ randomly sampled points in the spatio-parametric space $\Omega_{\mathcal{P}}$. The maximum iteration number in Algorithm \ref{alg_AONN} is set to $N_{\mathrm{iter}} = 300$ and the step size is $c^k\equiv c^0=1.0$. We choose an initial training epoch $n^0 = 200$ and increase it by $n_{\mathrm{aug}}=100$ after every $100$ iterations. For the PINN method, the architectures of the neural networks are the same as those of AONN except for adding another neural network for $\zeta(\boldsymbol{\mu})$ to satisfy the following KKT system: \begin{linenomath*}\begin{equation}\label{test3-KKT} \left\{\begin{array}{l} \text{state equation}\, \eqref{NS},\\ \text{adjoint equation}\, \eqref{NSadjoint},\\ u_1(\boldsymbol{\mu}) - \lambda_1(\boldsymbol{\mu}) + 2u_1(\boldsymbol{\mu}) \zeta(\boldsymbol{\mu}) = 0,\\ u_2(\boldsymbol{\mu}) - \lambda_2(\boldsymbol{\mu}) + 2u_2(\boldsymbol{\mu}) \zeta(\boldsymbol{\mu}) = 0,\\ (u_1(\boldsymbol{\mu})^2 + u_2(\boldsymbol{\mu})^2 - r^2)\zeta(\boldsymbol{\mu}) = 0,\\ u_1(\boldsymbol{\mu})^2 + u_2(\boldsymbol{\mu})^2 \leq r^2, \zeta(\boldsymbol{\mu}) \geq 0,\\ \end{array}\right.\\ \end{equation}\end{linenomath*} where $\zeta(\boldsymbol{\mu})$ is the Lagrange multiplier of the control constraint \eqref{u-constrain}. We compare the solutions of AONN with those obtained using PINN and plot their absolute errors in Figure~\ref{fig:test2-compare}, where it shows the control function $u=(u_1,u_2)$ for a representative parameter $\boldsymbol{\mu}=10$. From the figure, it can be seen that AONN can obtain a more accurate optimal control function than that of PINN, even when the training of PINN costs more epochs than that of AONN. Also, the quadratic constraint is not satisfied well for the PINN solution because there are more penalties from the KKT system \cref{test3-KKT} for the PINN loss. We compute the relative error $\|u - u^*\|/\|u^*\|$ on a uniform $256\times 256$ meshgrid for each parameter $\boldsymbol{\mu}$ and plot the results in Figure~\ref{fig:test2-mu}. For most of the parameters, the relative errors of the AONN solutions are smaller than that of PINN, indicating that AONN is more effective and efficient than PINN in solving parametric optimal control problems. Note that this problem becomes harder when the parameter $\boldsymbol{\mu}$ gets smaller \cite{wachsmuth2006optimal}. In particular, the relative errors of AONN and PINN are both large as $\boldsymbol{\mu}$ closes to $0.1$. \begin{figure}[htbp] \centering \includegraphics[height=5.5 cm]{pic/fig5.3_test3.png} \caption{Test 3: optimal solutions of the state function $y=(y_1,y_2)$ and the control function $u=(u_1,u_2)$ obtained by AONN and PINN, and their absolute errors for a given parameter $\boldsymbol{\mu}=10$.} \label{fig:test2-compare} \end{figure} \begin{figure}[htbp] \centering \includegraphics[height=5cm]{pic/fig5.4_test3.png} \caption{Test 3: the relative errors (in the $\ell_2$-norm sense) of AONN and PINN for the two components of $u(\boldsymbol{\mu})=(u_1(\boldsymbol{\mu}), u_2(\boldsymbol{\mu}))$. The relative errors are computed on the $256\times 256$ meshgrid for each fixed parameter $\boldsymbol{\mu}$.} \label{fig:test2-mu} \end{figure} \subsection{Test 4: Optimal control for the Laplace equation with geometrical parametrization}\label{sec_test4_geo} In this test case, we are going to solve the following parametric optimal control problem: \begin{linenomath*}\begin{equation} \label{eq:test3} \left\{\begin{aligned} &\min _{y(\boldsymbol{\mu}), u(\boldsymbol{\mu})} J\left(y(\boldsymbol{\mu}), u(\boldsymbol{\mu})\right)=\frac{1}{2}\left\|y(\boldsymbol{\mu})-y_{d}(\boldsymbol{\mu})\right\|_{L_{2}\left(\Omega(\boldsymbol{\mu})\right)}^{2}+\frac{\alpha}{2}\left\|u(\boldsymbol{\mu})\right\|_{L_{2}\left(\Omega(\boldsymbol{\mu})\right)}^{2}, \\ &\text { subject to } \left\{\begin{aligned} -\Delta y(\boldsymbol{\mu})&=u(\boldsymbol{\mu}) &&\text { in } \Omega(\boldsymbol{\mu}), \\ y(\boldsymbol{\mu})&=1 &&\text { on }\partial \Omega(\boldsymbol{\mu}),\\ \end{aligned}\right.\\ &\text{and} \quad u_a \leq u(\boldsymbol{\mu}) \leq u_b \quad \text { a.e. in } \Omega(\boldsymbol{\mu}), \end{aligned}\right. \end{equation}\end{linenomath*} where $\boldsymbol{\mu}=(\mu_1, \mu_2)$ represents the geometrical and desired state parameters. The parametric computational domain is $\Omega(\boldsymbol{\mu}) = ([0,2]\times[0,1])\backslash B((1.5,0.5), \mu_1)$ and the desired state is given by \begin{linenomath*}\begin{equation} y_d(\boldsymbol{\mu}) = \begin{cases} 1 & \text { in } \Omega_{1}=[0,1]\times[0,1], \\ \mu_2 & \text { in }\Omega_{2}(\boldsymbol{\mu})=([1,2]\times[0,1])\backslash B((1.5,0.5),\mu_1), \end{cases} \end{equation}\end{linenomath*} where $B((1.5,0.5), \mu_1)$ is a ball of radius $\mu_1$ with center $(1.5,0.5)$. We set $\alpha=0.001$ and the parameter interval to be $\boldsymbol{\mu}\in \mathcal{P}=[0.05,0.45]\times[0.5,2.5]$. This test case is inspired by the literature \cite{negri2013reduced, karcher2018certified} that involve the application of local hyperthermia treatment of cancer. In such case, it is expected to achieve a certain temperature field in the tumor area and another temperature field in the non-lesion area through the heat source control. The circle cut out from the rectangular area represents a certain body organ, and by using AONN we aim to obtain all-at-once solutions of the optimal heat source control for different expected temperature fields and different organ shapes. In particular, we consider a two-dimensional model problem corresponding to the hyperthermia cancer treatment. One difficulty of this problem is the geometrical parameter $\mu_1$ that leads to various computational domains, which causes difficulties in applying traditional mesh-based numerical methods. In the AONN framework, we can solve this problem by sampling in the spatio-parametric space: \begin{linenomath*} \postdisplaypenalty=0 \begin{align*} \Omega_{\mathcal{P}}=\{(x_0,x_1,\mu_1,\mu_2) |& 0\leq x_0\leq2,\, 0\leq x_1\leq1,\, 0.05\leq \mu_1\leq0.45,\, 0.5\leq \mu_2\leq2.5,\, (x_0-1.5)^2+(x_1-0.5)^2\geq \mu_1^2\}. \end{align*} \end{linenomath*} The computational domain $\Omega(\boldsymbol{\mu})$ as well as the $40000$ training points are given in Figure~\ref{fig:test3-data1} and Figure~\ref{fig:test3-data2}. The state neural network $\hat{y}$ is constructed by $ \hat{y}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{y_I}\right)=\ell(\mathbf{x}, \boldsymbol{\mu}) \hat{y}_{I}\left(\mathbf{x}(\boldsymbol{\mu}) ; \boldsymbol{\theta}_{y_I}\right) + 1$ to naturally satisfy the Dirichlet boundary condition \eqref{eq:test3}, where the length factor function is \begin{linenomath*} \begin{equation*} \ell(\mathbf{x}, \boldsymbol{\mu}) = x_0(2 - x_0)x_1(1 - x_1)(\mu_1^2 - (x_0 - 1.5)^2 - (x_1 - 0.5)^2). \end{equation*} \end{linenomath*} The three neural networks $\hat{y}_{I}\left(\mathbf{x}(\boldsymbol{\mu}); \boldsymbol{\theta}_{y_I}\right), \hat{p}_{I}\left(\mathbf{x}(\boldsymbol{\mu}); \boldsymbol{\theta}_{p_I}\right)$ and $\hat{u}\left(\mathbf{x}(\boldsymbol{\mu}); \boldsymbol{\theta}_{u}\right)$ are comprised of three ResNet blocks, each of which contains two fully connected layers with $25$ units and a residual connection. The input dimension of these three neural networks is $4$ and the total number of parameters of these three neural networks is $3 \times 3401 = 10203$. We take $\gamma=0.985$ and the number of epochs for training the state function and the adjoint function increases from $200$ to $700$ during training. The configurations of the neural networks for the PINN and PINN+Projection methods are the same as those of AONN, and the number of training epoch is $50000$. For this test problem, the AONN algorithm converges in $300$ steps. Note that our AONN method can obtain all-at-once solution for any parameter $\boldsymbol{\mu}$. To evaluate the performance of AONN, we employ the classical finite element method to solve the $\mathrm{OCP}(\boldsymbol{\mu})$ with a fixed parameter. More specifically, a limited-memory BFGS algorithm implemented with bounded support is adopted in the dolfin-adjoint \cite{mitusch2019dolfin} to solve the corresponding $\mathrm{OCP}$. The solution obtained using the dolfin-adjoint can be regarded as the ground truth. Among the four methods, AONN, PINN and PINN+Projection are able to solve parametric optimal control problems, while the dolfin-adjoint solver can only solve the optimal control problem with a fixed parameter. Figure~\ref{fig:test3-2} shows the optimal control solution obtained using AONN for the parametric optimal control problem \eqref{eq:test3}. We choose several different parameters $\boldsymbol{\mu}$ for visualization. The left column of Figure~\ref{fig:test3-2} corresponds to $\mu_2=1$, in which case the optimal control is exactly zero because the desired state is achievable for $y=y_d \equiv 1$. The middle and right column of Figure~\ref{fig:test3-2} indicate that the decrease of $\mu_1$ and increase of $\mu_2$ could increase the magnitude of $u$. The results obtained by the dolfin-adjoint solver, AONN, PINN and PINN+Projection with different values of $c$ are displayed in Figure~\ref{fig:test3-3}, where the control functions at $\boldsymbol{\mu}=(0.3, 2.5)$ are compared. The mesh with $138604$ triangular elements are used in the dolfin-adjoint solver, and after $16$ steps, the final projected gradient norm achieves $2.379 \times 10^{-10}$. Figure~\ref{fig:test3-3} shows that AONN can converge to the reference solution obtained by the dolfin-adjoint solver but PINN cannot obtain an accurate solution, while the results of PINN+Projection depends heavily on the choice of $c$ in \eqref{projectedKKT}. When $c$ is not equal to $1 / \alpha=1000$, the PINN+Projection method is not guaranteed to converge to the reference solution. This also confirms that the variational loss \eqref{eq_rescontrol} brings great difficulties to neural network training of the KKT system \eqref{projectedKKT}, unless $c=1 / \alpha$, in which case the control function $u$ is canceled out inside the projection operator. \begin{linenomath*} \begin{equation*} \mathbf{P}_{U_{ad}(\boldsymbol{\mu})}\left(u(\boldsymbol{\mu})-c \mathrm{d}_{u}J(y(\boldsymbol{\mu}),u(\boldsymbol{\mu});\boldsymbol{\mu})\right) = \mathbf{P}_{U_{ad}(\boldsymbol{\mu})}\left(u(\boldsymbol{\mu})-c(\alpha u(\boldsymbol{\mu})+p(\boldsymbol{\mu}))\right) = \mathbf{P}_{U_{ad}(\boldsymbol{\mu})}\left(-\frac{1}{\alpha}p(\boldsymbol{\mu})\right) . \end{equation*} \end{linenomath*} However, for the next non-smooth test problem, $u$ cannot be separated from the variational loss for any $c$, which results in failure for the PINN+Projection method. To demonstrate that AONN can get all-at-once solutions, we first take a $100 \times 100$ grid of $\mathcal{P}$ and choose several different realizations of $\boldsymbol{\mu}$ to solve their corresponding OCP using the dolfin-adjoint solver. Then the parameters on the grid together with spatial coordinates are run through the trained neural networks obtained by Algorithm \ref{alg_AONN} to get the optimal solutions of OCP($\boldsymbol{\mu}$) all at once. It is worth noting that using the dolfin-adjoint solver to compute the optimal solutions for all parameters on the $100 \times 100$ grid is computationally expensive since $10000$ simulations are required. So we only take $16$ representative points on the grid for the dolfin-adjoint solver (It still takes several hours). Nevertheless, all-at-once solutions can be computed effectively and efficiently through our AONN framework. Figure~\ref{fig:test3-3d} displays three quantities with respect to $\mu_1, \mu_2$, where Figure~\ref{fig:test3-3d-1} shows the objective functional $J$, Figure~\ref{fig:test3-3d-2} is the accessibility of the desired state and Figure~\ref{fig:test3-3d-3} displays the $L_2$-norm of the optimal control $u$. The red dots in Figure~\ref{fig:test3-3d} show the results obtained by the dolfin-adjoint solver, where $16$ simulations of $\mathrm{OCP}$ with $(\mu_1, \mu_2)\in \{0.05, 0.1833, 0.3167, 0.45\} \times \{0.5, 1.1667, 1.8333, 2.5 \}$ are performed. From Figure~\ref{fig:test3-3d}, it is clear that AONN can obtain accurate solutions. \begin{figure}[!htbp] \centering \subfigure[] {\includegraphics[height=0.29\textwidth]{pic/fig5.5_test4-1.jpg} \label{fig:test3-data1}} \subfigure[] {\includegraphics[height=0.3\textwidth]{pic/fig5.5_test4-2.png} \label{fig:test3-data2}} \caption{Test 4: (a) The parametric computational domain $\Omega(\boldsymbol{\mu})$. (b) $N = 40000$ training collocation points sampled in $\Omega_{\mathcal{P}}$ (there are no points inside the frustum).} \label{fig:test3-data} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=14cm]{pic/fig5.6_test4.png} \caption{Test 4: the AONN solutions $u(\boldsymbol{\mu})$ with several realizations of $\boldsymbol{\mu}=(\mu_1, \mu_2)$.} \label{fig:test3-2} \end{figure} \begin{figure}[htbp] \centering \includegraphics[width=14cm]{pic/fig5.7_test4.png} \caption{Test 4: the solution obtained by the dolfin-adjoint solver for a fixed parameter $\boldsymbol{\mu}=(0.3, 2.5)$, the approximate solutions of $u$ obtained by AONN, PINN, PINN+Projection (with different $c=100,1000,10000$), and the absolute errors of the AONN solution and the PINN+Projection solution with $c=\frac{1}{\alpha}=1000$.} \label{fig:test3-3} \end{figure} \begin{figure}[!htbp] \centering \subfigure[] {\includegraphics[width=0.31\textwidth]{pic/fig5.8_test4-1.png} \label{fig:test3-3d-1}} \subfigure[] {\includegraphics[width=0.31\textwidth]{pic/fig5.8_test4-2.png} \label{fig:test3-3d-2}} \subfigure[] {\includegraphics[width=0.31\textwidth]{pic/fig5.8_test4-3.png} \label{fig:test3-3d-3}} \caption{Test 4: several quantities as functions with respect to parameter $\boldsymbol{\mu}=(\mu_1, \mu_2)$ obtained by AONN. Each red dot denotes the quantity corresponding to a specific $\boldsymbol{\mu}$ computed from the dolfin-adjoint solver. (a) Objective value: $J$ (b) Attainability of the desired state: $\frac{1}{2}\|y-y_d\|_{L_2}^2$. (c) $L_2$-norm of control function: $\frac{1}{2}\|u\|_{L_2}^2$.} \label{fig:test3-3d} \end{figure} \subsection{Test 5: Optimal control for the semilinear elliptic equations with sparsity parametrization}\label{sec_test5_sparse} In this test problem, we again consider a control problem for the semilinear elliptic equations as that in \eqref{test1}. However, this time we consider a sparse optimal control problem with sparsity parametrization. The sparse solution in optimal control is often achieved by $L_1$-control cost \cite{casas2011approximation,casas2012optimality,casas2017review} and its application to the controller placement problems is well studied \cite{stadler2009elliptic}. Specifically, we consider the following objective functional with $L_1$-control cost: \begin{linenomath*} \begin{equation*} J(y,u) = \frac{1}{2}\left\|y-y_{d}\right\|_{L_{2}}^{2}+\frac{\alpha}{2}\|u\|_{L_{2}}^{2}+\beta\|u\|_{L_{1}}, \end{equation*} \end{linenomath*} where the coefficient $\beta$ of the $L_1$-term controls the sparsity of the control function $u$. With the increase of $\beta$, the optimal control gradually becomes sparse and eventually reaches zero. In order to make continuous observation of this phenomenon, we need to solve the following parametric optimal control problem by setting $\beta$ as a variable parameter $\boldsymbol{\mu}$, \begin{linenomath*}\begin{equation} \left\{\begin{aligned} &\min_{y(\boldsymbol{\mu}),u(\boldsymbol{\mu})} J(y(\boldsymbol{\mu}), u(\boldsymbol{\mu}); \boldsymbol{\mu}):=\frac{1}{2}\left\|y(\boldsymbol{\mu})-y_{d}\right\|_{L_{2}(\Omega)}^{2}+\frac{\alpha}{2}\|u(\boldsymbol{\mu})\|_{L_{2}(\Omega)}^{2}+\boldsymbol{\mu}\|u(\boldsymbol{\mu})\|_{L_{1}(\Omega)},\\ &\text { subject to } \left\{\begin{aligned} -\Delta y(\boldsymbol{\mu}) + y(\boldsymbol{\mu})^3&=u(\boldsymbol{\mu})&&\text{ in } \Omega, \\ y(\boldsymbol{\mu}) &=0 &&\text { on } \partial \Omega, \end{aligned}\right.\\ &\text{and} \quad u_a \leq u(\boldsymbol{\mu}) \leq u_b \quad \text { a.e. in } \Omega.\\ \end{aligned}\right. \end{equation}\end{linenomath*} We fixed the other parameters \begin{linenomath*} \begin{equation*} \begin{aligned} &\Omega=B(0,1),\\ &\alpha=0.002, u_a=-12, u_b=12,\\ &y_d = 4\sin \left(2\pi x_{1}\right) \sin \left(\pi x_{2}\right)\exp(x_1),\\ \end{aligned} \end{equation*} \end{linenomath*} and the range of parameter is set to $\boldsymbol{\mu} \in [0, \boldsymbol{\mu}_{max}]$. The upper bound $\boldsymbol{\mu}_{max} = 0.128$ ensures that for any $\boldsymbol{\mu} \geq \boldsymbol{\mu}_{max}$ the optimal control $u^*(\boldsymbol{\mu})$ is identically zero. We compute the generalized derivative \begin{linenomath*}\begin{equation}\label{subgradient} \mathrm{d}_{u}J(y(\boldsymbol{\mu}), u(\boldsymbol{\mu}); \boldsymbol{\mu}) = \alpha u(\boldsymbol{\mu}) + p(\boldsymbol{\mu}) + \boldsymbol{\mu} \ \mathrm{sign}(u(\boldsymbol{\mu})). \end{equation}\end{linenomath*} where $p$ is the solution of the adjoint equation as defined in \eqref{test1-adjoint}, and $\mathrm{sign}$ is an element-wise operator that extracts the sign of a function. Since the optimal control function varies for different $\boldsymbol{\mu}$, solving a series of sparse optimal control problems is straightforward in general. For example, Eduardo Cases \cite{casas2017review} calculated the optimal solutions for $\boldsymbol{\mu} = 2^i \times 10^{-3}, i=0,1,\ldots,8$. Here, we use AONN to compute all the optimal solutions for any $\boldsymbol{\mu} \in [0,0.128]$ all at once. The length factor function for the Dirichlet boundary condition is chosen as $\ell(\mathbf{x}) = 1 - x_0^2 - x_1^2$. The neural networks $\hat{y}_{I}\left(\mathbf{x}(\boldsymbol{\mu}); \boldsymbol{\theta}_{y_I}\right), \hat{p}_{I}\left(\mathbf{x}(\boldsymbol{\mu}); \boldsymbol{\theta}_{p_I}\right)$ and $\hat{u}\left(\mathbf{x}(\boldsymbol{\mu}); \boldsymbol{\theta}_{u}\right)$ are trained by AONN, which have the same configurations to those in the previous test, except for the input dimension being $3$, resulting in $3 \times 3376=10128$ undecided parameters. To this end, we sample $N=20000$ points in the spatio-parametric space $\Omega_{\mathcal{P}} = B(0,1)\times[0,\boldsymbol{\mu}_{max}]$ by a uniform distribution. In order to capture the information at the boundary of $\boldsymbol{\mu}$, $2000$ of these $20000$ points are sampled in $B(0,1)\times\{0\}$ and $B(0,1)\times\{\boldsymbol{\mu}_{max}\}$. We take $500$ iteration steps and gradually increase the training epochs with $n_{\mathrm{aug}}=100$ after every $100$ iteration. As a result, training epochs for the state function and the adjoint function increase from $200$ to $600$ during training. The step size $c^k$ starts with $c^0 = 10$ and decreases by a factor $\gamma = 0.985$ after every iteration. The optimal control for some representative $\boldsymbol{\mu}\in[0,\boldsymbol{\mu}_{max}]$ computed by AONN are displayed in Figure~\ref{fig:test2-1}. The AONN results are consistent with the results presented in ref.\cite{casas2017review}, where the sparsity of optimal control increases as $\boldsymbol{\mu}$ increases. As shown in Figure~\ref{fig:test2-1}, the initial optimal control for $\boldsymbol{\mu}=0$ has eight peaks and each peak disappears as $\boldsymbol{\mu}$ increases. To determine where it is most efficient to put the control device, one might require some manual tuning of $\boldsymbol{\mu}$ and thus need to solve $\mathrm{OCP}$ many times for different $\boldsymbol{\mu}$. Determining these optimal locations is easy if we have obtained the parametric solutions $u^*(x,y,\boldsymbol{\mu})$, which is exactly what AONN does. The coordinates of the eight peaks are obtained by evaluating the last vanishing positions of $u^*(x,y,\boldsymbol{\mu})$ as $\boldsymbol{\mu}$ increases at a uniform $100^3$ grid on $[-1,1]\times[-1,1]\times[0,\boldsymbol{\mu}_{max}]$. Figure~\ref{fig:test2-2} shows the variation of control values at the eight peaks as a function with respect to $\boldsymbol{\mu}$. We observe that the control function values at points $P_1,P_2,P_3$ start with $12$, and begin to decrease after $\boldsymbol{\mu}$ reaches a certain value, finally drop to zero. Value at $P_4$ starts to decrease from a number less than $12$ until it reaches zero. The behavior of points $P_5 \sim P_8$ is completely symmetric. \begin{figure}[htbp] \centering \includegraphics[height=10cm]{pic/fig5.9_test5.png} \caption{Test 5: the AONN solutions $u(\boldsymbol{\mu})$ of representative values for $\boldsymbol{\mu} = 2^i \times 10^{-3}, i=0,1,\ldots,8$.} \label{fig:test2-1} \end{figure} \begin{figure}[htbp] \centering \includegraphics[height=6cm]{pic/fig5.10_test5.png} \caption{Test 5: the AONN solution $u(\boldsymbol{\mu})$ of eight fixed peaks $P_1\sim P_8$ as a function respect to $\boldsymbol{\mu}$. The legend on the right is the coordinates of the eight points.} \label{fig:test2-2} \end{figure} To conclude, with these five numerical tests, we examine the efficiency of AONN and compare its performance with PINN, PINN+Projection, and the traditional solver. The numerical results indicate that the proposed AONN method is more advantageous than the PINN+Projection method and the PINN method in solving parametric optimal control problems. The PINN method cannot obtain accurate solutions for complex constrained problems, and the PINN+projection method improves the accuracy of the PINN method in general but has limitations on nonsmooth problems such as the sparse optimal control problems, while the AONN method is a general framework performing better on different types of parametric optimal control problems.
\section{Design} In this section, we discuss the root causes of the QoS mismatch, list the key challenges in designing a solution like 5GLoR, and describe the key components of 5GLoR. \input{designgoals} \input{challenges} \subsection{Key tasks and components in 5GLoR}\label{subsec:algorithm} \begin{algorithm}[t] \caption{Path discovery from sensor on RAN to application on LAN} \label{algo:algo1new} \begin{algorithmic}[1] \STATE \textbf{Input:}\\ $IP_r$: IP address of sensor in RAN, $IP_l$: IP address of application in LAN,$R_{init}= $ router connecting RAN to LAN \STATE \textbf{Output:}\\ \begin{math} P =\{(R_{init},p_{in},p_{out}),...,(R_{end},p_{in},p_{out})\} \end{math} \STATE $R_i$=$R_{init}$ \WHILE{true} \IF{$IP_l$ is in same subnet as $IP_r$}\label{algo:arp} \STATE Get egress port $p_{out}$ on $R_i$ to reach $IP_l$; \STATE Append $\{R_i,,p_{out}\}$ to path $P$; \STATE {\bf break} \label{algo:endforwardpath} \ENDIF \IF{$IP_l$ is in same subnet as $R_i$} \STATE Get egress port $p_{out}$ on $R_i$ to reach $IP_l$; \STATE Append $\{R_i,,p_{out}\}$ to path $P$; \STATE {\bf break} \label{algo:endforwardpath} \ENDIF \STATE Determine next-hop from IP table of $R_i$; \STATE Get egress port $p_{out}$ on $R_i$ to reach next-hop; \STATE Append $\{R_i,,p_{out}\}$ to path $P$; \STATE Assign $R_i$ = next-hop ; \ENDWHILE \end{algorithmic} \end{algorithm} \subsubsection{\textbf{Path Discovery}} Path Manager finds the sequence of network switches (ingress and egress ports on each switch) from a sensor on RAN to the application on the VLAN. Utilities like traceroute \cite{b2} only focuses on routers on the path, but we also need details about the layer 2 switches along the path. Furthermore, utilities like traceroute do not provide (ingress and egress) port-level details. Therefore, we designed an algorithm that consults the MAC, ARP and IP tables on a layer 3 switch, and the MAC table in a layer 2 switch to determine the path with port-level details. If all the switches are managed by an SDN controller, we can also get the path by querying the controller \cite{openflow}. In this paper, we assume that all switches are IP-accessible either directly or through an SDN controller, and the IP address of the first network element (layer 3 or layer 2 switch) that connects the RAN to the LAN is known. Path Manager implements the algorithm shown in Figure~\ref{fig:sys} to determine the layer 3 switches (and ingress or egress ports) on the path. Since a layer 3 switch is also a layer 2 switch, we can consult the MAC, ARP and IP tables to determine the ingress and egress ports on each switch. We begin with the network element that connects the RAN to the LAN ($R_{init}$). If the destination (i.e. the application on the VLAN) is on the same subnet as the source (i.e. the sensor on the RAN), then ARP (or ARP cache) provides the MAC address of the destination, and the MAC table has the egress port, and the forward pass of the path discovery process is terminated. Otherwise, we check if $R_{init}$ is on the same subnet as the destination. If yes, then we use ARP and the MAC table to determine the egress port on $R_{init}$ to reach the destination, and the forward pass terminates. Otherwise, we lookup the IP table for the next hop, determine the MAC address of the next hop, and find the egress port on $R_{init}$ to reach the next hop. This information is added to the path, and we repeat the above process for the next hop $R_i$. The forward pass shown in Figure~\ref{fig:sys} determines the layer 3 switches on the path, as well as the egress ports on all these switches. To determine the ingress ports on these switches, we use a similar algorithm as in Figure~\ref{fig:sys}, but this time we process the switches (in the path) in a reverse order (i.e. from the application on LAN to the sensor on the RAN). The algorithm shown in Figure~\ref{fig:sys} does not identify the layer 2 switches on the path. Therefore, our implementation uses a variant of traceroute~\cite{layer2-traceroute} that can be used to find all the layer 2 switches between any two routers on the path. Since we assume that all switches are accessible using their IP address, we can consult their MAC tables to determine the ingress and egress ports. Alternatively, the network path can also be specified manually and 5GLoR can determine the ingress and egress ports automatically along the given path. \subsubsection{\textbf{Feasibility Check}}: We carefully examine each switch on the path to check if it can accomodate a given RAN flow. Our objective is to determine the egress queue that can support the flow, and the DSCP identifier that should be used to traverse this switch. To check feasibility at a particular switch, we have to estimate the LAN flows in each of the egress queues. By querying the switch, we can determine the configured, maximum capacity of each egress queue. If we also know the LAN flow into the egress queue, then it is easy to check if the given RAN flow can be supported (without dropping any packets) by this egress queue. We periodically estimate the LAN flow into each egress queue by using sFlow~\cite{b5}. It is a multi-vendor, packet sampling technology that samples 1 in N packets passing through the interface, irrespective of the flow. 5GLoR uses the ToS (type of service) field from the sFlow summary to estimate the number of ToS-based flows. ToS has the DSCP marking that allows us to infer the queue for the packet. We checks the status of every switch in the path. At each switch, we examine all the queues for the egress port. If there is a queue with adequate capacity to carry the RAN flow, then the procedure chooses a DSCP identifier that will map the RAN flow into the queue. Information about the LAN flows in this queue are pre-computed by using sFlow. By querying the switch, we also know the pre-set capacity limit for the queue. Since we know the desired RAN flow, the difference between pre-set capacity and the existing LAN flow is sufficient to determine whether the queue can support the new RAN flow. It is possible that we may not find a suitable DSCP identifier for a switch in the path. Then, this switch may break the QoS of the RAN flow. The feasibility check procedure is implemented in the feasibility manager shown in Figure~\ref{fig:sys}. \begin{figure}[t] \centering \begin{subfigure}{0.45\columnwidth} \centering \includegraphics[width=\columnwidth,height=0.9 in]{Figures/tcplanflows-qos.pdf} \vspace{-0.2 in} \caption{Throughput}\label{fig:exp-tput-lanqos} \end{subfigure} \begin{subfigure}{0.45\columnwidth} \centering \includegraphics[width=\columnwidth,height=0.9 in]{Figures/udplanflows-qos.pdf} \vspace{-0.2 in} \caption{Loss}\label{fig:exp-loss-lanqos} \end{subfigure} \caption{LAN Flows with 5GLoR with right DSCP} \label{fig:exp-lanflows} \vspace{-0.1 in} \end{figure} \begin{figure}[t] \centering \begin{subfigure}{0.45\columnwidth} \centering \includegraphics[width=\columnwidth,height=0.9 in]{Figures/tcplanflows.pdf} \vspace{-0.2 in} \caption{Throughput}\label{fig:exp-tput-lan} \end{subfigure} \begin{subfigure}{0.45\columnwidth} \centering \includegraphics[width=\columnwidth,height=0.9 in]{Figures/udplanflows.pdf} \vspace{-0.2 in} \caption{Loss}\label{fig:exp-loss-lan} \end{subfigure} \caption{LAN Flows with 5GLoR with default Queue DSCP} \label{fig:exp-lanflows-defaultqos} \vspace{-0.1 in} \end{figure} \begin{figure*}[t] \begin{subfigure}{0.4\columnwidth} \centering \vspace{-0.08 in} \includegraphics[width=1\columnwidth,height=0.8 in]{Figures/e2eif.pdf} \vspace{-0.2 in} \caption{ E2E\& InterFrame }\label{fig:exp-e2eif} \end{subfigure} \begin{subfigure}{0.4\columnwidth} \centering \vspace{-0.08 in} \includegraphics[width=1\columnwidth,height=0.8 in]{Figures/jittertarget.pdf} \vspace{-0.2 in} \caption{Jitter \& Delay}\label{fig:exp-jitter} \end{subfigure} \begin{subfigure}{0.4\columnwidth} \centering \vspace{-0.08 in} \includegraphics[width=1\columnwidth,height=0.8 in]{Figures/mediarate.pdf} \vspace{-0.2 in} \caption{Media Rate}\label{fig:exp-mediarate} \end{subfigure} \begin{subfigure}{0.4\columnwidth} \centering \vspace{-0.08 in} \includegraphics[width=1\columnwidth,height=0.8 in]{Figures/fd-time.pdf} \vspace{-0.2 in} \caption{Detection Time }\label{fig:exp-fdtime} \end{subfigure} \begin{subfigure}{0.4\columnwidth} \centering \vspace{-0.08in} \includegraphics[width=1\columnwidth,height=0.8 in]{Figures/fd-accuracy.pdf} \vspace{-0.2 in} \caption{Detection Accuracy }\label{fig:exp-fdaccuracy} \end{subfigure} \caption{Comparison of 5G LAN, 5GLoR and 5G+MEC} \vspace{-0.2 in} \label{fig:exp-comp} \end{figure*} \subsubsection{\textbf{DSCP re-write rules}} As explained in section \ref{sec:goal1}, it is possible that the Feasibility Check procedure may recommend a different queue number across different switches on the path. Therefore, the DSCP marking necessary to safely traverse a switch can be different across switches. To address this DSCP identifier mismatch across switches, 5GLoR installs rewrites rules \cite{b3} on appropriate switches so that the RAN flow is directed to the appropriate egress queue in each switch of the path. The DSCP identifier to be used for the first network element in the path is communicated to the application, and all packets from the application have this DSCP marking. The Queue manager in Figure~\ref{fig:sys} installs the re-write rules on switches. \subsubsection{\textbf{Ingress and egress policies}} As explained in section \ref{sec:goal1}, inbound flows on different ingress ports can interfere. To avoid this problem, we use the ingress reservation for ingress ports of all the switches in the path: we use the two-rate three-color technique. Two rate defines the min and maximum rate, and three colors, red, green, and yellow, decides the packet drop \cite{b4}. We define the $min_{rate}=min(\{gbr1,gbr2,...,gbr_f\})$ and $max_{rate}=max(\{gbr1,gbr2,...,gbr_f\})$. We also ensure that the queue draining policy is Round-Robin at egress ports of all the switches in the path. \section{Evaluation}\label{sec:eval} In this section, first, we explain the end-to-end test bed and then show the detailed evaluation of the 5GLoR. \subsection{Our 5G LAN} Key components of our 5G LAN are shown in Figure~\ref{fig:testbed-block}. The 5G cellular network components (RAN and core) are from a commercial vendor \cite{celona}. Our UEs (user equipment) are from also from another commercial vendor \cite{multitech}. We have five five laptops (with Ubuntu 20 OS), and each laptop uses a distinct UE to stream stored videos over the 5G cellular network. We can also connect an IP camera to each laptop to live stream video over the 5G network. For our experiments, we use a public benchmark -- video of the publicly available airport security recording~\cite{pond5}. As shown in Figure~\ref{fig:testbed-block}, we also have one layer 3 ex2300 Juniper switch, two NEC switches (a layer 3 switch qx5800, and a layer 2 switch qx5200), and an SDN controller. All the switches are accessed and controlled using APIs from Mist UI for Juniper and NOE UI (SDN controller) for NEC. Our MEC layer of compute is a laptop that is connected to the 5G core via a layer 2 switch. For our 5G LAN, the Juniper switch is the internet gateway. We also introduce additional LAN flows using servers that are directly connected to the Juniper and NEC switches. We also have two virtual LANs (VLANs) that host our applications. \subsection{Experimental Results} \subsubsection{Impact of 5G LoR on LAN flows}\label{sec:lanflows} In the motivation section (\ref{sec:motivation}), we showed that 5GLoR ensured that the QoS of the RAN flows in both the second window (30-60 sec) and the third window (60-90 secs) are preserved, in spite of the additional DSCP marked and unmarked LAN flows. We now analyze the impact of 5GLoR and the RAN flows on the LAN flows. The DSCP marked LAN flows map to egress queue 6 in switch S1. This queue has a pre-set capacity of 100 Mbps. However, the total incoming DSCP marked LAN flows is 1125 Mbps (75 x 15 Mbps). Therefore, we observe only 100 Mbps of output at the egress port. This is shown in Figure~\ref{fig:exp-tput-lanqos} as the green waveform. The DSCP marked LAN flows also experience high packet loss (green waveform in Figure~\ref{fig:exp-loss-lanqos}). Since the RAN flows are using egress queue 8 (with a pre-set queue capacity of 350 Mbps, we observe that 5GLoR has no impact on the DSCP marked LAN flows. However, 5GLoR has a significant impact on the best-effort flows. Without 5GLoR, the 75 marked flows (with aggregate flow of 1500 Mbps) are put in the best-effort egress queue. Since most of the higher numbered queues (except queue 6 which has 100 Mbps of the marked LAN flows) are empty, the unmarked LAN flows egress the switch at almost 800 Mbps (red waveform in Figure~\ref{fig:exp-tput-lan}; egress port has a bandwidth of 1000 Mbps)! The packet loss for the unmarked LAN flows is small (red waveform in Figure~\ref{fig:exp-loss-lan}). However, when 5GLoR introduces a total of 40 Mbps RAN traffic into queue 8 (five RAN flows: 6+6+6+11+11 Mbps), the throughput of the 75 marked LAN flows (best-effort flows) drops because of the higher-priority RAN flows. Consequently, the loss for the marked LAN flows is higher, as shown by the green waveform in Figure~\ref{fig:exp-loss-lan}. \subsubsection{Impact of 5GLoR on enterprise IoT applications} We consider three applications (face detection, face recognition, and WebRTC) to analyze the impact of 5GLoR. For each application, we create five RAN flows (flow 1 thru flow 5), and encapsulate each flow in a separate network slice. We consider three scenarios: a 5G LAN, the 5G LAN augmented with the proposed technique 5GLoR, and 5G+MEC. For 5G LAN experiments, all our applications are hosted on the enterprise VLANs. For the 5G+MEC experiments, all our five applications are hosted on the MEC (i.e. computing resources at the edge of the 5G network; therefore, no traffic from the RAN enters the enterprise LAN). Figure~\ref{fig:exp-comp} shows results for all three scenarios. {\bf Frame and packet delays:} Figure~\ref{fig:exp-e2eif} shows the impact of 5GLoR on WebRTC~\cite{WebRTC} flows. WebRTC is a web real-time communication framework for browsers, and many popular applications like Facebook messenger, WhatsApp, and Snapchat use this communication framework. The average end to end (E2E) delay for a frame, as well as the average inter-frame delay for the WebRTC flows are decreased by 212\% and 122\%, respectively, by using 5GLoR. Compared to the 5G+MEC case, note that the average frame delay and inter-frame delay are reduced by 30\% and 70\% respectively (see Figure~\ref {fig:exp-e2eif}). The reason for better performance compared to MEC is the usage of DSCP in WebRTC\cite{WebRTC}. We also analyzed the per-packet jitter and delay for the WebRTC streams.With 5GLoR, per-packet jitters and delays are reduced by 80\% and 67 \% (see Figure~\ref{fig:exp-jitter}) when compared to 5G LAN without 5GLoR. Furthermore, these delays are comparable to the delays observed for the 5G+MEC scenario. As shown in Figure~\ref{fig:exp-mediarate}, the media rate with 5GLoR is 2.5 Mbps, which is 3.6 times better than the 5G LAN scenario. The mediarate for the 5G+MEC scenario was 1.5Mpbs, which is much lower than the mediarate for the 5GLoR case. {\bf Accuracy:} Figures~\ref{fig:exp-fdtime} and~\ref{fig:exp-fdaccuracy} show the impact of 5GLoR on a face detection application, which detects human faces in a video frame by using machine learning techniques. As shown in Figure~\ref{fig:exp-fdtime}, the average time to detect a face improves by 25\% when 5GLoR is used, and this time is comparable to the average detection time for the 5G+MEC scenario. We also measured the accuracy of face detection for the three scenarios. As shown in Figure~\ref{fig:exp-fdaccuracy}, we observe much higher accuracy (33\% higher) when 5GLoR is used in the 5G LAN. Also, accuracy of face detection for the 5G LAN with 5GLoR scenario is comparable to the 5G+MEC scenario. \section{Introduction} \footnote[1]{ \textbf{Published in IEEE Future Networks World Forum-2022}} WiFi technologies have long dominated wireless connectivity in the enterprise, but that is poised to change. 5G-LAN is an enterprise local area network (LAN) that leverages 5G technology for wireless connectivity instead of WiFi. A 5G-LAN enables enterprises to benefit from the much wider coverage and higher performance, reliability, and security of 5G cellular technology (compared to WiFi). A 5G-LAN is specifically deployed to meet the high-performance needs of various enterprises by combining traditional enterprise LANs with the power and performance of 5G cellular. 5G-LAN enables new IoT applications in enterprises like factories, warehouses, airports, hospitals, and arenas. One such example is shown in Figure~\ref{fig:intro-airport}, where numerous surveillance video cameras in an airport use a private 5G cellular network (we will refer to it as RAN) to stream high-definition videos to analytics applications like video surveillance, which are hosted on the enterprise LAN of the airport. The increasing use of private RAN is fueled by the rapid increase in the use of IoT devices in enterprises. According to Ericson, 5 billion IoT devices will be connected over the RAN \cite{erricson} by 2025, and the global 5G IoT market is expected to be worth US \$40 billion by 2026 \cite{5g-market}. AWS already offers private 5G in several regions, including the United States East (Ohio), the United States East (North Virginia), and the United States West (Oregon)\cite{aws5g}. \begin{figure}[t] \centerline{\includegraphics[width=1\linewidth]{Figures/airport_paper.png}} \caption{Airport security system using a 5G-LAN} \vspace{-0.25 in} \label{fig:intro-airport} \end{figure} \begin{figure*}[t] \centering \begin{subfigure}{0.65\columnwidth} \centering \includegraphics[width=\columnwidth,height=1.3 in]{Figures/Motivations_tcp.pdf} \vspace{-0.25 in} \caption{Throughput}\label{fig:motivation-tcp} \end{subfigure} \begin{subfigure}{0.65\columnwidth} \centering \includegraphics[width=\columnwidth,height=1.3 in]{Figures/Motivations_loss_jitter.pdf} \vspace{-0.25 in} \caption{Loss}\label{fig:motivation-udp} \end{subfigure} \begin{subfigure}{0.65\columnwidth} \centering \includegraphics[width=\columnwidth,height=1.3 in]{Figures/webstats.pdf} \vspace{-0.25 in} \caption{Frame Level E2E delay}\label{fig:motivation-webrtc} \end{subfigure} \vspace{-0.1 in} \caption{QoS Analysis of the RAN slice in LAN} \label{fig:motivation} \vspace{-0.2 in} \end{figure*} Cellular operators have provided different quality of service (QoS) for specific traffic classes like video, voice, or data for many years by using technologies like DiffServ in the transport and core network. However, unlike any prior cellular technology, 5G's network slicing technology also supports QoS in the radio frequency (RF) domain. Unlike DiffServ, 5G slicing can provide differential traffic treatment from different customers in the same traffic class, like voice or video, by using new QoS technologies in the RF domain. Consequently, 5G slicing can isolate traffic from different customers in the same traffic class and provide differentiated services to each customer. For example, consider the airport deployment shown in Figure~\ref{fig:intro-airport}. Surveillance video cameras in the airport deliver video streams to video surveillance applications hosted on the enterprise LAN. Similarly, drones monitoring the outdoor areas of the airport deliver video streams to crowd detection applications that are hosted on the enterprise LAN. Crowd detection applications monitor people or vehicles in outdoor areas of the airport. As shown in Figure~\ref{fig:intro-airport}, surveillance and drone video streams traverse the RAN in two separate slices (slice \#1 and slice \#2). Although the two data streams belong to the same traffic class (video), applying different QoS policies (like priority or security) to the two data streams is possible. This unprecedented ability of 5G slicing to differentially treat customers in the same traffic class is not supported by most enterprise LANs. LAN is primarily based on DiffServ-like technologies that provide varying QoS for different traffic classes rather than different customers. Therefore, 5G slice customer-specified QoS for data streams (within the same traffic class) ends within the 5G network. Once the streams exit the 5G network, the enterprise LAN cannot ensure customer-specified QoS. We show in later sections that this mismatch in QoS between the cellular and wired networks can adversely affect the accuracy of insights from the analytics applications on the enterprise LAN. In this paper, we systematically analyze the impact of the mismatch in QoS capabilities between the private RAN and the enterprise LAN. The critical analytics applications on the enterprise LANs are deployed on real-world private 5G deployment. We propose a new application-specific method {\it 5GLoR} (5G-LAN Orchestrator) that aims to preserve the QoS of 5G data streams as they traverse the enterprise LAN. 5GLoR is a real-time, application-specific orchestrator middleware that an application can use to manage its 5G data streams on enterprise LANs. For each 5G data stream in a slice, 5GLoR is aware of the customer-specified QoS requirement (in a 5G slice). 5GLoR first determines appropriate queues via enterprise switches that can maintain the QoS requirement for the 5G data stream. Then, 5GLoR identifies an appropriate DSCP identifier for the 5G data stream based on available queues. The application assigns this identifier to all IP packets in the data stream. As the DSCP-tagged data stream traverses the switches in the LAN, it may be necessary to change the DSCP identifier between switches. 5GLoR installs switch re-write rules to re-write the DSCP identifier, as necessary. \begin{figure*}[t] \centering \begin{subfigure}{0.65\columnwidth} \centering \includegraphics[width=\columnwidth,height=1.3 in]{Figures/Motivations_tcpsol.pdf} \vspace{-0.25 in} \caption{Throughput}\label{fig:motivation-tcp-sol} \end{subfigure} \begin{subfigure}{0.65\columnwidth} \centering \includegraphics[width=\columnwidth,height=1.3 in]{Figures/Motivations_udpsol.pdf} \vspace{-0.25 in} \caption{Loss}\label{fig:motivation-udp-sol} \end{subfigure} \begin{subfigure}{0.65\columnwidth} \centering \includegraphics[width=\columnwidth,height=1.3 in]{Figures/webrtcstats_sol.pdf} \vspace{-0.25 in} \caption{Frame Level E2E delay}\label{fig:motivation-webrtc-sol} \end{subfigure} \vspace{-0.05 in} \caption{QoS Analysis for the RAN slice to LAN with proposed solution} \label{fig:motivation-sol} \vspace{-0.2 in} \end{figure*} Additionally, it ensures that the RAN flows do not suffer from local LAN flows with higher priority. Once a DSCP identifier is assigned to a 5G data stream and the switch re-write rules are used, the 5G data stream traverses the LAN with the customer-specified QoS. Our unique approach does not affect the existing non-5G traffic using the enterprise LAN because 5GLoR uses admission control to allow 5G data streams into the enterprise LAN. If 5GLoR cannot find a suitable path to preserve QoS, then 5GLoR allows the 5G data stream to traverse the LAN using a best-effort policy. Compared to a 5G-LAN without our proposed orchestration, 5GLoR improves the RTP frame level delay and inter-frame delay by 212\% and 122\%, respectively for WebRTC \cite{WebRTC}. The accuracy of two example applications (face detection and recognition) improved by 33\% and the average time by 25\% when using 5GLoR. We also compared the 5G-LAN with 5GLoR to an edge-computing architecture where all analytics applications are run at the edge of the 5G network (i.e., on the multi-access edge computing or MEC) rather than being hosted on the enterprise LAN. Our experiments show that the performance (accuracy and latency) of applications on a 5G-LAN with the proposed 5GLoR compares well with the performance of the same applications on MEC. This is significant because 5G-LAN offers an order of magnitude more computing, networking, and storage resources to the applications than the resource-constrained MEC, and mature enterprise technologies can be used to deploy, manage, and update IoT applications on enterprise LANs. In summary, we make the following contributions: \begin{itemize} \item We designed a real-world 5G-LAN composed of a CBRS-based RAN and an enterprise LAN; several real-world video analytics applications like face recognition were hosted on the enterprise LAN, with several video cameras on the RAN. \item We conducted extensive experiments to show the mismatch in QoS capabilities between the slicing-based RAN and the enterprise LAN. \item We systematically analyzed the root causes of the QoS mismatch in the enterprise LAN and proposed a novel, application-specific 5G-LAN orchestrator (5GLoR) that preserves the QoS of a 5G data stream as it traverses the enterprise LAN. \item We demonstrated that the addition of 5GLoR to a 5G-LAN significantly improves the performance of three popular video analytics applications, like Face Detection, Face Recognition, and WebRTC.  \item We also showed that hosting applications on a 5G-LAN with 5GLoR is competitive with the alternative of hosting applications on MEC at the edge of the RAN. \end{itemize}{} The rest of the paper is organized as follows. We discuss the motivation for our work by reporting results for popular video analytics applications on a real-world private RAN and enterprise LAN. Then, we discuss prior work and how it relates to the proposed 5G-LAN orchestrator 5GLoR. After discussing the system overview and major components of 5GLoR, we present the detailed design of 5GLoR, including design challenges and solutions. Finally, we report a detailed evaluation of 5GLoR in a real-world 5G-LAN setting and compare it with an alternative architecture where applications run on MEC in 5G. \section{Motivation}\label{sec:motivation} We demonstrate the impact of the QoS mismatch between the 5G network and the enterprise LAN. We use a real-world 5G-LAN (airport security system described in Section~\ref{sec:eval}), where the application on the enterprise LAN processes videos from five video cameras on the 5G network. These video streams are in five different 5G slices. The five slices have a Guaranteed Bit Rate (GBR) of \{6, 6, 11, 6, 11\} Mbps, and all the flows have a DSCP marking of 39. A slice guarantees QoS (i.e., the RAN reserves the GBR requested). We use DSCP \cite{dscp} identifiers on the LAN to distinguish among traffic classes like video, voice, or data. We show that the QoS guarantee in a slice is not preserved as the 5G data traverses the LAN, adversely impacting the accuracy of insights from the analytics applications hosted on the LAN. The total test duration is 120 seconds, with four windows of 30 seconds each. During the first window, the LAN does not have any traffic other than the five RAN flows. During the second window, 75 LAN flows with a DSCP marking of 39 are introduced into the LAN, and during the third window, an additional 75 LAN flows are introduced but without any DSCP marking. In the fourth window, we remove all the 150 LAN flows. We measure the application's throughput, packet loss, and end-to-end (E2E) delay in receiving the frames from the video cameras. During the first window, as shown in fig \ref{fig:motivation-tcp} and \ref{fig:motivation-udp}, the application sees a throughput of 100\% with 0\% packet loss. However, as the 75 DSCP marked LAN flows are introduced during the second window, the application throughput drops by ~81\%, and the application experiences a packet loss of about ~10\%. During the third window, the additional LAN flows (with no DSCP marking) do result in some degradation of the RAN flows (compared to the case in the first window). During the fourth window, there are no LAN flows, and the RAN flows begin to exhibit the same QoS that was observed in the first window. A similar observation is made for the E2E delay of the video frame. As we see in the fig \ref{fig:motivation-webrtc}, during the first window, the E2E delay is small and increases up to 300 ms, and during the second window, it increases to 750 ms (2.3 times the delay in the first window). In the third window, the delay goes up further to 1450ms (4.8 times the delay in the first window). Such large E2E values cause frame drops for real-time video streaming. After all LAN flows are removed in the fourth window, we observe a delay of 300 ms (the same as the delay in the first window). However, it took almost 20 seconds to recover from the increased delay observed in the third window. It is evident from the above experiments that 5G Slice's GBR (guaranteed bit rate) is preserved on the LAN when there is no other LAN traffic. However, when new LAN traffic is introduced (practical scenario), the QoS guarantee for RAN flows is broken even when the RAN flows have a DSCP marking. This is because of the mismatch in QoS between the 5G network and LAN. In this paper, we propose 5GLoR to preserve the QoS of RAN flows as they transit through the LAN. When we run the same experiments with the 5GLoR assisting the application, there is no throughput degradation, as shown in Figure~\ref{fig:motivation-tcp-sol}. Also, the packet loss is almost zero, and the video frame (end-to-end) delay is around 380ms (see Figure~\ref{fig:motivation-webrtc-sol}) compared to about 1500ms delay when 5GLoR is not used. More details about the 75 background LAN flows are described in Section~\ref{sec:lanflows}. \section{Related Work} \textbf{5G Slice}: The 5G slice construct begins from the wireless mobile device on RAN and ends at the core of the 5G. Much of the previous work has been done on the design of slice in the air (RAN). A.Banchs et al. in \cite{related-1} focus on analyzing two categories of resource allocation, dedicated and shared. V.Sciancalepore et al. in  \cite{related-2} developed ONETS, a theoretical model that emphasizes maximizing the network slicing multiplexing gains rather than providing dedicated or shared resources. A.Gohar et al. in \cite{related-3} also build a slice broker that works on minimizing the cost by purchasing the slices from the service provider. All these works emphasize the resource allocation and management of slices from the wireless side, but 5GLoR addresses the issue of QoS breakdown of 5G slice in LAN. \textbf{5G-LAN}: Celona offers the 5G-LAN infrastructure \cite{b6}, that provides benefits of remote updates to end user devices, better management and device operation via remote monitoring. However, 5G-LAN, as described above, suffers due to localized traffic in LAN. 5GLoR is built to address this issue. \textbf{Protocols:} Multiprotocol Label Switching (MPLS) \cite{mpls} and Resource reservation protocol (RSVP)\cite{rsvp} are routing protocols to connect enterprise sites through public internet service providers. These protocols also offer an end-to-end QoS mechanism by creating private tunnels or specific flows. One would ask, why not use these protocols with 5G-LAN? Firstly RSVP is not supported in all the routers, and MPLS is the only class-based QoS guarantee, not flow-based. These are WAN-specific router protocols, and using them in an enterprise LAN adds significant overhead. Hence we build 5GLoR \section{System Overview of 5GLoR}\label{sec:overview} \begin{figure}[!t] \centerline{\includegraphics[width=1\linewidth]{Figures/architecture.pdf}} \caption{System Overview of 5GLoR} \label{fig:sys} \vspace{-0.2 in} \end{figure} This section gives a brief overview of 5GLoR. Key components of 5GLoR are shown in Figure~\ref{fig:sys}. The Path Manager determines the path (i.e., switches and the ingress and egress ports on each switch) the 5G data stream will take in the enterprise LAN. This path can also be manually specified. After knowing the path, 5GLoR analyzes the status of the various queues associated with the egress ports of each switch in the path. Such information can be obtained from an SDN (software-defined networking) controller on the LAN or by directly querying the switch. Based on the status of the various queues in each switch, the Feasibility Manager determines if there are queues in each switch so that the QoS of the 5G data can be preserved as the data traverses the LAN. If such a path exists, then the Compatibility Manager checks if a single, common DSCP identifier is sufficient to ensure that the QoS of the 5G data is preserved as the data traverses through the various queues across the switches. If a common DSCP identifier across all switches is not available, then 5GLoR uses the Queue Manager to install the appropriate re-write rules on each switch (this will allow the DSCP identifier to be changed mid-way during the path). 5GLoR also periodically monitors the path, and if necessary, it can change the DSCP identifier the application should use or update re-write rules on switches. If the Feasibility Manager fails to find a suitable path that can preserve the QoS, then 5GLoR alerts the application that Slice QoS will be broken on the LAN and pinpoints the switch and port where the QoS is likely to be broken. If the application wishes to continue to use the LAN, then 5GLoR will enable the 5G data to traverse the offending switch using the best-effort policy. In the following sections, we will provide more details about the goals, challenges, and detailed design of key components in 5GLoR. \subsection{Challenges:}Design of a solution like 5GLoR poses significant challenges: \begin{itemize} \item Topology Challenge: For 5GLoR to check the queue availability, mapping tables, and priority of ingress and egress ports of different switches, knowledge of the network path (switches and port details) from the IoT sensors to the LAN-resident application is essential. \item Feasibility Challenge: To determine a possible path through the queues of different switches, knowledge of the status of the different queues (i.e., max capacity and current usage) is essential. \item Adaptability Challenge: 5GLoR should be able to automatically adapt as new switches are added to the network path between the IoT sensors and the application. \item Heterogeneity Challenge: The QoS mechanisms and policies are the same on different switches from different vendors. However, the APIs used to invoke the mechanisms and policies are quite different across the switches. 5GLoR must work seamlessly with switches from vendors and SDN controllers that manage many L3 and L2 switches. \end{itemize} \section{Conclusion} Although 5G technology has the unique ability to distinguish among customers in the same traffic class (by using nework slicing), and offer differentiated services to different customers, this ability is not supported by most enterprise LANs. As a consequence, applications resident on the enterprise LAN are unable to take advantage of the unique abilities of 5G. To address this gap, we proposed 5GLoR that helps enterprise IoT applications achieve predictable performance. Our extensive experiments demonstrated that for a variety of figures of merit like throughput, delay, jitter, and accuracy, a 5G LAN with the proposed 5GLoR technique is superior to a 5G LAN without our technique. Furthermore, a 5G LAN with the proposed 5GLoR technique is very competitive to the alternative of hosting applications in 5G+MEC. This is significant because 5G LAN offers an order of magnitude more computing, networking, and storage resources to the applications than the resource-constrained MEC, and mature enterprise technologies can be used to deploy, manage and update enterprise IoT applications. \subsection{Design Goals} \subsection{Root causes for QoS mismatch} \begin{figure}[!t] \centerline{\includegraphics[width=1\linewidth]{Figures/l3-mismatch.pdf}} \caption{QoS mismatch in layer 3 switches} \vspace{-0.2 in} \label{fig:l3-mismatch} \end{figure} \subsubsection{QoS mismatch in layer three switches \label{sec:goal1}} Figure~\ref{fig:l3-mismatch} shows a part of the enterprise LAN with four-layer 3 (L3) switches. Five slices from the RAN trunk to switch S1 in the enterprise LAN. As shown in the figure, other non-RAN flows enter the L3 switches as well. The egress port of every switch has eight queues labelled {\it q1} through {\it q8}. Also, each L3 switch has a table that maps a range of DSCP identifiers to one of the eight queues. For example, packets with DSCP identifiers from 0-7 are sent to queue {\it q1}. The figure also shows how the 1Gbps egress bandwidth of a port is apportioned among the eight queues of the egress port. For example, queue  {\it q1} is apportioned  30\% of the egress port bandwidth. Similarly, queue {\it q2} is the {\it default}, which means that packets with no DSCP identifiers are put in this queue, and packets are sent out of the egress port on a best-effort basis. We illustrate a QoS mismatch that can occur in a layer three switch. As shown in the fig \ref{fig:l3-mismatch}, let us assume that the available queues (i.e., these queues can carry new packets without dropping any packets) are queue {\it q8} in switch S1 (DSCP range 56-63) that has an unused capacity of 35\%, queue {\it q2} in switch S2 (DSCP range 8-15), and queue {\it q1} in switch S3 (DSCP range 0-7). We assume that the rest of the queues in the figure are fully subscribed by other non-RAN flows (shown in the figure as LAN flows) using a DSCP marking of 39. When the RAN packets with a DSCP marking of 39 enter the LAN, they will be placed in queue {\it q5} in switch S1 (as per the mapping table shown in the figure for the switch S1), queue {\it q5} in switch S2, and queue {\it q5} in switch S3. These RAN flows must, without a doubt, compete with existing LAN data in queue {\it q5} in switches S1, S2, and S3. Such competition usually breaks the Slice QoS requirements for the RAN flows, and packets from the RAN may be dropped. In contrast, if the RAN flow was assigned a DSCP marking in the range 56-63 for switch S1, a DSCP marking in the range 8-15 for switch S2, and a DSCP marking in the range 0-7 for switch S3, then the RAN flow would have no contention with the existing LAN flows that are using the DSCP marking of 39. A similar mismatch happened to RAN flows in the motivational experiment discussed in section \ref{sec:motivation}, where RAN flows had DSCP marking of 39. \begin{figure}[!t] \vspace{-0.15 in} \centerline{\includegraphics[width=1\linewidth]{Figures/l2-l3-mismatch.pdf}} \caption{QoS mismatch between layer 3 and layer 2 switches} \vspace{-0.2 in} \label{fig:l2-l3-mismatch} \end{figure} \subsubsection{QoS mismatch due to layer 3 and layer 2 switches \label{sec:goal2}} Enterprise LANs have both layer two (L2) and L3 switches. Unlike L3 switches, an L2 switch uses the 3-bit CoS (Class of Service) field in the ethernet header to assign frames to queues at an egress port. If the packets have a DSCP marking, then two translations occur: first, a DSCP to CoS translation is done, which is followed by a translation of CoS to queue number. This mapping table is shown as the L2 mapping table in Figure~\ref{fig:l2-l3-mismatch}. Here, packets with DSCP marking in the range 0-7 are mapped by an L3 switch to queue {\it q1} while the L2 switch maps the same DSCP range to a different queue. In the L2 switch, the DSCP range 0-7 translates to a CoS value of 1, which is mapped to queue {\it q2}. As shown in the figure, queue {\it q2} in an L2 switch is the default queue (best-effort traffic), and the Slice QoS can break when RAN flows traverse queue {\it q2} of the L2 switch. To preserve the slice QoS of the RAN flows, 5G data must use the DSCP range 0-7 to traverse the S1(L3) switch but change to the DSCP range 8-15 to traverse the S2(L2) switch so that the packets are assigned to queue {\it q1} in switch S2. Such an opportunistic change of DSCP identifiers can preserve slice QoS when 5G data traverses an L2 switch. \subsubsection{QoS mismatch due to poor ingress-egress policies \label{sec:goal3}} Packets received at ingress ports are put in an internal ring inside the switch. When the total inbound bandwidth of all ports exceeds the bandwidth of the internal ring~\cite{internal-ring}, then packets are dropped before they are even put in ingress queues (ingress queues are located after the packet is classified, policed, and marked in the internal ring, and before packets are forwarded into the switch fabric). A similar problem occurred for RAN flows in the motivation experiment in section \ref{sec:motivation}, where the LAN flows had too many packets, and some packets in the RAN flows were dropped at the internal ring. To mitigate this, policies had to be set at ingress port for RAN flows to reserve adequate bandwidth on the internal ring. This ensured that RAN flows got ingress priority over LAN flows. At the egress port of an enterprise switch, packets are drained from the queues based on the queue's priority and the queue number. The higher the queue number, the higher the priority. There are two policies in LAN switches that control the queue draining: strict and round-robin. Strict policy continuously drains the packets from higher priority queues unless they are empty. Round-robin drains the packets in a round-robin fashion based on the maximum bandwidth allocated to the queues. A similar problem occurred for RAN flows in the motivation experiment in section \ref{sec:motivation}, and the egress queue draining policy had to be set to round-robin to preserve the QoS of the RAN flow. \section{Discussion} Our current system is built for a single IoT application. The number of RAN flows coming in with GBR requirements is smaller than the total available hardware queues. We can extend the 5GLoR for multi-tenant applications, where the number of RAN flows will be significantly more significant than the total available queues. This breaks the feasibility easily. we plan to extend our solution by adding proxy paths in LAN or exploring multipath capabilities of the LAN. The machine learning algorithms will be used to monitor the LAN flows and switches to avoid the complexities of increased RAN flows.
\section{Introduction} \vspace{-0.5pc} Time series forecasting is a classical statistical problem with practical applications in several fields, such as finance, business management \cite{petropoulos2022forecasting}. Local statistical models such as ARIMA and ETS \cite{hyndman2018forecasting} have long been state-of-the-art for forecasting. In recent years, much effort has been put into matching the performance of local models with deep learning approaches, particularly when modeling several closely-related time series \cite{salinas2020deepar, oreshkin2019n, challu2022n}. When less data is available in a target dataset, transfer learning from source to target data is often necessary to compete with local methods. One approach is meta-learning, or domain generalization, where a model is trained to generalize to new target domains after an initial training phase on source data. Recent work has shown that meta-learning for time series forecasting, or meta-forecasting, can achieve competitive performance with only local fine-tuning \cite{grazzi2021meta} or even with no fine-tuning \cite{oreshkin2021meta}. Such approaches are \textit{zero-shot} forecasters, as they can forecast out-of-domain time series one-at-a-time without access to any related time series. Almost all of the previous transfer learning works use the assumption that source and target data come from the same sampling frequency, e.g. hourly, daily, monthly, etc. We propose a different assumption: \textit{all data is seasonal, but not necessarily from the same sampling frequency}. The typical seasonality associated with each sampling frequency then creates a correspondence between sampling frequency and signal frequency. As seen in Figure \ref{fig:intro_fig}, seasonal time series of different signal frequencies appear very similar to humans, but are challenging for typical forecasting models to transfer between. Along with our data assumption, we consider a new task, \textit{frequency generalization}, in which we task a model to generalize to \textit{unseen} frequencies during meta-test time. For successful frequency generalization, we propose a new model, the Continuous Frequency Adapter (CFA). As shown in Figure \ref{fig:intro_fig}, CFA can forecast the correct frequency on data of new unseen frequencies, which other methods cannot. \begin{figure} \centering \includegraphics[width=0.8\linewidth]{figures/intro_fig.pdf} \caption{For frequency generalization, CFA outperforms LSTM. Both models are trained on synthetic source data with period length randomly sampled between [10, 20], and are zero-shot applied to synthetic target data with period length randomly sampled from [30, 40]. In the top plot, the LSTM model predicts the wrong seasonality, whereas CFA successfully adapts to the new seasonality. In the bottom plot, we see that CFA keys are invariant to frequency (color), but LSTM hidden states have different distributions for source and target frequencies ranges.} \label{fig:intro_fig} \vspace{-1pc} \end{figure} CFA uses continuous domain adaptation \cite{wang2020continuously} to enforce frequency-invariant hidden states, which is vital for frequency generalization. We summarize the novelty and contribution of this paper: \begin{itemize}[itemsep=0ex, topsep=0ex, partopsep=0ex, parsep=0.5ex, leftmargin=2.1ex] \item We explore meta-learning over different sampling frequencies, which is previously unexplored. For this, we introduce a new task, \textit{frequency generalization}, in which we task a model to generalize to time series of new sampling frequencies during test time. \item We develop a new model, CFA, which achieves improved performance for frequency generalization than previous meta-learning models. CFA uses continuous domain adaptation \cite{wang2020continuously} to adapt to new sampling frequencies, a new technique for the time series literature. Specifically, CFA uses signal frequencies obtained from a Fourier transform of the input time series to define continuous domain indices, a novel technique for time series domain generalization. \end{itemize} \paragraph{Related Work} Transfer learning has been explored previously for time series through several subfields. Time series representation learning \cite{yue2022ts2vec, zerveas2021transformer} does self-supervised pretraining for time series data. Domain adaptation approaches \cite{jin2022domain, hu2020datsing} learn models that can adapt from one source dataset to a different target dataset, often utilizing adversarial training. In few-shot learning \cite{iwata2020few}, a model transfers knowledge by learning how to learn from a small support set of related time series. Recently, a few papers have particularly addressed meta-forecasting. In \cite{oreshkin2021meta}, the popular forecasting model N-BEATS is shown to fit a meta-learning framework, and achieves competitive zero-shot performance. In Meta-GLAR \cite{grazzi2021meta}, a local closed-form head is used to adapt global representations to new time series. Our work is most similar to these meta-learning approaches in that performance on the target dataset is evaluated in a zero-shot manner. Our model, however, takes inspiration primarily from \cite{jin2022domain} in its use of adversarial training and self-attention. We emphasize that all of the above cited papers only consider transferring between datasets of the same frequency, with the exception of \cite{jin2022domain} which considers domain adaptation opposed to the harder task of zero-shot meta-learning. \section{Problem Definition}\label{sec:prob_def} \vspace{-0.5pc} Time series forecasting is the problem of predicting future observations, i.e. forecasting, given a past context window. That is, for some time series $(\bm{z}_t)_{t > 0}$, data samples are of the form \[ \bm{x} = \bm{z}_{1:\tau_c}, \quad \bm{y} = \bm{z}_{\tau_c+1 : \tau_c + \tau_f} \] where $\tau_c$ is the length of the context and $\tau_f$ is the length of the forecast. A model $f$ then estimates $\bm{y}$ from $\bm{x}$. If $f$ has parameters $\theta$, we aim to find the parameters $\theta$ that minimize the forecasting loss, i.e. \begin{equation} \label{eq:loss_fn} \mathop{\mbox{argmin}}_\theta \mathbb{E}[L_f(F(\bm{x}), \bm{y}; \theta)] \end{equation} where $L_f$ is a forecasting loss such as MSE. What distribution the expectation is taken over, i.e. what distribution $\bm{z}$ comes from, depends on the nature of the forecasting problem. In this paper, we consider the \textit{zero-shot} framework, in which case $\bm{z} \sim \mathcal{T}$ comes from some target distribution $\mathcal{T}$, but we only have training data $(\bm{x}_1, \bm{y}_1), \ldots, (\bm{x}_n, \bm{y}_n) \sim \mathcal{S}$ from a source distribution $\mathcal{S}$. This defines the problem of \textit{meta-forecasting}, where the model $f$ must meta-learn on $\mathcal{S}$ with the goal of minimizing \ref{eq:loss_fn} on $\mathcal{T}$ with no additional training on $\mathcal{T}$, where $\mathcal{T}$ could be \textit{any} target distribution unseen during training. In this paper, we focus on \textit{frequency generalization}, which we define as meta-forecasting with $\mathcal{S}$ and $\mathcal{T}$ representing distinct frequencies. This is more challenging than the setting considered in previous meta-forecasting papers, in which $\mathcal{T}$ only contains frequencies that are already seen in $\mathcal{S}$. We do explore this second easier setting to compare to previous papers, and present the results in Appendix \ref{subsec:uni_vs_multi}. Since minimizing \ref{eq:loss_fn} on all potential $\mathcal{T}$ is an ambitious and likely unrealistic desire, we restrict $\mathcal{S}$ and $\mathcal{T}$ to be distributions representing seasonal datasets. Under this assumption, different sampling frequencies correspond to different signal frequencies, and thus generalizing to new sampling frequencies corresponds to generalizing to new signal frequencies. This makes the frequency generalization problem realistic, since seasonal data of different signal frequencies appear quite similar to the human eye but are difficult for machine learning models to generalize between as shown in Figure \ref{fig:intro_fig}. Relaxing this assumption would be significantly more challenging, and we leave this to future work. \section{Continuous Frequency Adaptation}\label{sec:cfa} \vspace{-0.5pc} Most meta-forecasting models struggle to learn frequency-invariant signal vital for meta-forecasting. This challenge is demonstrated in the bottom right portion of Figure \ref{fig:intro_fig}, where an LSTM model learns hidden states whose distribution depends on the input signal frequency. To overcome this challenge, we introduce the Continuous Frequency Adapter (CFA), which is specifically designed to learn frequency-invariant representations (see bottom left of Figure \ref{fig:intro_fig}). CFA is primarily a self-attention network, and utilizes adversarial training to enforce frequency invariance in the attention keys and queries (but not the values). The model architecture is inspired by the Domain Adaptation Forecaster (DAF) \cite{jin2022domain}, but uniquely uses continuous domain indices \cite{wang2020continuously} obtained by a Fourier transform to generalize to unseen signal frequencies. \begin{figure} \centering \begin{minipage}[c]{0.57\textwidth} \includegraphics[width=\linewidth]{figures/cfa_architecture.png} \end{minipage} \hfill \begin{minipage}[c]{0.4\textwidth} \caption{CFA Architecture. The encoder takes in a context window and produces keys, queries, and values, which are used by the self-attention module to produce representations for each timestep in the forecast window, which the decoder uses to make forecasts. Meanwhile, the keys and queries are passed to the continuous discriminator, which predicts the top $k$ frequencies of the context window sorted by FFT amplitude. Adversarial training via Equation \ref{eq:minimax_loss} is used to learn good forecasts while also making keys and queries frequency-invariant.} \label{fig:cfa_architecture} \end{minipage} \vskip -0.5cm \end{figure} \paragraph{CFA Architecture} The CFA architecture is summarized in Figure \ref{fig:cfa_architecture}. The encoder, self-attention, and decoder blocks are similar to the DAF architecture \cite{jin2022domain}. The encoder consists of a position-wise MLP follows by a series of 1D convolutional layers, and the decoder is a position-wise MLP. The self-attention block is a standard multi-head attention block as in transformer architectures \cite{vaswani2017attention}. The CFA discriminator is an MLP, like in DAF, but unlike DAF, our discriminator outputs a continuous response to match the continuous domain index (see next paragraph). Also, unlike DAF, the encoder and decoder blocks are shared for all time series, since a continuous domain index does not allow for separate encoders and decoders for each possible index since there are infinitely many domain indices. The discriminator takes as input all keys and queries from the self-attention block, in order to enforce domain invariance in the keys and queries via adversarial training (see Equation \ref{eq:minimax_loss}). The motivation for this choice is that the keys and queries are used to generate the attention weights, which tell the model, for any given time point, which other time points are most relevant. For time series data, especially seasonal time series data, this importance weighting can be independent of the signal frequency, as the attention weights only need to capture the phase of the signal. Meanwhile, the values in the self-attention block are left independent of the discriminator, and thus can learn information that is dependent on the given time series, e.g. what the time series typically looks like at each phase. \paragraph{Continuous Domain Generalization} A key component of CFA is the use of continuous domain indices \cite{wang2020continuously}. These continuous domain indices serve as labels for the discriminator, which takes as input the self-attention keys and queries and outputs a continuous domain index prediction. The domain indices are obtained via an FFT on the inputted context window to capture the signal frequencies of the time series. Specifically, we take the absolute value of the FFT outputs to obtain the amplitude corresponding to each frequency bin. We then select the top $k$ frequencies, sorted by their amplitudes, and use their inverses (i.e. the period lengths) as the discriminator labels. We normalize the labels to be between 0 and 1 to stabilize the discriminator loss. For synthetic data we use $k=1$, since the synthetic data is noist sine waves without subfrequencies, and on real data we use $k=2$. \paragraph{Adversarial Loss} CFA utilizes adversarial training via a typical minimax loss \cite{goodfellow2020generative}. Let $E$ be an encoder, $F$ a forecasting decoder, and $D$ a discriminator (for CFA, E generates the self-attention keys, queries, and values, and F produces forecasts using these self-attention inputs). The goal of CFA is to solve the following minimax problem: \begin{equation} \label{eq:minimax_loss} \min_{E, F} \max_D \mathbb{E}[L_f(\bm{x}; E, F)] - \lambda \mathbb{E}[L_d(\bm{x}; E, D)] \end{equation} where $L_f$ is the forecasting loss and $L_d$ is the discriminator loss. In words, $D$ is trained to minimize $L_d$, thereby training a strong discriminator, while $E$ and $F$ are trained to both produce good forecasts (i.e. minimize $L_f$) while maintaining hidden states that the strong discriminator cannot predict well (i.e. maximizing $L_d$). Such adversarial training allows the model to learn frequency-invariant discriminator inputs (keys and queries) while still producing good forecasts. In practice, the forecast/generative parameters (E, F) and the discriminative parameters (D) are updated in an alternating fashion, see Algorithm \ref{alg:cfa_alg}. \paragraph{Training Procedure} Since CFA is designed to learn frequency-invariant keys and queries, it is essential that CFA is trained over source data with varied frequencies. The multi-source training procedure is illustrated in Algorithm \ref{alg:cfa_alg}. The training works by sampling one batch from each of the source datasets, and updating the generative and discriminative parameters from the sum of the batch losses. The forecast/generative parameters (E, F) and the discriminative parameters (D) are updated in an alternating fashion, as typical for adversarial training. \begin{algorithm}[h!] \caption{CFA Training Algorithm} \begin{algorithmic}[1]\label{alg:cfa_alg} \STATE \textbf{Input:} source datasets $S_1, \ldots S_d$, forecast loss $L_f$, discriminator loss $L_d$. \FOR{epoch $=1$ {\bfseries to} $E$} \FOR{$i=1$ {\bfseries to} n\_batches\_per\_epoch} \STATE Sample $\bm{x}_j, \bm{y}_j \sim S_j$ for $j=1,\ldots,d$ \STATE Compute generative loss $L_j = L_f(\bm{x}_j, \bm{y}_j) - \lambda L_d(\bm{x}_j)$ for each $j$ \STATE Update generative parameters via $L = L_1 + \cdots + L_d$ \STATE Compute discriminative loss $L_j = L_d(\bm{x}_j, \text{FFT}(\bm{x}_j)$ for each $j$ \STATE Update discriminative parameters via $L = L_1 + \cdots + L_d$ \ENDFOR \ENDFOR \end{algorithmic} \end{algorithm} \section{Experiments} \vspace{-0.5pc} \paragraph{Models} For our experiments, we consider the following models. \begin{itemize}[itemsep=0ex, topsep=0ex, partopsep=0ex, parsep=0.5ex, leftmargin=2.1ex] \item \textbf{Mean}: simple baseline that forecasts the mean from the context window. \item \textbf{LSTM}: an auto-regressive LSTM model similar to DeepAR \cite{salinas2020deepar}. \item \textbf{NBEATS}: deep model with mostly linear layers and doubly-residual connections \cite{oreshkin2019n}. \item \textbf{CFA}: Our model described in Section \ref{sec:cfa}. \end{itemize} Since frequency generalization is a new task, there are some baselines which cannot readily be adapted. For one, any method which requires separate modules for different sampling frequencies cannot be used, e.g. DAF \cite{jin2022domain}, because it is impossible to train a new module for the target sampling frequency in the zero-shot regime. Additionally, we think that is it critical on real data to have different forecasting lengths for different sampling frequencies, and thus require models that can forecast an arbitrary number of time steps ahead during test time. CFA and LSTM can easily do this since they are autoregressive forecasters, i.e. they use the previous forecasts to make each successive forecast. NBEATS, on the other hand, requires a fixed forecast length that cannot be adjusted during test time, and thus we do not use it as a baseline for real data experiments. We still consider NBEATS as a baseline for synthetic data generated with uniform forecast length, though, since NBEATS has been shown to be a strong meta-forecaster \cite{oreshkin2021meta}. \paragraph{Synthetic Data} We generate synthetic time series data using sinusoidal curves with Gaussian noise and uniformly random period length (inverse of frequency), see Appendix \ref{subsec:dataset_details} for full details. We designate one period range for source data and one period range for target data. Models are trained on source data and applied zero-shot to target data, evaluated by mean squared error (MSE) in the forecast window. Results are shown in Table \ref{tab:synthetic_zero_shot}. Across all combinations of source and target period ranges, CFA is either the best model or within one standard deviation of the best model. As shown in Figure \ref{fig:intro_fig}, CFA is able to learn good forecasts on the source data while maintaining frequency-invariant keys and queries, allowing CFA to generalize to new frequencies. In comparison, LSTM and NBEATS learn frequency-dependent signal, and thus fail to generalize to new frequencies, even failing to beat the simple mean baseline. \begin{table} \centering \scalebox{0.8}{ \begin{tabular}{llllll} \toprule Source Range & Target Range & Mean & CFA & LSTM & NBEATS \\ \midrule (10, 15) & (15, 20) & $0.260 \pm 0.002$ & $\bm{0.088 \pm 0.011}$ & $0.312 \pm 0.057$ & $0.424 \pm 0.017$ \\ & (20, 25) & $0.259 \pm 0.003$ & $\bm{0.190 \pm 0.025}$ & $0.456 \pm 0.081$ & $0.351 \pm 0.007$ \\ & (25, 30) & $\bm{0.262 \pm 0.003}$ & $\bm{0.223 \pm 0.041}$ & $0.426 \pm 0.028$ & $0.320 \pm 0.004$ \\ (15, 20) & (10, 15) & $0.259 \pm 0.003$ & $\bm{0.071 \pm 0.014}$ & $0.388 \pm 0.035$ & $0.417 \pm 0.011$ \\ & (20, 25) & $0.259 \pm 0.003$ & $\bm{0.055 \pm 0.004}$ & $0.185 \pm 0.055$ & $0.469 \pm 0.011$ \\ & (25, 30) & $0.262 \pm 0.003$ & $\bm{0.082 \pm 0.007}$ & $0.499 \pm 0.072$ & $0.526 \pm 0.012$ \\ (20, 25) & (10, 15) & $\bm{0.259 \pm 0.003}$ & $\bm{0.209 \pm 0.099}$ & $0.497 \pm 0.037$ & $0.333 \pm 0.005$ \\ & (15, 20) & $0.260 \pm 0.002$ & $\bm{0.066 \pm 0.013}$ & $0.282 \pm 0.082$ & $0.425 \pm 0.008$ \\ & (25, 30) & $0.262 \pm 0.003$ & $\bm{0.064 \pm 0.006}$ & $0.134 \pm 0.052$ & $0.387 \pm 0.020$ \\ (25, 30) & (10, 15) & $\bm{0.259 \pm 0.003}$ & $\bm{0.257 \pm 0.056}$ & $0.442 \pm 0.015$ & $\bm{0.303 \pm 0.006}$ \\ & (15, 20) & $\bm{0.260 \pm 0.002}$ & $\bm{0.213 \pm 0.081}$ & $0.533 \pm 0.045$ & $0.417 \pm 0.007$ \\ & (20, 25) & $0.259 \pm 0.003$ & $\bm{0.069 \pm 0.015}$ & $0.177 \pm 0.027$ & $0.397 \pm 0.021$ \\ \bottomrule \end{tabular} } \vspace{0.5pc} \caption{Frequency generalization on synthetic data, measured as MSE of forecast. Source and target range indicate the range of uniformly random period lengths in the source and target data, respectively. For each source/target pair, the model is trained on source and applied zero-shot to target. Across all pairs of ranges, CFA has the best performance. } \label{tab:synthetic_zero_shot} \vspace{-2pc} \end{table} \paragraph{Real Data} We focus on real world datasets that exhibit clear seasonality. We use the following datasets, each with a different sampling frequency: elec (hourly), uber (daily), tourism monthly (monthly), and tourism quarterly (quarterly). We load all datasets using GluonTS \cite{alexandrov2020gluonts}. More information on each dataset, data preprocessing, and setup can be found in Appendix \ref{subsec:dataset_details}. For each experiment, we designate one dataset as the target dataset and use the other 3 as the source datasets. We evaluate models by their Normalized Deviation (ND) \cite{jin2022domain} on the forecasting window. We do not run NBEATS because it requires equal context/forecast lengths across datasets, which we do not enforce for frequency generalization. The results are shown in Table \ref{tab:freq_gen}. As was the case with synthetic data, CFA outperforms LSTM for frequency generalization. \begin{table} \centering \begin{minipage}[c]{0.50\textwidth} \scalebox{0.64}{ \begin{tabular}{llll} \toprule {} & Mean & CFA & LSTM \\ \midrule elec & $0.404 \pm 0.000$ & $\bm{0.281 \pm 0.065}$ & $0.376 \pm 0.031$ \\ tourism\_monthly & $0.312 \pm 0.000$ & $\bm{0.226 \pm 0.019}$ & $0.296 \pm 0.033$ \\ tourism\_quarterly & $0.229 \pm 0.000$ & $\bm{0.178 \pm 0.021}$ & $\bm{0.19 \pm 0.018}$ \\ uber & $0.203 \pm 0.000$ & $\bm{0.166 \pm 0.012}$ & $0.252 \pm 0.02$ \\ \bottomrule \end{tabular} } \end{minipage} \begin{minipage}[c]{0.48\textwidth} \caption{Frequency generalization on real data, evaluated by test Normaized Deviation. Each dataset has a different frequency, and each row corresponds to one target dataset, using all other datasets as source. As on synthetic data, CFA is better at frequency generalization than LSTM. We do not evaluate N-BEATS in this setting because each dataset has a different context and forecast length, making N-BEATS incompatible.} \label{tab:freq_gen} \end{minipage} \end{table} \section{Conclusion} \vspace{-0.5pc} Previous meta-forecasting papers have shown strong performance, but only when training one model per sampling frequency. In this paper, we instead consider frequency generalization, i.e. generalizing to unseen frequencies, for which it is not possible to train one model per sampling frequency. While previous meta-forecasting models are not successful, our CFA model provides much improved performance. This is an important first step towards building forecasting models robust to signal frequency, which could be trained over larger and less constrained datasets. \bibliographystyle{abbrv}
\section{Introduction} Spreading processes have become an influential part of our daily lives. From epidemics (\cite{Nowzari2016}), computer viruses (\cite{Bloem2008} to wildfires (\cite{Karafyllidis1997a}) and misinformation (\cite{zareie2021minimizing}), if not properly monitored and controlled, they can have a disastrous impact and pose a significant threat. This has stressed the importance and current limitation of methods to reduce their risk with appropriate intervention strategies. What these processes or `threats' have in common, is that they can all be modeled as a process with an initial outbreak that spreads rapidly throughout a network. The natural and social networks these processes typically evolve on, e.g. global contact and travel networks for epidemics, large geographic areas for wildfires, social media or the internet for computer viruses and misinformation, have two important and challenging aspects associated with them. First of all, they are often temporal in nature, i.e. interactions or the connectivity of the network change over time, and second, they evolve on a large scale. This implies it can be difficult or even impossible to deliver resources everywhere quickly across the whole network, such as vaccines for epidemics or waterbombing allocations for wildfires. Therefore, sparse, budgeted and dynamic allocation of resource solutions is important. Spreading processes are commonly modeled as Markov processes. The most well-known models are the Susceptible-Infected-Susceptible (SIS) model and the Susceptible-Infected-Removed (SIR) model as proposed by \cite{kermark1927contributions} and \cite{bailey1975mathematical}. These stochastic models can be approximated as ordinary differential equation (ODE) models, which can in turn be approximated by linear models (\cite{Ahn2013}). This is proven by \cite{VanMieghem:2009} to be an upper bound and is, therefore, usually the object of study. The problems of minimizing the spreading rate by removing either a fixed number of links or nodes in the network are both NP-hard as discussed in \cite{van2011decreasing}. This could be overcome by heuristics methods, but besides their optimality compromises, the strategy of complete link or node removal is often unrealistic. A more realistic assumption is that spreading rate can be decreased or the recovery rate increased by applying resources to the nodes and links. Various methods have been proposed in which this resource allocation is subject to budget constraints (e.g. see \cite{Nowzari2016,Bloem2008,DiGiamberardino2019,Torres2017,Preciado2014,Zhang2018,Nowzari2017}). However, all these methods consider static control of static networks. That is, the resource allocation is determined based on the current state of the network instead of taking into account the time-varying nature of the network. A more realistic approach would be to have time-dependent intervention for temporal networks. Temporarility also implies that the time-varying nature of the spreading variables can be investigated. For example, changing weather conditions for wildfires and varying spreading and recovery rates as different variants emerge or new treatments are developed for epidemics. Furthermore, behavioral changes, growing contact networks or additional external influences can be taken into account by varying the network structure and parameters, which is a step towards a more complete system as indicated in \cite{zino2021analysis}. Furthermore, in \cite{speidel2017epidemic} is stressed that ignoring the temporally-varying nature of networks may underestimate endemicity. Dynamic resource allocation for epidemics on static networks is studied in \cite{drakopoulos2017network} and \cite{scaman2016suppressing}. Here network properties are identified to respectively identify limitations on and derive upper and lower bounds for epidemic extinction time. More recently, dynamic programming (\cite{bertsekas2000dynamic}) and in particular, model predictive control (MPC) has been proposed for time dependent intervention (\cite{kohler2018dynamic,watkins2019robust,Selley2015}). One method to deal with dynamic networks is by using a time-scale separation. Here the assumption is made that the network dynamics and spreading process evolve on different time-scales, i.e. one process is much faster than the other. In the case of the spreading process being faster, a static network can be used as the changing network structure won't affect the resource allocation and spread. If, on the other hand, the network dynamics are changing faster, we encounter the annealed regime and an `average network' can be used (\cite{zino2021analysis}). A method that overcomes this time-scale separation assumption are temporal-switching networks. Temporal-switching networks use a sequence of static networks to model the temporal behavior. They were first proposed in \cite{prakash2010virus} for deterministic models, where the epidemic threshold is investigated. In \cite{sanatkar2015epidemic} this is further extended to include the upper bound for epidemic spread and conditions for stability for arbitrarily switching networks. \cite{valdano2015analytical} extend this to continuous time, where the threshold is related to time of observation. In \cite{pare2015stability,pare2017epidemic} stability analysis of heterogeneous epidemic processes on time-varying networks is investigated and conditions for global exponential stability and convergence to the disease-free equilibrium are provided. \citet{gracy2020analysis} provide a distributed control strategy by defining conditions for stability and exponential convergence to the disease-free equilibrium. A solution, using geometric programming techniques for control of time-varying networks is given in \cite{Nowzari2016b}. None of these approaches, however, consider sparse, targeted resource allocation to bound the risk. An exception regarding sparsity being the approach taken in \citet{Rev2R2}, where the authors utilize the reweighted $\ell_1$ optimization approach to solve an antidote problem for a multi-competitive virus model. This approach, however, has no guarantee of global optimality. In this paper, we therefore, present a framework for dynamic, sparse resource allocation on time-varying networks for control of spreading processes. This framework builds on work presented in \cite{ACC2022}, where we presented a multi-stage sparse resource allocation method for static networks. The presented framework distinguishes itself by extending this work to temporal-switching networks and hence, overcoming the shortcomings of the assumption of a static network. \section{Model and Problem Formulation} \subsection{SIS Spreading Process Model} We study a spreading process on a time-varying graph $\mathcal{G}(t)$ with $n$ nodes in node set $\mathcal{V}$ and time-variant edge set $\mathcal{E}(t)$. Now, each node $i \in \{1, 2, ..., n\} \in \mathcal{V}$ has a state $X_i(t)$ associated with it. We consider the basic SIS model by \cite{kermark1927contributions} in which a node can be in two states: infected, i.e. $X_i(t)=1$, or susceptible to infection from neighboring nodes, i.e. $X_i(t)=0$. An infected node recovers with probability $\delta_{i}\Delta t$ to $X_i(t+\Delta t)=0$ and the process spreads from infected node $j$ to susceptible node $i$ with probability $\beta_{ij} \Delta t$, where $\Delta t$ is a small time interval. Due to the time-varying nature of our spreading process and network, we extend this further by allowing $\beta_{ij}(t)$ and $\delta_i(t)$ to change over time. We now define $x_{i}(t)=E(X_{i}(t))=P(X_{i}(t)=1)$ as the probability of a node $i$ being infected at time $t$. Following \cite{Preciado2014}, with a mean-field approximation, $n$ coupled nonlinear differential equations are obtained: \begin{equation} \label{eq:nonL} \dot{x}_{i}=(1-x_{i}(t))\sum^{n}_{j=1}\beta_{ij}(t)x_{j}(t)-\delta_{i}(t)x_{i}(t). \end{equation} By applying Euler's forward approximation to \eqref{eq:nonL}, see \cite{pare2020modeling}, we obtain the following discrete time model approximation \begin{equation} \label{eq:disnonL} x_{i}^{k+1}=x_i^k + h(1-x_{i}^k)\sum^{n}_{j=1}\beta^k_{ij}x_{j}^k-h\delta^k_{i}x_{i}^k \end{equation} where $h= t^{k+1}-t^k$ is the length of each time interval $[t^k, t^{k+1}]$. Given $h\delta^k \leq 1$ and $h\sum^{n}_{j=1}\beta^k_{ij}<1 \,\, \forall\, k$, this model is well-defined at $x_i^1\in[0,1] \Rightarrow x_i^k\in[0,1] \,\, \forall\, k$. By linearizing around the infection-free equilibrium point ($x_i=0 \,\, \forall\, i$) we obtain \begin{equation} \label{eq:disL} x^{k+1}=A^kx^k \end{equation} where $x^k=[x_{1}^k,...,x_{n}^k]^{T}$ is the state of the system and $A^k$ the sparse state matrix consisting of elements \begin{equation} \label{eq:epi} a_{ij}^k = \begin{cases} 1-h\delta_{i}^k \ge 0 &\quad \text{if}\quad i=j, \\ h\beta_{ij}^k \ge 0&\quad \text{if}\quad i\neq j, (i,j) \in \mathcal{E}^k, \\ 0 &\quad \text{otherwise}. \end {cases} \end{equation} Note that the state matrix $A^k$ changes each time step due to both changes in spreading parameters $\beta^k_{ij}$, $\delta_i^k$ and due to changes in network structure, i.e. in $\mathcal{E}^k$. Hence, we have obtained a system that can take a sequence of temporal-switching graphs $\mathcal{G}^k(\mathcal{V},\mathcal{E}^k)$ as input. Furthermore, we remark that \eqref{eq:disL} is a positive system as described in \cite{berman1994nonnegative}, i.e. if $x^1_i\ge 0$ for all $i$, then $x^i_k\ge 0$ for all $i$ and all $k\ge 0$. \subsection{Cost function} The aim is to reduce and bound the risk of the spreading system on the temporal-graph described in the previous section. In order to achieve this, we assume a finite-time horizon forecast and optimization up to time $K$ and associate the following cost function with the system \begin{equation} \label{eq:JC} J(x^1) = \sum_{k=1}^K \alpha^kCx^k \end{equation} where $x^k=[x_{1}^k,...,x_{n}^k]^{T}$ is the state of the system and $C= [c_1, ..., c_n]$ is a row vector defining the cost at time $k$ associated with each node $i$, with each $c_i\ge 0$. We include a discount factor $\alpha\in(0,1]$ which can be tuned to emphasize near-term cost over long-term cost. Note that the cost for $K \rightarrow \infty$ can also be taken into account as further explained in Section \ref{subsec:Inf}. We can now formulate bounds on the cost \eqref{eq:JC} based on the linear model \eqref{eq:disL} and demonstrate it also bounds the costs of the nonlinear model \eqref{eq:disnonL}. Positive systems with non-negative linear costs admit linear value, or cost-to-go, functions, see e.g. \cite{berman1994nonnegative, briat2013robust, rantzer2015scalable}, and we will use a variation of this argument to construct bounds via a dynamic-programming-like formulation. % \begin{prop}\label{prop1} Suppose there exists a sequence of row vectors $p^k=[p_{1}^k,...,p_{n}^k], k = 1, ..., K$ which are elementwise non-negative: $p_i^k\ge 0 \,\, \forall\, i,k$, and for which the following inequality holds: \begin{equation} \label{eq:pk1} p^k \ge C+\alpha p^{k+1}A^{k} \end{equation} where the inequalities are understood to hold elementwise. Then $p^1x^1\ge J(x^1)$ as defined in \eqref{eq:JC}. \end{prop} \begin{pf} We first show that $V(x,k) = p^kx^k$ provides an upper bound on the cost-to-go from state $x$ at time $k$ for the linear system \eqref{eq:disL}. Since $x_i^k\ge 0 \,\, \forall\, i,k$, inequality \eqref{eq:pk1} implies $ p^kx^k \ge Cx^k+\alpha p^{k+1}A^{k}x^k. $ Using $V(x,k) = p^kx^k$, we obtain \begin{equation} \label{eq:vk1} V(x^k,k) \ge Cx^k+\alpha V(x^{k+1},k+1). \end{equation} By telescoping sum we obtain $ V(x^1,1) \ge \sum_{k=1}^K \alpha^kCx^k + V(x^K,K+1) $ and since $V(x^K,K+1)\ge 0$ we have $ V(x^1,1) = p^1x^1 \ge \sum_{k=1}^K \alpha^kCx^k. $ To demonstrate this also bounds the cost for the nonlinear system \eqref{eq:disnonL}, we note that for any $x^k$ with elements in $[0,1]$, $x^{k+1}\ge A^kx^k$ where $x^{k+1}$ is evaluated according to \eqref{eq:disnonL}, i.e. solutions of the linear system upper bound (elementwise) those of the nonlinear system from the same initial conditions. Because the cost vector $C$ is positive, this further implies that the cost obtained with the linear system upper bounds that with the nonlinear system. \end{pf} To go from these cost bounds to a model of risk, we note that we can bound the expected cost $E[J(x^1)]$ via a linear function of the expected value of the initial state $\hat x^1$. Because we have $J(x^1) \le p^1x^1$ for any $x^1$, it follows that $E[J(x^1)] \le E[p^1x^1] = p^1 E[x^1]=p^1\hat x^1$. We, therefore, define the risk associated with each state as \begin{equation} \label{eq:Risk2} R_i=p_i^1\hat{x}_i^1. \end{equation} Both the overall risk $\sum_i R_i=p^1\hat x^1$ and the maximum risk or `worst-case' expected impact of an outbreak $\max_{i}(R_{i})$ can be considered. \subsection{Resource Allocation Model} In order to reduce the overall cost and risk involved, we now investigate the inclusion of sparse, budgeted resources at each time step $k$ to our model. We consider allocation of resources to both the edges, to reduce spreading rates $\beta_{ij}$, and to the nodes, i.e. to increase recovery rates $\delta_{i}$. In order to achieve this, we assume bounded ranges of possible spreading and recovery rates for $k=1,...,K$: \begin{equation} \label{eq:bounds2} 0 < \underline{\beta}_{ij}^k \leq \beta_{ij}^k \leq \overline{\beta}_{ij}^k, \quad 0 < \underline{\delta}_{i}^k \leq \delta_{i}^k \leq \overline{\delta}_{i}^k<\overline{\Delta}. \end{equation} Here $\overline{\beta}_{ij}^1$ and $ \underline{\delta}_{i}^1 $ are the unmodified rates of the system \eqref{eq:disnonL}. For $k>1$, $\overline{\beta}_{ij}^k$ and $ \underline{\delta}_{i}^k $ are the updated rates of the system given the unmodified rates associated with time step $k$ with the inclusion of resource allocation up to the current time step. That is, in our model, changes made at a particular time step persist for all future times. This implies that our state matrix $A^k$ now changes each time step not only due to the time-varying nature of the graph as set out in \eqref{eq:epi}, but also due to inclusion of resource allocation on $\beta_{ij}$ and $\delta_i$ up to time $k$. Note that the framework can easily be modified to include interventions with a fixed duration or those that diminish over time. We now propose the following resource model defined by: \begin{align} f_{ij}\left(\beta_{ij}^k\right)&=w_{ij}^k\text{log}\left(\frac{\overline{\beta}^k_{ij}}{\beta_{ij}^k}\right) \nonumber \\ g_{i}\left(\overline{\Delta}-\delta_{i}^k\right)&=w_{ii}^k\text{log}\left(\frac{\overline{\Delta}-\underline{\delta}^k_{i}}{\overline{\Delta}-\delta_{i}^k}\right) \label{eq:RM} \end{align} where $w_{ij}$ are weightings expressing the cost of respectively reducing $\beta_{ij}$ and increasing $\delta_{i}$ at time $k$. These resource models can be understood as that a certain proportional increase (for $\beta_{ij}$) and decrease (for $\delta_i$) always have the same cost. Note that it is impossible for $\beta_{ij}$ to be reduced to $0$ since that would take infinite resources. More importantly, these resource models encourage sparsity as detailed further in Section \ref{subsec:spars}. We refer to \cite{LCSS2021} for a more in-depth discussion of this type of logarithmic resource allocation. \subsection{Problem Statements} The goal is to bound both the risk of an outbreak and the amount of resources required while adhering to the time-varying network structure. Therefore, we study two closely related problems of dynamic resource allocation for spreading processes on temporal-switching graphs. \begin{prob}[Resource-Constrained Risk Minimization] \label{prob:1} \quad \\ Given a sequence of temporal-switching graphs $\mathcal{G}^k(\mathcal{V},\mathcal{E}^k)$, a defined resource allocation budget $\Gamma^k$ per time step $k$, a total budget $\Gamma_{\text{tot}}$ and a cost $c_{i}$ associated with each node $i \in \mathcal{V}$, find the optimal spreading and recovery rates $\beta_{ij}^k$ and $\delta_{i}^k$ for $k=1, ..., K$ that via sparse resource allocation minimize an upper bound on the maximum risk $p_i^1\hat{x}_i^1$. This problem can be formulated as: \begin{align} \underset{p^k,\beta^k, \delta^k}{\text{minimize}} & \quad \text{max}(p_i^1\hat{x}_i^1) \label{eq:C0}\\ \text{such that} & \quad p^k \geq 0, \quad \alpha p^{k+1} A^k - p^{k} \leq -C, \label{eq:C1a}\\ & \quad 0 < \underline{\beta}_{ij}^k \leq \beta_{ij}^k \leq \overline{\beta}_{ij}^k, \ 0 < \underline{\delta}_{i}^k \leq \delta_{i}^k \leq \overline{\delta}_{i}^k < \overline{\Delta}, \label{eq:rCons} \\ & \quad \sum_{ij} f_{ij}\left(\beta_{ij}^k\right) + \sum_{i} g_{i}\left(\delta_{i}^k\right) \leq \Gamma^k, \label{eq:C2} \\ & \quad \sum^K_{k=1} \biggl(\sum_{ij} f_{ij}\left(\beta_{ij}^k\right) + \sum_{i} g_{i}\left(\delta_{i}^k\right)\biggr) \leq \Gamma_{\text{tot}}. \end{align} \end{prob} \begin{prob}[Risk-Constrained Resource Minimization] \label{prob:2} \quad \\ Find the optimal spreading and recovery rates $\beta_{ij}^k$ and $\delta_{i}^k$ for $k=1, ..., K$ that via sparse resource allocation minimize the amount of resources required, given an upper bound on the maximum risk $\gamma$, a sequence of temporal-switching graphs $\mathcal{G}^k(\mathcal{V},\mathcal{E}^k)$ and a cost $c_{i}$ for $i \in \mathcal{V}$. This problem can be formulated similarly to optimization Problem \ref{prob:1} except with the left-hand-side of \eqref{eq:C2} as an objective and a constraint $p_i^1\hat{x}_i^1 \leq \gamma$ for all $i$. \end{prob} This problem formulation can be extended by including surveillance scheduling and resource allocation on $\hat{x}_i^1$, see \cite{TCNS2021} for details. Note also that time $K \rightarrow \infty$ can be included, see Section \ref{subsec:Inf}, and we can replace \eqref{eq:C0} with $\sum_ip_i^1\hat{x}_i^1$ to bound overall risk. \section{Exponential Cone Programming} In this section we show that Problems \ref{prob:1} and \ref{prob:2} can be reformulated as convex optimization problems, in particular exponential cone programs. Furthermore, we discuss how the proposed resource model leads to sparse resource allocation. We define decision variables $y_i$ and $v_i$ for all nodes $i\in \mathcal{V}$, and $u_{ij}^k$ for all edges $(i,j)\in\mathcal E^k$. \begin{prop} \label{prop:1} Given that $h\overline{\Delta} < 1$, Problem \ref{prob:1} is equivalent to the following convex optimization problem under the transformations $y_i=\text{log}(p_i)$ and $u_{ij}=f_{ij}\left(\beta_{ij}\right)$ and $v_{i}=g_{i}\left(\overline{\Delta} - \delta_{i}\right)$ \begin{align} \underset{y^k, u^k, v^k}{\text{minimize}} & \quad \text{max}(\text{log}(\hat{x}_i^1)+ y_i^1) \label{eq:OF1}\\ \text{such that} & \quad \text{log} \Biggl (\sum_{i: (i,j)\in \mathcal E} \text{exp} \Biggl(y_{i}^{k+1} + \text{log}\left(\alpha h\overline{\beta}^k_{ij}\right) - \frac{u_{ij}^k}{w_{ij}} \nonumber\\ & \quad - y_{j}^k \Biggr) + \text{exp}\left(y_{j}^{k+1} + \text{log}\left(\alpha(1-h\overline{\Delta})\right) - y_{j}^k\right) \nonumber \\ & \quad + \text{exp}\left(y_{j}^{k+1}+ \text{log}\left(\alpha h(\overline{\Delta}-\underline{\delta})\right) - \frac{v_{i}^k}{w_{ii}} - y_{j}^k\right) \nonumber \\ & \quad + \text{exp}\left (\text{log}\left (c_{j}\right) - y_{j}^k\right) \Biggr) \leq 0 \quad \forall j, \label{eq:CNew} \\ & \quad 0 \leq u_{ij}^k \leq w_{ij}\text{log}\left (\frac{\overline{\beta}_{ij}^k}{ \underline{\beta}_{ij}^k}\right ), \label{eq:CB} \\ & \quad 0 \leq v_{i}^k \leq w_{ii}\text{log}\left (\frac{1-\underline{\delta}^k_{i}}{ 1-\overline{\delta}^k_{i}}\right ) ,\label{eq:CD} \\ & \quad \sum_{ij} u_{ij}^k + \sum_{i} v_{i}^k \leq \Gamma^k, \label{eq:C5} \\ & \quad \sum^K_{k=1} \biggl(\sum_{ij} u_{ij}^k + \sum_{i} v_{i}^k\biggr) \leq \Gamma_{\text{tot}} \label{eq:C6}. \end{align} \end{prop} \begin{pf} Similar to the proof of Proposition 2 in \cite{ACC2022}. \end{pf} \begin{prop} Given that $h\overline{\Delta} < 1$, Problem \ref{prob:2} is equivalent to a convex optimization problem under the transformations $y_i=\text{log}(p_i)$ and $u_{ij}=f_{ij}\left(\beta_{ij}\right)$ and $v_{i}=g_{i}\left(\overline{\Delta}- \delta_{i}\right)$. The formulation is the same as \eqref{eq:OF1} - \eqref{eq:C6} except that the objective is $\sum_{ij} u_{ij}^k + \sum_{i} v_{i}^k$ and in place of \eqref{eq:C5} we have the constraint $ \text{log}(\hat{x}_i^1)+ y_i^1 \leq \gamma$. \end{prop} \begin{pf} See \cite{ACC2022}. \end{pf} \subsection{Sparsity} \label{subsec:spars} A significant benefit of the proposed framework and exponential cone programming formulation is that it encourages sparse resource allocation. Our resource models, now formulated as constraints \eqref{eq:C5} and \eqref{eq:C6} are $\ell_{1}$ norm constraints and objectives, since $u_{ij}\geq 0$ and $v_i \geq 0$, which are known to encourage sparsity (e.g. \cite{Candes2008} and references therein). If the goal is maximal sparsity, i.e. minimal number of nodes and edges with non-zero resources allocated, then the reweighted $\ell_{1}$ optimization approach of \cite{Candes2008} can be used. We can include this in our model by iteratively solving our problem, but with a reweighted resource model that approximates the number of nodes and edges with non-zero allocation, e.g. \begin{equation} \label{eq:L1} \phi^q=\sum_{ij} \frac{u^{k^q}_{ij}}{u_{ij}^{k^{q-1}}+\epsilon}+\sum_{i} \frac{v^{k^q}_{i}}{v_{i}^{k^{q-1}}+\epsilon} \end{equation} where $q$ is the iteration number and $\epsilon$ a small positive constant to improve numerical stability. For Problem \ref{prob:1} we now replace \eqref{eq:C5} with $\phi^q \leq M$ where $M$ is the bound on the number of nodes and edges that can have resources allocated to them. Similarly for Problem \ref{prob:2} we replace the objective with \eqref{eq:L1}. This iterative approach can ignore previous budget bounds and has no guarantee of convergence or global optimality, but has been found to be effective in practice. \subsection{Infinite Time} \label{subsec:Inf} The proposed framework considers the scenario of a finite-time horizon optimization up to time step $K$, which makes sense given practical examples often have limited time (reliable) forecasts. Alternatively, the framework can easily be extended to include the cost as $K \rightarrow \infty$. The updated cost bounds (see Proposition \ref{prop:1}) can be found as follows. \begin{prop} Given an upperbound on future network changes, i.e. on future values of $A$, $A^K \geq A^k$ for all $k \geq K$, and suppose there exists a sequence of row vectors $p^k=[p_{1}^k,...,p_{n}^k], k = 1, ..., K$ which are elementwise non-negative: $p_i^k\ge 0 \,\, \forall\, i,k$, and for which inequality \eqref{eq:pk1} now holds for $k=1,...,K-1$ and \begin{equation} \label{eq:pK1} p^K \ge C+\alpha p^K A^{K} \geq C + \alpha p^K A^k, \end{equation} where the inequalities are understood to hold elementwise. Then $p^1x^1\ge J(x^1)$ as defined in \eqref{eq:JC}. \end{prop} \begin{pf} The second inequality in \eqref{eq:pK1} follows because $p$ is non-negative and $A^K \geq A^k$. In the proof of Proposition \ref{prop:1} we obtained \eqref{eq:vk1} from \eqref{eq:pk1} and similarly \eqref{eq:pK1} implies \begin{equation} V(x^k,K) \ge Cx^k+\alpha V(x^{k+1},K) \end{equation} for $k \ge K$. By telescoping sum we now obtain $ V(x^1,1) \ge \sum_{k=1}^L \alpha^kCx^k + V(x^L,K) $ for any $L\ge K$, and since $V(x^L,K)\ge 0$ and $L$ is arbitrarily large we have $ V(x^1,1) = p^1x^1 \ge \sum_{k=1}^\infty \alpha^kCx^k. $ \end{pf} Our optimization Problems \ref{prob:1} and \ref{prob:2} now use \eqref{eq:C1a} for $k=1,...,K-1$ and include the additional constraint \begin{equation} p^{K} (\alpha A^K-I) \le -C. \label{eq:DCK} \end{equation} For the corresponding convex formulation we refer to equation (21) in \cite{ACC2022}. \section{Results} In this section we demonstrate how our proposed optimization framework can be utilized to investigate resource allocation on temporal-switching networks. First, we discuss a 7-node example to illustrate the differences in resource allocation for assuming a static, average and temporal-switching network. Next, we show a periodic flight network and corresponding sparse flight reduction to reduce the risk of a known SARS outbreak. Finally, we present a wildfire example with changing wind forecast. \subsection{Small Influence Network} We, first, start with a small 7-node example as it is easier to visualize network sequence changes and impact on a small scale. In this particular example, we model the spread of misinformation and consider the influence graph $\mathcal{G}^k=(\mathcal{V},\mathcal{E}^k)$ with $n=7$ nodes as visualized for $k \geq K$ in Fig. \ref{fig:GraphAM1}. Here node $i=1$ has a high probability $\hat{x}_i^1$, indicated by node color, of starting this particular rumor and arrows indicate the direction of influence, e.g. node $i=1$ influences node 6, but not the other way around, while node 6 and 7 share (mis)information with each other. The actual influence network, however, changed over time $k\leq K$, with nodes making new connections or e.g. stopping to follow other nodes due to unwanted content. We take homogeneous spreading and recovery rates of $\beta_{ij}^k=0.35$ for all $(i,j) \in \mathcal{E}^k$ and $\delta_i=0.2$ for all $i \in \mathcal{V}$. Furthermore, we introduce a high cost node $i=7$ with $c_i=1$, as indicated by node marker size, where we don't want this rumor to end up due to potentially their connections to other larger media networks or vulnerability to misinformation (e.g. scams or anti-vaccine campaigns to elderly). \begin{figure}[!t] \centering \def1\linewidth{0.7\linewidth} \input{Influence.pdf_tex} \caption{Influence graph with $n=7$ nodes. Node color indicates outbreak probability $\hat{x}_i^1$, node marker size indicates cost $c_i$ with high cost node $i=7$.} \label{fig:GraphAM1} \end{figure} The goal is now to both stop the spread of this rumor and in particular to protect the high cost node $i=7$. The impact of rumors and misinformation can be reduced by `truth campaigns', i.e. increasing awareness or recovery rate $\delta$, and by blocking incoming `risky' content, i.e. reducing the incoming spreading rate $\beta$ (\cite{zareie2021minimizing}). We model this simultaneously where targeted nodes have both increased recovery rate and reduced spreading rate. Setting $\overline{\Delta}=1$, $\alpha=0.93$, $h=0.24$ and $\Gamma^k=1.5$ for all $k$ with $K=4$, we first solve Problem 2. Next, to emphasize sparsity and difference in outcomes, we use the reweighted $\ell_1$ minimization approach, see Section \ref{subsec:spars}, by keeping the risk bound but minimizing the number of non-zero allocations. We want to compare targeted nodes for different assumptions in speed of the network changes compared to the rumor spreading. Leaving all spread and model parameters the same, we now consider the scenarios of 1) static graph, 2) temporal-switching graph with $K \rightarrow \infty$ and 3) an average graph. The results are displayed in respectively Fig. \ref{fig:03}, \ref{fig:KRA}, and \ref{fig:AverageRA}. It can be seen that the awareness or anti-rumor campaign strategy differs quite a bit depending on the assumptions made on the speed of the network changes and stresses the importance of taking into account the temporal character. All temporal strategies start with targeting node $i=7$ compared to node 1 for the static approach due to knowledge of the changes in influence. Strategies after $k=1$ differ due to different assumptions in speed and knowledge of the network changes and duration. \begin{figure} \centering \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INStatic1.pdf_tex} \caption{k=1} \label{fig:031} \end{subfigure} ~ \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INStatic2.pdf_tex} \caption{k=2} \label{fig:032} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INStatic3.pdf_tex} \caption{k=3} \label{fig:033} \end{subfigure} ~ \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INStatic4.pdf_tex} \caption{k=K} \label{fig:034} \end{subfigure} \caption{Anti-rumor strategy using a \emph{static} network with $h=0.24$, $\alpha=0.93$. Node color indicates nodes targeted.} \label{fig:03} \end{figure} \begin{figure} \centering \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INSeq1.pdf_tex} \caption{k=1} \label{fig:031} \end{subfigure} ~ \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INSeq2.pdf_tex} \caption{k=2} \label{fig:032} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INSeq3.pdf_tex} \caption{k=3} \label{fig:033} \end{subfigure} ~ \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INSeq4.pdf_tex} \caption{k=K} \label{fig:034} \end{subfigure} \caption{Anti-rumor strategy for a \emph{temporal-switching} network sequence with $h=0.24$, $\alpha=0.93$.} \label{fig:KRA} \end{figure} \begin{figure} \centering \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INAverage1.pdf_tex} \caption{k=1} \label{fig:031} \end{subfigure} ~ \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INAverage2.pdf_tex} \caption{k=2} \label{fig:032} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INAverage3.pdf_tex} \caption{k=3} \label{fig:033} \end{subfigure} ~ \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INAverage4.pdf_tex} \caption{k=K} \label{fig:034} \end{subfigure} \caption{Target strategy of the \emph{average} graph of Fig. \ref{fig:KRA}. } \label{fig:AverageRA} \end{figure} \subsection{US Air Network} Next, we consider a periodic domestic US air transportation network graph based on the amount of passengers transported in 2014 from \cite{USdata} modified to a periodic flight schedule consisting of $n=359$ nodes and 514 - 2097 edges based on the flight day as visualized in Fig. \ref{fig:USGraph}. All domestic air traffic within the US excluding Puerto Rico, Virgin Islands and Guam is considered, where multiple airports that serve the same city are combined, and routes that have less than 10,000 passengers carried per year are omitted. Number of flight days is determined based on passengers transported and routes are divided into respectively 2, 3, 4 or 7 flight days a week to create a periodic schedule and network graph. \begin{figure} \centering \def1\linewidth{0.77\linewidth} \input{USPeriodic.pdf_tex} \caption{Periodic US air transportation network with 359 nodes and 514 - 2097 edges based on \cite{USdata}. Edge color indicates the number of flight days per week with dark blue indicating routes that are flown at least daily. Node marker size indicates cost $c_i$ and node color indicates outbreak probability $\hat{x}_i^1$.} \label{fig:USGraph} \end{figure} We now model an outbreak of SARS in Philadelphia. Spreading parameters are based on \cite{chowell2004model} and we take a spreading rate of $\beta=0.25$ per day and a recovery rate of $\delta=0.0631$. The spreading rate $\beta_{ij}$ can now be controlled by reducing passenger numbers and flights on particular routes. Furthermore, we take a cost $c_i$ based on the normalized number of passengers served per airport to represent the impact of the disease reaching a given city node. We now set a daily budget of $\Gamma^k=5$, with an overall budget of $\Gamma_{\text{tot}}=25$, $h=0.02$ and $\alpha=0.9$, and obtain the daily reduced schedules as visualized in Fig. \ref{fig:USRA}. Passengers numbers are reduced on respectively 13, 18, 18, 19, and 19 routes for the first 5 days, using the maximum budget in the first time steps to maximally oppress the outbreak. \begin{figure*} \centering \begin{subfigure}[b]{0.3\linewidth} \def1\linewidth{1\linewidth} \input{Sunday.pdf_tex} \caption{Sunday} \label{fig:031} \end{subfigure} \begin{subfigure}[b]{0.3\linewidth} \def1\linewidth{1\linewidth} \input{Monday.pdf_tex} \caption{Monday} \label{fig:032} \end{subfigure} \begin{subfigure}[b]{0.3\linewidth} \def1\linewidth{1\linewidth} \input{Tuesday.pdf_tex} \caption{Tuesday} \label{fig:032} \end{subfigure} \begin{subfigure}[b]{0.3\linewidth} \def1\linewidth{1\linewidth} \input{Wednesday.pdf_tex} \caption{Wednesday} \label{fig:033} \end{subfigure} \begin{subfigure}[b]{0.3\linewidth} \def1\linewidth{1\linewidth} \input{Thursday.pdf_tex} \caption{Thursday} \label{fig:034} \end{subfigure} \begin{subfigure}[b]{0.3\linewidth} \def1\linewidth{1\linewidth} \input{Friday.pdf_tex} \caption{Friday, Saturday} \label{fig:032} \end{subfigure} \caption{Daily reduction of passenger numbers on respectively 13, 18, 18, 19, 19, 0 and 0 routes for $\Gamma^k=5$ and $\Gamma_{\text{tot}}=25$ to repress an outbreak in Philadelphia.} \label{fig:USRA} \end{figure*} \subsection{Wildfire Example} Let us consider the fictional landscape given in Fig. \ref{fig:Landscape} consisting of different vegetation types, a city and water. We represent this landscape as a temporal graph $\mathcal{G}^k (\mathcal{V},\mathcal{E}^k)$ with $n=1000$ nodes, where the edge set $\mathcal{E}^k$ connects each node to its neighboring 8 nodes, i.e. fire can spread horizontally, vertically and diagonally, but the spreading values associated with each edge can change each time step in line with changing weather conditions and forecasts. Besides weather forecast, the spreading rates are determined by the vegetation type following \cite{Karafyllidis1997a} and \cite{Alexandridis2008a}, where $\beta=\beta_{b}\beta_{veg}\beta_{w}$, consists of the baseline spreading rate $\beta_{b}=0.5$, the vegetation factor $ \beta_{veg}=0, 0.1, 1$ and $1.4$ for respectively water, desert, grassland and eucalypt forest and the weather effect $\beta_{w}$. Finally, the spreading rate is corrected for the spread between diagonally connected nodes. We set the recovery rate $\delta=0.5$ for all nodes $i \in \mathcal{V}$. \begin{figure} \centering \begin{subfigure}[b]{0.85\linewidth} \def1\linewidth{1\textwidth} \includegraphics[width=1\linewidth]{Ex3N.png} \caption{Vegetation Map} \label{fig:Landscape} \end{subfigure} \begin{subfigure}[b]{0.85\linewidth} \def1\linewidth{0.79\textwidth} \input{Ex2L.pdf_tex} \caption{Outbreak Probability} \label{fig:LM} \end{subfigure} \caption{Fictional landscape with different area types, represented as a grid with $n=1000$ nodes with its corresponding estimated outbreak probability $\hat{x}_i^1$.} \label{fig:53} \end{figure} Next, we take the cost $c_i=1$ for the city nodes with $c_i=0.001$ elsewhere and outbreak probability $\hat{x}_{i}^1$ as depicted in Fig. \ref{fig:LM}. This could reflect a higher cost due to risk of human life and property and higher outbreak probability of fires near roads. We now assume the following weather forecast. At time step $k=1$; no wind, $k=2$ northeasterly wind of $V=4$ m/s, midway time step $k=3$ this changes to a southerly wind of $V=8$ m/s which is predicted to stay for at least another 2 time steps. Hence, in order to model this we can take the average graph of the two wind conditions for $k=3$. Setting $\Gamma^k=10$, $h=0.25$, $\alpha=0.9$, we obtain the results illustrated in Fig. \ref{fig:FireRA}. The accumulated amount of resources are shown, where the new resources added per time step have a thicker line width and previous resources added a higher transparency. It can be seen that effectively a protective layer is created around the city following the forecast. First, with no wind and northeasterly wind coming up, resources are allocated to the north and east, afterwards the city is prepared for the incoming southerly wind with more resources allocated to the south to protect the city from higher spread from those areas. \begin{figure*} \centering \begin{subfigure}[b]{0.3\linewidth} \def1\linewidth{1\linewidth} \input{Fire1.pdf_tex} \caption{k=1} \label{fig:031} \end{subfigure} \begin{subfigure}[b]{0.3\linewidth} \def1\linewidth{1\linewidth} \input{Fire2.pdf_tex} \caption{k=2} \label{fig:032} \end{subfigure} \begin{subfigure}[b]{0.3\linewidth} \def1\linewidth{1\linewidth} \input{Fire3.pdf_tex} \caption{k=3} \label{fig:032} \end{subfigure} \caption{Resource allocation for the scenario in Fig. \ref{fig:53} with $\Gamma^k=10$, $h=0.25$ and $\alpha=0.9$ for a forecast with no wind at k=1, a northeasterly wind of $V=4$ m/s at k=2, changing to a 8 m/s southerly wind midway step k=3.} \label{fig:FireRA} \end{figure*} Scalability of the proposed convex optimization program was investigated in \cite{TCNS2021,ACC2022} and solver time was found to be linear in both number of nodes and time-steps. For the dynamic variation, similar run times were found. \section{Introduction} Spreading processes have become an influential part of our daily lives. From epidemics (\cite{Nowzari2016}), computer viruses (\cite{Bloem2008} to wildfires (\cite{Karafyllidis1997a}) and misinformation (\cite{zareie2021minimizing}), if not properly monitored and controlled, they can have a disastrous impact and pose a significant threat. This has stressed the importance and current limitation of methods to reduce their risk with appropriate intervention strategies. What these processes or `threats' have in common, is that they can all be modeled as a process with an initial outbreak that spreads rapidly throughout a network. The natural and social networks these processes typically evolve on, e.g. global contact and travel networks for epidemics, large geographic areas for wildfires, social media or the internet for computer viruses and misinformation, have two important and challenging aspects associated with them. First of all, they are often temporal in nature, i.e. interactions or the connectivity of the network change over time, and second, they evolve on a large scale. This implies it can be difficult or even impossible to deliver resources everywhere quickly across the whole network, such as vaccines for epidemics or waterbombing allocations for wildfires. Therefore, sparse, budgeted and dynamic allocation of resource solutions is important. Spreading processes are commonly modeled as Markov processes. The most well-known models are the Susceptible-Infected-Susceptible (SIS) model and the Susceptible-Infected-Removed (SIR) model as proposed by \cite{kermark1927contributions} and \cite{bailey1975mathematical}. These stochastic models can be approximated as ordinary differential equation (ODE) models, which can in turn be approximated by linear models (\cite{Ahn2013}). This is proven by \cite{VanMieghem:2009} to be an upper bound and is, therefore, usually the object of study. The problems of minimizing the spreading rate by removing either a fixed number of links or nodes in the network are both NP-hard as discussed in \cite{van2011decreasing}. This could be overcome by heuristics methods, but besides their optimality compromises, the strategy of complete link or node removal is often unrealistic. A more realistic assumption is that spreading rate can be decreased or the recovery rate increased by applying resources to the nodes and links. Various methods have been proposed in which this resource allocation is subject to budget constraints (e.g. see \cite{Nowzari2016,Bloem2008,DiGiamberardino2019,Torres2017,Preciado2014,Zhang2018,Nowzari2017}). However, all these methods consider static control of static networks. That is, the resource allocation is determined based on the current state of the network instead of taking into account the time-varying nature of the network. A more realistic approach would be to have time-dependent intervention for temporal networks. Temporarility also implies that the time-varying nature of the spreading variables can be investigated. For example, changing weather conditions for wildfires and varying spreading and recovery rates as different variants emerge or new treatments are developed for epidemics. Furthermore, behavioral changes, growing contact networks or additional external influences can be taken into account by varying the network structure and parameters, which is a step towards a more complete system as indicated in \cite{zino2021analysis}. Furthermore, in \cite{speidel2017epidemic} is stressed that ignoring the temporally-varying nature of networks may underestimate endemicity. Dynamic resource allocation for epidemics on static networks is studied in \cite{drakopoulos2017network} and \cite{scaman2016suppressing}. Here network properties are identified to respectively identify limitations on and derive upper and lower bounds for epidemic extinction time. More recently, dynamic programming (\cite{bertsekas2000dynamic}) and in particular, model predictive control (MPC) has been proposed for time dependent intervention (\cite{kohler2018dynamic,watkins2019robust,Selley2015}). One method to deal with dynamic networks is by using a time-scale separation. Here the assumption is made that the network dynamics and spreading process evolve on different time-scales, i.e. one process is much faster than the other. In the case of the spreading process being faster, a static network can be used as the changing network structure won't affect the resource allocation and spread. If, on the other hand, the network dynamics are changing faster, we encounter the annealed regime and an `average network' can be used (\cite{zino2021analysis}). A method that overcomes this time-scale separation assumption are temporal-switching networks. Temporal-switching networks use a sequence of static networks to model the temporal behavior. They were first proposed in \cite{prakash2010virus} for deterministic models, where the epidemic threshold is investigated. In \cite{sanatkar2015epidemic} this is further extended to include the upper bound for epidemic spread and conditions for stability for arbitrarily switching networks. \cite{valdano2015analytical} extend this to continuous time, where the threshold is related to time of observation. In \cite{pare2015stability,pare2017epidemic} stability analysis of heterogeneous epidemic processes on time-varying networks is investigated and conditions for global exponential stability and convergence to the disease-free equilibrium are provided. \citet{gracy2020analysis} provide a distributed control strategy by defining conditions for stability and exponential convergence to the disease-free equilibrium. A solution, using geometric programming techniques for control of time-varying networks is given in \cite{Nowzari2016b}. None of these approaches, however, consider sparse, targeted resource allocation to bound the risk. An exception regarding sparsity being the approach taken in \citet{Rev2R2}, where the authors utilize the reweighted $\ell_1$ optimization approach to solve an antidote problem for a multi-competitive virus model. This approach, however, has no guarantee of global optimality. In this paper, we therefore, present a framework for dynamic, sparse resource allocation on time-varying networks for control of spreading processes. This framework builds on work presented in \cite{ACC2022}, where we presented a multi-stage sparse resource allocation method for static networks. The presented framework distinguishes itself by extending this work to temporal-switching networks and hence, overcoming the shortcomings of the assumption of a static network. \section{Model and Problem Formulation} \subsection{SIS Spreading Process Model} We study a spreading process on a time-varying graph $\mathcal{G}(t)$ with $n$ nodes in node set $\mathcal{V}$ and time-variant edge set $\mathcal{E}(t)$. Now, each node $i \in \{1, 2, ..., n\} \in \mathcal{V}$ has a state $X_i(t)$ associated with it. We consider the basic SIS model by \cite{kermark1927contributions} in which a node can be in two states: infected, i.e. $X_i(t)=1$, or susceptible to infection from neighboring nodes, i.e. $X_i(t)=0$. An infected node recovers with probability $\delta_{i}\Delta t$ to $X_i(t+\Delta t)=0$ and the process spreads from infected node $j$ to susceptible node $i$ with probability $\beta_{ij} \Delta t$, where $\Delta t$ is a small time interval. Due to the time-varying nature of our spreading process and network, we extend this further by allowing $\beta_{ij}(t)$ and $\delta_i(t)$ to change over time. We now define $x_{i}(t)=E(X_{i}(t))=P(X_{i}(t)=1)$ as the probability of a node $i$ being infected at time $t$. Following \cite{Preciado2014}, with a mean-field approximation, $n$ coupled nonlinear differential equations are obtained: \begin{equation} \label{eq:nonL} \dot{x}_{i}=(1-x_{i}(t))\sum^{n}_{j=1}\beta_{ij}(t)x_{j}(t)-\delta_{i}(t)x_{i}(t). \end{equation} By applying Euler's forward approximation to \eqref{eq:nonL}, see \cite{pare2020modeling}, we obtain the following discrete time model approximation \begin{equation} \label{eq:disnonL} x_{i}^{k+1}=x_i^k + h(1-x_{i}^k)\sum^{n}_{j=1}\beta^k_{ij}x_{j}^k-h\delta^k_{i}x_{i}^k \end{equation} where $h= t^{k+1}-t^k$ is the length of each time interval $[t^k, t^{k+1}]$. Given $h\delta^k \leq 1$ and $h\sum^{n}_{j=1}\beta^k_{ij}<1 \,\, \forall\, k$, this model is well-defined at $x_i^1\in[0,1] \Rightarrow x_i^k\in[0,1] \,\, \forall\, k$. By linearizing around the infection-free equilibrium point ($x_i=0 \,\, \forall\, i$) we obtain \begin{equation} \label{eq:disL} x^{k+1}=A^kx^k \end{equation} where $x^k=[x_{1}^k,...,x_{n}^k]^{T}$ is the state of the system and $A^k$ the sparse state matrix consisting of elements \begin{equation} \label{eq:epi} a_{ij}^k = \begin{cases} 1-h\delta_{i}^k \ge 0 &\quad \text{if}\quad i=j, \\ h\beta_{ij}^k \ge 0&\quad \text{if}\quad i\neq j, (i,j) \in \mathcal{E}^k, \\ 0 &\quad \text{otherwise}. \end {cases} \end{equation} Note that the state matrix $A^k$ changes each time step due to both changes in spreading parameters $\beta^k_{ij}$, $\delta_i^k$ and due to changes in network structure, i.e. in $\mathcal{E}^k$. Hence, we have obtained a system that can take a sequence of temporal-switching graphs $\mathcal{G}^k(\mathcal{V},\mathcal{E}^k)$ as input. Furthermore, we remark that \eqref{eq:disL} is a positive system as described in \cite{berman1994nonnegative}, i.e. if $x^1_i\ge 0$ for all $i$, then $x^i_k\ge 0$ for all $i$ and all $k\ge 0$. \subsection{Cost function} The aim is to reduce and bound the risk of the spreading system on the temporal-graph described in the previous section. In order to achieve this, we assume a finite-time horizon forecast and optimization up to time $K$ and associate the following cost function with the system \begin{equation} \label{eq:JC} J(x^1) = \sum_{k=1}^K \alpha^kCx^k \end{equation} where $x^k=[x_{1}^k,...,x_{n}^k]^{T}$ is the state of the system and $C= [c_1, ..., c_n]$ is a row vector defining the cost at time $k$ associated with each node $i$, with each $c_i\ge 0$. We include a discount factor $\alpha\in(0,1]$ which can be tuned to emphasize near-term cost over long-term cost. Note that the cost for $K \rightarrow \infty$ can also be taken into account as further explained in Section \ref{subsec:Inf}. We can now formulate bounds on the cost \eqref{eq:JC} based on the linear model \eqref{eq:disL} and demonstrate it also bounds the costs of the nonlinear model \eqref{eq:disnonL}. Positive systems with non-negative linear costs admit linear value, or cost-to-go, functions, see e.g. \cite{berman1994nonnegative, briat2013robust, rantzer2015scalable}, and we will use a variation of this argument to construct bounds via a dynamic-programming-like formulation. % \begin{prop}\label{prop1} Suppose there exists a sequence of row vectors $p^k=[p_{1}^k,...,p_{n}^k], k = 1, ..., K$ which are elementwise non-negative: $p_i^k\ge 0 \,\, \forall\, i,k$, and for which the following inequality holds: \begin{equation} \label{eq:pk1} p^k \ge C+\alpha p^{k+1}A^{k} \end{equation} where the inequalities are understood to hold elementwise. Then $p^1x^1\ge J(x^1)$ as defined in \eqref{eq:JC}. \end{prop} \begin{pf} We first show that $V(x,k) = p^kx^k$ provides an upper bound on the cost-to-go from state $x$ at time $k$ for the linear system \eqref{eq:disL}. Since $x_i^k\ge 0 \,\, \forall\, i,k$, inequality \eqref{eq:pk1} implies $ p^kx^k \ge Cx^k+\alpha p^{k+1}A^{k}x^k. $ Using $V(x,k) = p^kx^k$, we obtain \begin{equation} \label{eq:vk1} V(x^k,k) \ge Cx^k+\alpha V(x^{k+1},k+1). \end{equation} By telescoping sum we obtain $ V(x^1,1) \ge \sum_{k=1}^K \alpha^kCx^k + V(x^K,K+1) $ and since $V(x^K,K+1)\ge 0$ we have $ V(x^1,1) = p^1x^1 \ge \sum_{k=1}^K \alpha^kCx^k. $ To demonstrate this also bounds the cost for the nonlinear system \eqref{eq:disnonL}, we note that for any $x^k$ with elements in $[0,1]$, $x^{k+1}\ge A^kx^k$ where $x^{k+1}$ is evaluated according to \eqref{eq:disnonL}, i.e. solutions of the linear system upper bound (elementwise) those of the nonlinear system from the same initial conditions. Because the cost vector $C$ is positive, this further implies that the cost obtained with the linear system upper bounds that with the nonlinear system. \end{pf} To go from these cost bounds to a model of risk, we note that we can bound the expected cost $E[J(x^1)]$ via a linear function of the expected value of the initial state $\hat x^1$. Because we have $J(x^1) \le p^1x^1$ for any $x^1$, it follows that $E[J(x^1)] \le E[p^1x^1] = p^1 E[x^1]=p^1\hat x^1$. We, therefore, define the risk associated with each state as \begin{equation} \label{eq:Risk2} R_i=p_i^1\hat{x}_i^1. \end{equation} Both the overall risk $\sum_i R_i=p^1\hat x^1$ and the maximum risk or `worst-case' expected impact of an outbreak $\max_{i}(R_{i})$ can be considered. \subsection{Resource Allocation Model} In order to reduce the overall cost and risk involved, we now investigate the inclusion of sparse, budgeted resources at each time step $k$ to our model. We consider allocation of resources to both the edges, to reduce spreading rates $\beta_{ij}$, and to the nodes, i.e. to increase recovery rates $\delta_{i}$. In order to achieve this, we assume bounded ranges of possible spreading and recovery rates for $k=1,...,K$: \begin{equation} \label{eq:bounds2} 0 < \underline{\beta}_{ij}^k \leq \beta_{ij}^k \leq \overline{\beta}_{ij}^k, \quad 0 < \underline{\delta}_{i}^k \leq \delta_{i}^k \leq \overline{\delta}_{i}^k<\overline{\Delta}. \end{equation} Here $\overline{\beta}_{ij}^1$ and $ \underline{\delta}_{i}^1 $ are the unmodified rates of the system \eqref{eq:disnonL}. For $k>1$, $\overline{\beta}_{ij}^k$ and $ \underline{\delta}_{i}^k $ are the updated rates of the system given the unmodified rates associated with time step $k$ with the inclusion of resource allocation up to the current time step. That is, in our model, changes made at a particular time step persist for all future times. This implies that our state matrix $A^k$ now changes each time step not only due to the time-varying nature of the graph as set out in \eqref{eq:epi}, but also due to inclusion of resource allocation on $\beta_{ij}$ and $\delta_i$ up to time $k$. Note that the framework can easily be modified to include interventions with a fixed duration or those that diminish over time. We now propose the following resource model defined by: \begin{align} f_{ij}\left(\beta_{ij}^k\right)&=w_{ij}^k\text{log}\left(\frac{\overline{\beta}^k_{ij}}{\beta_{ij}^k}\right) \nonumber \\ g_{i}\left(\overline{\Delta}-\delta_{i}^k\right)&=w_{ii}^k\text{log}\left(\frac{\overline{\Delta}-\underline{\delta}^k_{i}}{\overline{\Delta}-\delta_{i}^k}\right) \label{eq:RM} \end{align} where $w_{ij}$ are weightings expressing the cost of respectively reducing $\beta_{ij}$ and increasing $\delta_{i}$ at time $k$. These resource models can be understood as that a certain proportional increase (for $\beta_{ij}$) and decrease (for $\delta_i$) always have the same cost. Note that it is impossible for $\beta_{ij}$ to be reduced to $0$ since that would take infinite resources. More importantly, these resource models encourage sparsity as detailed further in Section \ref{subsec:spars}. We refer to \cite{LCSS2021} for a more in-depth discussion of this type of logarithmic resource allocation. \subsection{Problem Statements} The goal is to bound both the risk of an outbreak and the amount of resources required while adhering to the time-varying network structure. Therefore, we study two closely related problems of dynamic resource allocation for spreading processes on temporal-switching graphs. \begin{prob}[Resource-Constrained Risk Minimization] \label{prob:1} \quad \\ Given a sequence of temporal-switching graphs $\mathcal{G}^k(\mathcal{V},\mathcal{E}^k)$, a defined resource allocation budget $\Gamma^k$ per time step $k$, a total budget $\Gamma_{\text{tot}}$ and a cost $c_{i}$ associated with each node $i \in \mathcal{V}$, find the optimal spreading and recovery rates $\beta_{ij}^k$ and $\delta_{i}^k$ for $k=1, ..., K$ that via sparse resource allocation minimize an upper bound on the maximum risk $p_i^1\hat{x}_i^1$. This problem can be formulated as: \begin{align} \underset{p^k,\beta^k, \delta^k}{\text{minimize}} & \quad \text{max}(p_i^1\hat{x}_i^1) \label{eq:C0}\\ \text{such that} & \quad p^k \geq 0, \quad \alpha p^{k+1} A^k - p^{k} \leq -C, \label{eq:C1a}\\ & \quad 0 < \underline{\beta}_{ij}^k \leq \beta_{ij}^k \leq \overline{\beta}_{ij}^k, \ 0 < \underline{\delta}_{i}^k \leq \delta_{i}^k \leq \overline{\delta}_{i}^k < \overline{\Delta}, \label{eq:rCons} \\ & \quad \sum_{ij} f_{ij}\left(\beta_{ij}^k\right) + \sum_{i} g_{i}\left(\delta_{i}^k\right) \leq \Gamma^k, \label{eq:C2} \\ & \quad \sum^K_{k=1} \biggl(\sum_{ij} f_{ij}\left(\beta_{ij}^k\right) + \sum_{i} g_{i}\left(\delta_{i}^k\right)\biggr) \leq \Gamma_{\text{tot}}. \end{align} \end{prob} \begin{prob}[Risk-Constrained Resource Minimization] \label{prob:2} \quad \\ Find the optimal spreading and recovery rates $\beta_{ij}^k$ and $\delta_{i}^k$ for $k=1, ..., K$ that via sparse resource allocation minimize the amount of resources required, given an upper bound on the maximum risk $\gamma$, a sequence of temporal-switching graphs $\mathcal{G}^k(\mathcal{V},\mathcal{E}^k)$ and a cost $c_{i}$ for $i \in \mathcal{V}$. This problem can be formulated similarly to optimization Problem \ref{prob:1} except with the left-hand-side of \eqref{eq:C2} as an objective and a constraint $p_i^1\hat{x}_i^1 \leq \gamma$ for all $i$. \end{prob} This problem formulation can be extended by including surveillance scheduling and resource allocation on $\hat{x}_i^1$, see \cite{TCNS2021} for details. Note also that time $K \rightarrow \infty$ can be included, see Section \ref{subsec:Inf}, and we can replace \eqref{eq:C0} with $\sum_ip_i^1\hat{x}_i^1$ to bound overall risk. \section{Exponential Cone Programming} In this section we show that Problems \ref{prob:1} and \ref{prob:2} can be reformulated as convex optimization problems, in particular exponential cone programs. Furthermore, we discuss how the proposed resource model leads to sparse resource allocation. We define decision variables $y_i$ and $v_i$ for all nodes $i\in \mathcal{V}$, and $u_{ij}^k$ for all edges $(i,j)\in\mathcal E^k$. \begin{prop} \label{prop:1} Given that $h\overline{\Delta} < 1$, Problem \ref{prob:1} is equivalent to the following convex optimization problem under the transformations $y_i=\text{log}(p_i)$ and $u_{ij}=f_{ij}\left(\beta_{ij}\right)$ and $v_{i}=g_{i}\left(\overline{\Delta} - \delta_{i}\right)$ \begin{align} \underset{y^k, u^k, v^k}{\text{minimize}} & \quad \text{max}(\text{log}(\hat{x}_i^1)+ y_i^1) \label{eq:OF1}\\ \text{such that} & \quad \text{log} \Biggl (\sum_{i: (i,j)\in \mathcal E} \text{exp} \Biggl(y_{i}^{k+1} + \text{log}\left(\alpha h\overline{\beta}^k_{ij}\right) - \frac{u_{ij}^k}{w_{ij}} \nonumber\\ & \quad - y_{j}^k \Biggr) + \text{exp}\left(y_{j}^{k+1} + \text{log}\left(\alpha(1-h\overline{\Delta})\right) - y_{j}^k\right) \nonumber \\ & \quad + \text{exp}\left(y_{j}^{k+1}+ \text{log}\left(\alpha h(\overline{\Delta}-\underline{\delta})\right) - \frac{v_{i}^k}{w_{ii}} - y_{j}^k\right) \nonumber \\ & \quad + \text{exp}\left (\text{log}\left (c_{j}\right) - y_{j}^k\right) \Biggr) \leq 0 \quad \forall j, \label{eq:CNew} \\ & \quad 0 \leq u_{ij}^k \leq w_{ij}\text{log}\left (\frac{\overline{\beta}_{ij}^k}{ \underline{\beta}_{ij}^k}\right ), \label{eq:CB} \\ & \quad 0 \leq v_{i}^k \leq w_{ii}\text{log}\left (\frac{1-\underline{\delta}^k_{i}}{ 1-\overline{\delta}^k_{i}}\right ) ,\label{eq:CD} \\ & \quad \sum_{ij} u_{ij}^k + \sum_{i} v_{i}^k \leq \Gamma^k, \label{eq:C5} \\ & \quad \sum^K_{k=1} \biggl(\sum_{ij} u_{ij}^k + \sum_{i} v_{i}^k\biggr) \leq \Gamma_{\text{tot}} \label{eq:C6}. \end{align} \end{prop} \begin{pf} Similar to the proof of Proposition 2 in \cite{ACC2022}. \end{pf} \begin{prop} Given that $h\overline{\Delta} < 1$, Problem \ref{prob:2} is equivalent to a convex optimization problem under the transformations $y_i=\text{log}(p_i)$ and $u_{ij}=f_{ij}\left(\beta_{ij}\right)$ and $v_{i}=g_{i}\left(\overline{\Delta}- \delta_{i}\right)$. The formulation is the same as \eqref{eq:OF1} - \eqref{eq:C6} except that the objective is $\sum_{ij} u_{ij}^k + \sum_{i} v_{i}^k$ and in place of \eqref{eq:C5} we have the constraint $ \text{log}(\hat{x}_i^1)+ y_i^1 \leq \gamma$. \end{prop} \begin{pf} See \cite{ACC2022}. \end{pf} \subsection{Sparsity} \label{subsec:spars} A significant benefit of the proposed framework and exponential cone programming formulation is that it encourages sparse resource allocation. Our resource models, now formulated as constraints \eqref{eq:C5} and \eqref{eq:C6} are $\ell_{1}$ norm constraints and objectives, since $u_{ij}\geq 0$ and $v_i \geq 0$, which are known to encourage sparsity (e.g. \cite{Candes2008} and references therein). If the goal is maximal sparsity, i.e. minimal number of nodes and edges with non-zero resources allocated, then the reweighted $\ell_{1}$ optimization approach of \cite{Candes2008} can be used. We can include this in our model by iteratively solving our problem, but with a reweighted resource model that approximates the number of nodes and edges with non-zero allocation, e.g. \begin{equation} \label{eq:L1} \phi^q=\sum_{ij} \frac{u^{k^q}_{ij}}{u_{ij}^{k^{q-1}}+\epsilon}+\sum_{i} \frac{v^{k^q}_{i}}{v_{i}^{k^{q-1}}+\epsilon} \end{equation} where $q$ is the iteration number and $\epsilon$ a small positive constant to improve numerical stability. For Problem \ref{prob:1} we now replace \eqref{eq:C5} with $\phi^q \leq M$ where $M$ is the bound on the number of nodes and edges that can have resources allocated to them. Similarly for Problem \ref{prob:2} we replace the objective with \eqref{eq:L1}. This iterative approach can ignore previous budget bounds and has no guarantee of convergence or global optimality, but has been found to be effective in practice. \subsection{Infinite Time} \label{subsec:Inf} The proposed framework considers the scenario of a finite-time horizon optimization up to time step $K$, which makes sense given practical examples often have limited time (reliable) forecasts. Alternatively, the framework can easily be extended to include the cost as $K \rightarrow \infty$. The updated cost bounds (see Proposition \ref{prop:1}) can be found as follows. \begin{prop} Given an upperbound on future network changes, i.e. on future values of $A$, $A^K \geq A^k$ for all $k \geq K$, and suppose there exists a sequence of row vectors $p^k=[p_{1}^k,...,p_{n}^k], k = 1, ..., K$ which are elementwise non-negative: $p_i^k\ge 0 \,\, \forall\, i,k$, and for which inequality \eqref{eq:pk1} now holds for $k=1,...,K-1$ and \begin{equation} \label{eq:pK1} p^K \ge C+\alpha p^K A^{K} \geq C + \alpha p^K A^k, \end{equation} where the inequalities are understood to hold elementwise. Then $p^1x^1\ge J(x^1)$ as defined in \eqref{eq:JC}. \end{prop} \begin{pf} The second inequality in \eqref{eq:pK1} follows because $p$ is non-negative and $A^K \geq A^k$. In the proof of Proposition \ref{prop:1} we obtained \eqref{eq:vk1} from \eqref{eq:pk1} and similarly \eqref{eq:pK1} implies \begin{equation} V(x^k,K) \ge Cx^k+\alpha V(x^{k+1},K) \end{equation} for $k \ge K$. By telescoping sum we now obtain $ V(x^1,1) \ge \sum_{k=1}^L \alpha^kCx^k + V(x^L,K) $ for any $L\ge K$, and since $V(x^L,K)\ge 0$ and $L$ is arbitrarily large we have $ V(x^1,1) = p^1x^1 \ge \sum_{k=1}^\infty \alpha^kCx^k. $ \end{pf} Our optimization Problems \ref{prob:1} and \ref{prob:2} now use \eqref{eq:C1a} for $k=1,...,K-1$ and include the additional constraint \begin{equation} p^{K} (\alpha A^K-I) \le -C. \label{eq:DCK} \end{equation} For the corresponding convex formulation we refer to equation (21) in \cite{ACC2022}. \section{Results} In this section we demonstrate how our proposed optimization framework can be utilized to investigate resource allocation on temporal-switching networks. First, we discuss a 7-node example to illustrate the differences in resource allocation for assuming a static, average and temporal-switching network. Next, we show a periodic flight network and corresponding sparse flight reduction to reduce the risk of a known SARS outbreak. Finally, we present a wildfire example with changing wind forecast. \subsection{Small Influence Network} We, first, start with a small 7-node example as it is easier to visualize network sequence changes and impact on a small scale. In this particular example, we model the spread of misinformation and consider the influence graph $\mathcal{G}^k=(\mathcal{V},\mathcal{E}^k)$ with $n=7$ nodes as visualized for $k \geq K$ in Fig. \ref{fig:GraphAM1}. Here node $i=1$ has a high probability $\hat{x}_i^1$, indicated by node color, of starting this particular rumor and arrows indicate the direction of influence, e.g. node $i=1$ influences node 6, but not the other way around, while node 6 and 7 share (mis)information with each other. The actual influence network, however, changed over time $k\leq K$, with nodes making new connections or e.g. stopping to follow other nodes due to unwanted content. We take homogeneous spreading and recovery rates of $\beta_{ij}^k=0.35$ for all $(i,j) \in \mathcal{E}^k$ and $\delta_i=0.2$ for all $i \in \mathcal{V}$. Furthermore, we introduce a high cost node $i=7$ with $c_i=1$, as indicated by node marker size, where we don't want this rumor to end up due to potentially their connections to other larger media networks or vulnerability to misinformation (e.g. scams or anti-vaccine campaigns to elderly). \begin{figure}[!t] \centering \def1\linewidth{0.7\linewidth} \input{Influence.pdf_tex} \caption{Influence graph with $n=7$ nodes. Node color indicates outbreak probability $\hat{x}_i^1$, node marker size indicates cost $c_i$ with high cost node $i=7$.} \label{fig:GraphAM1} \end{figure} The goal is now to both stop the spread of this rumor and in particular to protect the high cost node $i=7$. The impact of rumors and misinformation can be reduced by `truth campaigns', i.e. increasing awareness or recovery rate $\delta$, and by blocking incoming `risky' content, i.e. reducing the incoming spreading rate $\beta$ (\cite{zareie2021minimizing}). We model this simultaneously where targeted nodes have both increased recovery rate and reduced spreading rate. Setting $\overline{\Delta}=1$, $\alpha=0.93$, $h=0.24$ and $\Gamma^k=1.5$ for all $k$ with $K=4$, we first solve Problem 2. Next, to emphasize sparsity and difference in outcomes, we use the reweighted $\ell_1$ minimization approach, see Section \ref{subsec:spars}, by keeping the risk bound but minimizing the number of non-zero allocations. We want to compare targeted nodes for different assumptions in speed of the network changes compared to the rumor spreading. Leaving all spread and model parameters the same, we now consider the scenarios of 1) static graph, 2) temporal-switching graph with $K \rightarrow \infty$ and 3) an average graph. The results are displayed in respectively Fig. \ref{fig:03}, \ref{fig:KRA}, and \ref{fig:AverageRA}. It can be seen that the awareness or anti-rumor campaign strategy differs quite a bit depending on the assumptions made on the speed of the network changes and stresses the importance of taking into account the temporal character. All temporal strategies start with targeting node $i=7$ compared to node 1 for the static approach due to knowledge of the changes in influence. Strategies after $k=1$ differ due to different assumptions in speed and knowledge of the network changes and duration. \begin{figure} \centering \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INStatic1.pdf_tex} \caption{k=1} \label{fig:031} \end{subfigure} ~ \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INStatic2.pdf_tex} \caption{k=2} \label{fig:032} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INStatic3.pdf_tex} \caption{k=3} \label{fig:033} \end{subfigure} ~ \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INStatic4.pdf_tex} \caption{k=K} \label{fig:034} \end{subfigure} \caption{Anti-rumor strategy using a \emph{static} network with $h=0.24$, $\alpha=0.93$. Node color indicates nodes targeted.} \label{fig:03} \end{figure} \begin{figure} \centering \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INSeq1.pdf_tex} \caption{k=1} \label{fig:031} \end{subfigure} ~ \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INSeq2.pdf_tex} \caption{k=2} \label{fig:032} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INSeq3.pdf_tex} \caption{k=3} \label{fig:033} \end{subfigure} ~ \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INSeq4.pdf_tex} \caption{k=K} \label{fig:034} \end{subfigure} \caption{Anti-rumor strategy for a \emph{temporal-switching} network sequence with $h=0.24$, $\alpha=0.93$.} \label{fig:KRA} \end{figure} \begin{figure} \centering \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INAverage1.pdf_tex} \caption{k=1} \label{fig:031} \end{subfigure} ~ \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INAverage2.pdf_tex} \caption{k=2} \label{fig:032} \end{subfigure} \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INAverage3.pdf_tex} \caption{k=3} \label{fig:033} \end{subfigure} ~ \begin{subfigure}[b]{0.45\linewidth} \def1\linewidth{1\linewidth} \input{INAverage4.pdf_tex} \caption{k=K} \label{fig:034} \end{subfigure} \caption{Target strategy of the \emph{average} graph of Fig. \ref{fig:KRA}. } \label{fig:AverageRA} \end{figure} \subsection{US Air Network} Next, we consider a periodic domestic US air transportation network graph based on the amount of passengers transported in 2014 from \cite{USdata} modified to a periodic flight schedule consisting of $n=359$ nodes and 514 - 2097 edges based on the flight day as visualized in Fig. \ref{fig:USGraph}. All domestic air traffic within the US excluding Puerto Rico, Virgin Islands and Guam is considered, where multiple airports that serve the same city are combined, and routes that have less than 10,000 passengers carried per year are omitted. Number of flight days is determined based on passengers transported and routes are divided into respectively 2, 3, 4 or 7 flight days a week to create a periodic schedule and network graph. \begin{figure} \centering \def1\linewidth{0.77\linewidth} \input{USPeriodic.pdf_tex} \caption{Periodic US air transportation network with 359 nodes and 514 - 2097 edges based on \cite{USdata}. Edge color indicates the number of flight days per week with dark blue indicating routes that are flown at least daily. Node marker size indicates cost $c_i$ and node color indicates outbreak probability $\hat{x}_i^1$.} \label{fig:USGraph} \end{figure} We now model an outbreak of SARS in Philadelphia. Spreading parameters are based on \cite{chowell2004model} and we take a spreading rate of $\beta=0.25$ per day and a recovery rate of $\delta=0.0631$. The spreading rate $\beta_{ij}$ can now be controlled by reducing passenger numbers and flights on particular routes. Furthermore, we take a cost $c_i$ based on the normalized number of passengers served per airport to represent the impact of the disease reaching a given city node. We now set a daily budget of $\Gamma^k=5$, with an overall budget of $\Gamma_{\text{tot}}=25$, $h=0.02$ and $\alpha=0.9$, and obtain the daily reduced schedules as visualized in Fig. \ref{fig:USRA}. Passengers numbers are reduced on respectively 13, 18, 18, 19, and 19 routes for the first 5 days, using the maximum budget in the first time steps to maximally oppress the outbreak. \begin{figure*} \centering \begin{subfigure}[b]{0.3\linewidth} \def1\linewidth{1\linewidth} \input{Sunday.pdf_tex} \caption{Sunday} \label{fig:031} \end{subfigure} \begin{subfigure}[b]{0.3\linewidth} \def1\linewidth{1\linewidth} \input{Monday.pdf_tex} \caption{Monday} \label{fig:032} \end{subfigure} \begin{subfigure}[b]{0.3\linewidth} \def1\linewidth{1\linewidth} \input{Tuesday.pdf_tex} \caption{Tuesday} \label{fig:032} \end{subfigure} \begin{subfigure}[b]{0.3\linewidth} \def1\linewidth{1\linewidth} \input{Wednesday.pdf_tex} \caption{Wednesday} \label{fig:033} \end{subfigure} \begin{subfigure}[b]{0.3\linewidth} \def1\linewidth{1\linewidth} \input{Thursday.pdf_tex} \caption{Thursday} \label{fig:034} \end{subfigure} \begin{subfigure}[b]{0.3\linewidth} \def1\linewidth{1\linewidth} \input{Friday.pdf_tex} \caption{Friday, Saturday} \label{fig:032} \end{subfigure} \caption{Daily reduction of passenger numbers on respectively 13, 18, 18, 19, 19, 0 and 0 routes for $\Gamma^k=5$ and $\Gamma_{\text{tot}}=25$ to repress an outbreak in Philadelphia.} \label{fig:USRA} \end{figure*} \subsection{Wildfire Example} Let us consider the fictional landscape given in Fig. \ref{fig:Landscape} consisting of different vegetation types, a city and water. We represent this landscape as a temporal graph $\mathcal{G}^k (\mathcal{V},\mathcal{E}^k)$ with $n=1000$ nodes, where the edge set $\mathcal{E}^k$ connects each node to its neighboring 8 nodes, i.e. fire can spread horizontally, vertically and diagonally, but the spreading values associated with each edge can change each time step in line with changing weather conditions and forecasts. Besides weather forecast, the spreading rates are determined by the vegetation type following \cite{Karafyllidis1997a} and \cite{Alexandridis2008a}, where $\beta=\beta_{b}\beta_{veg}\beta_{w}$, consists of the baseline spreading rate $\beta_{b}=0.5$, the vegetation factor $ \beta_{veg}=0, 0.1, 1$ and $1.4$ for respectively water, desert, grassland and eucalypt forest and the weather effect $\beta_{w}$. Finally, the spreading rate is corrected for the spread between diagonally connected nodes. We set the recovery rate $\delta=0.5$ for all nodes $i \in \mathcal{V}$. \begin{figure} \centering \begin{subfigure}[b]{0.85\linewidth} \def1\linewidth{1\textwidth} \includegraphics[width=1\linewidth]{Ex3N.png} \caption{Vegetation Map} \label{fig:Landscape} \end{subfigure} \begin{subfigure}[b]{0.85\linewidth} \def1\linewidth{0.79\textwidth} \input{Ex2L.pdf_tex} \caption{Outbreak Probability} \label{fig:LM} \end{subfigure} \caption{Fictional landscape with different area types, represented as a grid with $n=1000$ nodes with its corresponding estimated outbreak probability $\hat{x}_i^1$.} \label{fig:53} \end{figure} Next, we take the cost $c_i=1$ for the city nodes with $c_i=0.001$ elsewhere and outbreak probability $\hat{x}_{i}^1$ as depicted in Fig. \ref{fig:LM}. This could reflect a higher cost due to risk of human life and property and higher outbreak probability of fires near roads. We now assume the following weather forecast. At time step $k=1$; no wind, $k=2$ northeasterly wind of $V=4$ m/s, midway time step $k=3$ this changes to a southerly wind of $V=8$ m/s which is predicted to stay for at least another 2 time steps. Hence, in order to model this we can take the average graph of the two wind conditions for $k=3$. Setting $\Gamma^k=10$, $h=0.25$, $\alpha=0.9$, we obtain the results illustrated in Fig. \ref{fig:FireRA}. The accumulated amount of resources are shown, where the new resources added per time step have a thicker line width and previous resources added a higher transparency. It can be seen that effectively a protective layer is created around the city following the forecast. First, with no wind and northeasterly wind coming up, resources are allocated to the north and east, afterwards the city is prepared for the incoming southerly wind with more resources allocated to the south to protect the city from higher spread from those areas. \begin{figure*} \centering \begin{subfigure}[b]{0.3\linewidth} \def1\linewidth{1\linewidth} \input{Fire1.pdf_tex} \caption{k=1} \label{fig:031} \end{subfigure} \begin{subfigure}[b]{0.3\linewidth} \def1\linewidth{1\linewidth} \input{Fire2.pdf_tex} \caption{k=2} \label{fig:032} \end{subfigure} \begin{subfigure}[b]{0.3\linewidth} \def1\linewidth{1\linewidth} \input{Fire3.pdf_tex} \caption{k=3} \label{fig:032} \end{subfigure} \caption{Resource allocation for the scenario in Fig. \ref{fig:53} with $\Gamma^k=10$, $h=0.25$ and $\alpha=0.9$ for a forecast with no wind at k=1, a northeasterly wind of $V=4$ m/s at k=2, changing to a 8 m/s southerly wind midway step k=3.} \label{fig:FireRA} \end{figure*} Scalability of the proposed convex optimization program was investigated in \cite{TCNS2021,ACC2022} and solver time was found to be linear in both number of nodes and time-steps. For the dynamic variation, similar run times were found.
\section{Introduction} Among the molecules detected in the interstellar medium (ISM), simple and complex organic molecules, SOM and COMs,\footnote{As discussed in \citet{Herbst2009}, the adjective complex here stands for interstellar molecules containing an organic functional group, as the simple ones, but with more than 5 atoms.} respectively, such as formaldehyde (H$_2$CO), formamide (CH$_3$NO), acetaldehyde (CH$_3$CHO), ethene (H$_2$CCH$_2$), glycolaldehyde (HOCH$_2$CHO), methyl and ethyl formate (HCOOCH$_3$,HCOOCH$_2$CH$_3$), have attracted much attention \citep{herbst2009complex,Lopez2015,zamirri2019quantum}. In space, COMs have been found in interstellar clouds, hot corinos, hot molecular cores, molecular outflows, circumstellar envelopes around evolved stars, and in low and high mass star forming regions in general \citep{Coletta2020,Nazari2021}. Detections of COMs from young stellar objects and protoplanetary discs suggest the participation of these molecules in the composition of comets and planets in formation, which increase the importance of COMs as the building blocks of the first organic molecules in primitive planets \citep{Walsh2014,fedoseev2015experimental,butscher2015formation}. The study of COMs has been an emerging topic in astrochemistry because of their potential role in prebiotic chemistry, {particularly} in the formation of amino acids and other fundamental species for the emergence of life \citep{bulak2021photolysis}. The glycolaldehyde molecule is one of these molecules directly linked to the formation of complex sugars, like ribose and derivatives, essentials to genetic material throughout formose reaction. \citep{woods2013glycolaldehyde,woods2012formation,banfalvi2021prebiotic}. From astronomical observations in the sub-mm domain, \citet{hollis2000interstellar} and \citet{hal2006} carried out a comprehensive study of glycolaldehyde in Sgr~B2 discussing the role of the formose reaction to produce glycolaldehyde from formaldehyde. Recent theoretical and experimental works have investigated again the role of the formose reaction, also known as the Butlerov reaction, under interstellar conditions. \citet{Ahmad2020} studied the role of interstellar H$_2$CO to produce the C$_2$H$_4$O$_2$ isomers: glycolaldehyde, methyl formate and acetic acid (CH$_3$COOH). \citet{Layssac2020} studied experimentally the chemistry of formaldehyde through formose-like reactions. They found that VUV processed interstellar ice analogues containing H$_2$CO can produce sugar-related molecules. Glycolaldehyde was firstly detected is space in molecular clouds within Sagittarius B2(N) \citep{hollis2000interstellar}, and later on it has been observed in several other different regions, such as the hot molecular core G31.41+0.31 \citep{beltran2008first}, the Class 0 protostellar binary IRAS 16293-2422 \citep{jorgensen2012detection}, solar-type protostar NGC 1333 IRAS2A \citep{coutens2015detection}, multiple sources of Perseus molecular cloud \citep{de2017glycolaldehyde}, and in shock region L1157-B1 \citep{lefloch2017l1157}. Glycolaldehyde also has been detected in comets like Lovejoy \citep{biver2015ethyl} and 67P/Churyumov–Gerasimenko \citep{goesmann2015organic}. Regarding bioessential sugars, \citet{Furukawa2019} detected sugar-related compounds in three carbonaceous chondrites demonstrating evidence of extraterrestrial ribose in primitive meteorites. These observations exemplify how widespread the glycolaldehyde molecule is in the ISM environment. Despite its importance, its chemical formation routes in space are still not well understood \citep{woods2012formation,woods2013glycolaldehyde,vazart2018ethanol,coutens2018chemical}. The other two isomers of glycolaldehyde, the methyl formate and acetic acid have also been detected in several astrophysical environments \citep{mehringer1997detection,remijan2003survey,remijan2005survey,shiao2010first} being all involved in the synthesis of key biomolecules such as glycine (NH$_2$CH$_2$COOH), the simplest amino acid \citep{sorrell2001origin}. Methyl formate is the most abundant of the three isomers detected in space, glycolaldehyde being the less abundant one. Indeed, among the three isomers, methyl formate was the first ever observed outside the Galaxy. \citet{Sewilo2018} reported its first extragalactic detection, along with dimethyl ether in the N113 star forming region in the Large Magellanic Cloud. As discussed by \citet{rachid2017destruction}, such high abundances of methyl formate could be related to its high resistance to ionising radiation field when in solid phase compared with other isomers. However, this species in the gas phase is highly sensitive to ionising radiation \citep{fantuzzi2011photodissociation}. Both authors agreed that besides destruction by radiation, an explanation considering different efficiencies in both production and desorption routes to the gas phase might be invoked in an attempt to explain such observed abundances among isomers. According to \citet{burke2015glycolaldehyde}, the desorption of methyl formate from ice grain mantles occurs at lower temperatures than glycolaldehyde and acetic acid, and at shorter time-scale and therefore the temperature of a region might be an important constrain for the abundances of theses isomers (expected to be mainly produced in ices) to be detected in gas-phase. In contrast, formaldehyde is a simple molecule found in many regions of space where glycolaldehyde is detected \citep{jorgensen2012detection,leroux2020solid}. By modelling emission signals from the $^{18}$O isotope transitions of the SgrB2(N) region, an abundance of formaldehyde to glycolaldehyde is estimated in the ratio between 42 and 56 \citep{jorgensen2012detection}. This abundance estimate provides the basis for a possible route of formation of glycolaldehyde from formaldehyde. However, the simple reaction between two formaldehyde molecules does not seem to be favourable even in the solid phase, as shown by \citet{leroux2020solid}, who concluded that the production of glyoxal followed by fragmentation would occur instead of glycolaldehyde production. Shortly after the first detection of glycolaldehyde in Sagittarius B2(N), \citet{sorrell2001origin} proposed through theoretical astrophysical models that complex organic molecules such as glycolaldehyde could be formed in the bulk of icy grain mantles with the presence of radicals created by ultraviolet radiation. In this study, it was postulated that reactions between two formyl radical molecules and between formyl radical and methanol could lead to the formation of a glycolaldehyde molecule. Through theoretical calculations, \citet{jalbout2007can} proposes that gas-phase reactions between two molecules of formaldehyde with subsequent shock with H$_3^+$ have the potential for the final formation of glycolaldehyde and methyl formate. However, the chemical reaction proposed in this work leads to very slow reaction kinetics to produce the abundance of glycolaldehyde detected in the ISM. \citet{skouteris2018genealogical} proposed, through computational calculations, reaction pathways for the formation of glycolaldehyde through radical reactions between formaldehyde and hydroxymethyl radical in gas phase. Nevertheless, the reaction is promising with only two elementary steps, it comes up against an energy barrier that makes it clear that glycolaldehyde is not favourable for its formation in the gas phase, unless it develops through ethanol radical precursors. In a nutshell, astrochemical models indicate that gas-phase routes would be inefficient for the formation of glycolaldehyde, and grain-surface formation are preferable candidates. Specifically, the mechanism with a formyl radical and methanol molecules with five reaction steps initially proposed by \citet{sorrell2001origin} is the best candidate for matching the observational estimates in low temperatures. However, mechanisms in two steps of two-body reactions involving HCO, H$_2$CO and H look more feasible from a chemistry perspective \citet{sorrell2001origin,beltran2008first,bennett2007formation,woods2013glycolaldehyde}. The \citet{bennett2007formation} work shows that a hydrogen atom could add to a CO molecule, generating the formyl radical (HCO) for a posteriori reaction to generate the glycolaldehyde molecules and other isomers. In addition, the study developed by \citet{pantaleone2020chemical} shows that the HCO radical produced in situ by hydrogenation of CO remains adsorbed at the surface of water ice under ISM conditions. This radical will then be available for further collisions from incoming gas-phase molecules, such as formaldehyde. Nevertheless, through astrochemical models and theoretical calculations \citet{woods2013glycolaldehyde} showed that the recombination of two formyl radical molecules is not an efficient initial path for glycolaldehyde formation. In the same study, it was proposed that a surface reaction with an energy barrier of less than 100K would be sufficient to match the observed abundance of glycolaldehyde in the ISM. \citet{chu2016} studied the formation of glycolaldehyde, ethylene glycol and methyl formate in mixed CO, H$_2$CO and CH$_3$OH ices. They highlighted the importance of radicals as HCO in the formation of COMs. A more recent study using simulations with a gas-grain chemical code for astrochemical modelling came to the same conclusions for recombining two formyl radical molecules \citep{coutens2018chemical}. In this work, we perform computational predictions on the possibility of glycolaldehyde formation via reactions between formyl and formaldehyde, which are believed to be important precursors for this molecule~\citep{beltran2008first,woods2012formation}. This is carried out both in the gas phase and in the presence of amorphous water ice using a new model. \section{Computational methods} To investigate the influence of the ice in catalysing the reaction, the mechanism was initially explored in the gas phase and improved using benchmark calculations. Subsequently, we propose a model for the surface of an amorphous ice, and reevaluate the reaction supported on it in several different ways. \subsection{Gas Phase} Geometry optimisations and vibrational calculations were performed using density functional theory (DFT) with exchange-correlation functional M06-2x and aug-cc-pVQZ (AVQZ) basis set \citep{zhao2008density,peterson2008systematically}. In addition, IRC (Intrinsic Reaction Coordinate) \citep{maeda2015intrinsic,fukui1970formulation,fukui1981path} and NEB (Nudged Elastic Band) \citep{henkelman2000climbing} calculations ensured the correct link between the molecules and the representation of the isomer with the lowest energy. To further improve the accuracy, single point energies were calculated at the M06-2X geometry using the explicitly correlated coupled cluster method with singles and doubles excitation with the third one obtained by perturbative method, with resolution of identity correction (CCSD(T)-F12/RI), using the cc-pVQZ-F12 (VQZ-F12) basis set \citep{knizia2009simplified}. The T1 diagnostic of the various structures were evaluated and are presented in table 1 of the supplementary material. The calculations are performed in the lowest spin state of each molecule. We have employed the ORCA program package 5.0.3 version in all gas phase calculations \citep{neese2012orca,neese2018software,neese2020orca}. \subsection{Solid Phase} The modelling of an amorphous ice surface is a non-trivial task, and there are several possible ways to tackle this problem. One of these is to use clusters of water molecules in the gas phase to mimic the disorganised pattern of a real grain\citep{al2004adsorption,ferrero2020binding}. Alternatively, crystalline unit cells have also been used as an approximation to the amorphous ones \citep{karssemeijer2014interactions,perrero2021ab,molpeceres2019silicate}. Fewer works have employed amorphous unit cells for periodic calculations, which applied molecular dynamics on crystalline configurations to generate the random pattern \citep{andersson2006molecular,andersson2008photodesorption,oberg2016photochemistry}. In this work, we propose a faster and yet efficient approach to build representative amorphous unit cells. The main steps of this approach are summarised in Fig.~\ref{fig:fluxograma1}. With a Fortran routine, we create a tetragonal box with dimensions of 10x10x7$\si{\angstrom}$. To match the mean density of ISM amorphous ice, 25 water molecules must be added inside such unit cell. The addition of each molecule is done by generating three random numbers, which are used to locate the centre of mass of the molecule at a random position inside the cell. Three other random numbers are employed for rotating the molecule around the three Euler angles. This is performed independently for each new molecule, and the only restriction to accept the position of a new one is that its distance to any previously added molecule must be greater than 1.6$\si{\angstrom}$. If this condition is not satisfied, the molecule is discarded and a new random position is tried. This process was repeated ten times creating ten different models for the amorphous ice. All obtained structures were optimized, and their total energies were ranked. The cells were classified according to their total energy and only the unit cell with the lowest energy of the group of ten was selected for posterior surface creation. \begin{figure} \centering \includegraphics[scale=0.6]{fig1.pdf} \caption{Flow chart of methodology steps used in solid state phase} \label{fig:fluxograma1} \end{figure} Surfaces were created by increasing the height of the tetragonal unit cell by 13 $\si{\angstrom}$ resulting in a box of dimensions 10x10x20 $\si{\angstrom}$. Another geometry relaxation was performed at the surface. As shown in Fig.~\ref{fig:fluxograma1}, this process was repeated ten times, yielding a diverse set of models for the surface of the amorphous ice grain. All geometry optimizations were performed using DFT calculations with exchange functional PBE using plane waves \citep{perdew1996generalized} with Grimme D3 dispersion correction \citep{grimme2010consistent} and the ultrasoft type pseudopotential \citep{garrity2014pseudopotentials}. The plane wave cutoff energy was set to 40 rydberg (Ry) with a mesh of k points set to 3x3x3 in the bulk and 2x2x1 in the surface models. The reactions involving radicals were of the spin-polarized calculation type, in which unpaired electrons in different orbitals are taken into account. Subsequently, we proceed to study the adsorption and reaction of the molecules in each of the ten surfaces generated, thus providing a sample of the many ways the reaction may occur in different ices. At each stage of the mechanism proposed, reagents, intermediate, and product molecules are positioned on the ten surfaces randomly (following the same routine used for the water molecules in ice, producing random cartesian coordinates near the surface) and structurally optimized. The Eley-Rideal reaction model was used for the mechanism proposed \citep{hama2013surface}, starting with one molecule adsorbed and the other approaching from the gas phase. Two initial routes were tested, one with HCO adsorbed while H$_2$CO approaches from the gas phase and the opposite. The transition state search is performed using NEB type calculations with 10 images to reproduce the energy barrier expected by the approximation of the HCO and H$_2$CO molecules. Each image is separated by 0.5 \AA\ from the other. To quantify the amount by which the reaction barrier is reduced due to the presence of the ice, a reference calculation employing the same methodology is performed removing the water molecules and with a very large unit cell, thus representing the reaction in gas phase at this calculation level. Note that the benchmark calculations described in the previous section cannot be used as a reference to calculate the barrier height reduction here, as the methods for surface calculation are different. It is important to mention that the energy barriers were not correctly described by the PBE functional. An in-depth analysis of this problem can be found in the Results section and more detailed in the supplementary material. It was shown that hybrid functionals are necessary to describe the barrier-height, and to circumvent this difficulty, single-point calculations were performed for each image obtained in the NEB calculations using the B3LYP functional with only the gamma point \citep{stephens1994ab}. Therefore, all energy presented for the calculations including the ice surface are at the B3LYP level with PBE-optimized geometry. We have employed the Quantum Espresso package 7.0 version in all solid phase calculations. \citep{giannozzi2009quantum}. \section{Results} In this work, several possible reaction pathways for glycolaldehyde formation were initially screened, but most were deemed as potentially not important. The new and efficient route proposed here occurs in two parts: first a formaldehyde molecule reacts with a formyl radical, giving rise to an intermediate product radical, followed by a hydrogenation process leading to the glycolaldehyde formation, such as: \begin{align} \mathrm{H_2CO + HCO\cdot \rightarrow H_3C_2O_2\cdot} \label{eq1}\\ \mathrm{H_3C_2O_2\cdot +\ H\cdot \rightarrow H_4C_2O_2} \label{eq2} \end{align} Reaction \ref{eq1} is the decisive step and leads to the formation of the carbon-carbon bond. Unlike previous work, here we start with the premise that the HCO and H$_2$CO molecules are stable enough in the ice surface to react with another molecule \citep{pantaleone2020chemical}. First we consider HCO adsorbed in the surface and reacting with formaldehyde coming from the gas phase, and later the opposite situation. Reaction \ref{eq2} is expected to be fast due to its radical-radical character, and given the abundance of hydrogen atoms in the interstellar medium. The addition of a hydrogen atom promotes the formation of a very stable neutral and closed shell molecule. To understand the catalytic effect of the amorphous ice on this reaction, we first calculate its energy barrier in the gas phase, to later assess if it can be promoted on the surface of a grain. \subsection{Gas Phase} The results obtained for gas-phase calculations are illustrated in Fig. \ref{fig:diagram1}. It is shown that the chemical reaction exemplified in equation \ref{eq1} has an activation energy of 27 kJ mol$^{-1}$, probably due to electron repulsion from the molecular orbitals during the intermolecular approximation. As a result of carbon-carbon bond formation, the intermediate $\mathrm{H_3C_2O_2}$ (I1) is produced, which is the glycolaldehyde species without a hydrogen atom, with relative energy of -6 kJ mol$^{-1}$ with respect to the reactants, suggesting that the formation of the carbon-carbon bond slightly stabilises the composite system. The hydrogenation process that occurs in the sequence, as can be seen in Fig. \ref{fig:diagram1}, takes place without an energy barrier resulting in the target molecule glycolaldehyde, with relative energy of -455 kJ mol$^{-1}$. One can note that adding a hydrogen atom leads to a considerable stabilisation of the molecule, as this addition leads to a non-radical diamagnetic system with 12 electrons in a closed shell configuration. \begin{figure} \includegraphics[width=\columnwidth]{fig2.pdf} \caption{Gas phase mechanisms for Glycolaldehyde (GA) formation. The solid connections corresponds to reaction (\ref{eq1}) while the dashed line corresponds to reaction (\ref{eq2}). All energies are relative to the hypothetical H+HCO+H$_2$CO separated fragments and were obtained at the CCSD(T)-F12/VQZ-F12 level of theory with ZPE correction.} \label{fig:diagram1} \end{figure} An alternative mechanism of glycolaldehyde formation was also found, with a different direction of approximation between reactant molecules, as can be seen also in Fig. \ref{fig:diagram1}. In this mechanism, the H atom of the HCO radical migrates to the oxygen end of formaldehyde, leading to a transition state (TS2) that is higher in energy than TS1. In contrast, the intermediate formed in this way (I2) has lower energy than I1. The intermediate formation occurs with a hydrogen atom transfer, followed by the carbon-carbon bond formation. In sequence, the formation of the glycolaldehyde molecule occurs via a subsequent step in which the carbon (originally from the HCO molecule) is hydrogenated, and not the oxygen, as in the previous mechanism. The interdependence of the mechanisms through TS1 and and TS2 was investigated considering the isomerisation of intermediates I1 and I2, as shown in Fig. \ref{fig:i1i2}. If a possible conversion of the intermediate I1 and I2 occurs, the reaction could go through TS1 to I1 and later isomerize via H-atom migration to I2 before formation of the glycolaldehyde, since I2 has lower energy relative to the reagents. As shown in Fig. \ref{fig:i1i2}, this is not possible because the energy barrier for conversion between the intermediates is too high compared to their formation barriers. This result indicates that only I1 contributes to glycolaldehyde formation. \begin{figure} \includegraphics[width=\columnwidth]{fig3.pdf} \caption{NEB calculation for the possible conversion of intermediate species I1 and I2. Gas phase calculation at M06-2X/aug-cc-pVTZ level.} \label{fig:i1i2} \end{figure} Complete energy data at DFT, CCSD(T) and ZPE correction are shown in Table 1 of the supplementary data. \subsection{Solid Phase} \subsubsection{Reaction Mechanism} Fig. \ref{fig:super3} shows one of the model surfaces of amorphous ice created in this work. The random pattern of water molecules with the presence of non-homogeneous cavities (as expected in an ISM ice) can be observed. The complete group of studied surfaces can be seen in section 3 of the supplementary material. We emphasise here the importance of using a diverse sample of possible surfaces, because the structural arrangement of the site where the reaction takes place may vary substantially in a real amorphous ice grain. \begin{figure*} \includegraphics[scale=0.3]{fig4.png} \caption{Front, side and top view from one of the surfaces of amorphous ice created in this work} \label{fig:super3} \end{figure*} The mechanism through TS1 (Fig. \ref{fig:diagram1}) was the most successful in the gas phase, and for this reason it was chosen to be the reference for the surface calculations. We have explored this reaction in two ways: one starting with an H$_2$CO molecule adsorbed at the surface (s-H$_2$CO) with HCO approaching from the gas phase, while the other starts with HCO adsorbed (s-HCO) and being approached by H$_2$CO. Examples of each reactant molecule adsorbed on the surface, as well as the intermediate I1 and the product glycolaldehyde can be seen in Fig. \ref{fig:pathexample}. Since we have 10 possible models for the amorphous ice surface, and the two reaction possibilities described above, this amounts to a total of 20 potential energy barriers (EB) predictions, which are presented in Table \ref{tab:ts1qe}. \begin{figure*} \includegraphics[scale=0.3]{fig5.png} \caption{a1) Adsorption of HCO radical a2) Adsorption of H$_2$CO molecule b) Intermediate molecule I1 and c) glycolaldehyde molecule adsorbed in surface of amorphous ice} \label{fig:pathexample} \end{figure*} To investigate whether glycolaldehyde formation is in fact catalysed when carried out on the surface of amorphous ice, we calculate the decrease in EB provoked by the presence of the surface as $\rm EB^{gas}-EB^{surf}$. It is not possible to carry out benchmark CCSD(T)-F12 with periodic conditions. The reference gas-phase EB was calculated at the same level of theory as the 20 calculations just described, which employ periodic boundary conditions with large unit cells containing only the HCO and H$_2$CO molecule at B3LYP level. We should stress here that, to reproduce the benchmark gas-phase EB employing DFT calculations, it was necessary to use hybrid exchange-correlation functionals, since PBE was not able to predict a gas phase barrier. This is true both for localised basis sets and plane wave calculations. The complete exchange-correlation functional study for this system is shown in section 1 of supplementary data. The results of each different surface studied are shown in Table \ref{tab:ts1qe}. As can be seen, the surface of amorphous ice catalyses the reaction of formation of glycolaldehyde at different levels with an average of 49\% of decrease of the energetic barrier in the s-H$_2$CO path. In some cases, the energetic barrier disappeared such as in surfaces number 4 and 6, leading to a reaction without barrier that should occur very rapidly. \begin{table} \centering \caption{Influence of decrease the energy barrier of the transition state (EB) by ice. Eley-Rideal reaction type starting with H$_2$CO or HCO molecules adsorbed in the surface (s)} \label{tab:ts1qe} \begin{tabular}{ccccc} \hline \multirow{2}{*}{\#Surface} & \multicolumn{2}{c}{Size of EB (kJ mol$^{-1}$)} & \multicolumn{2}{c}{Decrease of EB (\%)} \\ & s-H$_2$CO & s-HCO & s-H$_2$CO & s-HCO \\ \hline 1 & 12 & 0 & 14 & 100 \\ 2 & 13 & 15 & 5 & 0 \\ 3 & 14 & 30 & 1 & 0 \\ 4 & 0 & 17 & 100 & 0 \\ 5 & 10 & 18 & 24 & 0 \\ 6 & 0 & 15 & 100 & 0 \\ 7 & 4 & 14 & 68 & 0 \\ 8 & 15 & 15 & 0 & 0 \\ 9 & 1 & 6 & 91 & 52 \\ 10 & 2 & 27 & 83 & 0 \\ \hline Average & 7 & 16 & 49 & 15 \\ \hline \end{tabular} \end{table} It can also be seen in Table~\ref{tab:ts1qe} that the path starting from the s-HCO structure is less efficient than that with s-H$_2$CO. In surfaces 1 and 9, there is a complete and partial decrease in the energy barrier. However, on the other surfaces, there is no decrease at all when compared to the gas phase reaction. It is assumed that this behaviour occurs due to the influence of the surface in stabilising the unpaired electron of the HCO radical, and thus decreasing its reactivity. In the s-H$_2$CO path on the other hand, the adsorption is likely to activate the otherwise stable formaldehyde molecule via an electron density transfer mechanism, and thus catalysing the process of carbon-carbon bond formation. The reaction path over all surfaces starting with H$_2$CO adsorbed are illustrated in Fig. \ref{fig:allsurf1}. This figure shows a tendency of energy decrease, initially due to the adsorption of the reactant molecules and followed by the chemical reaction itself, which presents more energetically stable products. This tendency is very similar to the gas phase reaction path, where the intermediate has a relative energy similar to the reactants and the final product presents very low energy. In contrast to the gas phase, in the catalysed route some reaction paths occur barrierlessly. The reaction paths starting with HCO adsorbed are illustrated in Fig. \ref{fig:allsurf2}. As previously reported, the majority of cases did not lead to a decrease in energy barrier. \begin{figure} \includegraphics[width=\columnwidth]{fig6.pdf} \caption{Formation of glycolaldehyde (GA) in the ten model surfaces, each represented by a different colour. The first step corresponds to the adsorption of the H$_2$CO molecule at the surface, followed by HCO attack yielding the intermediate I1 and later the final product. The energy reference in this diagram is the sum of the ice surface energy and the separate reactants. The s- prefix indicates that the molecule is adsorbed on the surface.} \label{fig:allsurf1} \end{figure} \begin{figure} \includegraphics[width=\columnwidth]{fig7.pdf} \caption{Formation of glycolaldehyde (GA) starting from an adsorbed HCO molecule.} \label{fig:allsurf2} \end{figure} It is important to mention that the surface that presented the lower energy in the first step did not necessarily show the lower energy in the next step. In this way, it is challenging to point out a surface with a preferable topography for this chemical reaction to occur. \subsubsection{Adsorption of Reactants and Intermediates} It is important to know whether the newly formed products will be strongly bound to the surface and will remain on the grain for a long period, or if they are weakly bound and could be released to the gas phase using part of the energy released in the reaction. For this reason, we have also calculated the adsorption energy ($\rm E_{\rm adsorp}$) of each reactant, intermediate and products on each of the 10 model surfaces used in this work as \begin{align} \rm E_{adsorp}=& \rm E_{total} -E_{surface} -E_{molecule} \label{eq:adsor} \end{align} where $\rm E_{total}$ refers to the energy of the adsorbed configuration containing molecule and surface, while $\rm E_{surface}$ and $\rm E_{molecule}$ correspond to the energy of the clean surface and that of the isolated molecule, respectively. The adsorption energies for each chemical species are shown in Table~\ref{tab:adsortab}. \begin{table} \centering \caption{Adsorption energy of reactants, intermediates and product in kJ mol$^{-1}$. Eley-Rideal reaction type starting with H$_2$CO and HCO molecule adsorbed in the surface (s).} \label{tab:adsortab} \begin{tabular}{cccccc} \hline & \multicolumn{2}{c}{Reagents} & \multicolumn{2}{c}{Intermediates} & Product \\ \# Surface & s-HCO & s-H$_2$CO & s-HCO & s-H$_2$CO & GA \\ \hline 1 & -114 & -3 & -44 & -47 & -52 \\ 2 & -84 & -25 & -3 & -60 & -53 \\ 3 & -117 & -3 & -1 & -38 & -64 \\ 4 & -26 & -24 & -39 & -59 & -52 \\ 5 & -114 & -49 & -9 & -33 & -41 \\ 6 & -84 & -35 & -43 & -41 & -75 \\ 7 & -114 & -45 & -16 & -51 & -67 \\ 8 & -151 & -49 & 38 & -7 & -100 \\ 9 & -148 & -34 & -38 & -29 & -70 \\ 10 & -113 & -39 & 68 & -4 & -73 \\ \hline Averaged & -106 & -31 & -8 & -37 & -64 \\ \hline \end{tabular} \end{table} In Table 2, we would like to highlight the results obtained for the formaldehyde and glycolaldehyde species. The adsorption energy for formaldehyde ranges from -3 to -49 kJ mol$^{-1}$, and the average value is -31 kJ mol$^{-1}$. These results are in excellent agreement with experimental results found in the literature. According to an experimental study performed by \citet{noble2012desorption}, the adsorption energy of formaldehyde is estimated to be -27.1 kJ mol$^{-1}$, showing that our results present an average deviation of 4 kJ mol$^{-1}$ from the experimental one. It is possible to note that some surfaces, for example, surfaces 2 and 4, deviate in 2 and 3 kJ mol$^{-1}$ from the experimental result, and surfaces 6, 9, and 10 deviate from 12 kJ mol$^{-1}$, in the most. For glycolaldehyde, we compare our results with the experiments performed by \citet{burke2015glycolaldehyde} on the adsorption energy of important COMs on amorphous solid water ices using infrared and temperature programmed desorption techniques. This experiment obtained a value of -46 kJ mol$^{-1}$ for glycolaldehyde, which can be compared with the results of this work shown in the last column of Table~\ref{tab:adsortab}. It can be seen that on average the deviation from the experiment was 18 kJ mol$^{-1}$. Several of our model surfaces showed deviations below 7 kJ mol$^{-1}$. Such deviations are expected for DFT calculations \citep{peverati2011improving,hammer1999improved}, and suggests that our method for generating the amorphous surfaces does not produce another significat source of error. The results in Table~\ref{tab:adsortab} also suggest that the interaction between the reactants and the surface is strong enough to hold the reactants on the ice until the chemical reaction occurs. Let us first analyse the mechanism starting with H$_2$CO adsorbed (s-H$_2$CO), which as argued in the previous section is the preferred one. In this case the intermediate formed is seen to have an adsorption energy of -37 kJ mol$^{-1}$ on average. Recall that the formation of I1 is only slightly exothermic, and thus it would be formed on the grain with low vibrational energy content, which could also be dissipated to the grain. Given the low temperatures of the ISM, it is likely that this intermediate would stay on the grain long enough for the second step of hydrogenation to occur, finally leading to glycolaldehyde. As for the less favorable route, which starts with \ce{HCO} adsorbed and is attacked by a gas-phase H$_2$CO molecule, we see that the average adsorption energy of the intermediate is much lower in magnitude. In fact, there were two cases (out of ten) with positive adsorption energy, which would mean that the nascent intermediate would be promptly desorbed. This low magnitude of the adsorption energy gives a further indicative that this is not a viable mechanism, as the intermediate could in principle be desorbed right after formation, which would make it less prone for the subsquent step of hydrogen addition. For the glycolaldehyde molecule, all surfaces presented negative adsorption energies (Tab~\ref{tab:adsortab}), indicating an attractive character to such molecule. However, the exothermicity of the second step of our proposed mechanism is large (on average releasing -751 kJ mol$^{-1}$), and for all of the ten cases, the product glycolaldehyde molecule would in fact be formed with a vibrational energy content that is more than enough to overcome its adsorption energy and release it to the gas phase. \section{Astrochemical Implications} In this study, two sides of a problem were investigated and significant results were obtained that improved our understanding of the formation of the glycolaldehyde molecule. In the gas phase side, results show that the carbon-carbon bond can be achieved through neutral-radical reactions with a low energetic barrier, enabling this process to occur in many astronomical environments where glycolaldehyde is found. However, this association would require a radioactive energy release (radioactive association) or third-body collision for the stabilisation of the intermediate complex. In fact, \citet{woods2012formation} shows that the formation of glycolaldehyde in the gas phase is not sufficient to achieve the formation rates reported in the ISM. At the surface of a grain, the reactants proposed in our mechanism (formyl radical and formaldehyde) can be formed in the ISM in several ways. For example, successive hydrogenation processes of CO can form the HCO and H$_2$CO, reactions already described in the KIDA database\footnote{Kinetic Database for Astrochemistry \url{https://kida.astrochem-tools.org/}} \citep{wak15}. Another process was recently described by \citet{molpeceres2021carbon}, wherein the interstellar amorphous water ice catalyses the two-step C + H$_2$O reaction to formaldehyde formation. The formaldehyde can be split in HCO radical and hydrogen atom in cosmic rays reactions, being a source of formation of this radical in the gas phase. Thus, our mechanism could be initiated also by a carbon atom on the amorphous ice, leading to our proposed reactants and culminating in the hydrogenation of the intermediate I1 on the ice surface as shown in Fig. \ref{fig:scenario}. \begin{figure} \includegraphics[width=\columnwidth]{fig8.pdf} \caption{Most likely scenario of glycolaldehyde formation from the results obtained in this work. Dotted line means that the atom is bound to the surface through adsorption.} \label{fig:scenario} \end{figure} When we directly compare the relative energies between the mechanism in the gas phase and the same applied to the surface of amorphous ice, as can be seen in Fig. \ref{fig:dft-comp}, it is notable that the greatest influence occurs in the decrease of the energy barrier in the formation of the glycolaldehyde molecule.The energy barrier for this reaction reduces from a gas-phase value of 17 kJ mol$^{-1}$ (2040 K) to only 7 kJ mol$^{-1}$ (842K) on average for the surface. This barrier can be easily overcome by local heating induced by collisions or cosmic ray impacts, and the reactivity may be enhanced by quantum tunnelling \citep{paudel2014energy,bialy2020cold}. This leads to the question of how many other chemical reactions take place in the ISM in a similar fashion. \begin{figure*} \includegraphics[scale=0.5]{fig9.pdf} \caption{Comparison between the proposed mechanism in the gas phase and on the surface of amorphous ice. The displayed energy of the solid phase is the average of the energies of the ten surfaces studied. All energies are at DFT level.} \label{fig:dft-comp} \end{figure*} In the case of the mechanism studied in this work, the exothermic chemical energy released in the formation of glycolaldehyde can lead to non-thermal surface desorption processes. With this desorption occurring glycolaldehyde would to released to the gas phase quickly after its formation. This hybrid mechanism between gas and solid phases would be the key to understanding the current abundances of glycolaldehyde in the ISM and other more complex COMs. Other reaction routes considering isomers of glycolaldehyde could also help to clarify this issue. In comparison with other theoretical and experimental works, \citet{Layssac2020} discussed a general formation route for sugars and polyol compounds. They investigated the formation of COMs, such as glyceraldehyde and its saturated derivative glycerol, through VUV photolysis of interstellar ice analogues composed of H$_2$O and H$_2$CO. They proposed a formation mechanism for glycolaldehyde and polyoxomethylene (a formaldehyde polymer) based on a radical-non radical reaction between HCO and H$_2$CO. \citet{Ahmad2020} found that reactions between two formaldehyde molecules exhibits a significant potential barrier, but due to quantum tunnelling these reactions can happen in the ISM. In addition to that, they also found that the chemical reaction is exothermic and capable of producing not only glycolaldehyde but also methyl formate and acetic acid. In a future study, it would be interesting to investigate the thermodynamic influence of some nonpolar amorphous surfaces with the presence of molecules such as CO and CO$_2$ in different proportions with water molecules. These studies should help quantify how much of the catalysis of chemical reactions would be directly linked to the surface composition. It was shown in this work that small changes in the surface can lead to considerable changes in the final result. Therefore calculations with more details like explicit molecules, amorphous configuration and periodic conditions have a significant importance for correct results. \section{Conclusions} In this work we computationally study the formation of glycolaldehyde from formaldehyde (H$_2$CO) and the formyl radical (HCO) over a two steps mechanism (reactions \ref{eq1} and \ref{eq2}), occurring both in the gas phase and catalysed by a surface (amorphous water ice). In the gas phase, DFT and CCSD(T) calculations were used to construct the reaction path with the lowest possible energy. In the solid phase, periodic DFT calculations were used on a sample of ten amorphous ice surfaces in order to study their influence on the energy barrier of an Eley-Rideal mechanism. A consistent decrease in the reaction barrier was obtained in almost all of the different amorphous water surfaces explored with an average reduction of 49\% (which amounts to an average barrier of 7 kJ mol$^{-1}$) and reaching a decrease of 100\% in some cases. Even though each grain will have its unique amorphous structure and reactive sites, our results suggest that the catalytic effect is the predominant scenario. Given that the first step of the reaction is only slightly exothermic, our adsorption energy analysis indicates that the intermediate will remain on the grain for a subsequent hydrogenation step, leading to glycolaldehyde. The large amount of energy released in this step will be greater than the adsorption energy of the product molecule and sufficient to overcome its adsorption energy. Therefore, the mechanism culminates in the release of glycolaldehyde to the gas-phase in a non-thermal desorption process. The results on the energy barrier, as well as the adsorption energies indicate that the Eley-Rideal mechanism with an adsorbed H$_2$CO being attacked by HCO is much more efficient then the analogous one starting with an adsorbed HCO. The mechanisms involving the surface (the average value) lead to a product that, in addition to having a lower activation barrier than in the gas phase, is also much more exothermic than the product in the gas phase. Which may suggest that the formation of glycolaldehyde in cold regions can be much more efficient than in gas. The proposed mechanism and the computational framework proposed here may be transferred to the study of several other complex organic molecules. \section*{Acknowledgements} The authors would like to thank the financial support provided by the Coordena\c c\~ao de Aperfei\c coamento de Pessoal de N\'ivel Superior - Brasil (CAPES) - Finance Code 001, and Conselho Nacional de Desenvolvimento Cient\'ifico e Tecnol\'ogico (CNPq), grants 311402/2021-6 and 311508-2021-9. \section*{Data Availability} The data of this paper will be shared on reasonable request to the corresponding author. The essential extra data can be seen at Supplementary Data section. \bibliographystyle{mnras} \section{Analysis of exchange-correlation functionals for correct reproduction of TS1} In order to state that the glycolaldehyde formation reaction is in fact catalysed when carried out on the surface of amorphous ice, we need a robust electronic structure method for predicting the energy barrier that would work both on the gas-phase and in the reaction catalyzed by the surface. However, when periodic condition calculations (without the surface and employing a large unit cell to simulate the gas-phase reaction) were performed using the PBE functional, the results revealed that there was no energy barrier to carbon-carbon bond formation in the gas-phase reaction. This contradicts the accurate CCSD(T)-F12/aug-cc-pVQZ results, which found the existence of an energy barrier. To identify the failure in the reproduction of the energy barrier in the periodic condition calculations, a benchmark was carried out in which different methods were tested with ORCA and Quantum Espresso (QE) package programs. It is important to note that these calculations were performed in gas phase or in a unit cell containing only the molecules HCO and H$_2$CO. \begin{figure}[!htb] \centering \includegraphics[scale=0.44]{Supplementary-Data-fig1.pdf} \caption{Energy profile obtained using different programs and methods to approximate the carbon-carbon coordinate between H$_2$CO+HCO molecules. The reference coordinates were optimized in the QE-PBE and used for point-point calculations in the other methods and/or programs. QE stands for Quantum Espresso, and the localised basis set used was aug-cc-pVTZ.} \label{fig:Supplementary-Data-fig1} \end{figure} As can be seen in Fig. \ref{fig:Supplementary-Data-fig1}, only the calculations in which hybrid-type exchange-correlation functionals were used managed to properly reproduce the existence of an energy barrier lying above the reactants. Thus, even calculations that use only localised bases and non-hybrid functional, as was the case with ORCA PBE, failed to describe the energy barrier, which shows that the deficiency for the description of the energy barrier lies in the choice of the inappropriate functional and not the use of plane waves. In Fig. \ref{fig:Supplementary-Data-fig1} the HCO and H$_2$CO approximation geometries were obtained under PBE XC-functional using the Quantum Espresso program. Comparatively, the geometries at each point in Fig. \ref{fig:benchmark2} were obtained using the ORCA program package and M06-2X XC-functional optimizations. \begin{figure}[!htb] \centering \includegraphics[scale=0.44]{Supplementary-Data-fig1.pdf} \caption{Energy profile obtained using different programs and methods to approximate the carbon-carbon coordinate between the H$_2$CO+HCO molecules. The reference coordinates were optimized in ORCA-M06-2x and used for single-point calculations in other methods and/or programs. The localised basis set used was aug-cc-pVTZ.} \label{fig:benchmark2} \end{figure} Fig. \ref{fig:benchmark2} confirms that only calculations with hybrid functionals reproduce the energy barrier. The only exception occurs for HSE functional, which partially reproduced the energy barrier, all other calculations with hybrid functionals obtained very close energies, regardless of the chosen basis set or program. It can be seen that B3LYP calculations from both ORCA and Quantum Espresso present almost identical energies in the correct description of the system. This benchmark was necessary so that when comparing the results of the energy barrier in the gas phase and on the ice surface, there is no error or bias associated with the functional or basis set used. \section{Formation Route H$_2$CO + HCO + H} \begin{table}[htpb] \centering \caption{DFT, Coupled Cluster and zero-point energy for each structure. Energy values relative to the reactant, except ZPE which is in terms of total energy. All values are in kJ mol$^{-1}$ except T1 diagnostic which is in SI.} \label{tab:a1a} \begin{tabular}{ccccc} \hline \textbf{Name} & \textbf{M06-2x + ZPE} & \textbf{CCSD(T)-F12 + ZPE} & \textbf{ZPE} & \textbf{T1 diagnostic} \\ \hline H$_2$CO+HCO+H & 0 & 0 & 105.91 & 0.01477 0.02031 \\ TS1 & 16.86 & 27.23 & 115.67 & 0.03055 \\ I1 & -17.62 & -5.70 & 125.34 & 0.02221 \\ TS2 & 41.60 & 57.62 & 104.44 & 0.03361 \\ I2 & -82.71 & -77.50 & 128.57 & 0.01722 \\ GA & -463.42 & -455.64 & 162.99 & 0.01388 \\ \hline \end{tabular} \end{table} \begin{longtable}{ccc} \label{tab:a1b}\\ \hline \textbf{Name} & \textbf{Vibrational Frequencies (cm$^{-1}$)} & \textbf{Cartesian coordinates (XYZ)} \\ \hline \endhead H$_2$CO+HCO & \begin{tabular}[c]{@{}c@{}}1108.19\\ 2004.66\\ 2723.22\\ -----//------\\ 1215.95\\ 1280.80\\ 1541.63\\ 1875.47\\ 2942.07 \\ 3015.19\end{tabular} & \begin{tabular}[c]{@{}c@{}}C -1.339035 0.469623 -0.001171\\ O -0.536175 -0.375263 0.001671\\ H -1.580932 1.096035 -0.896329\\ -----//------\\ C -1.358419 0.489508 -0.000007\\ O -0.535656 -0.375118 0.000013\\ H -1.569442 1.086451 -0.902319\\ H -1.944151 0.729853 0.902313\end{tabular} \\ \hline TS1 & \begin{tabular}[c]{@{}c@{}} 322.29i\\ 39.31 \\ 215.40 \\ 270.50 \\ 613.13 \\ 667.97 \\ 1117.86 \\ 1136.92 \\ 1249.13 \\ 1492.47 \\ 1663.50 \\ 1999.29 \\ 2900.96 \\ 2942.08 \\ 3013.59\end{tabular} & \begin{tabular}[c]{@{}c@{}}C 0.015694 0.004595 -0.000980\\ C 2.123542 0.001983 0.010076\\ O -0.147348 1.219111 0.001039\\ H -0.044468 -0.583738 0.926795\\ H -0.048414 -0.578081 -0.934061\\ O 2.733353 -0.453136 0.886385\\ H 2.428928 0.773048 -0.722912\end{tabular} \\ \hline I1 & \begin{tabular}[c]{@{}c@{}}121.86 \\ 344.16 \\ 532.10 \\ 703.09 \\ 1019.36 \\ 1022.62 \\ 1148.10 \\ 1156.87 \\ 1312.66 \\ 1375.93 \\ 1400.93 \\ 1882.69 \\ 2927.44 \\ 2972.20 \\ 3046.23\end{tabular} & \begin{tabular}[c]{@{}c@{}}C -1.330934 0.001337 -0.014427\\ C 0.190680 0.023147 0.041607\\ O -1.852920 1.115671 -0.579034\\ O 0.846034 -0.972703 0.034203\\ H -1.664192 0.016612 1.040764\\ H -1.696687 -0.937150 -0.445702\\ H 0.637619 1.032256 0.088928\end{tabular} \\ \hline TS2 & \begin{tabular}[c]{@{}c@{}} 2138.29i\\ 104.57 \\ 134.98 \\ 195.40 \\ 407.99 \\ 547.27 \\ 703.87 \\ 991.42 \\ 1242.57 \\ 1432.20 \\ 1512.40 \\ 1672.80 \\ 2048.31 \\ 3055.32 \\ 3158.15\end{tabular} & \begin{tabular}[c]{@{}c@{}}C -1.084073 -0.151421 -0.037989\\ C 1.844694 0.301645 0.046127\\ O -0.535186 0.933646 -0.317649\\ H -1.455639 -0.340978 0.968994\\ H -1.206873 -0.926067 -0.795008\\ O 1.674162 -0.779552 0.389545\\ H 0.762914 0.962726 -0.254019\end{tabular} \\ \hline I2 & \begin{tabular}[c]{@{}c@{}}138.59 \\ 182.98 \\ 341.42 \\ 529.78 \\ 852.03 \\ 859.96 \\ 1139.19 \\ 1211.78 \\ 1308.92 \\ 1392.35 \\ 1476.51 \\ 2013.99 \\ 3027.75 \\ 3110.26 \\ 3867.57\end{tabular} & \begin{tabular}[c]{@{}c@{}}C -0.408151 -0.146169 0.000933\\ C 1.093915 -0.193081 0.211099\\ O -0.844704 1.105178 -0.435910\\ H -0.867895 -0.407539 0.957144\\ H -0.640481 -0.930678 -0.725039\\ O 1.742990 -1.084675 0.591295\\ H -0.075674 1.656963 -0.599522\end{tabular} \\ \hline GA & \begin{tabular}[c]{@{}c@{}}216.42 \\ 311.18 \\ 393.27 \\ 735.34 \\ 774.71 \\ 892.94 \\ 1120.11 \\ 1166.13 \\ 1266.44 \\ 1309.26 \\ 1402.57 \\ 1449.89 \\ 1488.54 \\ 1858.64 \\ 2990.67 \\ 3021.36 \\ 3041.69 \\ 3787.48\end{tabular} & \begin{tabular}[c]{@{}c@{}}C -0.626413 -0.118125 -0.018700\\ C 0.810526 -0.503185 0.183238\\ O -0.759090 1.226322 -0.346352\\ O 1.695739 0.296918 0.063630\\ H -1.168900 -0.360209 0.903030\\ H -1.037197 -0.763754 -0.804060\\ H 1.017409 -1.553088 0.446035\\ H 0.129647 1.603039 -0.365813\end{tabular} \\ \hline \end{longtable} \newpage \section{Surface \#1} Tetrahedral cell $\alpha=\beta=\gamma=90^o$ \begin{verbatim} CELL_PARAMETERS (angstrom) 10.0 0.0 0.0 0.0 10.0 0.0 0.0 0.0 20.0 ATOMIC_POSITIONS {angstrom} O 4.404634248 2.821291111 4.145276240 H 4.540842279 2.701425629 3.153528929 H 5.122711130 3.415991166 4.480059914 O 7.875884872 1.896459919 5.781581559 H 8.676628274 1.715544590 5.234465305 H 7.119818761 1.317539030 5.490345387 O 7.072462388 6.122430219 1.666492504 H 7.584024807 5.227975176 1.574549252 H 7.530764678 6.865389662 1.205527417 O 0.676184969 2.449419890 -0.493572554 H 0.833338423 3.087011303 0.247379443 H 1.378258674 1.772348912 -0.364641221 O 6.836062737 6.492421491 4.251915165 H 7.006798725 6.327344595 3.262803719 H 6.963560052 5.622406199 4.717816039 O 1.725669252 6.411999283 4.978318694 H 2.670269005 6.533425746 4.694297598 H 1.603582714 5.439863059 4.811877470 O 1.843206263 3.790215692 4.185788226 H 2.795967563 3.494402366 4.219639778 H 1.317544031 3.021543197 4.534569801 O 6.455678487 10.024301020 2.242269674 H 6.931178285 9.878808168 3.092116252 H 5.558237892 9.596324508 2.400204177 O 4.737419099 2.415395903 1.508676021 H 5.548629672 1.860471579 1.530226291 H 4.039487622 1.830632467 1.104330248 O 4.198393268 6.512530390 3.845997729 H 5.158538104 6.493780377 4.136692469 H 4.189942469 5.979981011 3.000206293 O 3.155760706 7.739586069 0.398540658 H 3.657913008 6.890233036 0.452393491 H 2.210192481 7.460030659 0.532822679 O 6.542159820 4.118747128 5.500314730 H 7.170552396 3.319198172 5.586568011 H 6.232907604 4.295710428 6.405022012 O 1.729449415 0.115543420 3.047959963 H 1.181022098 -0.731591124 3.127093390 H 2.670476176 -0.229602535 3.117927263 O 0.635896213 6.869462700 1.011050415 H -0.142856391 6.976371665 0.435924867 H 0.387724017 7.260367303 1.914505356 O 0.523635015 1.507170093 4.928163170 H 1.017800043 0.961391782 4.225641552 H 0.822113567 1.160173459 5.785798750 O 5.524973491 0.604274234 5.240219947 H 5.050849550 0.381804677 6.058413229 H 5.010942616 1.360528076 4.826921440 O 4.504768745 5.388046983 1.351117088 H 5.470372707 5.654691463 1.334003678 H 4.505795389 4.416077855 1.197299745 O 8.093943452 8.607382555 0.678124697 H 7.422902870 9.115406656 1.238973817 H 8.949074706 8.996083279 0.933183292 O 8.147105847 3.816720246 1.775865747 H 9.138892580 3.897628727 1.825769610 H 7.990439627 3.122823871 1.070742461 O 0.855894993 4.180854502 1.679954646 H 0.896076006 5.141481804 1.445013025 H 1.300893448 4.058887151 2.565036954 O 4.062182221 8.894355899 2.650649574 H 4.156190865 8.070238347 3.217819356 H 3.732498291 8.505669559 1.780602664 O 0.327438520 7.902653997 3.386918305 H 0.832378315 7.293836558 4.045098870 H -0.519094996 8.209121496 3.821943704 O 2.700496539 0.749978803 0.514609431 H 2.215213492 0.537328428 1.357984986 H 2.973074184 -0.120197234 0.155863625 O -1.957283808 1.972809035 -0.205963789 H -0.972359249 2.025440435 -0.397653626 H -2.158165797 1.029395327 -0.076133593 O 8.024047504 8.821054212 4.416526997 H 7.527728729 7.945013868 4.503397539 H 8.008234693 9.241976342 5.292618258 \end{verbatim} \newpage \section*{Surface \#2} Tetrahedral cell $\alpha=\beta=\gamma=90^o$ \begin{verbatim} CELL_PARAMETERS (angstrom) 10.0 0.0 0.0 0.0 10.0 0.0 0.0 0.0 20.0 ATOMIC_POSITIONS {angstrom} O 8.3398218135 7.6406247780 5.4866150529 H 7.6948424415 8.2073757286 4.9376234814 H 8.6889566399 8.2502605736 6.1608428418 O 0.9981259055 -0.2530338873 5.0789124626 H 0.3854107912 0.3549032660 4.5753739781 H 0.9539120586 -1.1492456416 4.6530871708 O 5.6557809600 1.5797844915 3.8343631498 H 4.7826843119 1.4059072348 4.2595361848 H 5.4655013680 1.9500238973 2.9228789032 O 2.3338909711 5.2236732929 5.2144915292 H 3.3328386516 5.3742116050 5.0586118571 H 2.2352295165 5.0081377251 6.1573724849 O 4.8363751876 5.7309184448 4.7454779977 H 5.2602100632 5.5789262161 3.8492308299 H 5.5911529507 5.5336008563 5.4036365801 O 2.6296632070 2.6449474780 1.0063379589 H 2.4462631406 2.7363538092 1.9773590229 H 2.7654285496 1.6616712616 0.8310438002 O 6.3191909316 5.0875192553 2.5779612884 H 6.6446857055 5.7050691872 1.8776875189 H 5.8700462040 4.3336849780 2.0871596148 O 7.6316000774 2.4228820187 0.1256496219 H 7.9254402799 1.5763469052 0.6260226819 H 7.6554179819 2.1902177795 -0.8175020560 O 7.6358826436 3.3736834049 4.3359066074 H 7.3896416154 4.0208934750 3.6208874454 H 6.8705406926 2.7315219999 4.3237828059 O 0.6568665379 7.1355781575 4.1782171333 H 1.2289250581 6.4780247978 4.6565462682 H -0.2284050321 7.1696309985 4.6407827488 O 2.9023563160 7.4703562043 0.4932770938 H 2.1848474912 6.9707664170 0.9537977459 H 3.6401202590 7.5661187788 1.1372406023 O 6.5255926747 8.9915844371 4.1556816634 H 6.4780572408 9.9690210990 3.9870409327 H 5.6978988323 8.7948488353 4.7006535274 O 2.0246133282 2.9701750730 3.6819303214 H 2.5269917487 2.3625971458 4.2887247322 H 2.0433272207 3.8452463366 4.1514296778 O 6.9395340866 5.2820421742 6.2520893732 H 7.4817275215 6.0889120142 6.0726298479 H 7.3362777537 4.5624616086 5.6946278279 O 4.3323107064 8.2574268297 5.4438799322 H 3.5798119816 8.6335901502 4.9559129393 H 4.4334812344 7.3115495660 5.1266429673 O -0.6796610322 8.1043811063 0.2722566602 H -0.1642533943 8.2797185821 -0.5335105271 H -0.1290409206 7.4151177146 0.8061766094 O 0.1516420699 3.9651216900 0.5699263444 H 0.9458182939 3.3742797648 0.5871841698 H -0.6595040238 3.4156442338 0.4952402467 O 9.6579767160 1.6383162957 3.6400697149 H 8.9383279225 2.2687519475 3.9281905066 H 10.4740657331 2.2073406938 3.5588035687 O 3.3762280840 10.1698585931 0.4559640848 H 4.1918308134 9.8654011241 0.9209960422 H 2.9015138336 9.3064502868 0.3446424979 O 5.2397804607 8.4771284969 1.7179431522 H 5.8694164768 7.9778124316 1.1440369734 H 5.7399800203 8.6238945566 2.5603678492 O 3.2130499308 1.0746104262 5.2203029939 H 3.4438825013 1.1415135268 6.1621472828 H 2.3658531936 0.4920735693 5.1792064400 O 8.3751423099 0.4061837041 1.5640517600 H 8.8137708808 -0.3815957912 1.1594723555 H 8.9725146389 0.7803251180 2.2657601354 O 7.0042727540 6.7758100802 0.4039880229 H 6.7349827370 6.3522836169 -0.4277166072 H 7.8776117307 7.2415432103 0.2316057722 O 0.6326420331 6.3388826038 1.5922597480 H 0.5645643540 6.4935895513 2.5738272764 H 0.3833857051 5.3975285056 1.3295049870 O 5.2937944971 2.8946923990 1.4855792534 H 4.3595004455 2.8597575001 1.1194457925 H 5.9701460650 2.6503312023 0.7989303763 \end{verbatim} \newpage \section*{Surface \#3} Tetrahedral cell $\alpha=\beta=\gamma=90^o$ \begin{verbatim} CELL_PARAMETERS (angstrom) 10.0 0.0 0.0 0.0 10.0 0.0 0.0 0.0 20.0 ATOMIC_POSITIONS {angstrom} O 7.136085269 4.225947122 1.736249778 H 7.892520797 3.661260471 1.316514243 H 6.814411036 4.835978284 1.039875138 O -0.986176034 2.756697178 0.803535380 H -1.158834669 1.806781218 0.990945266 H -0.208510488 3.014590537 1.367670017 O 1.669357713 5.547297441 6.232590417 H 2.591562696 5.222359113 6.343572523 H 1.713011470 6.250283963 5.533625524 O 2.975430787 1.950542167 5.379325836 H 3.006120236 1.067811195 4.954986443 H 2.027491132 2.247911456 5.363715560 O 6.057325064 1.431197622 5.322956034 H 6.450351641 0.543960193 5.087505089 H 5.185395818 1.257421238 5.724459059 O 5.548458515 2.208817047 2.718930660 H 5.763681434 2.058374823 3.675389527 H 6.151670110 2.913206115 2.352706586 O 6.265470830 6.780323925 0.467191696 H 6.162190403 7.719312081 0.122613087 H 5.408473492 6.632919933 0.949537792 O 3.973751722 0.121797912 1.892082035 H 3.018364875 0.390964583 1.813424690 H 4.491255323 0.943451874 2.100263108 O 4.916969972 6.608863413 4.389964308 H 4.521368000 5.881409872 4.935805024 H 5.841942250 6.246008280 4.227164081 O 7.305323960 5.475947309 4.054793876 H 8.085803644 6.026252561 4.310362205 H 7.415448741 5.052436005 3.144124272 O 8.533455129 7.381109234 1.639364596 H 8.345015292 7.286895662 2.590430524 H 7.664923347 7.072358560 1.195129914 O 0.942610528 3.622962167 2.531119612 H 0.778810577 3.552833578 3.523689071 H 1.956763505 3.596705442 2.356763626 O 7.144438921 9.167782106 4.317063374 H 6.390299096 8.571287219 4.152537358 H 7.831859871 8.593338961 4.763710460 O 3.943704148 6.308150880 1.865291682 H 4.160721423 6.485370028 2.822871634 H 3.002118542 6.553699507 1.713665330 O 8.499933077 10.092831694 1.773174674 H 8.007457346 10.096737976 2.622213672 H 8.567973809 9.115634042 1.570815868 O 0.576848748 3.344082041 5.170593337 H 0.913200344 4.186269249 5.608054693 H -0.372209867 3.245140264 5.468847143 O 3.403279129 3.633334225 1.882029631 H 3.710450099 4.576438457 1.833443657 H 4.122783228 3.120828269 2.332004807 O 5.965074317 -0.585751274 -0.000470008 H 6.702112114 -0.123028349 0.446414757 H 5.166310393 -0.362022739 0.538502115 O 3.555515571 9.150443394 4.354434167 H 4.115477743 8.360079049 4.532015512 H 3.762763400 9.431612209 3.408481450 O 1.401817711 7.505998351 4.302571283 H 2.086598430 8.237751171 4.280359076 H 1.336737822 7.089840344 3.385932031 O 1.084981154 6.302248707 1.961150127 H 0.228813632 6.642871886 1.600139340 H 0.940852593 5.324619761 2.126486803 O 4.211060795 4.332179713 5.857811151 H 4.945316513 4.137095924 6.466322871 H 3.862820111 3.442792517 5.561880198 O 7.934203249 3.436856852 5.891339696 H 7.608394917 4.105002779 5.239986791 H 7.313268080 2.675943136 5.809328684 O 1.344042393 0.741843389 2.379018849 H 1.204583522 1.715863905 2.423520565 H 0.457842268 0.389514297 2.142661779 O 8.982328531 7.380771422 5.172089023 H 9.942897742 7.548701170 4.860418401 H 9.062127805 7.072299132 6.092756399 \end{verbatim} \newpage \section*{Surface \#4} Tetrahedral cell $\alpha=\beta=\gamma=90^o$ \begin{verbatim} CELL_PARAMETERS (angstrom) 10.0 0.0 0.0 0.0 10.0 0.0 0.0 0.0 20.0 ATOMIC_POSITIONS {angstrom} O 7.524053336 1.509989555 0.239401540 H 6.907488730 1.143957234 -0.413271708 H 7.348509983 2.482528787 0.270726988 O 1.132748263 4.496325281 3.148913856 H 1.459610260 4.327765776 4.105653746 H 1.919337743 4.739424990 2.582007175 O 9.376219518 3.009363036 6.129581096 H 8.771520630 3.680456532 5.748706677 H 9.024593538 2.127109729 5.880156411 O 4.857681533 8.399535579 1.520072539 H 4.657224251 7.888505849 2.362808735 H 4.134080231 8.122711187 0.913082488 O 7.127012153 0.440646597 2.783401355 H 6.684920252 -0.388149352 2.530441938 H 7.330434584 0.880464855 1.916067590 O 7.291231285 4.097397666 1.082384960 H 7.313513580 5.080760374 0.908571323 H 8.072609381 3.855815719 1.632446499 O 4.921767206 0.801873956 4.642522097 H 4.247809895 0.720488140 3.919349638 H 5.731988763 1.017895124 4.130860842 O 1.745515557 4.253535606 5.648800154 H 0.962714782 3.720973186 5.959194807 H 2.585509264 3.743993418 5.879580420 O 3.192478960 5.304412639 1.672969718 H 3.552904921 5.918200316 2.395126946 H 2.920513924 5.914846179 0.943075936 O 4.189813983 6.833638907 3.577648593 H 3.529995962 6.974593012 4.337241367 H 4.806598372 6.117880054 3.910939731 O 3.572366505 0.795208374 2.232635365 H 4.055771716 1.635910750 2.006244006 H 4.097204254 0.035099906 1.876572140 O 6.209245107 8.774003734 5.964252192 H 5.567974141 9.379380487 5.507365617 H 5.747892239 8.484920329 6.766605606 O 8.413019847 0.344978693 5.299644820 H 7.700204538 -0.168643570 5.758379025 H 8.084353599 0.415925118 4.370754323 O 4.099105796 3.126089663 6.132633950 H 4.666917782 3.737551020 5.601791196 H 4.309659239 2.247171681 5.744726072 O 7.975625789 5.299379100 5.069564930 H 7.760509786 5.934150499 5.773067451 H 8.516404919 5.824209988 4.397783337 O 7.221902585 6.784023335 0.552191462 H 8.041493396 7.313769920 0.645263784 H 6.487343609 7.333245700 0.902984573 O -0.416414760 2.737839793 2.017362018 H 0.230158213 3.390688107 2.453066748 H -0.181392936 2.711939868 1.074383884 O 5.510934206 4.640416702 4.314988286 H 5.401681450 4.038639034 3.536578689 H 6.481712772 4.792573162 4.487852765 O 2.502083859 7.007751557 5.588494033 H 1.765504502 7.637106543 5.409431220 H 2.108612652 6.115126421 5.738768774 O 4.860382929 3.213222307 1.980180221 H 4.242217692 3.944632082 1.708826242 H 5.735692802 3.460722908 1.581737549 O 2.443902510 7.421019744 0.103489592 H 2.390485496 7.448800847 -0.864136949 H 1.507819130 7.626373691 0.434189526 O -0.007240408 7.974880861 1.048179551 H -0.177888676 7.426172044 1.867216228 H 0.183029305 8.881811411 1.406826680 O 0.871447623 0.268833924 2.347392880 H 1.823537098 0.529253946 2.228500099 H 0.351937063 1.113360284 2.338925839 O -0.457529367 6.604169388 3.360504951 H -0.072297011 7.359098199 3.900829832 H 0.228075073 5.866722582 3.311772230 O 0.527282769 8.758020652 4.629727848 H 0.776078807 9.331609019 3.856173551 H -0.212079911 9.279409241 5.050625105 \end{verbatim} \newpage \section*{Surface \#5} Tetrahedral cell $\alpha=\beta=\gamma=90^o$ \begin{verbatim} CELL_PARAMETERS (angstrom) 10.0 0.0 0.0 0.0 10.0 0.0 0.0 0.0 20.0 ATOMIC_POSITIONS {angstrom} O 0.772300263 7.342347745 2.216936547 H -0.192706033 7.275901568 1.929791172 H 0.954202035 6.733418706 2.976948890 O 2.812727444 1.043026235 3.044329195 H 1.968372652 0.514473514 3.014951382 H 2.640404371 1.881289834 2.518359120 O 7.185506000 5.893396378 -0.085252162 H 6.460304603 6.045966947 -0.712549109 H 7.002728070 5.029038683 0.374293654 O 8.490712480 0.355077016 0.451934046 H 8.523198851 -0.562550128 0.831851288 H 8.939968434 0.972860026 1.069478476 O 6.582326676 8.088291631 3.574359765 H 7.051007416 7.865211315 4.428599177 H 6.210902545 9.018757579 3.606936336 O 4.867313427 4.148682507 3.396823658 H 5.562602356 3.989359339 2.702631428 H 4.710507622 5.142896838 3.403712268 O 5.648300146 2.392789018 5.245663949 H 4.836578491 2.103675869 5.718825880 H 5.350526216 3.153561849 4.657449278 O 3.229888475 7.300380836 0.906979875 H 3.514232955 8.145660359 0.445436713 H 2.281836990 7.397130765 1.178012802 O 7.801920123 7.094605228 5.755378432 H 7.691251350 6.132060859 5.683404578 H 8.758520460 7.231850087 5.999622459 O 0.495799316 10.243861228 5.979831205 H 0.544727351 9.955305704 5.025268044 H 0.445308093 9.379115052 6.449926198 O 5.976632029 1.147074530 0.755420805 H 6.904498225 0.794279088 0.554488363 H 5.818742045 0.897420807 1.712563748 O 0.526689135 9.682822341 3.328368605 H 0.600958915 8.761561746 2.896251600 H -0.312697596 10.083796362 3.040173164 O 4.080861541 -0.485623658 -0.369825828 H 4.771371494 0.132447569 0.007022641 H 3.418841725 0.086467178 -0.790459374 O -0.761128365 2.549534851 2.317207412 H -0.987232877 2.328571719 3.266202235 H 0.119587679 2.980023722 2.322660216 O 6.763733464 3.624410781 1.408821438 H 6.430094876 2.741770181 1.047100579 H 7.675706306 3.403574786 1.735763277 O 5.407970282 0.464736935 3.314854753 H 5.599505557 1.153221212 4.013215996 H 4.413875316 0.508552448 3.201596389 O 2.357584264 4.331937122 6.195051179 H 3.158817934 4.578609788 6.686423335 H 2.484186004 3.356244044 5.966455826 O 10.432013386 7.465084037 6.463697698 H 10.658392619 6.931554546 7.244638644 H 11.040889676 7.122245263 5.727740374 O 1.877779500 6.350688921 4.544205593 H 2.778876131 6.631862344 4.217841236 H 2.042555858 5.485674044 5.030284477 O 8.273475632 7.762041421 1.496527184 H 7.637436225 7.860223482 2.266132657 H 7.837095030 7.117323547 0.865630903 O 8.392409414 1.647724560 4.712478650 H 8.964512122 1.246992805 5.408887230 H 7.531697183 1.901995720 5.112420630 O 2.810438086 1.769201726 5.668557682 H 2.810758863 1.551588192 4.689708855 H 2.061831849 1.216861528 6.018034023 O 2.345368967 3.481643614 2.109224359 H 3.056766662 3.786075443 2.724588068 H 2.675814296 3.849799409 1.240851893 O 4.272109851 6.746930732 3.318108929 H 3.960015340 6.993450796 2.394523620 H 5.119056548 7.263521159 3.469738126 O 3.697458883 4.721798030 0.057770665 H 4.599584187 4.526478570 0.367216876 H 3.552890225 5.685829503 0.266396640 \end{verbatim} \newpage \section*{Surface \#6} Tetrahedral cell $\alpha=\beta=\gamma=90^o$ \begin{verbatim} CELL_PARAMETERS (angstrom) 10.0 0.0 0.0 0.0 10.0 0.0 0.0 0.0 20.0 ATOMIC_POSITIONS {angstrom} O 0.2995472385 2.2545384206 1.7715146398 H 1.1776301470 1.9281188739 1.3575176451 H 0.1304605572 1.5589075970 2.4685520055 O 0.6385868033 6.1383326068 4.7746914880 H 0.8783410483 5.4114429796 4.1084046955 H 1.4579702553 6.7272809915 4.7775909682 O 4.7947731236 2.3550821506 1.9555906708 H 5.4670022510 1.7530275136 2.4075823366 H 5.3620279318 3.0926866819 1.5598989435 O 5.3853209390 4.0933356315 5.4334119749 H 5.2510538004 4.9532972264 4.9394072678 H 4.6161270319 3.5478896316 5.1085804327 O 6.5124197804 0.8938868795 3.4216070328 H 6.8523222722 0.0831238753 2.9010881381 H 7.2518755914 1.4847185467 3.7234553668 O 5.1232447350 6.6419674310 1.4553070579 H 5.5967353714 5.8471600102 1.0754086592 H 4.1610568052 6.4941708908 1.2158901675 O 0.4845063801 0.1047910346 3.5055385997 H 1.1952426551 0.3026899220 4.1627391084 H 0.9703428178 -0.4420692897 2.8016070868 O 1.4397650128 4.3442670379 3.0242512459 H 2.1380497718 3.7947787407 3.5121165721 H 0.8947647665 3.6326334175 2.5577080920 O 7.9092632988 5.1778321931 2.9804596106 H 7.9302203121 4.3950128325 3.6368496793 H 8.8445883878 5.3735990087 2.7666863787 O 7.1490476346 8.7015176934 2.0872951493 H 6.4133313141 8.0992006975 1.8057962581 H 7.7311321482 8.1729782877 2.7000725866 O 8.8055944873 3.1706413860 -0.2451127771 H 9.2373131961 2.7162372312 0.5507813297 H 8.6295510165 2.4460364857 -0.8810804534 O 2.5592716829 1.3286407281 0.7432118330 H 2.5412687518 0.3662464963 0.9939262990 H 3.4229018113 1.6772690611 1.1203559007 O 4.9936600236 6.5071759499 4.1437667444 H 5.7593944236 6.9620921042 4.6125426587 H 5.1643747269 6.5239666366 3.1453767779 O 6.8395758039 7.6390960325 5.7557292322 H 7.6762233432 7.8349042076 5.2022212623 H 7.0988933644 6.9169659002 6.3696269439 O 2.3942019158 6.0614341205 1.0562854717 H 2.1185218796 5.4969362304 0.2757162330 H 2.1177239727 5.4757845906 1.8227538378 O 2.7376474776 7.7771223128 4.3639691553 H 3.6552717987 7.3168270615 4.3577941433 H 2.8137358276 8.6118213885 4.9011140507 O 2.9163861007 0.3430264818 5.4305296191 H 2.5873078132 0.5482589493 6.3309399761 H 3.9626433894 0.1976042254 5.5624886392 O 7.7248885700 3.1620677622 4.6776666908 H 6.7925154373 3.4621040474 4.9901877856 H 8.3127472053 3.4953711732 5.4107703366 O 1.5138595803 4.1504187250 -0.7692719357 H 0.5501292955 3.9274579632 -0.6701728919 H 1.9728339651 3.2957547931 -0.6069899492 O 2.1162855212 8.7095114416 1.8877275279 H 1.9942869086 7.8543420621 1.3850084014 H 2.5057005675 8.3720013553 2.7552817061 O 6.4635213544 4.2825834211 0.9852939811 H 7.0513848386 4.6013408537 1.7574491889 H 7.1414236974 3.9234500246 0.3526313951 O 8.8515678485 8.0143668802 4.1341927892 H 9.4157567545 8.8380795596 4.0460353697 H 9.5047025774 7.2584656056 4.2995603941 O -0.9224592273 4.7957898006 6.5241277695 H -0.2434039652 5.3115008347 5.9911151755 H -0.4534280108 4.5188685696 7.3368748371 O 3.3181880062 2.8140713797 4.1322913626 H 3.8734353677 2.6445837079 3.2985477994 H 3.1103803235 1.9226874717 4.5274334387 O 5.4065815583 10.0542494512 5.7082343386 H 5.8545602695 10.3758871891 4.8592107719 H 5.8272885670 9.1717788333 5.8974369810 \end{verbatim} \newpage \section*{Surface \#7} Tetrahedral cell $\alpha=\beta=\gamma=90^o$ \begin{verbatim} CELL_PARAMETERS (angstrom) 10.0 0.0 0.0 0.0 10.0 0.0 0.0 0.0 20.0 ATOMIC_POSITIONS {angstrom} O 0.492200879 2.925807549 4.931400324 H 0.405325271 2.672078325 5.862692365 H 0.944460553 2.148449717 4.461179092 O 7.537140074 6.420530242 4.254459592 H 8.046580639 5.621801977 3.900026709 H 6.749217320 6.039485046 4.725708414 O 9.004664597 6.176631291 0.343115708 H 8.464122023 5.353049025 0.308244048 H 9.859219219 5.838800709 0.697999148 O 3.202413788 7.001449900 4.991195465 H 4.004236069 6.511462422 5.313770722 H 3.458651540 7.428390574 4.114825409 O 0.478987467 7.399130986 5.239625298 H -0.024828061 6.573606864 5.140568619 H 1.426858250 7.153886546 5.370284829 O 7.057499442 7.480790226 1.792353075 H 7.843085561 7.134362285 1.289939841 H 7.209290239 7.172752970 2.730495054 O 6.239219138 0.561762350 4.650605818 H 6.865625809 -0.061328011 5.103776900 H 5.369213324 0.481660090 5.117751867 O 4.547812034 3.448476768 4.042802015 H 3.644131053 3.772060711 3.806877450 H 4.950430834 3.062096437 3.222467128 O 5.579723375 9.862228693 2.250093328 H 6.235928961 9.195975072 1.934629082 H 5.887185944 10.101772900 3.203753671 O 3.541751057 8.065333719 2.577067459 H 4.209350404 8.807785283 2.471122500 H 3.907436126 7.312204108 2.024259430 O 2.142589058 4.732432908 3.735367019 H 1.523309816 4.221088315 4.319146017 H 2.432076095 5.547108330 4.220265077 O 8.529252242 1.374266797 -0.545721346 H 8.942634163 0.586586471 -0.104882866 H 7.692639476 1.049574533 -0.911944352 O 1.776208669 1.082282926 3.587979949 H 1.894788102 1.407625389 2.658282645 H 1.341085789 0.194245329 3.429735519 O 3.447699642 3.456515383 -0.029164836 H 2.748509367 4.047154811 0.384732914 H 3.863747276 3.990476658 -0.723808784 O 5.443444059 2.497389073 1.622637933 H 4.702215542 2.721561662 1.006687615 H 5.497928365 1.501468191 1.715088729 O 7.889900432 8.699091819 5.774101378 H 7.815499733 7.882429824 5.220697356 H 8.846218511 8.769323507 5.933764691 O 5.362906431 5.375890507 5.519710852 H 5.562497207 5.041498363 6.408210418 H 5.122420138 4.556882138 4.943957036 O 3.638775103 0.191218723 5.568958099 H 3.449506748 -0.764897029 5.568499332 H 3.094752727 0.563211939 4.835987540 O 7.836725039 3.598184050 0.879157042 H 8.205624768 2.821821371 0.376759455 H 6.933714186 3.269253049 1.137961265 O 8.876047381 4.409975810 3.252206739 H 8.507868564 3.999541580 2.422774526 H 9.208971728 3.696542942 3.837970816 O 1.334070017 4.631009055 1.148300003 H 0.862294989 3.774774692 1.123432866 H 1.547171968 4.762225538 2.114980905 O 1.573483558 1.622383408 0.894486300 H 1.177634787 0.815688545 0.501435160 H 2.261476114 1.946849085 0.277917772 O -0.076076686 9.244069058 0.460295316 H -0.262977774 8.414936567 -0.015150182 H 0.126464009 8.961343368 1.395727067 O 0.915118608 8.654129308 2.864615360 H 0.626015950 8.135489834 3.662909704 H 1.852397118 8.370717061 2.666726523 O 4.801179805 6.113213171 1.220358757 H 5.697755694 6.543873623 1.363137589 H 4.841092072 5.272910977 1.706898806 \end{verbatim} \newpage \section*{Surface \#8} Tetrahedral cell $\alpha=\beta=\gamma=90^o$ \begin{verbatim} CELL_PARAMETERS (angstrom) 10.0 0.0 0.0 0.0 10.0 0.0 0.0 0.0 20.0 ATOMIC_POSITIONS {angstrom} O 5.028978576 4.177949891 1.058381269 H 5.574957392 4.936821133 1.401234756 H 5.639083942 3.637087586 0.527418034 O 10.291254128 7.158431835 3.863308576 H 9.860180508 6.551495374 3.200155641 H 10.931488227 6.597934570 4.366894975 O 1.348968607 2.801616923 4.776013971 H 2.249386510 2.401861518 5.030097596 H 1.246502720 2.563100217 3.799304136 O -0.523456016 1.114952613 5.672965541 H 0.196976947 1.764947157 5.373321312 H -0.692358002 1.337331818 6.602779628 O 3.694098203 1.733578169 5.276909071 H 3.995682690 1.718559784 4.311873926 H 4.348850400 2.352010465 5.683198402 O 0.655418181 7.247909460 0.338203613 H 0.462057845 7.495177008 -0.579724488 H 1.603531712 6.900538798 0.335183178 O 5.742823166 3.686245128 5.611031270 H 5.366903626 4.369233573 5.019303082 H 6.330195245 3.134117484 5.030211629 O 4.111524032 8.333045960 2.577643392 H 3.263501097 8.841921582 2.495754229 H 4.011443113 7.757631860 3.368428766 O 9.008386325 5.710927766 1.929355930 H 8.080496761 6.044214700 1.981889488 H 9.481111878 6.208239355 1.209949386 O 6.625944491 -0.400984311 2.948660892 H 7.143716244 -0.943417516 3.593476986 H 5.694947826 -0.730114506 2.943428180 O 1.443067621 9.228295639 2.273943753 H 1.088815835 8.650798040 2.994145431 H 1.151981247 8.751621775 1.461437204 O 4.541525837 1.884338819 2.803626169 H 4.681643297 2.772579539 2.418205763 H 4.332377027 1.307905877 2.007361453 O 4.142898602 0.595142308 0.488983647 H 3.590881728 1.328385305 0.115029568 H 5.068996378 0.754582159 0.191956834 O 8.520346238 2.949186199 1.752044138 H 8.072531447 2.748826062 2.618574160 H 8.711000528 3.920690148 1.752473456 O 7.354051188 2.060030885 4.065499994 H 8.076141581 1.698546512 4.635395741 H 6.877518018 1.270396025 3.693313990 O 2.270375202 9.214737091 5.450900183 H 2.887309003 9.975832711 5.522909571 H 1.396929525 9.616078866 5.596906870 O 6.386078899 6.824179170 6.222585212 H 6.762214933 5.936582371 6.358906036 H 7.110377074 7.395058639 5.858546331 O 6.279557404 6.302768204 2.194548696 H 6.019889119 7.175421000 1.844890995 H 5.732067772 6.210705956 3.023027942 O 4.626598183 6.171014637 4.354531105 H 3.722598749 5.885019050 4.645499109 H 5.149823355 6.506318761 5.145488695 O 8.251088118 -1.520740444 4.943389102 H 9.038599967 -2.041380333 4.597113023 H 8.637091459 -0.688612285 5.286873963 O 0.996779834 1.975621588 2.252828949 H 0.059248358 2.217760936 2.002043162 H 1.077718758 0.985318311 2.251476982 O 3.213964289 6.628121386 0.478805619 H 3.657516582 5.761744266 0.522951134 H 3.622303345 7.198974421 1.174776845 O 2.555127498 2.841975986 0.099661056 H 3.216985660 3.451100422 0.474951495 H 1.984152258 2.589305663 0.868698054 O 6.956719239 0.907859092 0.415575023 H 7.506875305 1.686311522 0.646903561 H 6.952386466 0.383832126 1.247904108 O 2.062728836 5.390133486 5.142552007 H 2.014685028 5.539841459 6.100917698 H 1.757359576 4.438773783 4.994863748 \end{verbatim} \newpage \section*{Surface \#9} Tetrahedral cell $\alpha=\beta=\gamma=90^o$ \begin{verbatim} CELL_PARAMETERS (angstrom) 10.0 0.0 0.0 0.0 10.0 0.0 0.0 0.0 20.0 ATOMIC_POSITIONS {angstrom} O 2.312679622 5.464990674 3.359398197 H 2.225679579 6.335356554 3.812213595 H 1.652480289 4.830838437 3.763207022 O 5.517028555 7.670836513 4.119779746 H 5.501593564 6.733986034 3.760781344 H 5.911265882 7.627848637 5.014365598 O 7.059261516 1.067677534 1.447498063 H 7.835581700 1.417456594 0.936912427 H 7.422318071 0.632700569 2.256672443 O 9.125536533 4.752817693 -0.054115796 H 10.022001433 5.090206449 0.147197066 H 8.489384172 5.318029508 0.464348080 O 1.822174250 5.649303995 0.663741022 H 2.031228796 5.611787212 1.641286177 H 2.505044025 6.210779334 0.259652302 O 8.351849362 5.385746827 4.127266083 H 7.676640639 4.909332539 4.674258943 H 9.100647690 4.732279098 4.027616207 O 1.721488166 9.453542060 2.331082630 H 2.433916037 9.482639430 1.605563202 H 2.117211832 8.986069809 3.103097907 O 7.668413074 6.526324567 1.524637176 H 7.731796585 6.105203978 2.410948737 H 8.463105051 7.136590993 1.475755770 O -0.320060918 1.998934953 6.193272013 H -1.268047722 1.706169646 6.093105144 H -0.250708908 2.325963253 7.102983872 O 3.071656443 2.783759800 0.540061633 H 2.742422579 3.647166194 0.225072389 H 2.375296509 2.502552457 1.195961541 O 0.995715885 1.988389510 2.127178170 H 1.214616930 1.029661771 2.330223939 H 0.308712757 1.976998999 1.403326619 O 9.160796287 2.186955785 0.159811774 H 9.395561919 1.821280980 -0.707367311 H 9.082471868 3.204742346 0.050586007 O 7.062858329 1.177163499 5.800988626 H 6.642164973 2.056406619 5.631346417 H 7.186379875 0.712967698 4.920889862 O 5.054079353 5.085542425 3.404681701 H 4.062797274 5.101090267 3.393276621 H 5.322589077 4.471344001 2.628351283 O 0.454776657 3.662031610 4.106687902 H 0.259945399 3.115594630 4.911800361 H 0.603475982 2.992404015 3.367505082 O 4.718996096 6.066297182 6.844109449 H 5.036505008 6.988531332 6.913311451 H 4.044920679 6.099215135 6.144277345 O -0.653149145 7.819348293 4.767182164 H -1.018411609 6.902499480 4.586988967 H -0.758254409 7.946134722 5.723004110 O 5.580447559 3.428018382 1.485288611 H 4.696128651 3.137099998 1.141539582 H 6.109679743 2.596659285 1.586073906 O 6.145840946 -1.296420490 6.787619299 H 6.674663747 -1.385290859 7.595375871 H 6.317168779 -0.363100811 6.488910293 O 3.415672349 -0.403045505 0.350333861 H 3.553741207 0.530541653 0.108432453 H 4.323494450 -0.805971442 0.486964238 O 7.533730287 9.577796543 3.693787261 H 6.784846336 8.940814818 3.592971772 H 8.290468163 9.000901720 3.995625046 O 5.864982030 8.630868321 0.706311282 H 6.406338485 9.434451323 0.890572353 H 6.377718688 7.848270022 1.011616026 O 2.859560359 7.987019399 4.424968564 H 3.861773338 7.990353207 4.347398194 H 2.626119774 8.448529781 5.245268924 O -0.118713707 7.914062754 1.059352467 H 0.491587552 7.204923200 0.778602481 H 0.459394337 8.508660862 1.607390219 O 6.311924835 3.939291274 5.451049955 H 5.943789999 4.462487703 6.192798988 H 5.745618777 4.249035738 4.676218668 \end{verbatim} \newpage \section*{Surface \#10} Tetrahedral cell $\alpha=\beta=\gamma=90^o$ \begin{verbatim} CELL_PARAMETERS (angstrom) 10.0 0.0 0.0 0.0 10.0 0.0 0.0 0.0 20.0 ATOMIC_POSITIONS {angstrom} O 9.811876652 8.118569040 -1.112946991 H 9.188412710 8.810744691 -0.846412403 H 10.711704839 8.538450965 -1.128791057 O 4.776948758 2.788129414 0.489846646 H 5.583764631 2.805745269 1.046972594 H 4.020721951 2.823129144 1.123514748 O 4.457199579 0.270922504 -0.566279850 H 4.529190958 1.229362495 -0.307548178 H 4.756245378 -0.214408381 0.241796231 O 7.080648916 2.995649786 2.383655012 H 6.865675822 3.754765250 2.987216780 H 8.063635907 3.025191245 2.254684353 O 10.478406673 8.181942099 3.297021999 H 10.763472966 7.673111137 4.106877502 H 11.233457434 8.128468079 2.643798206 O -0.576026725 5.684111946 -0.034480806 H -0.362740674 6.549162285 -0.488122131 H 0.178053346 5.090718159 -0.171559906 O 6.600086964 4.713528848 4.519043852 H 7.562289920 4.663507280 4.775798027 H 6.054691709 4.257679170 5.209158971 O 3.461314073 5.903032595 5.316090350 H 3.591043388 5.809370043 4.335025218 H 3.802298751 5.065210090 5.701555052 O 8.676104423 6.430926738 2.370714295 H 9.050586616 6.092907077 1.496417007 H 9.276385246 7.190299847 2.634304509 O 5.016758750 -0.453848881 4.183109075 H 5.781608507 0.181687654 4.275938998 H 5.370575313 -1.297716978 4.578025462 O 0.998584994 6.655017836 5.512532948 H 0.860705562 7.129123786 6.347835008 H 1.966958297 6.321745312 5.524957078 O 4.789901794 3.484237663 6.114266290 H 4.706371481 3.265429574 7.054765409 H 4.287908479 2.765918233 5.588398252 O -0.749313400 4.801131702 4.425391051 H -0.117068053 5.288946205 5.007588297 H -0.916973387 5.425481190 3.660561002 O 7.024125840 1.290651197 4.419954823 H 6.871997113 1.858581244 5.194550062 H 7.001235491 1.911697046 3.620975358 O 2.466489043 7.773170285 1.489290952 H 2.291959945 7.935238122 0.530628458 H 3.353927990 8.238587173 1.619645421 O 6.122377119 6.266113754 1.514202059 H 7.037038504 6.349733307 1.911613066 H 6.249257569 5.782252917 0.680885530 O 2.434283406 8.772007950 -1.144439704 H 3.146623184 9.484868887 -0.940669435 H 2.777406395 8.299891863 -1.919450978 O -0.036794619 2.863503403 2.656095419 H -0.072126863 1.983169896 3.132686955 H -0.147264029 3.520800159 3.396844135 O 6.553202511 7.444242471 4.869891849 H 6.415664512 6.466728195 4.758705846 H 7.365671320 7.625677399 4.370780243 O -0.301531285 0.643573622 4.158280030 H -0.031370010 -0.255648852 3.834188620 H -1.275649966 0.655478045 4.302105021 O 1.048024831 2.133672981 6.252399878 H 0.493978727 1.570937341 5.673206400 H 1.924057401 2.032553752 5.828030620 O 3.660541309 5.583064689 2.615323061 H 4.592200987 5.691386080 2.299082400 H 3.145077311 6.279925615 2.126009764 O 4.907732281 8.759464656 1.669815403 H 5.441522141 7.932328871 1.584664181 H 5.008521134 9.096116768 2.615636606 O 2.731179809 3.026016048 2.421612267 H 1.735490453 2.983995993 2.393690317 H 2.975141481 3.985666152 2.517448708 O 3.467884732 1.776969522 4.695341267 H 3.211233837 2.178236029 3.813281442 H 3.854137889 0.881376397 4.536285907 \end{verbatim} \end{document}
\section{Introduction} The search for modifications of Einstein's theory of General Relativity (GR) that may explain important phenomenological aspects of current cosmology, such as inflation and dark energy, follows several directions. One of them, traditionally, contemplates the inclusion of extra scalar fields into the theory. Such a role is taken by a scalar that drives the metric inflation and couples to all of matter present around the Planck scale, finally decaying into the spectrum of particles, parents of the Standard Model ones. Another modification is the inclusion of a cosmological constant, which fits very well the CMB data within the $\Lambda$CDM model, but underscores a huge hierarchy problem.\\ An interesting class of modified cosmologies are those that include higher powers of the curvature of spacetime, the Riemann tensor, but in a form in which no dimensionful coupling is present in the action and exhibiting equations of motion of the second order, as for the Einstein-Hilbert (EH) action. \\ A nice example of these is the Einstein Gauss-Bonnet (EGB) theory at finite GB coupling, which would be ideal for the study of some of these phenomena, were it not that, in four dimensions, the theory is topological. In string theory in $d=10$ such quadratic corrections get combined in the GB term only in the heterotic case \cite{Duff:1986pq}. It was observed that they are deprived of double poles, generated by the second functional derivative of this term $(\sqrt{g}E^{(2)})^{\mu\nu\rho\sigma}$, from the quadratic metric fluctuations around flat space $(\sim O(h^2))$ \cite{Zwiebach:1985uq}. \\ We recall that topological contributions in the form of either the Einstein-Hilbert (EH) action at $d=2$ \begin{equation} V_{EH}(g,d)\equiv\mu^\epsilon\int d^d x \sqrt{g} R, \end{equation} $\epsilon=d-2$, or the Gauss Bonnet action (GB) at $d=4$, define evanescent terms in the equations of motion of gravity. In $d=2$ the EH action itself is metric independent.\\ Evanescent terms can be turned into dynamical contributions by performing a singular limit on the corresponding coupling constant, which are dimensionless. This features is commonly present and held into account in the context of conformal anomaly actions, but recently it has been reproposed in a purely classical context \cite{Glavan:2019inb}. In the case of $d=2$, the theory is rendered dynamical by replacing the EH action by the regulated action \cite{Mann:1992ar} \begin{equation} \label{eh2} \mathcal{S}_2=\lim_{d\to 2}\frac{\int d^d x \left(V_{EH}(g,d)- V_{EH}(\bar g,d)\right)}{d-2}, \end{equation} where one introduces a conformal decomposition of the metric \begin{equation} g_{\mu\nu}=\bar{g}_{\mu\nu}e^{2 \phi} \end{equation} in terms of a dilaton (Weyl) factor $\phi$ and a fiducial metric $\bar{g}$, with $V_{EH}(\bar g,d)$ being a subtraction that allows a finite limit. The limiting procedure allows to generate special forms of dilaton gravities, which are closely related to conformal anomaly actions, and are of Horndeski type. The differences among the possible realizations of such actions are related to the ways in which the subtractions are included in the regularization of such $V_{EH}(g,d)/\epsilon\to 0/0$ contributions as $\epsilon\to 0$. \\ The method, well-known both in the case of 2-D gravity and of conformal anomaly actions \cite{Matsumoto:2022fln,Coriano:2013nja,Ferreira:2017wqz,Elvang:2012st}, where the same procedure is applied to the counterterms in the dimensional regularization (DR) of the theory, has recently regained significant attention, for offering, possibly, a way to evade Lovelock' s theorem \cite{Lovelock:1971yv} in a purely classical framework \cite{Glavan:2019inb}. \\ Eq. \eqref{eh2} identifies the ordinary Wess-Zumino (WZ) form of the action. Different subtractions, defined either in $d$ dimensions - as in \eqref{eh2} - or at $d=4$, allow to include or exclude extra - Weyl invariant - terms. It has been pointed out that this arbitrariness is a possible way to account for the difference between topological and non topological anomalies, or anomalies of types A and B \cite{Coriano:2023sab}. Both types of anomalies appear in the trace of correlation functions involving stress energy tensors $(T)$, but the first are not associated with the breaking of scale invariance.\\ Similarly to the $d=2$ case, in the case of the 4d GB theory, the coupling $g_s(d)$ becomes singular as $d\to 4$, while the integral of the Euler-Poincar\`e density becomes topological, generating again a $0/0$ contributions that requires a subtraction. The result is a finite, non topological action, whose structure depends on the subtraction \cite{Coriano:2022ftl}. \\ The $d\to 4$ limit is purely geometrical, but involves additional scales, coming from the dependence of the fields on the extra $(d-4)$ coordinates of the manifold, and borrows its features from dimensional regularization (DR) in flat Minkowski space. As a theory, it is unrelated to the regularization of some quantum corrections, as is the case of the conformal anomaly action, derived by integrating out a conformal matter sector. However, it is a well-defined variant that opens the way to new interesting developments. It is clear that such behaviour can be classified as a strongly coupled one, geometrically induced and with a dimensional reduction of the field dynamics. It can be envisioned for every topological term of a general Lovelock theory.\\ Lovelock's theorem states that, at $d=4$, the only gravitational action that generates second order equations of motion is the EH action, plus a cosmological constant \begin{equation} \mathcal{S}_{EH}=\int d^d x \sqrt{g}( M_P ^2 R +2 \Lambda). \end{equation} Its generalization to higher dimensions takes the form \cite{Lovelock:1971yv} \begin{align} &{\cal L}^{(n)}={n!\over 2^{n/2}} \delta^{[\mu_1}_{\nu_1} \cdots \delta^{\mu_n]}_{\nu_n}R_{\mu_1\mu_2}^{\ \ \ \ \ \nu_1\nu_2}R_{\mu_3\mu_4}^{\ \ \ \ \ \nu_3\nu_4}\cdots\nonumber \\ &\cdots R_{\mu_{n-1}\mu_n}^{\ \ \ \ \ \ \ \nu_{n-1}\nu_n},\ \ \ n=0,2,4,\ldots \,. \label{lovelock1} \end{align} $n=0$ identifies the cosmological constant, $n=2$ the EH action and $n=4$ the GB density. Given the antisymmetrization present in its definition, this is nonzero only in specific dimensions. Once the indices are contracted, the resulting density and its coordinate dependence can be extended to any dimension. The reduction of the action to the topological dimension $d=4$ for E ($E_4$) is investigated by an embedding of the metric into the extra $(d-4)$ dimensions, a procedure which is not unique \cite{Coriano:2022ftl}. The case $n=4$, with $d=4$, defines the GB density \begin{align} \label{ffr} V_E(g,d)\equiv &\mu^{\varepsilon} \int\,d^dx\,\sqrt{-g}\,E , \end{align} where $\mu$ is a renormalization scale and $E$ is the integrated Euler-Poincar\`e density \begin{eqnarray} \label{GB1} E& =& R^2 - 4 R^{\mu \nu} R_{\mu \nu} + R^{\mu \nu \rho \sigma} R_{\mu \nu \rho \sigma}, \end{eqnarray} whose inclusion modifies the EH action just by boundary contributions, since in an ordinary EGB theory \begin{equation} \mathcal{S}_{EGB}=S_{EH} + g_s V_E, \label{first} \end{equation} the GB term is evanescent at $d=4$. Its contribution to the gravitational equation of motion \begin{equation} \frac{1}{\kappa}\left(R_{\mu\nu}-\frac{1}{2}g_{\mu\nu}R+\Lambda_{0}g_{\mu\nu}\right)+ g_s(V_{E}(d))_{\mu\nu}=0, \label{GB2} \end{equation} explicitly given by \begin{align} \label{ep3} &V_E^{\mu\nu}\equiv \frac{\delta V_E}{\delta g_{\mu\nu}}= \sqrt{-g} \biggl ( \frac{1}{2} g^{\mu \nu} E_4 - 2 R^{\mu \alpha \beta \gamma}R^\nu_{\alpha \beta \gamma} +\nonumber \\ & 4 R^{\mu \alpha} R^\nu_{\ \alpha} + 4 R^{\mu \alpha \nu \beta} R_{\alpha \beta} - 2 R R^{\mu \nu} \biggl ), \end{align} vanishes at $d=4$ if we use \eqref{GB1}. In $d>4$, $V_E$ is not a boundary term, and is indeed contemplated by Lovelock' s theorem as a possible modification of the EH action (see \cite{Edelstein:2014dje, Charmousis:2014mia}). We are going to investigate the conformal constraints associated with this term in $d$ dimensions, that have not been investigated before. A similar singular limit can be performed at $d=6$ for the topological invariant $E_6$, cubic in the curvature, extending the strategy discussed in this work.\\ As we have already discussed in the introduction, such constraints are a natural consequence of the role played by such terms in the context of conformal anomaly actions in every even dimensions. \\ As mentioned, when expanded around a flat spacetime $g_{\mu\nu}=\eta_{\mu\nu} +\kappa h_{\mu\nu}$, the operators of highest derivatives $(\sq^2)$ of the GB action, contributing to the quadratic term in the action ($h\sq^2 h$), cancel out, showing that the theory is free of ghosts. We recall that at quadratic order, the contribution to an action containing the Riemann tensor and its contractions, with arbitrary combinations, is affected by a propagator with double poles in the form \begin{align} \label{exE} &\int d^d \sqrt{g} \left((R_{\mu\nu\rho\sigma})^2 + a_1 (R_{\mu\nu})^2 + a_2 R^2\right)=\nonumber \\ &\frac{1}{4}\int d^d x \sqrt{g}\left( (a_1 + 4) h_{\mu\nu} \sq^2 h_{\mu\nu} +(a_2-1)h\sq^2 h \right) +\nonumber \\ & O(h^3) \end{align} that vanish if $a_1$ and $a_2$ are chosen to reproduce the Euler-Poincar\`e density. \\ For general metric background, the analysis of the behaviour of such actions can be performed starting from a conformal decomposition \begin{equation} \label{cd} g_{\mu\nu}=\bar{g}_{\mu\nu}e^{2 \phi} \end{equation} and eliminating the dilaton using its expression in terms of the entire metric $g$. The theory becomes nonlocal if the dilaton is removed from the spectrum, as suggested for the conformal anomaly action in \cite{Mazur:2001aa}. One relies on integrable conformal decompositions, such as the one discussed in \cite{Barvinsky:1995it}, recently investigated in connection with the perturbative hierarchy of the conformal Ward identities for a specific 4-point function in \cite{Coriano:2022jkn}. Different nonlocal forms of such actions are possible, which differ - rather nontrivially- by different possible inclusions of Weyl invariant terms. As in the $d=2$ case, in order to bring the dynamics of $V_E$ down to $d=4$ from $d>4$, bypassing its evanescence, one can perform a similar singular rescaling of the coupling \begin{equation} \label{re} g_sV_E\to g_s(d) V_E\qquad g_s(d)\equiv \frac{g_s\mu^\epsilon}{d-4} \end{equation} in order to remodulate $g_s V_E$ as a $0/0$ contribution. Obviously, the definition of the $4d$, $(d=4)$ singular limit of the GB theory, requires a specific compactification, which depends on the underlying geometry and is, in general, affected by extra Kaluza-Klein modes. We are essentially performing an infinite coupling limit ($g_s\to g_s(d)$) on the GB term, as we approach the dimension at which the GB contribution is topological. These variant theories should be seen as classical modifications of the EH action that resolve the evanescence of a certain topological term in specific even dimensions.\\ Compared to the ordinary Lovelock's classification of pure gravity actions yielding equations of motion of second order, this procedure is essentially new. As mentioned, it can be performed in any even dimension, starting with $d = 2$.\\ In this work we are going to provide the expression of the nonlocal EGB action expanded up to quartic order (4-graviton vertex) in the fluctuations around a classical metric background. The result is derived elaborating on various previous analysis of the conformal anomaly actions, adapted and simplified for $4d$ EGB theories. Notice that the conformal Ward identities (CWIs) derived for the $\mathcal{S}_{WZ}$ theory carry the same structure of the anomalous CWIs characterizing the quantum anomaly action \cite{Coriano:2021nvn}, where vertices of the $V_E$ term defined in \eqref{ffr}, obtained by differentiating this functional, are constrained by the fundamental symmetries. \\ The main difference between a classical and a quantum approach lays in the fact that the constraints obtained by the procedure either apply to classical vertices - for $4d$ EGB theories - or to quantum averages of correlation functions, if the analysis is performed in a quantum context. In this second case, the classical action in the functional integral $S_o(\chi_i,g)$, where the $\chi_i$'s are generic conformal field, is decomposed in terms of the two components $\bar{g}$ and $\phi$ of \eqref{cd}, corresponding to the fiducial metric and the dilaton field. A similar decomposition can be introduced for the GB term, with equations of motion that are constrained by the "anomaly" of $V_E$, defined below in \eqref{epx}, which is Weyl variant for general $d$. \subsection{Singular rescalings and finite subtractions} The singular rescaling of the coupling can be applied to any topological term, such as $E_4, E_6$ and so on. In practice, the method is sufficient in order to regulate the $0/0$ limit of the $d=4$ action, though the result, as we have mentioned, depends on the geometry of the compactification. In practical terms, the resulting actions are usually simplified, by neglecting the dependence of the metric on the extra coordinates while they reduced them to $d=4$. This is a procedure that, even if not stated explicitly in the literature, is essentially based on dimensional reduction (DRed), in the form described in \cite{Coriano:2022ftl}. Conformal anomaly effective actions, to which $4d$ GB models are related, are derived by a similar procedure, applied to the GB ($V_E$) and the Weyl tensor squared ($V_{C^2}$) counterterms. The latter, in the case of a $4d$ EGB, is unnecessary. \\ The topological evanescence of the $V_E$ contribution is lifted by the procedure, but some ambiguities are encountered, due to the non-unique choice of the background metric against which $ V_E $ is calculated, which remains an indetermination of the method \cite{Coriano:2022ftl}. \\ The derivation of the geometric effective action depends on the specific choice of the fiducial metric and of the subtraction term, here identified in the form of a Wess-Zumino action \cite{Coriano:2022knl} via the conformal decomposition, although other subtractions are possible. A discussion of this point can be found in \cite{Coriano:2022ftl}. \\ The regularization of the action that results from \eqref{re} is not uniquely defined, since the DRed procedure is naturally affected by an integration cutoff. The singular limit of the GB term is investigated by a Weyl rescaling of this term in $d\neq 4$, which introduces a dilaton in the spectrum, and the $\epsilon=d-4\to 0$ expansion is performed afterwards, accompanied by the DRed procedure. \subsection{Content of this work} The goal of our work is to identify the constraints satisfied by the classical vertices of the theory, obtained by removing the dilaton from the spectrum, and resorting to a nonlocal description of the 4d GB theory. The local version of such theory, which is given by dilaton gravity, therefore, is replaced by a nonlocal theory when a finite (classical) renormalization of the GB interaction, proportional to an $R^2$ term, is added to the usual GB action, which is allowed by the singular limit . \\ We identify the constraints satisfied by the vertices of such nonlocal action once its expression is expanded around flat space. These correspond to a set of Ward identities which are naturally satisfied by the Weyl-variant part of a renormalized anomaly action, due to the similarity between such action, which describes the Weyl/conformal anomaly, and the $4d$ EGB theory. We provide a description of such vertices up to quartic order in the fluctuations around a flat background. The conformal constraints satisfied by the vertex derived from $V_E(g,d)$ are valid in $d$ dimension due to the fact that Weyl variation of this term given by \eqref{epx} is exactly linear in $(d-4)$. \\ At $d=4$ the evanescence of the term, as already pointed out, is removed by the inclusion of a subtraction, corresponding to a classical renormalization, and the conformal constraints remain valid once we replace $V_E(g,d)$ by the regulated vertex $\hat{V}'_E$, which describes the WZ form of the action. \\ Section 4 contains a first principle discussion of the constraints on the equations of motion found once we perform a conformal decomposition, showing that they are a rigorous consequence of symmetry \eqref{sym} . The latter is broken by the subtraction term introduced in the definition of $\hat{V}'_E$. Also in this case, the corresponding constraint, given in \eqref{fin}, is naturally borrowed from the case of the conformal anomaly actions \cite{Coriano:2022ftl}. \section{The local EGB theory and the nonlocal action} The correctly regulated theory takes the form of a Wess-Zumino (WZ) action, which depends on the regularization procedure and the treatment of the dilatonic field $(\phi)$. The $0/0$ regularization follows closely the 2D case, where the Einstein-Hilbert term is also topological, and the limit is performed by redefining the coupling as $\alpha\to \alpha/(d-2)$. In general, dilaton effective actions may contain solutions with the conformal factor that needs to be stabilized around a certain scale $f$. Such a scale is the conformal breaking scale. The scale ($f$) is required in order to redefine the dimensionless conformal factor of the metric $g$ in the conformal decomposition \eqref{sym}. The local shift symmetry, which allows to identify a fiducial metric and the dilaton field, via the transformation \begin{equation} \label{sym} \phi\to \phi -\sigma , \,\,\bar{g}_{\mu\nu}\to \bar{g}_{\mu\nu} e^{2\sigma} \end{equation} with $\sigma=\sigma(x)$, is indeed broken by the regularization of the Lagrangian in the $0/0$ limit. This issue is not present in the nonlocal action, since $\phi$ can be eliminated in terms of the entire metric, but, as we have already mentioned, one needs to perform an additional finite renormalization of the action \cite{Mazur:2001aa} in order to reduce the equations of motion for $\phi$ to a linear form. A EGB theory is not uniquely defined in such a singular limit, due to several issues, related to the selection of the background metric and to the regularization procedure that it is invoked. The $V_E$ (GB) term can be expanded around $d=4$ in several ways. One possibility is defined by the ordinary DR-like procedure \begin{equation} \label{expand1} \frac{1}{\varepsilon}V_{E}(g,d)=\frac{\mu^{\epsilon}}{\epsilon}\left( V_{E}(g,4) + \epsilon V_{E}'(g,4) +O(\varepsilon^2) \right), \end{equation} in terms of a single metric $g$, implicitly defining the GB part of the EGB action in the form \begin{equation} \label{oone1} V'_E=\frac{1}{\epsilon}\left( V_E(g,d)-V_E(g,4)\right). \end{equation} Note that the subtraction term $V_E(g,4)$ obviously does not contribute to the dynamics, for being topological, and amounts just to a constant being added to the action, since \begin{equation} V_E(4)=\int d^4 x \sqrt{g} E=4\pi \chi_0(\mathcal{M}), \end{equation} where $\chi_0(M)$ is the Euler-Poincar\`e characteristic of a manifold $M$. Therefore, the evanescence of the GB contribution $V_E$ is related to the fact that at $d=4$ its variation is zero, together with all the classical vertices derived from its functional differentiation \begin{equation} \label{es} V_E^{\mu_1\nu_1\ldots \mu_n\nu_n}=\frac{\delta^n V_E(4)}{\delta g_{\mu_1\nu_1}\ldots \delta g_{\mu_n\nu_n}}. \end{equation} The finiteness of the contributions generated by the renormalized vertices $1/\epsilon V_E^{\mu_1\nu_1\ldots \mu_n\nu_n}(d)$ is therefore related to the $O(\epsilon)$ behaviour of \eqref{es} as $\epsilon\to 0$, as we will discuss next. This generates a finite EGB theory of the form \begin{equation} \mathcal{S}_{EGB}=S_{EH} +V'_E, \label{first1} \end{equation} where $V'_E$ is bound to satisfy the constraint \begin{equation} \frac{\delta}{\delta\phi} V'_E=\sqrt{g} E, \label{he} \end{equation} as recognized in the conformal anomaly effective action. Alternatively, the finite action could be defined in the Wess-Zumino (WZ) form \begin{equation} \label{WZ} \mathcal{S}_{WZ}\equiv \hat{V}'_E= \lim_{d\to 4}\frac{1}{\epsilon} \left(V_{E}(\bar{g} e^{2 \phi},d) -V_E(\bar{g},d)\right) \end{equation} that differs from \eqref{oone1} by Weyl invariant terms \begin{equation} \mathcal{S}_{EGB}=S_{E.H} +\mathcal{S}_{WZ}. \label{first2} \end{equation} The different EGB actions that can be generated in the $d\to 4$ limit are all associated with the treatement of the $V_E$ term, a procedure that should be completely defined in DR and with the choice of a specific fiducial metric $\bar{g}$. This would correspond to the choice of a specific scheme, as usually done in Minkowski space. Note that contracting \eqref{ep3} with $2 g^{\mu\nu}$ gives the relation \begin{equation} \label{epx} 2 g_{\mu\nu}\frac{\delta}{\delta g_{\mu\nu}}\int d^d y \sqrt{-g} E(y)=\epsilon \sqrt{g}E(x), \end{equation} which is at the core of \eqref{he}, since the subtraction term $V_E(\bar g, d)$ is Weyl independent. Such subtraction is essential in order to generate a $0/0$ limit of the topological term and obtain, henceforth, a finite action. This Weyl variation is an exact property of the $V_E$ terms, therefore valid to all orders in $\epsilon$. We will come back to it in a next section, when discussing its implication in the context of Lovelock theory. \eqref{epx} is identified using the scaling relation \begin{align}\label{GaussB} &\sqrt{-g} E=\sqrt{\bar g} e^{(d-4)\phi}\biggl \{ \bar E+(d-3)\bar\nabla_\mu \bar J^\mu(\bar{g},\phi)+ \nonumber \\ &(d-3)(d-4)\bar K(\bar{g},\phi) \biggl \}, \end{align} where we have defined \begin{align} \label{GBexJ} &\bar J^\mu(\bar{g},\phi)=8\bar R^{\mu\nu}\bar\nabla_\nu\phi-4\bar R\bar \nabla^\mu\phi +\nonumber \\ &4(d-2)(\bar\nabla^\mu\phi\bar \sq \phi-\bar \nabla^\mu\bar\nabla^\nu\phi\bar \nabla_\nu\phi+\bar\nabla^\mu\phi\bar\nabla_\lambda\phi\bar\nabla^\lambda\phi), \end{align} \begin{align} \label{GBexK} &\bar K(\bar{g},\phi)=4\bar R^{\mu\nu}\bar\nabla_\mu\phi\bar\nabla_\nu\phi-2\bar R\bar\nabla_\lambda\phi\bar\nabla^\lambda\phi+\nonumber \\ &4(d-2)\bar\sq\phi\bar\nabla_\lambda\phi\bar\nabla^\lambda\phi+(d-1)(d-2)(\bar \nabla_\lambda \phi\bar \nabla^\lambda \phi)^2, \end{align} that allows to perform the expansion in $\epsilon$ of the form \begin{align} \label{red1} &V_E(g,d)=\int d^d x \sqrt{\bar{g}}\left(\bar E + \bar\nabla_M \bar J^M \right) +\nonumber \\ &\epsilon\int d^d x \sqrt{\bar g} \phi\left( \bar E + \bar\nabla_M \bar J^M \right) +\epsilon \int d^d x \sqrt{\bar g} K. \end{align} The scheme dependence of the regularization comes as a last step, when the integrals present in \eqref{WW} are reduced to $d=4$ from general $d$ dimensions. This can can be obtained by introducing a cutoff ($L$) in the extra dimensions in the form \begin{eqnarray} \label{WG in generic case} &\frac{1}{d-4}V_E(g,d) =\frac{1}{\epsilon} \left({L}{\mu}\right)^{\epsilon}\int d^4x \sqrt{-g} \ {}_4 \bar{E}+\nonumber\\ &+ \left({L}{\mu}\right)^{\epsilon}\int d^4x \sqrt{-g}\ \Big[\phi {}_4\bar{ E}-(4 {} G^{\mu\nu}(\bar\nabla_\mu\phi\bar\nabla_\nu\phi) +\nonumber \\ &2(\nabla_\lambda \phi \nabla^\lambda \phi )^2 +4\sq\phi \nabla_\lambda \phi \nabla^\lambda \phi ) \Big], \end{eqnarray} where all the terms in the integrands are 4-dimensional and $L$ is a space cutoff in the $d-4$ extra dimensions. $L^{\epsilon}$ is the volume of the extra space. Taking the $\epsilon\to 0$ limit and the conformal separation $g_{\mu\nu}=\bar g_{\mu\nu}e^{2 \phi}$ for the fiducial metric, we finally derive the expressions \begin{align} \label{rdef} &\hat{V}'_E( g, \phi)\equiv\mathcal{S}_{WZ}=\frac{1}{\epsilon}\left(V_E(g,d)-V_E(\bar g,d)\right)=\nonumber\\ &\int d^4x \sqrt{-g} \Big[\phi {}_4 E-(4 {} G^{\mu\nu}(\bar\nabla_\mu\phi\bar\nabla_\nu\phi)+2(\nabla_\lambda \phi \nabla^\lambda \phi )^2 +\nonumber \\ &4\sq\phi \nabla_\lambda \phi \nabla^\lambda \phi ) \Big]. \end{align} It is easy to show that the use of the regularization in the form given above, by subtracting $V_E(\bar g,d)$ in $d$ dimensions - rather than at $d=4$ - is eliminating some Weyl invariant terms \cite{Coriano:2022ftl}. The local action given above is quartic in $\phi$, and its structure depends on the chosen fiducial metric.\\ In summary, it is possible to define a consistent procedure for the extraction of the effective action at $d=4$, from the singular limit of a topological term. The approach can be performed in $d$ dimensions by a 1) rescaling of the topological density using \eqref{GaussB}, with a metric which is d-dimensional. This implies, obviously, that the dilaton field carries dependence on the extra dimensions. At the last stage, 2) we dimensionally reduce the fields, by allowing only the zero mode of $\phi$ to survive the compactification procedure, while the extra components of the metric are assumed to be flat. The cutoff $L$ in the size of the extra dimensions is introduced in order to guarantee the convergence of the integral $V_E$ in the $d\to 4$ limit. Finally, 3) we subtract the same term expressed only in terns of the fiducial metric, performing the limit.\\ As shown above, the subtraction can be performed either as in \eqref{oone1} or as in \eqref{WZ}, the difference between the two being given by Weyl invariant terms, described in \cite{Coriano:2022ftl}. The $\mathcal{S}_{WZ}$ action, which identifies a contribution that we have also called $\hat{V}'_E$ in \eqref{WZ}, will define our starting action. \subsection{The $4d$ EGB + $R^2$ theory} We briefly summarize the steps that take to the nonlocal action. One may proceed by introducing a finite renormalization/extension of the topological term, in order to derive a different version of $\mathcal{S}_{WZ}$, which is quadratic in $\phi$, rather than quartic. This is obtained by extending the topological term at $O(\epsilon)$ in the form \cite{Mazur:2001aa} \begin{equation} E_{ext}=E_4 +\epsilon\frac{R^2}{2 (d-1)^2}, \label{eee} \end{equation} and the singular limit performed on the functional \begin{equation} \label{ss1} \tilde{V}_E=\int d^d x \sqrt{g}E_{ext}. \end{equation} The effective action is then defined similarly to \eqref{fin}, with $\mathcal{S}_{WZ}$ in \eqref{rdef} now redefined by the inclusion of \eqref{eee} \begin{equation} \label{MWZ} \tilde{\mathcal{S}}_{WZ}= \frac{1}{\epsilon} \left(\tilde{V}_{E}(\bar{g} e^{2 \phi},d) -\tilde{V}_E(\bar{g},d)\right) \end{equation} induced by this additional finite modification of the action. A direct computation, using the rescaling formula for $R^2$ \begin{align} &\sqrt{g}R^2=\sqrt{\bar g}e^{\epsilon \phi}\biggl( \bar R -2 (d-1) \bar\sq \phi -\nonumber \\ &(d-1)(d-2) \bar\nabla_\lambda\phi\bar\nabla^\lambda\phi\biggl)^2\biggl ) \end{align} gives, after an expansion at $O(\epsilon)$ \begin{align} &\frac{1}{\epsilon}\int d^d x \sqrt{g}E_{ext}=\frac{1}{\epsilon}\int d^4 x\sqrt{\bar g} \biggl( \bar E + \bar\nabla\cdot \bar J \biggl) +\nonumber \\ &\int d^4 x\sqrt{\bar g}\phi\biggl(\bar E + \bar\nabla\cdot \bar J \biggl) \nonumber \\ &+\int d^4 x\sqrt{\bar g}\biggl( \bar K + \frac{1}{2(d-1)^2}\biggl[ \bar R -2 (d-1) \bar\sq \phi -\nonumber\\ &(d-1)(d-2) \bar\nabla_\lambda\phi\bar\nabla^\lambda\phi\biggl]^2 \biggl).\nonumber \\ \end{align} The expression can be simplified by some integration by parts and the omission of boundary terms. Explicitly, one uses \begin{align} &\phi \bar\nabla\cdot \bar J=-8 \bar R^{\mu\nu}\bar\nabla_\mu\phi \bar\nabla_\nu\phi +4\bar R\bar\nabla^\mu\phi\bar\nabla_\mu\phi-\nonumber \\ &4(d-2)\bar\nabla_\mu\phi \bar\nabla^\mu\phi \bar\sq\phi +4(d-2) \bar\nabla^\mu\bar\nabla^\nu\phi \bar\nabla_\nu\phi\bar\nabla_\mu\phi\nonumber\\ &-4 (d-2)(\bar\nabla_\mu\bar\nabla^\mu\phi)^2 +\textrm{b.t.} \end{align} and \begin{equation} \bar\nabla^\mu\bar\nabla^\nu\phi \bar\nabla_\nu\phi\bar\nabla_\mu\phi=-\frac{1}{2} \bar\nabla^\mu\phi\bar\nabla_\mu\phi\bar\sq\phi +\textrm{b.t.} \end{equation} (where $\textrm{b.t.}$ indicates the boundary terms). This gives the modified relation \begin{equation} \delta_\phi\int d^d x \sqrt{g} E_{ext}=\epsilon \sqrt{g}(E_{ext}- \frac{2}{d-1} \sq R) \end{equation} which can be used in \eqref{ss1} to give \begin{equation} \frac{\delta}{\delta\phi}\frac{1}{\epsilon}\tilde{V}_E(g_{\mu\nu},d)= \sqrt{g}\left(E-\frac{2}{3}\sq R + \epsilon\frac{R^2}{2(d-1)^2}\right). \end{equation} Therefore from \eqref{MWZ} we derive the Weyl variation \begin{eqnarray} \frac{\delta \mathcal{S}^{WZ}}{\delta\phi}&=&\alpha\sqrt{g}\left(E-\frac{2}{3}\sq R \right)\nonumber \\ &=&\alpha\sqrt{\bar g}\left(\bar E-\frac{2}{3}\bar \sq\bar R + 4 \bar\Delta_4 \phi\right). \label{solve} \end{eqnarray} Note that the redefinition of the GB density $(E\to E_{ext})$ allows to re-obtain a rescaling of the combination $E -2/3 \sq R$ as in $d=4$, where $\Delta_4$ is the fourth order self-adjoint operator. This is conformal invariant \begin{equation} \Delta_4 = \nabla^2 + 2\,R^{\mu\nu}\nabla_\mu\nabla_\nu - \frac23\,R{\sq} + \frac13\,(\nabla^\mu R)\nabla_\mu\, \label{120} \end{equation} and satisfies the relation \begin{equation} \sqrt{-g}\,\mathcal{D}_4\chi=\sqrt{-\bar g}\,\bar{\mathcal{D}}_4 \chi,\label{point2} \end{equation} if $\chi$ is invariant (i.e. has scaling equal to zero) under a Weyl transformation. This brings the action $\tilde{\mathcal{S}}_{WZ}$ to the form \begin{equation} \tilde{\mathcal{S}}_{WZ}= \alpha\int\,d^4x\,\sqrt{-\bar g}\,\left\{\left(\overline E - {2\over 3} \bar{\sq} \overline R\right)\phi + 2\,\phi\bar\Delta_4\phi\right\}.\, \label{WZ2} \end{equation} The elimination of $\phi$ can be performed quite directly. Using the currents \begin{align} &J(x)=\bar{J}(x) + 4 \sqrt{g}\Delta_4\phi(x),\qquad \bar J(x)\equiv \sqrt{\bar g}\left( \bar E-\frac{2}{3}\bar \sq \bar R\right), \nonumber\\ & J(x)\equiv \sqrt{ g}\left( E-\frac{2}{3} \sq R\right) \label{inv} \end{align} and the quartic Green function of $\Delta_4$ \begin{equation} (\sqrt{-g}\,\mathcal{D}_4)_xD_4(x,y)=\d^4(x,y).\label{point4} \end{equation} We can invert \eqref{inv}, obtaining \begin{equation} \label{onshell} \phi(x)=\frac{1}{4}\int d^4y\,D_4(x,y)(J(y)- \bar{J}(y)). \end{equation} The expression of $\phi$ in terms of the entire metric $g$ is what defines a conformal decomposition of the metric, which in this case is integrable, in the sense that we can express $\phi$ covariantly. $\tilde{\mathcal{S}}_{WZ}$ can be obtained by solving the equation \begin{equation} \frac{\delta \tilde{\mathcal{S}}_{WZ}}{\delta \phi}=J, \end{equation} clearly identified in the form \begin{equation} \tilde{\mathcal{S}}_{WZ}=\int d^4 x \left(\bar J \phi + 2\phi(\sqrt{g} \Delta_4) \phi\right). \end{equation} At this stage it is just matter of inserting the expression of $\phi$ given by \eqref{onshell} into this equation to obtain the WZ action in the form \begin{equation} \tilde{\mathcal{S}}_{WZ}=\mathcal{S}_{anom}(g)- \mathcal{S}_{anom}(\bar g), \label{WW} \end{equation} with \begin{equation} \mathcal{S}_{anom}(g)=\frac{1}{8}\int d^4 x d^4 y J(x) D_4(x,y) J(y), \end{equation} and a similar expression for $\mathcal{S}_{anom}(\bar g)$. Using the explicit expression of $\phi$, and including the contribution from the rescaled $C^2$ term, we finally find the nonlocal and covariant anomaly effective action as \begin{align} &\mathcal{S}_{\rm anom}^{}(g) =\frac {1}{8}\!\int \!d^4x\sqrt{-g_x}\, \left(E - \frac{2}{3}\,\raise.5pt\hbox{$\nbox{.09}{.09}$}\, R\right)_{\!x} \nonumber\\ &\int\! d^4x'\sqrt{-g_{x'}}\,D_4(x,x')\left[\frac{b'}{2}\, \left(E - \frac{2}{3}\,\raise.5pt\hbox{$\nbox{.09}{.09}$}\, R\right) \right]_{x'}. \label{Snonl} \end{align} \section{ Constraints on $V_E$ in $d$ dimensions for Lovelock gravity} \label{heres} The presence in 4d EGB of a topological term has important implications concerning the structure of such classical contributions. This point can be understood more clearly by discussing the role of the term $g_s(d)V_E$ in the context of the conformal anomaly effective action \cite{Coriano:2022ftl}. This action is naturally derived from a path integral, once we integrate out a conformal sector, and one can show that the counterterm sector - that in this case involves also the square of the Weyl tensor - separately satisfies anomalous CWIs. \\ The derivation of such identities follows a direct pattern, that consists in writing down the conformal anomaly action in a background metric endowed with conformal Killing (CKVs) vectors. In this section we illustrate the derivation of these constraints that define, in the context of the $4d$ GB theory, the application of this method. This point can be understood geometrically in the following way. \\ In a local free falling frame of a curved spacetime (i.e. in tangent space), we require that a certain action is endowed with a conformal symmetry, enlarging the usual local Poincar\`e symmetry of Einstein's theory. Such conformal symmetry of each local frame can be gauged in the form of a general metric that allows CKVs. In the case of a conformal anomaly action, the contribution coming from $V_E$, as already mentioned, is paired with $V_{C^2}$. The latter is the only effective counterterm needed in order to remove the singularity of the quantum corrections at $d=4$. The CWIs of the complete effective action get splitted into three separate contributions: those derived from the renormalized quantum corrections and those associated with $V_E$ and $V_{C^2}$. All the three contributions satisfy separate conservation WIs and CWIs. Those corresponding to the finite renormalized quantum corrections, once we perform the flat spacetime limit, are ordinary, while the other two hierarchies, related to $V_E$ and $V_{C^2}$, are anomalous. The constraints on these functionals come from their response once we perform a variation respect to the conformal factor $\phi$. \\ We detail the derivation of this point. \\ We recall that the CKVs are solutions of the equation \begin{equation} \nabla_\mu \xi_\nu + \nabla_\nu \xi_\mu = \frac{2}{d} \nabla_\lambda \xi^\lambda g_{\mu \nu} . \label{bb} \end{equation} To derive the CWI's in the flat limit, we need to require that the background metric allows CKVs that leave the action invariant. We start from the conservation of the conformal current \begin{equation} \int d^d x \sqrt{g}\, \nabla_\mu \left( \xi_\nu^{(K)} V_E^{\mu\nu}\right)=0, \label{eew} \end{equation} and, analogously, we can write \begin{equation} \int d^d x \sqrt{g}\, \nabla_\mu \left( \xi_\nu V_E^{\mu\nu\mu_1\nu_1}\right)=0. \label{Ve2} \end{equation} The identity \begin{align} \label{CKVconflat11} &2 \delta_{\mu \nu} \delta^{\lambda \rho} \xi_\lambda \partial_\rho \phi = 2 \delta_{\mu \nu} e^{2 \phi} g^{\lambda \rho} \xi_\lambda \partial_\rho \phi = \nonumber\\ &2 \delta_{\mu \nu} e^{2 \phi} \xi^\lambda \partial_\lambda \phi \end{align} can be used in the covariant derivatives of \eqref{bb} to obtain \begin{align} \label{CKVconflat1} &\partial_\mu \xi_\nu - 2 \xi_\mu \partial_\nu \phi + \partial_\nu \xi_\mu - 2\xi_\nu \partial_\mu \phi + 2 \delta_{\mu \nu} \delta^{\lambda \rho} \xi_\lambda \partial_\rho \phi=\nonumber\\ & \frac{2}{d} \partial_\lambda \xi^\lambda e^{2 \phi} \delta_{\mu \nu} + 2 \delta_{\mu \nu} e^{2 \phi} \xi^\lambda \partial_\lambda \phi. \end{align} This can be written in the form \begin{align} \label{CKVconflat12} &\partial_\mu \xi_\nu - 2 \xi_\mu \partial_\nu \phi + \partial_\nu \xi_\mu - 2\xi_\nu \partial_\mu \phi = \nonumber\\ &e^{2 \phi}[ \partial_{\mu} (e^{- 2 \phi} \xi_\nu ) + \partial_{\nu} (e^{- 2 \phi} \xi_\mu ) ] =\nonumber\\ &e^{2 \phi} (\delta_{\nu \lambda} \partial_\mu + \delta_{\mu \lambda} \partial_\nu )\xi^\lambda , \end{align} Substituting \eqref{CKVconflat11} and \eqref{CKVconflat12} in \eqref{CKVconflat1} we get \eqref{bb} with the ordinary derivative replacing the covariant ones \begin{equation} \label{flatc} \partial_\mu \xi_\nu+\partial_\nu \xi_\mu=\frac{2}{d}\delta_{\mu\nu}\,\left(\partial\cdot \xi\right). \end{equation} Writing explicitly the action of the covariant derivative in \eqref{eew} and taking the flat limit, then we obtain the constraint \begin{align} 0=\int\,d^dx\,\bigg(\partial_\mu \xi_\nu\,V_{E}^{\mu\nu\mu_1\nu_1}+ \xi_\nu\,\partial_\mu\,V_E^{\mu\nu\mu_1\nu_1}\bigg). \end{align} We recall that $\xi_\nu$ satisfies the conformal Killing equation in flat space and by using \eqref{Ve2}, the equation above can be re-written in the form \begin{align} 0=\int\,d^dx\,\bigg(\xi_\nu\,\partial_\mu V_E^{\mu\nu\mu_1\nu_1}+\frac{1}{d}\big(\partial\cdot \xi\big)\delta_{\mu\nu}\,V_E^{\mu\nu\mu_1\nu_1}\bigg).\label{newcons} \end{align} If we use in this previous expression the conservation and the trace identities for $V_E^{\mu\nu\mu_1\nu_1}$, that are explicitly given by \begin{align} &\partial_\mu V_E^{\mu\nu\mu_1\nu_1}(x,x_1)=\bigg(\delta^{(\mu_1}_\mu\delta^{\nu_1)}_\lambda\partial^\nu\delta(x-x_1)-\nonumber \\ &2\delta^{\nu(\mu_1}\delta^{\nu_1)}_\mu\partial_\lambda\delta(x-x_1)\bigg)V_E^{\lambda\mu}(x),\label{consTT}\nonumber \\ &\delta_{\mu\nu}V_E^{\mu\nu\mu_1\nu_1}(x,x_1)=2(d-4)\big[\sqrt{-g(x)}E(x)\big]^{\mu_1\nu_1}(x_1)-\nonumber \\ &2\delta(x-x_1)V_E^{\mu_1\nu_1}(x) \end{align} together with the explicit expression of the Killing vector $\xi^{(C)}_\nu$ for the special conformal transformations, we derive the relation \begin{equation} \begin{split} \xi^{(C)\,\kappa}_\mu&=2x^\kappa\,x_\mu-x^2\delta^\kappa_\mu\\ \partial\cdot \xi^{(C)\,\kappa}&=2d\,x^\kappa \end{split}\label{spc} \end{equation} where $\kappa=1,\dots,d$. By using \eqref{spc} in the integral \eqref{newcons}, we derive the relation \begin{align} 0=\int\,d^dx\,\bigg[\big(2x^\kappa\,x_\nu-x^2\delta^\kappa_\nu\big)\partial_\mu\,V_E^{\mu\nu\mu_1\nu_1} \nonumber \\ +2\,x^\kappa\,\delta_{\mu\nu}V_E^{\mu\nu\mu_1\nu_1}&\bigg] \end{align} that can be cast into the form \begin{align} &0=\int\,d^dx\,\bigg[\big(2x^\kappa\,x_\nu-x^2\delta^\kappa_\nu\big)\bigg(\delta^{(\mu_1}_\mu\delta^{\nu_1)}_\lambda\partial^\nu\delta(x-x_1)-\nonumber \\ & 2\delta^{\nu(\mu_1}\delta^{\nu_1)}_\mu\partial_\lambda\delta(x-x_1)\bigg)V_E^{\lambda\mu}(x) -4\,x^\kappa\,\delta(x-x_1)V_E^{\mu_1\nu_1}(x)\bigg]. \end{align} Integrating by parts, we obtain the expression \begin{align} &\left(2d\,x_1^\kappa+2x_1^\kappa\,x^{\mu}_1\frac{\partial}{\partial x_1^\mu}+x_1^2\frac{\partial}{\partial x_{1\kappa}}\right)V_E^{\mu_1\nu_1}+\nonumber\\ &2\bigg(x_{1\lambda}\,\delta^{\mu_1\kappa}-x_1^{\mu_1}\delta^\kappa_\lambda\bigg)V_E^{\lambda\nu_1}(x_1)\notag\\ &+2\bigg(x_{1\lambda}\,\delta^{\nu_1\kappa}-x_1^{\nu_1}\delta^\kappa_\lambda\bigg)V_E^{\mu_1\lambda}(x_1)=\nonumber\\ &4(d-4)\,\int dx\,x^\kappa\big[\sqrt{-g(x)}E(x)\big]^{\mu_1\nu_1}(x_1) \end{align} which is the special CWIs satisfied by $V_E^{\mu_1\nu_1}$. This relation is, in this case, trivially satisfied just because $V_E^{\mu_1\nu_1}$, in the flat limit, vanishes. Non trivial constraints are generated when we consider the contributions - starting from the three graviton vertex onwards - and we have for $n\ge3$ \begin{align} &\sum_{j=1}^n\biggl[2x_j^\kappa\biggl(d+x_j^\alpha\frac{\partial}{\partial x_j^\alpha}\biggl)-x_j^2\,\delta^{\kappa\alpha}\frac{\partial}{\partial x_j^\alpha}\biggl]\,\nonumber\\ &V_E^{\mu_1\nu_1\dots\mu_n\nu_n}(x_1,\dots,x_n)+\notag\\ &2\sum_{j=1}^n\biggl(\delta^{\kappa\mu_j}x_{j\,\alpha}-\delta^\kappa_\alpha x_j^{\mu_j}\biggl)\,\nonumber\\ &V_E^{\mu_1\nu_1\dots\nu_j\alpha\dots\mu_n\nu_n}(x_1,\dots,x_j,\dots,x_n)+\notag\\ &2\sum_{j=1}^n\biggl(\delta^{\kappa\nu_j}x_{j\,\alpha}-\delta^\kappa_\alpha x_j^{\nu_j}\biggl)\nonumber\\ &V_E^{\mu_1\nu_1\dots\mu_j\alpha\dots\mu_n\nu_n}(x_1,\dots,x_j,\dots,x_n)=\notag\\ &2^{n+1}(d-4)\,\int d^dx\,x^\kappa\biggl[\sqrt{-g(x)}\,\nonumber\\ &E(x)\biggl]^{\mu_1\nu_1\dots\mu_n\nu_n}(x_1,\dots,x_n). \end{align} The dilatation CWI is obtained by the choice of the CKV of the form \begin{equation} \xi^{(D)}_\mu(x)=x_\mu,\qquad\partial\cdot \xi^{(D)}=d, \end{equation} and equation \eqref{newcons}, in the general case becomes \begin{align} &0=\int d^d x\bigg\{x_\mu\,\partial_\nu V_E^{\mu\nu\mu_1\nu_1\dots\mu_n\nu_n}(x,x_1,\dots,x_n)+\nonumber\\ &\delta_{\mu\nu}V_E^{\mu\nu\mu_1\nu_1\dots\mu_n\nu_n}(x,x_1,\dots,x_n)\label{anomDil}\bigg\}. \end{align} Taking into account the conservation and trace identities satisfied by $V_E^{\mu_1\nu_1\dots\mu_n\nu_n}$ we obtain the final expression \begin{align} &\left(n\,d+\sum_{j=1}^n\,x_j^\alpha\frac{\partial}{\partial x_j^\alpha}\right)\,V_E^{\mu_1\nu_1\dots \mu_n\nu_n}(x_1,\dots,x_n)=\nonumber\\ &2^n(d-4)\int d^dx \left[\sqrt{-g(x)}\,E(x)\right]^{\mu_1\nu_1\dots\mu_n\nu_n}(x_1,\dots,x_n)\label{DilAnom}. \end{align} This constraint is non trivial starting from $n=3$. In momentum space these equations are written as \begin{align} &\left(d-\sum_{j=1}^{n-1}\,p_j^\alpha\frac{\partial}{\partial p_j^\alpha}\right)\,V_E^{\mu_1\nu_1\dots \mu_n\nu_n}(p_1,\dots,\bar{p}_n)=\nonumber\\ &2^n(d-4)\left[\sqrt{-g}\,E\right]^{\mu_1\nu_1\dots\mu_n\nu_n}(p_1,\dots,\bar{p}_n),\label{DilAnomMom} \end{align} and \begin{align} &\sum_{j=1}^{n-1}\left(p_j^\kappa\frac{\partial^2}{\partial p_j^\alpha \partial p_{j\alpha}}-2p_j^\alpha\frac{\partial}{\partial p_j^\alpha\partial p_{j\kappa}}\right)V_E^{\mu_1\nu_1\dots \mu_n\nu_n}(p_1,\dots,\bar{p}_n)\notag\\ &+2\sum_{j=1}^{n-1}\left(\delta^{\kappa\mu_j}\frac{\partial}{\partial p_{j\,\alpha}}-\delta^\kappa_\alpha \frac{\partial}{\partial p_j^{\mu_j}}\right)\nonumber\\ &V_E^{\mu_1\nu_1\dots\nu_j\alpha\dots\mu_n\nu_n}(p_a,\dots,p_j,\dots\bar{p}_n)\notag\\ &+2\sum_{j=1}^{n-1}\left(\delta^{\kappa\nu_j}\frac{\partial}{\partial p_{j\,\alpha}}-\delta^\kappa_\alpha \frac{\partial}{\partial p_j^{\nu_j}}\right)\nonumber\\ &V_E^{\mu_1\nu_1\dots\mu_j\alpha\dots\mu_n\nu_n}(p_a,\dots,p_j,\dots\bar{p}_n)\notag\\ &=-2^{n+1}(d-4)\nonumber\\ &\bigg[\frac{\partial}{\partial p_{n\kappa}}\bigg(\,\left[\sqrt{-g}\,E\right]^{\mu_1\nu_1\dots\mu_n\nu_n}(p_1,\dots,p_n)\bigg)\bigg]_{p_n=\bar{p}_n}, \label{fff} \end{align} where $\bar{p}_n=-\sum_{i=1}^{n-1}p_i$ for the conservation of the total momentum. These constraints are directly satisfied in $d\neq 4 $ dimensions and are therefore typical of Lovelock's theories of gravity in generic dimensions. Notice that the equations above are modified by an overall dimensionful factor both on their lhs and rhs, for dimensional reasons, but leaving \eqref{fff} unaltered. In the $d\to 4$ limit the analysis of these equations requires an accurate study of the degeneracy of such such structures, similarly to the one performed in \cite{Coriano:2022jkn}. \\ In the context of anomaly actions, their reduction to $d\to 4$ requires the inclusion of a Weyl invariant sector, provided by the finite quantum corrections, missing here. \subsection{Conservation identity at $d=4$ and trace identities at $d\neq 4$} The same vertex satisfies a hierarchy of of conservation identity at $d=4$ in flat space, starting from a curved background. Trace Ward identities, instead, are valid for this vertex at $d\neq 4$, as we are going to show next. Indeed, from \begin{equation} \label{vat} \nabla_\mu V_E^{\mu\nu}(x)_g=0, \end{equation} expanding the covariant derivative, we obtain the relation \begin{align} &\partial_{\nu_1}V_E^{\mu_1\nu_1 \mu_2\nu_2 \mu_3\nu_3 \mu_4\nu_4}(x_1,x_2,x_3,x_4)=\notag\\ &-\biggl[2\left(\frac{\delta\Gamma^{\mu_1}_{\lambda\nu_1}(x_1)}{\delta g_{\mu_2\nu_2}(x_2)}\right)_{g=\delta}\nonumber\\ &V_E^{\lambda\nu_1 \mu_2\nu_2 \mu_3\nu_3 \mu_4\nu_4}(x_1,x_2,x_3,x_4)+(23)+(24)\biggl]\notag\\ & -\biggl[4\left(\frac{\delta^2\Gamma^{\mu_1}_{\lambda\nu_1}(x_1)}{\delta g_{\mu_2\nu_2}(x_2)\delta g_{\mu_3\nu_3}(x_3)}\right)_{g=\delta}V_E^{\lambda\nu_1}(x_1, x_4)+\nonumber\\ &(24)+(34)\biggl],\label{transverseX} \end{align} where \begin{align} &\biggl(\frac{\delta\Gamma^{\mu_1}_{\lambda\nu_1}(x_1)}{\delta g_{\mu_i\nu_i}(x_i)}\biggl)_{g=\delta}=\frac{1}{2}\biggl(\delta^{\mu_1(\mu_i}\delta^{\nu_i)}_{\nu_1}\,\partial_\lambda\delta_{x_1x_i}+\nonumber\\ &\delta^{\mu_1(\mu_i}\delta^{\nu_i)}_{\lambda}\,\partial_{\nu_1}\delta_{x_1x_i}-\delta^{(\mu_i}_\lambda\delta^{\nu_i)}_{\nu_1}\,\partial^{\mu_1}\delta_{x_1x_i}\biggl)\nonumber\\[1.5ex] &\left(\frac{\delta^2\Gamma^{\mu_1}_{\lambda\nu_1}(x_1)}{\delta g_{\mu_i\nu_i}(x_i)\delta g_{\mu_j\nu_j}(x_j)}\right)_{g=\delta}=\notag\\ &-\frac{\delta_{x_1x_i}}{2}\delta^{\mu_1(\mu_i}\delta^{\nu_i)\epsilon}\biggl(\delta^{(\mu_j}_\epsilon\delta^{\nu_j)}_{\nu_1}\,\partial_\lambda\delta_{x_1x_j}+\nonumber\\ &\delta^{(\mu_j}_\epsilon\delta^{\nu_j)}_{\lambda}\,\partial_{\nu_1}\delta_{x_1x_j}-\delta^{(\mu_j}_\lambda\delta^{\nu_j)}_{\nu_1}\,\partial_\epsilon\delta_{x_1x_j}\biggl)+(ij), \end{align} that in momentum space becomes \begin{align} &p_{1\,\nu_1}\,V_{E}^{\mu_1\nu_1\mu_2\nu_2\mu_3\nu_3\mu_4\nu_4}(p_1,p_2,p_3,\bar{p}_4)=\notag\\ &=\Big[4\, \mathcal{B}^{\mu_1\hspace{0.4cm}\mu_2\nu_2\mu_3\nu_3}_{\hspace{0.3cm}\lambda\nu_1}(p_2,p_3)V_{E}^{\lambda\nu_1\mu_4\nu_4}(p_1+p_2+p_3,\bar{p}_4)\nonumber\\ &+(34)+ (24)\Big]\notag\\ &+\Big[2 \, \mathcal{C}^{\mu_1\hspace{0.4cm}\mu_2\nu_2}_{\hspace{0.3cm}\lambda\nu_1}(p_2)V_{E}^{\lambda\nu_1\mu_3\nu_3\mu_4\nu_4}(p_1+p_2,p_3,\bar{p}_4)+\nonumber\\ &(2 3)+(24)\Big], \end{align} where \begin{align} \label{BB} \mathcal{B}^{\mu_1\hspace{0.4cm}\mu_2\nu_2\mu_3\nu_3}_{\hspace{0.3cm}\lambda\nu_1}(p_2,p_3)\equiv -\frac{1}{2}\delta^{\mu_1(\mu_2}{\delta^{\nu_2)\epsilon}}&\times \nonumber \\ \times\left(\delta_\epsilon^{(\mu_3}\delta^{\nu_3)}_{\nu_1}\,p_{3\,\lambda}+\delta_\epsilon^{(\mu_3}\delta^{\nu_3)}_{\lambda}\,p_{3\,\nu_1}-\delta_\lambda^{(\mu_3}\delta^{\nu_3)}_{\nu_1}\,p_{3\,\epsilon}\right)+(23),&\nonumber\\ \end{align} and \begin{align} \mathcal{C}^{\mu_1\hspace{0.4cm}\mu_2\nu_2}_{\hspace{0.3cm}\lambda\nu_1}(p_2)&\equiv \frac{1}{2}\left(\delta^{\mu_1(\mu_2}\delta^{\nu_2)}_{\nu_1}\,p_{2\,\lambda}+\delta^{\mu_1(\mu_2}\delta^{\nu_2)}_{\lambda}p_{2\,\nu_1}\right. &\nonumber \\ &\left. -\delta^{(\mu_2}_{\lambda}\delta^{\nu_2)}_{\nu_1}p_2^{\mu_1}\right), \end{align} correspond, respectively, to the second and first functional derivatives of the Christoffel connection. A similar analysis can be performed for a trace identity. In this case, we simply functionally differentiate the anomalous Weyl variation \eqref{epx} multiple times and transform the expression to momentum space, obtaining \begin{align} \label{mom} &\delta_{\mu_1\nu_1}\,V_{E}^{\mu_1\nu_1\dots\mu_n\nu_n}(p_1,\dots,p_n)=\nonumber\\ &2^{n-1}(d-4)\,\left[\sqrt{-g}E\right]^{\mu_2\nu_2\dots\mu_n\nu_n}(p_2,\dots,p_n)\notag\\ &-2\bigg[V_{E}^{\mu_2\nu_2\dots\mu_n\nu_n}(p_1+p_2,p_3,\dots,p_n)+\nonumber\\& V_{E}^{\mu_2\nu_2\dots\mu_n\nu_n}(p_2,p_1+p_3,\dots,p_n)+\dots+\nonumber\\ &V_{E}^{\mu_2\nu_2\dots\mu_n\nu_n}(p_2,p_3,\dots,p_1+p_n)\bigg]. \end{align} This constraint is satisfied by all the vertices extracted from the $E_4$ term, and remain valid once this contribution is included in a Lovelock action when $d\neq 4$. \section{Classical constraints on the equations of motion in the local action} \label{cla} The constraints derived in the previous sections, as already mentioned, are obtained by performing the flat spacetime limit of the metric variations, without resorting to a conformal decomposition of the metric itself. \\ More general constraints are obtained if we, instead, perform a conformal decomposition and vary the fiducial metric and the conformal factor independently. The separation is consistent with the fact that the subtractions included in the definition of the WZ action introduce a conformal scale. This separation is scale invariant, in the sense that the resulting action is free of any dimensionful constant. These types of actions are typical of dilaton gravities and can be modified by the addition of extra scale-invariant potentials. \\ In this section we investigate the consistency of the equations of motion, discussing their conservation in the local version of the theory. The same consistency will be missing once we move to the nonlocal theory, obtained by eliminating the dilaton, using the Riegert decomposition \eqref{onshell}. \\ As we are going to illustrate in a final section, in that case we need to amend the action by Weyl invariant contributions, that are necessary in order to derive the exact expression of the hierarchy. This, in principle, requires an analysis of the $4T$ correlator, correcting the predictions derived from the nonlocal actions, with extra Weyl-invariant terms. Such terms can be identified by an approach that has been already discussed for a simpler correlator, the $TTJJ$ \cite{Coriano:2022jkn}. While this is an important point that we hope to discuss elsewhere, it is possible to obtain the correct hierarchies satisfied by the 4-point vertices of a 4d GB theory by resorting directly to a previous analysis of the counterterms of the same vertex. This study has been presented in \cite{Coriano:2021nvn}. \\ \subsection{The dilaton gravity action} Coming to the local dilaton-gravity form of the limiting theory, the two fields can be treated as independent, but their equations will be linked by the constraints coming from the anomalous variation of the Euler Poincar\`e density. For this reason, \eqref{rdef} defines a dilaton gravity theory in which the trace of the equations of motion of the gravity metric $\bar g$ and that of the conformal factor are related in the form \begin{eqnarray} \label{fin} \left(2 \bar{g}_{\mu\nu}\frac{\delta}{\delta \bar g_{\mu\nu}}-\frac{\delta}{\delta\phi}\right)\mathcal{S}^{(WZ)}_{GB}=-\alpha\sqrt{\bar g}\bar{E}. \end{eqnarray} The derivation of this relation is discussed in \cite{Coriano:2022ftl} for conformal anomaly actions. Note that the regulated action \eqref{WZ} is, separately, a functional of $\bar{g}$ and $\phi$ and one can use the relations \begin{equation} 2 g_{\mu\nu}\frac{\delta }{\delta g_{\mu\nu}}V_E(g)=\frac{\delta}{\delta\phi}V_E(g)=\epsilon \sqrt{g} E, \label{wwi} \end{equation} \begin{equation} 2 \bar{g}_{\mu\nu}\frac{\delta }{\delta \bar{g}_{\mu\nu}}V_E(\bar g)=2 {g}_{\mu\nu}\frac{\delta }{\delta {g}_{\mu\nu}}V_E(\bar g), =\epsilon \sqrt{\bar g}\bar E \end{equation} (using $\bar{g}_{\mu\nu}=g_{\mu\nu}e^{-2 \phi}$) and \begin{equation} \frac{\delta}{\delta \phi}V_E(\bar g)=0 \end{equation} to obtain \eqref{fin}. It is convenient to define the two tensors \begin{equation} T^{\mu\nu}=\frac{2}{\sqrt{\bar g}}\frac{\delta \mathcal{S}_{WZ}}{\delta\bar g_{\mu\nu}} \end{equation} and \begin{equation} T_\phi=\frac{1}{\sqrt{\bar g}}\frac{\delta \mathcal{S}_{WZ}}{\delta\phi}. \end{equation} The relation can also be obtained by a direct computation using \eqref{rdef} \begin{align} &\sqrt{\bar g}T_\phi=\sqrt{g}\biggl(\bar E + 8 \bar G_{\mu\nu}\bar \nabla_\mu\phi\bar \nabla_{\nu}\phi \nonumber\\ &+ 8 \bar \sq \phi \bar\nabla_\mu\phi \bar \nabla^\mu\phi +16 \bar \nabla_\lambda\bar \nabla_\mu\phi \bar \nabla^\lambda \phi \bar \nabla^\mu\phi \nonumber \\ & \qquad\qquad -8 \bar R_{\mu\nu}\bar \nabla^\mu\phi\bar \nabla^\nu\phi + 8 (\bar \sq\phi)^2 -\nonumber\\ &8\bar \nabla_\mu\bar \nabla_\nu\phi \bar \nabla^\mu\bar \nabla^\nu\phi\biggl)\equiv \sqrt{\bar g} \bar g_{\mu\nu}T^{\mu\nu} \end{align} where the last equality follows from the trace of \eqref{ep3}. Rescalings in the conformal decomposition are typically of the form \begin{eqnarray} &R_{\mu \nu \rho \sigma}^2 =e^{-4\phi} \biggl(\bar R_{\mu \nu \rho \sigma}^2 - 8 \bar R^{\mu \nu} \bar \Delta_{\mu \nu} - \nonumber\\ &4 \bar R\bar \nabla_\lambda \phi \bar \nabla^\lambda \phi + 4(d-2)\bar \Delta_{\mu \nu}^2 + \nonumber\\ &4\bar \Delta ^2+ 8(d-1)\bar \Delta \bar \nabla_\lambda \phi \bar \nabla^\lambda \phi +\nonumber\\ &2d(d-1)(\bar \nabla_\lambda \phi \bar \nabla^\lambda \phi)^2 \biggl) \end{eqnarray} and similar ones. They can be found in \cite{Coriano:2022ftl}. The action is diffeomorphism invariant since $\phi$ transforms as a scalar under changes of coordinates. We can use this invariance to derive the equation satisfied by the stress energy tensor, by varying the action with respect to the fiducial metric. The Lie derivatives for the scalar field $\phi$ and the fiducial metric $\bar g_{\mu\nu}$ are \begin{equation} \begin{cases} \delta_\xi \phi=\xi^\lambda\bar\nabla_\lambda\phi\\ \delta_\xi\bar g_{\mu\nu}=\bar g_{\mu\lambda}\bar \nabla_\nu \xi^\lambda+\bar g_{\nu\lambda}\bar \nabla_\mu\xi^\lambda \end{cases}\,. \end{equation} giving the variation \begin{align} &\delta \mathcal{S}_{WZ}=\int d^d x \left ( \delta_\xi\phi \frac{\delta}{\delta \phi}+\delta_\xi\bar g_{\mu\nu}\frac{\delta}{\delta\bar g_{\mu\nu}} \right )\mathcal{S}_{WZ} \notag\\ =&\int d^d x \left ( \xi^\lambda\bar\nabla_\lambda\phi\frac{\delta}{\delta\phi}+(\bar g_{\mu\lambda}\bar \nabla_\nu \xi^\lambda+\bar g_{\nu\lambda}\bar \nabla_\mu\xi^\lambda)\frac{\delta}{\delta\bar g_{\mu\nu}} \right)\mathcal{S}_{WZ}\notag\\ =&\int d^d x\xi^\lambda \left ( \bar\nabla_\lambda\phi\frac{\delta}{\delta\phi}-2\bar g_{\mu\lambda}\bar \nabla_\nu\frac{\delta}{\delta\bar g_{\mu\nu}} \right )\mathcal{S}_{WZ}. \end{align} The condition to be imposed to get the invariance under diffeomorphism for a generic functional such as $\mathcal{S}_{WZ}$ is \begin{equation} \label{diff inv} \left ( \bar\nabla_\lambda\phi\frac{\delta}{\delta\phi}-2\bar g_{\mu\lambda}\bar \nabla_\nu\frac{\delta}{\delta\bar g_{\mu\nu}} \right )\mathcal{S}_{WZ}=0. \end{equation} From now to the rest we will omit the "bar" above all the tensor, derivatives ecc., assuming that they are all evaluated respect to the fiducial metric $\bar{g}$, treated as an independent field. The first variation gives \begin{align} \label{first term} &\nabla_\lambda\phi\frac{\delta }{\delta\phi}\mathcal{S}_{WZ}=\nabla_\lambda\phi\biggl [ E+ 8G^{\mu\nu}\nabla_\mu\nabla_\nu \phi+\nonumber\\ &8\sq\phi\nabla_\mu\phi\nabla^\mu\phi+16\nabla_\lambda\nabla_\mu\phi\nabla^\lambda\phi\nabla^\mu\phi\notag \\ &-8R_{\mu\nu}\nabla^\mu\phi\nabla^\nu\phi+8(\sq\phi)^2-8\nabla_\mu\nabla_\mu\phi\nabla^\mu\nabla^\nu\phi\biggl]. \end{align} The second variation is given by \begin{align} \label{second term} &-2 g_{\mu\lambda} \nabla_\nu\frac{\delta}{\delta g_{\mu\nu}}\mathcal{S}_{WZ}=\nonumber\\ &-2 g_{\mu\lambda} \nabla_\nu\int d^4x \sqrt{-g} \frac{\delta}{\delta g_{\mu\nu}}(\phi E)\notag\\ &-\nabla_\lambda\phi\biggl [ 8G^{\mu\nu}\nabla_\mu\nabla_\nu \phi+8\sq\phi\nabla_\mu\phi\nabla^\mu\phi+\nonumber\\ &16\nabla_\lambda\nabla_\mu\phi\nabla^\lambda\phi\nabla^\mu\phi -8R_{\mu\nu}\nabla^\mu\phi\nabla^\nu\phi\notag\\ &+8(\sq\phi)^2-8\nabla_\mu\nabla_\mu\phi\nabla^\mu\nabla^\nu\phi\biggl]+\nonumber\\ &8R_{\lambda\mu\nu\rho}\nabla^\nu\phi(\nabla^\mu\nabla^\rho\phi-\nabla^\rho\nabla^\mu\phi). \end{align} Adding \eqref{first term} and \eqref{second term}, recalling that $[\nabla_\mu,\nabla_\nu]\phi=0$, we finally get \begin{align} &\left ( \nabla_\lambda\phi\frac{\delta}{\delta\phi}-2 g_{\mu\lambda} \nabla_\nu\frac{\delta}{\delta g_{\mu\nu}} \right )\mathcal{S}_{WZ}=\nabla_\lambda\phi E-\nonumber\\ &2 g_{\mu\lambda} \nabla_\nu\int d^4x \sqrt{-g} \frac{\delta}{\delta g_{\mu\nu}}(\phi E). \end{align} The explicit form of the second term in the equation above is expressed by \begin{align} &-2 g_{\mu\lambda} \nabla_\nu\int d^4x \sqrt{-g} \frac{\delta}{\delta g_{\mu\nu}}(\phi E)=-\nabla_\lambda\phi E-\nonumber\\ &4R^{\nu\mu\alpha\beta}\phi\nabla_\mu R_{\lambda\nu\alpha\beta}-2R^{\nu\mu\alpha\beta}\phi\nabla_\lambda R_{\nu\mu\alpha\beta}\notag\\ &+4\nabla^\mu\nabla^\nu\phi(\nabla_\nu R_{\lambda\mu}- \nabla_\mu R_{\lambda\nu})-\nonumber\\ &4(R_{\lambda\mu\nu\alpha}+R_{\lambda\nu\mu\alpha})\nabla^\alpha\nabla^\mu\nabla^\nu\phi+4R_{\nu\mu\alpha\beta}R_{\lambda}{}^{\mu\alpha\beta}\nabla^\nu\phi\notag\\ &+2\phi[\nabla_\lambda,\nabla_\nu]\nabla^\nu R+2R_{\lambda\nu}\phi\nabla^\nu R. \end{align} The simplification of this expression requires some intermediate steps. A lengthy but direct computation shows that the Bianchi identity \begin{equation} R^\mu_{\ \nu \rho \sigma} + R^\mu_{\ \rho \sigma \nu} + R^\mu_{\ \sigma \nu \rho} = 0 \end{equation} is still satisfied for a conformal decomposition. Thanks to the above equation, using the symmetry of the Riemann tensor and \begin{equation} [\nabla_\nu,\nabla_\mu]V^\rho=R^\rho{}_{\sigma\mu\nu}V^{\sigma}, \end{equation} it is quite easy to show \eqref{diff inv}. A similar computation can be performed to derive \eqref{fin} from \eqref{rdef}.\\ It is quite obvious that the singular procedure that takes to a regulated $4d$ EGB action is consistent. This analysis becomes rather nontrivial as the dilaton is removed from the spectrum. As already mentioned, in that case the nonlocal action needs to be amended by extra terms. This will occur at the level of the classical 4-graviton vertex. The 3-graviton vertex, instead, can be handled directly with the nonlocal action \eqref{Snonl}. Results of this analysis are given below. \section{3- and 4-wave interaction in the nonlocal $4d$ GB theory} The nonlocal structure of the $4d$ EGB theory results from an iterative solution of the equations of motion in which the dilaton is expressed in terms of the full original metric $g$, as shown in \cite{Coriano:2017mux}. One can rewrite the nonlocal action in the form \begin{eqnarray} \label{loc} & \mathcal{S}_{\rm anom}(g,\varphi) \equiv -\sdfrac{1}{2} \int d^4x\,\sqrt{-g}\, \Big[ (\,\raise.5pt\hbox{$\nbox{.09}{.09}$}\, \varphi)^2 - \nonumber\\ &2 \big(R^{\mu\nu} - \tfrac{1}{3} R g^{\mu\nu}\big) (\nabla_\mu\varphi)(\nabla_\nu \varphi)\Big]\nonumber\\ & +\, \sdfrac{1}{2}\,\int d^4x\,\sqrt{-g}\ \Big[\big(E - \tfrac{2}{3}\,\raise.5pt\hbox{$\nbox{.09}{.09}$}\, R\big) \Big]\,\varphi, \label{Sanom} \end{eqnarray} that can be varied with respect to $\phi$, giving \begin{equation} \sqrt{-g}\,\mathcal{D}_4\, \varphi = \sqrt{-g}\left[\sdfrac{E}{2}- \sdfrac{\!\,\raise.5pt\hbox{$\nbox{.09}{.09}$}\, R\!}{3} \right] \label{phieom}. \end{equation} Three-wave interactions can be derived by expanding perturbatively in the metric fluctuations in the form \begin{subequations} \begin{eqnarray} &g_{\mu\nu} = g_{\mu\nu}^{(0)} + g_{\mu\nu}^{(1)} + g_{\mu\nu}^{(2)} + \dots \equiv\nonumber\\ & \eta_{\mu\nu} + h_{\mu\nu} + h_{\mu\nu}^{(2)} + \dots\\ &\varphi = \varphi^{(0)} + \varphi^{(1)} + \varphi^{(2)} + \dots \end{eqnarray} \end{subequations} The expansion above should be interpreted as a collection of terms generated by setting \begin{equation} g_{\mu\nu} = \delta_{\mu\nu} + \kappa h_{\mu\nu} \end{equation} having reinstated the coupling expansion $\kappa$, with $h$ of mass-dimension one, and collecting all the higher order terms in the functional expansion of \eqref{loc} of the order $h^2$, $h^3$ and so on. A similar expansion holds for $\varphi$ if we redefine $ \varphi^{(1)}=\kappa \bar\varphi^{(1)}, \varphi^{(2)}=\kappa^2 \bar \varphi^{(2)}$ and so on. At cubic level the vertex is given by \begin{align} &\mathcal{S}_{\rm nonl}^{(3)}\! =\!- \sdfrac{b'}{18}\! \int\! d^4x \left\{\!R^{(1)}\!\sdfrac{1}{\,\raise.5pt\hbox{$\overline{\nbox{.09}{.09}}$}\,} \big(\sqrt{-g} \,\raise.5pt\hbox{$\nbox{.09}{.09}$}\,^2\big)^{\!(1)}\sdfrac{1}{\,\raise.5pt\hbox{$\overline{\nbox{.09}{.09}}$}\,} R^{(1)}\! \right\}+\nonumber\\ & \sdfrac{b'}{9}\! \int\! d^4x \left\{\!\pa_{\mu} R^{(1)}\!\sdfrac{1}{\,\raise.5pt\hbox{$\overline{\nbox{.09}{.09}}$}\,} \! \left(\!R^{(1)\mu\nu}\! - \!\sdfrac{1}{3} \eta^{\mu\nu} R^{(1)}\!\right)\!\sdfrac{1}{\,\raise.5pt\hbox{$\overline{\nbox{.09}{.09}}$}\,}\pa_{\nu} R^{(1)}\!\right\} \nonumber\\ & - \sdfrac{1}{6}\! \int\! d^4x \left(b'\, E^{\!(2)} \right)\sdfrac{1}{\,\raise.5pt\hbox{$\overline{\nbox{.09}{.09}}$}\,}R^{(1)}+\nonumber\\ & \sdfrac{b'}{9} \!\int\! d^4x\, R^{(1)} \sdfrac{1}{\,\raise.5pt\hbox{$\overline{\nbox{.09}{.09}}$}\,} \left(\sqrt{-g}\,\raise.5pt\hbox{$\nbox{.09}{.09}$}\,\right)^{\!(1)}R^{(1)} + \sdfrac{b'}{9} \! \int\! d^4x\, R^{\!(2)}R^{(1)} \label{Sanom3b} \end{align} where the suffixes $(1)$, $(2)$ denote the order of the expansion in the fluctuations around flat space $(g_{\mu\nu}=\delta_{\mu\nu} + h_{\mu\nu})$. From \eqref{Sanom3b} we can extract the expressions of the classical 3-wave gravitational interactions in this effective theory by differentiating three times with respect to $h_{\mu\nu}$. \subsection{3-wave interactions in momentum space} The GB term in the equations of motion induces interactions of higher orders exhibiting specific features, that we are going to identify in this and in the next section. Obviously, cubic and quartic interactions in the nonlocal $4d $ EGB theory \eqref{Sanom3b} share close similarities with those identified in the nonlocal conformal anomaly action. At cubic level, the most convenient way to organize such contributions is to transform the expressions to momentum space. For this purpose, we define \begin{equation} \int d^4x \, e^{-ip\cdot x} \, R_{\mu\a\nu\beta}^{(1)}(x) \equiv \big[R_{\mu\a\nu\beta}^{(1)}\big]^{\mu_1\nu_1}(p)\, \tilde h_{\mu_1\nu_1}(p) \label{RieFour} \end{equation} for the linear expansion of the Ricci tensor \begin{equation} R_{\mu\a\nu\beta}^{(1)} = \sdfrac{1}{2}\, \Big\{\!- \pa_\a\pa_\beta h_{\mu\nu}- \pa_\mu\pa_\nu h_{\a\beta} + \pa_\a\pa_\nu h_{\beta\mu} + \pa_\beta\pa_\mu h_{\a\nu}\Big\}, \end{equation} which in momentum space becomes \begin{align} &\big[R_{\mu\a\nu\b}^{(1)}\big]^{\mu_1\nu_1}(p) = \sdfrac{1}{2}\, \Big\{\d^{(\mu_1}_\a\, \d^{\nu_1\!)\hspace{-4pt}}\,_\b\,p_\mu\, p_\nu + \d^{(\mu_1}_\mu\, \d^{\nu_1)}_\nu\,p_\a\, p_\b -\nonumber\\ & \d_\b\,^{\hspace{-2pt}(\mu_1}\, \d^{\nu_1)}_\mu\,p_\a \,p_\nu - \d^{(\mu_1}_\a\, \d^{\nu_1)}_\nu\,p_\b \,p_\mu \Big\}. \label{Riemom} \end{align} We will be needing the identities \begin{align} &\big[R_{\mu\a\nu\b}^{(1)}R^{(1)\mu\a \nu\b}\big]^{\mu_1\nu_1\mu_2\nu_2} (p_1, p_2) \equiv\nonumber\\ &\big[R_{\mu\a\nu\b}^{(1)}\big]^{\mu_1\nu_1} (p_1) \big[R^{(1)\mu\a \nu\b}\big]^{\mu_2\nu_2}(p_2) =\nonumber\\ & (p_1 \cdot p_2)^2\, \eta^{\mu_1(\mu_2}\eta^{\nu_2)\nu_1} - 2\, (p_1\cdot p_2)\, p_1\,^{\hspace{-4pt}(\mu_2}\eta^{\nu_2)(\nu_1}p_2\,^{{\hspace{-2pt}}\mu_1)}+\nonumber\\ & p_1^{\mu_2}\,p_1^{\nu_2}\,p_2^{\mu_1}\,p_2^{\nu_1} \label{Riemsq} \end{align} and \vspace{-3mm} \begin{align} &\big[R_{\mu\nu}^{(1)}R^{(1)\mu\nu}\big]^{\mu_1\nu_1\mu_2\nu_2} (p_1, p_2) \equiv \big[R_{\mu\nu}^{(1)}\big]^{\mu_1\nu_1} (p_1) \big[R^{(1)\mu\nu}\big]^{\mu_2\nu_2}(p_2) =\nonumber\\ &\sdfrac{1}{4}\, p_1^2 \, \Big(p_2^{\mu_1}\, p_2^{\nu_1}\, \eta^{\mu_2\nu_2} - 2\, p_2\,^{\hspace{-4pt}(\mu_1}\eta^{\nu_1)(\nu_2} p_2\,^{\hspace{-2.5pt}\mu_2)}\Big)+\nonumber\\ & \sdfrac{1}{4}\, p_2^2\, \Big(p_1^{\mu_2}\, p_1^{\nu_2}\, \eta^{\mu_1\nu_1} - 2\,p_1\,^{\hspace{-4pt}(\mu_1}\eta^{\nu_1)(\nu_2} p_1\,^{\hspace{-2.5pt}\mu_2)}\Big)+\nonumber\\ & \sdfrac{1}{4}\, p_1^2\ p_2^2\, \eta^{\mu_1(\mu_2}\eta^{\nu_2)\nu_1}+\nonumber\\ & \sdfrac{1}{4}\, (p_1\cdot p_2)^2\, \eta^{\mu_1\nu_1}\eta^{\mu_2\nu_2} + \sdfrac{1}{2} \, p_1^{(\mu_1}\,p_2^{\nu_1)}\,p_1^{(\mu_2}\,p_2^{\nu_2)}+\nonumber\\ & \sdfrac{1}{2} \, (p_1\cdot p_2)\, \Big( p_1\,^{\hspace{-4pt}(\mu_1}\, \eta^{\nu_1)(\nu_2} p_2\,^{\hspace{-2.5pt}\mu_2)} -\eta^{\mu_1\nu_1} \, p_1^{(\mu_2}\, p_2^{\nu_2)} -\nonumber\\ &\eta^{\mu_2\nu_2} \, p_1^{(\mu_1}\, p_2^{\nu_1)}\Big)\,. \label{Riccsq} \end{align} We also use the relation \begin{align} &\big[(R^{(1)})^2\big]^{\mu_1\nu_1\mu_2\nu_2} (p_1, p_2) \equiv\nonumber\\ &\big[R^{(1)}\big]^{\mu_1\nu_1} (p_1) \big[R^{(1)}\big]^{\mu_2\nu_2}(p_2)=\nonumber\\& p_1^2\, p_2^2 \, \pi^{\mu_1\nu_1}(p_1)\, \pi^{\mu_2\nu_2}(p_2), \label{Riccscalsq} \end{align} and re-express the third order classical vertices of the $GB$ action and its contribution \eqref{Sanom3b} to the three-point correlator in momentum space, in the form \begin{align} &S_3^{\mu_1\nu_1\mu_2\nu_2\mu_3\nu_3}(p_1,p_2,p_3)=\sdfrac{8}{3} \alpha\Big\{\pi^{\mu_1\nu_1}(p_1)\,\nonumber\\ &\left[ E^{(2)}\right]^{\mu_2\nu_2\mu_3\nu_3}(p_2,p_3)+(\text{cyclic})\Big\}\nonumber\\ &\qquad -\sdfrac{16\alpha}{9}\Big\{ \pi^{\mu_1\nu_1}(p_1)\,Q^{\mu_2\nu_2}(p_1,p_2,p_3)\, \pi^{\mu_3\nu_3}(p_3)\nonumber\\ &+(\text{cyclic})\Big\} +\sdfrac{16\alpha}{27\,}\, \pi^{\mu_1\nu_1}(p_1)\,\pi^{\mu_2\nu_2}(p_2)\,\pi^{\mu_3\nu_3}(p_3)\,\nonumber\\ &\Big\{p_3^2\, p_1\cdot p_2+(\text{cyclic})\Big\}, \label{AS3} \end{align} where we have defined \begin{equation} \pi^{\mu\nu}_{}(p)\equiv\delta^{\mu\nu}-\frac{p^{\mu}p^{\nu}}{p^2}, \end{equation} and \begin{align} &Q^{\mu_2\nu_2}(p_1,p_2,p_3) \equiv p_{1\mu}\, [R^{\mu\nu}]^{\mu_2\nu_2}(p_2)\,p_{3\nu}= \nonumber\\ & \sdfrac{1}{2} \,\Big\{(p_1\cdot p_2)(p_2\cdot p_3)\, \delta^{\mu_2\nu_2} + p_2^2 \ p_1^{(\mu_2}\, p_3^{\nu_2)} -\nonumber\\ & (p_2\cdot p_3) \, p_1^{(\mu_2}\, p_2^{\nu_2)} - (p_1\cdot p_2) \, p_2^{(\mu_2}\, p_3^{\nu_2)}\Big\}. \end{align} We have defined with \begin{align} &\big[E^{(2)}\big]^{\mu_i\nu_i\mu_j\nu_j} =\big[R_{\mu\a\nu\b}^{(1)}R^{(1)\mu\a \nu\b}\big]^{\mu_i\nu_i\mu_j\nu_j}\nonumber\\ &-4\,\big[R_{\mu\nu}^{(1)}R^{(1)\mu\nu}\big]^{\mu_i\nu_i\mu_j\nu_j}+\big[ \big(R^{(1)}\big)^2\big]^{\mu_i\nu_i\mu_j\nu_j} \end{align} the second functional derivative of the topological density in flat space, after Fourier transform. One can prove the identity \begin{align} &\delta_{\a_1\b_1}\, S_3^{\a_1\b_1\mu_2\nu_2\mu_3\nu_3}(p_1,p_2,p_3)\Big\vert_{p_3 = -(p_1 + p_2)} =\nonumber\\ &\,8\alpha\, \big[E^{(2)}\big]^{\mu_2\nu_2\mu_3\nu_3} (p_2, p_3), \label{traceS3} \end{align} together with the conservation identities \begin{subequations} \begin{eqnarray} &&p_{2 \mu_2} \, Q^{\mu_2\nu_2} (p_1, p_2, p_3) = 0\\ &&p_{2 \mu_2} \, \big[E^{(2)}\big]^{\mu_2\nu_2\mu_3\nu_3} (p_2, p_3) = 0. \end{eqnarray} \end{subequations} Double tracing \eqref{AS3} of the nonlocal theory one obtains \begin{align} &\delta_{\a_1\b_1}\delta_{\a_3\b_3}\,S_3^{\a_1\b_1\mu_2\nu_2\a_3\b_3}(p_1,p_2,p_3)\big\vert_{p_3 = -(p_1 + p_2)} =\nonumber\\ & 8\alpha \, \delta_{\a_3\b_3}\big[E^{(2)}\big]^{\mu_2\nu_2\a_3\b_3} (p_2, p_3) \nonumber\\ & \qquad = 16\alpha\, Q^{\mu_2\nu_2}(p_1,p_2,p_3)\big\vert_{p_3 = -(p_1 + p_2)} \, + \nonumber\\ &\ 8\alpha\,p_2^2\, \left( p_1^2 + p_1\cdot p_2\right)\pi^{\mu_2\nu_2}(p_2). \label{dbltrace3} \end{align} \begin{figure} \label{ff2} \center \includegraphics[scale=0.45]{figures/vertex1.pdf} \includegraphics[scale=0.45]{figures/vertex2.pdf} \includegraphics[scale=0.45]{figures/vertex3.pdf} \caption{Mixing in three-point functions} \end{figure} Notice that the expression above is purely polynomial since $p_2^2 \pi^{\mu_2\nu_2}(p_2)$ is a local term. Thus in the first line of (\ref{AS3}) we may substitute (\ref{traceS3}) and in the second line use (\ref{dbltrace3}) to eliminate the $Q^{\mu_2\nu_2}$ terms and its three cyclic permutations. The triple trace gives \begin{align} &\delta_{\a_1\b_1}\delta_{\a_2\b_2}\delta_{\a_3\b_3}\,S_3^{\a_1\b_1\a_2\b_2\a_3\b_3}(p_1,p_2,p_3)\big\vert_{p_3 = -(p_1 + p_2)} =\nonumber\\ &16\alpha \left[ p_1^2\,p_2^2 - (p_1\cdot p_2)^2\right]. \label{triptrace3} \end{align} We use these expressions to derive the structure of the 3-wave interaction in the form \begin{align} &S_3^{\mu_1\nu_1\mu_2\nu_2\mu_3\nu_3}=\sdfrac{1}{3}\, \pi^{\mu_1\nu_1}(p_1)\,\delta_{\a_1\b_1}\,S_3^{\a_1\b_1\mu_2\nu_2\mu_3\nu_3}+\nonumber\\ &\sdfrac{1}{3}\, \pi^{\mu_2\nu_2}(p_2)\,\delta_{\a_2\b_2}\,S_3^{\mu_1\nu_1\a_2\b_2\mu_3\nu_3}\nonumber\\ &+\sdfrac{1}{3}\, \pi^{\mu_3\nu_3}(p_3)\,\delta_{\a_3\b_3}\,S_3^{\mu_1\nu_1\mu_2\nu_2\a_3\b_3}- \nonumber\\ &\sdfrac{1}{9}\,\pi^{\mu_1\nu_1}(p_1)\,\pi^{\mu_3\nu_3}(p_3)\,\delta_{\a_1\b_1}\delta_{\a_3\b_3}\,S_3^{\a_1\b_1\mu_2\nu_2\a_3\b_3}- \nonumber\\ &\sdfrac{1}{9}\,\pi^{\mu_2\nu_2}(p_2)\pi^{\mu_3\nu_3}(p_3)\,\delta_{\a_2\b_2}\delta_{\a_3\b_3}\,S_3^{\mu_1\nu_1\a_2\b_2\a_3\b_3}-\nonumber\\ &\sdfrac{1}{9}\,\pi^{\mu_1\nu_1}(p_1)\pi^{\mu_2\nu_2}(p_2)\delta_{\a_1\b_1}\, \delta_{\a_2\b_2}\,S_3^{\a_1\b_1\a_2\b_2\mu_3\nu_3}+\nonumber\\ &\sdfrac{1}{27}\,\pi^{\mu_1\nu_1}(p_1)\pi_2^{\mu_2\nu_2} (p_2)\pi^{\mu_3\nu_3}(p_3)\,\delta_{\a_1\b_1}\delta_{\a_2\b_2}\delta_{\a_3\b_3}\,\nonumber\\ &S_3^{\a_1\b_1\a_2\b_2\a_3\b_3}\,. \label{fin1} \end{align} The nonlocal $EGB$ theory has a structure that at trilinear level in the fluctuations, similarly to the case of the nonlocal anomaly actions, can be depicted as in Fig. 1. The vertex of the 3-wave is organized in terms of longitudinal insertions of massless states on each of the weavy lines, in a sequence of single, double and triple insertions. The dark blob at the center denotes the polynomial contributions coming from the functional derivatives of the Euler-Poincar\` e density. Each of the $\pi^{\mu\nu}$ projectors introduces a massless pole in momentum space, identified from the expression \begin{equation} \pi^{\mu\nu}=\frac{1}{p^2}\hat{\pi}^{\mu\nu}\qquad \hat{\pi}^{\mu\nu}=\left(\delta^{\mu\nu}p^2 -p^\mu p^\nu\right) \end{equation} which induce nonlocal corrections on each of the external gravitational metric fluctuations $h_{\mu\nu}$. This picture gets modifed when we move to the case of 4-wave interactions. In that case the nonlocal action and henceforth Fig. 2 does not provide the correct expression of the vertices, and one has to resort to a perturbative expansion. While the specific features of these vertices can always be obtained by the brute force expansion of the $V_E$ term around flat space to fourth order, there are some uncommon features that are typical of the expansion, as in the cubic case. The vertex can be reshuffled in an interesting way around flat space, as we are now going to show. \section{4-wave interactions in the subtracted vertex} Also in this case, as for conformal anomaly actions, \begin{figure} \label{ff2} \center \includegraphics[scale=0.45]{figures/4mix1.pdf} \includegraphics[scale=0.45]{figures/4mix2.pdf} \includegraphics[scale=0.45]{figures/4mix3.pdf} \includegraphics[scale=0.45]{figures/4mix4.pdf} \caption{Mixing in four-point functions} \end{figure} we perform a subtraction of the form \begin{align} &\mathcal{S}=\lim_{d\to4}\frac{1}{(d-4)}\left[V_E(g,d)-V_E(g,4)\right]=\nonumber\\ &\lim_{d\to4}\frac{1}{(d-4)}\left[\int\,d^dx\,\mu^{d-4}\,E_4-\int\,d^4x\,E_4\right]\label{diffE4}. \end{align} Notice that the subtraction introduced above differs by Weyl invariant terms from \eqref{WZ} \cite{Coriano:2022ftl,Coriano:2023sab} and it reproduces, in the flat spacetime limit, the usual regularization approach of DR with $\bar{g}\to \delta$, as applied, ordinarily, to momentum space. The subtraction is needed in order to account for the $0/0$ evanescent contributions that, as we have already mentioned, are present in the differentiation of $V_E$ with open indices. The derivation of the conformal constraints, in this case, can be adapted from \cite{Coriano:2021nvn}, where it has been shown that these constraints can be directly extracted from the counterterms introduced to regulate the quantum corrections coming from a conformal sector. One may organize the contribution to the 4-point vertex (4-wave interaction) in terms of a sequence of anomaly poles and of a traceless contribution ("0-trace") derived from a consistent longitudinal/transverse decomposition of the 4-graviton interaction \begin{align} &\mathcal{S}^{{\mu_1\nu_1}{\mu_2\nu_2}{\mu_3\nu_3}{\mu_4\nu_4}}(p_1,p_2,p_3,\bar{p}_4)=\nonumber\\ &\mathcal{S}^{{\mu_1\nu_1}{\mu_2\nu_2}{\mu_3\nu_3}{\mu_4\nu_4}}_{pole}(p_1,p_2,p_3,\bar{p}_4) +\nonumber\\ &\mathcal{S}^{{\mu_1\nu_1}{\mu_2\nu_2}{\mu_3\nu_3}{\mu_4\nu_4}}_{0-trace}(p_1,p_2,p_3,\bar{p}_4)\label{4S}. \end{align} the expression of $\mathcal{S}_{0-trace}$ is given below in \eqref{otrace}. It is worth mentioning that the subtraction in \eqref{diffE4} is necessary in order to have a finite functional variation with respect to the metric fluctuation in the limit $d\to4$, as also pointed out in \cite{Bzowski:2017poo, Bzowski:2018fql}. This fact is reflected in the presence of an evanescent $0/0$ piece, due to Lovelock tensor identities, that can be eliminated once the subtraction \eqref{diffE4} is taken into account. There is a difference in the handling expressions such as \eqref{diffE4}, due to this subtle behaviour, if we perform functional derivatives with respect to the metric either with uncontracted or contracted indices. For instance, a differentiation with respect to the $\phi$ commutes with the limit in \eqref{diffE4}, and indeed reproduces the anomaly contribution in \eqref{wwi}, but a differentiation with open indices, followed by the flat Minkowski limit $g\to\delta$, needs special care. If we include the subtraction given in \eqref{diffE4} we can follow in the $4d$ EGB the same approach implemented in the case of a conformal anomaly action. In \eqref{4S} the zero trace part has the property \begin{align} &\delta_{\mu_i\nu_i}\mathcal{S}^{{\mu_1\nu_1}{\mu_2\nu_2}{\mu_3\nu_3}{\mu_4\nu_4}}_{0-trace}(p_1,p_2,p_3,\bar{p}_4)=0,\nonumber\\ & i=1,2,3,4, \end{align} The explicit expression of $\mathcal{S}_{0-trace}$ requires the inclusion of suitable projectors separating the tensorial indices into transverse traceless, trace and longitudinal sectors, introduced in the analysis of the CWIs for 4T correlators in momentum space. This contribution, in the context of the action functional \eqref{diffE4}, and more generally, of conformally anomaly actions, has been shown to be necessary in order to generate consistent conservation WIs, as also discussed in \cite{Coriano:2022jkn}. We have \begin{align} &\mathcal{S}^{{\mu_1\nu_1}{\mu_2\nu_2}{\mu_3\nu_3}{\mu_4\nu_4}}(p_1,p_2,p_3,\bar{p}_4)_{0-trace}=\notag\\ &=\bigg\{\mathcal{I}^{\mu_1\nu_1}_{\alpha_1}(p_1)\mathcal{I}^{\mu_2\nu_2}_{\alpha_2}(p_2)\mathcal{I}^{\mu_3\nu_3}_{\alpha_3}(p_3)\nonumber\\ &\mathcal{I}^{\mu_4\nu_4}_{\alpha_4}(p_4)\,p_{1\beta_1}\,p_{2\beta_2}\,p_{3\beta_3}\,p_{4\beta_4}\,\notag\\ &\qquad+\bigg[\Pi^{\mu_1\nu_1}_{\alpha_1\beta_1}(p_1)\mathcal{I}^{\mu_2\nu_2}_{\alpha_2}(p_2)\mathcal{I}^{\mu_3\nu_3}_{\alpha_3}(p_3)\nonumber\\ &\mathcal{I}^{\mu_4\nu_4}_{\alpha_4}(p_4)\,p_{2\beta_2}\,p_{3\beta_3}\,p_{4\beta_4}+(\text{perm.})\bigg]\notag\\ &\qquad+\bigg[\Pi^{\mu_1\nu_1}_{\alpha_1\beta_1}(p_1)\Pi^{\mu_2\nu_2}_{\alpha_2\beta_2}(p_2)\mathcal{I}^{\mu_3\nu_3}_{\alpha_3}(p_3)\nonumber\\ &\mathcal{I}^{\mu_4\nu_4}_{\alpha_4}(p_4)\,p_{3\beta_3}\,p_{4\beta_4}+(\text{perm.})\bigg]\notag\\ &\qquad+\bigg[\Pi^{\mu_1\nu_1}_{\alpha_1\beta_1}(p_1)\Pi^{\mu_2\nu_2}_{\alpha_2\beta_2}(p_2)\Pi^{\mu_3\nu_3}_{\alpha_3\beta_3}(p_3)\nonumber\\ &\mathcal{I}^{\mu_4\nu_4}_{\alpha_4}(p_4)\,p_{4\beta_4}+(\text{perm.})\bigg]\bigg\}\nonumber\\ &\mathcal{S}_{4}^{\alpha_1\beta_1\alpha_2\beta_2\alpha_3\beta_3\alpha_4\beta_4}(p_1,p_2,p_3,\bar{p}_4), \label{otrace} \end{align} where the contractions are expressed in terms of the contribution of the third and second functional derivatives as \begin{align} &p_{1\,\beta_1}\,\mathcal{S}_{4}^{\alpha_1\beta_1\alpha_2\beta_2\alpha_3\beta_3\alpha_4\beta_4}(p_1,p_2,p_3,\bar{p}_4)=\notag\\ &=\Big[4\, \mathcal{B}^{\alpha_1\hspace{0.4cm}\alpha_2\beta_2\alpha_3\beta_3}_{\hspace{0.3cm}\lambda_1\beta_1}(p_2,p_3)\,\nonumber\\ &\mathcal{S}_{2}^{\lambda_1\beta_1\alpha_4\beta_4}(p_1+p_2+p_3,\bar{p}_4)+(34)+ (24)\Big]\notag\\ &\hspace{0.9cm}+\Big[2 \, \mathcal{C}^{\alpha_1\hspace{0.4cm}\alpha_2\beta_2}_{\hspace{0.3cm}\lambda_1\beta_1}(p_2)\,\nonumber\\ &\mathcal{S}_{3}^{\lambda_1\beta_1\alpha_3\beta_3\alpha_4\beta_4}(p_1+p_2,p_3,\bar{p}_4)+(2 3)+(24)\Big]. \end{align} We have defined the transverse traceless projector \begin{align} \Pi^{\mu \nu}_{\alpha \beta} & = \frac{1}{2} \left( \pi^{\mu}_{\alpha} \pi^{\nu}_{\beta} + \pi^{\mu}_{\beta} \pi^{\nu}_{\alpha} \right) - \frac{1}{d - 1} \pi^{\mu \nu}\pi_{\alpha \beta}\label{TTproj}, \end{align} and the tensor \begin{align} \mathcal{I}^{\mu\nu}_{\alpha}&=\frac{1}{p^2}\left( p^{\mu}\delta^{\nu}_{\alpha} + p^{\nu}\delta^{\mu}_{\alpha} - \frac{p_{\alpha}}{d-1}( \delta^{\mu\nu} +(d-2)\frac{p^\mu p^\nu}{p^2} \right)\label{proone}. \end{align} On the other hand, the pole part is then explicitly given as \begin{align} &\mathcal{S}^{{\mu_1\nu_1}{\mu_2\nu_2}{\mu_3\nu_3}{\mu_4\nu_4}}(p_1,p_2,p_3,\bar{p}_4)_{poles}=\notag\\ &=\frac{\pi^{\mu_1\nu_1}(p_1)}{3}\delta_{\alpha_1\beta_1}\mathcal{S}_{4}^{\alpha_1\beta_1\mu_2\nu_2\mu_3\nu_3\mu_4\nu_4}(p_1,p_2,p_3,\bar{p}_4)+\nonumber\\ &(perm.)-\frac{\pi^{\mu_1\nu_1}(p_1)}{3}\,\frac{\pi^{\mu_2\nu_2}(p_2)}{3}\,\delta_{\alpha_1\beta_1}\delta_{\alpha_2\beta_2}\times\nonumber\\ &\times\mathcal{S}_{4}^{\alpha_1\beta_1\alpha_2\beta_2\mu_3\nu_3\mu_4\nu_4}(p_1,p_2,p_3,\bar{p}_4)+(perm.)\notag\\ &+\frac{\pi^{\mu_1\nu_1}(p_1)}{3}\,\frac{\pi^{\mu_2\nu_2}(p_2)}{3}\,\frac{\pi^{\mu_3\nu_3}(p_3)}{3}\,\delta_{\alpha_2\beta_2}\,\delta_{\alpha_1\beta_1}\delta_{\alpha_2\beta_2}\delta_{\alpha_3\beta_3}\,\nonumber\\ &\mathcal{S}_{4}^{\alpha_1\beta_1\alpha_2\beta_2\alpha_3\beta_3\mu_4\nu_4}(p_1,p_2,p_3,\bar{p}_4)+(perm.)\notag\\ &-\frac{\pi^{\mu_1\nu_1}(p_1)}{3}\,\frac{\pi^{\mu_2\nu_2}(p_2)}{3}\,\frac{\pi^{\mu_3\nu_3}(p_3)}{3}\,\frac{\pi^{\mu_4\nu_4}(p_4)}{3}\times\,\nonumber\\ &\times\delta_{\alpha_1\beta_1}\delta_{\alpha_2\beta_2}\delta_{\alpha_3\beta_3}\delta_{\alpha_4\beta_4}\mathcal{S}_{4}^{\alpha_1\beta_1\alpha_2\beta_2\alpha_3\beta_3\alpha_4\beta_4}(p_1,p_2,p_3,\bar{p}_4), \end{align} where the single trace is expressed in terms of the third functional derivative \begin{align} &\delta_{\alpha_1\beta_1}\,\mathcal{S}_4^{\alpha_1\beta_1\alpha_2\beta_2\alpha_3\beta_3\alpha_4\beta_4}(p_1,p_2,p_3,p_4)=\nonumber\\ &8\,\left[\sqrt{-g}E\right]^{\alpha_2\beta_2\alpha_3\beta_3\alpha_4\beta_4}(p_2,p_3,p_4)\notag\\ &-2\bigg[\mathcal{S}_{3}^{\alpha_2\beta_2\alpha_3\beta_3\alpha_4\beta_4}(p_1+p_2,p_3,p_4)+\nonumber\\ &\mathcal{S}_{3}^{\alpha_2\beta_2\alpha_3\beta_3\alpha_4\beta_4}(p_2,p_1+p_3,p_4)+\nonumber\\ &\mathcal{S}_{3}^{\alpha_2\beta_2\alpha_3\beta_3\alpha_4\beta_4}(p_2,p_3,p_1+p_4)\bigg], \end{align} and additional traces involve vertices of lower orders. \section{Conclusions} In this work we have investigated the nonlinear constraints emerging in a nonlocal 4d EGB theory for the 3- and 4-point classical interactions present in its fundamental action. They are hierarchical and directly linked to to the topological properties of the vertex $V _E$ and its subtracted expression $\hat{V}'_E$, valid in $d\neq 4$ and $d=4$ dimensions respectively. \\ The analysis is essentially built on several previous studies of conformal anomaly actions, that allow to identify some nontrivial features of this specific $4d$ theory. Among these, the presence of bilinear mixing in the graviton vertices and of extra, traceless contributions, which are not predicted by the nonlocal action as we move to 4-wave interactions. The nonlocal version of such a theory, as pointed out, is derived by a finite renormalization of the topological density, that allows to remove the dilaton from the spectrum by expressing it in terms of the full metric. Three-wave interactions are naturally derived from the nonlocal action, but the derivation of the hierarchical constraint satisfied by the four-wave interactions requires a different approach, given the limitations of such actions in reproducing the correct flat spacetime limit. The constraints that we have derived are satisfied also in the case of Lovelock actions. Indeed it is possible to generalize them to those cases where topological invariants of higher orders, such as $E_6, E_8$ and so on, are present, extending the approach outlined in this work. We hope to return to this point in a future study. \centerline{\bf Acknowledgements} We thank Riccardo Tommasi for discussions. This work is partially supported by INFN within the Iniziativa Specifica QFT-HEP. The work of C. C. and M. C. is funded by the European Union, Next Generation EU, PNRR project "National Centre for HPC, Big Data and Quantum Computing", project code CN00000013 and by INFN iniziativa specifica QFT-HEP. The work of M.C. is also supported by a PON fellowship DOT1312457-3. M. M. M. is supported by the European Research Council (ERC) under the European Union as Horizon 2020 research and innovation program (grant agreement No818066) and by Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Germany's Excellence Strategy EXC-2181/1 - 390900948 (the Heidelberg STRUCTURES Cluster of Excellence). \providecommand{\href}[2]{#2}\begingroup\raggedright
\section{Introduction} Supervised deep learning has achieved unprecedented success in a wide range of real-world applications \cite{ganin2015unsupervised}. However, obtaining labeled data, which is crucial for supervised learning algorithms, may be costly, labor-intensive, and/or time-consuming in certain applications, particularly in medical and biological domains \cite{lu2017deep,li2020transformation}. To address this problem, unsupervised domain adaptation (UDA) has been proposed to make use of available labeled data \cite{farahani2021brief}. The goal of UDA is to transfer knowledge from a labeled source domain to a different but related unlabeled target domain. Efficient UDA is challenging as models trained on the source domain may not perform well on the target domain due to discrepancies in the distributions of the two domains hereafter referred to as domain shift \cite{wang2018deep,sankaranarayanan2018learning,deng2019cluster}. To address the challenge of domain shift, most domain adaptation research has focused on reducing the distributional gap between the source and target domains \cite{shen2018wasserstein,liu2016coupling,isola2017image,tzeng2015simultaneous,tzeng2017adversarial,tzeng2020adapting,ganin2015unsupervised,ganin2016domain,peng2018zero}. These methods are supported by statistical learning theory for transfer learning \cite{ben2006analysis,ben2010theory, mansour2012multiple,redko2017theoretical,li2018extracting}. They also have achieved high performance by learning representations that are both discriminative and domain-invariant \cite{ganin2015unsupervised}. However, these methods are somewhat limited in the sense that they only focus on matching the marginal distribution between domains while ignoring label distributions \cite{deng2019cluster}. This limitation may be significant since class distribution shifts across domains are common phenomena in real-world applications \cite{jiang2020implicit,japkowicz2002class,chawla2009data,tan2019generalized}. In this paper, we present \emph{Domain Adaptation via Rebalanced Sub-domain Alignment} (DARSA), a novel UDA algorithm that addresses the class distribution shifting. Motivated by theoretical analysis of sub-domain-based UDA methods, DARSA provides state-of-the-art (SOTA) performance in various tasks. Specifically, we attempt to reduce the reweighted classification error and the reweighted discrepancy between the sub-domains of the source task and that of the target task in order to improve classification performance under class distribution shifts. The reweighting is based on a simple intuition: \emph{important sub-domains in the target domain need more attention} (see Section~\ref{sec:weighted_classification_loss} for details). By reweighting the sub-domains, we can significantly alleviate the shifted class distribution problem. This is demonstrated by the superior performance of DARSA compared to those of existing SOTA methods (see Sections~\ref{sec:digit} and ~\ref{sec:TST}). The benefits of introducing sub-domain alignment can be visualized in one-dimensional space, as shown in Figure \ref{figure_motiv}(a). After splitting the distributions into corresponding sub-domains (e.g. sub-domains with the same label in the source and target task), we can focus on decreasing the distance between the corresponding source and target sub-domains. We also demonstrate the effectiveness of this method in high-dimensional and complex domain adaptation tasks through an experiment (see Section \ref{sec:digit}) where we transfer information from the MNIST \cite{lecun1998gradient} dataset to the MNIST-M dataset \cite{ganin2016domain} under scenarios with shifted class distribution (e.g. different proportions of labels in the source and target domains). As illustrated in Figure \ref{figure_motiv}(b), comparing with the distance between the source and target domains without aligning sub-domains, our method leads to a smaller distance. \begin{figure}[t!] \begin{center} \subfigure[One-dimensional space]{\includegraphics[width=0.99\columnwidth]{motivation_updated.png}} \subfigure[High-dimensional space]{\includegraphics[width=0.5\columnwidth]{method_overview_distance.png}} \caption{Illustration of the motivation. (a): The source domain (blue), $\mathcal{D_S}$, is sampled from a mixture of two Gaussians centered at $-1.5$ and $1.5$, respectively with weights $0.7$ and $0.3$. The target domain (orange), $\mathcal{D_T}$ is sampled from a mixture of two Gaussian distributions centered at $-1.4$ and $1.6$, respectively with weights $0.3$ and $0.7$. The auxiliary variable Class $\in {1,2}$ divides both domains into $\mathcal{D}^1$ (x $<$ 0) and $\mathcal{D}^2$ (x $\geq$ 0). (b) Distance between corresponding source-target sub-domains is shown for each cluster. Different clusters contain samples of different class labels. The distances are measured using Wasserstein-1 (W1) distance.} \label{figure_motiv} \end{center} \vskip -0.2in \end{figure} We summarize our main contributions in this work below: \begin{itemize}[noitemsep,topsep=0pt] \item We theoretically analyze UDA methods that align corresponding source-target sub-domains and establish a new generalization bound. \item We prove that our generalization bound is at least as strong as the state-of-the-art bounds for UDA problems with shifted class distribution under realistic assumptions. We also empirically demonstrate that our bound is much stronger on real-world datasets. \item Based on the proposed theory, we design an algorithm (DARSA) that reduces rebalanced distribution gaps between the source and target domains and rebalanced classification error by incorporating sub-domain structure. \item We demonstrate that DARSA outperforms state-of-the-art methods in shifted class distribution scenarios through experiments on both well-established benchmarks and real-world domain adaptation tasks. \end{itemize} \section{Related Work} \textbf{Discrepancy-based Domain Adaptation.} A common goal of UDA is to reduce the distribution gap between the source and target domains. One approach to achieve this is discrepancy-based methods \cite{tzeng2014deep,long2015learning,sun2016return}, which often use maximum mean discrepancy (MMD) \cite{borgwardt2006integrating} to directly match the marginal distributions of the source and that of the target domains. While MMD is a well-known Reproducing Kernel Hilbert Space (RKHS) metric, it is weaker than the Wasserstein-1 distance \cite{lu2020universal}. Therefore, inspired by WDGRL \cite{shen2018wasserstein}, our work uses the Wasserstein-1 distance as the distance metric. Many discrepancy-based methods also enforce the sharing of the first few layers of the networks between the source and target domains \cite{hassanpour2022survey}. In contrast, our method lifts this restriction by allowing a more flexible feature space. \textbf{Adversarial-based Domain Adaptation.} Adversarial-based domain adaptation methods aim to encourage domain similarity through adversarial learning \cite{shen2018wasserstein,liu2016coupling,isola2017image,tzeng2015simultaneous,tzeng2017adversarial,tzeng2020adapting,ganin2015unsupervised,ganin2016domain,peng2018zero,hoffman2018cycada}. These methods are divided into generative methods, which combine discriminative models with a generating process, and non-generative methods, which use a domain confusion loss to learn domain-invariant discriminative features \cite{wang2018deep}. However, many existing algorithms fail to align multi-modal distributions under label shifting scenarios. Additionally, training adversarial networks can be challenging due to mode collapse and oscillations \cite{liang2018generative}. \textbf{Class-conditional Domain Adaptation.} Class-conditional domain adaptation has been used in a few existing methods to encourage alignment of multi-modal distributions and has shown improved performance in many tasks \cite{deng2019cluster,shi2012information,jiang2020implicit,long2018conditional,snell2017prototypical,pinheiro2018unsupervised}. In contrast to our work, none of these methods provides a theoretical perspective on the benefit of incorporating class-conditional structures. \textbf{Theoretical Analysis of Domain Adaptation.} Many existing domain adaptation methods are inspired by generalization bounds based on the $\mathcal{H}$-divergence \cite{ben2006analysis}. The $\mathcal{H}$-divergence \cite{ben2006analysis} is a modified version of the total variation distance ($L_1$) that restricts the hypothesis to a given class. These generalization bounds can be estimated by learning a domain classifier with a finite Vapnik–Chervonenkis (VC) dimension. However, this results in a loose bound for most neural networks \cite{li2018extracting}. In our method, we use the Wasserstein distance for two reasons. First, the Wasserstein-1 distance is bounded above by the total variation distance employed by \citet{ben2010theory}. Additionally, the Wasserstein-1 distance is bounded above by the Kullback-Leibler divergence (a special case of the R\'{e}nyi divergence when $\alpha$ goes to 1 \cite{fournier2015rate}), giving stronger bounds than those presented by \citet{redko2017theoretical,mansour2012multiple}. The second reason for leveraging the Wasserstein distance is that it has stable gradients even when the compared distributions are far from each other \cite{gulrajani2017improved}. \section{Preliminaries} Given a labeled source domain $X_S$ with distribution $P_S$ and an unlabeled target domain $X_T$ with distribution $P_T$, our goal is to learn a classifier that can accurately predict labels for the target domain using only the labeled source data and the unlabeled target data. Specifically, we have a labeled source dataset $\{(x_S^i,y_S^i)\}_{i=1}^{N_S}$ and an unlabeled target dataset $\{x_T^i\}_{i=1}^{N_T}$. The source dataset has $N_S$ labeled samples, and the target dataset has $N_T$ unlabeled samples. We assume that the samples $x_S^i \in \mathcal{X} \subseteq \mathbb{R}^d$ and $x_T^i \in \mathcal{X} \subseteq \mathbb{R}^d$ are independently and identically drawn from the probability densities $P_S$ and $P_T$, respectively. For mathematical rigorousness, we further assume that $P_S$ and $P_T$ are probability densities of Borel probability measures in Wasserstein space $\mathcal{P}_1 (\mathbb{R}^d)$, which is the space of probability measures with finite first moment. Our goal is to learn a classifier $f(x)$ that can accurately predict the labels $y_T^i$, given only the labeled source dataset $\{(x_S^i,y_S^i)\}_{i=1}^{N_S}$ and the unlabeled target dataset $\{x_T^i\}_{i=1}^{N_T}$. \begin{itemize}[topsep=0pt] \item \textit{Sub-domain-related notations:} We assume that both $X_S$ and $X_T$ are mixtures of $K$ sub-domains. In other words, we have $P_S=\sum_{k=1}^K w_S^k P_S^k$ and $P_T=\sum_{k=1}^K w_T^k P_T^k$ where we use $P_S^k$ and $P_T^k$ to represent the distribution of the $k$-th subdomain of the source domain and that of the target domain respectively. Note that $\mathbf{w_S}\doteq[w_S^1,\dots,w_S^K]$ and $\mathbf{w_T}\doteq[w_T^1,\dots,w_T^K]$ belong to $\Delta^{K}$ (the $K-1$ probability simplex). \item \textit{Probabilistic Classifier Discrepancy:} For a distribution $\mathcal{D}$, we define the discrepancy between two functions $f$ and $g$ as: \begin{equation*} \gamma_\mathcal{D}(f,g) = \mathbb{E}_{x\sim\mathcal{D}}\left[|f(x) - g(x)|\right] \end{equation*} We use $g_T$ and $g_S$ to represent the true labeling functions of the target and source domains, respectively. We use $\gamma_S(f)\doteq\gamma_{P_S}(f,g_S)$ and $\gamma_T(f)\doteq\gamma_{P_T}(f,g_T)$ to respectively denote the discrepancies of a hypothesis $f$ to the true labeling function for the source and target domains. \item \textit{Wasserstein Distance:} The Kantorovich-Rubenstein dual representation of the Wasserstein-1 distance between $P_S$ and $P_T$ can be written as \cite{villani2009optimal}: \begin{equation*} W_1(P_S,P_T) = \sup_{||f||_L \leq 1} \mathbb{E}_{P_S}[f(x)] - \mathbb{E}_{P_T}[f(x)] \end{equation*} where the supremum is taken over all Lipschitz functions $f$ with Lipschitz constant $L \le 1$ (referred to as the set of $1$-Lipschitz functions). \end{itemize} For notational simplicity, we use $D(X_1,X_2)$ to denote the distance between the distributions of any pair of random variables $X_1$ and $X_2$. For instance, $W_1(\Phi(X_S),\Phi(X_T))$ denotes the Wasserstein-1 distance between the distributions of the random variables $\Phi(X_S)$ and $\Phi(X_T)$ for any transformation $\Phi$. \section{Theory} \label{sec:31} The importance of the proposed generalization bounds in this section is two-fold: (1) they are theoretically proved to be at least as strong as existing popular upper bounds used in the literature (see Theorem~\ref{theorem:tigher}) and are frequently much stronger on real-world data; (2) they inspire a new framework (see Section~\ref{sec:method}) that achieves state-of-the-art performance on both UDA benchmarks and real-world domain adaptation tasks (see Section~\ref{sec:results}). \subsection{Generalization Bounds for Domain Adaptation} Before presenting our theoretical results about sub-domain-based domain adaptation, we first present an upper bound closely related to the work of \citet{ben2010theory} and \citet{li2018extracting}. It is worth noting that we use the Wasserstein-1 distance in our analysis, as it provides a stronger bound than the total variation distance \cite{redko2017theoretical} employed by \cite{ben2010theory}[Theorem 1]. \begin{theorem}[Overall Generalization Bound] \label{theorem1} For a hypothesis $f: \mathcal{X} \rightarrow [0,1]$, \begin{equation} \gamma_T(f) \leq \gamma_S(f) + (\lambda+\lambda_H) W_1 (P_S, P_T) + \gamma^{\star} \end{equation} where $\gamma^{\star} = \underset{f \in \mathbb{H}}{\min} \gamma_S(f) + \gamma_T(f)$, $\mathbb{H}$ is a hypothesis class included in the set of $\lambda_H$-Lipschitz functions, and the true functions $g_T$ and $g_S$ are both $\lambda$-Lipschitz functions (as defined in Appendix \ref{def:lipschitz}). \end{theorem} \begin{proof} See in Appendix~\ref{appendix1}. \end{proof} \begin{remark} The upper bound in Theorem~\ref{theorem1} consists of three components: (i) $\gamma_S(f)$ is the performance of the hypothesis on the source domain, (ii) $W_1 (P_S, P_T)$ is the distance between the source and the target domains, and (iii) $\gamma^{\star}$ is a constant that is related to the fundamental difference between the source and the target problems. \end{remark} \begin{remark} \label{remark:smooth} For succinctness and clarity of the following analysis, we assume without loss of generality that $\lambda+\lambda_H\leq1$, simplifying the bound to \begin{equation} \gamma_T(f) \leq \gamma_S(f) + W_1 (P_S, P_T) + \gamma^{\star} \end{equation} \end{remark} Numerous works attempt to solve the transfer learning problem by designing algorithms that attempt to minimize similar generalization bounds (e.g., Theorem 1 of \citet{ben2010theory}). This approach first requires (1) selecting a mapping $\Phi: \mathcal{X} \rightarrow \mathcal{H}$ to transform the original problem by mapping $X_S$ and $X_T$ into a shared hidden space $\mathcal{H}$, and (2) a hypothesis $h:\mathcal{H}\rightarrow[0,1]$ for prediction. Since $\gamma_T(h\circ\Phi) = \gamma_{\Phi(X_T)}(h)$, with Theorem~\ref{theorem1}, we can have a generalization bound for the performance of the function $h\circ\Phi: \mathcal{X} \rightarrow [0,1]$ on the original target problem: \begin{multline} \gamma_T(h\circ\Phi)=\gamma_{\Phi(X_T)}(h)\\ \leq \gamma_{\Phi(X_S)}(h) + W_1 (\Phi(X_S), \Phi(X_T)) + \gamma^{\star}_{\Phi}. \end{multline} If the distance between $\Phi(X_S)$ and $\Phi(X_T)$, i.e., $W_1 (\Phi(X_S), \Phi(X_T))$, is close and the classification error of $h$ on the transformed source problem, i.e., $\gamma_{\Phi(X_S)}(h)$, remains low, then the performance of the hypothesis $h\circ\Phi$ on the \emph{original} target problem can be guaranteed. This motivation has led to numerous domain adaptation frameworks that optimize the following objective \begin{equation} \min_{\substack{\Phi:\mathcal{X}\rightarrow\mathcal{H}\\ h:\mathcal{H}\rightarrow[0,1]}} \gamma_{\Phi(X_S)}(h) + \alpha \; D(\Phi(X_S),\Phi(X_T)) \end{equation} where $\gamma_{\Phi(X_S)}(h)$ is the classification error of $h$ on the transformed source problem, $D$ is some distance between distributions and $\alpha$ is the balancing weight. In this work, we consider the case where $D$ is Wasserstein-1 distance. \subsection{Sub-domain-based Generalization Bounds for Domain Adaptation with Shifted Class Distribution} When taking the sub-domain information into consideration, we can have a stronger bound than the one in Theorem~\ref{theorem1}. We first present several results that will be used to build toward the main theorem. These results themselves may be of interest. First of all, for each subdomain, Theorem~\ref{theorem1} directly leads to the following Proposition: \begin{proposition}[Sub-domain Generalization Bound] For $k \in \{1,\ldots,K\}$, where K represents the number of distinct subdomains, for sub-domain $X^k_S$ with distribution $P_S^k$ and $X_T^k$ with distribution $P_T^k$, it holds any $f \in \mathbb{H}$ that \label{proposition1} \begin{equation} \gamma_{T}^k(f) \leq \gamma_S^k(f) + W_1(P_S^k,P_T^k) + (\gamma^{k})^{\star} \end{equation} where $(\gamma^{k})^{\star} = \min_{f \in \mathbb{H}} \gamma_S^k (f) + \gamma_T^k (f)$ is the minimum error can be reached, $\mathbb{H}$ is a hypothesis class included in the set of $\lambda_H$-Lipschitz functions, the true functions $g_T$ and $g_S$ are both $\lambda$-Lipschitz functions, and $\lambda+\lambda_H\leq1$. \end{proposition} Our second result shows that the classification error of any hypothesis $f$ on a domain can be represented by a weighted sum of the classification errors of $f$ on its sub-domains. \begin{lemma}[Decomposition of the Classification Error] For any hypothesis $f\in\mathbb{H}$, \label{lemma1} \begin{equation} \begin{split} \textstyle\gamma_S(f) =\sum_{k=1}^K w_S^k \gamma_{S}^k(f), \\ \textstyle\gamma_T(f) = \sum_{k=1}^K w_T^k \gamma_{T}^k(f). \end{split} \end{equation} \end{lemma} With Proposition~\ref{proposition1} and Lemma~\ref{lemma1}, we can have a generalization bound of the target domain with sub-domain information: \begin{theorem}[Sub-domain-based Generalization Bound] \label{theorem2} \begin{multline} \textstyle \gamma_T(f,g_T) \leq \sum_{k=1}^K w_T^k \gamma_S^k(f,g_S) \\ \textstyle + \sum_{k=1}^K w_T^k W_1(P_S^k,P_T^k) + \sum_{k=1}^K w_T^k (\gamma^{k})^{\star} \end{multline} \end{theorem} \begin{proof} See in Appendix~\ref{theorem2proof}. \end{proof} We next show that, under reasonable assumptions, the weighted sum of distances between corresponding sub-domains of the source and target domains is at most as large as the distance between the marginal distribution of the source domain and that of the target domain. \begin{theorem}\label{thm:weight_subdomain_distance_stronger} If the following assumptions hold, \begin{itemize} \item For $k \in \{1,\ldots,K\}$, $P^k_S$ / $P^k_T$ are Gaussian distributions with mean $m_S^k$ / $m_T^k$ and covariance $\Sigma_S^k$ / $\Sigma_T^k$. \item The distance between the paired source-target sub-domain is smaller or equal to the distance between the non-paired source-target sub-domain, i.e., for $k \neq k^\prime$, we have $W_1(P_S^k,P_T^k) \leq W_1(P_S^k,P_T^{k^\prime})$. \item There exists an assumed small constant $\epsilon >0$, such that $\underset{1\leq k \leq K}{\max}(\text{trace} (\Sigma_S^k)) \leq \epsilon$ and $\underset{1\leq k \leq K}{\max}(\text{trace} (\Sigma_T^{k^\prime})) \leq \epsilon$. \end{itemize} Then $$\textstyle \sum_{k=1}^K w_T^k W_1(P_S^k,P_T^k)\leq W_1(P_S,P_T) + \delta_c$$ where $\delta_c$ is $4\sqrt{\epsilon}$. \end{theorem} \begin{proof} See in Appendix~\ref{dis_stronger_proof}. \end{proof} \begin{remark} $\delta_c$ is a constant dependent only on the variance of the features but not the covariance between features in different dimensions. Moreover, the inequality still holds without $\delta_c$ on the right-hand side as demonstrated by our numerical experiments. To make our bound stronger, we add an intra-clustering loss $\mathcal{L}_{intra}$ in our learning objectives to minimize the $\delta_c$ term (details provided in Section \ref{sec:clustering_loss}). \end{remark} \begin{remark} The assumption of a Gaussian distribution for $X^k$ is not unreasonable since it is often the result of a complex transformation, $\Phi$, and the Central Limit Theorem indicates that the outcome of such a transformation converges to a Gaussian distribution. \end{remark} \label{sec:weighted_classification_loss} In the setting of shifted class distributions, $w_T^k$ and $w_S^k$ can be vastly different. To overcome this, we propose to minimize an objective with the simple intuition that \emph{important sub-domains in the target domain need more attention}. With this motivation, we propose the following objective function for UDA with shifted class distribution: \begin{equation} \textstyle \mathcal{L}(f) = \sum_{k=1}^{K}w^k_T\gamma_S^k(f). \end{equation} In other words, $\mathcal{L}$ reweights the sub-domains losses so that the subdomain with more weight in the target domain can be emphasized more. We prove that in UDA with shifted class distributions, the sub-domain-based generalization bound is at least as strong as the general upper bound without sub-domain information as demonstrated by the following Theorem. \begin{theorem}\label{theorem:tigher} Let $\mathbb{H}\doteq\{f | f:\mathcal{X}\rightarrow[0,1]\}$ denote a hypothesis space. Under the Assumptions in Theorem~\ref{thm:weight_subdomain_distance_stronger}, if the following assumption hold for all $f\in\mathbb{H}$: \begin{equation}\label{eqn:ass_uda} \textstyle \sum_{k=1}^{K}w^k_T\gamma_S^k(f) \leq \sum_{k=1}^{K}w^k_S\gamma_S^k(f), \end{equation} then we have \begin{equation*} \textstyle \sum_{k=1}^K w_T^k (\gamma^{k})^{\star} \leq \gamma^{\star}. \end{equation*} Further, let \begin{multline*} \textstyle \epsilon_c(f) \doteq \sum_{k=1}^K w_T^k \gamma_S^k(f,g_S) \\+ \textstyle \sum_{k=1}^K w_T^k W_1(P_S^k,P_T^k) + \sum_{k=1}^K w_T^k (\gamma^{k})^{\star} \end{multline*} denote the sub-domain-based generalization bound, let $$ \epsilon_g(f) \doteq \gamma_S(f,g_S) + W_1 (P_S, P_T) + \gamma^{\star} $$ denote the general generalization bound without any sub-domain information. We have for all $f$, \begin{equation*} \epsilon_c(f) \leq \epsilon_g(f) + \delta_c \end{equation*} \end{theorem} \begin{proof} See in Appendix~\ref{theorem:tigher_proof}. \end{proof} \begin{remark} We note that Assumption~\eqref{eqn:ass_uda} is likely to hold, as we are minimizing the left hand side of Eq.~\eqref{eqn:ass_uda}. \end{remark} \begin{remark} In addition to theoretically proving that our proposed bound is at least as strong as the existing bound, we empirically observe that the sub-domain-based bound tends to be much stronger (see Figure \ref{figure_motiv} (b) and quantitative results in Section \ref{sec:empircalbound}). \end{remark} Inspired by Theorem~\ref{theorem:tigher}, we next propose a framework for imbalanced UDA with the name \textit{Domain Adaptation with Rebalanced Sub-domain Alignment} (DARSA for short). \section{Methods}\label{sec:method} Our proposed method, DARSA, focuses on aligning the distributions of the source and target sub-domains (Figure 2(b)) rather than matching the marginal distributions (Figure 2(a)). In DARSA, we divide the source domains into sub-domains based on class labels, and divide target domains into sub-domains using predicted class labels (serving as pseudo labels which have shown success in previous research \cite{lee2013pseudo,deng2019cluster}) for unlabeled target domains. This encourages homogeneous sub-domains (e.g., sub-domains with the same class labels in a classification task) to merge, while separating heterogeneous sub-domains for better decision boundaries. \begin{figure}[t] \vskip 0in \begin{center} \subfigure[Baseline model]{\includegraphics[width=0.8\columnwidth]{figure2a.png}} \subfigure[Proposed model, DARSA]{\includegraphics[width=0.8\columnwidth]{figure2b.png}} \caption{Figure 2(a): classic UDA methods. Figure 2(b): DARSA. $w^k_T$ is the weight (i.e., $\mathbb{P}(y_T=k)$) of the $k$-th subdomain in target domain.} \label{figure1} \end{center} \vskip -0.2in \end{figure} Motivated by Theorem \ref{theorem2}, the framework of DARSA, shown in Figure \ref{figure_framework}, is composed of a source encoder $f_E^S$ (parameterized by $\theta_E^S$), a target encoder $f_E^T$ (parameterized by $\theta_E^T$), and a label classifier $f_Y$ (parameterized by $\theta_Y$). In our implementation, all three functions are defined as neural networks. We first pretrain $f_E^S$ and $f_Y$ with source data, and initialize $f_E^S$ and $f_E^T$ with pretrained weights. The source/target encoder $f_E^S$/$f_E^T$ maps data to feature space, then the classifier $f_Y$ uses extracted features to predict labels. Our framework is outlined in pseudo-code in Appendix \ref{sec:algorithm}. Source labels and predicted target labels are used in the learning objective function for the following purposes: ($i$) Aligning the sub-domains of the source and the target; ($ii$) Estimating weights $\mathbf{w_S}$ and $\mathbf{w_T}$; ($iii$) Calculating weighted classification loss and clustering losses. We next give a detailed discussion of the learning objective function. \subsection{Learning Objectives} \label{lo} Our learning objectives are motivated by Theorem \ref{theorem2}. Based on Equations \ref{lossy}, \ref{lossd}, \ref{lossc}, and \ref{lossa}, we can represent the learning objectives as follows: \begin{equation} \textstyle \min_{\theta_Y,\theta_E^S, \theta_E^T} \lambda_Y \mathcal{L}_Y + \lambda_D \mathcal{L}_D + \mathcal{L}_{C} \\ \end{equation} where $\mathcal{L}_Y$ represents weighted source domain classification error, $\mathcal{L}_D$ represents weighted source-target domain discrepancy, $\mathcal{L}_{C} = \lambda_c \mathcal{L}_{intra} + \lambda_a \mathcal{L}_{inter}$ represents the clustering loss (details provided in Section \ref{sec:clustering_loss}), and $\lambda_Y$, $\lambda_D$, $\lambda_c$ and $\lambda_a$ are hyperparameters representing weights of each loss. We next elaborate on each one of the losses. \subsubsection{$\mathcal{L}_Y$(Weighted source domain classification error)} The weighted source domain classification error in Theorem \ref{theorem2} can be further expressed as: \begin{equation} \label{lossy} \begin{split} & \textstyle \sum_{k=1}^K w_T^k (\gamma_S^k(f,g_S)) \\ & \textstyle = \sum_{k=1}^K w_T^k\int P_S(x|c=k) |f(x) - g_S(x)|dx \\ & \textstyle = \sum_{k=1}^K w_T^k\int \frac{P_S(c=k|x)P_S(x)}{P_S(c=k)} |f(x) - g_S(x)|dx \\ & \textstyle = \sum_{k=1}^K \frac{w_T^k}{w_S^k}\mathbb{E}_{x\sim D_s} w_S^k(x)|f(x) - g_S(x)| \\ \end{split} \end{equation} where variable $c$ represents class, $w_T^k = P_T(c=k),w_S^k = P_S(c=k), w_S^k(x) = P_S(c=k|x)$. We say that $P_S(c=k|x) = 1$ only when data point $x$ is in class $k$, otherwise $P_S(c=k|x) = 0$. $w_S^k$ can be set to the marginal source label distribution, and $w_T^k$ can be estimated from the target predictions. From Equation \ref{lossy}, we can express the empirical weighted source domain classification error as: \begin{equation*} \begin{split} \textstyle\mathcal{L}_Y(\theta_Y,\theta_E^S) & \textstyle= \frac{1}{N_S} \sum_{x^i \in \mathcal{X}_S} \mathbbm{1}_{y^i = k}\frac{w_T^k}{w_S^k} \ell (\hat{y^i}, y^i) \end{split} \end{equation*} where $\hat{y}^i = f_Y(f_E^S(x^i))$ is the predicted label and $\ell$ can be any non-negative loss function (e.g., cross-entropy loss for classification tasks). \begin{figure}[t] \begin{center} \centerline{\includegraphics[width=\columnwidth]{figure_framework.png}} \caption{The DARSA framework. Yellow lines representing the clustering loss $\mathcal{L}_C$, blue lines indicating domain discrepancy $\mathcal{L}_D$, and purple lines indicating source classification loss $\mathcal{L}_Y$.} \label{figure_framework} \end{center} \vskip -0.2in \end{figure} \subsubsection{$\mathcal{L}_D$ (weighted source-target domain discrepancy)} The weighted source-target domain discrepancy in Theorem \ref{theorem2} can be further expressed as: \begin{equation} \label{lossd} \begin{split} \textstyle\mathcal{L}_D(\theta_E^S, \theta_E^T, \theta_Y) & \textstyle= \sum_{k=1}^K w_T^k W_1(P_S^k,P_T^k) \\ & \textstyle= \sum_{k=1}^K w_T^k W_1(f_E^S(x_S^k),f_E^T(x_T^k)) \end{split} \end{equation} where $x_S^k$ are source samples with labels $y_S = k$, $x_T^k$ are target samples with predicted labels $\hat{y}_T = k$. In addition, we leverage the Sinkhorn algorithm \cite{cuturi2013sinkhorn} to approximate the Wasserstein metric. \begin{table*}[t!] \centering \caption{Summary of UDA results on the digits datasets with shifted class distribution, measured in terms of prediction accuracy (\%) on the target domain.} \centering \begin{tabular}{c|cccc} \hline ~ & \begin{tabular}[c]{@{}c@{}}MNIST to \\~MNIST-M\end{tabular} & \begin{tabular}[c]{@{}c@{}}MNISTM to \\~MNIST\end{tabular} & \begin{tabular}[c]{@{}c@{}}USPS to \\~MNIST\end{tabular} & \begin{tabular}[c]{@{}c@{}}SVHN to \\~MNIST\end{tabular} \\ \hline DANN \cite{ganin2016domain} & 63.1 & 93.0 & 59.8 & 64.9 \\ WDGRL \cite{shen2018wasserstein} & 60.4 & 93.6 & 63.9 & 64.3 \\ DSN \cite{bousmalis2016domain} & 62.3 & 98.4 & 59.9 & 15.2 \\ ADDA \cite{tzeng2017adversarial} & 88.2 & 90.7 & 44.8 & 42.4 \\ CAT \cite{deng2019cluster} & 54.1 & 95.4 & 81.0 & 65.8 \\ CDAN \cite{long2018conditional} & 58.7 & 96.0 & 42.0 & 38.3 \\ pixelDA\cite{bousmalis2017unsupervised} & 95.0 & 96.0 & 72.0 & 68.0 \\ DRANet \cite{lee2021dranet} & 95.2 & 97.8 & 86.5 & 40.2 \\ Source Only & 47.9 & 91.5 & 40.8 & 53.7 \\ \hline DARSA & \textbf{96.0} & \textbf{98.8} & \textbf{92.6} & \textbf{90.1} \\ \hline \end{tabular} \label{tab:1} \vspace{-3mm} \end{table*} \subsubsection{$\mathcal{L}_{C}$ (Clustering loss)} \label{sec:clustering_loss} Inspired by CAT \cite{deng2019cluster}, the clustering loss $\mathcal{L}_C$ consists of two losses: the \textit{intra-clustering loss $\mathcal{L}_{intra}$} and the \textit{inter-clustering loss $\mathcal{L}_{inter}$}. $\mathcal{L}_{intra}$ was first proposed to direct features of the same label to concentrate as well as to push features of different labels to separate from each other with at least a user-specified distance $m$ \cite{luo2018smooth}. We use the following definition of $\mathcal{L}_c$: \begin{equation} \label{lossc} \begin{aligned} & \mathcal{L}_{intra}(\theta_E^S, \theta_E^T, \theta_Y)\\ &= \mathcal{L}_{intra} (f_E^S(\mathcal{X_S})) + \mathcal{L}_{intra} (f_E^T(\mathcal{X_T})) \end{aligned} \end{equation} with \begin{align} \begin{aligned} & \mathcal{L}_{intra} (f_E^S(\mathcal{X}))\\& = \frac{1}{N^2} \sum_{i,j=1}^N \Big[\delta_{ij} \|f_E(x_i) - f_E(x_j)\|^2 \nonumber \\ & + (1-\delta_{ij}) \max \left(0, m - \|f_E(x_i) - f_E(x_j)\|^2\right)\Big] \end{aligned} \end{align} where $N$ represents the number of samples in the domain $\mathcal{X}$, $\delta_{ij} = 1$ only if $x_i$ and $x_j$ have the same label (using ground truth label in source domain; use predicted label in target domain), otherwise $\delta_{ij} = 0$. $m$ is a pre-defined distance controlling how separate we want each class to be. $\mathcal{L}_{inter}$ is leveraged to help domain adaptation by aligning centroids of the source sub-domains with that of the corresponding target sub-domains in the representation space. The definition of $\mathcal{L}_{inter}$ is \label{lossa} \begin{align} \begin{aligned} &\textstyle\mathcal{L}_{inter}(\theta_E^S, \theta_E^T, \theta_Y) \\ &= \frac{1}{K} \sum_{k=1}^K \|\text{c(}f_E^S(x_T^k)\text{)} - \text{c(}(f_E^T(x_T^k)\text{)}\|^2 \end{aligned} \end{align} where c($\cdot$) calculates the centroids of the sub-domains. \section{Results} \label{sec:results} We first demonstrate through empirical evidence that our proposed generalization bound is stronger. After that, we evaluate our proposed method, DARSA, on four benchmark UDA tasks using digit datasets and two tasks using real-world neural datasets. All source-target datasets are resampled to enforce shifted label distributions. We show that our method outperforms all state-of-the-art transfer learning methods under shifted label distributions, including methods specifically designed for computer vision tasks. As shown in Figure \ref{featurespace}, our method learns a feature space that is discriminative and domain-invariant, resulting in improved performance in target domain predictions. \subsection{Empirical Analysis of our Proposed Generalization Bound} \label{sec:empircalbound} In our empirical analysis of our proposed generalization bound, we evaluate the bound on the MNIST to MNIST-M UDA task (dataset details in Section \ref{sec:digit}). As shown in Figure \ref{figure_emp_compare}, our empirical results demonstrate that our theory, i.e., Theorem \ref{theorem2} provides a stronger generalization bound than Theorem \ref{theorem1}. Additional empirical results to support this claim are provided in Appendix \ref{emp_tighter_more}. \begin{figure}[t] \vskip -0.2in \begin{center} \subfigure[Domain discrepancy]{\includegraphics[width=0.48\columnwidth]{mtom_loss_domain.png}} \subfigure[Source Classification Loss]{\includegraphics[width=0.51\columnwidth]{mtom_loss_clf.png}} \caption{For MNIST to MNIST-M UDA task with shifted class distribution, a) Compare the domain discrepancy term ($\mathcal{L}_D$) in our proposed bound to that in Remark \ref{remark:smooth} b) Compare the source classification term ($\mathcal{L}_Y$) in our proposed bound to that in \ref{theorem1}}. \label{figure_emp_compare} \end{center} \vskip -0.3in \end{figure} \subsection{Experiments on Digit Datasets with Shifted Class Distribution} \label{sec:digit} We conduct experiments on four digit datasets: MNIST \cite{lecun1998gradient}, MNIST-M \cite{ganin2016domain}, USPS, and Street View House Numbers (SVHN) \cite{netzer2011reading}. To create class distribution shifts, we subsample the datasets so that the proportion of odd digits is three times the proportion of even digits in the source dataset, and vice versa in the target dataset. To ensure a fair comparison, all methods use a subset of the labeled target domain data (around 1000 samples) as a validation set for the hyperparameters search. This validation set performance serves as an upper bound for evaluating the performance of UDA methods. The experimental details (dataset description, model structure and hyperparameters) are provided in appendix \ref{digit_intro}. As shown in Table \ref{tab:1}, our model outperforms all competing methods. We note that most of the SOTA comparisons are not specifically designed for shifted class distribution scenarios, and this setting caused issues in several competing methods. We use Adaptive Experimentation (Ax) platform \cite{bakshyopen2019,letham2019constrained}, an automatic tuning approach to select hyperparameters to maximize their performance in domain shifting scenarios (see Appendix \ref{digit_hyper_details}). \subsection{Experiments on the TST Dataset with Shifted Class Distribution} \label{sec:TST} The Tail Suspension Test (TST) dataset \cite{gallagher2017cross} consists of local field potentials (LFPs) recorded from the brains of 26 mice. These mice belong to two genetic backgrounds: a genetic model of bipolar disorder (Clock-$\Delta$19) and wildtype mice. Each mouse is subjected to 3 behavioral assays which are designed to vary stress: home cage (HC), open field (OF), and tail-suspension (TS). We conduct experiments on two transfer learning tasks using these neural activity data: transferring from wildtype mice to the bipolar mouse model and vice versa. We aim to predict for each one second window which of the 3 conditions - HC, OF, or TS - the mouse is currently experiencing. To create class distribution shifts, we subsample the datasets so that we have 6000 Homecage observations, 3000 Open Field observations, and 6000 Tail Suspension observations in the bipolar genotype dataset and 3000 Homecage observations, 6000 OpenField observations, and 3000 Tail Suspension observations in the wildtype genotype dataset. The experimental details (dataset description, model structure and hyperparameters) are provided in appendix \ref{neural_intro}. As shown in Table \ref{tab:neural}, our model outperforms all competing methods. \begin{table}[t] \centering \caption{Summary of UDA results on the TST datasets with shifted class distribution, measured in terms of prediction accuracy (\%) on the target domain.} \centering \begin{tabular}{c|cc} \hline & \begin{tabular}[c]{@{}c@{}}Bipolar to \\~Wildtype\end{tabular} & \begin{tabular}[c]{@{}c@{}}Wildtype to \\~Bipolar\end{tabular}\\ \hline DANN \cite{ganin2016domain} & 79.9 & 81.5 \\ WDGRL \cite{shen2018wasserstein} & 79.6 & 79.5 \\ DSN \cite{bousmalis2016domain} & 79.4 & 80.9 \\ ADDA \cite{tzeng2017adversarial} & 75.1 & 72.6 \\ CAT \cite{deng2019cluster} & 77.3 & 78.6 \\ CDAN \cite{long2018conditional} & 75.0 & 73.6 \\ Source Only & 73.8 & 70.4 \\ \hline DARSA & \textbf{86.6} & \textbf{84.8} \\ \hline \end{tabular} \label{tab:neural} \vskip -0.3in \end{table} \subsection{Analysis of Feature Space} We visualize the feature spaces learned by DANN \cite{ganin2016domain} and our method, DARSA, using UMAP \cite{sainburg2021parametric}. As shown in Figure \ref{featurespace} (a) and (b), features learned with DARSA form stronger clusters when the labels are the same, and clusters with different labels are more separated from one another. In contrast, DANN \cite{ganin2016domain} fails to learn a good source-target domain alignment in the feature space (shown in Figure \ref{featurespace} (c) and (d)) in the presence of class distribution shifts. This confirms that our method, DARSA, can learn a class-conditional feature space that is discriminative and domain-invariant, which improves performance in target domain prediction. \begin{figure}[ht] \vskip -0.15in \begin{center}{\includegraphics[width=\columnwidth]{figure51.png}} \caption{For MNIST to MNIST-M UDA task with shifted class distribution (a) feature space learned by our method, DARSA. (b) feature space learned by DANN. Left panel: colored by source/target; Right panel: colored by true label (digit). The features are projected to 2-D using UMAP.} \label{featurespace} \end{center} \vskip -0.3in \end{figure} \section{Discussion and Conclusion} In this paper, we propose a novel bound for UDA that motivates a novel algorithm with improved performance in various tasks. Since most domain adaptation work is based on reducing the distribution gaps in the source and target domain without incorporating class-conditional structure, we address this challenge to improve alignment between domains during training. We show that our method outperforms state-of-the-art methods in class imbalance and class distribution shifting scenarios. Our work focuses on classification tasks with source and target having the same number of distinct classes; however, in some cases, this could be addressed by combining similar classes. In addition, by choosing an appropriate clustering algorithm within the framework, this work has the potential to extend to regression tasks. Our current method is also limited to two domains, and future work will extend our method to multiple domains. Lastly, \citet{johansson2016learning} shows that estimating counterfactual outcomes in causal inference under ignorability is mathematically equivalent to UDA between domains $D \in \{0,1\}$ under covariate shift \cite{johansson2020generalization}. With the equivalency, our framework has the potential to be used in causal inference scenarios.
\section{Introduction}\label{S:Introduction} To satisfy the proliferating demands of next generation wireless applications, such as multisensory extended reality (XR)~\cite{Saad2020,Martin2020,Hu2021}, connected robots~\cite{Weiss2021,Savazzi2021,Sankhe2021}, wireless brain computer interactions~\cite{Perdikis2020}, digital twins~\cite{Khan2022b}, industrial internet-of-things (IoT)~\cite{Zhou2021}, tactile IoT~\cite{Aijaz2017a,Saeed2020,Yang2019b}, internet of underwater things~\cite{Abdulkadir2020,Filho2020}, self-driving ground and air vehicles~\cite{Pretto2021, Liu2022f,Zhong2022f}, and others, while dealing with the spectrum scarcity of the radio and microwave bands~\cite{Boulogeorgos2017,Boulogeorgos2018a,PhD:Boulogeorgos,Matthaiou2021}, the research, innovation and industrial communities turned its attention to communications in the millimeter wave (mmWave)~\cite{Xi2019,Jie2020,Ntontin2021,Ntontin2021b,Le2022}, terahertz (THz)~\cite{Boulogeorgos2021a,Boulogeorgos2020b,Boulogeorgos2021e,Tsiftsis2022}, and optical bands~\cite{Trevlakis2020,Boulogeorgos2021d,Abdulkadir2022,Anas2022,Naser2022}. Despite the unprecedented bandwidth that high-frequency systems offer, in order to achieve the promised performance excellence in terms of throughput, latency, and reliability, in acceptable transmission distances, both the transmitter (TX) and the receiver (RX) require knowledge of each others relative position and orientation~\cite{Azari2022,Pliatsios2022,Boulogeorgos2022f,Boulogeorgos2022g,Boulogeorgos2022h}. As a consequence, localization is expected to become a vital component of high-frequency wireless systems. Scanning the technical literature, several surveys and tutorials for localization can be identified~\cite{Bresson2017,Ferreira2017,Kuutti2018,Laoudias2018,Peral2018,Keskin2018,Shit2019,Zafari2019,Saeed2019,Wen2019,Burghal2020,Zhu2020,Motroni2021,DeLima2021,Kanhere2021a,Xiao2022,Ding2022,Laconte2022,Liu2022,Chen2022}. In more detail, in~\cite{Bresson2017}, the authors presented an overview of the simultaneously localization and mapping approaches in self-driving vehicles. In~\cite{Ferreira2017}, the authors reported the requirements, technology enablers, techniques and approaches, as well as existing system models and their performance in indoor localization for emergency response scenarios. In~\cite{Kuutti2018}, a state-of-the-art (SotA) vehicle localization approaches comparison and assessment was conducted and their role to vehicle-to-everything scenarios was discussed. A list of the enabling localization technologies that were developed for cellular systems and wireless local area networks until 2018 was documented in~\cite{Laoudias2018}. In~\cite{Peral2018}, the authors presented an overview of the standardized localization methods from the first to the fifth generation cellular systems. In~\cite{Keskin2018}, the authors revisited and discussed visible light positioning (VLP) approaches. The authors of~\cite{Shit2019} conducted an overview of the device-free localization approaches and presented the 2019 research and development trends. In~\cite{Zafari2019}, the authors surveyed the 2019 indoor localization systems and methods accounting for different radio technologies. In~\cite{Saeed2019}, the authors revisited and explained multidimensional scaling (MDS)-based localization techniques. In~\cite{Wen2019}, a review of the SotA of localization techniques for massive multiple-input multiple-output (MIMO) systems was conducted. Moreover, the authors of~\cite{Burghal2020} reviewed machine learning (ML)-based localization methodologies that employ radio signals. In~\cite{Zhu2020}, a summation of ML-enabled indoor localization approaches was reported. The authors of~\cite{Motroni2021} presented a survey of radio frequency identifier (RFID) based localization techniques. In~\cite{DeLima2021}, the authors focused on the identification of key enabling technologies and applications of localization in the sixth generation (6G) networks. In~\cite{Kanhere2021a}, the vision of cm-level localization was presented and map-based approaches was identified as possible enablers. In~\cite{Xiao2022}, a survey on localization fundamental approaches accompanied by SotA results and future directions was reported. The authors of~\cite{Ding2022} focused on the recent developments and applications of simultaneous localization and mapping (SLAM) with emphasis in complex and unstructured agricultural environments. In~\cite{Laconte2022}, the authors overviewed a number of localization methods for autonomous vehicles. The authors of~\cite{Liu2022} conducted a survey on the fundamental limits of integrated communication and localization systems. Finally, in~\cite{Chen2022}, the authors provided a survey concerning THz empowered localization techniques. \begin{table*} \centering \caption{Summary of recent localization surveys and tutorials (2017-2019)} \label{tab:Survey1719} \begin{tabular}{|c|c| p{2.3cm} | p{1.6cm} | p{1.5cm}| p{1.8cm}| p{2.5cm} | p{4.0cm} |} \hline \textbf{Year} & \textbf{Ref.} & \textbf{Applications} & \textbf{Use-cases} & \textbf{Technologies} & \textbf{System models} & \centering \textbf{KPIs} & \textbf{Algorithms} \\ \hline \hline 2017 & \cite{Bresson2017} & Autonomous vehicle & Outdoor & Sensors & \centering -- & Accuracy, scalability, availability, recovery, updatability, dynamicity & SLAM \\ \hline 2017 & \cite{Ferreira2017} & Emergency response & Indoor \par Outdoor & Radio signals, Inertial measurement units (IMUs) & \centering -- & Accuracy, information~accessibility, adaptability, scalability, physical robustness, assembling complexity, equipment's size and weight, energy efficiency, cost & Proximity, Triangulation, Lateration/ trilateration/ multilateration, Maximum likelihood estimation, Dead reckoning, Kalman filters, Centroid, Particle filters, Fingerprinting, Visual analysis, Map matching \\ \hline 2018 & \cite{Kuutti2018} & Autonomous vehicles & Outdoor & GPS/IMU, Sensors, Radio and microwave signals, VLP & \centering -- & Accuracy, Dead reckoning, Position error, Odometry, Packet loss, Robustness, Time-to-first-fix & Differential GPS, Assisted GPS, Real time kinematic based techniques, SLAM, Random sample consensus, Frequency modulation continuous wave (FMCW)-based solutions \\ \hline 2018 & \cite{Laoudias2018} & Network planing and optimization, Emergency response & Indoor \par Outdoor & Cellular, WLANs, Sensors, mmWave & Cellular & Accuracy & Probabilistic radio signal strength (RSS) fingerprint matching, Semi-supervised and unsupervised learning, Cell-identifier and GPS position sequence matching, Hidden Markov model, Bayesian learning, Assisted GPS, Advanced forward link trilateration, RF pattern matching, Intelligent probability hierarchy based solutions, SLAM \\ \hline 2018 & \cite{Peral2018} & \centering -- & Indoor \par Outdoor & Radio signals, WLAN/ Bluetooth, Sensors & \centering -- & Accuracy & Cell-ID, RF pattern matching, Time of arrival (ToA) and time difference of arrival (TDoA) based methods, Advanced forward link trilateration, Stand-alone, Differential, and Assisted GNSS \\ \hline 2018 & \cite{Keskin2018} & \centering-- & Indoor & VLP & VLP & Cram\'er-Rao lower bound (CRLB), Root mean square error, Power efficiency & Direct positioning, proximity, geometric- and statistical-based approaches, fingerprinting, mapping\\ \hline 2019 & \cite{Shit2019} & Smart agriculture, Smart grid, Smart media, Smart cities, Social computing, Social IoT, e-Business, Affective computing, Cyber physical systems, Wearable applications & Indoor \par Outdoor & Radio signals, Sensors & \centering-- & Static and dynamic backscattering model & Directional and ambient radio imaging, channel diversity, Shadowing, Comprehensive sensing, Radio grid, Diffraction theory, Extreme learning machine, Markov model, Probabilistic classification, Gradient fingerprinting, Support vector machine (SVM), Deep learning, Dictionary learning \\ \hline 2019 & \cite{Wen2019} & \centering -- & Indoor \par Outdoor & mmWave & mmWave MIMO & Accuracy, Complexity & Indirect localization, Direct localization, Fingerprinting \\ \hline 2019 & \cite{Zafari2019} & Personalized context-aware networks, e-Health, Disaster management and recovery, Security, Asset management and tracking & Indoor & WiFi, Bluetooth, Zigbee, RFID, VLP, Acoustic, Ultrasound & \centering -- & Availability, Cost, Energy efficiency, Reception range, Accuracy, Latency, Scalability & Fingerprinting/scene analysis, RSS, Channel state information (CSI), Angel of arrival (AoA), Time of flight (ToF), TDoA, Return time of flight (RFoF), and Phase of arrival-based approaches \\ \hline 2019 & \cite{Saeed2019} & Disaster management, Security, IoT, Underwater exploration & Indoor \par Outdoor \par NTN \par Underwater & Cellular, RFID, Sensors, Acoustic, VLP & \centering-- & Accuracy, Complexity & MDS \\ \hline \end{tabular} \end{table*} \begin{table*} \centering \caption{Summary of recent localization surveys and tutorials (2020-2022)} \label{tab:Survey2022} \begin{tabular}{|c|c| p{2.3cm} | p{1.6cm} | p{1.5cm}| p{1.8cm}| p{2.5cm} | p{4.0cm} |} \hline \textbf{Year} & \textbf{Ref.} & \textbf{Applications} & \textbf{Use-cases} & \textbf{Technologies} & \textbf{System models} & \centering \textbf{KPIs} & \textbf{Algorithms} \\ \hline \hline 2020 & \cite{Burghal2020} & Autonomous vehicles, Mission-critical applications, IoT, Beam alignment in massive MIMO systems & Indoor \par Outdoor & WiFi, Cellular, Bluetooth, Sensors & \centering -- & Accuracy & K-nearest neighbors (KNN), Gaussian processes, Ensemble methods, Neural networks (NNs), Convolution NNs (CNNs), Recurrent NNs (RNNs), Autoencoders, Generative and statistical models, Deep belief networks, MDS, Tranfer learning \\ \hline 2020 & \cite{Zhu2020} & Positioning and navigation of indoor environment, Nursing people and tracking, People management, Fire rescue and other safety needs & Indoor & WiFi, Bluetooth, VLP, Magnetic field & \centering -- & Accuracy, latency, complexity, coverage, robustness & Fingerprint \\ \hline 2020 & \cite{Nguyen2020a, Nguyen2020b} & Social distancing & Indoor \par Outdoor \par NTN & WiFi, GNSS, cellular, bluetooth, UWB, RFID & \centering -- & Accuracy, latency, coverage & Trilateration, Kalman filters, RSS-based, TDoA-based, Assisted-GNSS, Enhanced Cell-ID \\ \hline 2021 & \cite{Motroni2021} & Vehicle localization, navigation, tracking & Indoor & RFID, Sensors & \centering -- & Accuracy, cost, energy efficiency, complexity & -- \\ \hline 2021 & \cite{DeLima2021} & Environment mapping, Robot localization, Tracking, Localization and sensing for eHealth, Context awareness, Radar-based applications & Indoor \par Outdoor & mmWave, THz, Reconfigurable intelligent surfaces (RISs) & \centering -- & \centering -- & Supervised, unsupervised, reinforcement learning \\ \hline 2021 & \cite{Kanhere2021a} & People, objects, and vehicles monitoring & Indoor \par Outdoor & mmWave, Cellular & mmWave & Accuracy & Fingerprinting, Kalman filter, Extended Kalman filter \\ \hline 2021 & \cite{Lemic2021} & Nanonetworks & Nanoscale & THz & \centering -- & Accuraxy, complexity & -- \\ \hline 2022 & \cite{Xiao2022} & Mutisensory XR, Tele-presence, Smart transportation, Connected robotics and autonomous systems, UAVs & Indoor \par Outdoor \par NTN & mmWave, THz, Sensors & \centering -- & Accuracy, latency, precision, energy efficiency & Tracking, SLAM, NNs Extednde Kalman filter \\ \hline 2022 & \cite{Ding2022} & Precision agriculture, mapping, navigation & Outdoor & Sensors & \centering -- & Accuracy & Extended Kalman filter SLAM, Monte Carlo localization, Visual SLAM, Sensor fusion SLAM \\ \hline 2022 & \cite{Laconte2022} & Autonomous vehicles & Outdoor & Sensors & \centering -- & Accuracy, F1 Score & Extended Kalman filters, NNs \\ \hline 2022 & \cite{Liu2022} & IoT connected home, Internet of vehicles, UAV communications and navigation, Target detection & Indoor \par Outdoor \par NTN & WiFi, mmWave & Cooperative and non-cooperative localization with MIMO and virtual MIMO & Accuracy, coverage, complexity, stability & -- \\ \hline 2022 & \cite{Chen2022} &\centering -- & Indoor \par Outdoor & mmWave, THz & THz with and without RISs & Accuracy, Coverage, Latency, Update rate, Stability, Scalability, Mobility, Complexity & ToA-based, TDoA-based, AoA-based, AoD-based, Expected maximization, NNs, Kalman filter, Particle filter \\ \hline \multicolumn{2}{|c|}{This work} & Autonomous~supply chain, Smart cities, Manufacturing,~XR, Earth monitoring, Network~expansion, Mapping, Sensor infrastructure~web, Context-aware networks, Precision healthcare, Security, Gesture/motion recognition, Robots, Nanoscale, e-Health, Agriculture & Indoor \par Outdoor \par NTN \par Underwater \par Nanoscale & mmWave, THz, hardware, beamforming, RIS, AI, channel charting, radars, sensors, VLP & mmWave/THz, VLP & Accuracy, precision, latency, coverage, complexity, stability & Triangulation, Kalman filters, Compressive sensing, MDS, Direct localization, Swarm intelligence, Fingerprinting, SLAM, kNN, SVM, Decision trees, Gaussian processes, NNs, Autoencoders, CNNs, RNNs, Unsupervised learning, Semi-supervised learning, clustering, Dimensionality reduction, Federated learning, Reinforcement learning (RL), Deep RL, Transfer learning, Manifold learning, Cooperative approaches\\ \hline \end{tabular} \end{table*} Tables~\ref{tab:Survey1719} and \ref{tab:Survey2022} summarize the surveys existing in literature that investigate localization applications and use cases as well as the relevant technologies, system models, key performance indicators (KPIs) and approaches. However, the focus and aim of each survey is different both in terms of use cases, technologies and methods enlisted. For instance, almost every survey includes indoor and outdoor terrestrial use cases~\cite{Bresson2017, Ferreira2017, Kuutti2018, Laoudias2018, Peral2018, Keskin2018, Shit2019, Wen2019, Zafari2019, Saeed2019, Burghal2020, Zhu2020, Motroni2021, DeLima2021, Kanhere2021a, Xiao2022, Ding2022, Laconte2022, Liu2022, Chen2022}, while only~\cite{Saeed2019, Xiao2022, Liu2022} take into account non-terrestrial networks (NTN) and only~\cite{Saeed2019} investigates underwater use cases. As far as technology enablers are concerned, each contribution focuses on specific subsets of them. Specifically, the majority of the surveys before $2020$ take into account sensors, radars, and cellular systems~\cite{Bresson2017, Ferreira2017, Kuutti2018, Peral2018, Keskin2018, Shit2019, Zafari2019, Saeed2019}, while the contrary is valid for contributions between $2020$ and $2022$ that mainly investigate mmWave/THz technologies~\cite{DeLima2021, Kanhere2021a, Xiao2022, Liu2022, Chen2022}. In addition, enablers like visible light positioning (VLP), beamforming, channel charting and reconfigurable intelligent surfaces (RISs) are taken into consideration in a very small number of surveys. From a system model point of view, only selected contributions provide mathematical modelling for the discussed technologies, such as~\cite{Laoudias2018, Keskin2018, Wen2019, Kanhere2021a, Liu2022, Chen2022}. From these tables, it becomes evident that a complete survey of the applications, use cases, technology enablers, system models, KPIs, and methods with focus on the future 6G wireless networks is missing from the bibliography. To cover this gap and with respect to the aforementioned contributions, the overall objective of this survey is to deliver a timely and comprehensive review of the localization applications, use cases, system models, enabling technologies, methods and KPIs in the 6G era as well as to identify research gaps and highlight possible research directions. In particular, this survey investigates the following: \begin{figure}[t] \centering\includegraphics[width=1\linewidth]{figures/Structure.eps} \caption{The overall structure of this survey.} \label{fig:Structure} \end{figure} \begin{itemize} \item The main localization-specific applications and use cases of future 6G wireless networks are presented. \item The localization-enabling technologies are investigated with regard to their contribution towards advancing the SotA of wireless systems. \item System models for line-of-sight (LOS) and non-LOS (NLOS) channels in mmWave/THz and VLP localization wireless systems are analyzed taking into account both classic reflectors and RISs. \item The major KPIs used by localization methods to measure the performance of the system are discussed and accompanied by mathematical expressions. \item The SotA of conventional and learning-based localization methodologies/algorithms are investigated and conceptual figures are provided to aid the reader in understanding their basic principles. \item The formulation, system design and optimization of the localization problem is described. \item Directions and insights for the design and improvement of future 6G wireless systems are discussed. \end{itemize} The reminder of the survey article is organized as follows: Section~\ref{S:6G_aplications} describes the applications of 6G wireless systems, while Section~\ref{S:Use cases} delves into the use cases and their relations with the various 6G applications. Next, the technology enablers of localization are presented in~Section~\ref{S:Technology_enablers}. Section~\ref{S:System_model} focuses on the system models for mmWave/THz localization and VLP, while the various KPIs of the localization approaches are presented in~Section~\ref{S:KPIs}. Section~\ref{S:Methodologies} describes the SotA conventional and learning-based localization methodologies and algorithms that are envisioned to be applied in future 6G wireless networks. Section~\ref{S:Theoretical_framework} highlights the major aspects of the localization problem formulation, systems design as well as its optimization. Finally, in~Section~\ref{S:Future_directions}, the findings of this contribution are translated into insights and future directions, while concluding remarks are provided in~Section~\ref{S:Conclusion}. The structure of this survey in a glance is reported in~Figure~\ref{fig:Structure}. \textit{Abbreviations and notations}: The abbreviations that can be found throughout this survey are presented in~Table~\ref{tab:Abbreviations}, given at the top of the next page. Unless stated otherwise, {bold} low and capital letters respectively denote vectors and matrices, $(\cdot)^T$ stands for the transpose matrix, $|\cdot|$ denotes absolute value, $e^x$ represents the exponential function, $(\cdot)^{-1}$ is the inverse matrix, while $a^b$ is $a$ in the power of $b$. In addition, $\cos(\cdot)$, $\sin(\cdot)$, $\arctan2(\cdot)$, and $\arcsin(\cdot)$ represent the cosine, sine, 2-argument arctangent, and the arcsine functions, respectively. Also, $\log_{2}(\cdot)$ stands for the binary logarithm, $\mathrm{Hilb}[\cdot]$ represents the Hilbert function, and $\mathbb{E}[\cdot]$ denotes the expected value. Moreover, $tr(\cdot)$ is the trace of a matrix and $I^{-1}(\cdot)$ denotes the inverse Fisher matrix. $\argmin(\cdot)$ represents the argument of minimum, $\mathrm{diag}(\cdot)$ is the diagonal matrix, and $\mathrm{rank}(\cdot)$ denotes the rank of a matrix. Finally, $\sqrt{\cdot}$ represents the root and $\sum^N_{i=1}x_i$ is the sum of $x_i$ with $i$ in the range of $[1,N]$. \begin{table*} \centering \caption{Abbreviations} \label{tab:Abbreviations} \begin{center} \begin{tabular}{ll|ll} 1D & One dimensional & MR & Mixture reality \\ 2D & Two dimensional & MSE & Mean square error \\ 3D & Three dimensional & NASA & National aeronautics and space administration \\ 3G & Third generation & NG-RAT & Next generation radio access technology \\ 4D & Four dimensional & NLOS & Non line of sight \\ 4G & Forth generation & NN & Neural network \\ 5G & Fifth generation & OFDM & Orthogonal frequency division multiplexing \\ 6G & Sixth generation & PARP & Peak to average power ratio \\ AI & Artificial intelligence & PCA & Principal component analysis\\ AoA & Angle of arrival & PD & Photo-detector \\ AoD & Angle of departure & QoE & Quality-of-experience \\ AR & Augmented reality & QoPE & Quality-of-physical-experience \\ BSE & Beam split effect & QoS & Quality-of-service\\ CDF & Cumulative distribution function & RaF & Random forest \\ CMOS & Complementary metal oxide semiconductor & RBF & Radial basis function \\ CNN & Convolutional neural network & RF & Radio frequency \\ COA & Curvature of arrival & RGB & Red green blue \\ CS & Compresive sensing & RIS & Reflective intelligent surfaces \\ CSI & Channel state information & RL & Reinforcement learning \\ D2D & Device to device & RMS & Root mean square \\ DL & Deep learning & RRN & Recurrent neural network \\ DoA & Direction of arrival & RSS & Received signal strength \\ DoD & Direction of departure & RTT & Round trip time \\ DOF & Degree of freedom & RX & Receiver \\ DT & Digital twin & SDG & Sustainable development goals \\ EMND & Enhanced MND & SDN & Software defined network \\ EKF & Extended Kalman filter & SINR & Signal to interference and noise ratio\\ FDM & Frequency division multiplexing & SLAM & Simultaneous localization and mapping \\ FIM & Fisher information matrix & SNR & Signal to noise ratio \\ FL & Federated learning & SotA & State of the art\\ FMCW & Frequency modulated continuous wave & SVM & Support vector machine \\ FOV & Field of view & TDoA & Time-difference of arrival \\ GALILEO & European GNSS & TDM & Time division multiplexing \\ GDoP & Geometrical dilution of precision & THz & Terahertz \\ GLONASS & Russian GNSS & TL & Transfer learning \\ GNSS & Global navigation satellite system & ToA & Time of arrival \\ GP & Gaussian process & ToF & Time of flight \\ GPS & Global positioning system & TX & Transmitter \\ GRU & Gated recurrent units & UAV & Unmanned aerial vehicle \\ IoT & Internet of things & UFK & Unscented Kalman filter \\ IVM & Import vector machine & UGV & Unmanned ground vehicle \\ KF & Kalman filter & UN & United Nations \\ kNN & k-nearest neighbors & URLLC & Ultra-reliable low latency communications \\ KPI & Key performance indicator & UWB & Ultra wide band \\ LED & Light-emitting diode & VLC & Visible light communications \\ LiDaR & Light detection and ranging & VLP & Visible light positioning \\ LOS & Line of sight & VNF & Virtual network function \\ LSTM & Long short-term memory & WiFi & Wireless fidelity \\ MDS & Multidimensional scaling & WSN & Wireless sensor network \\ MEM & Micro-electro-mechanical & XLM & Extended learning machine \\ MIMO & Multiple input multiple output & XR & Extended reality \\ ML & Machine learning & & \\ mmWave & Milimeter wave & & \\ MND & Malicious node detection & & \\ \end{tabular} \end{center} \end{table*} \section{Applications of localization in 6G wireless systems} \label{S:6G_aplications} \begin{figure*}[!ht] \centering\includegraphics[width=1\textwidth]{figures/applications_2.eps} \caption{Localization-assisted applications} \label{fig:applications} \end{figure*} Localization has been completely transformed by the advancement of multiple technologies, such as radars, sensors, AI, mmWave, THz, VLC, and RISs. As illustrated in~Fig.~\ref{fig:applications}. It is expected to play a dominant role in the next generation of communication networks through its incorporation to a variety of applications. Some indicative examples include pinpointing a device's outdoor location with cm- to mm-level precision, accurate indoor localization with reliable interpretation of 3D data in addition to the 2D data that are presently available, or the incorporation of roll, pitch, and yaw into the localization process. To achieve these, 6G promises to use a combination of radio and VLC localization to achieve cm- to mm-level accuracy whether the user, object, or device is inside and/or~outside. A detailed analysis of specific applications of localization in 6G wireless systems is presented in the following sections. In more detail, the first two sections distinguish between the various applications of localization based on the nature of the utilized hardware. In~Section~\ref{Ss:Sustainable_development}, the applications that fall under the sustainable development umbrella are analyzed, while in~Section~\ref{Ss:Immersive_telepresence}, the ones that will lead to achieving immersive telepresence are detailed. Section~\ref{Ss:Trust_zones} highlights promising 6G applications that involve setting up local trust zones for human and machine localization. Finally, Sections~\ref{Ss:Massive_twinning} and~\ref{Ss:Robots} describe the applications of localization in next-generation massive twinning and robotics settings, respectively. \subsection{Sustainable development}\label{Ss:Sustainable_development} In order to achieve the United Nations' (UN) sustainable development goals (SDGs) and lessen the environmental impact, the next generation of radio access technology (NG-RAT) promises to incorporate measures to protect the environment and empower people to improve their own lives and the world around them. NG-RAT is planned to serve clusters of use cases such as autonomous supply chain, earth monitoring, e-health, and personalized context-aware networks in order to meet the major UN SDG. All these use cases have a common need for localization, which in turn have a set of criteria on major KPIs that must be satisfied. \subsubsection{Autonomous supply chain}\label{Sss:Autonomous_supply_chain} With the ability to monitor products from the time they are created all the way through their final stages of use and disposal, an autonomous supply chain may guarantee material and energy savings as well as increased efficiency. Specifically, 6G-enabled micro-tags may be used to (i) promote a flexible and adaptable supply chain; (ii) track and record the whereabouts and condition of all products; (iii) allow a decentralised, worldwide asset monitoring and management system; as well as (iv) link all products to the internet~\cite{Nemati2022, Viswanathan2020}. For example, consequences for the supply chain sector may be seen in the novel approaches to final-mile delivery made possible by the widespread use of computing and mobile communication technologies. Up to half of total distribution expenses are attributable to the last mile of the supply chain's journey. Packages spend much of their time in transit dead-zone locations, and very little real-time information is available, as they make their way from a site of storage, like a warehouse to a point of sale or straight to the premises of ultimate costumers. Lastly, a conventional supply chain is unable to meet the demand for instantaneous delivery for online purchases. Therefore, the management of supply chains has placed a premium on innovative technical solutions. Thus, the ongoing maturation of technologies based on 6G wireless systems and fog computing will unquestionably provide a plethora of chances for the next wave of technological innovation~\cite{Baccarelli2019}. The latter may provide a wide variety of services due to the use of VNFs, SDN, AI, and resource orchestration that works with both physical and virtual resources. This will pave the way for an ideal answer in terms of logistics management, protocol compatibility, and network architecture for the next-generation delivery systems, which rely on UAVs and robot delivery workers. \subsubsection{Earth monitoring}\label{Sss:Earth_monitoring} The UN SDGs include global real-time monitoring. In order to achieve this, a large number of low-cost biodegradable devices are expected to be deployed to gauge climate, collect meteorological data, and track species distributions around the globe. Autonomous and robust placement is required to map the gathered measurements from the massive deployment of sensors to the site where the data will be used. The so-called ``Destination earth'' allows for near real-time observation and monitoring of environmentally important factors including solute concentrations, biodiversity, and weather~\cite{DestinationEarth}. Environmentally friendly and pervasive sensors linked together in terrestrial wide area networks and wireless mesh networks make it possible to conduct such monitoring tasks. This encourages data collecting even in underdeveloped regions with limited access to modern technology. Cases include conserving endangered ecosystems through human activities like preventing the spread of disease via adjusting climate models and/or monitoring environmental conditions~\cite{Hofmann2022}. As a result, the objectives of future 6G network should include the development of earth monitoring systems. The network is strengthened by the incorporation of tiny sensors that work together to build a ``sensor infrastructure web'', which incorporates a worldwide sensor network for tracking the state of the planet's ecosystem~\cite{Torres2003}. The sustainability of human existence on earth is specifically threatened by climate change. To this end, the climate deal aims for net positive benefits on the climate budget. Due to the exponential growth of data, future networks will need to significantly lower their energy footprint. To this end, green localization approaches are perfectly suited for energy-saving usage in this context. \subsubsection{e-Health}\label{Sss:e-Health} By using a low-cost 6G networks, it is possible to increase access to healthcare for a huge fraction of the world's population. Remote healthcare is widely used all over the world to serve people who live in remote areas or who are unable to travel for medical treatment. The use of telemedicine and other forms of remote health monitoring make this service possible~\cite{Pramanik2019}. Telemedicine is the practise of treating, diagnosing, and evaluating patients remotely. Using AR/VR/XR, a patient and doctor may have a conversation that is almost identical to the one that would take place during a face-to-face visit. Telemedicine now makes use of high-quality video teleconferencing; but, with the fast development of holographic technology, is anticipated to be employed in the near future. Wireless body area networks and wearable devices are only two examples of the Internet-of-Medical-Things technologies that have begun to see widespread deployment for remote health monitoring~\cite{Wei2020}. The same way that real-time monitoring systems benefit society as a whole by tracking emergency situations, future 6G-enabled e-Health systems will be able to provide immediate treatment. However, there is a significant barrier to this aim caused by the slow rate of acceptance of new technologies. Also, those who require constant monitoring, like diabetics, may rest easy es that their dosages can be modified with the help of digital medication. Finally, sample collection for testing may be facilitated by deploying drones to out-of-the-way locations. Strict requirements on localization precision in the range of $0.1-0.3$ m in the vertical and $0.1-0.5$ m in the horizontal plane need to be satisfied to guarantee a valid sample collection by deploying drones to improve remote health care. For tracking purposes, especially during landing and sample collection/delivery operations, a high level of availability of up to 99.99\% is required. \subsubsection{Personalized context-aware networks}\label{Sss:Context_aware} 6G is envisioned to allow contextual interpretations in both communication and localization protocols. Humans are able to comprehend and understand their activities because of the organizational, cultural, and physical circumstances in which they participate. This is accomplished by a combined comprehension of time and activity components of an action along with the quantitative characterisation of entities, like things, places, or people. The ability to recognize human and technological contexts is equally crucial for the realization of 6G networks~\cite{DeLima2021}. Contextual understanding will be useful in several 6G applications. By communicating only when it is most efficient applications may significantly reduce their overall energy footprint. Insightful prediction of data transmission based on context paves the way for increased throughput on demand. To achieve hyper-personalization, context-awareness may be utilized to intelligently relocate personalization algorithms and sensor data to portions of the network, where storage and computing are quick and practical. For instance, in healthcare contexts, it is crucial to fuse sensor data in order to discover patterns and deviations, and this is made possible by intelligent storage and distributed processing capabilities~\cite{Dey2001,Dourish2001}. Additionally, multi-modal localization is made possible by context-awareness, allowing mobile devices to transition between channels and communication technologies based on their present location. With multi-modality, devices may choose between national and private technologies, reducing power consumption and improving service quality. This diversity in communication styles necessitates the use of context-aware localization approaches~\cite{Nust2019}. The following developments in awareness of context is expected to benefit from 6G networks. Context awareness techniques will be able to keep track of history and interpret temporal data, allowing them to spot patterns and outliers, which, in turn, can improve anomaly detection protocols. For instance, this is essential in hyper-personalization, where instantaneous changes in a user's status are tracked. In addition, there are unique privacy risks with sophisticated temporal context detection algorithms since they integrate private information, i.e., human physiological data, with publicly available information, such a as environmental variables. Intelligent security solutions are needed to store and analyze this data in various portions of the infrastructure. Finally, a lot of standardization of context parameters is needed for distributed context awareness. It is hard to construct networks that can transform the context into assets for applications without defined interpretation rules for context parameters. Standardizing context operating rules and parameters to achieve a fair data economy that permits the combinations and flow of multiple data sources, which are regulated by a diverse ecosystem, poses a significant challenge to the implementation and adoption of such context-aware features. \subsection{Immersive telepresence}\label{Ss:Immersive_telepresence} Immersive telepresence enables users to interact with a distant environment, including devices, people, and/or objects, utilising all of their senses. The foundations of a fully-cyberphysical world would be strengthened by its capacity to provide unobstructed near-real-time holographic experience and mixed reality. This enhanced capacity is expected to be useful for mixed reality work, as well as fully immersive entertainment, such as sports, gaming, live events, etc. All of the use cases under the telepresence umbrella have one thing in common: the need for localization in order to enable features such as gesture and motion recognition and XR. \subsubsection{Gesture and motion recognition}\label{Sss:Gesture_recognition} 6G's higher frequency range provides improved precision and resolution, allowing for the capturing of finer gestures and actions. With the advent of advanced computer technology and pervasive AI methods~\cite{Behravan2022}, a new age of gesture and activity recognition has begun. Localization and sensing in the near future will not be confined to a single space, but rather a massive and complex setting. This allows for widespread gesture recording and activity detection without the need for any additional devices. Each base station is envisioned to serve as a sensor that works together with user devices to get a more complete picture of their environment, leading to a significant increase in performance. Moreover, the base station enables a notably increased range that was not attainable through only user devices, as well as the dissemination of the gathered data to the cloud or to neighbouring buildings. A smart environment could use high classification accuracy to include features like behaviour detection, gesture and motion recognition, intruder detection, and more~\cite{Tan2021b}. Likewise, patients in a smart hospital may benefit from automated patient monitoring thanks to the facility's medical rehabilitation system. In such environments, improper gestures or actions will trigger notifications, greatly enhancing security as well as the provided services (i.e., rehabilitation). More accurate localization capabilities and high classification precision would be necessary for certain superior contactless activities like playing virtual piano. Assuming that the black keys have an average width of $10-11$ mm, the expected accuracy for determining the finger's vertical distance from the board and its horizontal location in relation to the virtual keys is $3$ mm. In addition, the recognition probability should be higher than $99\%$ for a pleasant tune. \subsubsection{XR}\label{Sss:XR} Across the whole AR/VR spectrum, XR will provide several applications for 6G. Due to their limitation to provide extremely low latencies for data rate-heavy applications, upcoming 5G systems still fall short of offering a fully immersive XR experience that captures all sensory inputs. Creating an immersive AR/VR/XR experience calls for a collaborative design that takes into account not just technical but also perceptual considerations. Engineering methods have to account for both the maximum and minimum boundaries of human perception. To achieve this goal, traditional QoS, i.e., rate and latency, and QoE, like mean opinion score, inputs need to be combined with physical elements from the users themselves, necessitating a new notion of quality-of-physical-experience (QoPE) metric. QoPE may be influenced by a number of actions, such as non-verbal cues, physical processes, and mental processing. In~\cite{Kasgari2019}, for instance, we demonstrate that under the URLLC regime, the human brain may not be able to differentiate between various latency metrics. Meanwhile, as shown in~\cite{Park2019} the sensory input, particularly touch and sight, is critical for optimising use of available resources. Furthermore, with XR, it is possible to test out ideas before committing to a final design, and it allows corporations to provide customers services that are tailored to their own needs and circumstances. To offer an XR solution that is both appropriate and realistic for the user's current location, 6G localization of the device providing the service is essential. Thus, an XR user would require accurate localization in order for the device to receive the correct data. A shopper, for instance, may employ XR-enhanced advertising while strolling through a retail centre. As another use case, XR can superimpose a computer-generated image or simulation onto the real world. However, much greater precision is needed in this particular setting. \subsection{Local trust zones}\label{Ss:Trust_zones} Local trust zones related use cases highlight the need of a framework that calls for the NG-RAT to enable adaptable architectures that let enterprises and services to keep their most sensitive data inside their own networks. Some examples that fall within this broad category are: (i) infrastructure-less network extensions; (ii) sensor infrastructure web; (iii) precision healthcare; and (iv) security and privacy. Localization is required in all the aforementioned use cases clusters. \subsubsection{Infrastructure-less network extensions}\label{Sss:Network_extensions} This use case requires extending the network coverage temporarily, particularly if the number of devices to be served are located near the network's edge. Use cases are almost ubiquitous. Normal instances take place in rural locations, where coverage is restricted and performance levels are inconsistent. In production settings, bigger populations of the same vendor's modules, computers, and vehicles may be linked together via infrastructure-free networks that serve as an underlay for the infrastructure network and require the adaptive and fast solution of geometric consensus problems~\cite{Mostaani2021}. For example, autonomous vehicle platoons have been used for agricultural harvesting. Each vehicle should keep its distance from the others to prevent accidents and work together to find their way around the operational area. It is also important to guarantee the vehicles' safe operation even when on the borders of the coverage area. The application will need an update rate proportional to the current pace of the cars' movement. Cooperating localization is a term that is occasionally used to describe these kinds of applications. Finally, most of these use cases include either a population of nodes that make up the infrastructure-free network and may move independently to enable direct device-to-device connection, or a collection of sensor nodes travelling along strongly linked trajectories. \subsubsection{Sensor infrastructure web}\label{Sss:Sensor_infrastructure_web} The sensor infrastructure web was introduced by NASA~\cite{Delin2001}. It consists of smart infrastructure that enables coordinated localization and sensing. It is made up of disparate nodes equipped with sensors that not only gather information, but also communicate with each other to modify their behaviour~\cite{Xiao2018c}. Tens of millions of mobile, airborne, in-situ, and space-borne sensors have been deployed in diverse domains and for varied purposes recently due to the growth of IoT, smart cities, and the Global Earth Observation System of Systems (GEOSS). Earth's urban areas have never been detected so dynamically and in-depth in the past. To accommodate this scenario, 6G is expected to provide localization data to devices with almost zero sensing capabilities, such as guiding a vehicle through an unfamiliar area that has inadequate on-board sensors to comprehend its surroundings. Accurate device localization is required to convey relevant sensing information to devices lacking sensing capabilities, which is necessary to enable such use cases. For example, in disaster management application, the sensor infrastructure web is able to use a combination of in-situ and space sensors in order to collect data for volcano hazard monitoring, or use orbital space sensors, like satellites, to locate flooding indicators or wildfire hot-spots~\cite{Zhang2018c}. \subsubsection{Precision healthcare}\label{Sss:Precision_healthcare} Precision medicine has emerged as a mean to treat and prevent illness in an individualised fashion. Dispensing medication with the help of wireless nano-scale robots that move within the human body's soft tissues is fundamental to the individualised therapy, which differs from the standard one-size-fits-all method. To maintain tabs on a patient's health, 6G connection will be used to gather sensor-based data. Utilizing the massive coverage area provided by 6G, patient monitoring and tracking may be utilised to ensure the safety of patients regardless of the nature of their illness or their current health status. The anticipated 6G localization capacity benefits all these distinct applications by providing enhanced precision healthcare, such as medical equipment placement on the body, small-scale robots, patient monitoring and tracking, as well as telesurgery. From the aforementioned applications, telesurgery is a unique use case of cutting-edge precision healthcare that employs a surgeon and an expert operator stationed in a different location to operate one or more robotic arms. Data for receiving feedback and controlling the surgical tools must be reliably sent between distant locations. High-data rate URLLCs that are expected to be made possible by 6G technology will allow robotic arms to mirror the surgeon's natural hand motions and offer haptic input, boosting the surgeon's senses and dexterity. More advanced technologies, known as cooperative surgical systems, let doctors and machines work together to achieve better results during procedures. The tissues and surgical equipment both need to be precisely localised for successful remote surgery. \subsubsection{Nanoscale localization} Recent breakthroughs in nanotechnology are bringing light to nanometer-size devices that will allow a multitude of innovative applications. Among the many fascinating fields where nanotechnology is predicted to reap benefits is in-body treatment. Antibiotic resistance might be detected at the molecular level, drugs could be delivered with pinpoint accuracy, and neurosurgery could be performed on specific areas of the brain. In order to implement such applications, a network of nanodevices will need to be created within the body, which will then travel through the circulatory system, respond in response to orders at specific areas, and report their findings to a more robust body area network (BAN)~\cite{Dressler2015}. Nanodevices in this context are assumed to have dimensions similar to those of red blood cells in order to prevent clotting as a result of their entry into the circulation. Because of their little size, these nanonodes are likely to rely only on energy harvesting for their operation~\cite{Piro2015}. These nanonodes are expected to be passively flowing, i.e. without the potential of mechanical guiding toward the specified point, due to their limited energy and small form factors. Based on the aforementioned, localizing the nanonodes is of great importance for regulating their operation. To issue control commands, for example, two way communication between the nanonodes and the outside world is essential. THz communications constitutes a viable technology enabler in such scenarios as the primary prerequisite for in-body nanonodes, namely small transceiver form-factors, is only possible with transmission at these frequencies. The THz band, however, is entangled with various limitations, such as high scattering and spreading losses that limit the propagation distance of THz waves. The main challenges of THz-enabled nanoscale localization include:(i) maintaining low complexity and energy demands of nanonodes; (ii) overcoming the substantial attenuation of in-body THz propagation; and (iii) allowing network scalability~\cite{Lemic2021}. Research on nanoscale networks and their localization approaches is currently limited and constrained in tackling a subset of these challenges. Specifically, a THz-enabled network architecture was proposed in~\cite{Lemic2022}, which enables fine-grained localization of the energy-harvesting in-body nanonodes, as well as their two-way communication with the outside world. This approach elisted software-defined metamaterials and location-aware and wake-up radio-based wireless nanocommunication paradigms to enable the novel energy-harvesting capabilities for in-body nanonetworks. The authors suggested that the proposed design can take advantage of the large number of nanonodes, surpassing the limitations of limited range of THz in-body propagation and severely confined nanonodes. Moreover, in~\cite{Gomez2022a, Gomez2022b}, the authors explore the potential for flowing nanosensors in the blood flow to identify and localize and report anomalies in the human body. This work focuses on the identification of quorum sensing molecules and evaluate their performance. The authors use a Markov chain model to simulate the nanosensors' motion through the blood arteries, and apply ML models to predict their trajectory. The results validate the detection and localization capabilities of the investigated method across a variety of body areas, demonstrating their utility in identifying vascular anomalies. \subsubsection{Security and privacy}\label{Sss:Security} Addressing the security elements of localization is a growing area of study alongside enhancing localization precision, sampling efficiency, and resilience against intermittent connection loss. Jamming and spoofing are two versions of intentional interference that degrades or prevents the calculation of a GNSS signal~\cite{Elango2022}. In this context, protecting personal privacy entails blocking the functioning of GNSS receivers that may track the user's whereabouts and communicate such information to other parties. In case jamming signals are not correctly identified and their consequences are not mitigated, the employment of jammers leads in reduced positioning accuracy or complete loss of GNSS signals, which may result in catastrophic damage. Intentional intervention is also done by political activists, cybercriminals, and foreign nations to disrupt the networks of others. Spoofing, on the other hand, refers to the malicious broadcast of false GNSS-like signals that trick the receiver. The hardest part of spoofing is its identification. Fortunately, the attacker must be able to produce authentic GNSS signals, including data, modulation, and timing, maintain temporal synchronisation near to authentic GNSS time, and modify the signal power levels to correspond to those of the authentic signals in order to be able to conduct a realistic spoofing assault. There are a plethora of localization approaches that take security into account. SotA security-aware techniques frequently have large computing needs, prioritize structure-based assaults, assume static networks and even make bold assumptions that may not hold true under real-world circumstances. A common problem is that when harmful conduct from anchor or unknown nodes is expected, either no explicit attack model is supplied or detection of such hostile nodes is all that is defined, with no further treatment of the discovered nodes being specified. For instance, exploiting the noise characteristics induced by external distance assaults, the authors of~\cite{Xie2021} suggested a lightweight secure ToA-based localization technique that enables protection against impersonation attacks in WSNs. Clustering and consistency evaluation-based malicious node detection (MND) and its improved and secure variant, enhanced MND (EMND), constitute a solution to identify the anomalous node clusters by applying spatial clustering based on density~\cite{Liu2019}. Afterwards, they utilize a sequential probability ratio test to find the bad actors in the networks. Simulations reveal that the proposed algorithms are more accurate and efficient than current SotA approaches. One downside of the proposed algorithms is that there is no way for maliciously labeled anchor nodes to redeem themselves and reclaim their trusted status in the network. In addition, in~\cite{Bochem2022}, the authors present a extremely computationally-lightweight while yet retaining the benefits of range-free techniques including low cost and complexity of deployment as well as increased resilience against assaults of secure localization systems. Due to the distributed nature of this approach, it relies on no external resources or single points of failure, thus being able to identify and filter out malicious or malfunctioning anchor nodes, improving localization precision. Finally, intruders might exploiting security flaws to harass the users, break into their homes, steal their identities, and more. Privacy concerns about the impending proliferation of THz communications on smartphones and wearables have been voiced several time in the past~\cite{Lohan2017,Sarieddeen2020}. THz-based remote sensing and see-through imaging may be used by an attacker or malicious equipment, which might compromise users' privacy. Also, radar-like localization systems are being developed using 4G and 5G signals and developments in full-duplex communications~\cite{Barneto2019,Barneto2019b}, with the potential for expansion beyond 5G. Radio frequency fingerprinting~\cite{Balakrishnan2019,Soltanieh2020} may identify user devices even without providing a device identifier, highlighting the potential privacy risks of combining high-resolution photography with machine learning algorithms. \subsection{Massive twinning}\label{Ss:Massive_twinning} Future RAN aims to bridge the gap between the physical and digital worlds, making it possible to create a digital counterpart of anything in the actual world~\cite{Yuan2022}. The ability to create a trustworthy, efficient, and effective digital duplicate of any physical object will open up hitherto inconceivable avenues of exploration, such as (i) more effective use of resources has a positive effect on the long-term viability of agriculture; (ii) to facilitate a fully smart city by developing 4D spatio-temporal interactive maps; and (iii) tracking the operations at every corner of a smart factory at once by constructing a digital map of the space. The development of a digital twin (DT) may fundamentally benefit from data about events occurring in the real world at a certain time and place. 6G-connected tags may be affixed to real-world items to generate a digital duplicate, with the added benefit of gathering sensory data that can be paired with time instances to show exactly when the data was gathered~\cite{Yuan2022}. There are, however, difficulties in correctly localising these devices, particularly when they are installed in GPS-denied locations. 6G WANs are being constructed to handle the communication demands of DTs; these networks might be used for localization as well, solving this issue~\cite{Uusitalo2021}. In addition, localization and detection of items that are not linked to the digital world via 6G tags or other 6G-enabled devices is required in certain use cases. Radio-signal-based sensing may be used in this context to gather data about passive items, such as their position and the time they were present. Adding data on inactive things is a useful supplement to the DT, which typically only includes digital copies of network-accessible physical items. \subsubsection{Agriculture}\label{Sss:Agriculture} Numerous advancements have been made in the study and use of robotic solutions for the agricultural industry, and fresh contributions are anticipated in the near future~\cite{Skvortsov2018}. Farmers are becoming more aware of its influence on agriculture, which has increased the need for autonomous machinery in this field. A wide range of duties, including application of fertilisers, watering, harvesting, planting, and more, are being carried out by robots~\cite{Roldan2018}. The design and development of technological concepts that enable robots to travel safely across various settings is crucial in this situation. The fundamental necessity imposed by these advancements is to localise the robots in various agricultural settings. Using Global Navigation Satellite System (GNSS) is the most typical technology used so far~\cite{Guo2018c}. The use of GNSS is questionable in many agricultural areas due to signal blocking and multi-reflection of satellite signals~\cite{Santos2020}. Therefore, it is crucial to investigate and create intelligent systems that calculate the robot's localization using a variety of sensor modalities and data sources. The most advanced method for doing this is simultaneous localization and mapping (SLAM)~\cite{Cadena2016}. This method involves mapping the immediate area while also predicting the status of a robot. The robot model often includes the robot's position as well as, in certain situations, its velocity, calibration factors, and sensor offsets. The map is a 3D depiction of the agents that the robot's onboard sensors have detected and are used as a guide throughout the localization process. Creating a map is often crucial to provide details about the surroundings. Additionally, maps may be updated and reused by the robots each time they go across the environment. Finally, visual odometry is one of the most popular alternatives to SLAM, which is capable of predicting the motion of the on-board camera using just image data as input~\cite{Zhan2020}. \subsubsection{Smart cities}\label{Sss:Smart_cities} To improve the quality of life in a city, a comprehensive smart city must give a wealth of data, such as a digital reproduction of the city with real-time data on control utilities, pollution maps, traffic, etc~\cite{Ulusar2020}. An interactive 4D map is a key component of an immersive smart city, since it can be used to better organise and design essential infrastructure and services, like transportation, waste management, plumbing, electrical wiring, and more~\cite{Brincat2019}. Sensors installed to track, monitor, and update status of these services must be localised for this kind of dynamic map to be possible. Moreover, units may be stationed by the side of the road to aid in communication, while simultaneously operating as traffic monitors in various sections of the city. Radio signals received by a user at a certain position are impacted by the features of their immediate physical surroundings in a predictable manner~\cite{Gope2018}. For instance, because of the existence of urban infrastructure, such as buildings, a user's device in the street level may pick up a signal that has travelled by way of several reflections. The presence of trees near the target causes a reflection of radio signals. By inferring the sort of topography at the user's position, we can better map the terrain around the cell towers. Finally, due to the virtual depiction of each piece of infrastructure, huge digital twining may be of great use in the smart buildings of the future. To do this, you must determine the precise location of every heater, lamp, light switch, and other controlled fixture in the facility. Not only will it be put to use in the daily running of the building, but its intelligence and automation will also allow for a significant decrease in the cost of the building's commissioning. \subsubsection{Manufacturing}\label{Sss:Manufacturing} As we go towards Industry 5.0, machines and robots will become more self-sufficient, with only little human oversight~\cite{Chaccour2022}. As a result, cutting-edge control mechanisms are essential for high-precision production processes. In particular, connection density of $10^7\text{/km}^2$, latency on the scale of hundreds of microseconds, and data speeds on the order of Tbps are required for the fast development industrial systems as well as the automation of their operations~\cite{Giordani2020}. THz networks are a natural solution for achieving such high data speeds. However, there are several obstacles that need to be addressed when using THz networks for Industry 5.0 applications, such as precision-driven control mechanisms, dense coverage, and zero-latency. Moreover, the positioning capabilities of 6G networks have the greatest potential to advance industrial use cases~\cite{Mogyorosi2022}. Many different industries, from logistics and manufacturing to mining and transportation, will benefit from using position data to improve and automate their operations~\cite{Lu2018}. Both the (mobile) terminals and robots as well as the whole network will benefit greatly from location data in factory automation and industrial control. The former can better allocate and regulate resources and boost processing efficiency, while the latter can better direct the movement of the terminals. \subsection{Robot coordination and interaction}\label{Ss:Robots} Local pose tracking and global localization are two basic types of the localization challenge for mobile robots. Once the robot's starting stance has been determined, the local pose tracking problem may focus on maintaining that pose over time. In contrast, the global localization issue requires the robot to independently localise itself and minimise the uncertainties in its posture predictions. A mobile robot's first posture estimate at startup is required for relocating the robot in the event of a pose tracking failure, autonomously navigating, and more. Moreover, numerous localization strategies have been investigated over the last several decades, but probabilistic methods using Bayes filters, Monte Carlo particle filters, Markov particle filter, and extended Kalman filter are now the most popular and well-proven options~\cite{Zhang2019f}. There are two main uses for localization with respect to robots: (i) interaction with humans in order to accomplish goals in the everyday life and industrial settings, and (ii) localization and mapping of the environment, where robots may determine where they are located in space and how they are oriented in relation to one another as well as their surroundings. \subsubsection{Interactions}\label{Sss:Interactions} It is anticipated that 6G wireless systems will offer the means through which a technological basis for human-robot collaboration may be laid. As a result, collaborative robots (cobots) will be used extensively in both the domestic and commercial settings. Moreover, cobots will become more important in the home and consumer sectors, evolving beyond the robotic household helpers that they are today. Cobots will also be used in the manufacturing sector to facilitate flexible production of a wide variety of items, including those with a high level of personalization and customization. Accurate 3D localization of cobots that supports high update rates is essential for their efficient operation, as are capabilities to perceive the environment, with the former in particular allowing for synchronised, uninterrupted, and smooth collaboration. Cobots are expected to use this data as input to plan and conduct actions, either alone or in swarms in order to achieve their goal. Additionally, the cobots use a symbiotic autonomy technique, where the robots are self-aware of their perceptual, motor, and cognitive limits and actively seek human assistance for tasks like object manipulation. The cobots' success in the 1,000-km challenge demonstrates their localization system's stability and accuracy during long-term deployments~\cite{Biswas2016}, despite the existence of environmental fluctuations. To achieve this, a monitoring script running on the robots would follow the status of the tasks' execution and contact researchers in the occasions when the robots required help. As a result, over ninety percent of deployments of robots did not need human involvement to reset the robot localization. \subsubsection{Mapping}\label{Sss:Mapping} When the GPS signal is poor or unavailable, a mobile robot may use SLAM to create a consistent map of its surroundings and simultaneously calculate its position~\cite{Durrant2006}. In the realm of autonomous navigation and localization, SLAM is widely recognized as a crucial challenge~\cite{Ding2022}. The autonomous capability of mobile robots in unfamiliar surroundings is greatly enhanced by the solution of the robust long-term and real-time SLAM issue, which focuses on two primary components: localization and mapping~\cite{Chong2015,Fuentes2015}. Through accurate and reliable localization, the robot's present location in space is determined. Simultaneous mapping without prior knowledge of the robot's position unifies the fragmented understanding of the surroundings into a coherent whole~\cite{Khairuddin2015}. Autonomous mobile robots equipped with powerful SLAM algorithms have played an important role in a wide variety of application scenes, including exploration in hostile environments such as aerial space, underground mining, rough terrain, and underwater surveillance~\cite{Erfani2019}. Since its introduction in the 1980s, SLAM has evolved significantly over the course of more than three decades~\cite{Smith1988}. There has been a shift from filter-based to optimization-based algorithms and from single to multi thread methods. Sonar has been replaced by 2D/3D light detection and ranging (Lidar) systems and monocular, stereo, RGB-D, time of flight (ToF), and other cameras. There are now three primary SLAM methods in use: Visual SLAM, multi-Sensor Fusion SLAM, and Lidar SLAM. Visual SLAM estimates its posture with the use of prior knowledge of multi-frame pictures and multi-view geometry, and then utilizes this estimate together with depth information derived from the accumulation of pose changes. Most notably, RGBD cameras can get depth data without any further processing. To complete localization, the SLAM algorithm in Lidar SLAM matches and compares Point Cloud at various periods to determine the distance traveled by the robot as it moves relative to the surroundings and as its attitude changes. Due to the limitations of individual 2D/3D Lidar or cameras, multi-Sensor Fusion SLAM has gained popularity in recent years. The most common sensors for fusion algorithms include Lidar, cameras, IMUs, wheel odometers, and Global Navigation Satellite Systems (GNSS). SLAM technology is in high demand for use in a wide variety of applications, including but not limited to unmanned aerial vehicle (UAVs)~\cite{Demim2016}, unmanned ground vehicle (UGVs)~\cite{Gupte2012}, indoor autonomous mobile robots~\cite{Faragher2012}, and VR/AR hardware~\cite{Newcombe2011}. The vast majority of AR systems need pre-existing knowledge about their surroundings in order to function. In contrast, the advancement of SLAM algorithms and hardware has allowed sensors to rebuild free-form interior scenes without the need for real-time map initialization. Since GNSS signals cannot completely penetrate buildings, it is more challenging to place robots inside, and conventional localization relies on community landmarks and signage. With SLAM and inertia measurement units working together, we can solve this issue~\cite{Faragher2012}. For UGVs and UAVs, SLAM is also a crucial tool. Specifically, Sensor Fusion SLAM is quickly replacing other methods for building the map concurrently, positioning unmanned vehicles, and implementing autonomous navigation in an uncharted area~\cite{Demim2016,Gupte2012}. All things considered, SLAM has been heavily used across many different disciplines and has promising future applications. \section{Localization use cases}\label{S:Use cases} \begin{figure*}[!ht] \centering\includegraphics[width=1\textwidth]{figures/Use_cases.eps} \caption{Localization use cases} \label{fig:use_cases} \end{figure*} In this section, the use cases of future wireless systems are described based on the localization requirements and applications mentioned in Section~\ref{S:6G_aplications}. To this end, Fig.~\ref{fig:use_cases}, which is given at the top of the next page, illustrates each application alongside its corresponding KPIs and related use cases. \subsection{Indoor}\label{Ss:Indoor} Services such as indoor localization have emerged as a consequence of the rapid use of wireless devices in recent years. Obtaining the position of a person or device within a building is referred to as ``indoor localization''. Extensive studies on indoor device localization have been conducted over the last decade, mostly in industrial settings and for wireless sensor networks and robotics. Since the widespread adoption of smartphones and wearable devices with wireless communication capabilities, the localization and tracking of such devices has become synonymous with the localization and tracking of the corresponding users, enabling a vast ecosystem of related applications and services. The ability to precisely pinpoint the location of a user or device has several practical applications in the fields of autonomous supply chain, e-Health, precision healthcare, personalized context-aware networks, XR, gesture and motion recognition, sensor infrastructure web, security and privacy, agriculture, smart cities, manufacturing, as well as robotic interactions and mapping. \subsection{Outdoor}\label{Ss:Outdoor} Accurate positioning data is essential for many outdoor applications, such as navigating in uncharted territory and monitoring the location of company vehicles. However, in urban canyons with high-rise buildings or subterranean parking lots, where building walls obstruct the GNSS reference signal, GNSS coverage is limited. Current mmWave cellular networks and upcoming sub-THz cellular networks offer good prospects for localization where GNSS fails to fulfill the application's KPIs. At mmWave frequencies, adjustable channel bandwidths of up to $400$ MHz are possible in 5G and phased arrays with hundreds of antenna components and narrow half power beamwidths are commercially available. Future 6G wireless systems will migrate to frequencies greater than 100 GHz, when channel allocations lasting several gigahertz are possible. Strategies that take the estimated condition of the wireless propagation channel into account have been the focus of research in wireless systems' localization. Channel impulse response, propagation delay, AoA, and RSS are only some of the propagation parameters that are measured or estimated by networks at one or more locations, usually base stations and user equipment. Moreover, user-location fingerprinting has also been interpreted geometrically, compared to existing databases, or used to locate the user on maps. Finally, the outdoor localization use case includes all applications discussed in the present contribution. \subsection{Non-terrestrial}\label{Ss:Non_terrestrial} Non-terrestrial localization has become ubiquitous as a result of the fast advancement of satellite localization technology, making formerly inconvenient tasks easier for the general public. When it comes to non-terrestrial localization, GNSS is the most applied solution and is made up of constellations of artificial satellites in geosynchronous orbit, transmitting real-time position and timing information. During the time of writing, four major not-terrestrial systems are in use: (i) Europe's Galileo, (ii) the United States' GPS, (iii) China's Beidou, and (iv) Russia's GLONASS. These systems provide of $1-10$ m accuracy and low device autonomy. GPS, which was originally designed for use by the United States Navy, is a radio navigation and positioning system that contains location and time information, while GLONASS, a second-generation military satellite navigation system is technologically superior to GPS in its capacity to withstand interference, yet it lacks GPS's pinpoint single-point precision. Moreover, BDS is a Chinese-created satellite navigation system with worldwide coverage and GALILEO, which uses two ground control centres and 30 satellites, is more widespread in Europe. Based on these, non-terrestrial localization applications of future wireless systems include autonomous supply chain, earth monitoring, e-Health, personalized context-aware networks, agriculture, smart cities, robotics-enabled mapping, infrastructure-less network expansion, sensor infrastructure web, precision healthcare, as well as security and privacy. \subsection{Underwater}\label{Ss:Underwated} In recent years, underwater wireless systems have applied localization techniques for many different purposes. Each implementation is crucial in its own field, while some of them can advance ocean exploration to accommodate a range of underwater applications, such as underwater surveillance, natural disasters alert systems, oceanographic data collection, assisted navigation, etc. For instance, sensors may evaluate specific characteristics, such as base intensity and mooring tension, for offshore engineering applications to monitor the structural condition of the mooring environment. Therefore, the basic applications of underwater localization wireless systems include earth monitoring, sensor infrastructure web, personalized context-aware networks, mapping, security and privacy, as well as infrastructure-less network expansion. \subsection{Nanoscale}\label{Ss:Nanoscale} THz nanonetworks are expected to enable a wide variety of applications, many of which will need localization or even tracking of the nanonodes. As a result of the nanoscale nature of the nodes, it is essential that localization and tracking capabilities work under very tight energy budgets while yet maintaining a high degree of precision due to the small sizes of the nanonodes. Furthermore, because of the limited range of THz band nano-communication, multi-hopping may be required for localization, which has the disadvantage of increasing localization error with each hop. Few efforts have been made towards localization of THz-operating nanonodes, with the most notable ones using range and hop counting to make educated guesses about where all nanonodes are positioned in a given region. In the former, the locations of the two examined nanonodes are calculated by counting the number of hops between them, while the latter assumes that all nanonodes are clustered together to cut down on overhead and energy dissipation. One limitation of these techniques is that, as the number of hops rises, their accuracy will inevitably decrease due to the spread of localization errors. The main KPIs of nanoscale localization are low energy consumption and high precision, while the related open challenges include modeling of such systems in non-free space propagation, hardware imperfections, and frequency- and angle-dependent response of the nanonodes. \section{Technology enablers for 6G wireless systems} \label{S:Technology_enablers} This section aims to shine light into the key technology enablers of localization in future 6G networks. Specifically, Section~\ref{Ss:mmWave_THz_localization} presents the current SotA of mmWave and THz localization techniques. Next, in Section~\ref{Ss:Hardware}, the main hardware advancements related to localization approaches are investigated, while Sections~\ref{Ss:Beamforming} and~\ref{Ss:RIS} illustrates the role of beamforming and RIS in the localization paradigm of future 6G networks. The impact of AI and channel charting approaches are presented in Sections~\ref{Ss:AI} and~\ref{Ss:Charting}, respectively. Section~\ref{Ss:Radars} discusses radar-based technologies that enable localization applications, while Section~\ref{Ss:Sensors} sensor-based ones. Finally, visible light-based localization methods are analyzed in~Section~\ref{Ss:visible_light_positioning}. \subsection{mmWave/THz localization}\label{Ss:mmWave_THz_localization} With the explosion of cellular services in recent years comes a surge in demand for higher data transfer speeds~\cite{Stratidakis2019}. Using the vast amount of unstandardized bandwidth available in the mmWave and THz range, mmWave and THz wireless systems hold great potential for meeting the data rate need. However, substantial channel attenuations hinder communications at these frequencies~\cite{Kokkoniemi2018}. mmWave and THz systems counteract these higher losses by using pencil-beams made from massive antenna arrays at both the transmitter and the receiver side~\cite{Boulogeorgos2018,Boulogeorgos2018b}. As a result, mmWave and THz links are highly directional. In order to ensure high-reliability and avoid defects, the base station must know and monitor the orientation of the user equipment (UE). Reduced beamwidth necessitates a much higher cost for current localization and tracking methods. Because of this, they are not suitable for use in mmWave and THz systems. Because of this, it is necessary to work on developing efficient localization methods for THz systems. Due to the complementarity between mmWave and THz systems, the need arises to compare the benefits and drawbacks of these techniques in various diverse localization scenarios especially since THz are likely to be utilized as an extension of mmWave systems~\cite{Kouzayha2021}. We anticipate bigger array sizes, smaller footprints, wider bandwidths, and higher frequencies as we move towards 6G networks. Thus, new possibilities are enabled both in the sense of larger arrays with the same dimensions as well as antennas with constraint sizes. Moreover, increased availability of bandwidth in conjunction with higher frequencies result in robust delay estimation, lower path loss, and decreased multipath. The aforementioned changes will impact a plethora of features of future networks. For instance, new synchronization problems emerge and hardware needs to keep up with novel mmWave and THz-enabled system designs. Another already reported problem is the requirement for increased peak to average power ratio (PAPR) compared to 5G systems, which may render the classic orthogonal frequency division multiplexing (OFDM) inappropriate~\cite{Tarboush2022}. Another important aspect that needs to be taken into account in the development of next generation localization algorithms is the impact of near-field circumstances along with the beam-split effect (BSE) that can greatly influence the geometry of MIMO channel localization models. Finally, the high path loss plagued mmWave and THz channels can greatly influence the energy-efficiency of the overall system and thus, they must be accounted during the design of future networks. All in all, the increased performance anticipated by mmWave and THz networks comes hand in hand with important difficulties in complexity, overhead, area coverage, and hardware architectures that this affects. THz localization is already the subject of active study, with researchers delving into simulation environments, localization methods, and system architectures. For instance, a high level of estimated accuracy and reduced deafness in 2D settings are sought for with the proposal of cooperation-aided localization procedures~\cite{Stratidakis2019}. Also, Kalman filtering-based indoor localization approaches have been proven to offer great advantages for time-variant channel modeling~\cite{Nie2017}. Another example is the angle of arrival (AoA) estimation by a forward-backward algorithm that offers improved localization and human motion characterization~\cite{Peng2016}, while a near-field model with massive antenna arrays has been examined for the purpose of using the curvature of arrival (COA) as a sixth degree of freedom (DOF) in determining the location of the source~\cite{Guerra2021}. Furthermore, by adopting a beam zooming mechanism combined with delay-phase precoding for mmWave and THz beam tracking, it is possible to monitor numerous users and blockers using a single RF chain with significantly reduced beam training overhead~\cite{Tan2021}. Finally, in addition to geometry-based strategies, DL-based strategies show great potential for 3D mmWave and THz indoor localization by enhancing the localization accuracy by approximately 60\%~\cite{Fan2020}. Each of the aforementioned localization efforts addresses a unique issue associated with mmWave and THz localization, namely near-field effects, tracking, improper alignment, and BSE. Despite these advances, important gaps in our understanding still need to be filled. It is yet unclear how signals in the mmWave- and THz-band might boost localization accuracy in both active and passive approaches~\cite{Chen2022}. \subsection{Infrastructure}\label{Ss:Hardware} Most of the work being done to close the gap between current and potential applications of THz technology is still at the device level. Several competing technologies have recently illustrated great potential for realizing THz components. The most established technology is electronic silicon-based devices that have already been used in mmWave systems~\cite{Hillger2020}. For instance, complementary metal oxide semiconductor (CMOS) and its variants are characterized by manufacturing compatibility and small size~\cite{Nikpaik2017}. However, such approaches are plagued by limited maximum available power gain frequency and power handling capacity. To overcome the power constraints of CMOS and increase coverage area, MIMO-based systems with high array gains combined with beamforming techniques provide a promising alternative. In contrast to electronic devices, photonic THz systems, such as uni-traveling carrier photodiodes, quantum cascade lasers, photoconductive antennas, and optical downconversion systems, provide both data speeds and larger carrier frequencies (over 300 GHz)~\cite{Nagatsuma2016}. The downside of such approaches is the larger form factor that poses power and integration constraints. To this end, fully integrated hybrid electronic-photonic systems have been proposed. Such systems use photonic transmitters and electronic receivers and come with increased requiremetns for synchronization between transmitters and receivers~\cite{Sengupta2018}. Furthermore, photonics can provide extensive network coverage in the base station level, but the aforementioned constraints of photonic devices make it difficult to implement MIMO approaches in the user device level. Graphene and other novel plasmonic materials are being explored for manufacturing THz devices due to their capacity to provide solutions with great reconfigurability~\cite{Hafez2018}. In plasmonics, antenna arrays may be made considerably smaller and more versatile since they are characterized by substantially lower wavelengths~\cite{Singh2020}. Plasmonic solutions are advantageous for adaptable system designs and on-site reconfiguration due to their small size and frequency-interleaving features. Unlike conventional transceivers, plasmonic ones do not need upconversion or downconversion to function at THz frequencies, where the creation of energy-efficient brief pulses is especially advantageous~\cite{Zakrajsek2017}. The downside of such devices is that due to the power output constraint, they have a short range making them impractical for localization. \subsection{Beamforming}\label{Ss:Beamforming} Data transmission towards a specific direction in order to increase the SNR and consequently the throughput (beamforming) is a fundamental requirement in high-frequency wireless systems~\cite{DeLima2021}. For mmWave and microwaves, 3D beamforming is a useful tool for mitigating the detrimental effects of high pathloss and for improving SNR. In order to localize and sense objects or people, the gathered channel response can be analyzed for any geographical information about the relationship with them. The channel estimation, which includes the angular and delay domain characteristics that are necessary for localization algorithms, is a prerequisite for beamspace processing~\cite{Ahmed2018}. Especially in challenging NLOS and high-mobility conditions, channel estimation is indespensible~\cite{Miao2019}. Beams are dynamically controlled based on the channel estimate of the AoA and angle of departure (AoD) to find and track mobile users in a dynamic environment~\cite{Huang2019}. Accurate and rapid AoA or AoD estimate of the primary multipath can suffice forin scenarios of mobile users who connect with the BS through a LOS path or strong NLOS route. Uplink AoA estimates from LOS connections may be used to directly infer the position of users, whereas AoA estimates from NLOS links can be used for the scatterer's location. NLOS links originate from multipaths of the signal emitted by an active user and subsequently arrive at the BS. For the latter, NLOS cases, accurate estimates of both AoD and AoA are required to pinpoint the user's position. Beamspace processing for locating mobile users in NLOS and LOS settings is a significant challenge; ``device-free'' localization~\footnote{Passive localization methods are capable of localizing targets without requiring them to carry a device or tag.} presents an even greater one~\cite{Denis2019}. Here, additional environment indicators are required so that the target(s)' spatial characterisation may be differentiated from that of the background objects. This is made more challenging as the number of targets increase~\cite{Miao2019} and the complexity and computational requirements for identifying said targets increase exponentially~\cite{Hong2016}. Very fine spatial resolution may be achieved by using a pencil-shaped beam operating in the mmWave and THz spectrum. Beamspace channels' combined angular-delay characteristics are used to detect and locate passive objects. In this example, the instantaneous beamspace may be compared with a reference to detect a passive target, and with a prior sample (on-line or real-time) to track a moving target. Target identification relies on learning algorithms that can tell the difference between the varying angular-delay profiles of various targets. High-precision localization and detection of scattering objects may be enabled by the use of specialized beamspace processing signals and the strategic placement of monostatic/multistatic MAS. \subsection{RIS}\label{Ss:RIS} RISs' role is ever increasing in the communication paradigm where their main goal is to increase the data rate via achieving higher SNR. However, when it comes to localization approaches, RISs are utlized on the one hand to augment the information gathered by the system by introducing curvature of arrival (COA), while on the other hand they provide geometrical diversity by acting as a passive anchor. Specifically, the requirement of localization algorithms for numerous base stations (passive anchors) in order to provide an accurate estimate can be further enhance by the introduction of RISs. This notion has been investigated in the recent published literature, which takes advantage of the phenomenon of multipath to to pinpoint the origin of high-frequency signals~\cite{Wen2020}. Although multipath signals can be destructive for communications, researchers have been able to take advantage of them and enable localization and mapping with a single base station (BS)~\cite{Ge2020}. It becomes obvious that it is possible to reduce infrastructure cost by a great deal by exploiting RISs that act as passive reconfigurable BSs with low energy consumption~\cite{Wymeersch2020, Strinati2021}. In mmwave/THz bands high accuracy localization necessitates the need to densify the network with a massive number of anchors in order to counteract blockages. This is of course due to the fact that such bands are more susceptible to blockages compared with their sub-6 GHz counterparts. However, densifying the network only with active nodes, such as small cells and active relays that host power amplifiers, will induce an immense energy consumption due to the power amplifier, which is the most power consuming component of active nodes. Hence, RISs can also notably reduce the network energy consumption for high-accuracy localization. Morever, active nodes inevitably need to be connected to the power grid. There are places though where the power grid cannot reach to for reasons of heavy planning/maintenance costs and aesthetics. In such scenarios it's much more preferable to use RISs that may not even need to be connected to the power grid if they are supplied by alternative sources of energy such as solar radiation through solar panels attached to the RISs in outdoor scenarios~\cite{Tishchenko2023}. This would of course be feasible due to the much lower consumption of RISs compared with active nodes. Thus, RISs are expected to enable novel localization approaches that will revolutionize future high-frequency (mmWave, THz, optical wireless) networks. Despite the aforementioned advances, breakthroughs made in material research focused on mmWave, THz, and optical-operating materials could provide immense advances in RIS-enabled localization~\cite{Khalid2016}. mmWave, THz, and optical-operating metasurfaces that offer improved reconfigurability and sensing precision are essential for both mmWave, THz, and optical localization and communications due to the strong blockage and directionality exhibited in the mmWave, THz, and optical frequency band. Recent research shows that mmWave, THz, and optical-operating hypersurfaces that use a stack of physical and virtual components to provide lens effects and individualized reflections can offer significant performance increase~\cite{Liaskos2018}. In addition, similar small-scale metasurfaces have been proven capable of efficient mmWave, THz, and optical signal steering at a broad variety of angles, polarization conversion, as well as generation of orbital angular momentum~\cite{Fu2020}. On another note, despite their slow clock speeds and capacitance leakage, CMOS-enabled RISs offer improved energy efficiency and seamless integration to existing systems~\cite{Venkatesh2020}. Similarly, graphene-based metasurfaces offer a promising alternative for the construction of RISs, due to their low-complexity biasing circuits and low power requirements~\cite{Nie2019}. Finally, multiple researcher have investigated the plausibility of micro-electro-mechanical (MEM) devices as a candidate echnology for the realization of RISs. However, several issues must be overcome, such as relatively large footprints, control signals, and switching rates, before they can be a viable option. \subsection{AI}\label{Ss:AI} As we enter the data-rich 6G era, AI is envisioned to play an increasingly vital role. The design and development intelligent systems and beings that can think, plan, and make optimum decisions based on probabilistic foundations, sometimes in unpredictable settings, is a vast field~\cite{Ali2020}. To train models beyond explicitly coded rules, most modern AI systems rely on ML, which enables data-driven interdisciplinary techniques. Such data-driven algorithms will be essential to 6G systems and beyond, opening up new possibilities for not just wireless communication but also sophisticated localization methods using mmWave, THz, and optical frequencies. Fingerprinting and the use of classification and regression techniques were the primary focus of ML approaches to localization~\cite{Zafari2019,Hsieh2019}. We anticipate that ML will be used more frequently in data-rich and complex localization applications; especially, for the GNSS poor indoor and urban outdoor channel conditions, as traditional signal processing and mathematical techniques are not sufficient to address complex issues where we have a large number of noisy and multi-modal observations, as well as the non-linear characteristics of the signal. Instead, we may mimic the behavior of the system—sensor noise and all—using AI techniques. In addition, in many circumstances, pattern recognition and predictive models based on ML approaches are needed to achieve high-level sensing and localization from perhaps high-dimensional low-level raw observations, such as CSI in massive MIMO systems. Consequently, mapping systems and localization will rely increasingly heavily on the application of statistical AI approaches to model complicated radio signal properties and fuse multiple complementary but noisy sensors. These are expected to be supplemented by hybrid signal propagation models that combine conventional physics-based models with sequential Bayesian models and data-driven learning methodologies. Furthermore, it will be hard to manually construct the mathematical model, due to the enormous complexity of the predictive function of mapping low-level observations to high-level goal ideas. In order to build approaches with unprecedented precision and adaptation capabilities for 6G localization, ML offers an alternative framework that is based on cutting-edge DL and probabilistic methods and learns from data by optimizing or inferring previously unknown parameters~\cite{Ciftler2020}. A number of strategies to improve conventional localization are currently available in the current AI toolkit, based on methods, like probabilistic learning and reasoning, as well as DNNs. However, a lot of these tried-and-true methods have their limits, because of how data-hungry they are and how much processing power and labeled training data they need. Novel inference approaches and hierarchical models need to be created and cleverly coupled in order to learn from restricted, arbitrarily structured, and noisy data. Several current methods might be improved in order to reduce the expense of gathering labeled training data. In order to improve a supervised solution, semi-supervised learning blends a large number of unlabeled with a limited number of labeled ones. Additionally, next-generation wireless systems' localization features are expected to be more autonomous and time-evolving, necessitating the use of adaptive ML algorithms. For example, cooperative localization based on RL~\cite{Peng2019} and crowdsourcing based on FL~\cite{Ciftler2020} might assist in overcoming the difficulties posed by adaptable settings and limited data. These issues must be resolved in order to properly use AI and ML approaches as an enabler for the highly dynamic, large-scale localization of the future. \subsection{Channel charting}\label{Ss:Charting} Applying traditional unsupervised ML-based dimensionality reduction techniques to the field of CSI is what channel charting is all about~\cite{DeLima2021}. Users may be discovered and tracked on a chart that is generated automatically based on a big collection of CSI samples collected in a certain setting. The lack of supervision of channel charting makes it useful in cases, when there is insufficient data to construct an accurate geometric representation of the user's position and surroundings~\cite{Studer2018}. Although it is not possible to directly correlate a position on the chart with a user's physical location, it provides a pseudo-location within the cell that is stable over time and users. Therefore, the need for specific measurements of the labeled CSI datasets that are necessary for fingerprinting methods are eliminated. Several network features, including mmWave beam tracking and association, grouping in device-to-device (D2D) situations, resource management, predictive rate and cell-to-cell handoffs may benefit from keeping tabs on the pseudo-location. Pseudo-locations have certain advantages over an actual position, but they cannot completely substitute it. Initially, channel charting's lack of supervision means that there is no need for prior information (i.e., geometrical/geographical) in order to achieve self-configuration, which aids in deploying emergency and temporary networks. Another aspect of pseudo-locations is privacy, due to the fact that it enables contact tracking without the knowledge of the user's precise location. To begin with, channel mapping was created for scenarios with intense scattering phenomena and where major RF propagation characteristics are anticipated to remain stable (such as massive MIMO). In order to use this method LOS application found at high frequencies, it will likely need to be expanded to jointly handle signals from numerous transmission locations. Directly related to the ML foundations of channel charting are other unresolved concerns, such as the feasibility of implementing lifelong learning and the appropriate feature design for CSI signals. \subsection{Radars}\label{Ss:Radars} Extensive research and development into techniques for device localization has been performed in recent years~\cite{Kocur2018}. It has been shown that sub 5 GHz functioning ultra-wideband (UWB) radars are useful in such scenarios. Most non-metallic materials exhibit minimal attenuation of electromagnetic radiation in this frequency region, making it possible to detect devices that otherwise would be obstructed. Moreover, UWB radars, by taking advantage of the ultra-wide bandwidth, may provide great precision in target localization thanks to their superior range resolution~\cite{Sachs2013}. These features make UWB radars useful for a wide variety of applications, including but not limited to: beamforming in cellular communications; vehicle localization; monitoring critical infrastructure; indoor patient monitoring; search and rescue operations; etc. Beamforming improvements of the narrow beams are essential for terahertz (THz) and millimeter wave (mmWave) communications systems to generate enough receive signal strength. High beam training overhead, however, makes it difficult for these systems to serve highly mobile applications like extended reality (XR), drone, or vehicle communications~\cite{Alkhateeb2018}. Beam selection is notoriously sensitive to changes in transmitter and receiver locations as well as environmental geometry and features. This suggests that learning more about the environment and the positions of the transmitters and receivers can assist solve the beam selection problem. Using inexpensive radar sensors, such those used for automotive applications, is a quick and easy approach to get this understanding~\cite{Ginsburg2018}. This paper's objective is to solve the beam selection issue using radar sensory data, and to do so, it presents the first AI-based demonstration of radar-based beam prediction under realistic vehicular communication scenarios. Frequency-modulated continuous wave (FMCW) radars, which can function in a wide range of environmental conditions, have recently seen widespread use in self-driving automobiles and autonomous robotics. Therefore, it is an intriguing open topic whether or not these radars can be employed for reliable simultaneous localization and mapping (SLAM) in large-scale areas under harsh weather conditions. Moreover, due to these advances in radar technologies other breakthroughs are anticipated in radar odometry~\cite{Aldera2019,Park2020}, estimating mobility~\cite{Ramesh2021}, landmarks extraction~\cite{Cen2018,Cen2019}, and more~\cite{Suaftescu2020,Tang2020}. \subsection{Sensors}\label{Ss:Sensors} A continuously increasing number of IoT devices with a wide variety of sensors are being deployed to cover a vast array of use cases, ranging between smart cities~\cite{Kanev2017} to industrial applications~\cite{Liu2021} and decentralized initiatives to protect the planet~\cite{Sommer2016,Tonisson2021}. Information on the specific location of the measurements taken is crucial for making sense of the results. Due to the fact that many applications depend on mobile sensors, the network needs to be able to dynamically detect their positions. When working on a wireless sensor network (WSN) protocol or application, localization is crucial. For instance, in environmental monitoring applications, it is essential to know the precise location from where readings are taken in order to conduct proper statistical and scientific analysis; without this location information, the acquired data are essentially worthless. Node locations are also crucial to the development of such methods. In target identification and geographical routing, node locations are required~\cite{Tomic2016,Xing2014}. Techniques like mobility management~\cite{Xiao2018}, mobile sensor deployment~\cite{Liao2015}, and topology mapping may also benefit from their utilization~\cite{Gunathillake2018}. There has been a recent uptick in the usage of sensor networks for indoor localization~\cite{Ebner2016,Ebner2017}. In order to take use of location-based services like navigation, tracking, and monitoring, users may determine their location anywhere in the world using the Global Navigation Satellite System (GNSS)~\cite{Saeed2019}. The GNSS is a collection of navigational satellite systems from various countries, including the Europe's Global Navigation Satellite System (GALILEO), United States' Global Positioning System (GPS), China's BeiDou, and Russia's Global Navigation Satellite System (GLONASS). To locate a user inside or in a hostile environment, GPS and GNSS fall short of expectations. Indoor environments are more difficult and intricate than their outside counterparts for a number of reasons. Multi-path propagation error is caused by interference from several sources, including but not limited to ceilings, walls, equipment, and humans. As a result of obstacles unique to the inside environment, designing accurate indoor positioning systems for next-generation wireless networks is a formidable task. Utilizing a satellite-based navigation system is the standard method used for this. However, there are a few problems that come along with using GPS~\cite{Bochem2022}. For example, they are only effective in areas with good reception for satellite signals, which limits their use in certain outdoor settings and prevents them from being used inside. Limiting the number of nodes that have GPS sensors may help with the first two issues. These nodes then serve as anchor or seed nodes, guiding subsequent nodes to their correct locations. Static anchors with predetermined positions are often used in place of movable anchor nodes outfitted with GPS receivers. \subsection{VLP}\label{Ss:visible_light_positioning} A lot of work has been done to assess the efficacy of various tracking approaches suited for mobility control in indoor settings from the perspective of RF technology~\cite{Anastou2021}. None of the aforementioned improvements may be used in applications, where privacy is paramount, such hospitals and petrol stations, since those establishments must instead use isolated VLC systems. As a further drawback, their precision is limited by electromagnetic interference and the significant multipath phenomena brought on by many reflections in barriers, like walls, furniture, and moving persons~\cite{Luo2017}. New light-based ways for indoor location without the restrictions of the RF-based traditional techniques have been published as a reaction to the recent developments in semiconductor-based lighting systems that have made LEDs the dominating choice for illumination~\cite{Chen2021}. Since the optical energy is concentrated on the LOS connection, visible light positioning (VLP) devices are more resistant to the multipath propagation effect. Consequently, the accuracy of the AoA improves. However, in scenarios with LOS blockage, novel reflecting surfaces, such as optical RISs and mirrors, can be used to reinstate high quality communications~\cite{Abdelhady2020}. Furthermore, ceiling-mounted LEDs have a very high density since their main job is to provide illumination. Therefore, it is anticipated that VLP systems would increase accuracy and fulfill the tougher standards of indoor settings, while RF-based systems are restricted in sensitive regions~\cite{Zhuang2018}. The main VLP techniques utilize multiple image and light sensors, as well as positioning-optimization methods, for instance filtering, spring and normalization. The proximity approach used in~\cite{Luo2017} predicts the relative position based on a known base station or access point and is proven to have a huge variable in proximity, hence it does not match localization needs in many interior environments. Other efforts used multiple VLP triangulation methodologies, such as received signal strength (RSS), time difference of arrival (TDoA), time of arrival (ToA), and AoA, to boost position estimate accuracy without added hardware. Although these procedures are accurate, they are computationally intensive. Most of the aforementioned contributions agree that numerous access mechanisms have been suggested to separate and analyze transmitted mixed signals, a necessary operation for a VLP system. Time-division multiplexing (TDM) and frequency-division multiplexing (FDM) are two common methods that have been studied in the literature~\cite{Maheepala2020}. Demand for tighter coordination between individual LEDs, however, increases this complexity cost. When the location data is based on light of varying wavelengths, precision is increased since the signals are more easily distinguished. In order to limit the amount of LEDs utilized for localization, some traditional VLP systems use square waveforms whose spectral content include odd-integer harmonic frequencies. However, a sinusoidal waveform has significantly less complicated spectrum information~\cite{Costanzo2019}. This allows for a greater number of LEDs to be used, which in turn greatly improves both localization precision and breadth. \section{System models}\label{S:System_model} This section focuses on the system and channel models that lay the foundation of the discussed mmWave/THz and optical localization systems. In more detail, Section~\ref{Ss:THz} discusses the proposed mmWave/THz system model, which includes both LOS and RIS-aided NLOS scenarios, while Section~\ref{Ss:VLC} delves into the VLC-based localization techniques that can be split into LOS and optical RIS-aided NLOS system models. \begin{figure} \centering\includegraphics[width=0.9\columnwidth]{figures/THz.eps} \caption{mmWave/THz localization system architecture.} \label{fig:THz} \end{figure} \subsection{mmWave/THz}\label{Ss:THz} THz and mmWave techniques have been researched extensively during the past couple of years aiming to reduce the ``THz gap''. From a hardware perspective, small-scale graphene-based THz transceivers have been demonstrated with groundbreaking sensitivity, precision and power. Specifically, SotA photonic- and electronic-enabled transceivers have accomplished unprecedented signal transmission and modulation~\cite{Sengupta2018,Sengupta2019,Kenneth2019}. In order to properly configure and analyze the performance of a system, a channel model with robust accuracy is required. Channel modelling may make use of either stochastic, deterministic, or a combination of such approaches. Initially, the simplest model, i.e., deterministic, is analyzed for the far-field MIMO channel in the localization system, which assumes a planar waves in contrast to the near-field models that assume spherical waves. As depicted in Fig.~\ref{fig:THz}, in the uplink, we can split the channel matrix, $\textbf{H}$, of the channel into two distinct submatrices as \begin{align} \textbf{H} = \textbf{H}_\mathrm{LOS} + \textbf{H}_{\mathrm{NLOS}} , \end{align} with $\textbf{H}_\mathrm{NLOS}$ and $\textbf{H}_\mathrm{LOS}$ denoting the NLOS and LOS channels, respectively. \subsubsection{LOS}\label{Sss:THz_LOS} The LOS channel coefficient is valid in scenarios where the BS and the user equipment (UE) share an unobstructed communication path. In such cases, the channel matrix can be written as in~\cite{Heath2016} \begin{align} \textbf{H}_\mathrm{LOS}= \rho e^{-j 2 \pi\left(f \tau-\nu t\right)} G_{\mathrm{BS}} G_{\mathrm{UE}} \mathbf{a}_{\mathrm{BS}} \mathbf{a}_{\mathrm{UE}}^T , \end{align} where $\mathbf{a_{BS}}$, $\mathbf{a_{UE}}$, $G_{BS}$, and $G_{UE}$ represent the steering vectors and the gains of the BS and the UE, respectively. Moreover, $\tau$, $\nu$, $f$, and $\rho$ denote the signal delay, Doppler shift, frequency, and path gain, respectively. In more detail, the path gain can be expressed as in~\cite{Shahmansoori2017} \begin{align} \rho = \frac{c K_\alpha}{4 \pi f d} , \end{align} with $d$ being the propagation distance and $K_\alpha$ denoting the attenuation coefficient, which is a function of the distance and transmission frequency. It is important to highlight that, in THz systems $K_\alpha$ can be evaluated based on high-resolution transmission molecular absorption caused by water vapor and other gases in the atmosphere, while in mmWave ones it denotes the atmospheric attenuation. Furthermore, by assuming negligible Doppler effect and identical $K_\alpha$ between the subcarriers, the channel becomes frequency-flat and can be obtained as \begin{align} \textbf{H}_{\mathrm{LOS}}& = c_k \rho e^{-j \xi} e^{-j 2 \pi \Delta f_k \tau} \mathbf{a}_{\mathrm{BS}} \mathbf{a}_{\mathrm{UE}}^T , \end{align} where \begin{align} &\rho = \frac{\lambda_c {K_\alpha} G_{\mathrm{BS}} G_{\mathrm{UE}}}{4 \pi d_{BU}} , \\ &\xi = 2 \pi f_c \tau, \end{align} and \begin{align} &\tau = \frac{d_{BS-UE}}{c} + B. \end{align} Likewise, $B$ and $c$ are the clock synchronization offset and the speed of light, respectively, while $f_k$ and $c_k$ denote the frequency of the $k$-th subcarrier and the ratio between the central and the subcarrier frequency, respectively. Finally, $d_{BU}$ represents the distance between the BS and the UE. \subsubsection{NLOS}\label{Sss:THz_NLOS} \underline{Without RIS:} When all LOS paths are obstructed, the transmitted mmWave/THz signal may arrive at the user's device after being reflected on random (i.e., obstacles, walls, metallic structures, etc) or carefully placed (i.e., RISs) objects. Specifically, THz NLOS communication scenarios are characterized by increased losses and sparsity, while scattering and diffraction phenomena are introduced from rough surfaces~\cite{Ma2019b}. Thus, such channels are commonly modelled with ray-tracing and stochastic techniques. On the other hand, mmWave NLOS can be characterized by modeling the stochastic reflection loss and geometrical modeling~\cite{Fascista2019}. If we assume M reflectors between the BS and the UE, the channel matrix for each reflector can be expressed as \begin{align} \textbf{H}^{(m)}_{\mathrm{NLOS}}& = c_k \rho^{(m)} e^{-j \xi^{(m)}} e^{-j 2 \pi \Delta f_k \tau^{(m)}} \mathbf{a}_{\mathrm{R}} \mathbf{a}_{\mathrm{UE}}^T , \label{Eq:H_NLOS} \end{align} where \begin{align} &\rho^{(m)} = \frac{\lambda_c {K_\alpha}^{(m)}_{(R-UE)} G^{(m)}_{\mathrm{BS}} G^{(m)}_{\mathrm{UE}}}{4 \pi d^{(m)}_{R-UE}} , \\ &\xi^{(m)} = 2 \pi f_c \tau^{(m)} \end{align} and \begin{align} &\tau^{(m)} = \frac{d^{(m)}_{BS-R} + d^{(m)}_{R-UE}}{c} + B. \end{align} In~\eqref{Eq:H_NLOS}, $d^{(m)}_{BS-R}$ and $d^{(m)}_{R-UE}$ denote the distances between the BS and the $m$-th reflector as well as between the $m$-th reflector and the UE, respectively. Also, $\mathbf{a}_{\mathrm{R}}$ represents the steering vector of the reflector, while ${K_\alpha}^{(m)}_{(R-UE)}$ is the attenuation coefficient for the RIS-UE channel. \underline{With RIS:} In the case of RIS-aided systems, the previous analysis is augmented with RIS-reflected signal coefficients. The reflection of the signal on the RIS modifies its phase and amplitude with the channel matrix given by~\cite{Tang2020b} \begin{align} \textbf{H}_{\mathrm{RIS}}& = c_k^2 \rho e^{-j \xi} e^{-j 2 \pi \Delta f_k \tau} \mathbf{a}_{\mathrm{BS}} \mathbf{a}_{\mathrm{RIS}}^T \mathbf{\Omega} \mathbf{a}_{\mathrm{RIS}} \mathbf{a}_{\mathrm{UE}}^T , \label{Eq:HRIS} \end{align} where \begin{align} &\rho = \frac{\lambda_c^2 {K_\alpha}_{(BS-RIS)} {K_\alpha}_{(RIS-UE)}}{16 \pi^2 d_{BS-RIS} d_{RIS-UE}} , \\ &\xi = 2 \pi f_c \tau \end{align} and \begin{align} &\tau = \frac{d_{BS-RIS} + d_{RIS-UE}}{c} + B , \end{align} In~\eqref{Eq:HRIS}, ${K_\alpha}_{(BS-RIS)}$ is the attenuation coefficient for the BS-RIS channel, while ${K_\alpha}_{(RIS-UE)}$ is the attenuation coefficient for the RIS-UE channel. In addition, $d_{BS-RIS}$ and $d_{RIS-UE}$ denote the distances between the BS and the RIS as well as between the RIS and the UE, respectively. Finally, $\mathbf{a}_{\mathrm{RIS}}$ represents the steering vector of the RIS. Finally, the complete NLOS channel matrix can be obtained by summing all the individual reflection components, both random and RIS ones, as \begin{align} \textbf{H}_{\mathrm{NLOS}} = \sum^M_{m=1} \textbf{H}^{(m)}_{\mathrm{NLOS}} + \textbf{H}_{\mathrm{RIS}} . \end{align} \subsubsection{Localization geometry}\label{Ss:THz_geometry} From a localization perspective, the system consists of a base station, a RIS and the end user's device. In order to determine the position of the latter in space, we need to define a global coordinate system defined as \begin{align}\mathbf{p} = [x,\,y,\,z]^T.\end{align} As discussed in~Section~\ref{Ss:RIS}, the channel contains LOS as well as NLOS paths generated by RIS, reflector and/or diffractor elements. \begin{figure} \centering\includegraphics[width=1\columnwidth]{figures/Coordinates.eps} \caption{Global vs local coordinate system.} \label{fig:Coordinates} \end{figure} To simplify the analysis, a local coordinate system needs to be used, which can be translated to the global one by using an Euler angle vector and a xyz rotation sequence as \begin{align} \mathbf{p}_\mathrm{i} = \mathbf{R} \mathbf{\tilde{p}}_\mathrm{i} + \mathbf{p} \end{align} with $\mathbf{p}_i$ and $\mathbf{\tilde{p}}_i$ representing the position of the $i$-th element with $i=\mathrm{BS}, \mathrm{UE}, \mathrm{RIS}$ in the global and local coordinate system, respectively, while $\mathbf{R}$ denotes the rotation matrix and $\mathbf{p}$ is the center of the array. The global and local coordinate systems are presented in~Fig.~\ref{fig:Coordinates}. Furthermore, in the case that the user transmits a signal towards the BS, the direction vector in the global coordinate system can be written as \begin{align} \label{Eq:v_BS_UE} \mathbf{v}_\mathrm{BS-UE} = \frac{\mathbf{p}_\mathrm{UE}-\mathbf{p}_\mathrm{BS}}{d_\mathrm{BS-UE}} , \end{align} where \begin{align} d_\mathrm{BS-UE}=||\mathbf{p}_\mathrm{U}-\mathbf{p}_\mathrm{BS}|| \end{align} denotes the distance between the UE and the BS. \eqref{Eq:v_BS_UE} can be translated in the local coordinate system as \begin{align} \mathbf{\tilde{v}}_\mathrm{BS-UE} = \mathbf{R}^{-1} \mathbf{v}_\mathrm{BS-UE} , \end{align} The AoA/AoD pairs can be derived based on the definitions provided for the global and local coordinate systems by using an azimuth, $\phi$, and an elevation, $\theta$, angles. The former is defined as the angle between the y axis and the projection of the direction vector on the xy plane, while the latter is the angle between the direction vector and the xy plane. Due to the fact that the AoA/AoD angles can only be measured in the local coordinate system, the direction vector needs to be rewritten in the local coordinate system as \begin{align} \label{Eq:AoA/AoD} \mathbf{\tilde{v}}_\mathrm{BU} = f(\mathbf{\tilde{\varphi}}_\mathrm{BU}) = \begin{bmatrix} \mathrm{cos}(\tilde{\phi}_\mathrm{BU}) \mathrm{cos}(\tilde{\theta}_\mathrm{BU}) \\ \mathrm{sin}(\tilde{\phi}_\mathrm{BU}) \mathrm{cos}(\tilde{\theta}_\mathrm{BU}) \\ \mathrm{sin}(\tilde{\theta}_\mathrm{BU}) \end{bmatrix} , \end{align} where $\mathbf{\varphi}$ and $\mathbf{\tilde{\varphi}}$ denote the AoA/AoD angles in the global and local coordinate system, respectively, while $f(\mathbf{\tilde{\varphi}}_\mathrm{BU})$ represents the mapping between the direction vector and the AoA/AoD angles. On the contrary, \eqref{Eq:AoA/AoD} can be expressed in terms of the direction vector as \begin{align} f(\mathbf{\tilde{\varphi}}_\mathrm{BU}) = \begin{bmatrix} \tilde{\phi}_\mathrm{BU} \\ \tilde{\theta}_\mathrm{BU} \end{bmatrix} = \begin{bmatrix} \mathrm{arctan2}(\mathbf{\tilde{v}}_\mathrm{BU,x},\mathbf{\tilde{v}}_\mathrm{BU,y}) \\ \mathrm{arcsin}(\mathbf{\tilde{v}}_\mathrm{BU,z}) \end{bmatrix} , \end{align} with $\mathrm{arctan2}\left(\cdot\right)$ denoting the four-quadrant inverse tangent. This procedure can be used to calculate the global AoA/AoD values by substituting $\mathbf{\tilde{v}}_\mathrm{BU}$ with $\mathbf{v}_\mathrm{BU}$, while the same methodology can be applied to any of the aforementioned channels, either LOS or NLOS. \subsection{VLP}\label{Ss:VLC} Visible-light based positioning (VLP) systems are distinct from their radio-based counterparts in a number of ways. As a result, it is important to develop appropriately designed VLP system that incorporate the optical transmission particularities and are both precise and reliable. As depicted in~Fig.~\ref{fig:VLP}, signals in VLP systems travel from an light emmiting diode (LED) source to a photodiode (PD) receiver via a wireless channel. The LED is often categorised as a Lambertian source~\cite{Kahn1997}, meaning it disseminates signals in accordance with Lambert's emission law (i.e., when observing a perfect diffuse reflecting surface, the radiant intensity is proportional to the cosine of the angle between the direction of incoming light and the surface). The following analysis, assumes that the channel between the receiver and the transmitter may be obstructed, in which case it enlists an optical RIS to extend the VLP system coverage. \begin{figure} \centering\includegraphics[width=1\columnwidth]{figures/VLP_v2.eps} \caption{VLC localization system architecture.} \label{fig:VLP} \end{figure} \subsubsection{LOS}\label{Sss:VLC_LOS} The LOS process may be represented by a Lambertian model, which means that after being reflected off of an object like a wall, the light's intensity drops to such a low level that it may be safely disregarded. Changing the reflection route of the optical connection and achieving beamforming through a multi-mirror reflection link are both possible thanks to RIS based on mirror arrays, as described in~\cite{Qian2021}. In the LOS channel the system model can be expressed as in~\cite{Zhuang2018} \begin{align} y = h \, x + n , \end{align} where $x$ and $y$ represent the transmission and received signal, respectively. Also, $n$ denotes the additive white Gaussian noise (AWGN), while $h$ is the channel gain. In more detail, the LOS channel gain can be written as \begin{align} h^{\mathrm{LOS}} &=\frac{A(m+1)}{2 \pi d^2} \cos ^m\left(\phi\right) \cos \left(\psi\right) T_o G\left(\psi\right), \end{align} where \begin{align} m &= - \frac{1}{2} \log_2 (\cos(\Phi_{1/2})), \end{align} and \begin{align} G\left(\psi\right) &= \frac{\alpha^2}{\sin^2(\Psi)}, \text{ for } 0\leq \psi \leq \Psi. \end{align} Moreover, $\phi$ and $\psi$ denote the irradiance and incidence angles, respectively. In addition, $G\left(\psi\right)$ is the optical concentrator gain, while $T_o$ represents the optical filter gain. Finally, $m$ is the Lambertian model index, $\Phi_{1/2}$ is the LED's half-power angle, $\Psi$ is the field of view (FOV), $\alpha$ is the PD's refractive index and $A$ is the PD's area. \subsubsection{NLOS}\label{Sss:VLC_NLOS} In the NLOS scenario, a RIS that is made up of $\mathrm{N_x} \times \mathrm{N_y}$ identical rectangular mirrors, each of which is $d$ in size. Each mirror is mounted such that its optical centre is in a plane perpendicular to the $y$ axis. To determine the roll $\omega$ and the yaw $\gamma$ angles, which spin clockwise in the positive direction of the $x$ axis and counterclockwise in the positive direction of the $z$ axis, respectively, we need two mirrors placed at right angles to one another. The RIS-enabled NLOS pathways can be split into two categories: (i) the RIS component is a RX that handles the signals from LED; and (ii) to re-transmit the optical signal collected in the prior stage, the RIS component is assumed to be a point source and its magnitude is multiplied by the reflection coefficient. As higher-order reflections have an unaccounted-for effect on VLC systems, we restrict the following analysis to first-order reflections~\cite{Tang2020c}. Moreover, we assume that the LED's incident light falls on each of the RIS elements that are called meta-atoms (MAs) at its geometric centre as well as that there are $K$ MAs of area $D$. As a result, the channel gain of the $k$-th RIS element can be expressed as in~\cite{Abdelhady2020} \begin{align} \begin{split} h_k^{\mathrm{NLOS}}=&\rho_k^\mathrm{RIS} \frac{(m+1) A D}{2 \pi^2 (d_k)^2 (d_k^r)^2} \cos ^m\left(\phi_k\right) \\ & \times \cos \left(\psi_k^r\right) \cos \left(\psi_k\right) \cos \left(\phi_k^r\right) T_o G\left(\psi_k^r\right) , \end{split} \end{align} where $d_k$ and $d_k^r$ represent the distances of the $k$-th RIS element from the LED and the PD, respectively, while, $\rho_k^\mathrm{RIS}$ denotes the reflection coefficient of the $k$-th element. Moreover, if we assume that the receiver, the transmitter and the $k$-th RIS element are located in $(x_r,y_r,z_r)$, $(x,y,z)$, and $x_k,y_k,z_k$, correspondingly, $\phi_k^r$ and $\psi_k$, which are based on the roll and yaw angles of the $k$-th RIS element, can be evaluated~as \begin{align} \begin{split} \cos \left(\phi_k^r\right)=&\frac{\left(x_r-x_k\right)}{d_k^r} \sin (\gamma_k) \cos (\omega_k) \\ &+ \frac{\left(y_r-y_k\right)}{d_k^r} \cos (\gamma_k) \cos (\omega_k) \\ &+ \frac{(z_k-z_r)}{d_k^r} \sin (\omega_k) , \end{split} \end{align} and \begin{align} \begin{split} \cos \left(\psi_k^i\right)=&\frac{\left(x-x_k\right)}{d_k} \sin \left(\gamma_k\right) \cos \left(\omega_k\right) \\ &+ \frac{\left(y-y_k\right)}{d_k} \cos \left(\gamma_k\right) \cos \left(\omega_k\right) \\ &+\frac{\left(z_k-z\right)}{d_k} \sin \left(\omega_k\right) . \end{split} \end{align} Finally, the $k$-th element's norm vector can be written as \begin{align} n_k = \left(\sin(\psi_k) \cos(\phi_k^r), cos(\psi_k)cos(\phi_k^r),-sin(\phi_k^r)\right)^T . \end{align} As a result, the complete channel gain of the VLP system can be expressed as \begin{align} h = h^{\mathrm{LOS}} + \sum_{k=1}^K h_k^{\mathrm{NLOS}} (\omega_k,\gamma_k) . \end{align} \subsubsection{Localization geometry}\label{Ss:VLC_geometry} To dig a little deeper into the VLP approaches, the most common geometrical approaches can be categorized in to RSS-based, ToA/TDoA-based and AoA-based~\cite{Zhuang2018}. Specifically, the most well known localization RSS-based technique for VLP is trilateration, where, after the RX measures the strength of the transmitted signals, the distance between the RX and each TX can be calculated, allowing for the drawing of concentric circles whose radii correspond to the measured distances. Existing measurement flaws often cause the recorded distance to be just slightly off from the real ones. Thus, almost always some overlap exists between the areas where the circles are drawn. In this case, the trilateration problem transforms into the least-squares estimate~\cite{Zhang2014}, the solution to which is provided as a solution to the system \begin{align} \left\{ \begin{array}{l} \left(x-x_1\right)^2+\left(y-y_1\right)^2=d_1^2 \\ \left(x-x_2\right)^2+\left(y-y_2\right)^2=d_2^2 \\ \left(x-x_3\right)^2+\left(y-y_3\right)^2=d_3^2 \end{array} \right. . \end{align} As far as the ToA/TDoA-based methods are concerned, they also leverage trilateration algorithms since, as light travels at a fixed speed over a given distance, it generates phase delay in the RX. Such systems need at least three TX, i.e., at least three phase differences, with each one having its own unique frequency id. The power of each TX can be expressed as \begin{align} P_i(t) = P_c + P_s cos(2\pi f_i t+ \phi_0) , \end{align} where $P_s$, $P_s$, and $\phi_0$ denote modulated signal power, the continuous signal power, and the initial phase of the signal, respectively. Also, $f_i$ is the modulation frequency of each transmitter ($i=1,2,3$). As a result, the power recieved by the PD can be written as \begin{align} E(t)=K \left| R \sum_{i=1}^3 P_i(t) h_i(t)\right| , \end{align} with $R$, $K$, and $h_i(t)$ represent the PD's responsivity, the constant proportionality, and the channel impulse response, accordingly. The received signal is processed by band pass filters specialized on each modulated frequency and, afterwards, it is passed by a frequency down converter comprised by a mixer and a band pass filter to unify the frequency. Thus, the system is capable to use Hilbert transform to calculate the two phase differences (from three transmitters). However, a third phase difference is required for accurately obtaining the position of the user, which can be obtained by altering the frequency of two out of the three transmitters~\cite{Jung2011}. As a result, the phase differences can be obtained by \begin{align} \left\{ \begin{array}{l} \Delta \varphi_{12}=2 \pi f_1 \frac{d_1-3 d_2}{c_{12}}=\arctan \left(I_{12} / Q_{12}\right) \\ \Delta \varphi_{13}=2 \pi f_1 \frac{d_1-5 d_3}{c_1}=\arctan \left(I_{13} / Q_{13}\right) \\ \Delta \varphi_{21}=2 \pi f_1 \frac{d_2-3 d_1}{c}=\arctan \left(I_{21} / Q_{21}\right) \end{array} \right. , \end{align} with $f_1$ denoting the reference frequency, and \begin{align} \left\{ \begin{array}{l} I_{ab} = E_a(t) \mathrm{Hilb}[E_b(t)] - \mathrm{Hilb}[E_a(t)] E_b(t) \\ Q_{ab} = E_a(t) E_b(t) + \mathrm{Hilb}[E_a(t)] \mathrm{Hilb}[E_b(t)] \end{array} \right. , \end{align} where $E$ represents the RSS after the band pass filter and the down conversion, while $\mathrm{Hilb}[\cdot]$ denotes the Hilbert transform. Finally, the user's position can be calculated based on the following distances \begin{align} \left\{ \begin{array}{l} d_1=-\frac{1}{8} \frac{c}{2 \pi f_1}\left[\tan^{-1}\!\left(I_{12} / Q_{12}\right)\!+\!3 \tan^{-1}\!\left(I_{21} / Q_{21}\right)\right] \\ d_2=\frac{1}{3}\left[d_1-\tan^{-1}\!\left(I_{12} / Q_{12}\right) \frac{c}{2 \pi f_1}\right] \\ d_3=\frac{1}{5}\left[d_1-\tan^{-1}\!\left(I_{13} / Q_{13}\right) \frac{c}{2 \pi f_1}\right] \end{array} \right. . \end{align} \section{Localization KPIs}\label{S:KPIs} Naturally, better location and orientation accuracy and precision would be at the top of the list, when developing a localization system. But other goals, including complexity, coverage and mobility, are crucial to the system's success as a whole. This section provides the fundamental KPIs shared between SotA localization systems. \subsection{Accuracy}\label{Ss:Accuracy} The accuracy with which a system can estimate its location and orientation is one of the most important KPIs of its localization capability. In more detail, the accuracy of a system is often evaluated by calculating the distance between the real location and the predicted one. It can be often measured as the mean squared error (MSE) or the CDF of measurements bound by a predefined threshold, which can be expressed as \begin{align} \begin{split} \label{Eq:e_MSE} e_{\mathrm{MSE}}(\hat{\mathbf{w}})=&\mathbb{E}\left[\|\hat{\mathbf{w}}-\mathbf{w}\|^2\right] \\ =&\operatorname{tr}(\mathbf{C}(\hat{\mathbf{w}}, \mathbf{w}))+\|\mathbb{E}[\hat{\mathbf{w}}]-\mathbf{w}\|^2 , \end{split} \end{align} with $w$, $\mathrm{C}(\hat{\mathrm{w}}, \mathrm{w})$ and $\operatorname{tr}(\cdot)$ denoting the location, the covariance matrix, and the matrix trace, respectively. Also, $\mathbb{E}[\cdot]$ is the expected value. In more detail, $\|\mathbb{E}[\hat{\mathbf{w}}]-\mathbf{w}\|^2$ represents the bias, while $\operatorname{tr}(\mathbf{C}(\hat{\mathbf{w}}, \mathbf{w}))$ is the variance of the location estimate. Moreover, it is possible to get a worst case estimate of the accuracy by assuming that no bias exists and using the Cramér-Rao bound, which is illustrated in the following equation, provided the noise and signal models are known. \begin{align} \label{Eq:C_w} \mathbf{C}(\hat{\mathbf{w}}, \mathbf{w}) \succeq \mathbf{I}^{-1}(\mathbf{w}) , \end{align} where $\mathbf{I}^{-1}(\mathbf{w})$ is the inverse of the Fisher matrix~\cite{Guvenc2009}. Finally, after performing the substitution between \eqref{Eq:e_MSE} and~\eqref{Eq:C_w}, based on the available/selected measurement such as ToA, AoA, RSS, and more, the localization lower bound can be extracted~as \begin{align} \begin{split} e_{\operatorname{MSE}}(\hat{\mathbf{w}}) &=\mathbb{E}\left[\|\hat{\mathbf{w}}-\mathbf{w}\|^2\right] \\ & \geq \operatorname{tr}(\mathbf{C}(\hat{\mathbf{w}}, \mathbf{w})) \\&\geq \operatorname{tr}\left(\mathbf{I}^{-1}(\mathbf{w})\right). \end{split} \end{align} It should be highlighted that various published works utilize the root MSE (RMSE) instead of the MSE, which results in the following lower bound: \begin{align} \begin{split} e_{\operatorname{RMSE}}(\hat{\mathbf{w}}) &=\sqrt{\mathbb{E}\left[\|\hat{\mathbf{w}}-\mathbf{w}\|^2\right]} \\ & \geq \sqrt{\operatorname{tr}(\mathbf{C}(\hat{\mathbf{w}}, \mathbf{w}))} \\ & \geq \sqrt{\operatorname{tr}\left(\mathbf{I}^{-1}(\mathbf{w})\right)}. \end{split} \end{align} However, the performance of the system may fall short of the Cramér-Rao bound since many realistic estimators are skewed due to signal NLoS propagation and other causes. To this end, tighter constraints have been introduced, such as the Zik-Zakai, Weiss-Weinstein, and Bayesian Cramer Rao bounds\cite{Xiao2022}. \subsection{Precision}\label{Ss:Precision} In terms of localization precision, it reveals the variance of the estimated location. The KPI of localization precision was created to statistically characterize the accuracy as it fluctuates throughout numerous localization attempts. One example of precision KPIs is the geometrical dilution of precision (GDoP) that measures the variation in localization errors and can be expressed as \begin{align} \mathrm{GDoP}=\frac{e_{\mathrm{RMSE}}(\hat{\mathbf{w}})}{e_{\mathrm{RMSE}}(\hat{\mathbf{d}})} , \end{align} with the estimated range and location RMSEs serving as numerator and denominator, correspondingly. Minimizing the GDoP can provide the optimal fixed node selection and placement as it model the precision of the location estimation with regard to the distribution of the fixed nodes in space. Another KPI of the localization precision is the localization error, which can be measured by two metrics, namely its CDF and outage. The former represents the likelihood that location estimates will be precise to a specified degree and is given by \begin{align} \operatorname{F_e}(e_{\mathrm{th}})=1-\operatorname{P_{out}}(e_{\mathrm{th}}) , \end{align} while the latter expresses the likelihood of the localization error to overcome a predefined value and can be expressed as \begin{align} \operatorname{P_{out}}\left(e_{\mathrm{th}}\right)=\operatorname{Pr}\left\{\|\hat{\mathrm{w}}-\mathrm{w}\| \geq e_{\mathrm{th}}\right\} . \end{align} In actual situations, the outage and/or CDF reflects the likelihood of confidence in the estimated location. In the case when two localization methods have equivalent accuracy, the approach that produces the smaller outage and/or larger CDF values is more precise and thus preferred. \subsection{Latency}\label{Ss:Latency} \begin{figure} \centering\includegraphics[width=0.4\columnwidth]{figures/Latency.eps} \caption{Localization latency.} \label{fig:Latency} \end{figure} In a localization system, the term latency refers to the delay that occurs between a device making a location request and receiving the response, as shown in Fig.~\ref{fig:Latency}. This is determined by the processing speed of the chosen localization method and the length of the position reference signals utilized. However, latency only describes part of the time-related performance. The pace at which a localization indicator is updated is known as its update rate. This KPI is latency-dependent, in the sense that its maximum value cannot exceed (latency)$^{-1}$, and use-case-dependent. \subsection{Coverage}\label{Ss:Coverage} As the distance between each fixed and the mobile network node grows, localization performance often decreases. The system's coverage is the largest geographic region across which reliable localization services may be provided with specified levels of latency, precision, accuracy, and other KPIs. Depending on the available localization infrastructures, the coverage may be broadly broken down into three categories: indoor, local, and global. The probability of coverage, which represents the probability that a specific user achieves an SINR higher than a certain threshold, is the most common KPI of coverage and can be expressed as \begin{align} P_c = P[\gamma \geq \gamma_{\mathrm{th}}] , \end{align} with $\gamma$ and $\gamma_{\mathrm{th}}$ denoting the SINR of the wireless system and the threshold that must be satisfied in order to consider the UE inside the coverage area, respectively. However, the coverage KPI disregards the system's adaptability when expanding the scope of localization. There is a risk of wireless channel congestion as localization coverage expands, and the localization system will need to execute increased computations and measurements. To this end, the KPI of scalability has been introduced, which quantifies the capacity of a system to accommodate a growing number of end devices. If we consider a wireless networks with $N$ nodes, there is a point after which the residual capacity becomes negative. This point is the maximum number of nodes, $k$, that can be supported by the system. Thus, the scalibility of the wireless network is defined as the number of nodes, after which the residual capacity decreases for every new node added in the system. By setting the residual capacity at $k$ equal to $0$, the scalability can be obtained as in~\cite{Ramanathan2012} \begin{align} C_R(N=k) &= 0, \end{align} which leads to \begin{align} \eta\, C_a &= \sum_{i}(1+\Gamma_i)\, L_i\, (1+Y_i), \end{align} where $C_a$ is the available capacity, $\eta$ denotes the efficiency, while $L_i$, $\Gamma_i$, and $Y_i$ represent the average load, the contention factor, and the transit factor, respectively. \subsection{Complexity}\label{Ss:Complexity} Various aspects of the localization approach, such as the hardware, the signal detection method, and the algorithm's computation requirements, contribute to the overall system's complexity. Depending on the specifics of the intended use case, all or a subset of these types of complexity may be relevant. With regard to hardware, the complexity of hardware realization and deployment is directly related to the complexity of communication and localization algorithms. While, as far as software complexity is concerned, it can be challenging to analytically determine the complexity formula of various localization methods. Thus, it is often considered equal to the computational complexity of the location estimators. Moreover, in the context of localization, complexity is intertwined with accuracy and precision. In addition, there is a crucial relation between complexity and the time elapsed between location updates for a specific mobile node, which is measured by two KPIs, namely update rate and latency. \subsection{Stability}\label{Ss:Stabililty} In high-frequency systems with small beamwidths, where pointing errors might cause an outage, loss of tracking or deafness can be a critical issue. Thus, deafness, which is defined as the power leakage brought on by the estimate error, is often used as a metric in the assessment of localization algorithms. Deafness is represented as a percentage and normalised to the half power beamwidth (HPBW) as in~\cite{Stratidakis2019} \begin{align} \mathcal{D} = \frac{\|x-\hat{x}\|}{\mathrm{HPBW}} , \end{align} and, thus, the stability can be written as \begin{align} \mathcal{S} = 1 - \mathcal{D}. \end{align} If it reaches 100\%, the localization process must restart since the estimate failed because the UE is outside the beam. Therefore, a system's stability may be thought of as the variation in localization accuracy over time, particularly in a mobile setting. \begin{table*} \centering \caption{SoTA Localization Methods} \label{tab:localization_methods} \begin{tabular}{p{0.001\linewidth}p{0.1\linewidth}p{0.22\linewidth}p{0.22\linewidth}p{0.23\linewidth}p{0.08\linewidth}} \toprule & \textbf{Algorithm} & \textbf{Application scenarios} & \textbf{Use cases} & \textbf{Technology enablers} & \textbf{Metrics}\\ \midrule \parbox[t]{2mm}{\multirow{30}{*}{\rotatebox[origin=c]{90}{Conventional}}} & Triangulation & Local trust zones \cite{Hanssens2016, Ottoy2016} \par Mapping \cite{Kristalina2016, Landstrom2016, Prateek2021} \par Sustainable develop. \cite{Tazawa2016, Steendam2018, Lee2020} \par Security \cite{Yan2018} \par Massive twinning \cite{Soltanaghaei2018, Adama2021} & Outdoor \cite{Prateek2021} \par Indoor \cite{Hanssens2016, Ottoy2016, Landstrom2016, Tazawa2016, Steendam2018, Yan2018, Soltanaghaei2018, Lee2020, Adama2021} & mmWave/THz \cite{Landstrom2016} \par VLP \cite{Steendam2018} \par Sensors \cite{Yan2018, Adama2021, Prateek2021} & AoA, ToA, AoD, ToF, RSS, RMSE \\ \cline{3-6} & Kalman \par Filters & Local trust zones \cite{Werner2015, Yousefi2015, Rastorgueva2018, Kanhere2021, Ammous2022} \par Massive twinning \cite{Koivisto2016, Koivisto2017} \par Robots \cite{Bai2019} & Outdoor \cite{Werner2015, Koivisto2016, Koivisto2017, Rastorgueva2018, Kanhere2021, Ammous2022} \par Indoor \cite{Yousefi2015, Bai2019} & mmWave/THz \cite{Werner2015, Koivisto2016, Rastorgueva2018, Koivisto2017, Bai2019, Kanhere2021, Ammous2022} \par RIS \cite{Ammous2022} \par Sensors \cite{Yousefi2015} & ToA, DoD, RSS, RMSE \\ \cline{3-6} & Compressive \par sensing & Local trust zones \cite{Cao2017, Abdelreheem2018, Salari2018, Harlakin2021, Jiang2021, Jiang2021b} \par Mapping \cite{Ramadan2017} \par Massive twinning \cite{Gligoric2018} & Indoor \cite{Ramadan2017} \par Outdoor \cite{Harlakin2021, Jiang2021, Jiang2021b} & mmWave/THz \cite{Abdelreheem2018, Harlakin2021, Jiang2021} \par Sensors \cite{Cao2017, Ramadan2017, Salari2018, Jiang2021, Jiang2021b} \par Beamforming \cite{Abdelreheem2018} \par Radar \cite{Harlakin2021} \ ,\ \ VLP \cite{Gligoric2018} & RSS, TDoA, DoA, RMSE \\ \cline{3-6} & Multidimensional \par Scaling & Robots \cite{Oliveira2014} \par Local trust zones \cite{Franco2015, Saeed2015, Chaurasiya2014, Jiang2016, Kumar2016b, Morral2016, Stojkoska2017, Fan2020b, Fan2021} \par Massive twinning \cite{Cui2016} & Indoor \cite{Oliveira2014, Cui2016, Stojkoska2017} \par Outdoor \cite{Saeed2015, Chaurasiya2014, Jiang2016, Morral2016, Fan2021} \par Non-terrestrial \cite{Kumar2016b, Fan2020b} & Sensors \cite{Oliveira2014, Franco2015, Saeed2015, Chaurasiya2014, Jiang2016, Kumar2016b, Morral2016, Stojkoska2017, Fan2020b, Fan2021, Cui2016} & ToF, TDoA, RSS, RMSE \\ \cline{3-6} & Direct \par Localization & Local trust zones \cite{Weiss2004, Garcia2017, Yin2017, Chen2018, Han2019, Ma2019, Zhao2020, Xia2021, Yu2021} \par Sustainable develop. \cite{Hossain2019b, Bai2022} & Outdoor \cite{Weiss2004, Garcia2017, Yin2017, Chen2018, Han2019, Ma2019, Zhao2020, Xia2021, Yu2021, Hossain2019b, Bai2022} & mmWave/THz \cite{Garcia2017, Han2019, Hossain2019b} \par Sensors \cite{Weiss2004, Yin2017, Chen2018, Ma2019, Zhao2020, Xia2021, Yu2021, Bai2022} \par Radar \cite{Yu2021} & ToA, TDoA, AoA, RMSE \\ \cline{3-6} & Swarm \par Intelligence & Robots \& Mapping \cite{Nedjah2020} \par Local trust zones \cite{Daely2016, Arsic2016, Kulkarni2016, Monica2016, Tuba2018, Strumberger2018, Strumberger2018b, Phoemphon2018, Kulkarni2019, Strumberger2019, Arafat2019, Akram2021} \par Sustainable develop. \cite{Singh2018} & Indoor \cite{Nedjah2020, Monica2016, Kulkarni2016, Monica2016} \par Outdoor \cite{Nedjah2020, Daely2016, Arsic2016, Tuba2018, Strumberger2018, Strumberger2018b} & Sensors \cite{Nedjah2020, Daely2016, Arsic2016, Kulkarni2016, Monica2016, Tuba2018, Strumberger2018, Strumberger2018b, Phoemphon2018, Kulkarni2019, Strumberger2019, Arafat2019, Akram2021, Singh2018} & AoA, ToA, RMSE, RSS \\ \cline{3-6} & Fingerprinting & Sustainable develop. \cite{Zhou2015, Zhou2015b, He2016, Souza2016, Li2016, Chen2016b, Zhang2017c, Zhou2017d, Pecoraro2018, Duan2019, Moghtadaiee2019, Zhang2019fing, Gao2021} \par Mapping \cite{Li2019c} \par Local trust zones \cite{Shen2021} & Indoor \cite{Zhou2015, Zhou2015b, He2016, Souza2016, Li2016, Chen2016b, Zhang2017c, Zhou2017d, Pecoraro2018, Duan2019, Moghtadaiee2019, Li2019c, Zhang2019fing, Gao2021} \par Outdoor \cite{Shen2021} & Sensors \cite{Zhou2015, Zhou2015b, He2016, Souza2016, Li2016, Chen2016b, Zhang2017c, Zhou2017d, Pecoraro2018, Duan2019, Moghtadaiee2019, Li2019c, Zhang2019fing, Gao2021} \par mmWave/THz \cite{Shen2021} & RSS, RMSE\\ \cline{3-6} & SLAM & Mapping \cite{Schlegel2018, Holder2019, Cui2020, Rodriguez2018, Lin2019, Chen2020b, Wang2021b, Chen2021b} & Outdoor \cite{Schlegel2018, Rodriguez2018, Lin2019, Chen2020b, Wang2021b} \par Non-terrestial \cite{Holder2019} \par Underwater \cite{Cui2020} \par Indoor \cite{Chen2021b} & Sensors \cite{Schlegel2018, Cui2020, Lin2019, Chen2020b, Chen2021b} \par Radar \cite{Holder2019, Wang2021b} \par & RMSE, RSS \\ \midrule \parbox[t]{2mm}{\multirow{43}{*}{\rotatebox[origin=c]{90}{Learning-based}}} & K-nearest \par neighbor & Sustainable develop. \cite{Alhajri2019, Peng2016b} \par Massive twinning \cite{Wang2019b, Guo2018} \par Local trust zones \cite{Sun2018, Wang2019c} \par Mapping \cite{Boudani2020, Chen2016} & Indoor \cite{Alhajri2019, Peng2016b, Wang2019b, Guo2018, Boudani2020, Chen2016} \par Outdoor \cite{Sun2018, Wang2019c} & mmWave/THz \cite{Sun2018, Boudani2020, Wang2019c} \par VLP \cite{Chen2016} \par Sensors \cite{Alhajri2019, Peng2016b, Wang2019b, Guo2018} & RMSE, RSS \\ \cline{3-6} & Support vector \par machine & Sustainable develop. \cite{Zhang2018b, Ray2016, Cheng2016} \par Mapping \cite{Li2017} \par Massive twinning \cite{Kram2019, Yang2018, Zhang2019d} \par Local trust zones \cite{Wu2018, Wu2019d, Sanam2018, Mahfouz2015, Burghal2020, Petric2019, Zhang2017b, Rezgui2017, Khalajmehrabadi2017, Wang2016c, Guo2019, Yan2017} & Indoor \cite{Zhang2018b, Kram2019, Wu2018, Wu2019d, Sanam2018, Mahfouz2015, Petric2019, Zhang2017b, Rezgui2017, Khalajmehrabadi2017, Wang2016c, Guo2019, Yan2017, Cheng2016} \par Outdoor \cite{Li2017, Ray2016, Yang2018} \par Non-terrestrial \cite{Li2017} & Sensors \cite{Zhang2018b, Kram2019, Wu2018, Wu2019d, Sanam2018, Mahfouz2015, Petric2019, Zhang2017b, Rezgui2017, Khalajmehrabadi2017, Wang2016c} \par Radars \cite{Li2017, Yan2017, Yang2018, Cheng2016} \par mmWave/THz \cite{Ray2016} & ToA, TDoA, RSS, RSME \\ \cline{3-6} & Decision \par trees & Local trust zones \cite{Ahmadi2015, Akram2018, Guo2018b, Malmstrom2019, Rashdan2020} \par Massive twinning \cite{Musa2019, De2019} \par Sustainable develop. \cite{Zhang2019e, Chen2019c, Apostolo2019} & Indoor \cite{Ahmadi2015, Musa2019, Chen2019c, Apostolo2019, Zhang2019e, Akram2018, Guo2018b} \par Outdoor \cite{De2019, Malmstrom2019, Rashdan2020} & Radars \cite{Ahmadi2015, Musa2019, De2019} \par Sensors \cite{Chen2019c, Apostolo2019, Zhang2019e, Akram2018, Guo2018b} \par mmWave/THz \cite{Malmstrom2019, Rashdan2020} & AoA, RSS, RMSE \\ \cline{3-6} & Gaussian \par Processes & Local trust zones \cite{Savic2015, Prasad2017, Prasad2018b, Kumar2016, Yu2018, Wang2021, Prasad2018} \par Sustainable develop. \cite{Homayounvala2019, Sun2018b} \par Mapping \cite{Zhao2018b, Yiu2017} & Indoor \cite{Homayounvala2019, Yiu2017, Kumar2016, Sun2018b, Yu2018} \par Outdoor \cite{Savic2015, Prasad2017, Prasad2018b, Wang2021, Prasad2018} & Sensors \cite{Homayounvala2019, Yiu2017, Kumar2016, Sun2018b} \par Radars \cite{Savic2015, Zhao2018b, Yu2018} \par mmWave/THz \cite{Prasad2017, Prasad2018b, Wang2021, Prasad2018} & ToA, RSS, RMSE \\ \cline{3-6} & Neural \par networks & Sustainable develop. \cite{Fang2019, Wu2019c, Wang2016b, Wang2015, Belmonte2019, Feng2019} \par Local trust zones \cite{Yang2019, Lee2018, Ge2019, Jaafar2018, Sobehy2019, Decurninge2018, Orabi2021, Gante2019, Comiter2017} \par Massive twinning \cite{Zhang2019c, Boudani2020} & Indoor \cite{Fang2019, Jaafar2018, Wang2016b, Wang2015, Zhang2019c, Sobehy2019, Belmonte2019, Feng2019} \par Outdoor \cite{Yang2019, Lee2018, Ge2019, Decurninge2018, Orabi2021, Gante2019, Comiter2017} & Sensors \cite{Fang2019, Wu2019c, Ge2019, Jaafar2018, Wang2016b, Wang2015, Zhang2019c, Belmonte2019, Feng2019, Sobehy2019} \par mmWave/THz \cite{Yang2019, Lee2018, Decurninge2018, Orabi2021, Gante2019, Comiter2017} & RSS, ToA, RMSE\\ \cline{3-6} & Autoencoders & Sustainable develop. \cite{Khatab2017, Kim2018, Song2019, Belmannoubi2019, Zhang2017, Yazdanian2018, Abbas2019} \par Local trust zones \cite{Wang2017} & Indoor \cite{Khatab2017, Kim2018, Song2019, Belmannoubi2019, Zhang2017, Wang2017, Yazdanian2018, Abbas2019} & Sensors \cite{Khatab2017, Kim2018, Song2019, Belmannoubi2019, Zhang2017, Yazdanian2018, Abbas2019} \par mmWave/THz \cite{Wang2017} & RSS, RMSE\\ \cline{3-6} & Convollutional \par NNs & Local trust zones \cite{Jang2018b, Ebuchi2019, Ibrahim2018, Soro2019, Chen2017, Wang2018, Jing2019, Li2019b, Wu2021, Vieira2017} \par Sustainable develop. \cite{Liu2019b, Hsieh2019, Huang2018, Bregar2018} \par Massive twinning \cite{Mittal2018, Niitsoo2019} & Indoor \cite{Jang2018b, Mittal2018, Liu2019b, Ibrahim2018, Soro2019, Chen2017, Wang2018, Jing2019, Li2019b, Hsieh2019, Huang2018, Bregar2018} \par Outdoor \cite{Ebuchi2019, Niitsoo2019, Wu2021, Vieira2017} & Sensors \cite{Jang2018b, Mittal2018, Liu2019b, Ibrahim2018, Soro2019, Chen2017, Wang2018, Jing2019, Li2019b, Hsieh2019, Huang2018, Bregar2018, Niitsoo2019} \par mmWave/THz \cite{Ebuchi2019, Wu2021, Vieira2017} & ToA, RSS \\ \cline{3-6} & Recurrent \par NNs & Local trust zones \cite{Turabieh2019, Zhang2019b, Wu2019b, Yu2020, Tarekegn2019} \par Sustainable develop. \cite{Canton2017, Rizk2019c, Rizk2019b, Chen2019b, Qian2019, Adege2019} \par & Indoor \cite{Turabieh2019, Canton2017, Rizk2019c, Rizk2019b, Chen2019b, Qian2019, Yu2020} \par Outdoor \cite{Zhang2019b, Wu2019b, Adege2019, Tarekegn2019} & Sensors \cite{Turabieh2019, Canton2017, Rizk2019c, Rizk2019b, Chen2019b, Qian2019, Zhang2019b, Adege2019} \par Radar \cite{Tarekegn2019, Yu2020} \par mmWave/THz \cite{Wu2019b} & RSS, RSME \\ \cline{3-6} & Unsupervised \par learning & Local trust zones \cite{Le2018, Zafari2019, Sikeridis2018, Guo2019, Saeed2016, Saeed2019} \par Massive twinning \cite{Choi2019, Choi2019b, Jang2018, Ye2018} \par Sustainable develop. \cite{Gao2017} & Indoor \cite{Le2018, Choi2019, Choi2019b, Zafari2019, Sikeridis2018, Guo2019, Saeed2016, Saeed2019} \par Outdoor \cite{Sikeridis2018} & Sensors \cite{Le2018, Zafari2019, Guo2019, Saeed2019, Choi2019, Choi2019b, Jang2018, Gao2017} \par mmWave/THz \cite{Sikeridis2018, Ye2018, Saeed2016} & ToA, RSS, RMSE\\ \cline{3-6} & Federated \par learning & Local trust zones \cite{Niknam2020, Chen2017b, Ciftler2020, Li2020, Nguyen2021, Liu2019c, Yin2020} & Indoor \cite{Niknam2020, Chen2017b, Ciftler2020, Li2020, Nguyen2021, Liu2019c, Yin2020} \par Outdoor \cite{Niknam2020, Chen2017b, Ciftler2020, Nguyen2021} & Sensors \cite{Chen2017b, Li2020, Nguyen2021, Liu2019c, Yin2020} \par mmWave/THz \cite{Niknam2020} & ToA, TDoA, AoA, RMSE\\ \cline{3-6} & Reinforcement \par Learning & Local trust zones \cite{Shao2018, Li2019, Dou2018, Peng2019} \par Mapping \cite{Mirama2021, Fahad2018} & Indoor \cite{Shao2018, Li2019, Dou2018, Peng2019} \par Outdoor \cite{Mirama2021, Li2019, Peng2019, Fahad2018} & Sensors \cite{Shao2018, Li2019, Dou2018, Peng2019} \par mmWave/THz \cite{Mirama2021, Fahad2018} & RMSE, RSS\\ \cline{3-6} & Transfer \par learning & Local trust zones \cite{De2020, Li2021, Zou2017, Zhou2017, Behera2020, Yoo2019, Lei2019} \par Sustainable develop. \cite{Xiao2018b, Liu2017, Zhang2018} \par Mapping \cite{Xu2020, Zhou2017b} & Indoor \cite{Li2021, Xiao2018b, Liu2017, Zou2017, Zhang2018, Xu2020, Zhou2017b, Behera2020, Yoo2019} \par Outdoor \cite{De2020, Lei2019} & Sensors \cite{Xiao2018b, Liu2017, Zou2017, Zhang2018, Xu2020, Zhou2017b, Behera2020, Yoo2019, Lei2019} \par Radar \cite{Li2021} \par mmWave/THz \cite{De2020} & AoD, AoA, RSS \\ \bottomrule \end{tabular} \end{table*} \section{Localization algorithms}\label{S:Methodologies} This section delves deeper into the various localization methodologies and algorithms that exist. Differentiating between the conventional and learning-based methods is selected for the following analysis. Learning-based methods refers to methods that use ML frameworks, hence NNs would fall under this umbrella. Keep in mind that distinguishing between the two may be challenging; thus, some of the publications described here might be categorized in multiple ways. Not only that, but fingerprint matching makes use of probabilistic approaches. As a result, due to the ambiguous position between ML and analytical solutions, they are categorized under the conventional methods umbrella. \subsection{Conventional}\label{Ss:Classical} This section provides an overview of conventional algorithms for deriving the location of a mobile node in the considered area. As also summarized in Table \ref{tab:localization_methods}, these methods include triangulation, Kalman filters, compressive sensing, multidimensional scaling, direct localization, swarm intelligence algorithms, and fingerprinting. \subsubsection{Triangulation}\label{Sss:Triangulation} \begin{figure} \centering\includegraphics[width=0.8\columnwidth]{figures/triangulation.eps} \caption{Triangulation architecture.} \label{fig:triangulation} \end{figure} Triangulation uses the AoA or AoD measurements of radio signals exchanged between the mobile node and the access points to estimate the location of a node at the intersection of lines through simple geometric relationships \cite{Laoudias2018}. A minimum of two access points is required to estimate a node's 2D coordinates. An indicative example of triangulation is shown in Fig. \ref{fig:triangulation}. The mobile node estimates the AoA measurements from three different access points, namely $\phi_1$, $\phi_2$, and $\phi_3$. Using these measurements and the known locations of the access points, the location coordinates of the mobile node can be obtained. The authors of \cite{Hanssens2016} presented a UWB triangulation scheme that leverages the geometrical properties of the propagation path based on the AoD, AoA, and ToA measurements. Ottoy and Strycker, in \cite{Ottoy2016}, developed a triangulation algorithm that autonomously selects the appropriate AoA measurements out of a set of possible values. In \cite{Kristalina2016}, the authors presented a geometric triangulation approach that leverages the AoA measurement between the mobile node and the anchor nodes. Moreover, Landstrom and Beek in \cite{Landstrom2016} proposed an approach for transmitter localization suitable for multipath mmWave 5G scenarios. The proposed approach combines stochastic ray-shooting with the triangulation concept, to provide accurate localization based on the path relations between the receivers and the TX. Tazawa et al., in \cite{Tazawa2016}, investigated the impact of extending the number of antenna elements on localization accuracy. In this respect, the triangulation technique is applied to the AoD and RSS measurements originating from multiple receivers. Steendam in \cite{Steendam2018} presented a 3D triangulation algorithm based on the maximum likelihood principle. Using the proposed iterative algorithm, each AoA estimate is updated based on the previous position estimate. A method that detects unreliable AoA measurements is presented in \cite{Yan2018}. The proposed method uses the characteristics of estimated locations of various nodes to detect unreliable nodes and mitigate localization error. Moreover, the authors of \cite{Soltanaghaei2018} presented a localization solution for WiFi wireless networks, which leverages multipath reflection for estimating a node's location with respect to the receiver. The proposed technique offers orientation information and decimeter-level localization based on the AoA, AoD, and ToF measurements. In \cite{Lee2020}, the authors presented a RSS-based indoor triangulation approach that employs the incoherent reception of the transmission from a node of unknown location by several identical indoor nodes. Also, the nodes are able to communicate with each other in order to construct an indoor propagation model. Adama and Asutkar, in \cite{Adama2021}, combined the weighted prediction and grey prediction algorithms in order to develop a triangulation approach for reducing the estimation error of unknown nodes and improving the positioning accuracy. The authors of \cite{Prateek2021} proposed a method consisting of a range-free approach for detecting symmetric triangulations, which, combined with semidefinite programming, can enhance localization accuracy. \subsubsection{Kalman filters}\label{Sss:KF} \begin{figure} \centering\includegraphics[width=0.9\columnwidth]{figures/Kalman.eps} \caption{Kalman filters architecture.} \label{Fig:Kalman} \end{figure} KF is a fundamental technique for the study of noisy or inaccurate measurements, offering a clear knowledge of how a signal evolves over time. The KF eliminates random noise before estimating the state of the monitored process over time. KFs are widely used in navigation, radar applications, and movement control. KF involves two steps: a) the prediction step, which projects the current state of the model and associated uncertainties into the subsequent time step; b) the update step, where the projection is adjusted by calculating the weighted average of the projected state and the measurements. KF-based methods estimate and fuse multiple approximations of an unknown value in order to generate an accurate approximation. In this respect, KFs are able to exploit the estimates from multiple anchor nodes in order to accurately obtain the location of a mobile node. The authors of \cite{Werner2015} presented an extended KF (EKF) method that tracks the location of a node based on the fusion of time of arrival (ToA) and direction of arrival (DoA) estimates. The simulation results showed that the joint Doa and ToA estimation outperforms the DoA-only estimation. In \cite{Yousefi2015}, the authors reported the use of an unscented KF (UKF) for the ToA-based localization of a mobile node in non-line-of-sight scenarios. The evaluation results revealed a high localization accuracy in presence of low-variance noise, making it suitable for high-resolution UWB localization. Moreover, Koivisto \textit{et al.} in \cite{Koivisto2016} documented two approaches based on EKF and UKF for 3D localization scenarios. The proposed approaches leverage a number of densely deployed anchor nodes that enable the fusion of DoA and ToA estimates. Based on the simulations, both methods can achieve sub-meter scale accuracy, with the EKF-based method slightly outperforming the UFK-based one. Similarly, a two-stage cascaded EKF method for mmWave localization scenarios is adopted in \cite{Rastorgueva2018}. In the first stage, the direction of departure (DoD) is estimated at each anchor node, whereas in the second stage, all DoD estimates are fused into the final 3D location estimates. In \cite{Koivisto2017}, the authors presented a cascaded EKF-based solution to track the DoA and ToA of various devices. In more detail, the first EKF is employed to generate the individual DoA and ToA estimates from the anchor nodes based on the reference signals, whereas the second EKF is employed to fuse the DoA and ToA estimates from multiple anchor nodes. Furthermore, Bai \textit{et al.} in~\cite{Bai2019} develop an UKF-based algorithm for obtaining the 2D coordinates of a mobile node that exploits the packet loss errors to estimate and improve the localization accuracy. The simulation results indicate an average localization error of 0.39m when the packet loss rate is lower than 90\%. Moreover, Kanhere and Rappaport in \cite{Kanhere2021} leverage an EKF to combine the DOA and time of flight (ToF) from multipath components in LoS and NLoS environments. The respective experimental results report an average error of 24.8 cm at 140 GHz. Finally, the authors of \cite{Ammous2022} consider a mmWave localization scenario involving a base station and a RIS and design an EKF-based approach to obtain the location of a node using the time-difference of arrival (TDOA) and round trip time (RTT) measurements. \subsubsection{Compressive Sensing}\label{Sss:CS} \begin{figure} \centering\includegraphics[width=1\columnwidth]{figures/Compressive_sensing.eps} \caption{Compressive sensing architecture.} \label{Fig:Compressive_sensing} \end{figure} Compressive sensing (CS) theory, as illustrated in Fig.~\ref{Fig:Compressive_sensing}, provides a novel framework for recovering sparse signals under a certain basis, with a significantly lower number of samples compared to conventional methods (e.g., the Nyquist theorem) \cite{Donoho2006, Candes2008}. Nonetheless, the acquisition of the original signal requires a time-consuming or expensive process, which appears futile as, during compression, the vast majority of the recovered information is discarded. CS provides and alternative procedure, which by acquiring only the required linear and non-adaptive measurements it is possible to obtain a compressed form of the signal directly. As a result, even with fast recovery techniques, CS predicts the reconstructed signal from severely under-sampled non-adaptive data adequately and can be employed to recover various estimates, such as TDOA, RSS, AoA, from the signals using fewer signal samples. An approach for estimating the TDOA using CS theory was presented in \cite{Cao2017}. Specifically, the approach utilizes the discrete Fourier transform and a maximum likelihood estimator for obtaining accurate TDOA estimates. In \cite{Ramadan2017}, the authors presented an indoor localization approach based on the received signal strength (RSS) obtained CS processing. Additionally, the authors of \cite{Abdelreheem2018} designed a multi-level beamforming technique for LoS mmWave links, which leverages CS theory to estimate the signal AoD. An approach for deriving the 2D location coordinates in a VLC environment was presented in \cite{Gligoric2018}. In particular, CS was employed to obtain the location estimates from multiple overlapping light beams. Furthermore, Salari \textit{et al.}, in \cite{Salari2018}, documented a CS-based approach for obtaining TDOA estimates, which requires a limited number of signal samples, leading to a significantly lower computational complexity. A CS-aided MIMO scheme for aerial scenarios was reported in~\cite{Harlakin2021}. In more detail, the authors combined MIMO techniques for 2D antenna arrays and CS-based DoA estimation for 3D target tracking. An aerial scenario leveraging CS theory was also investigated in \cite{Jiang2021} and \cite{Jiang2021b}. The Bayesian CS approach was applied to estimate ground node locations using RSS samples collected by the UAV sensors. Particularly, in \cite{Jiang2021}, a trajectory optimization method was employed to minimize the errors of CS-based location estimation, whereas, in \cite{Jiang2021b}, the Bayesian CS-based approach was enhanced using an a priori knowledge-aided algorithm. \subsubsection{Multidimensional Scaling}\label{Sss:MDS} Multidimensional scaling (MDS) is a mathematical approach for classification and visualization of high-dimensional data. MDS is applied on a matrix formed by the distances between nodes and, for each node, it generates a vector of coordinates in the Euclidean space \cite{Seco2018}. Consequently, MDS is widely utilized in localization problems, in which several nodes have to estimate their relative locations from the measured distances between themselves. Assuming a network consisting of a number of anchor nodes and $N$ mobile nodes, let $\mathbf{D}$ denote the $N \times N$ distance matrix \begin{equation} \mathbf{D}= \begin{bmatrix} 0 & d_{1,2}^2 & d_{1,3}^2 & ...& d_{1,N}^2\\ d_{2,1}^2 & 0 & d_{2,3}^2& ... & d_{1,N}^2\\ d_{3,1}^2 & d_{3,1}^2 & 0 & ... & d_{3,N}^2\\ \multicolumn{5}{c}{$\vdots$} \\ d_{N,1}^2 & d_{N,2}^2 & d_{N,3}^2 & ... & 0\\ \end{bmatrix}, \end{equation} where $d_{i,j}$ stands for the shortest distance between the $i$-th and $j$-th mobile nodes. Classical all-pairs shortest-path algorithms, such as the Floyd–Warshall or Dijkstra algorithms, can be used for obtaining the distances. The rank of $\mathbf{D}$ can be reduced by double centering as \begin{equation} \mathbf{C}=-\frac{1}{2}\mathbf{J}\,\mathbf{D}\,\mathbf{J}, \end{equation} where \begin{equation} \mathbf{J}=\mathbf{I}-\frac{1}{N}\mathbf{e}\mathbf{e}^\intercal, \end{equation} $\mathbf{I}$ is the $N \times N$ identity matrix, $\mathbf{e}$ is a column vector of length $N$ with all elements equal to 1, and $\intercal$ is the matrix transpose operator. Additionally, \begin{align} \mathbf{C}\simeq\mathbf{X}\,\mathbf{X}^\intercal, \end{align} where $\mathbf{X}$ is a $N \times 2$ matrix with each nodes' coordinates translated so as the centroid of the network is at $(0,0)$. Therefore, the matrix containing the relative node locations can be estimated by minimizing the following formula: \begin{equation}\label{eq:mds_func} \hat{\mathbf{X}}_{\text{MDS}}=\argmin_x \|\mathbf{C}-\mathbf{X}\mathbf{X}^\intercal\|^2. \end{equation} Eigenvalue decomposition can be applied for solving \eqref{eq:mds_func} as \begin{equation} \mathbf{C}=\mathbf{V}\mathbf{\Lambda} \mathbf{V}^\intercal, \end{equation} where $\mathbf{V}$ stands for the eigenvector matrix and \begin{align} \mathbf{\Lambda}=\rm{diag}(\lambda_1, \lambda_2, ..., \lambda_N) , \end{align} stands for the respective eigenvalue matrix. Since $\mathbf{C}$ is positive-definite and symmetric, and \begin{align} \rm{rank}(\mathbf{C})\leq 2 , \end{align} it can be represented by its two largest eigenvalues. Consequently, \begin{align} \mathbf{C}\simeq\mathbf{V}_s\mathbf{\Lambda}_s\mathbf{V}_s , \end{align} and the solution to \eqref{eq:mds_func} can be obtained as \begin{equation} \hat{\mathbf{X}}^{\rm{signal}}_{MDS}=\mathbf{V}_s\mathbf{\Lambda}_s^{1/2}, \end{equation} with $\mathbf{\Lambda}_s^{1/2}$ is a diagonal matrix with the two largest eigenvalues. Of note, the obtained position estimate is not referred to any particular reference system, and will be, in general, rotated, translated, and reflected from the physical node arrangement. Therefore, the actual mobile node locations can be derived by the known positions of the anchor nodes. MDS-based localization offers two significant advantages; the approach is robust to individual error ranges, provided that there exists data redundancy in the square distance matrix. Also, it provides a closed-form localization estimate, regardless of network size. The authors of \cite{Oliveira2014} designed a relative localization algorithm for obtaining the inverse of the distance between any pair of communicating nodes, based on the RSS metric using MDS, and deriving the network topology. Aiming to solve the geometrical uncertainties imposed by the conventional MDS algorithm, an enhanced MDS algorithm was presented in \cite{Franco2015}. In \cite{Saeed2015}, Saeed and Nam combined MDS and Procrustes analysis to develop a two-phase localization algorithm for cognitive networks. Specifically, an approximated distance-based approach is employed to maximize the accuracy based on the nodes' proximity information available in the network. The authors of \cite{Chaurasiya2014} designed a MDS-based 3D localization algorithm that aims to reduce communication and computational overheads towards minimizing energy consumption. In \cite{Cui2016}, Cui \textit{et al.} introduces a 3D localization algorithm that is based on the combination of polynomial data fitting and MDS. The algorithm is able to achieve high localization accuracy without requiring information about the channel noise and the node movement model. Moreover, Jiang \textit{et al.} in \cite{Jiang2016} presented a solution for finding a node's 2D coordinates through the TDOA measurements by minimizing the MDS-based cost function. A similar approach was presented in \cite{Kumar2016b}, in which the authors introduce an approach that integrates the relative velocity information, available via Doppler shift measurements between mobile nodes, into the MDS cost function. Furthermore, a low-complexity majorization algorithm was leveraged to minimize the MDS cost function. Morral and Bianchi in \cite{Morral2016} reported a distributed algorithm for node self-localization in WSNs based on sporadic measurements of the RSS metric. The nodes' positions can be recovered from the principal components of the similarity matrix which is constructed from the squared inter-nodes distances. The authors of \cite{Stojkoska2017} designed an indoor UAV localization algorithm that is based on distance measurements between the access points and the UAV. The distance measurements are derived through the RSS samples, while two different localization techniques are utilized, namely the MDS and the weighted centroid localization. In \cite{Fan2020b}, Fan \textit{et al.} a combination of fast-clustering and MDS is presented for 2D localization in mobile networks. In more detail, in the inner-cluster relative localization stage, the advantages of combining classical MDS and iterative MDS are leveraged, while in the inter-cluster coordinate registration stage, the least squares method is used to reduce the registration error. In~\cite{Fan2021}, the authors presented a cooperative 3D localization algorithm based on filtering and MDS techniques, which are employed to mitigate any abnormal measurements due to errors. \subsubsection{Direct Localization}\label{Sss:DirectLocalization} In the aforementioned approaches, the location of a node is estimated by various parameters such as the AoA, AoD, TDOA, and ToA. An alternative approach to addressing localization challenges is direct localization \cite{Weiss2004}. In direct localization, the source's location is estimated straight from the data, with no need to estimate any intermediate parameters, like the AoAs or others. Specifically, the echo signals from all node pairs are accumulated and the target location is extracted directly. To achieve this, signals, or some function thereof, must be sent to a fusion centre that makes location estimations. The fusion operation is carried out on the signal level, resulting in less computational overhead and, therefore, improved performance. Such a topology is often simpler to implement in scenarios, where reduced distances are involved. However, for cellular networks, cloud radio access networks (C-RAN) is expected to provide the necessary backbone as BSs forward incoming signals to a centralised unit that performs the baseband processing~\cite{Hossain2019b}. In~\cite{Garcia2017}, the authors presented a direct source localization approach based on AoA and ToA estimates, which determines the source location by jointly processing data snapshots acquired at each BS. Moreover, the authors of~\cite{Yin2017} developed a single-step direct localization algorithm for obtaining the location of multiple stationary nodes by combining AoA and Doppler information. The numerical results indicate that the proposed direct localization algorithm can attain the corresponding Cramer-Rao constraint. A direct passive localization method that jointly exploits the AoA and TDOA information was presented in~\cite{Chen2018}. By exploiting spatio-temporal processing, the proposed method did not require prior knowledge about the number of source nodes. Han \textit{et al.} in~\cite{Han2019} reported a joint near-field and far-field direct localization approach for massive MIMO environments. Specifically, the approach uses the AoA measurements and divides the BSs into far-field and near-field ones to mitigate localization errors. The authors of \cite{Ma2019} developed a TDOA-based direct localization approach under the assumption that multiple nodes work with independent clocks. The approach leverages an expectation-maximization (EM) algorithm and a Gauss-Newton algorithm for coarse and refined parameter estimation, respectively. Moreover, in~\cite{Zhao2020}, the authors presented a framework for direct localization comprised of beamspace design and position determination. In addition, they derived the respective beamspace direct localization performance bound and present a localization algorithm with low computational complexity and communication overhead. A direct localization approach that leverages random spatial spectrum was presented in~\cite{Xia2021}. According to the approach of~\cite{Xia2021}, the co-channel signals were transformed into the spatial spectrum, enabling the suppression of multipath components. Moreover, a spatial sparse clustering algorithm was utilized to distinguish the nodes in the spatial domain. In~\cite{Yu2021}, the authors developed a factor graph-based approach for direct localization in distributed MIMO radar environments. A graph representation was carefully designed for the direct localization problem, which was solved efficiently through message passing based on expectation propagation and belief propagation. Finally, Bai \textit{et al.} in \cite{Bai2022} presented a direct localization algorithm for multipath orthogonal frequency division multiplexing (OFDM) environments. The algorithm utilizes the data observed by multiple nodes and estimatest the source node in one step by exploiting the orthogonality between the noise subspace and the array response vector. \subsubsection{Swarm Intelligence}\label{Ss:SI} Swarm intelligence is a subset of algorithms that studies group dynamics, where most approaches take inspiration from the social behaviours of animals, including bees, birds, ants, and others. Complex patterns often form through the coordination of the activities of multiple entities that are relatively unsophisticated in their mode of operation. All swarm intelligence-based approaches use a search strategy based on the dichotomy and interplay of two conventional procedures, namely exploration and exploitation~\cite{Nedjah2020}. The goal of exploration is to increase the fraction of the search space that has been uncovered and, hence, reduced to workable solutions. The term ``exploitation'' refers to the swarm's effort to enhance the quality of previously found solutions by increasing the intensity of its search efforts in the area around those solutions. In \cite{Daely2016} and \cite{Arsic2016}, the authors respectively utilized the dragonfly and fireworks algorithms for estimating the node locations that were randomly deployed in a specific area. The authors of \cite{Kulkarni2016} presented a multi-stage localization method that leverages the artificial bee colony algorithm. Moreover, they compared the proposed method against the particle swarm optimization in terms of localization accuracy, number of nodes, and computation time. Monica and Ferrari in \cite{Monica2016} investigated the problem of UWB indoor localization in WSNs by employing the particle swarm optimization algorithm. A two-stage WSN localization approach based on the firefly algorithm is proposed in \cite{Tuba2018}. In the first stage, four anchor nodes, that were placed at the area edges, were considered, whereas, in the second stage, the closest anchor nodes are considered. Furthermore, the authors of \cite{Strumberger2018} utilized the monarch butterfly optimization algorithm for addressing the localization problem in WSNs. Also, the same authors in \cite{Strumberger2018b} presented an adaptation of the hybridized moth search algorithm for solving the node localization problem and compared it against alternative state-of-art algorithms. Singh \textit{et al.} in \cite{Singh2018} focused on the 2D localization problem and compared the performance of four swarm intelligence algorithms, namely the biogeography-based optimization, the firefly algorithm, the particle swarm optimization, and the H-best particle swarm optimization algorithms. Moreover, in \cite{Phoemphon2018}, the authors introduced a fuzzy logic model for localization in WSNs. Towards increasing the efficiency of the model, the concept of resultant force vectors is applied, while the particle swarm optimization algorithm is employed to minimize the irregular deployment effects. The authors of \cite{Kulkarni2019} utilized the firefly algorithm and the artificial bee colony algorithm for approximating the distance of a mobile node from the anchor nodes. Also, a comparison between the two algorithms in terms of computation time and localization accuracy is presented. Similarly, in \cite{Strumberger2019}, the authors investigated the performance of two swarm intelligence algorithms, namely the elephant herd optimization and tree growth algorithms, with respect to solving the localization problem in WSN environments. In \cite{Arafat2019}, Arafat and Moh utilized the particle swarm optimization algorithm for the localization of UAV nodes. To increase the convergence speed of the algorithm, the boundary box technique is leveraged, leading to smaller initial search space. Akram \textit{et al.} in \cite{Akram2021} presented an adaptation of the multi-objective particle swarm optimization algorithm for jointly maximizing the number of localized nodes and minimizing the energy consumption and computation time.Finally, in \cite{Nedjah2020}, the authors compared three swarm intelligence algorithms, namely the firefly algorithm, the artificial bee colony algorithm, and the particle swarm optimization algorithm, in SLAM scenarios. \subsubsection{Fingerprinting}\label{Sss:Fingerprinting} The fundamental idea behind fingerprinting is to estimate the mobile node location by comparing the received signal fingerprint to a database of known signal locations that have already been recorded \cite{Vo2016}. The database of signal fingerprints has to be generated in advance. Consequently, fingerprinting consists of two phases, namely the populating or training phase and the matching phase. In the first phase, the area of interest is explored to create a signal map, whereas, in the second phase, the node location is estimated by comparing the current fingerprint signal with the fingerprints database. Various metrics can be used for generating the signal fingerprint database during the training phase. For instance, using the reference RSS, denoted by $\rm{RSS}_{\rm{R}}$, the $(x,y)$ coordinates of a node can be expressed as \begin{equation} \mathbf{F}(x,y)= [\rm{RSS}_{\rm{R}}(1), \rm{RSS}_{\rm{R}}(2), ..., \rm{RSS}_{\rm{R}}(N)], \end{equation} where $N$ is the number of access points. For the matching phase, an Euclidean distance matching method can be leveraged. The method calculates the Euclidean distances between the measured signal fingerprint, denoted by $\rm{RSS}_{\rm{M}}$, and each reference location in the database as follows: \begin{equation}\label{eq:fingerprint_distance} D=\sqrt{\sum_{j=1}^N\left(RSS_{\rm{R}}(j)-RSS_{M}(j)\right)^2} \end{equation} Finally, a nearest neighbor algorithm can be used for finding the closest fingerprint based on \eqref{eq:fingerprint_distance}. Zhou \textit{et al.} in \cite{Zhou2015} and \cite{Zhou2015b} investigated the correlation between the access point deployment and the localization precision based on the RSS and designed a simulated annealing algorithm for optimizing the access point positions. The authors of \cite{He2016} designed an approach that automatically updates the fingerprint database by employing a clustering algorithm to filter out the altered signals to achieve high localization accuracy. Using the observed signals and the calculated location of a node, the fingerprint database is constantly updated without manual intervention. In \cite{Souza2016}, the authors combined RSS-based fingerprinting with context-aware data regarding the node's environment (i.e., building floor plan) and demonstrated that the proposed method can reduce the required access point number and mitigate the effects of wireless interference. The authors of \cite{Li2016} developed a collaboration-based fingerprinting approach, in which several assistant nodes around an unknown node are selected, based on the RSS sequences similarity, and distances between them are used as auxiliary information to improve the positioning accuracy. Moreover, Chen \textit{et al.} in \cite{Chen2016b} designed a cooperative fingerprinting approach that takes into consideration the physical constraint of pairwise distances to refine and improve the estimated positions of multiple nodes, thereby increasing the robustness against outdated database entries and distance errors. In \cite{Zhang2017c}, the authors proposed a fingerprint localization method based on the path-loss measurement for the training and matching phase. The two-step method consists of a path-loss-based fingerprinting scheme, which aims to improve precision, and a dual-scanned fingerprinting that guarantees localization robustness. A crowdsourcing method for indoor fingerprinting-based localization is proposed in \cite{Zhou2017d}. The method leverages the RSS data collected from multiple smartphones and generates the database of fingerprints. A similar method is presented in \cite{Pecoraro2018}. Specifically, the method aims to improve localization accuracy by generating the fingerprint database using the channel frequency response, which can be obtained from the CSI. In \cite{Duan2019}, the authors designed a fingerprinting scheme based on the achieved data rates, which can be directly obtained by the access points. To mitigate data rate fluctuations, the scheme employs a time-window mechanism that takes into account multiple access points and various transmission power levels. In \cite{Moghtadaiee2019}, the authors developed a fingerprinting method that integrates information about the signal propagation effects and architecture of an indoor area to generate fingerprints using a low number of RSS measurements. Li \textit{et al.} \cite{Li2019c} proposed a crowdsourcing fingerprinting approach that integrates wireless, inertial. Also, they defined the fingerprinting accuracy indicators and assessed their performance in predicting location estimation errors and outliers. In \cite{Zhang2019fing}, the authors introduced a phase decomposition method to calculate the multipath phase and apply principal component analysis to derive the fingerprint based on the CSI. The authors of \cite{Gao2021} developed a fingerprinting prototype that eavesdrops on smartphone signals in order to acquire the CSI. Furthermore, it employs a joint outlier detection and clustering approach to detect signal changes. Finally, Shen \textit{et al.} in \cite{Shen2021} proposed a fingerprint training scheme that leverages information entropy theory and maximum likelihood estimation. The scheme uses uplink channels to extract the link states and the AoA measurements and applies a weighted mean square error algorithm to estimate the node location. \subsubsection{Simultaneous localization and mapping}\label{Sss:SLAM} The challenge that simultaneous localization and mapping (SLAM) is tasked with solving is building a map of a moving agent's surroundings, alongside estimating its trajectory. Due to its pivotal role in the development of autonomous robots, SLAM has attracted a lot of attention from the research community during the last couple of decades. In simultaneous localization and mapping (SLAM), the map, which can be found in various formats, such as occupancy grid, point cloud, and more, serves as the model of the physical world, while its estimate is entangled with the inference of the robot's trajectory. Building a consistent representation of the world requires collecting data from a wide range of sources, regardless of the shape that representation takes. For the purpose of analysing the connections between the available data, they are split into data frames, each of which can be anything from a collection of laser range scan to a series of photographs. The collection of such data frames presents an additional difficulty in that the obtained measurements are always realtive to the ``uncertain'' location of the mobile entity that captures them. Schlegel \textit{et al.} in \cite{Schlegel2018} presented an open source SLAM system that uses localization and image processing techniques to generate a virtual 3D map. Four processes were employed for map generation, namely image-based triangulation, motion estimation, pose-graph-based map management, and relocalization. A radar-based SLAM method was presented in \cite{Holder2019}. The method constructs a map from radar measurements combining the pose graph and the iterative closes point algorithm for matching the scans. Also, GNSS information is leveraged to improve localization accuracy. The authors of \cite{Cui2020} reported a SLAM method for autonomous underwater vehicles. The method utilizes simulated annealing and applies an EKF on the depth, compass, and acoustic sensor measurements. Rodriguez \textit{et al.} in \cite{Rodriguez2018} emphasized the criticality of the accurate representation and quantification of uncertainties to correctly report the associated confidence of the robot's location estimate in every step of the SLAM process. In \cite{Lin2019}, the authors developed an intelligent filter-based SLAM approach for enhancing the localization performance of mobile robots. The proposed approach can be also applied to underwater and aerial scenarios using the appropriate radar-based measurements. In \cite{Chen2020b}, the authors investigated the relations among the graphical structure of pose-graph SLAM, Fisher information matrix (FIM), Cramer Rao lower bound, and the optimal design metrics. A SLAM framework that employs light detection and ranging (LIDAR) and image processing techniques for localization was presented in \cite{Wang2021b}. The framework considers both light intensity information and geometry information to improve localization accuracy. Chen \textit{et al.} in \cite{Chen2021b} presented an active SLAM algorithm for mobile robots able to derive a collision-free trajectory. The algorithm is based on a predictive control framework that leverages graph topology that approximates the uncertainty minimization problem as a constrained non-linear least squares problem. After applying convex relaxation to the original problem, a convex optimization algorithm and a rounding process based on singular value decomposition are employed for solving the problem. \subsection{Supervised learning}\label{Ss:Supervised} This section examines contributions that use supervised learning based ML methodologies for tackling the localization problem. In more detail, these techniques discussed entail both traditional ML approaches, such as kNN, SVM, decision trees, and Gaussian processes, and DL based ones, like NNs, autoencoders, CNNs, and RNNs. \subsubsection{K-nearest neighbors}\label{Sss:kNN} \begin{figure} \centering\includegraphics[width=1\columnwidth]{figures/kNN.eps} \caption{kNN architecture.} \label{Fig:kNN} \end{figure} With k-nearest neighbors (kNN), the average position of the k-nearest fixed network nodes from the fingerprint database is used to estimate the target's coordinate. In the localization process as presented in~Fig.~\ref{Fig:kNN}, the selected region is where the majority of the k-neighbors are placed. The label for an observed point in an $M$-class classification issue can be provided by \begin{align} \hat{y}_o=\max _c \sum_{i \in \mathcal{K}_o} \mathbb{1}\left(y_i=c\right) , \end{align} where $\mathbb{1}\left(y_i=c\right)$ is equal to unity in the case of the $i$-th neighbor's label is equal to $c$, while $\mathcal{K}_o$ denotes the neighbors of the observed data point. Using the available data and background information, we can determine an appropriate value for the design parameter $k$ and specify the set of individuals who qualify as ``neighbors''. As a result the kNNs can be selected based on a variety of criteria, including the Euclidean distance between locations, which can be expressed~as \begin{align} d\left(\boldsymbol{x}_i, \boldsymbol{x}_0\right)=\sqrt{\sum_{k=1}^N\left|x_{i, k}-x_{0, k}\right|^2} , \end{align} with $x_{i, k}$ denoting the measurement between the $i$-th mobile and the $k$-th fixed network node, while $N$ represents the total number of mobile nodes. It is important to remember that kNN is a non-parametric model. The new labels are derived by comparing the fresh observations to the training examples, hence it is in the same category as instance-based learning. Several cutting-edge ML systems use weighted kNN as a last-ditch effort to forecast the location, with varying proposals on how to define the ``distance'' between fingerprints and weights. Weighted kNN uses kNN as a fusing method, but assigns different weights to the positions of the k-nearest neighbors before averaging them. Moreover, kernel functions and euclidean distance are examples of methods that may be used to compute the distances and weights, respectively. In addition, kNN has been taken into consideration in various localization methods, notably fingerprint based localization, because of its low computational cost and straightforward structure. Methods for building fingerprint databases, for adaptively choosing k, and for generating meaningful similarity metrics have all been the subject of studies pertaining to kNN. Finally, various features have also been employed in kNN. The authors of~\cite{Alhajri2019} developed a kNN-based cascading localization system, whereby a kNN is first used to identify the environment, and then a kNN is used to localization using a variety of characteristics. They demonstrate that hybrid features outperform RSS alone in a variety of settings and highlight the relevance of doing so. The gathered RSS data are then used to build the radio map, an early example of this method. When the localization step takes place online, the online RSS measurement from the three indoor fixed nodes is compared to the previously stored RSS dataset. Typically, the Euclidean distance is used for the comparison. However, considerable localization estimate errors may occur when employing a fixed k value, as is the case with the typical kNN, if the network nodes are moved or the RSS value changes. Several papers have investigated tweaks to kNN as a potential solution to this problem, with a number of techniques being available, including adjusting the similarity metric~\cite{Peng2016b, Wang2019b}, and sub-selecting a subset of the kNN~\cite{Guo2018, Wang2019b}. For instance, the method in~\cite{Wang2019b} clusters the k-nearest fixed network nodes and then uses their mean in the "delegate" cluster to determine the final location. Both the Euclidean distance and the cosine similarity are proposed as similarity metrics and used to build the weights for a weighted kNN in the work cited in~\cite{Peng2016b}. Lastly, the crowd-sourced indoor localization technique in~\cite{Chen2016} uses a smartphone's orientation sensor and an optical camera to pinpoint a user's precise location within a building. In this approach, a crude estimate of the position is derived via kNN over RSS from WiFi, speeding up the search space of image-based localization, which may be further limited by information from orientation sensors. Another feature that has been employed for the kNN algorithm is the AoA. For example, in~\cite{Sun2018}, AoA is used to pick a subset of k fixed network nodes in a massive-MIMO OFDM system. However, the channel observations are numerous and computationally intensive to store and sort through. To this end, a sparse channel representation based on the angle-delay domain that allows for effective compression has been proposed for database development. It employs two tiers of fingerprint clustering and categorization in order to search across multiple fingerprints. A combined angle and delay similarity measure, which is dependent on the amount of overlap between the scatterers, is suggested to quantify the channel observation-fingerprints similarity. Finally, a weighted kNN is used to accomplish localization based on ToA, AoA, and the corresponding weights. In this respect, localization is achieved by minimizing the Euclidean distance between the features, while the representation of the angle-delay domain is created by applying a fast method to retrieve the fixed network nodes and compressing the database~\cite{Wang2019c}. \subsubsection{Support vector machine}\label{Sss:SVM} \begin{figure} \centering\includegraphics[width=1\columnwidth]{figures/SVM.eps} \caption{SVM architecture.} \label{Fig:SVM} \end{figure} The support vector machine (SVM) is a very potent ML kernel based algorithm. Similarity between vectors may be captured by a kernel function, which can be included into instant based learning approaches. Intuitively, the distance between two vectors may be used to represent their similarity to one another. One such kernel is the radial basis function (RBF), which changes as one moves further away and is used in the Gaussian Kernel. Other kernel are sigmoid, polymonial, and linear ones. The kernel function seeks to identify the optimal hyperplane for classifying entities. Specifically, the hyperplane is selected to increase the gap between the groups. The kernels provide an efficient means of locating the product of observed features and training sessions in higher dimensional spaces, which can improve the features' distinguishability. A high-level illustration of the aforementioned SVM method is presented in~Fig.~\ref{Fig:SVM}. Other characteristics have been applied to SVM with various kernel approaches. Using Gaussian kernel ridge regression, the authors of~\cite{Zhang2018b} presented a localization approach based on RSS and ToA. Of note, in order to avoid being affected by measurement timing and random synchronization mistakes, the method suggested in~\cite{Li2017} employs ToA as fingerprints and is based on the Gaussian Kernel. Moreover, the energy decay time is only one example of characteristics that may be extracted from the channel impulse response and used as part of a UWB localization system~\cite{Kram2019}. The goal is to reduce the size of the impulsive response while still capturing relevant environmental information. For hierarchical area classification, the features are sent to a support vector machine algorithm. Using CSI from multiple sub-carriers, the authors of~\cite{Wu2018} built a visibility graph to capture frequency correlations between neighboring sub-carriers for SVM-based localization. next, in~\cite{Wu2019d}, the authors documented an SVM and kernel regression based method for localizing and recognizing activities based on CSI. In this approach, SVM performs classification of the target into an activity class while localization is accomplished by a regression model. Based on the CSI of a MIMO system,~\cite{Sanam2018} was able to gather CSI and transmit it to a centralized server in a device-free localization system. Finally, in~\cite{Mahfouz2015}, localization using an accelerometer and RSS was employed in WSN target tracking; the RSS based kernel approach produces a coarse position estimate, which is then passed along with the accelerometer measurements to a Kalman filter that performs instantaneous localization. Localization has seen widespread use of SVM with a great variety of kernel approaches. Applying SVM in WSN localization for a small number of sensors with known positions was one of the first research efforts that use kernel-based localization~\cite{Burghal2020}. The RSS between different sensors is used in SVM trained with a Gaussian kernel to classify the area. At last, more precise coordinates are calculated by averaging the sensors' respective area centers. For indoor mobile phone positioning using RSS,~\cite{Petric2019} employed Gaussian and linear kernels. Another approach combined SVM with a radial basis function (RBF) kernel and PCA to perform localization~\cite{Zhang2017b}, while the authors of~\cite{Rezgui2017} offered a strategy to handle the devices' variety by first ranking the RSSs only from trustworthy fixed nodes and then using SVM to categorize the desired location. To reduce the number of correlated fixed network nodes,~\cite{Khalajmehrabadi2017} presented using real-time node selection. Then, it uses a kernel to assign weights with regard to the similarity between fixed nodes and the corresponding RSS values; based on the assigned weights it estimates the location. The localization problem is very sensitive to the choice of kernel. To better capture the connection between the coordinates before localization and the RSS space, kernel canonical correlation analysis is presented, where the Matern kernel is utilized for the physical space and the Gaussian kernel is used for the signal space~\cite{Wang2016c}. To account for the training set's spatial organization, a kernel that takes use of any potential connection between the coordinates has been proposed~\cite{Guo2019}. According to~\cite{Yan2017}, a hybrid kernel consists of two separate kernels: a global and a local kernel that together account for the influence of both nearby and far-off fixed network nodes. In~\cite{Yang2018}, Import vector machine (IVM) was employed for NLOS classification for ToA-based ranging in UWB systems; however, the authors noted that an ISM has less complexity and offers a greater classification probability. Other facets of localization had also made use of kernel approaches, such as a SVM for estimating range errors with regard to CSI in an UWB system and an SVM for recognizing poses, which is subsequently utilized to find a good match with fixed network node~\cite{Zhang2019d}. Prior to utilizing particle filters for location determination,~\cite{Ray2016} classified spaces as indoor or outdoor. Using SVR to recreate the RSS values of the unselected fixed nodes,~\cite{Cheng2016} improves the localization process's resilience against noise by proposing a method for classification and node selection. \subsubsection{Decision trees}\label{Sss:Trees} \begin{figure} \centering\includegraphics[width=0.9\columnwidth]{figures/Trees.eps} \caption{Decision trees architecture.} \label{Fig:Trees} \end{figure} Rule sets for categorizing data are commonly derived via decision trees, which do so by segmenting the space of possible labels and possible observations. Specifically, Fig.~\ref{Fig:Trees} outlines a our two-stage positioning approach that makes use of various weighted decision trees. During the first stage (training), data is gathered to create a database known as the radio map. For $R$ reference and $A$ access nodes, $N$ location and $\theta$ direction measurements per node, the radio map can be expressed as in~\cite{Sanchez2015} \begin{align} \Psi^\theta=\left(\begin{array}{cccc} \varphi_{1,1}^\theta[\tau] & \varphi_{1,2}^\theta[\tau] & \cdots & \varphi_{1, R}^\theta[\tau] \\ \varphi_{2,1}^\theta[\tau] & \varphi_{2,2}^\theta[\tau] & \cdots & \varphi_{2, R}^\theta[\tau] \\ \vdots & \vdots & \ddots & \vdots \\ \varphi_{A, 1}^\theta[\tau] & \varphi_{A, 2}^\theta[\tau] & \cdots & \varphi_{A, R}^\theta[\tau] \end{array}\right) . \end{align} This data is comprised of location and direction measurements from fixed nodes. The ensemble model is constructed using this dataset. In the second stage, which is called testing, the mobile nodes make localization requests utilizing online measurements. In more detail, inputs such as online measurements from the fixed nodes are used to estimate the mobile node's location, which can be represented as \begin{align} \Psi_r^\theta=\left(\begin{array}{c} \varphi_{1,r}^\theta[q] \\ \varphi_{2,r}^\theta[q] \\ \vdots \\ \varphi_{A,r}^\theta[q] \end{array}\right) , \end{align} with $r$ denoting the mobile node's location. Both the localization system's accuracy and the time required to construct and assess the ensemble model are affected by the dataset's size. Moreover, a variety of localization issues, such as localization based on fixed node selection and clustering, coordinate prediction, and LOS identification, have benefited from the use of decision trees~\cite{Ahmadi2015, Musa2019}. Many of the articles, however, resort to extensive use of decision trees to solve the difficulties at hand or apply them to relatively straightforward categorization issues. The employment of numerous learning solutions to arrive at the final solution has been demonstrated to deliver outstanding performance even when constructed as an ensemble of fundamental ML solutions, such as decision trees. Adaptive and gradient boosting are two ensemble learning approaches that have been extensively applied~\cite{Chen2019c, Apostolo2019, Zhang2019e}. When the RSS distance is not indicative of the actual physical separation between two points,~\cite{Chen2019c} provided a fingerprinting approach that uses gradient boosting to convert raw RSS into features using a learnt non-linear mapping function. The main idea is to first build negative and positive pairs of fixed nodes and afterwards develop a loss function to guarantee that the similarity is maintained between them. Finally, after training the mapping function, weighted kNN was used with the revised mapping function to carry out the localization. On the other hand, adaptive boosting was used for passive localization in~\cite{Zhang2019e}, where phase information from CSI was employed to build a fingerprint map. This method iteratively refines the sample weights of the training sets in order to facilitate classification. The best four anticipated nodes' positions are weighted equally to provide a final location estimate. Another of the most prominent approaches of ensemble learning is random forest (RaF), which uses a forest of decision trees to make a prediction. For instance,~\cite{De2019} employed classification-based localization with multi-path information and a RaF to obtain the TDoA through volume cross-correlation between CSI values. As a means of improving localization accuracy, the suggested technique combines ray-tracing with empirical data. In order to determine both room predictions and spatial coordinates, the RSS of WiFi was investigated in~\cite{Akram2018}. The offline phase comprises the training of ensemble classifiers and a RaF regressor, as well as fingerprint data preprocessing for location prediction. Room prediction, establishing membership in a soft cluster, and preprocessing are all performed in the online phase. Another example uses a multi-antenna system to construct fingerprints from a variety of parameters, including power spectral density (PSD), RSS, and other statistical data~\cite{Guo2018b}. A RaF is then trained to serve as a classifier for each individual feature. The approach employs a number of samples and classifiers to boost the reliability of position estimations, and an entropy measure is utilized to choose both a stable time instant and a reliable classifier. The location is therefore the median of the location predictions, which is limited to fall inside the union of the projected locations generated by the chosen classifier and the chosen time instant. \subsubsection{Gaussian processes}\label{Sss:Gaussian} \begin{figure} \centering\includegraphics[width=1\columnwidth]{figures/Gaussian.eps} \caption{Gaussian processes architecture.} \label{Fig:Gaussian} \end{figure} Gaussian process (GP) regression models have been successfully used to forecast the spatial distribution of RSS measurements using minimal known labeled fixed nodes, which has been proven to increase the precision of localization schemes. Fig.~\ref{Fig:Gaussian} depicts the overall structure of an indicative localization system. In particular, the radio map used for localization in this example requires very few training measurements. Therefore, it significantly reduces the required time and energy for deployment and radio map construction procedures. Moreover, during the operation phase, RSS measurements are collected and used to pinpoint an exact location of the mobile nodes. Multiple alternative ML strategies rely on GPs, which can substitute Bayesian methods in the case of posterior distribution estimation of the labeling function~\cite{Savic2015, Prasad2017, Homayounvala2019, Zhao2018b, Prasad2018b}. During the training process, it is important to find optimal values for the GP's covariance and mean, while kernel functions, like Matern and RBF, are often used to capture it. For example, in~\cite{Yiu2017}, GP regression was used for the construction of an RSS-based continuous distribution. The authors used a MLE technique to determine the location of the target based on the RSS data available to them. Researchers examined the quadratic, Matern, and Gaussian kernels in order to determine which one best captures the relationship between geographical points. Moreover, in~\cite{Kumar2016}, a GP was used to represent the probability distribution of the RSS values, and then for a particular RSS observation, the location was estimated using a weighted combination of the fixed network node's positions in accordance with Bayes rule. An approach that applies GP-based dynamic calibration and estimation of the radio map with regard to RSS measurements is described in~\cite{Sun2018b}. The standard deviation of the trained GP model was used to quantify the accuracy of the predicted position, and the final location is calculated using weighted kNN. In order to achieve a RMSE near the Cramer-Rao constraint in massive-MIMO systems, the authors of~\cite{Prasad2018b} presented numerical approximation GP techniques, which were validated using simulations. Also, several UWB channel characteristics, including RMS delay spread, RSS and ToA, were retrieved from the power delay profile and put to use in a ranging scheme in~\cite{Yu2018}. The initial stage is to employ a kernel PCA to project the chosen channel parameters onto a nonlinear orthogonal high-dimensional space; from there, a subset of these projections is used as an input for GP regression to get a ranging estimate. \subsubsection{Neural networks}\label{Sss:NN} \begin{figure} \centering\includegraphics[width=0.9\columnwidth]{figures/NN.eps} \caption{NN architecture.} \label{Fig:NN} \end{figure} Today, neural networks (NNs) are widely used in ML. This is because they form the basis of many of the most effective learning designs. NNs are robust computational models that aim to mimic human cognitive abilities. Figure~\ref{Fig:NN} presents a visual representation of the structure of a NN, which comprises of many layers, each one with a set of parallel neurons. After calculating a weighted combination of the input based on the summation function, $\Sigma$, the neuron feeds it into the activation function, $\sigma$. Thus, we may think of a neuron as a perceptron or an extension of logistic regression. Each node in one layer is linked to all other nodes of the next layer in the simplest structures, often called fully-connected NNs. With non-linear activation functions and at least one hidden layer, NNs may estimate any function with arbitrary precision, according to the universal approximation theorem. Much like the logistic regression example, we require an optimization technique even to train a single neuron. Efficiency in training is especially crucial when dealing with deep NNs. Backpropagation is a typical technique for training NNs, where the loss function's gradient is back-propagated through the layers using the chain rule and then techniques like gradient descent may be used to adjust the parameters. Various NN-based localization approaches have been offered in past literature. Among these reported techniques, NNs were employed for passive localization, where the calibrated phase and amplitude of CSI were used as a hybrid complex input feature to the NN to localize the user~\cite{Fang2019}. Also, in~\cite{Yang2019}, localization was achieved in a mmWave communication system by integrating NNs into a collaborative weighted least square estimator, while, in~\cite{Wu2019c}, the authors employed RSS data as input to a NN, which subsequently calculates an estimate for the ranging error; the modified range values may then be used by a localization technique like least squares. Another instance,~\cite{Lee2018} utilizes the user's position in an cellular network along with the RSRP of the three strongest fixed nodes for the user's localization. Moreover, a three hidden layer NN that leverages RSS from several fixed nodes has been recently proposed with its robustness being increased by data augmentation methods. In addition, two separate networks are developed based on the RSS and ToA measurements of a WiFi system, and the final user's location was calculated as the weighted average of the two NNs' outputs~\cite{Ge2019}. A hierarchical localization technique that utilized a NN trained for cellular and WiFi indoor location has been implemented in~\cite{Jaafar2018}. This technique is based on real-time RSS data to recognize the environment during the online phase before being fed to the matching trained NN. As far as MIMO-OFDM systems are concerned,~\cite{Wang2016b} presented a fingerprint-based localization approach that relies on the CSI magnitude from three antennas. This technique represents fingerprints using the weights of a four hidden layer NN. For the NNs' training, a greedy learning approach was used that stacks radial basis functions. Following initial training and supervised tweaking, a NN's output is a faithful recreation of the input data. During the online phase, the observed data likelihood probability is represented by a set of RSS values when the $i$-th location is true, and then the Bayes rule is used to get the posterior probability of location $i$. The destination is determined by averaging all fixed network nodes equally. A linear modification of the phase value as a calibration step increases the stability of the phase values, as proposed in~\cite{Wang2015}. Fingerprints may be created from the weights of a NN with three hidden layer. With the use of directional antennas in a WiFi network, the authors of~\cite{Zhang2019c} constructed localization fingerprints based on RSS measurements and employed a classifier in the form of a two hidden layer NN to determine which fingerprint is most similar to the observed values. It is noted that, an improvement in localization precision may be achieved by using an approximation of the AoA. For example, the CSI amplitude of a MIMO system can be used as input to several NNs with various hyperparameters, with the final location estimation being a fusion of the output from all NNs~\cite{Sobehy2019}. From the numerous combining strategies that were analyzed, the best result was provided by taking both a weighted average and a median of the location estimations. Furthermore, in~\cite{Belmonte2019}, a framework was presented that integrates characteristics from many communication protocols, including XBee, Bluetooth, and WiFi, to aid in the tracking of targets. Yaw readings and RSS values from various nodes are used as inputs to the proposed NN. After the fingerprint probabilities have been calculated, the output of the Gaussian outliers filtering technique can be aggregated to generate the position estimate, which can subsequently be fed into a particle filter for target~tracking. Extreme learning machine (XLM) is a NN architecture with a single hidden layer that is presented as an alternative to back-propagation, which is used by the aforementioned designs and requires significantly more time. First-layer weights are often assigned at random, whereas hidden-layer weights are typically determined using a least-squares fit. Several studies, including~\cite{Decurninge2018} and~\cite{Feng2019}, aim to exploit the low-complexity of XLM design in localization. In~\cite{Feng2019}, the data was first grouped offline using k-means clustering, then an XLM was employed to classify the data to one of the clusters, and finally a dedicated XLM was trained for each cluster. During the active online phase, the XLM of the corresponding cluster was employed once the RSS values have been first categorised. As part of the offline process in~\cite{Decurninge2018}, an XLM was trained using data collected from a database of WiFi RSS fingerprints. Fingerprints were still gathered at certain previously identified hotspots throughout the online phase, and the solution was revised to account for the additional data. The newest XLM was then utilized for coordinate prediction. \subsubsection{Autoencoders}\label{Sss:Autoencoders} \begin{figure} \centering\includegraphics[width=1\columnwidth]{figures/Autoencoder.eps} \caption{Autoencoder architecture.} \label{Fig:Autoencoder} \end{figure} The localization literature makes use of autoencoders with a number of pre-existing supervised solutions, despite the fact that autoencoders are typically applied in unsupervised learning. Figure~\ref{Fig:Autoencoder} presents a high-level representation of an device-free localization autoencoder, where the area is partitioned into $N$ grids, each of which has a fixed node. The goal is to predict the position of the target inside one of these N grids. Pretrained features are extracted from data using an autoencoder as the foundation of the proposed network. The localization readings from the stationary nodes are used to build the input topology. Interestingly, the autoencoder's output is a ``copy'' of its input, which delegates autoencoders into the unsupervised learning architectures. The autoencoder may be broken down into three distinct parts. Firstly, the encoder maps the input to the second part, namely the hidden state, $h$, and afterwards, the decoder maps $h$ to the output, which can be expressed as \begin{align} \boldsymbol{y} = f(g(\boldsymbol{x})) , \end{align} where $\boldsymbol{x}$ and $\boldsymbol{y}$ denote the input and output, while $f(\cdot)$ and $g(\cdot)$ represent the encoder and decoder functions. The output of the autoencoder is often sent into a localization module, making this method a common choice for extracting strong feature representations. The autoencoder is utilized to extract high-level features, and the encoder's output substitutes the random projection of an XLM~\cite{Khatab2017}. Different regularization algorithms that rely on the encoder output may be easily included in the training procedure, which involves a hierarchical tuning procedure where the classifier parameter is adjusted before moving on to the encoder parameters. On a different approach, a multi-output network that makes use of the encoded information to predict the coordinates, floor, and building was presented in~\cite{Kim2018}. The building structure along with the target's coordinates were used to generate the location using stacked autoencoders~\cite{Song2019}. Another application of stacked autoencoders combined with two fully-connected layers of a deep network applies multi-label classification prediction in an indoor localization scenario~\cite{Belmannoubi2019}, while, in~\cite{Zhang2017}, an autoencoder was used to reduce the dimensionality of the magnetic field signals and RSS. Autoencoders have also been used to evaluate the degree of similarity between the gathered fingerprints and observed characteristics in fingerprint-based localization. Bi-modal DL localization (BiLoc) is a fingerprint localization solution that provides the average amplitude across two antennas and AoA estimations as input to autoencoders and utilizes the output weights as fingerprints~\cite{Wang2017}. In the online phase, the degree of similarity determines the likelihood that the target is located at a given time and place based on the observed characteristics recnostructed by the autoencoders. The final position of the target is determined by averaging the locations of the fingerprints according to their respective weights. In~\cite{Yazdanian2018}, the closest static point was used to determine the location by reconstructing the observed signal based on the autoencoder's latent variable and position. Moreover, stacked autoencoders matching to each fingerprint are constructed to provide a probabilistic position estimate in real-time. To achieve this, this method first attempts to rebuild the observed characteristics and then compares the similarity with the radial basis function~\cite{Abbas2019}. Autoencoders have also been used in device-free localization~\cite{Wang2016, Zhao2019, Zhao2018}. The encoder's output is sent into a classifier in convolutional autoencoder, which then makes a prediction about the predicted location of the target~\cite{Zhao2019}. In this example, the convolutional autoencoder takes as input a picture built from the disparity between the target and real-time RSS values. Based on the detected signals from the RSS, the authors of~\cite{Wang2016} estimated the gesture, activity, and position of the user by denoising the signal through wavelet decomposition, using a sparse autoencoder for dimentionality reduction, and finally incorporating the learnt features into a regression model and softmax classification. Data transformation is another possible use of autoencoders. For instance, the device heterogeneity issue may be addressed by an autoencoder that transforms the characteristics seen by a test device into features that match to the device used for obtaining the database~\cite{Rizk2019}. \subsubsection{Convolution neural networks}\label{Sss:CNN} \begin{figure} \centering\includegraphics[width=0.9\columnwidth]{figures/CNN.eps} \caption{CNN architecture.} \label{Fig:CNN} \end{figure} CNNs are efficient NNs designs that have demonstrated remarkable performance in computer vision applications. Through the use of parameter sharing, CNNs are able to construct more complex networks with a reduced set of parameters, compared to a fully-connected NN, like the one presented in~Fig.~\ref{Fig:CNN}. The convolution technique as well as the features maps and kernels play a very important role in the performance of CNNs. Within the convolution operation, the model's parameters are multiplied by the input data. Therefore, its data requirements and the computational complexity are reduced. At this point, it is important to point out two noteworthy characteristics of CNNs. On the one hand, connection sparsity is common in CNNs, in which low dimension filters can be used to generate each output value, while, on the other hand, CNN's sharing of parameters where each pixel uses the same weights. The translation efficiency and invariance of CNNs are appealing qualities made possible by these attributes. The term ``translation invariance'' is used to describe the CNNs' resistance to translation, which allows them to provide consistent results despite changes to the input data. Due to the achievable data and energy efficiency, more complex structures may be developed, allowing for the benefits of deeper networks to be realized. Overfitting is also mitigated by limiting the amount of trainable parameters, allowing the network to be trained on fewer samples of data. Since CNNs have been proven effective in computer vision, various recent publications have developed CNN-based localization strategies. Several studies restructure the recorded RSS array into 2D or 3D pictures and pass it to a CNN because of the high number of reported RSS values in metropolitan regions. With an applied CNN on the RSS picture, the authors of~\cite{Jang2018b} were able to assign the coordinates to one of numerous floors and buildings. Improvements to the RSS pictures were achieved by adding correlation values to the characteristics in~\cite{Mittal2018}. The augmented image was fed into a hierarchical localization structure, where CNNs first predict the floor number, based on which the corridor number was estimated, and finally the coordinates. In order to quantify the relative importance of the RSS value to the fingerprint, the authors of~\cite{Liu2019b} suggested a set of hybrid RSS characteristics. In a smart parking system, time-series bluetooth RSS measurements were utilized for pedestrian and car localization~\cite{Ebuchi2019}. Another hierarchical localization approach predicts the coordinates, floor, and building by combining RSS values from all fixed nodes over many time occurrences to create an RSS-time 2D representation~\cite{Ibrahim2018}. From a temporal perspective, in~\cite{Soro2019}, continuous wavelet transform was employed to generate a 2D time-frequency picture, which was fed in a CNN that predicts the closest reference points to the target. Then, kNN was used to infer the target's coordinates. High dimensional features may be used thanks to CNNs' increased efficiency in NNs. A multi-layer CNN that forms an image using the channel frequency response values at the available sub-carriers at various time instances has been presented in~\cite{Chen2017}. Under this framework, realizations at various antennas can be used at different CNN channels, whose output was the likelihood of the target localization problem. According to~\cite{Wang2018}, by averaging the fixed nodes' expected probability and actual locations, it is possible to estimate the precise position, which is based on the pair-wise phase difference between antennas. The position was predicted by combining the locations of the most likely fixed nodes during the online phase. Next, in~\cite{Jing2019}, the posterior distribution of the position of the end device was approximated by a Markov model using the spatio-temporal information learnt by 3D CNNs. It produces two 3D representations of the phase and calibrated amplitude of the CSI, where the depth, breadth, and height correspond to the phase/amplitude of various TX-RX pairs, sub-carriers, and packets, respectively. Finally, a computationally efficient deep CNN architecture has been used for predicting the most likely fixed nodes in a three-antenna system that generates three-channel images. From these channels, two were utilized for the antenna pairwise phase differences, while the other for the amplitudes of all sub-carrier packet samples~\cite{Li2019b}. CNNs have been also employed for device-free localization. For instance, in~\cite{Hsieh2019}, an 1D CNN model that takes advantage of either RSS values of packets from multiple antennas has been used or CSI amplitudes from all antennas and sub-carries. Another approach, in~\cite{Huang2018}, generated pictures from a time series of RSS values and associated continuous wavelet transform in order to identify people in a building. From these contributions, it becomes evident that solutions based on CSI outperform others when it comes to localization accuracy. Moreover, in~\cite{Bregar2018}, a CNN was employed to identify NLOS interference and estimate the range error in ultra-wideband systems, while, in~\cite{Niitsoo2019}, the authors recommended the use of time-calibrated complicated channel impulse responses to build pictures in an industrial context, where the the increased multi-path propagation limits the communication and localization range. Lastly, CNNs have been successfully applied in massive-MIMO systems. According to~\cite{Wu2021}, a uniform planar array can benefit from 3D pictures with power values in the delay, as well as vertical and horizontal domains. A CNN network is then fed these pictures and trained using the inception module in combination to various kernel sizes, which are imposed by the distinct sparsity of each domain. In popular Deep NNs designs, such as AlexNet, GoogLeNet, and more, the inception module is utilized to combine the results of many kernels for more accurate feature extraction~\cite{Vieira2017}. \subsubsection{Recurrent neural networks}\label{Sss:RNN} \begin{figure} \centering\includegraphics[width=0.85\columnwidth]{figures/RNN.eps} \caption{RNN architecture.} \label{Fig:RNN} \end{figure} Modeling sequential data is a common use of a specific form of NN called a recurrent neural network (RNN). With natural language processing and data processing of time series exhibiting a lot of potential. RNNs have the ability to carry out tasks, in which the outcome is reliant on both the past outcomes and the present input. The results of previous calculations may be viewed as being stored in the "memory" of RNNs. The RNN's hidden state, $\boldsymbol{h}(t)$, may remember the results of previous calculations. The output of the RNN can be written as \begin{align} y(t)=\sigma_y\left(W_h \boldsymbol{h}(t)+\boldsymbol{b}_h\right) , \end{align} with $W_h$ denoting the weights of the RNN, while its hidden state can be expressed as \begin{align} \boldsymbol{h}(t)=\sigma_h\left(V_x \boldsymbol{x}(t)+V_h \boldsymbol{h}(t-1)+\boldsymbol{b}_h\right) . \end{align} In the previous equations, $\boldsymbol{b}_h$, $V_x$, and $V_h$ are the RNN's parameters, while the activation function is denoted by $\sigma$. In RNNs, the model's parameters are preserved across time. In other words, they are resources that are shared by all links inside a certain layer and are fine-tuned through time via back propagation. However, when a gradient is propagated in time, gradient explosion or vanishing can occur and cause said gradient to increase or decrease, respectively. Another issue is that the model's effect gradually wanes with time; thus, it can not keep in mind too much history. Therefore, plain RNNs are not often employed in the real world. In reality, ``gates'' in RNN cells are used to account for influence loss or deterioration over time, with the most prominent architectures being long short-term memory (LSTM) and gated recurrent units (GRUs). As illustreted in~Fig.~\ref{Fig:RNN}, RNNs come in a wide variety of sizes and shapes, with some even being able to learn in both directions. According to architecture presented in this figure, for each fixed node during a specifide time window, a number of features extracted from the raw measurements are computed. Thus a plethora of data is generated from the initial measurements. These features are then fed into the LSTM RNNs in order to extract higher level features that capture the essential information of the localization data. Finally, the high level features are used as input for the regression, which is realized by using fully-connected layers in order to counterbalance overfitting of the algorithm. All in all, using RNNs to monitor a target's movement over time is a crucial part of localization. Numerous recent efforts have relied on recurrent neural networks that receive a series of RSS values for localization purposes. For instance, the floor and building can be estimated using a cascaded RNN that receives a succession of RSS values as input~\cite{Turabieh2019}. For real-time systems, RSS measurements accompanied by numerous Bluetooth anchors can be used for localization with high efficiency~\cite{Canton2017}. Another effort monitored the users' whereabouts from the linked cell towers' RSS history and utilized kNN and Markov models to produce synthetic measurements based on the previously observed ones~\cite{Rizk2019c, Rizk2019b}. Moreover, the authors of~\cite{Chen2019b} used a sliding window on a series of RSS data, computing five features for each access point within that window, which were then used as input for an LSTM device as a vector sequence. In WiFi and cellular networks, RNNs have been used for collecting the RSS fingerprint from several fixed network nodes over different timesteps and feeding it into a single-layer RNN, which returns the coordinates~\cite{Wu2019b}. By comparing the CSI amplitudes at various sub-carriers and antennas, it is possible to achieve localization in a MIMO system, where the SNR, CSI, and correlation matrix are employed as candidate features for various RNN approaches~\cite{Yu2020}. After the CSI has been pre-processed and shifted, polynomial regression is applied and the output data sequentially into the LSTM system, which is proven to performs better than competing systems. Furthermore, predicting the position of UAV BS using WiFi and RSS measurements has been reported in~\cite{Adege2019}. Before being integrated with the other data, the RSS features' dimensions are reduced using principal component analysis. In order to estimate the location, the new feature vector is fed into a RNN. In a similar arrangement,~\cite{Tarekegn2019} utilized linear discriminant analysis to choose the subset of fixed nodes to decrease calculation time, using RSS data from the accessible WiFi fixed nodes to construct a radio-map. It then uses an LSTM system to provide a position prediction based on the RSS sequences. RNN and CNN hybrids have been mulled upon in the recent literature~\cite{Qian2019, Zhang2019b}. A smooth trajectory of projected locations can be generated from sequential measurements in a cellular system~\cite{Zhang2019b}. At first, the area is split into cells, while afterwards pictures are generated with dimensions that correspond to the grid structure and populated based on the measurements. The photos are then propagated to a CNN, which uses the retrieved spatial characteristics to predict a score for each possible location. Next, the outcomes are then used as input to a multi-layer LSTM, which is responsible for creating the trajectory. With the use of consecutive RSS values from neighboring fixed nodes, localization is achieved. On another note, a 1D-CNN is used to extract features from consecutive RSS values and is followed by a RNN to record the temporal correlation~\cite{Qian2019}. Afterwards, a mixture density network is trained on the RNN's output to discover the conditional probability distributions of the locations. \subsection{Unsupervised learning}\label{Ss:Unsupervised} In contrast to supervised learning approaches, unsupervised learning methodologies take advantage of the features' underlying structure and distributions enclosed in unlabeled data. Multiple techniques for pretraining NNs reside in the general category of unsupervised learning and are discussed in this section. Two examples of architectures that have been employed, are deep belief networks and restricted Boltzman machines. Specifically, the former has been used to learn deep features from RSS data, and then feed those features into a different ML solution for location estimation~\cite{Le2018}. Another application of unsupervised learning techniques is to be applied in various localization tasks like device mapping, data filtering, or access point selection in order to provide increased performance. \subsubsection{Semi-supervised} On the way towards applying unsupervised techniques of localization, several researcher have developed methods of both semi-supervised and unsupervised nature. One application can estimate the distance of the user from the access points using RSS values based on a variety of cost functions, while, at the same time, evaluating the localization precision in terms of the difference between actual and estimated locations~\cite{Choi2019, Choi2019b}. Another solution is provided by developing a graph-based model, where latent variables are considered with regard to power levels and location~\cite{Zafari2019, Sikeridis2018}. To solve this model, a Gaussian mixture model was employed to calculate the received RSS likelihood under the assumption of independent normally distributed variables. Next, the models parameters are estimated through the expectation maximization algorithm that is initialized with a basic pathloss model and the positions of the fixed network nodes in order to address the identifiability issue. \subsubsection{Clustering} On a different note, unsupervised techniques have been successfully applied for constructing the map of a radio-based system. An instance of such a system develops a logical floor plan using accelerometer and RSS measurements from users within the service area~\cite{Jang2018}. This techniques is based on clustering techniques like k-means on RSS stacking difference, while each virtual room is assigned a representative localization fingerprint. Another proposed framework for unsupervised localization utilizes WiFi, gyroscope, compass, gyroscope, and accelerometer values of naturally moving users and tries to identify some fixed structures in the building (i.e., elevators, columns, stairs, and more) that greatly influence their movement. Afterwards, it employs k-means clustering to extract unique sensor signatures that can increase the localization accuracy for users starting from a known spot in the building~\cite{Guo2019}. Localization can be also achieved by the combination of global-local optimization and a Markov model that fits the RSS traces into the structure of the environment based on unlabeled data and considers the solutions that do not violate the signal propagation~\cite{Ye2018}. \subsubsection{Dimensionality reduction} Since many approaches rely on fusion to fulfil the localization procedure, an unsupervised learning approach has been proposed that concatenates the outputs of the best classifiers to develop a joint location-weight estimate and an extended candidate location set within an unsupervised optimization framework~\cite{Guo2018}. Forecasts that are considered more accurate are given more weight, thus the user's actual location should be near the most accurate predictions. Lastly, multidimensional scaling has been widely employed in dimensionality reduction schemes for localization~\cite{Saeed2016, Gao2017, Saeed2019}. Such schemes create a low dimensionality projection of the known distances between wireless nodes that yields the spatial map of the network configuration. Cooperative localization utilizing wireless signals, such as ToA, AoA, RSS and more, has lately been used for cognitive radio, IoT, and RFID to estimate distances between devices~\cite{Saeed2016, Gao2017}. \subsection{Federated learning}\label{Ss:Federated} \begin{figure} \centering\includegraphics[width=0.8\columnwidth]{figures/Federated.eps} \caption{Federated learning architecture.} \label{Fig:Federated} \end{figure} Federated learning (FL) decouples the capacity to perform ML from the need of storing the data in the cloud, allowing edge nodes to develop a shared prediction model cooperatively while maintaining all the training data locally. This extends the usage of edge device-based prediction models by bringing model training to the edge node itself. Specifically, FL is implemented by deploying a plethora of mobile nodes, each of which is in charge of a certain region that may or may not overlap with its neighbors. In order to perform local training of the global parameters, each mobile node gathers a dataset based on which it performs the minimization of the NN's parameters, $\theta_k$, by solving \begin{align} \theta_k=\arg \min _\theta \sum_{\forall\left\{x_i, y_i\right\} \in \mathcal{D}_k}\left\|y_i-f\left(x_i ; \theta\right)\right\|_2^2 , \end{align} with $\left\|a\right\|_2^2$ denoting the sum of the square of $a$'s components and \begin{align} y_i=f\left(x_i ; \theta\right)+ n_i , \end{align} where $f$ denoting the regression function. After this is carried out by every mobile node working together, the parameters can be defined as the global objective can be expressed in the form of a sum. The mobile terminals encrypt the communications before sending them to the core network, which then uses homomorphic algorithms to decode the messages. Figure~\ref{Fig:Federated} depicts the FL concept for localization. Advantages of this collaborative framework include less time spent on training and, more crucially, the protection of individual privacy by removing the need to provide sensitive information to the network~\cite{Niknam2020}. Typically, in FL, it is assumed that a centralized entity would combine the models trained at the edge devices and broadcast back an updated version of the model. Due to the unpredictable nature of mobile surroundings and the privacy leakage limitations introduced by the centralized nature of the data processing architecture employed in object localization, traditional ML localization approaches may be surprisingly fragile~\cite{Chen2017b}. FL has the potential to provide intriguing solutions for allowing accurate and private location services. There is an abundance of literature exploring the usage of FL in localization contexts; especially, since location data is one of the most fundamentally private bits of information. For example, a FL technique that uses NNs to anticipate user coordinates in order to increase the reliability and robustness of RSS fingerprint-based localization without compromising participant privacy has been recently presented~\cite{Ciftler2020}. When the users have finished training the model, the central node adjusts the NN weights based on the amount of samples they were exposed to and sends the resulting model back to the users. In addition,~\cite{Li2020} confirmed FL's promise in indoor localization services by addressing the problems of privacy leakage threats and task learning associated with using a centralized AI server. Using the computing power of mobile devices, the suggested architecture combines centralized indoor localization with FL to lighten the burden of fingerprint collecting and save network computational costs while maintaining users' privacy. In order to construct a global statistical localization model, a DL model is run on each node based on unlabeled crowdsourcing and labeled fingerprint data, and then shares the calculated updates with a central server. When compared to other methods of disseminating fingerprint data, FL definitely outperforms them in terms of stability, privacy protection, and transmission cost~\cite{Nguyen2021}. Similarly, a federated localization strategy for WiFi networks is constructed in~\cite{Liu2019c} using FL. WiFi signals representing known landmarks may be used by mobile devices to create local fingerprints, which can then be fed into a DNN model and subjected to a deep autoencoder to filter out background noise. A centralized server then compiles all of the regional weights into one global one. Local updates are encrypted using a homomorphic encryption method to safeguard the communication channel during the offloading phase. High precision in localization estimates and safety are shown in a laboratory corridor experiment. As another example, in~\cite{Yin2020} a federated localization architecture was suggested for precise IoT localization. FL reduces the privacy risks associated with location estimation by having numerous users work together to develop a model using local fingerprint data. Emerging localization services, such as wireless traffic prediction using BSs, and mobile indoor GPS localization, mobile target navigation and tracking using inertial sensors, may all benefit from FL's utility. \subsection{Reinforcement learning}\label{Ss:Reinforcement} \begin{figure} \centering\includegraphics[width=0.9\columnwidth]{figures/Reinforcement.eps} \caption{Reinforcement learning architecture.} \label{Fig:Reinforcement} \end{figure} Reinforcement learning (RL) is among ML's burgeoning research fields and it involves teaching an algorithm how to make judgments by letting it make mistakes, while interacting with the world around it. To optimize their rewards over time, agents conduct a series of behaviors in a predefined setting. A conceptual outline of RL-based localization is provided in~Fig.~\ref{Fig:Reinforcement}. The agent's abstracted state of the world, or environment, from which it draws its action choices at time $t$ is comprised of both the agent's location and the RSS reading make up the state. Moreover, the agent evaluates the state and uses that information to choose what courses of action to conduct. The ``good'' activities explored in localization schemes include traversing the grid while remaining on it. In accordance with the reward function, the agent will get a favorable response after taking the desired course of action. Theoretically, incentives may be determined by the distance between the target position and the agent. However, it is impossible to utilize this approach to handle unsupervised data. A technique, which build on the premise of isolating landmarks with accurate position labels and powerful RSS characteristics for establishing rewards, is proposed as a solution to this problem~\cite{Shao2018}. In this respect, the agent receives a reward if and only if the measured RSS matches the known RSS characteristic at the landmark location. \subsubsection{Markov decision process} For dynamic systems, like resource allocation, wireless communication and localization, it has attracted a lot of interest. For instance, a bluetooth based system that uses past locations information and RSS measurements to determine whether or not the reward is achieved, when the solution approaches known RSS values or an RP~\cite{Li2019}. In order to determine a progressive localization algorithm, the WiFi localization problem in a WiFi system is viewed as a Markov decision process with a model-free approach~\cite{Dou2018}. In this example, states may contain the RSS, action history, and center coordinate values. There are five possible motion directions in the action space, each of which may be used to shift the predicted location window by a different set of radius values. Another localization problem that can be tackled with RL methods is scheduling the exchange of signals during cooperative localization~\cite{Peng2019}. As a result, the solution treats the measurement choices as operational tasks and the linkages as autonomous agents. The observations may include the nodes that failed to meet a localization quality criteria, covariance values, and distance. \subsubsection{Deep RL} Another application of RL is to enable self-learning localization scenarios in which new information is learned from the outcomes of previous choices. Compared to unsupervised multilateration localization, the accuracy of Q-network in a deep RL structure increases by 37\% when used to predict the position of a pedestrian device~\cite{Li2019}. To better understand human traffic, predicting pedestrian paths can play a very important role. This issue has been tackled by designing a deep RL method that aims at maximizing entropy~\cite{Fahad2018} and has achieved performance similar to LSTM localization. Another approach, used semi-supervised deep RL for estimating the pedestrian distance in localization applications and exhibited a 23\% increase in precision with regard to supervised learning approaches. \subsection{Transfer learning}\label{Ss:Transfer} \begin{figure} \centering\includegraphics[width=1\columnwidth]{figures/Transfer.eps} \caption{Transfer learning architecture.} \label{Fig:Transfer} \end{figure} Transfer learning (TL) is utilized to take advantage of the knowledge learned in one domain to a new domain. This is especially useful when it is challenging to acquire data in the target domain, but an abundance of data exists in the source domain. Figure~\ref{Fig:Transfer} depicts the two stages that make up the TL-based localization system, namely offline training and online localization. To be more precise, a number of fixed and mobile nodes are installed in advance, taking into account the physical characteristics of the area and the needs of the individual application. RSS readings from the mobile device may be sent to the surrounding fixed nodes by positioning the mobile ones. Each fixed node then uploads its data to the server, which uses the signal characteristics acquired in order to create a fingerprint database. Another interesting case of TL is dynamic systems, such as localization applications, that require configuration and retraining on each distinct application. In this scenario, the overhead of retraining the model when the data is accessible in both domains is challenging and can be avoided with TL approaches. Based on these, the challenges of TL enabled localization span across many dimensions, including time, space, and hardware, where the data distribution may vary depending on the dimension. Specifically, TL is presented as a pair of optimization problems: the first involves extracting the underlying semantic manifold of the signal to serve as constraints for the second, which involves labeling the unlabeled data in the target domain. The challenge of TL across devices might be stated as one of multitask learning. For instance, a manifold regularization-based solution for a temporal TL can be applied to localization approaches where data distributions vary between time instances, but are often consistent with one another in low dimensions. \subsubsection{NNs}\label{Sss:Transfer_NN} One of the more recent applications of TL involves the utlization of SotA NN techniques. For instance, deep CNNs employ TL between many antenna configurations based on the time-domain CSI. After the network is first trained, it is possible to retrain the network's lower layers with less data points to accommodate the altered antenna configuration~\cite{De2020}. Another example, the transfer of knowledge across settings is explored in order to address the issue of localization based on RSS~\cite{Xiao2018b}. The NN model is pre-trained in one domain before being transferred to another domain, with the two domains being characterized by distinct propagation phenomena. Specifically, the domains are two floors in the same building, both of which have the same access point placement and architectural design. It is proven that with only 30\% of the data in the second floor the TL enabled system can achieve the same level of performance. Finally, deep CNNs for pedestrian localization can be combined with TL approaches with great success (i.e., 45\% increase of the training data and cut down on training time by half)~\cite{Li2021}. \subsubsection{Conventional TL}\label{Sss:Transfer_classical} Conventional TL methods augment the real-time measurements gathered from the target domain with labeled fingerprints from the source domain. For instance, a domain-invariant kernel, suitable for use with SVM in TL enabled localization, is learned using data from both domains~\cite{Zou2017}. Metric transfer and metric learning are the two components of the TL-based methodology that operate together to lessen the burden of offline training in the new setting~\cite{Zhang2018}. The metric learning component maximizes the statistical dependency between signal label and feature statistics to learn the distance metrics from source domains. Using a method that minimizes the difference in data between the source and target domains, the metric transfer component determines which metric is optimal for the target domain. In certain cases, the TL result may not take into consideration all aspects of the surrounding environment in order to recreate the radio map. To solve this issue, fuzzy C-means clustering has been used to reduce the impact of external factors~\cite{Liu2017}. \subsubsection{Manifold learning}\label{Sss:Manifold} \begin{figure} \centering\includegraphics[width=0.9\columnwidth]{figures/Manifold.eps} \caption{Manifold learning architecture.} \label{Fig:Manifold} \end{figure} The premise that the observed data sit on a low-dimensional manifold inside a higher-dimensional space is what distinguishes the discipline of manifold learning from others. In the ML world, manifold alignment is widely used for sharing models and data across disparate collections, assuming a common manifold. For instance, the Siamese network design presented in~Fig.~\ref{Fig:Manifold} employs two identical NNs to translate the high-dimensionality input characteristics, $x_n$ and $x_m$, to lower dimensional representations, $y_n$ and $y_m$, taking into account the fact that location affects the values of large scale parameters. The network's objective is to keep the distance between $x$ and $y$ to a minimum. Finally, in a semi-supervised learning situation, the parameter $\alpha$ is a scaling value for distance scale matching. Data visualization and dimentionality reduction are only two of the techniques that are applied in manifold learning. For example, graphs is one way to approximate the manifold's point relations, while variable manifold alignments can often result in neighborhood graphs with unique distances between graph nodes~\cite{Xu2020}. Specifically, in the area of localization, manifold alignment has found multiple applications for constructing a radio map based on the observed distances between the nodes. Another example is the Laplacian Eigenmap manifold alignment method that develops a weighted graph connecting the data points and maintaining the local geometry~\cite{Zhou2017}. This technique utilizes the Laplacian eigenvectors of the constructed graphs that contain the physical relations of the geometrical observations (such as RSS). Moreover, manifold learning has been utilized under a semi-supervised approach where both labeled RSS data as well as unlabeled timestamped traces are used to build the graphs~\cite{Zhou2017b}. In addition, to keep the distance estimates based on the wireless propagation model, the goal functions can be modified and Gaussian kernels can be used to determine the graph's weights between the RSS measurements~\cite{Behera2020}. Another approach of manifold learning optimizes a time-series graph Laplacian SVM to generate pseudo-labels, which are then used as part of a learning framework to assist with semi-supervised RSS localization. In order to strike a middle ground between the labeled and pseudo-labeled contributions, it incorporates manifold regularization into a transductive SVM~\cite{Yoo2019}. In WiFi, manifold regularization using Laplacian graphs is taken into consideration in the solution for extreme learning machine parameters. Since Bluetooth and WiFi signals display distinct propagation circumstances, two graph Laplacians are developed to reflect the smoothness in Bluetooth and WiFi, respectively~\cite{Jiang2018}. Finally, a Siamese network design, which consists of two identical NNs used to compare two inputs was used as a semi-supervised or supervised CSI localization solution~\cite{Lei2019}. Because of the impact of geography on the values of global parameters, a pair of feed-forward NNs is used to transform the input features into more manageable location representations. \section{Optimization frameworks for localization}\label{S:Theoretical_framework} To assess the fundamental bounds of achievable localization performance, problem formulation, design and optimization are crucial. This section starts by giving the formulation of the optimization problem based on the intended system goals, which is presented in Section~\ref{Ss:Problem_formulation}. The system's high-level design considerations are then covered in Section~\ref{Ss:Design}. Finally, Section~\ref{Ss:Optimization} delves into the optimization of system design issues. \subsection{Problem formulation}\label{Ss:Problem_formulation} Precision, throughput, signal quality, and energy efficiency are among the most important KPIs that must be optimized in communication systems. When designing a system with precision as a goal, the orientation and position error bounds are put to use for localization. However, these criteria are still a useful and manageable tool for assessing performance in the asymptotic area, even if it is only applicable when the estimator is efficient~\cite{Chen2022}. Aside from the goals listed in Section~\ref{S:6G_aplications}, there are several situations in which they become crucial. However, there is no one, universal definition of an aim; rather, objectives must be defined in light of the context in which they are used in. Compromises are necessary due to the various formulations of objective functions, particularly in the optimization of simultaneous communication and location systems. The BSs transmit positioning reference signals in low-frequency localization systems, and the accompanying system architecture are mostly offline. For instance, this is the case for antenna array and BS layout design. The improvement in localization performance is a side effect of the beamforming gain in MIMO systems. However, knowing the location of the receivers is essential for beamforming. Thus, combining matrix design, online precoding, and resource allocation are of paramount relevance. THz systems that rely on array-of-subarrays antenna structure perform precoder/combiner optimization at the subarray level rather than the antenna level. Therefore, the beamforming angles of the subarray must be well-designed together with the data symbols from the RFCs. Also, powerful algorithms are needed for optimizing resource allocation and RIS coefficients within a dense network. It is clear that both online and offline improvements will play a significant role in the success of future communication systems. The optimization issue is then formulated, and the impact of the various factors on the goals of the system is discussed. Specifically, the performance requirements for localization vary depending on the application scenario, as well as the related objectives and KPIs. These goals often overlap, and it is necessary to make concessions. Increases in coverage and update rates may have unintended consequences, such as diminishing accuracy. In order to maximize its effectiveness, a system may have several goals that it must balance. Such a localization system can be modeled under a generic optimization problem such as \begin{align} \begin{split} \mathcal{X} = \underset{x}{\arg\min}\ \ &\mathbf{f}\left(\mathcal{X}\right) \\ \mathrm{s.\ t.}\ \ &\mathbf{g}\left(\mathcal{X}\right) \leq 0 \end{split}\ \ , \end{align} where $\mathbf{f}$ and $\mathbf{g}$ denote the objective and constraint functions, respectively. Moreover, $\mathcal{X}$ represents the variable set that is used to achieve the optimal solution for the optimization problem constructed under each localization scenario. Depending on the context, a parameter may represent either an aim or a limitation. For instance, localization accuracy may be used as either a goal to achieve or a constraint to be satisfied, such as spacing, number of devices, beamforming angles, and so on, in addition to other KPIs, like throughput, precision, etc. \subsection{System design}\label{Ss:Design} The localization system's design is entangled to the use cases in order to fulfil their requirements. These use cases inform choices on network architectures, cooperative approaches, as well as algorithm development and optimization. \subsubsection{Network architectures} \label{Sss:Network_architectures} Under the umbrella of networks, as discussed in the previous sections, three types of channels have been covered LOS, NLOS, and RIS-enabled ones. However, densification is a key characteristic of future communication networks, thus numerous fixed and mobile nodes should be engaged. There are three distinct kinds of topologies for THz communication systems: centralized, distributed, and clustered. In a centralised system, one or more client nodes are linked directly to a centralised server, which uses client/server architecture. This is the most often utilised form of wireless system, in which the clients submit requests to the server and receive the answer. On the contrary, distributed networks aim to eliminate single points of failure by distributing processing across the network and coordinating their efforts. Distributed systems rely on the communication and synchronization between the nodes that are dispersed throughout a network. These nodes often consist of discrete pieces of hardware, however they might also be software processes. Centralized and distributed architectures are often utilized in macro settings with a wide communication distance. The centralized structures may offer greater overall performance with appropriate scheduling, while the scattered ones safeguard user privacy. Finally, a cluster network comprises of two or more computing devices sharing a single computational task. Such networks make use of the hardware's ability to process data in parallel in order to not only boost processing power, but also provide scalability, high availability, and eliminate network dependency on a single device. Nanonetwork settings, which value low power consumption and short communication distances, are well suited to the clustered design~\cite{Ghafoor2020}. There are four possible architectures to increase the system's performance in large-scale scenarios: (i) cell-free, (ii) RIS-enabled, (iii) 3D and (iv) heterogeneous networks~\cite{Yastrebova2018}. The main advantages of cell-free networks include ultramassive MIMO beamforming and power savings. However, the THz channel's sparser multipath propagation and low rank restricts performance~\cite{Chaccour2022}. In this scenario, due to the lack of cell borders, end devices may have a high coverage probability, while the localization performance can be augmented by the geometrical diversity of the base stations~\cite{Faisal2020}. Next, The network's coverage area may be expanded and the channel reshaped with the use of RISs. THz-frequency RISs are predicted to have modest footprints due to the utilization of short wavelengths, which can allow a higher versatility in deployment. Finally, in a heterogeneous network, many wired and wireless protocols coexist. This is a possible scenario for future networks. In addition to solving the hearing problem, this kind of multi-band network may also significantly shorten the time it takes to go online. The offline design of a system includes hardware selection to strike a balance between budget and overall system performance. Antenna polarization, hardware imperfections, and phase-shifter quantization are all taken into account throughout the hardware selection process. The main factors that influence signal quality in THz systems are absorption, blockage, device density, and antenna design. Understanding the optimal antenna polarization and device density for a THz network has been investigated in~\cite{Petrov2017}. As a rule, directional antennas are utilized for localization and transmissions, whereas unidirectional antennas are employed during the service discovery phase~\cite{Han2017}. Additionally, a quantized model should be considered in system design due to the discrete nature of phase control and amplitude signals in RISs~\cite{Wu2019}. \subsubsection{Cooperative approaches} \label{Sss:Cooperative_approach} Although energy consumption, as well as computational and time requirements are increased due to frequent contacts between the end devices, the localization coverage and precision are enhanced by cooperative localization~\cite{Xiao2022}. For a fair compromise, it is necessary to specify the related performance KPIs. Collaboration between fixed and mobile nodes, data fusion from several kinds of sensors~\cite{Zhang2019,Lu2020}, UAV-assisted localization~\cite{Wang2019} are all crucial. Furthermore, in many real-world use cases, the existence of NLOS propagation makes it difficult for certain agent nodes to directly connect with adequate fixed nodes for localization purposes, which may reduce localization precision. This phenomenon can be mitigated by using cooperative localization strategies~\cite{Xiao2022}. On the contrary, non-cooperative localization requires all mobile nodes to be in constant communication with fixed ones, necessitating either a densely packed network or a wide coverage area. By facilitating communication between mobile nodes, cooperative localization enhances accuracy and increases localization coverage beyond that of non-cooperative localization. The main problem of cooperative localization, which is a parameters estimation issue, may be addressed with probabilistic or deterministic methods. In the first case, the most prominent solutions involve multidimensional scaling, multilateration, traditional linear scaling, and other techniques that often fail in practice because they presume a Gaussian model for all measurement errors~\cite{Wang2020}. As far as probabilistic approaches are concerned, they not only provide location estimates, but also quantify the degree of uncertainty associated with those predictions. For instance, estimation theory and factor graphs are among the most notable techniques of probabilistic approaches, with recent efforts being focused on belief propagation and equivalent Fisher information~\cite{Gao2019}. \subsubsection{Algorithm development} \label{Sss:Algorithm_development} It is still unclear whether THz systems benefit from the use of multi- or single-carrier modulation schemes. The former appear to be advantageous in applications, where frequency-flat channels exist, while, in spite of the poor power efficiency and high complexity, multi-carrier systems are still favoured in frequency-dependent molecule absorption loss and multipath scenarios. The utilization of discrete-Fourier transform spread OFDM may be employed as a ready-made solution in order to mitigate the PAPR impact~\cite{Tarboush2022}. Spatial~\cite{Sarieddeen2019}, index~\cite{Loukil2020}, hierarchical bandwidth~\cite{Hossain2019}, and orthogonal time-frequency space modulations~\cite{Wei2021} are also taken into account for specific scenarios as additional multi-carrier modulations. Additionally, research on non-orthogonal multiple access at THz is being conducted~\cite{Magbool2022}. When designing wireless systems, the spectrum efficiency or data rate may be impacted by tweaking signal characteristics including packet length, bandwidth, and carrier frequency. These values are also critical for localization to accomplish targeted goals. For better route separation in the delay domain, more bandwidth is preferable, but the higher data size and sampling rate must be kept within the hardware's capabilities. When possible, the messages should be as lengthy as possible to maximize energy acquisition while being as short as possible to minimize delay, particularly in mobile settings. Finally, the localization system's effectiveness is heavily influenced by the design choices made. \subsection{Optimization}\label{Ss:Optimization} When a network architecture with no knowledge regarding the location of the end devices is assumed, it is possible to optimize the layout, antenna, and codebook based on data about the immediate fixed surroundings. In this scenario, the optimal placement of fixed and mobile network nodes may be calculated from the Cramér-Rao bound using a predetermined codebook after the quantity of these elements has been established. The design may be optimized for the greatest localization performance by taking into account environmental data. It is also important to ensure optimal orientation of base station antennas. Furthermore, higher beamforming and angular resolution performance is achieved by increasing the array dimensions of the antenna. However, as the number of antennas increases a more complicated and expensive setup is created. Designing an appropriate size subarray is crucial when selecting the antenna architecture. Beamforming gain and accuracy may be improved by increasing the number of active elements per subarray, although coverage can be reduced and hearing loss can occur with narrow beamwidths. To get from an unconnected state to an active one, a new device must go through the initial access operation of establishing a physical connection with a fixed node~\cite{Hu2020}. The initial access process may be seen as localization without any input from the end device. Blockage and deafness are two problems that arise in THz systems because to the small beams, making initial access difficult~\cite{Barati2020}. This necessitates well thought-out codebook construction and efficient first-time-in processes. Therefore, the codebook layout is determined by search techniques, which can split into science-aware, iterative and exhaustive search ones. In the first category, the beams may be learnt for each partitioned region to lessen initial access procedure's delay, given the fact that the previous user device position or environmental information is provided~\cite{Chen2019}. Next, for iterative search, in order to determine the optimal angular space, hierarchical codebooks may be created for transmission across progressively narrower beams~\cite{Sun2019}. In the last category, the fixed and mobile nodes utilize beamforming to send and receive messages in various directions~\cite{Alkhateeb2017}. In terms of hardware and coverage practicality, an exhaustive search is the best option for these algorithms~\cite{Barati2016}. However, the discovery latency increases linearly with beamforming strength. While iterative search shortens the time it takes to make a discovery, its narrow focus comes at a cost. On the contrary to aforementioned optimization approaches, when end device location information are available, the three major concepts are active beamforming, RIS coefficient, and resource allocation. Regarding the first case, if you know the exact position of the receiver ahead of time, you may boost the received signal strength by adjusting the beamforming angles such that they point directly at the receiver. However, this boost in SNR does not automatically result in better localization results. For more realistic approaches the Cramér-Rao bound is applied. For instance, beamforming optimization and location estimation can be iteratively applied by using numerous observations~\cite{Zhou2019}. Moreover, the optimum precoders for tracking the angle of departure and arrival can be determined by solving a stated convex optimization problem, if the uncertainty range of the target directions is available~\cite{Garcia2018}. In order to minimize beam assignments, space resource allocation often makes use of directional antennas and array-of-subarray structures. Accuracy and range are directly impacted by how well the analog beamforming angles are optimized. In multi-end-device environments, the beams must be strategically distributed across the various end devices so that communication and localization KPIs are met. To improve the overall system performance in a network with several fixed nodes, cooperative beamforming optimization is required. Next, improved signal gain in RIS-assisted systems relies heavily on both adjustment of the RIS coefficients and active beamforming. Multiple broadcasts using randomized beamforming angles of messages may be employed for localization when the end device's location is uncertain. Beamforming angles at mobile and fixed nodes may be simultaneously improved using knowledge of the end device's location and orientation in advance. For improving the localization and communication quality, it is possible to tweak the coefficients of the RIS~\cite{Bjornson2022}. Also, a larger data rate is achievable by optimizing the RIS components to increase the SNR at the receiver, while the higher SNR is not always associated with a low Cramér-Rao bound. One limitation that has yet to be solved is 3D MIMO system optimization methods, which are not currently available. Finally, allocating resources in a communication network that is servicing numerous end devices or performing different activities is a crucial step, with bandwidth, energy, and time being the three key resources. For bandwidth allocation to be feasible, the THz spectrum is split into a series of spectral windows that change in distance due to the fact that the vapor absorption coefficient varies with frequency. When the connection distance increases, the effective bandwidth window decreases in size~\cite{Gerasimenko2019}. The hierarchical bandwidth modulation, which optimizes device density to maximize capacity, is thought to be possible in THz communications due to the effective bandwidth~\cite{Hossain2019}. For localization purposes, it is necessary to identify and allocate appropriate sub-bands and subcarriers to the end devices at various ranges. As far as time slot allocation is concerned, a compromise between overhead and transmission speed must be found when communicating with a single recipient. It stands to reason that data acquired from multiple transmissions will improve localization accuracy, but at the expense of an increase in overhead and latency. Additionally, channel coherence and end device capabilities should be taken into account by the allocation process. Allocating communication time slots to different users helps ensure that all users within the service region receive the best possible positioning QoS. Finally, with regard to energy consumption, localization precision is often a limiting factor instead of a variable to be adjusted. Specifically, in an indoor positioning scenario, the end user requires to know its position with accuracy in the order of centimetres. Therefore, increasing the transmission power to achieve higher precision is unnecessary. All in all, intelligent energy allocation can meet the performance needs of user devices with minimum wasted resources. All of the aforementioned resource allocation strategies can be written in the form of optimization restriction in a plethora of active and passive beamforming problems. \section{Insights \& future directions}\label{S:Future_directions} So far, important concerns of future wireless systems' localization have been explored and intriguing findings obtained. In this section, as depicted in~Fig.~\ref{fig:future_applications}, we will address the insights and future directions with regard to mmWave/THz localization, wireless optical localization, RIS-assisted localization, heterogeneous localization systems, integrated localization and communication, as well as low earth orbit (LEO) positioning, navigation and timing (PNT). \begin{figure} \centering\includegraphics[width=1\linewidth]{figures/Future_directions.eps} \caption{Future directions for 6G localization.} \label{fig:future_applications} \end{figure} \subsection{mmWave and THz localization} mmWave/THz localization research is still in its infancy, with multiple approaches still to be investigated. In this section, future directions based on fundamental research and intelligent control design are presented. \subsubsection{Fundamental research} So far, a deterministic channel model was investigated. However, KPIs of dispersed signals, such as AoA, RSS, and more, are random in practical settings. Modeling the influence of randomly generated signals is necessary, and the impact of reflectors and scatterers on localization performance must be measured. Furthermore, since geometric localization relies on the channel model as its basis, current SotA approaches use an extension of mmWave models by including high-frequency system characteristics as the AOSA structure, the wideband effect, and atmospheric attenuation. However, the channel model may not account for the impact of hardware impairments and other THz-specific factors. Since the localization performance suffers as a result of these model incompatibilities, it is clear that a more precise channel model is necessary. Finally, in most localization tasks, the position and orientation of the BS and RIS are assumed as known anchors and research is focused on the UEs' location and orientation. However, this results in neglecting calibration problems between the reference anchor and additional ones. To overcome this issue, joint UE localization and BS/RIS calibration is of major importance in applications with many~anchors. \subsubsection{Intelligent protocol design} While model-based approaches are simple to deconstruct, AI-based approaches are often favoured for learning from or mitigating the impact of unanticipated model mismatches. In this case, it is important to have access to shared databases so that methods will be compared and contrasted. The preservation of user security and privacy, the transfer of a taught model into another domain to save training time, as well as the gathering, sharing, and storage of massive amounts of data, are all pressing concerns that need to be addressed in order to successfully deploy future intelligent 6G wireless networks. For example, optimising the placement of stationary BSs for better coverage or data accuracy is easy when compared to dynamically deployment of the BS by attaching it to UAVs, in temporary heavy traffic settings like stadiums or conference halls. To accommodate the UEs' communication and localization needs, the UAVs' position and path must be optimised. Connectivity in dynamic mmWave/THz UAV networks, however, presents its own unique set of difficulties that must be thoughtfully handled. Moreover, the SLAM method might provide access to a map of the immediate area. The PDF of previous access sites can be employed for scene-aware localization in addition to the map. In order to get around obstructions and make the most of the strong reflectors for localization, the beamforming vectors at the BS/UE and RIS element coefficients must be tuned. The intelligent optimization of the procedure to construct and maintain a map over time is an open question in this area. \subsection{Optical wireless localization} The vast majority of VLP techniques use at least three LEDs, with the voltage driving them being sinusoidal with very slight frequency changes. These strategies make use of the generally valid linear response between the LEDs and the PD, as detailed in most manufacturers' data-sheets. By using the RSS parameters and supposing a LOS attenuation model, these methods can determine the PD's static location. In addition, similar techniques have been adapted to carry out position estimate even while the UE is in motion at speeds that are more representative of real-world scenarios. However, by averaging the computed location using a small number of substantially overlapping received signals, the possible accuracy may be greatly improved. The reconstructed route can be smoothed down with the use of AI techniques like Kalman filter-based tracking. With this in mind, a robust modelling framework is needed to examine performance over a wide range of LED frequency, noise level, UE speed, and other design parameters. According to the findings reported in the literature, VLP approaches are effective at accurately localising the UE, which bodes well for their use both inside and outdoors. Finally, in order to go beyond the SotA of VLP wireless systems, it is necessary to pay close attention to positional errors, computing efficiency, as well as localization precision and latency. \subsection{RIS-assisted localization} RISs are expected to play a key role in the 6G era by manipulating the propagation condition, creating and/or canceling propagation paths, and practically enabling the ``propagation-as-a-service'' vision. Although a great amount of effort was put on analyzing the benefits and performance of RIS as well as designing RIS-empowered wireless communication protocols, there are only a limited number of contributions that documents the performance envelop of RIS-empowered or assisted localization systems and/or present suitable protocols in this direction. In this section, we briefly present the research gap and provide future directions in RIS-assisted localization~systems. \subsubsection{Fundamental research} The initial theoretical studies on RIS-assisted localization system assume: i) deterministic channel model, ii) continuous RIS phase shift capabilities, iii) ideal RIS with no imperfect meta-atom (MA), iv) analog RIS, v) single-RIS, vi) interference-free systems, and viii) ideal transceivers front-end. Although these assumptions are necessary in order to determine the performance envelop of RIS-assisted localization systems, in several real-world implementations, they are not realistic. This drives a theoretical campaign in this area that would allow the relaxation of the aforementioned assumptions. In more detail, the performance of RIS-assisted localization systems that experience different type of fading, such as Rayleigh, Rice, Nakagami-$m$, Weibul, generalized Gamma, Malaga, Gamma-Gamma, etc. need to be extracted. Notice that several recent works, including~\cite{Papasotiriou2021,Boulogeorgos2022e,Boulogeorgos2022i,Boulogeorgos2019f,Papasotiriouf2022}, have verified these type of fading even in THz systems. In a similar direction, the assumption of continuous phase shift is not valid in practice, since RISs have a discrete number of phases that can use~\cite{Xu2021_d,An2022_d,Xu2021,Shi2022}. As a result, research questions like how many RIS phases we need for localization arises. Likewise, according to~\cite{Taghvaee2020}, the assumption that all the MAs of the RIS are in perfect condition may not be always valid. This motivates an analysis towards the localization approach tolerance to MA failures. Different types of RIS exist, such as analog, hybrid, and digital. Current contributions only deal with analog RISs. The benefits from using hybrid and digital RISs need to be analytically quantified. Another research question that waits to be answer is concerning the feasibility and benefits of cascaded and parallel multi-RIS localization systems. Moreover, the impact of interference and transceivers hardware imperfections on the performance of RIS-assisted localization systems needs to be analytically assessed. Finally, most published contributions present closed-form or analytical expressions for the Cramer-Rao lower bound or a Fisher information analysis. However, a number of other insightful KPIs exist, such as localization energy efficiency, latency, coverage, etc. that are necessary to be assessed. \subsubsection{Intelligent protocol design} To make the most out of RIS-assisted localization system, while providing adaptability to ever changing conditions, an intelligent protocol that allows the exploitation of the systems resources, namely space, frequency, and time need to be developed. In more detail, the protocol should allow co-design of beam code-words for both the source and the RIS, selects the optimum bandwidth and timeslot for localization. Moreover, it should coordinate the overall localization process allowing changing between beam codewords when needed. Such a protocol should aim at maximizing the localization system energy efficiency without compromising its accuracy and stability. Likewise, the protocol should take into account the nature of the system, i.e. operation frequency band, as well as the type of the RIS, i.e., analog, hybrid, digital. Finally, the protocol should provide guidelines for the optimal RIS placement. To design such protocol, researchers should formulate and solve a number of optimization problems and combine their solution to a reinforcement learning strategy that will ensure the system's adaptability. \subsection{Heterogeneous localization system design} To counterbalance the physical limitations of high frequency wireless localization systems, simultaneous exploitation of microwave and mmWave, THz, and optical bands is required. However, localization systems in different bands have different localization range and accuracy. Moreover, their range and accuracy depends on different phenomena, like atmospheric conditions, size of the scatterers and obstracles, and design parameters, such as antenna gains, beamforming type, etc. Additionally, localization mechanisms have to facilitate the co-existence of several technologies with different coverage that follow different standards. As a result, localization system heterogeneity can be: i) spectrum, and ii) technology~heterogeneity. \subsubsection{Spectrum heterogeneity} refers to scenarios in which the localization agent uses both high (e.g., mmWave, THz, optical) and low frequencies (e.g., microwaves). The higher the localization frequency, the higher the localization accuracy and the lower the localization range. This observation drives the idea of designing multi-band localizers capable of determining the position of the object of interest in a hierarchical manner. Specifically, such a localizer would use lower frequency to find the location of an object that is outside the high-frequency system range with low accuracy, and high frequencies to increase the localization accuracy of object that are inside their coverage area. A hierarchical localization approach is required for such a localizer that will allow efficient and fast localization of the object of interest and boost its accuracy. Finally, an experimentally verified theoretical framework that quantify the hierarchical localizer performance and provides design guidelines is needed. \subsubsection{Technology heterogeneity} introduces two scenarios, namely: i) stand-alone and ii) integrated localization systems. In stand-alone scenarios only one type of localization technology, such as sensors, radards, mmaWave, THz, optical, is used. On the contrary in integrated localization systems, more than one localization technologies are used. In the later, the identification of the technologies that could combined without significantly negatively impacting the localizers energy efficiency needs to be performed. Another parameter that need to be accounted for is the implementation cost. Finally, algorithms for combining localization information from different sources are necessary to be developed. \subsection{Integrated localization and communication} A radio signal can carry both the TX information and localization-related data. As a consequence, a unified framework for integrated communication and localization seems to be a natural next step. Current cellular networks implement localization functionalities separately from the communication-related functions. The main reason behind this approach has been the different design objectives that these functionalities have. In more detail, the localization system aims at maximizing its accuracy, while the communication system overall objective is to jointly maximize its reliability, data rate, and transmission range through the wireless channel, which experience fading and noise. Therefore, localization systems used to operate in high frequency bands, where the short wavelength and antenna beamwidth allowed them to pin-point the target with acceptable accuracy. On the other hand, communication have only recently started to exploiting mmWave and THz transmissions. Thus, the time of a localization and communication synergy has come~\cite{Sarieddeen2020,Liu2022a,He2022,Liu2021a}. In order to devise efficient and low-cost integrated localization and communication systems a number of strategically designed steps, starting from suitable KPIs definition and finishing to the design of suitable protocols capable of operating in heterogeneous network environments, need to be taken. Next, we identify and analyze these steps. \subsubsection{KPIs definition} As discussed in~\cite{Ghatak2018,Jeong2015,Destino2017,Destino2018}, there are several trade-offs between localization and communication system goals. In more detail, in~\cite{Ghatak2018}, the authors discussed the localization accuracy and communication data rate trade-off. In~\cite{Jeong2015}, the authors revealed the localization accuracy, power efficiency, data rate trade-off. Similarly, in~\cite{Destino2017}, the authors highlighted the localization accuracy data rate trade-off in single-user mmWave systems, while, in~\cite{Destino2018}, the prior contribution was extended in multi-user scenarios. The aforementioned contributions revealed that there are a number of trade-offs that need to be understand and balanced. To achieve this, the current localization and communication KPIs may be not enough. This motivates rethinking and redefining or creating new KPIs capable of providing insights that in turns optimize the localization and communication synergy. Moreover, new KPIs may need to be defined that quantify the performance of specific applications. For example, QoS may be a better KPI instead of localization accuracy. Finally, for a number of applications in which the reliability of position information is a key design parameter, such as RIS or UAV-empowered wireless systems, the position integrity and availability may be the most important KPIs. \subsubsection{Fundamental research} As we move towards mmWave, THz, and optical bands, the performance of integrated localization and sensing systems are naturally expected to improve. However, new issues and challenges need to be addressed, giving space to fundamental research. Specifically, the research concerning THz channel modeling as well as integrated localization and communication is still at the early stage. Next, we focus in these two topics and provide some possible research~directions. Most published contribution in high-frequency integrated localization and communication neglect the impact of multiple scatters and obstacles and employ deterministic channel models. However, in practice, the AOA as well as the amplitude of the scattered signals are random processes. It is of high importance to model the effect of non-LOS signals and of scatters in order to allow the accurate integrated localization and communication system performance evaluation. In this direction, new channel modeling methodologies based on stochastic geometry, random shape theory and electromagnetic tools, like ray tracing or the finite element method, need to be developed. Other phenomena that should be taken into consideration in signal modeling are the wideband effect as well as the impact of atmospheric conditions and/or the transceivers hardware imperfections. Finally, the channel and signal model should also account for the existance of smart materials, such as RISs. Building upon the new channel and signal models, a new theoretical framework for the analysis of the performance of integrated localization and communication systems will be developed. This framework should return not only conventional KPIs that quantify the performance either the localization or the communication part of the system, but also the novel KPIs that would be defined and allow the assessment of the integrated localization and communication system. Moreover, different system models that employ different types of localizers with and without RISs, need to be investigated. The derived expressions are expected to bring insights and allow the optimization of the integrated localization and communication~system. \subsubsection{Advanced signal processing} Mobile terminals at various tiers of a multi-tiered network may communicate with one another using distinct frequency bands and independent communication paths. In such scenarios, efficient and dynamic maintenance of wireless networks is a key concern for integrated localization and communication. Maintenance and reconfiguration of wireless connections may be possible via dynamic resource management and the utilization of multiple distinct frequency bands. In addition, cross-layer data exchange depends on efficient signal processing for its operation. In this respect, the use of common hardware for localization and communication services can provide high efficiency for signal processing technologies in integrated communication and localization services, as well as the required reusability of channel estimation units for position extraction. As a result, the most important challenge with respect to advanced signal processing is achieving efficient co-design of signal processing techniques and hardware architecture. \subsubsection{Waveform design} Despite the fact that localization and communication waveform designs share a number of common key requirements, including low-latency, low transceiver hardware complexity, and high reliability, in the 4G and the 5G eras, signals and systems for localization and communications were designed separately~\cite{Dammann2016,Raulefs2016}. As we move towards higher frequency wireless systems, the idea of designing a common signal for localization and communication arises. To achieve this we need to determine optimal signal PSDs that satisfies both the requirements of the localization accuracy and the communication robustness to interference. In more detail, according to~\cite{Dammann2016} and~\cite{Gezici2005}, the Cramer-Rao lower bound of time-based ranging localization systems can be expressed~as \begin{align} \mathrm{CR} = \frac{c^{2}}{8\pi^2\,b^2\,\frac{P}{N_o\,B}}, \label{Eq:CR} \end{align} where $P$ and $B$ are respectively the transmission power and bandwidth, while $N_o$ is the noise PSD. Moreover, $b^2$ is the mean square bandwidth that can be obtained~as \begin{align} b^2 = \frac{\int_{-B}^{B} f^2\,\left|S(f)\right|^2\,\mathrm{d}f}{\int_{-B}^{B}\left|S(f)\right|^2\,\mathrm{d}f}, \label{Eq:MSB} \end{align} with $S(f)$ being the Fourier transform of the transmission~signal. From~\eqref{Eq:CR} and~\eqref{Eq:MSB}, for the localization perspective, a signal that has its power concentrated to the edges of the spectrum achieves better performance in terms of localization accuracy, i.e., lower Cramer-Rao lower bound, in comparison to signals that their power is either uniformly distributed or concentrated at the center of their spectrum. From communications point of view, in order to reduce the inter-symbol interference, signals are designed in a way that their power is concentrated at the center of their spectrum. This observation reveals that there is a trade-off in terms of the PSD requirements for localization and communication. To find the equilibrium, optimization problems for a number of different system models is necessary to be formulated and suitable policies need to be extracted. Finally, adaptability and flexibility in terms of bandwidth, signal power, PSD shape, etc. should be allowed in order to make the most in real-time ever changing wireless~environments. \subsubsection{Pro-active radio environment mapping and radio resource management} In order to reap the communication benefits of the proactive radio resource management in areas like beam alignment, channel prediction, cell selection, and more, high-precision radio environment mappings will be necessary. The majority of the radio environment mappings models that exist so far has focused on 2D scenarios. With this in mind, more accurate 3D localization in nLOS, and multi-path applications is required for future 6G networks. In spite of the fact that a number of effective multi-path and NLOS mitigation algorithms have been proposed in the literature, these algorithms are typically quite complex and are only practical for remote localization systems as opposed to self-localization systems where the UE must perform the computation and estimation. However, for the sake of analytical simplicity, these studies often only include first-order reflection, even though higher-order reflections are common in dense multi-path settings and might be crucial to localization in NLOS situations. As a result, further research is required in order to develop more precise and inexpensive localization methods for multi-path scenarios while maintaining the UE's communication performance and allocating radio resources based on its current position. Finally,despite the fact that precise location data improves communication, a better understanding of the underlying connection between varying levels of location precision and transmission rates is required. \subsubsection{Design of integrated localization and communication protocols for heterogeneous networks} Future networks will become more diverse by using a wide variety of standards and frequency ranges. For mobile terminals that are constantly moving under unstable radio conditions, the challenge of how to swiftly transition between protocols is of paramount importance in order to maintain reliable localization and communication. Since each network layer can use a unique set of protocols, the creation of logical links between them can be achieved by considering the protocols as gateways. However, the need for cross-layer, -module, and -node information transfer constitutes the integrated protocol design crucial. Finally, a reevaluation of the physical and MAC layers with respect to the protocol design that takes into account localization in addition to the communication metrics is required. \subsection{Low earth orbit (LEO) localization systems} In rural/remote areas that lack terrestrial infrastructure or when the signals from the terrestrial infrastructure are blocked due to obstacles, such as in mmWave/THz transmissions, terrestrial- and LEO-based localization can be used in integrated terrestrial non-terrestrial networks to achieve the best from the two options. In future communication, sensing, and localization applications, and, especially, positioning applications with LEO signals, there is currently a dichotomy of approaches. On the one hand, existing systems can be utilized to offer novel services to the end users, while, on the other hand, completely new systems, such as the ongoing efforts towards a LEO-PNT concept, can be designed. In the former, the receiver is responsible for most of the optimization work based on the assumption that the necessary infrastructure is already in place. In the latter, a three-segment optimization is required, which can be achieved either simultaneously or in stages. In order to obtain higher precision for localization with worldwide coverage, future efforts on constructing unique LEO-PNT constellations through optimization are focused on (i) integration of 6G and LEO networks, (ii) intelligent beamforming-based localization, (iii) LEO-based edge computing, and (iv) equip LEO satellites with GNSS receivers. \section{Conclusion}\label{S:Conclusion} The potential of the future 6G wireless system for localization was investigated in this article. In more detail, the key localization-based applications and use cases for the next generation of wireless networks were discussed, and the technologies that enable localization services were investigated. Moreover, models of mmWave/THz as well as VLP localization wireless systems were presented , while also taking into account both LOS and NLOS channels that were generated by traditional reflectors as well as RISs. Also, the major localization KPIs were described and mathematical expressions were provided when possible. Furthermore, SotA traditional and learning-based localization techniques were presented alongside their conceptual figures. Finally, the impact of all design aspects of future 6G wireless systems, namely characteristics, assumptions, localization problem formulation, and optimization, were discussed, while lessons learned and future directions were extracted. \ifCLASSOPTIONcaptionsoff \newpage \fi \bibliographystyle{IEEEtran}
\section{Conclusion and Future Work} In this paper, we propose a novel vision attention alignment method to bridge the two intertwined processes in visual commonsense reasoning. In particular, a re-attention module is first introduced to model the fine-grained inter-modality interactions, followed by the attention alignment equipped with two alternative loss functions. We apply this method to both the conventional vanilla attention model as well as the recent strong VL-Transformers. Through the qualitative and quantitative experiments on the benchmark dataset, the effectiveness of our proposed method is extensively demonstrated. In the future, we plan to further explore this view, \textit{i}.\textit{e}., collaborating the two processes in VCR with a single framework. More techniques that involve the close connection of these two processes are worth more investigation. \section{Experiments} \begin{figure}[htb] \centering \includegraphics[width=0.99\linewidth]{image/convergence_analysis.pdf} \caption{Convergence analysis of baselines and our GIST model.} \label{fig:convergence_analysis} \end{figure} \subsection{Datasets and Evaluation Protocols } We conducted extensive experiments on the VCR benchmark, a large-scale dataset alongside this task. The images are extracted from the movie clips in LSMDC~\cite{LSMDC} and MovieClips\footnote{youtube.com/user/movieclips.}, wherein the objects inside images are detected via the Mask-RCNN model~\cite{MASK_RCNN}. We used the official dataset split, where the number of questions for training, validation, and testing are 212,923, 26,534, and 25,263, respectively. For each question, four answers are given with only one being correct, and there are also four rationale choices among which only one makes sense. Regarding the evaluation metric, we used the popular classification accuracy for Q$\rightarrow$A, QA$\rightarrow$R, and Q$\rightarrow$AR\footnote{For Q$\rightarrow$AR, the prediction is right only when both the answer and rationale are selected correctly.}. The ground-truth labels are available for the train and validation sets~\cite{R2C}. Therefore, we reported the performance of our best model on the testing set once and performed other experiments on the validation set. \subsection{Implementation Details} The PyTorch toolkit~\cite{PyTorch} is leveraged to implement our models, and all the experiments were conducted on a single GeForce RTX 2080 Ti GPU. The specific details of each model are shown below. \textbf{Vanilla attention model.} As for the input features, we employed the pre-trained object-level features extracted by TAB-VCR~\cite{TAB-VCR} as the visual features, and the pre-trained token embeddings from BERT as the textual features. All the trainable parameters are initialized with the default PyTorch settings. The training batch size is set to 96 and the alignment loss weight $\lambda$ is set to 1.0. The parameters are optimized with the Adam~\cite{Adam} optimizer with an initial learning rate $2\times10^{-3}$. \textbf{VL-Transformers.} In order to verify the generalizable capability of our attention alignment mechanism on VL-Transformers, we employ several classical VL-Transformer models~\cite{UNITER, VL-BERT, villa} as the backbone. For a fair comparison, we strictly followed the original implementations. \begin{figure*} \centering \includegraphics[width=0.9\linewidth]{image/ablation.pdf} \caption{Performance comparison of different models \emph{w/} and \emph{w/o} our attention alignment module.} \label{fig:ablation} \end{figure*} \subsection{Overall Performance Comparison} We evaluated our method by comparing its performance with three kinds of methods: (1) advanced VQA models. (2) Traditional VCR baselines. (3) VL-Transformers in VCR. The results on both validation and testing sets are reported in Table \ref{tab:overall}, and the key observations are as follows. \begin{itemize} \item First, a significant performance gap exists between traditional strong VQA models and VCR methods, especially for QA$\rightarrow$R. This is because VCR demands higher-order reasoning capability, which differs from the simple recognition in VQA. In addition, predicting the right rationale is even more challenging. \item Second, compared to the task-specific VCR models such as R2C~\cite{R2C} and CCN~\cite{CCN}, VL-Transformers demonstrate advantages in all metrics, indicating the effectiveness of the universal cross-modal representation learned by pre-training. \item Lastly, our method achieves the best performance over these state-of-the-art models. Especially, for both the vanilla attention and VL-Transformer VCR baselines, with our attention alignment mechanism, they can all achieve improved gains on both validation and test sets. For example, compared with TAB-VCR, an absolute improvement of 1.1$\%$, 1.2$\%$ and 1.6$\%$ can be observed on Q$\rightarrow$A, QA$\rightarrow$R and Q$\rightarrow$AR respectively. \end{itemize} \begin{table}[htb] \centering \caption{Effectiveness of different alignment losses.} \label{tab:align_loss} \scalebox{1}{ \begin{tabular}{llll} \toprule \makebox[0.25\linewidth][l]{Alignment Loss} & \makebox[0.17\linewidth][l]{Q$\rightarrow${A}} & \makebox[0.17\linewidth][l]{QA$\rightarrow${R}} & \makebox[0.17\linewidth][l]{Q$\rightarrow${AR}}\\ \midrule Vanilla attention & 68.8 & 70.8 & 48.9 \\ \emph{\quad w/} Align-Dot & 70.5 (\textcolor{blue}{+1.7}) & 72.5 (\textcolor{blue}{+1.7}) & 51.4 (\textcolor{blue}{+2.5}) \\ \emph{\quad w/} Align-Rank & 69.4 (\textcolor{blue}{+0.6}) & 71.9 (\textcolor{blue}{+1.1}) & 50.0 (\textcolor{blue}{+1.1}) \\ \midrule VL-BERT & 72.6 & 74.0 & 54.0 \\ \emph{\quad w/} Align-Dot & 73.2 (\textcolor{blue}{+0.6}) & 74.6 (\textcolor{blue}{+0.6}) & 54.9 (\textcolor{blue}{+0.9}) \\ \emph{\quad w/} Align-Rank & 73.2 (\textcolor{blue}{+0.6}) & 74.7 (\textcolor{blue}{+0.7}) & 54.9 (\textcolor{blue}{+0.9}) \\ \midrule UNITER & 74.4 & 76.9 & 57.5 \\ \emph{\quad w/} Align-Dot & 74.7 (\textcolor{blue}{+0.3}) & 77.2 (\textcolor{blue}{+0.3}) & 58.0 (\textcolor{blue}{+0.5}) \\ \emph{\quad w/} Align-Rank & 74.9 (\textcolor{blue}{+0.5}) & 77.0 (\textcolor{blue}{+0.1}) & 58.1 (\textcolor{blue}{+0.6}) \\ \midrule VILLA & 75.4 & 78.7 & 59.5 \\ \emph{\quad w/} Align-Dot & 75.9 (\textcolor{blue}{+0.5}) & 79.0 (\textcolor{blue}{+0.3}) & 60.2 (\textcolor{blue}{+0.7}) \\ \emph{\quad w/} Align-Rank & 76.0 (\textcolor{blue}{+0.6}) & 78.8 (\textcolor{blue}{+0.1}) & 60.1 (\textcolor{blue}{+0.6}) \\ \bottomrule \end{tabular}} \end{table} \begin{table} \centering \caption{Ablation study from our re-attention module on the validation set.} \label{tab:re-attention} \begin{tabular}{lccc} \toprule {Model} & {Q$\rightarrow${A}} & {QA$\rightarrow${R}} & {Q$\rightarrow${AR}}\\ \midrule Full model & 70.5 & 72.5 & 51.4 \\ \emph{w/o} token-wise Att & 70.1 & 71.5 & 50.4 \\ \emph{w/o} Att & 68.7 & 71.2 & 49.1 \\ \bottomrule \end{tabular} \end{table} \subsection{Ablation Study} To better illustrate the effectiveness of our model in detail, we conducted experiments on the essential parts of our method and reported the results on the validation set below. \textbf{Efficacy of the attention alignment.} Figure~\ref{fig:ablation} demonstrates the effect of our attention alignment mechanism for both the vanilla attention model and VL-Transformers. From this figure, we can observe that among all the variants, our attention alignment mechanism consistently improves the base model on all metrics by a large margin. Take the vanilla attention model as an example, our attention alignment mechanism boosts it by 1.7\% (Q$\rightarrow$A), 1.7\% (QA$\rightarrow$R), and 2.5\% (Q$\rightarrow$AR). One main limitation of these baselines is that they neglect the visual consistency and the interactions between the answering and reasoning. In contrast, our visual attention alignment offers a bridge to connect these two processes and significantly enhances the baseline performance. Figure~\ref{fig:convergence_analysis} shows the convergence of answering and reasoning accuracy for baselines and our GIST model. It can be seen that the performance of baselines increases fairly or faster than our GIST model. Nevertheless, with more training steps, GIST outperforms all the baselines by a significant margin. One possible reason is that the baselines show certain disadvantages in these difficult instances as the model keeps training. In contrast, when aligning the visual attention between Q$\rightarrow$A and QA$\rightarrow$R, the model learns to leverage more accurate visual information to perform visual understanding, leading to more improvements. \begin{figure}[t!] \centering \includegraphics[width=1.0\linewidth]{image/lambda.pdf} \caption{Accuracy performance change with respect to different hyper-parameter $\lambda$. Q$\rightarrow${A} and QA$\rightarrow${R} use the left $y$-axis while Q$\rightarrow${AR} uses the right $y$-axis.} \label{fig:lambda} \end{figure} \begin{figure}[t!] \centering \includegraphics[width=1.0\linewidth]{image/similarity.pdf} \caption{Attention similarity statistics of baselines and our GIST model.} \label{fig:similarity} \end{figure} \begin{figure*}[t!] \centering \includegraphics[width=1\linewidth]{image/case_study.pdf} \caption{Attention weight distribution of the vanilla attention model and our proposed GIST model. The input question and image are shown in the first column, followed by the attention distribution of the baseline in Q$\rightarrow$A and QA$\rightarrow$R (column 2-3), and GIST in Q$\rightarrow$A and QA$\rightarrow$R (column 4-5).} \label{fig:case_study} \end{figure*} \textbf{Align-Dot v.s. Align-Rank.} As discussed in Section~\ref{sec:align}, we applied two candidate alignment loss functions to align the two attention maps from the two processes. Table \ref{tab:align_loss} reports the results obtained from different alignment losses. One can see that both loss functions bring certain performance improvements over respective baselines. Specifically, for the vanilla attention model, the \emph{Align-Dot}, which is more demanding, can achieve significantly better results. We suspect that one possible reason is that the carefully designed re-attention module can capture the attention precisely. \textbf{Re-Attention of the vanilla attention model.} In order to investigate the effectiveness of our re-attention module in the vanilla attention model, we designed two variants and reported the results in Table~\ref{tab:re-attention}. After removing the token-wise attention module from our model, we can observe performance degradation on all three metrics. It validates that different textual tokens contribute distinctively to visual feature learning. We then replaced all the attention computation with the mean operation and showed the results in the last row of this table. One can see that the model performance drops sharply compared with the previous two. \subsection{Hyper-parameter Study} In this section, we study the influence of the trade-off hyper-parameter $\lambda$ on the performance of our GIST model. The results on both the vanilla attention model and UNITER are shown in Figure~\ref{fig:lambda}. As we increase the loss weight $\lambda$, the model performance keeps being enhanced. This result demonstrates the effectiveness of our designed attention alignment mechanism. However, a too-large weight will lead to a deteriorating result. For instance, a loss weight larger than 0.4 for UNITER negatively hurts the model performance. \subsection{Qualitative Results} It is expected that our attention alignment operation should pull the attention maps from the two processes similarly so that the model prediction can be made according to consistent visual cues. To justify this, we performed some qualitative results from the following two angles. \textbf{Similarity of attention maps.} We leveraged the \emph{Align-Dot} to perform the attention alignment and estimated the attention similarity between Q$\rightarrow$A and QA$\rightarrow$R. The histogram of the similarity values is shown in Figure~\ref{fig:similarity}. As can be observed, the attention similarity from baseline models is mostly less than 0.2. In contrast, our GIST model yields more consistent visual reasoning results as the similarity is increased significantly. \textbf{Attention map visualization.} To gain a deeper insight into our attention alignment mechanism, in this section, we also provide some qualitative examples in Figure~\ref{fig:case_study} to compare the attention distribution of the baseline and our method. Regarding the first instance, the baseline puts more attention on the \emph{lamp} regions while ignoring the critical \emph{person} areas. However, though the answer is wrongly predicted, the rationale is unexpectedly selected correctly. This supports our argument that the answer prediction and rationale selection should depend on the same evidence otherwise may lead to unpredictable results. As to the second instance, without the attention alignment, the baseline focuses more on the \emph{chair1} object, which is less relevant to the given question. Our GIST model corrects this mistake and obtains the right selection for both Q$\rightarrow${A} and QA$\rightarrow${R}. The last one shows that the attention weights are distributed incorrectly for both processes. With the consistent alignment of our method, both Q$\rightarrow${A} and QA$\rightarrow${R} can be accurately predicted. \section{Introduction}\label{sec:intro} \IEEEPARstart{V}{isual} Question Answering (VQA) has received increasing interest over the past few years, which requires correctly answering natural language questions about a given image~\cite{VQA1}. Despite significant progress having been made, existing VQA benchmarks mainly focus on answering simple recognition questions (\textit{e}.\textit{g}., \emph{how many} or \emph{what color}), while the explanation of the question answering is often ignored. To close this gap, Visual Commonsense Reasoning (VCR) has recently been presented as a challenge for researchers~\cite{R2C}. Specifically, beyond answering the cognition-level questions (Q$\rightarrow$A) as canonical VQA does, VCR further prompts to provide a rationale for the correct answer (QA$\rightarrow$R) (see Figure~\ref{fig:teaser} for an example). In fact, VCR poses more challenges than VQA, which can be seen in the following two aspects: 1) on the data side -- the images in the VCR dataset describe more complex situations in the real world, and the questions are rather challenging and require high-level visual reasoning capabilities (e.g., \emph{why} or \emph{how}). And 2) on the task side -- it is hard to simultaneously figure out the right answer and its right rationale. Typically, VCR models first predict the answer, based on which the rationale can then be selected from the candidates. As the question answering has proved to be non-trivial for traditional VQA models~\cite{VQA2, language-bias1, language-bias2}, finding the right rationale simultaneously is even more difficult. Current VCR methods mostly enhance the visual understanding with the given query\footnote{Either question or question with the correct answer (see Figure~\ref{fig:teaser}).} (\textit{i}.\textit{e}., to overcome the first challenge), and could be roughly divided into two categories: the first one is to leverage the intra-modality correlations to enhance separate feature learning, and inter-modality ones between vision and linguistics to correctly reason~\cite{HGL, TAB-VCR, CCN}; the other is to employ large external datasets to pre-train a general multi-modal model, and then transfer it to VCR for learning a better joint representation of the image and text~\cite{Unicoder, ViLBERT, UNITER}. Although these methods have achieved promising results, they are all still limited by a common problem -- the Q$\rightarrow$A and QA$\rightarrow$R are handled independently, with the inherent relationship between these two processes being ignored. The second challenge thus remains unsettled, resulting in the sub-optimal performance of these methods. \begin{figure}[!t] \centering \includegraphics[width=1.0\linewidth]{image/teaser.pdf} \caption{An instance of the VCR task and the attention distribution over image objects. There are two sequential processes in VCR: Q$\rightarrow$A and QA$\rightarrow$R. We propose to steer the attention from the right rationale (R1) to be similar to the ground-truth answer (A4) while making other negative pairs dissimilar (such as R2 and A4).}\label{fig:teaser} \end{figure} In general, separately treating these two processes would inevitably lead VCR to degenerate into two VQA instances\footnote{Note that for QA$\rightarrow$R, the `question' to a VQA model now becomes the original question appended with the right answer. And the corresponding candidate `answer' set is accordingly composed of several rationales.}. For each given question, existing methods consider Q$\rightarrow$A and QA$\rightarrow$R as two independent cases, rather than two sequential reasoning processes of one question. This makes Q$\rightarrow$A and QA$\rightarrow$R disjoint, deviating from the original intention of VCR. Moreover, answering and justification are actually consistent and coherent in human cognition: \emph{the human brain would capture and leverage the same evidence from the image for the two processes}. Consequently, a better way to deal with VCR is to handle both via common cues. Thanks to the shared information provided by the same image, we align the visual attention of these two for better coordination. To seamlessly bridge the two processes, in this paper, we propose an a\textbf{G}ree on v\textbf{IS}ion a\textbf{T}tention model (dubbed GIST) for simple yet effective visual reasoning in VCR. Our method is composed of two consecutive modules. First, we design a novel re-attention module to model the fine-grained multi-modal interactions between queries and images. In particular, our attention module is two-stage: the first stage calculates the relevance between image regions and textual query tokens; the second stage combines the attention map of each token to obtain one single attention vector for each process. Secondly, we align the produced attention maps over the given image, guiding the two processes to ‘look at the same image regions’. Specifically, our method enforces an alignment loss between the attention maps from two processes, aiming to obtain similar attention maps during training. To test the effectiveness of our method, we conduct extensive experiments on the VCR dataset. We test our GIST method on both the vanilla visual attention models as well as the most recent Vision Language Transformers (VL-Transformers)~\cite{VL-BERT, UNITER, villa}. Both quantitative and qualitative results demonstrate that our method can significantly outperform the baseline method, confirming the utility of aligning vision attention of the two intertwined processes. In summary, the contribution of this paper is threefold: \begin{itemize} \item This work addresses the question answering and rationale prediction in VCR with a unified framework. In particular, we propose an attention alignment module to guide Q$\rightarrow$A and QA$\rightarrow$R to make predictions with the same visual evidence. \item We design a novel GIST method that skillfully aligns the visual attention from the two processes. We apply this method to both the vanilla visual attention model and the recent VL-Transformers. \item We conduct extensive experiments on the VCR dataset to demonstrate the effectiveness of our method. The code has been released\footnote{https://github.com/SDLZY/VCR\_Align.}. \end{itemize} \section{Proposed Method} Based on task intuition and human cognition, the answering and reasoning processes in VCR should be made cohesive and consistent. Nevertheless, existing methods often treat them separately, rendering the commonsense reasoning less convincing. To tackle these two processes jointly, we resort to aligning the visual attention of question answering and rationale inference processes for a better collaborative connection and design our GIST method. In the following, we first introduce the method's intuition and background knowledge, followed by our proposed visual attention alignment method. We then detail its implementation on the model with vanilla attention and the recent VL-Transformer with self-attention, respectively. \begin{figure}[!t] \centering \includegraphics[width=0.99\linewidth]{image/overview.pdf} \caption{Pipeline of the proposed method. Both Q$\rightarrow$A and QA$\rightarrow$R share the same image, which is encoded by the common image encoder. $t$ denotes the input tokens. The Q$\rightarrow$A takes the image, question, and answer as input, and produces its attention map. Similarly, we can also obtain the attention map from QA$\rightarrow$R. Our goal is to make these two attention maps as similar as possible, so that these two processes \emph{see} the same image regions for reasoning.} \label{fig:overview} \end{figure} \begin{figure*}[!t] \centering \includegraphics[width=1.0\linewidth]{image/vanilla_attention.pdf} \caption{Architecture of our proposed method with vanilla attention network (Left) and VL-Transformers (Right). For the vanilla attention model, we sequentially perform object-wise and token-wise attention to obtain the final attention maps for all the detected objects. Pertaining to the VL-Transformers, the attention weights are extracted from the self-attention operation.}\label{fig:vanilla_attention} \end{figure*} \subsection{Method Intuition} Given an image $I$ and a question $Q$ about this image, the goal of visual commonsense reasoning is to both predict the right answer $A_{+}$, as well as the correct rationale $R_{+}$ (the right and false ones are denoted as $+$ and $-$, respectively). In general, VCR comprises two multiple-choice processes: question answering (Q$\rightarrow$A) and answer justification (QA$\rightarrow$R). \textbf{Q$\rightarrow$A} aims to predict the correct answer $A_{+}$ from a set of answer choices $\mathcal{A}$ to the given question $Q$ upon the image $I$, which can be achieved by, \begin{equation} \label{eq:objective_q2a} A_{+} = \mathop{\arg\max}\limits_{A_i\in{\mathcal{A}}} {f(I, Q \mid A_i)}, \end{equation} where $f$ denotes the Q$\rightarrow$A model. Specifically, both question $Q$ and candidate answer $A_i$ are expressed in terms of textual sentences, and the image $I$ consists of $n$ objects $\mathcal{O} = \{o_i\}_{i=1}^{N}$ detected by a Mask-RCNN model~\cite{MASK_RCNN}. Previous methods train $f$ by minimizing the cross entropy loss\footnote{We employ the single instance loss rather than the batch-wise one for simplicity.}, \begin{equation} \mathcal{L}_{Q \mapsto A} = - y[A_+] \log\frac{\exp{f(I, Q \mid A_+)}}{\sum\nolimits_{i=1}^{\mid \mathcal{A} \mid}\exp{f(I, Q \mid A_i)}}, \end{equation} where $y[A_+]$ denotes the index of the ground-truth answer. \textbf{QA$\rightarrow$R} is different from Q$\rightarrow$A wherein the input is now composed of question $Q$ and its correct answer $A_{+}$ (a straightforward way is to concatenate these two together). The objective of QA$\rightarrow$R is to select the correct rationale $R_{+}$ from a rationale set $\mathcal{R}$ (see Figure~\ref{fig:teaser}), \begin{equation} \label{eq:objective_qa2r} R_{+} = \mathop{\arg\max}\limits_{R_i\in{\mathcal{R}}} {g(I, Q, A_{+} \mid R_i)}, \end{equation} where $g$ denotes the QA$\rightarrow$R model. The optimization function is similarly defined as follows, \begin{equation} \mathcal{L}_{{QA \mapsto R}} = - y[R_+] \log\frac{\exp{g(I, Q, A_{+} \mid R_+)}}{\sum\nolimits_{i=1}^{\mid \mathcal{R} \mid}\exp{g(I, Q, A_{+} \mid R_i)}}, \end{equation} where $y[R_+]$ represents the ground-truth rationale for the given image and question. Note that both $f$ and $g$ share identical structures and are often trained separately~\cite{CCN, VCR_TMM1}. To bridge these two connected processes, we propose a visual attention alignment module in the next. \subsection{Visual Attention Alignment} \label{sec:align} Inspired by human cognition, we argue that the visual evidence exploited in answering and justification should be the same. As these two processes share the same image (see Equation~\ref{eq:objective_q2a} and Equation~\ref{eq:objective_qa2r}), the fundamental visual attention thus offers a natural bridge for connecting them. In view of this, we propose to align the visual information based on the attention maps calculated by $f$ and $g$. Visual attention is an integral component for current vision-language models~\cite{BUTD1, VCR_TMM2}. A typical VCR model often involves a visual attention module on the object set $\mathcal{O}$. In particular, the visual attention learns a set of attention score $\{c_i\}_{i=1}^N$ for each image object, where $\sum_{i=1}^N c_i = 1$. A large $c_i$ usually represents that the $i$-th object has more influence for answering the current question. As discussed earlier, there are two sets of attention maps: $\mathcal{C}_{Q \mapsto A}$ -- the attention weights from model $f$, and $\mathcal{C}_{QA \mapsto R}$ -- the attention weights from model $g$. To achieve the goal that $f$ and $g$ employ the similar image regions, our idea is to learn another module that drives $\mathcal{C}_{Q \mapsto A}$ and $\mathcal{C}_{QA \mapsto R}$ closer. Specifically, we implement this by pulling the similarity of attention maps from the correct answer ${A_+}$ and the correct rationale ${R_+}$, while pushing away other negative pairs. In this paper, we propose an attention alignment loss to make the Q$\rightarrow$A and QA$\rightarrow$R learn to agree on visual regions. We formalize our attention alignment loss below, \begin{equation} \begin{cases} \mathcal{L}_{Q \mapsto A}^{Att} = -y[A_+] \log\frac{\exp{s(\mathcal{C}_{Q \mapsto A}^{A_+}, \mathcal{C}_{QA \mapsto R}^{R_+})}}{\sum\nolimits_{i=1}^{\mid \mathcal{A} \mid}\exp{s(\mathcal{C}_{Q \mapsto A}^{A_i}, \mathcal{C}_{QA \mapsto R}^{R_+})}}, \\ \mathcal{L}_{QA \mapsto R}^{Att} = -y[R_+] \log\frac{\exp{s(\mathcal{C}_{QA \mapsto R}^{R_+}, \mathcal{C}_{Q \mapsto A}^{A_+})}}{\sum\nolimits_{i=1}^{\mid \mathcal{R} \mid}\exp{s(\mathcal{C}_{QA \mapsto R}^{R_i}, \mathcal{C}_{Q \mapsto A}^{A_+})}}, \\ \mathcal{L}_{Align} = \mathcal{L}_{Q \mapsto A}^{Att} + \mathcal{L}_{QA \mapsto R}^{Att} , \end{cases} \end{equation} where $\mathcal{C}_{Q \mapsto A}^{A_i}$ represents the attention weights from model $f$ according to the $i$-th answer $A_i$; $\mathcal{C}_{QA \mapsto R}^{R_i}$ denotes the attention weights from model $g$ according to the $i$-th rationale $R_i$, and $s(\cdot, \cdot)$ is a similarity function. We detail how we implement $s(\cdot, \cdot)$ in the following: \begin{itemize} \item One intuitive approach to measure the similarity between two sets of attention weights is the dot product. We refer to this method as \emph{Align-Dot}, \begin{equation*} s(\mathbf{c}_p, \mathbf{c}_t) = \mathbf{c}_p^T \mathbf{c}_t. \end{equation*} \item Inspired by the \emph{learning to rank} models in the field of information retrieval~\cite{L2R}, we use the list-wise approach to align the ranking of attention weights and name this method \emph{Align-Rank}. To this end, we first obtain the permutations of the two attention vectors prediction $\boldsymbol{\pi}_p$ and target $\boldsymbol{\pi}_t$. Thereafter, we employ the NDCG metric optimization~\cite{NDCG, App_Rank} in our experiments: \begin{equation} \begin{aligned} s(\boldsymbol{\pi}_p, \boldsymbol{\pi}_t) &= NDCG(\boldsymbol{\pi}_p, \boldsymbol{\pi}_t) \\ &= Z_{N}^{-1}\sum_{i=1}^{N}\frac{G(\pi_{pi})}{\log(1+\pi_{ti})}, \end{aligned} \end{equation} where $G(\pi_{pi})$ denotes a gain function, \textit{e}.\textit{g}., $G(\pi_{pi}) = 2^{\pi_{pi}} - 1$, $Z_{N}^{-1}$ acts as the maximum of $G(\pi_{pi}) / \log(1+\pi_{ti})$, \textit{i}.\textit{e}., the value when the predicted attention permutation of $\boldsymbol{\pi}_p$ is the same as the target one $\boldsymbol{\pi}_t$. Nevertheless, directly optimizing NDCG with back-propagation is impossible due to its non-differentiable nature. To approach this problem, we then smooth the permutation function with~\cite{App_Rank}, \begin{equation} \hat{\pi}_{pi} = 1 + \sum_{j\neq i}\frac{\exp\{-\alpha(c_{pi} - c_{pj})\}}{1 + \exp\{-\alpha(c_{pi} - c_{pj})\}}, \end{equation} where $\alpha$ is a hyper-parameter, and $c_{pi}$ denotes the attention value of the $i$-th object. \end{itemize} By combining the aforementioned loss functions, the final objective becomes, \begin{equation} \mathcal{L} = \mathcal{L}_{{Q \mapsto A}} + \mathcal{L}_{{QA \mapsto R}} + \lambda \mathcal{L}_{Align} \end{equation} where $\lambda$ is a trade-off hyper-parameter. Our method is applicable to both vanilla visual attention models as well as the most recent VL-Transformers. In the following, we will show its implementation on these two typical models. \subsection{Application on the Vanilla Attention Model} Before the prevalence of VL-Transformers in VCR, conventional methods all adopt the vanilla attention mechanism to focus on the most salient image regions based on the textual information. In view of this, we intend to explore whether our proposed visual attention alignment method works under such settings. Specifically, we take the TAB-VCR~\cite{TAB-VCR} as a typical baseline to implement our method. Note that the two processes, \textit{i}.\textit{e}., Q$\rightarrow$A and QA$\rightarrow$R share the same structure, we, therefore, use the Q$\rightarrow$A as an example as the QA$\rightarrow$R can be easily extrapolated. \subsubsection{Overall Framework} In this subsection, we first introduce the overall framework of TAB-VCR. \textbf{Image \& Language Encoder.} Images in the VCR dataset~\cite{R2C} consist of objects detected by Mask-RCNN~\cite{MASK_RCNN}. We leverage this fine-grained information and utilize the pre-trained Convolutional Neural Network (CNN) model~\cite{ResNet} to extract the object features $\mathcal{O}=\{\boldsymbol{o}_1, ..., \boldsymbol{o}_N\}$. Pertaining to the textual input, we first concatenate the question $q$ and each answer $a_i$ and then employ a pre-trained word embedding to obtain the embeddings. Note that each sentence in VCR includes both text and some object tags, as shown in Figure~\ref{fig:vanilla_attention}. Following previous studies~\cite{R2C, TAB-VCR}, we take the word embeddings and the object features in their right order as input to a bidirectional RNN~\cite{GRU}. Specifically, if an input token is a tag referring to an object $o_{t}$, and the corresponding object feature will be $\boldsymbol{o}_{t}$; otherwise, it is the embedding of the entire image. The query and response can be encoded into a sequence of hidden states $\{\boldsymbol{h}_1, ..., \boldsymbol{h}_{M}\}$ by an RNN model: \begin{equation} \label{eq:rnn} \boldsymbol{h}_t = \mathsf{RNN}([\boldsymbol{t}_i, \boldsymbol{o}_{t_i}]; \boldsymbol{h}_{t-1}), \end{equation} where $\boldsymbol{o}_{t_i}$ denotes the $t_i$-th object's feature if $\mathbf{t}_i$ is a tag otherwise the averaged feature of all objects. \textbf{Classifier.} After the visual reasoning between the given question and image (which will be detailed in the next subsection), we treat VCR as a multi-class classification problem. In particular, we use the last hidden state $\boldsymbol{h}_M$ from RNN and the refined image feature $\hat{\boldsymbol{o}}$ as the representation of the question-answer pair and image, respectively. Our classifier is implemented with a multi-layer perceptron (MLP)~\cite{MLP} to compute a score for the candidate answers: \begin{equation} \label{eq:classifier} \hat{y_i} = \boldsymbol{W}_1\sigma({\boldsymbol{W}_0[\boldsymbol{h}_M, \hat{\boldsymbol{o}}]}), \end{equation} where $\sigma$ is the LeakyReLU~\cite{ResNet} activation function, and $\boldsymbol{W}_0$ and $\boldsymbol{W}_1$ are the learned weight matrices in the MLP. We omit the bias vectors for simplicity. \subsubsection{Re-Attention} \label{sec:vanilla-re-att} A typical model often extracts the visual features with a CNN model~\cite{cnn-mm} and takes the output $\mathcal{O}$ as the vision features for Equation~\ref{eq:rnn}. Different from it, we propose a re-attention module to distribute distinctive attention weights, which serves as an important part of our attention alignment goal. Specifically, our re-attention module consists of attention computation from two directions: object-wise and token-wise. The former takes each token feature as a query and learns the attention weights for all the objects. In contrast, token-wise attention collects the most informative signals of each token based on the fused token information from the former step. \textbf{Object-wise Attention.} It is intuitive that for each token, different objects often contribute distinctively to the learning of the textual features. For example, in Figure~\ref{fig:teaser}, the \emph{[person5]} object is more important than other objects for learning the token \emph{smiling} in the question. In light of this, we employ the token to attend to each specific object as follows, \begin{equation} \begin{cases} \bar{\mathbf{c}}_{o_{t_i}} = \mathsf{MLP} (\mathbf{t}_i)^T \mathsf{MLP} ([\mathbf{o}_1, \mathbf{o}_2 \cdots \mathbf{o}_N]), \\ \mathbf{c}_{o_{t_i}} = \mathsf{SoftMax} (\bar{\mathbf{c}}_{o_{t_i}}),\\ \end{cases} \end{equation} where $\mathbf{c}_{o_{t_i}}$ and $\bar{\mathbf{c}}_{o_{t_i}} \in \mathbb{R}^M$. In this way, we can have $M$ attention maps over all the objects, where $M$ is the number of tokens. \textbf{Token-wise Attention.} After the object-wise attention operation, we then employ another attention module to estimate the importance of each token with respect to the overall textual feature. To implement this, we take the output from RNN model $\mathbf{h}_M$ as a query, and perform attention over all the token features, \begin{equation} \label{eq:re-att1} \begin{cases} \bar{\mathbf{c}}_t = \mathsf{MLP} (\mathbf{h}_M)^T \mathsf{MLP} ([\mathbf{h}_1, \mathbf{h}_2, \cdots, \mathbf{h}_M]), \\ \mathbf{c}_t = \mathsf{SoftMax} (\bar{\mathbf{c}_t}),\\ \end{cases} \end{equation} where $\mathbf{c}_t$ and $\bar{\mathbf{c}_t} \in \mathbb{R}^M$. Thereafter, we employ the attention weights, \textit{i}.\textit{e}., the importance of tokens $\mathbf{c}_t$, to multiply that of the set of attention maps, to obtain the overall attention weights over objects $\hat{\mathbf{o}}$, \begin{equation} \label{equ:final_att} \begin{aligned} \mathbf{c}_o &= \sum_{i=1}^M c_{t_i} \times \mathbf{c}_{o_{t_i}}, \\ \hat{\mathbf{o}}&= \sum_{i=1}^N c_{o_i} \times \mathbf{o}_i. \end{aligned} \end{equation} \subsubsection{Attention Alignment} We then obtain the refined image feature in Equation~\ref{eq:classifier} and perform the final classifier for predicting the right answer or rationale. Thereafter, following Equation~\ref{equ:final_att}, the two attention sets can be easily collected from $\mathbf{c}_o$. One is for $\mathcal{C}_{Q \mapsto A}$, and the other is $\mathcal{C}_{Q \mapsto A}$. The visual attention alignment from Sec.~\ref{sec:align} can thereby be performed. \begin{table*}[htb] \centering \caption{Performance comparison on the validation and testing sets. The best results are highlighted in bold.} \begin{tabular}{{r}|ccc|*{6}{c}} \toprule \multirow{2}{*}{Model} & \multirow{2}{*}{VQA} & \multirow{2}{*}{VCR} & \multirow{2}{*}{Transformer} & \multicolumn{2}{c}{Q$\rightarrow$A} & \multicolumn{2}{c}{QA$\rightarrow$R} & \multicolumn{2}{c}{Q$\rightarrow$AR} \\ \cmidrule(lr){5-6} \cmidrule(lr){7-8} \cmidrule(lr){9-10} & & & & valid & test & valid & test & valid & test \\ \midrule Chance & & & & 25.0 & 25.0 & 25.0 & 25.0 & 6.2 & 6.2 \\ \midrule RevisitedVQA~\cite{RevisitedVQA} & \checkmark & & & 39.4 & 40.5 & 34.0 & 33.7 & 13.5 & 13.8 \\ BUTD~\cite{BUTD1} & \checkmark & & & 42.8 & 44.1 & 25.1 & 25.1 & 10.7 & 11.0 \\ MLB~\cite{MLB} & \checkmark & & & 45.5 & 46.2 & 36.1 & 36.8 & 17.0 & 17.2 \\ MUTAN~\cite{MUTAN} & \checkmark & & & 44.4 & 45.5 & 32.0 & 32.2 & 14.6 & 14.6 \\ R2C~\cite{R2C} & & \checkmark & & 63.8 & 65.1 & 67.2 & 67.3 & 43.1 & 44.0 \\ CCN~\cite{CCN} & & \checkmark & & 67.4 & 68.5 & 70.6 & 70.5 & 47.7 & 48.4 \\ HGL~\cite{HGL} & & \checkmark & & 69.4 & 70.1 & 70.6 & 70.8 & 49.1 & 49.8 \\ TAB-VCR~\cite{TAB-VCR} & & \checkmark & & 69.5 & 70.5 & 71.6 & 71.6 & 50.1 & 50.8 \\ VL-BERT~\cite{VL-BERT} & & \checkmark & \checkmark & 72.6 & 73.4 & 74.0 & 74.5 & 54.0 & 54.8 \\ UNITER~\cite{UNITER} & & \checkmark & \checkmark & 74.4 & 75.5 & 76.9 & 77.3 & 57.5 & 58.6 \\ \midrule $\text{GIST}_{\text{Vanilla}}$ & & \checkmark & & \bf{70.5}& \bf{71.2} & \bf{72.5}& \bf{72.0} & \bf{51.5}& \bf{51.4} \\ $\text{GIST}_{\text{VL-Transformer}}$& & \checkmark & \checkmark & \bf{74.9}& \bf{75.6} & \bf{77.0}& \bf{77.5} & \bf{58.1}& \bf{58.8} \\ \midrule Human & & \checkmark & & - & 91.0 &- & 93.0 &- & 85.0 \\ \bottomrule \end{tabular} \label{tab:overall} \end{table*} \subsection{Application on the VL-Transformer} VL-Transformers have been widely studied over the past few years~\cite{VL_Transformers1, VCR_TMM3}. In this section, we show how our attention alignment method works under such self-attention settings. \subsubsection{Overall Framework} The structure of a typical single-stream VL-Transformer is illustrated in Figure~\ref{fig:vanilla_attention}. \textbf{Transformer Encoder.} As can be observed, the input sequence starts with a special classification token (\textit{i}.\textit{e}., [CLS]), and then goes on with query and response elements, visual tokens, and ends with a special ending token (\textit{i}.\textit{e}., [END]). A special separation token (\textit{i}.\textit{e}., [SEP]) is introduced between every two parts of the input. Following the practice in BERT~\cite{BERT}, the input textual sentence is first split into tokens by the WordPiece tokenizer~\cite{WordPiece}, which are then transformed into vectors by the embedding layer. Pertaining to the vision inputs, each token is represented as the detected object features, the same as that in the vanilla attention model. After obtaining these embeddings, we then add them with the segmentation and position embeddings, so that the sequential information can be encoded into the transformer model. Thereafter, these embeddings are inputted to several Transformer blocks, wherein each of them consists of a self-attention layer, a feedforward network, and some layer normalization operations. \textbf{Classifier.} The features from both vision and language are fused and interacted with the Transformer model. And it is expected that visual reasoning is also performed. At last, the final block's output of the [CLS] token is fed to a Softmax classifier to predict whether the given response is the correct choice. \subsubsection{Re-Attention} The key to a Transformer model is multi-head self-attention. Given query and key matrices, $\mathbf{Q}$ and $\mathbf{K}$, the single head attention is formally defined as follows, \begin{equation} \label{equ:sa} \mathsf{SA}(\mathbf{Q}, \mathbf{K}) = \mathsf{SoftMax} (\frac{\mathbf{Q}^T\mathbf{K}}{\sqrt{d_k}}), \end{equation} where $d_k$ is the dimension of keys and values and acts as a scaling factor. The more commonly used multi-head self-attention is formulated, \begin{equation} \mathsf{MSA}(\mathbf{Q}, \mathbf{K}) = \mathsf{Concat} (h_1, \cdots, h_k) \mathbf{W}, \end{equation} where $k$ is the number of attention heads, which is calculated by the $\mathsf{SA}$ function in Equation~\ref{equ:sa}. One advantage of VL Transformers is that they offer holistic attention estimation with the [CLS] token. In this way, we do not have to aggregate all the information from textual tokens in the first step, as Sec.~\ref{sec:vanilla-re-att} does. \subsubsection{Attention Alignment} To achieve the attention alignment goal, we first average all the information from the $k$ heads. Thus, we obtain an $L$ layers attention map for the [CLS] token. We then extract the attention to the visual tokens and have an attention matrix $\mathbf{C}_o \in \mathbb{R}^{L \times N}$. To this end, we perform the visual attention alignment for each layer following the guidance of Sec.~\ref{sec:align}. \section{Related Work} \label{sec:related_work} \subsection{Visual Commonsense Reasoning} Conventional VQA mainly focuses on the recognition capability of models~\cite{VQA1, VQA5}. Until recently, VCR has emerged to study commonsense understanding, putting forward higher requirements in AI systems' cognitive reasoning abilities. To address this task, many approaches have been proposed, which can be roughly divided into the following two categories. The initial methods endeavor to devise task-specific architectures for VCR. Some of them explore a variety of sophisticated reasoning structures (\textit{e}.\textit{g}., holistic attention mechanism) to construct interactions between the image and text. For instance, R2C~\cite{R2C} performs three inference steps -- grounding, contextualization, and reasoning, to effectively solve the visual cognition problem. Inspired by the neuronal connectivity of the brain, CCN~\cite{CCN} designs a graph method to globally and dynamically integrate the local visual neuron connectivity; HGL~\cite{HGL} integrates the intra-graph and inter-graph to bridge the vision and language modalities. In addition, as some questions cannot be directly answered from only the image information, external commonsense knowledge is also exploited in the cross-modal reasoning process~\cite{KVL-BERT}. Another prevalent stream is to apply VL-Transformers to the downstream VCR for both Q$\rightarrow$A and QA$\rightarrow$R~\cite{VL-BERT, Unicoder}. For example, UNITER~\cite{UNITER} designs four novel pre-training tasks with conditional masking to learn universal image-text representations for various downstream multi-modal tasks. ViLBERT~\cite{ViLBERT} applies a dual stream fusion encoder to process visual and textual inputs in separate streams, followed by the modality interactions with co-attentional Transformer layers. MERLOT RESERVE~\cite{MERLOT_RESERVE} first learns task-agnostic representations through sound, language, and vision of videos~\cite{videos}, and then transfers these features to the downstream VCR task. Although both categories of methods have achieved improved results, they all view the two processes in VCR as two independent VQA instances. As a result, the critical correlations between these two are ignored, resulting in weak visual reasoning. In this work, we propose an effective attention alignment framework to bridge these two processes directly. \subsection{Attention in Visual Question Answering} The past few years have witnessed increasing growth in the research area of VQA. Among the existing methods, visual attention-based ones have demonstrated substantial advantages in feature learning. Traditional approaches focus more on the correlation learning between each image region and the whole question sentence~\cite{VQA5, VQA6}. Thereafter, the co-attention mechanism jointly performs the question-guided attention over image regions and the image-guided attention over question words~\cite{Co-Attention}. In addition to these top-down attention methods, BUTD~\cite{BUTD1, BUTD2} combines both the top-down and bottom-up attention, which first detects the salient objects inside an image and then leverages the top-down attention technique to locate the most relevant regions according to the given question. VQA-HAT~\cite{Human-LikeAttention1} and Attn-MFH~\cite{Human-LikeAttention2} point out that the attention maps produced by VQA models are inconsistent with human cognition. They, therefore, attempt to design more explicitly visual reasoning methods and have achieved certain improvements. \subsection{Vision-Language Transformers} \label{sec:pre-train-objective} Transformers have achieved great success in the field of Natural Language Processing (NLP)~\cite{BERT} and Computer Vision (CV)~\cite{ViT}. Because of their effectiveness, transformers also attract much attention in multi-modal studies. Based on how the vision and language branches are fused, current VL-Transformers can be roughly categorized into single-stream (\textit{e}.\textit{g}., UNIMO~\cite{UNIMO} and SOHO~\cite{SOHO}) and dual-stream cross-modal Transformers (\textit{e}.\textit{g}., LXMERT~\cite{LXMERT} and ALBEF~\cite{ALBEF}). In general, VL-Transformers adopt a \emph{pretrain-then-finetune} learning paradigm: these models are firstly pre-trained on large-scale multi-modal datasets (such as Conceptual Captions~\cite{Conceptual_Captions}) for learning universal cross-modal representations, and then fine-tuned on downstream tasks by transferring their rich representations from pre-training. In particular, the pretext tasks play an important role in pre-training, where masked language modeling, masked region prediction, and image-text matching are extensively studied. The fine-tuning step mirrors that of the BERT model~\cite{BERT}, which includes a downstream task-specific input, output, and objective. VL Transformers mainly help the following three groups of downstream tasks: cross-modal matching, cross-modal reasoning, and vision language generation~\cite{Survey_of_VLTransformer}. The first group focuses on learning cross-modal correspondences between vision and language, such as image text retrieval and visual referring expression. Reasoning ones require VL Transformers to perform language reasoning based on visual scenes, such as VQA. The last group aims to generate the targets of one modality given the other as input~\cite{X-LXMERT}. The desired visual or textual tokens are decoded in an auto-regressive generation manner.
\section{Introduction} \label{sec: intro} In the U.S. in 2021, 61.2 million people aged 12 or older (22\% of the population) used substances and 46.3 million (17\% of the population) met the criteria for having a substance use disorder (SUD)~\cite{substance2021}. Despite the prevalence of SUDs and substance use, 94\% of people with a SUD did not receive treatment. There are significant barriers to seeking treatment, including stigma (negative biases including stereotypes, prejudice, and discrimination~; \cite{corrigan2002understanding}). Studies have shown that, of those people who did perceive a need for treatment, 22.7\% report stigma as a reason for lack of seeking out treatment~\cite{ashford2019abusing}. Stigma has measurable consequences on the health and well-being of people who use substances (PWUS): it contributes to diminished help-seeking~\cite{clement2015impact}, medication non-adherence~\cite{sirey2001stigma}, healthcare avoidance~\cite{byrne2008healthcare}, worse healthcare~\cite{van2013stigma}, poor health outcomes~\cite{byrne2008healthcare,stangl2019health}, and lower quality of life~\cite{cheng2019negative}. Indeed, stigma, in general, is a central driving force for population mortality~\cite{hatzenbuehler2013stigma}. While extensive research has been conducted on the automatic detection of related concepts of hate speech and toxic language on social media~\cite{fortuna2018survey}, stigma and, in particular, stigma towards PWUS has received relatively little attention. This is despite the fact that roughly half of the people in treatment for SUDs have reported that their online communities contain triggering content~\cite{ashford2018technology}. The standard pipeline for the automatic detection of hate speech on social media is to collect a corpus of posts (from Twitter or Reddit, for example) and label each post as to whether or not it contains hate speech through a crowd-sourcing annotation task. These labels, typically produced through a majority vote across the annotations, are then used to train a machine learning classifier to automatically detect hate speech on unseen data. Recently, several issues have been identified with this pipeline where the annotation process and majority voting introduce substantial biases into the final machine learning model through, for example, annotator demographics~\cite{diaz2018addressing}, annotator beliefs~\cite{sap-etal-2022-annotators}, insensitivity to dialects of minority populations~\cite{sap-etal-2019-risk} Thus, increasing focus is being given to understanding \emph{who} is annotating data, what are the annotators' beliefs, moral values, and lived experiences, and how can machine learning methods incorporate dissenting opinions and disagreement~\cite{davani-etal-2022-dealing,prabhakaran2021releasing}. In this paper, we attempt to automatically identify stigmatizing content on social media by centering people who are the subject of the stigma -- those who have lived experience with substance use. This is done in an attempt to understand both manifestations of stigma and \emph{who} perceives it through three research questions: \begin{itemize} \item \textbf{RQ1} Can stigma towards people who use substances (PWUS) be automatically identified? \item \textbf{RQ2} Does lived experience with substance use inform how often stigma is perceived? \item \textbf{RQ3} Are there linguistic differences between stigma perceived by people with lived experience with substance use and those without? \end{itemize} To do this we collect a sample of 5,000 Reddit comments that contain mentions of substances or substance use and run a crowd-sourcing task where we pay Amazon Mechanical Turk (Mturk) workers to label the posts as having stigma towards PWUS. We also ask the workers a series of demographic and substance use-related questions. Using this demographic information, we assign stigma labels to each Reddit comment through a learning framework that allows one to center various demographic distributions, also known as jury learning~\cite{gordon-jury-learning}. We end by examining the linguistic cues associated with stigma across different populations. \paragraph{Contributions} Our key contributions include: (1) the public release of a data set of stigma-annotated Reddit comments along with demographic variables of the annotators; (2) we show that annotators with lived experience with substance use are more likely to label a social media post as stigmatizing through the evaluation of a machine learning classifier which centers groups of annotators with common attributes; and (3) we identify linguistic markers associated with stigmatizing social media posts as highlighted by annotators with lived experience with substance use. \section{Related Work} \label{sec: related work} \subsubsection{Deinfition of Stigma Toward People Who Use Substances} Stigma can be thought of as a collection of negative biases against certain groups of people, which often incorporate three components: stereotypes, prejudice, and discrimination~\cite{corrigan2002understanding}. All three components can manifest through interpersonal interactions or intrapersonally, known as self-stigma. Following Link and Phelan \cite{link2001conceptualizing}, stigma consists of the ``identification of differentness, the construction of stereotypes, the separation of labeled persons into distinct categories, and the full execution of disapproval, rejection, exclusion, and discrimination'' by people with access to ``social, economic, and political power''. While many group experience stigma, this paper is focused on stigma experienced by people who use substances or people with a SUD. \subsubsection{Stigma and Hate Speech on Social Media} Social media is a well-known means of sharing harmful and stigmatizing content online \cite{jilka2022identifying,li2018analysis,li2020comparison,li2018detecting,oscar2017machine,founta2018large,golbeck2017large}. In a population of people in treatment for SUD, approximately 74\% had social media and 47 percent reported their online communities to contain triggering content \cite{ashford2018technology}. Similarly, studies have shown up to 60 percent of people felt they were treated unfairly due to having a SUD, and 39.5 percent reported at least three types of stigmatizing experiences in their daily lives \cite{luoma2007investigation}. The first tools used to counter stigmatizing and hateful posts online put the onus on social media users themselves to label posts as inappropriate \cite{kayes2015social}. Research efforts similarly utilized manually annotated datasets to label hateful and stigmatizing social media content \cite{golbeck2017large,mcneil2012epilepsy,founta2018large,davidson2017automated}. Studying hate speech in online text, particularly social media such as Facebook or Twitter \cite{macavaney2019hate}, has proved informative along the lines of sexual orientation \cite{stefuanitua2021hate,waseem2016hateful}, gender \cite{waseem2016hateful,waseem2016you,basile2019semeval}, religion \cite{albadi2018they,waseem2016hateful}, race \cite{de2018hate,waseem2016you, waseem2016hateful}, ethnicity \cite{waseem2016hateful}, and immigration status \cite{basile2019semeval,ross2017measuring}. Previous work has expanded to studying hate speech toward people with health conditions such as HIV/AIDS and COVID-19, which often stem from identifying factors such as sexual orientation and ethnicity \cite{durul2019hate,uyheng2021characterizing}. \begin{table*}[ht] \resizebox{\textwidth}{!}{ \begin{tabular}{lc|lc|lc|lc|lc}\toprule Keyword & N (\%) & Keyword & N (\%) & Keyword & N (\%) & Keyword & N (\%) & Keyword & N (\%) \\ \hline acid & 379 (7.6) & dab & 77 (1.5) & lsd & 137 (2.7) & opiate & 127 (2.5) & shrooms & 73 (1.5)\\ adderall & 78 (1.6) & drug & 2396 (47.9) & marijuana & 174 (3.5) & opioid & 109 (2.2) & valium & 19 (0.4) \\ addy & 12 (0.2) & fentanyl & 35 (0.7) & mdma & 76 (1.5) & oxy & 24 (0.5) & weed & 762 (15.2) \\ cocaine & 128 (2.6) & heroin & 173 (3.5) & meth & 216 (4.3) & oxycodone & 5 (0.1) & xanax & 61 (1.2) \\ codeine & 18 (0.4) & kratom & 111 (2.2) & molly & 56 (1.1) & percocet & 4 (0.1) & xans & 16 (0.3) \\ coke & 242 (4.8) & kush & 28 (0.6) & norco & 3 (0.1) & purp & 7 (0.1) & xtc & 6 (0.1) \\ \bottomrule \end{tabular} } \caption{Percentage of comments in the combined training and test data containing each substance keyword. } \label{table:drug keywords} \end{table*} \subsubsection{Automatic Detection of Stigma and Hate Speech} The large post volume on social media platforms makes it difficult to moderate stigma and hate speech without implementing automatic detection algorithms \cite{jilka2022identifying,li2020comparison}. Although censoring hateful language has long been a major point of contention \cite{rainie2017future}, social media companies have begun developing algorithms to automatically remove hate speech and block users who express it \cite{mathew2019thou}. Social media platforms and researchers alike have leveraged annotated datasets to train automatic detection algorithms to cover the overwhelming volume of posts on social media platforms \cite{mathew2019thou,liu2022deep,oscar2017machine}. Along with physical health conditions such as COVID-19 \cite{liu2022deep}, automatic stigma and hate speech detection has recently been implemented in the context of mental health conditions such as depression \cite{li2018detecting,li2020comparison}, schizophrenia \cite{li2020comparison,jilka2022identifying}, and suicide \cite{li2018analysis}. Automatic detection has also been applied to labeling social media content related to substance use \cite{roy2017automated,zhang2018utilizing}. However, stigma toward PWUS on social media is only beginning to be explored \cite{chen2022examining}, and no work has implemented the automatic detection of stigma toward PWUS, which constitutes a gap this project seeks to address. \section{Data} \label{sec: data} \subsection{Annotation Data} We begin with 1.66 billion Reddit comments from 2019 collected from pushshift.io~\cite{baumgartner2020pushshift}. We then identify comments which contain at least one substance use keyword (see below for keyword selection and disambiguation process) for a total of 9.3 million comments. From this, we select 5,000 random comments for our annotation task. In Table \ref{table:drug keywords}, we break down the substance keyword distribution of these 5,000 comments. \paragraph{Substance Keywords} We identify comments related to substance use by identifying posts containing at least one of the following keywords: drug*, opioid*, opiate*, heroin, kratom, crack, cocaine, marijuana, meth, weed, coke, fentanyl, oxy, norco, oxycodone, codeine, pot, percocet, smoke, smokes, xanax, xans, LSD, and ecstasy. These keywords were chosen to identify posts about specific substances (e.g., LSD or meth), a breadth of substances (e.g., we do not focus solely on opioids), general substances (e.g., drug*), and substance \emph{use} (e.g., smoke). All keywords were agreed upon by an interdisciplinary team of substance use researchers. As an initial quality control check, we manually checked a random set of 1,000 posts in order to identify any obvious inconsistencies with our keyword data. Through this process, we identified several simple heuristics designed to reduce false positives (i.e., comments that do not refer to substances) and, thus, removed comments containing the following phrases: hillary, clinton, obama, bernie, bern, sanders, trump, gab, weed out, crack jokes, crack me up, *white pill, black pill, red pill, blue pill, *whitepill*, *blackpill*, *redpill, *bluepill* and crazy pill. This resulted in 8,798,160 comments and is referred to as the Substance Keyword data set below. \paragraph{Substance Keyword Disambiguation} We note that multiple keywords used to identify the Substance Keyword data set have multiple senses, many of which are not related to substances. For example, ``I smoked pot'' and ``I used a pot to cook.'' Thus, we attempt to refine our keyword list by removing keywords less likely to be referring to substances. To do this, two annotators were asked to rate 1,000 random comments (from the Substance Keyword data set above) for the following: ``Is this post about substances? Posts may reference substances by name, slang, or you may be able to determine by context.'' Both annotators are substance use researchers. The two raters agreed on 93.2\% of posts with a Cohen's Kappa score of 0.85. A total of 61.1\% of the 1,000 posts referred to substances (where both annotators agreed). Keywords were retained if they were used to discuss substances in more than 50\% of their occurrences or if they did not occur in the 1,000 random posts (using the assumption that these were rare words that would not dramatically increase false positives). The keywords ``acid'' was found to refer to substances in only 41\% of posts containing that keyword, yet, after internal discussions, it was decided that this keyword should be retained. \begin{table}[!b] \centering \begin{tabular}{lcc}\toprule & Full Sample & Final Sample \\ \cmidrule(lr){2-2}\cmidrule(lr){3-3} & M (SD) or \# (\%) & M (SD) or \# (\%) \\ \hline Age & 38.4 (10.5) & 38.8 (10.8) \\ Gender & & \\ \hspace{3mm} Female & 241 (42.7\%) & 180 (45.0\%) \\ \hspace{3mm} Male & 371 (56.5\%) & 215 (53.8\%) \\ \hspace{3mm} Transgender, agender, etc. & 5 (0.80\%) & 5 (1.20\%)\\ Race / Ethnicity & & \\ \hspace{3mm} African American & 80 (14.2\%) & 61 (10.8\%) \\ \hspace{3mm} Asian & 23 (4.1\%) & 20 (3.5\%) \\ \hspace{3mm} White & 447 (79.1\%) & 308 (77.0\%) \\ Substance Use & & \\ \hspace{3mm} Know someone with a SUD & 382 (67.6\%) & 259 (64.8\%) \\ \hspace{3mm} Use substances & 369 (65.3\%) & 212 (37.5\%) \\ \hspace{3mm} Days of SU in the past 30 days & 6.6 (10.4) & 5.0 (9.7) \\ \bottomrule \end{tabular} \caption{Demographic distribution of MTurk workers. Full Sample $N=565$, Final Sample $N=400$.} \label{tab:demographics} \end{table} \subsection{Model Evaluation Data} \paragraph{Train and Test Split} The jury learning framework is an annotator-level model, which predicts each worker's annotations given comment text, past annotations, and group-level information. As such, we evaluate the model on unseen (or held out) Reddit \emph{comments}, as opposed to unseen workers or annotations. As described below in the Annotation Task section, the final annotated data set consists of 6,147 annotations of 3,802 comments from 400 workers. We create a random train/test split by taking 80\% and 20\% of the comments for training and testing, respectively. This results in 4,761 annotations across 3,042 comments in the training data and 1,386 annotations across 760 comments in the test data. This data set is used for \textbf{RQ1}. \paragraph{Evaluating Stigma in the Wild} In order to identify stigmatizing language across Reddit (\textbf{RQ2} and \textbf{RQ3}), we apply the trained jury learning model to a large, random sample of unseen comments. As such, we collect 10,000 random comments from the Substance Keyword data set which do not appear in annotated data (i.e., do not appear in the training or testing data). \section{Annotation Task} \label{sec: annotation} We begin by asking consenting Amazon Mechanical Turk (MTurk) workers a series of demographic questions (age, gender identity, and race/ethnicity), how many times they've used substances for non-medical reasons within the past 30 days, and if they know anyone who is in treatment for substance use disorder. Note that due to the potentially sensitive nature of these questions, we did not force a response to the survey, which has implications for the final sample (see below for final data filtering). We then give the workers a short training on the task, specifically what types of posts reference drugs (e.g., posts about drug stores or pharmacies should not be considered) and how to define stigma. Workers are then given a short three-question quiz, where they are shown the correct answer upon completion of the quiz (no workers are removed for incorrect quiz answers). See the Appendix for the full survey question text, quiz questions, and attention check. After completing the demographic survey and training materials, workers are then shown a series of 20 random Reddit comments. For each of the 20 comments, the workers are asked the question \emph{Q-Sub}: ``Are the drug-related words in this post being used to talk about drugs? (Yes/No)'' If the worker responded \emph{Yes}, then the second question \emph{Q-Stigma} is asked: ``Does this post contain stigmatizing language? (Yes/No)''. This second question was skipped if the worker responded \emph{No} to \emph{Q-Sub}. For both questions there is a 5-second delay before the submit button is displayed, in an attempt to force the worker to read the Reddit comment thoroughly. After 10 Reddit comments, an attention check question is asked (see Appendix for details on the attention check), which is immediately followed by the final 10 Reddit comments. The maximum number of annotations per comment was set to 3. Workers are paid \$2.50 for completing the demographic questions and annotating 20 Reddit posts. In order to both view and work on this task, workers were required to be located in the U.S., have an approval rating of 80\% or higher, and have at least 100 approved HITs (Human Intelligence Tasks). \begin{figure}[!t] \centering \includegraphics[width=.5\textwidth]{figures/annotations_per_group.png} \caption{Percentage of stigma labels (red) and non-stigma labels (blue) for each binary demographic group across the Full Sample. Grey dotted line is the percentage of positive stigma labels across the entire sample (65\%). } \label{fig:labeled posts} \end{figure} \begin{figure}[!b] \centering \includegraphics[width=.5\textwidth]{figures/stigma_yes_histogram.pdf} \caption{Distribution of the worker-level percentage of positive stigma annotations across the Full Sample (the number of positive stigma annotations divided by the worker's total number of annotations). PWUS are shown in blue and those who have not used substances are shown in orange. } \label{fig:stigma histogram} \end{figure} \subsection{Annotation Results} Due to the randomization process and workers not completing the full task, not all of the 5,000 comments were seen by workers, nor were all comments rated three times (our desired number of annotations per comment). As such, at the end of the annotation process, a total of 4,991 comments were rated at least once by one of the 704 workers who attempted this task. We then removed workers who: (1) failed the attention check, (2) did not answer all questions in the demographic survey, and (3) did not complete the full series of 20 annotations in a single HIT (i.e., quit the task early). Note that, if the worker answered \emph{No} to \emph{Q-Sub} then they were not asked to rate the comment for stigma. Thus, we further refined the data set to only those comments which were annotated for stigma at most three times. This produced a data set of 4,600 comments rated at least once for stigma by 565 workers for a total of 9,392 annotations. The demographic distribution of this worker sample is seen in the Full Sample column of Table \ref{tab:demographics}. Next, we examined the distribution of positive stigma labels (i.e., stigma is present in the comment) across the workers. In Figure \ref{fig:labeled posts}, we see the percentage of labeled posts across each of the different demographic groups: those who use substances, those who know someone in treatment for a SUD, gender, and race/ethnicity. We see significant differences (via two-sided t-test) in the number of positive stigma labels across those who use/do not use substances ($t=48.4$, $p<0.01$) and those who know/don't know someone in treatment ($t=16.4$, $p<0.01$). Gender ($t=0.62$, $p>0.05$) and race/ethnicity ($t=-0.58$, $p>0.05$) differences are not statistically different. In Figure \ref{fig:stigma histogram}, we plot a distribution of the percentage of positive stigma labels across each worker's total annotations (the number of positive stigma labels divided by the worker's total number of annotations). We plot this distribution for both people who have used substances at least once in the past 30 days (blue) and those who did not (orange). As seen in this figure, there is a large spike at the tail end where workers rated over 95\% of their annotations as stigmatizing. Notably, the majority of people in this bin use substances. While this behavior may point to bad data (random or unreliable annotations), we note that the workers in this bin passed the attention check, fully responded to the demographic survey, and did not always positively identify each post as referring to substances (\emph{Q-Sub}). Additionally, if this was a sign of unreliable workers, it should be distributed randomly across the demographics, yet this pattern only holds across those who use substances and those who know someone with a substance use disorder and not age, gender, and race/ethnicity. While we believe these annotations to be useful data, they cause an imbalance in our data set. 65\% of the annotations are labeled as stigmatizing, which is much higher than previous studies on toxic language, which tends to find positive labels rare. Therefore, we remove 165 workers who rated at least 95\% of their annotations as positive for stigma. This leaves a final data set of 6,147 annotations across 3,802 comments from 400 workers. Their demographic distribution is found in the Final Sample column of Table \ref{tab:demographics}. This final data set has 47\% of annotations labeled as stigmatizing. \section{Methods} \label{sec: methods} Our analysis proceeds in three steps: (\textbf{RQ1}) training and evaluating the jury learning model, (\textbf{RQ2}) evaluating the effect of demographic representation within the jury, and (\textbf{RQ3}) identifying linguistic queues associated with stigma. First, we train and evaluate an annotator-level jury learning model, to assess how well our model can classify stigma annotations from text, person-level information, and group-level information. Next, we apply the trained jury model to a set of unseen Reddit comments and assess how different jury configurations (e.g., juries consisting of PWUS and those who do not) change the final stigma label. Finally, we identify language associated with labels and examine where different populations agree/disagree on stigmatizing content in order to understand how people perceive stigma. \begin{figure*}[!h] \centering \includegraphics[width=.9\textwidth]{figures/4_x_4.pdf} \caption{The effect of the jury demographic distribution on the amount of stigmatizing content across the data set. Each dot is the percentage of the 10,000 comments labeled as stigmatizing, where each comment is rated by 10,000 random juries. The color of the line indicates the threshold used to assign the final comment label from the 10,000 jury votes (e.g., a blue line means that a comment is labeled as stigmatizing if at least 50\% of the 10,000 juries vote positive stigma). Within each plot, moving from left to right increases the representation of jurors with a given demographic within each of the 10,000 juries (e.g., juries in (d) at 0 are all male and at 12 are all female).} \label{fig:distributions} \end{figure*} \subsection{Jury Learning} Jury learning is a supervised machine learning framework used to predict an individual annotator's label on unseen examples (in our case, stigmatizing content on Reddit) developed by Gorden et al. \cite{gordon-jury-learning}. Jury learning draws on the notion of juries in the U.S. legal system specifically through the use of group voting (as opposed to single judge) and the jury selection process. Modeling each annotator in the data set grants practitioners the ability to define the representation of groups of people in the training data. Thus, practitioners can build a jury relevant to the problem at hand from a large pool of annotators. In our example, since the final desired label is whether or not a Reddit post is stigmatizing towards PWUS, we might want the majority of our jurors to know someone in treatment for a SUD. It is easy to imagine similar examples for other toxicity detection related tasks, such as annotating gender stereotypes, hate speech towards racial minorities, etc. The jury learning model follows a Deep and Cross Network (DCN), which is a standard recommender system architecture~\cite{wang2021dcn}. Using a movie recommender system as an example, the recommender system will model the movie itself, a person's past viewing history, and who that person is. In more general terms, this architecture models three distinct pieces of information: content (i.e., the movie), group (i.e., who this person is), and person (i.e., the person's viewing history). Applied to this setting, the DCN models the Reddit comment (content), worker demographics (group), and each worker's annotation history (person). More formally, the DCN consists of an embedding layer, a cross network, and a deep network. The embedding layer is a concatenation of the content, group, and person embeddings. This is then fed into the cross network which models the explicit interactions between the three embedding types through the use of cross layers. The output of the cross network is then fed into the deep network (a standard feed-forward network) to model implicit interactions. We initialize our model and vectorizer with a standard BERTweet model~\cite{bertweet,liu2019roberta}. Using a similar training procedure to Gorden et al. \cite{gordon-jury-learning}, we train the BERTweet model and the DCN on 5 epochs of our data, allowing it to alter the underlying BERTweet model. We then freeze the BERTweet model and train for 15 more epochs. We note that Gorden et al. \cite{gordon-jury-learning} do an initial fine-tuning step where the BERTweet model is fine-tuned on a large toxicity data set. We chose not to do this initial fine-tuning as the data set is focused on toxicity detection, which may be different from substance use related stigma. Since our end goal is to understand stigmatizing content, we felt that this fine-tuning process may introduce unintended biases toward general toxicity. As described in the Data section, the DCN is trained on 80\% of the comments in the final annotation data and evaluated on the remaining 20\% of comments. We use BERTweet's pooler output as the content embeddings. We include five worker-level demographics (group embedding): continuous age, binary gender (1 for female, 0 otherwise), binary race/ethnicity (1 if African American, 0 otherwise), knowing someone in treatment (1 if the worker knows someone, 0 otherwise), and continuous number of times the worker used substances in the past 30 days. We also include a one-hot encoding of each worker (person embedding). See Appendix for full details and hyperparameter values. \subsubsection{Baselines} We compare the DCN to two baselines: Linguistic Inquiry and Word Count (LIWC) and unigrams. In all baselines, we consider models trained on (1) text-based features and (2) text-based features plus worker-level demographics (age, gender, race/ethnicity, substance use in the past 30 days, and knowing someone in treatment for a SUD). We also include a simple Most Frequent Class (MFC) classifier. All features are used within either a logistic regression (LIWC) or an Extra Trees Classifier (unigrams). We use the same training and test data as the DCN. See Appendix for full details and hyperparameter values (which are set via 10 fold cross validation on the training data). \paragraph{LIWC} LIWC is a dictionary consisting of 73 manually curated categories, including both content and function words, and is one of the most widely used dictionaries in social and psychological sciences~\cite{pennebaker2015development}. Example categories include positive and negative emotions, pronouns, verbs, and adjectives. \paragraph{Unigrams} We extract unigrams using a tokenizer designed for social media data~\cite{dlatk}. On the training data set there are 17,752 unique unigrams. In order to keep the number of features less than the number of observations in the training data (4,761 annotations), we remove rare unigrams: any unigram used by less than .5\% of the training data (24 annotations). This results in a total of 1,312 unigrams in the final feature space. \subsubsection{Evaluation} Here we attempt to answer \textbf{RQ2}: Does lived experience with substance use inform how often stigma is perceived? We begin with 4 binary demographic splits: female/not female, African American/not African American, uses substances/does not uses substances, knows/does not know someone in treatment. Given a set jury size of 12, we consider all possible jury configurations for each of the 4 demographic splits. For example, a jury with 0 female/12 non-females, 1 female/11 non-females, etc. Then for each of the 10,000 comments in the evaluation data, we create 10,000 random (without replacement) juries for the given configuration (e.g., 10,000 juries with 1 female and 11 non-females). Next, for each of the 10,000 juries, we apply the trained jury model to the jurors to produce 12 stigma ratings (corresponding to the 12 jurors) for the comment. We assign a stigma label of 1 if more than half (7) of the jurors vote that the comment is stigmatizing, and assign 0 otherwise. Thus, for each of the 10,000 comments we have 10,000 labels, each label produced from the majority vote of the random juries. Next, in order to assign a final stigma label from the 10,000 jury ratings, we consider increasingly stricter thresholds on the percentage of positive stigma votes needed to assign the final label. For example, we begin by assigning a final label to a comment if 50\% of the 10,000 juries rate the comment as stigmatizing and increase this threshold up to 100\%. We do this for each of the 10,000 comments in the evaluation data set and look at the total percentage of stigmatizing posts across the entire data in order to see if this percentage changes as the demographic representations across the juries change. \subsection{Stigmatizing Language in the Wild} In order to identify stigmatizing language (\textbf{RQ3}), we first assign labels to each of the 10,000 Reddit comments using two separate juries types: a jury where all 12 members have used substances within the last 30 days and a jury where all 12 members have no used substances. At the individual jury level, a stigma vote is assigned if at least 7 members (i.e., the majority) vote that the comment is stigmatizing. As described above, we select 10,000 random juries (for each jury type) and label a comment as stigmatizing if at least 90\% of juries vote that the comment is stigmatizing. Thus, at the end, we have two labels for each of the 10,000 comments: one label each from the two jury types. For the first step of this analysis, we want to know where all juries \textbf{Agree} on stigma. Thus, we only consider comments where both juries types agree (e.g., substance using juries vote \emph{yes} stigma and non-substance using juries also vote \emph{yes} stigma). We then look at language features (LIWC and unigrams) associated with the binary stigma label. To do this, we perform a single regression for each feature in our feature space (a process called Differential Language Analysis or DLA; Schwartz et al. \cite{schwartz2013personality}). In particular, for each language feature, we perform an logistic regression where the independent variable is the relative frequency of a given language feature and the dependent variable is a binary variable set to 0 where both jury types vote \emph{no} stigma and 1 where both jury types vote \emph{yes} stigma. The LIWC category and unigram frequencies are standardized (mean-centered and divided by the standard deviation). Due to the large number of comparisons, we perform a Benjamini-Hochberg False Discovery Rate (FDR) correction and only consider associations significant at a corrected rate of $p<0.05$~\cite{benjamini1995controlling}. For the second step of this analysis, we want to know where people with lived experience with substance use see stigma, but those who do not have the same lived experience do not see stigma. Thus, we only consider comments where substance using juries vote \emph{yes} stigma and examine where non-substance using juries \textbf{Digree}. Again, we perform a series of independent logistic regressions (i.e., DLA) using LIWC category and unigram frequencies as the independent variables and a binary dependent variable: 0 where non-substance using juries vote \emph{no} stigma and 1 where non-substance using juries vote \emph{yes} stigma. Again, LIWC category and unigram frequencies are standardized and we apply a Benjamini-Hochberg FDR correction. In both steps, effect sizes are reported as a Cohen's D: the mean differnce between the two groups (the 0 and 1 binary labels) divided by the pooled standard deviation. \section{Results and Discussion} \label{sec: Results} Table \ref{tab:annotator level results} shows the results of the jury learning process (\textbf{RQ1}). Here we see that across all models, adding demographic features increases the predictive accuracy over Reddit comment language alone. We also see that using more sophisticated language features (e.g., BERTweet vs LIWC) increases predictive accuracy. In the end, the DCN (jury learning) using all three feature types (content, person, and group) outperformed all other models. In Figure \ref{fig:distributions}, we see the results of the jury learning model applied to 10,000 Reddit comments (\textbf{RQ2}). Juries with lived experience with substance use (either those who use substances or those who know someone in treatment) tend to label more content as stigmatizing and this increases as their representation within each jury increases. On the other hand, we do not see such pronounced increases across gender or race/ethnicity, both of which are marginalized populations and could be sympathetic to stigma (and thus see stigma where others may not). Here we see slight increases as both African Americans (Figure \ref{fig:distributions}(c)) and females (Figure \ref{fig:distributions}(d)) represent a larger portion of each jury In Figures \ref{fig:liwc correlations} and \ref{fig:unigram correlations}, we see language correlated with stigmatizing content (\textbf{RQ3}). In Figure \ref{fig:liwc correlations}, the \textbf{Agree} label is where both jury types (PWUS and those who do not) agree on stigma/no-stigma, while the \textbf{Disgree} label is where juries with PWUS see stigma, but those who do not use substances do not see stigma. As seen in Figure \ref{fig:liwc correlations} (\textbf{Agree} only), stigma is associated with the ANGER, SWEARING, NEGEMO (negative emotions), and SEXUAL categories. The SHEHE category is 3rd person singular pronouns, while PPRON and PRONOUN are general pronoun categories. Figure \ref{fig:unigram correlations} gives further context to these results. Here we see references to others (``people'', ``he'', ``she''), addicts and addiction, and references to children, parents, and schools. LIWC correlations with the \textbf{Disgree} label include INGEST, COGPROC (cognitive processes), and I (first person singular pronouns). Only a few unigrams were associated with the \textbf{Disgree} label: ``acid'', ``coke'', ``i'', ``weed'', and ``the''. Notably, this includes three specific substance types, whereas the \textbf{Agree} results in \ref{fig:unigram correlations} do not contain many references to substances, other than ``meth'' which is generally found to be associated with stigmatizing or dehumanizing content~\cite{linnemann2013your}. While the stigmatizing words associated with \textbf{Agree} contain mentions of others, the LIWC category I and the unigram ``i'' are both associated with \textbf{Disgree}. Thus, juries which contain PWUS identify stigma in comments which contain self-references, where juries who do not use substances do not find this. \begin{figure}[t] \centering \includegraphics[width=.5\textwidth]{figures/liwc_correlations.pdf} \caption{LIWC categories associated with the presence of stigma in comments where both substance using and non-substance using juries agree and disagree (substance using juries labeled as stigma and non-substance using juries did not). All correlations significant at a Benjamini-Hochberg significance level of $p < 0.05$. Note the x-scales of the two plots are different.} \label{fig:liwc correlations} \end{figure} \begin{figure}[t] \centering \includegraphics[width=.5\textwidth]{figures/agree_pos.D_0.069-0.312.png} \caption{Unigram's associated with the presence of stigma in comments where both substance using and non-substance using juries agree. Size of the word indicates the strength of the correlation (larger Cohen's D); color indicates relative frequency of usage (rare words are grey, frequent words are red, with blue in-between). All correlations significant at a Benjamini-Hochberg significance level of $p < 0.05$. Correlations (Cohen's D) range from 0.07 to 0.31. } \label{fig:unigram correlations} \end{figure} \section{Discussion} \section{Conclusions} \label{sec: conclusions} Our findings show that people with lived experience with substance use perceive both more stigma and respond to different linguistic signals, as compared to other marginalized or minority groups (gender or race/ethnicity). Despite this, there is general consensus on what types of language lead to stigmatizing content, for example, othering, swearing, and terms like ``addict'' (though by no means do we wish to imply that stigma is universally agree upon). Having a jury-based process in place for determining stigmatizing language provides a way to gain insights from data that would otherwise be difficult to analyze due to lack of inter-rater agreement. This process allows us to conduct a deeper linguistic analysis of messages where those with lived experience with substance use and those who do not differ in their determination of stigma. Our hope is that analysis would reveal concepts and language that might seem acceptable to those creating messaging for the substance use audience but is actually harming the recipient. Conversely, there may be messaging that would seem harmful but would instead be impactful. \subsection{Broader perspective and Ethical Considerations} There is increased attention to stigma in both mental health and substance use. This has become especially important in recent years as the U.S. deals with the opioid epidemic, which caused 91,799 fatal drug poisoning in 2020 and approximately 1 million deaths since 1999~\cite{hedegaard2022drug}. As such, there have been several calls for clinicians and researchers to choose the words they use to describe these stigmatized populations~\cite{volkow2021choosing}. For example, using the term ``poisoning'' instead of ``overdose'' to avoid implications that (1) there is a correct and safe dose and that (2) the substance user knows what a proper dose is and chose to take more. Similarly, NIDA, previously the National Institute on Drug Abuse, has changed its name to the National Institute on Diseases of Addiction. Thus, a linguistic analysis of stigma towards PWUS which centers those with lived experience is timely and may help reveal where additional work is needed~\cite{stull2022potential}. The Mechanical Turk HITs were written in mono-lingual English and workers were required to live in the U.S. Similarly, the LIWC dictionaries and BERTweet model used in this study only contain monolingual English. Therefore, the results presented here may not generalize outside the U.S. or to non-English languages or minority populations. The study protocol was approved by the Institutional Review Board at REDACTED. MTurkers were consented and informed on the nature of the study and what data was being collected. As with all studies using public social media data, none of the Redditors consented to having their comments collected, analyzed, and publicly released. See Chancellor et al. \cite{chancellor2019human} for a thorough discussion of the ethical issues (including informed consent) of ``humans'' in ``human centered machine learning.'' We have taken care to anonymize the released data. This includes (1) hashed Mechanical Turk worker-ids, (2) a manual check for identifying information within the Reddit comments, and (3) only releasing Reddit comment-ids instead of releasing the full comment text. Only releasing comment-ids allows Redditors the ability to delete their posts from the platform, which would prevent any future data pulls from collecting their labeled posts. Following the recommendations in Gebru et al. \cite{gebru2021datasheets}, our released data set includes a data sheet with information related to motivation, funding, the collection process, etc. Finally, our analysis includes very narrow senses of gender and race/ethnicity. We do not mean to imply that either construct is binary, but we do note that our data is limited in terms of representation. \section{Annotation Task Details} \paragraph{Demographics Survey} We ask the following demographic questions: (1) What is your age (in years)?; (2) What is your gender identity? Mark all that apply: Male, Female, Genderqueer, Agender, Transgender, Cisgender, A gender not listed (open ended); and (3) With which racial and ethnic group(s) do you identify: American Indian/Alaska Native, Hispanic, Latino/a, or Spanish origin, White, Asian, Middle Eastern or North African, Black or African American, Native Hawaiian or Other Pacific Islander, Another race or ethnicity not listed above (open ended). \paragraph{Substance Use Related Questions} We ask the following questions related to substance use: (1) How many times in the past 30 days have you used an illegal drug or used a prescription medication for nonmedical reasons? For instance, because of the experience or feeling it caused; and (2) Do you know anyone close to you who has ever had treatment (including addiction medication) or attended support groups (ex. AA, NA) for substance or alcohol use disorder: Yes/No. \paragraph{Quiz} We ask workers to answer the following three question quiz: (1) What should NOT be considered drug-related: mentions of a drug store, Insurance plans and prescription coverage, Posts written in a language other than English, All of the above; (2) If you saw the following post, how would you rate it? ``I have been taking extra medications because I like the way it makes me feel'': Yes, contains drug terms / No, does not contain drug terms; and (3) Which of the following might be considered stigma, or stigmatizing language? Mentions of: prejudice, discrimination, stereotypes, all of the above, none of the above. \paragraph{Attention Check} The following fake Reddit comment was created to be both unambiguously about substances and unambiguously stigmatizing: ``The average burglar is just some idiot, 20 year old crackhead. Stealing from people like me to buy drugs for them and their addict friends. They get what they deserve and belong in jail. At least they can't collect unemployment there.'' Workers were then asked the same two questions as all other Reddit comments: ``Are the drug-related words in this post being used to talk about drugs?'' and ``Does this post contain stigmatizing language?''. This attention check was asked at the halfway point in each task (after 10 of the 20 annotations). Given an incorrect answer (\emph{No} to either of the two questions), the associated annotations were deleted. Despite the fact that the data were not used in the final data set, workers were able to complete the task and were compensated the full amount. \section{Experimental Parameters} Following Gorden et al. \cite{gordon-jury-learning}, we use a DCN of 3 cross layers followed by 3 deep layers of size 768 (standard Multi-Layer Perceptrons with ReLU activation) finally feeding into a logit layer with an output of a single real number. We use an Adam optimizer with learning rate = $1\times 10^{-5}$. Models are trained are trained using NVIDIA RTX A6000 GPU. The baseline models include a logistic regression and extra trees classifier (ETC). Logistic regression parameters: C = 1000000 (for an $l_0$ penalty approximation), penalty = l2, dual = False, and random\_state = 42. ETC parameters: n\_jobs = 12, n\_estimators = 1000, max\_features = sqrt, criterion = gini, min\_samples\_split = 2, class\_weight = balanced\_subsample. Unless otherwise specified, all default values are used. Each classifier is implemented using the scikit-learn Python package~\cite{scikit-learn} within the DLATK Python package~\cite{dlatk}. \section*{Acknowledgments} We thank Mitchell L. Gordon for sharing his jury learning code. This research was supported in part by the Intramural Research Program of the NIH, National Institute on Drug Abuse (NIDA). \bibliographystyle{unsrt} \section{Introduction} \lipsum[2] \lipsum[3] \section{Headings: first level} \label{sec:headings} \lipsum[4] See Section \ref{sec:headings}. \subsection{Headings: second level} \lipsum[5] \begin{equation} \xi _{ij}(t)=P(x_{t}=i,x_{t+1}=j|y,v,w;\theta)= {\frac {\alpha _{i}(t)a^{w_t}_{ij}\beta _{j}(t+1)b^{v_{t+1}}_{j}(y_{t+1})}{\sum _{i=1}^{N} \sum _{j=1}^{N} \alpha _{i}(t)a^{w_t}_{ij}\beta _{j}(t+1)b^{v_{t+1}}_{j}(y_{t+1})}} \end{equation} \subsubsection{Headings: third level} \lipsum[6] \paragraph{Paragraph} \lipsum[7] \section{Examples of citations, figures, tables, references} \label{sec:others} \lipsum[8] \cite{kour2014real,kour2014fast} and see \cite{hadash2018estimate}. The documentation for \verb+natbib+ may be found at \begin{center} \url{http://mirrors.ctan.org/macros/latex/contrib/natbib/natnotes.pdf} \end{center} Of note is the command \verb+\citet+, which produces citations appropriate for use in inline text. For example, \begin{verbatim} \citet{hasselmo} investigated\dots \end{verbatim} produces \begin{quote} Hasselmo, et al.\ (1995) investigated\dots \end{quote} \begin{center} \url{https://www.ctan.org/pkg/booktabs} \end{center} \subsection{Figures} \lipsum[10] See Figure \ref{fig:fig1}. Here is how you add footnotes. \footnote{Sample of the first footnote.} \lipsum[11] \begin{figure} \centering \fbox{\rule[-.5cm]{4cm}{4cm} \rule[-.5cm]{4cm}{0cm}} \caption{Sample figure caption.} \label{fig:fig1} \end{figure} \subsection{Tables} \lipsum[12] See awesome Table~\ref{tab:table}. \begin{table} \caption{Sample table title} \centering \begin{tabular}{lll} \toprule \multicolumn{2}{c}{Part} \\ \cmidrule(r){1-2} Name & Description & Size ($\mu$m) \\ \midrule Dendrite & Input terminal & $\sim$100 \\ Axon & Output terminal & $\sim$10 \\ Soma & Cell body & up to $10^6$ \\ \bottomrule \end{tabular} \label{tab:table} \end{table} \subsection{Lists} \begin{itemize} \item Lorem ipsum dolor sit amet \item consectetur adipiscing elit. \item Aliquam dignissim blandit est, in dictum tortor gravida eget. In ac rutrum magna. \end{itemize} \section{Conclusion} Your conclusion here \section*{Acknowledgments} This was was supported in part by...... \bibliographystyle{unsrt}
\section{Introduction} \label{sec:intro} The absolute majority of software today is developed collaboratively, where developers work separately on a different part of the software, and then merge their code with the rest of the software. To allow this collaboration, source control tools, such as Git, were developed. Git is a standard protocol that supports file versioning, which is extensively used by programmers to collaborate on software development. A repository of files is maintained by GIT, allowing operations such as updating files (push/commit), merging file versions (merge), and splitting a project into two branches (fork). A hosting service such as GitHub\footnote{\url{https://github.com/}} allows users to maintain and share a repository, and also allows tracking issues such as bug reports, feature suggestions, fork repositories, maintain merge requests, etc. This makes GitHub an ecosystem of software, where interaction among developers reveal patterns of behavior~\cite{horawalavithana2019mentions}. For example, adding a new feature to a repository may trigger many forks to the repository since other people will want to modify the feature. Software is naturally prone to errors, and some of them can be exploited by hackers to abuse the software for malicious acts. These errors are often called vulnerabilities and are usually fixed by a software update called a security patch. Vulnerabilities can be divided into 2 classes: 0-day, a vulnerability that is not known to the public and still does not have a security patch, and N-day, one that has a security patch. The Common Vulnerabilities and Exposures (CVE\footnote{\url{https://cve.mitre.org/}}) is a glossary of publicly disclosed vulnerabilities. This CVE glossary details the vulnerability date, description, references, and metrics regarding the vulnerability such as its complexity whether user interaction is required, and more. Vulnerabilities are analyzed and the Common Vulnerability Scoring System (CVSS) is employed to evaluate the threat level. The CVE score is often used for prioritizing the security of vulnerabilities. It is a common practice that once a vulnerability is detected and fixed, the company or individuals behind the software issue a CVE to alert the user community of the security threat, hopefully urging them to integrate the security patch. However, some companies might not disclose their vulnerabilities and just update their repository. This behavior may be in order to allow certain users to use the patch sooner, as a measure of ``Security by obscurity'', or to avoid public embarrassment. The disadvantage of not disclosing vulnerabilities is that users will not be aware that their software needs to be updated, while hackers can notice the code changes, detect a vulnerability, and exploit it. Recent work \cite{sun2020identify, wang2021patchrnn} has shown the ability to analyze source code changes and commit messages using natural language processing models. These aforementioned models rely on a certain programming language or on the natural language used in the comments and commit messages. Hence, these earlier models are limited in their ability to detect security patches on a repository that uses other programming languages or where comments are written in a different natural language. For example, a model that was trained on detecting security patches in \textit{C++} would not be able to detect security patches in a \textit{Perl} repository, and since it is less popular, gathering a sufficient amount of data to train a model for \textit{Perl} would be difficult. In this paper, we propose a method that trains a deep learning (DL) model to recognize the user behavioral data around a security patch of a repository on GitHub (a window of events that will be defined in the Data Pre-processing Section), and uses CVE publications to label if it is related to a security patch. Importantly, our model is insensitive to the programming language, or the natural language used by the developers. This allows us to identify security patches in languages that are rather rare and thus do not have sufficient data to train a model. Our model was able to achieve an accuracy of 88.32\% and an F1-Score~ of 89.75\% in detecting a security patch. Hence, our approach can be effectively used for detecting undisclosed security patches. Since GitHub behavioral data is temporal (various actions over time), we experimented with appropriate models such as Long-Short Term Memory (LSTM) \cite{hochreiter1997long} and 1-Dimensional Convolutional Neural Network (Conv1D), which allow calculating relations between features at different time points. Note that we do not require Natural Language processing or manual labeling to detect security patches. We made the source code for our data extraction and our models publicly available at GitHub\footnote{\url{https://github.com/nitzanfarhi/SecurityPatchDetection}}. The relevant data-set is available as well\footnote{\url{https://nitzanfarhi.github.io/datasets}}. We note that our published data-set covers more repositories than any previous work. \section{Related Work} \label{sec:related} In this section, we provide an overview of different works in the field of detecting security patches using the CVE Program. PatchDB~\cite{wang2021patchdb} is a dataset of security patch commits on \textit{C/C++} projects. Each patch commit contains the additions and deletions made to the code and a commit message. This dataset was created by extracting security patch commits using the CVE Program (we use a similar extracting technique for our data collection). PatchDB was used in PatchRNN~\cite{wang2021patchrnn} where natural language processing methods were employed to detect which commit is a security patch. This is done by tokenizing the commit message, the additions, and the deletions. Later, the tokens were fed into an LSTM neural network to provide a prediction regarding a specific commit with an accuracy of 83.57\%. A similar process was suggested by \citet{le2021deepcva}. A vulnerability-contributing commit can be deduced from the security patch (e.g., by using the command `git blame'). In \citet{le2021deepcva} tokenizing was performed on vulnerability-contributing commits in \textit{java} repositories and an attention-based GRU was employed in order to classify the severity of the commit. \citet{zhou2021spi} selected 4 open-source \textit{C/C++} projects and filtered commits by using known keywords that describe a security patch. Then, security researchers were employed to manually label the commits as either commits that \emph{introduces} a vulnerability, commits that \emph{closes} a vulnerability, or commits that are \emph{unrelated} to vulnerabilities. Natural Language Processing methods were used to create a deep learning model based on LSTM and Convolutional Neural network, which led to a reported accuracy of 90\%. \cite{li2017large} also used the CVE Program to extract security patches from git repositories. This was done to analyze and gain insights into the security patches. The authors investigated the number of changes done to the code base, the maturity of the bugs, and the number of bugs that were solved by the commits. \cite{sun2020identify} extracted security patch commits from the CVE Program and verified that the commits are security patches by manually inspecting 200 of them. Then, the authors extracted the commit message only from GitHub (and did not use other features such as added lines, removed lines, or date). Repositories that contained C/C++ code were selected, and negative samples were acquired by taking all other commits from the same repositories. The natural language processing model that was used to detect the security patches was a hierarchical attention network with Gated Recurrent Units (GRU) \cite{cho2014learning} as its layers. \cite{sun2020identify} reached an accuracy of 92\%. VCCFinder \cite{perl2015vccfinder} extract security patches of \textit{C/C++} repositories similarly, but used them to understand which is the commit that introduced the vulnerability. This paper takes the first step in the direction we suggest by extracting limited meta-data: they use present ``fork count'', ``star count'', ``number of commits'' and ``programming language'' but disregard the entire history of these event data. A Support Vector Machine (SVM) model was employed to detect the vulnerability introducing commits. \cite{pickerill2020phantom} used meta-data of Git logs to solve a different problem: detecting repositories that are ``engineered'', namely repositories that are not personal nor inactive. For this they extracted Integration Frequency, Commit Frequency, Integrator Frequency, Committer Frequency, and Merge Frequency, and transformed it into a time series, which was used to detect whether a repository is ``engineered''. Similarly, \cite{coelho2018identifying} used GitHub's API to extract the number of Forks, open issues closed issues, commits, and max days without commits to detect whether a project is under maintenance or unmaintained. While there were some previous works that used the git behavioral meta-data, these works were either limited in the amount of meta-data that was used or focused on a different type of task. This work is the first solution that uses meta-data alone, which enables a language-oblivious general solution. \section{Methods} \label{sec:methods} \subsection{Data Collection} \label{sec:collection} As explained below, we collected data from multiple sources and processed them into a single data-set that will be used by different models for training. A diagram of the overall data collection process can be seen in Figure~ \ref{fig:data_collection}. As mentioned before, Git is a collaborative version control system that allows tracking changes made to a repository. A \emph{commit} is a change to a repository that includes the text of the code that is being changed and a commit message describing the change in natural language. To make the repository and the commits accessible to all developers, they can be sent (pushed) to GitHub, a server that mirrors the local Git information. GraphQL\footnote{\url{https://graphql.github.io/}} API allows us to iterate over the entire repository's history and gather all events. It must be noted that in this data collection, only data from ``master'', ``main'', or activate branches can be collected because inactive branches are deleted and cannot be extracted. The data was collected from the years 2015 to 2021 and features that were collected are detailed in Table~\ref{tab:GitHub_features}. We also used GitHub's GraphQL API to acquire static information about repositories, this information will allow us to create different models for different repositories (for example by programming language) and also improve accuracy, as will be detailed later. The static information includes properties of the repository such as the programming language in use, the current size of the repository, and information about the owner of the repository, e.g., if it is an individual or a company. The list of static features is detailed in Table~\ref{tab:static_features}. To acquire more data, we used ``GH Archive''\footnote{\url{https://www.gharchive.org/}}, which records GitHub events and can be easily accessed via SQL. This database contains events that cannot be acquired via GraphQL since they are recorded in real-time, and branches that were deleted from the repository cannot be retrieved. We acquired only the repositories that had CVEs and Gathered all the events from ``GraphQL'' and ``GH Archive'', making our dataset more accurate and comprehensive to detect unlabeled vulnerabilities. Features extracted from the GH Archive can also be seen in Table~\ref{tab:GitHub_features}. To gather a dataset of existing security patches, we used the largest existing database of vulnerabilities - the CVE Program. A CVE is a unique identifier that identifies a vulnerability, the CVE format is as follows: ``CVE-2021-44228'' where 2021 is the current year the vulnerability was published and 44228 is a unique vulnerability ID for that year. The CVE Program publishes all CVEs in a comma-separated values (CSV) format. Each entry in the CSV file is a CVE, and includes the CVE's description and additional links. We used the additional links to acquire security patches in the following way: the additional links' field can be separated into separate links, and if one of the links points to a commit in GitHub, we gather the tuple \textlangle CVE-ID, commit-URL\textrangle. Finally, we cloned the repositories from GitHub to acquire a mapping between a commit ID and its timestamp, the number of additions, deletions, and the number of files that were changed. This allows us to have timestamped labeled commit events, where a commit can be labeled as either \emph{positive} - namely, a security patch or \emph{negative} - not a security patch. Since all other data we acquired is also dated, we overall have a dataset of events with their date, time, and label. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{figs/data_collection.drawio.png} \caption{The overall data collection process.} \label{fig:data_collection} \end{figure} \begin{table*}[] \begin{tabular}{|l|l|l|} \hline Feature & Type & Explanation \\ \hline isCompany & Boolean & Does the repository belong to a company or an independent person \\ \hline isEmployee & Boolean & Is the repository owner an employee of a company \\ \hline isHirable & Boolean & Is the repository owner can be hired \\ \hline isSiteAdmin & Boolean & Is the repository owner site administrator \\ \hline isSponsoringViewer & Boolean & Is the repository owner sponsored \\ \hline isGitHubStar & Boolean & Is the repository owner a member of the GitHub star program \\ \hline isCampusExpert & Boolean & Is the repository owner a member of the campus expert program \\ \hline isDeveloperProgramMember & Boolean & Is the repository owner a member of the GitHub developer program \\ \hline isVerified & Boolean & Is the repository owner verified by GitHub \\ \hline isInOrganization & Boolean & Is the repository owner in an organization \\ \hline createdAt & Integer & Year the repository was created (one-hot encoded) \\ \hline diskUsage & Integer & Disk usage of the repository \\ \hline hasIssuesEnabled & Boolean & Does the repository have issues enabled \\ \hline hasWikiEnabled & Boolean & Does the repository have wiki enabled \\ \hline isMirror & Boolean & Is the repository a mirror \\ \hline isSecurityPolicyEnabled & Boolean & Is the security policy enabled in the repository \\ \hline fundingLinks & Integer & Number of funding links in the repository \\ \hline languages & List & List of programming languages used in the repository \\ \hline \end{tabular} \caption{Repository's static features that can be extracted via GraphQL.} \label{tab:static_features} \end{table*} \begin{table*}[] \begin{tabular}{|l|l|l|} \hline Feature & Description & Location \\ \hline Comment Event & Comment on a commit was added & GraphQL \\ \hline Stargazers Event & A stargazer was added to the repository & GraphQL \\ \hline Commit Additions Event & lines were added to the repository (Integer) & GraphQL \\ \hline Commit Deletions Event & lines were deleted from the repository (Integer) & GraphQL \\ \hline Subscribers Event & A subscription was added to the repository & GraphQL \\ \hline Create Event & A Git branch or tag was created & GH Archive \\ \hline Delete Event & A Git branch or tag was deleted & GH Archive \\ \hline Issue Comment Event & A comment on an issue was added & GH Archive \\ \hline Commit Comment Event & A comment on a commit was added & GH Archive \\ \hline Pull Request Review Comment Event & A comment on a pull request was added & GH Archive \\ \hline Member Event & Membership on the repository changed & GH Archive \\ \hline Public Event & A repository changed its viewing settings & GH Archive \\ \hline Push Event & A commit was pushed to the repository & Both \\ \hline Fork Event & The repository was forked & Both \\ \hline Release Event & A new version of the repository was released & Both \\ \hline Issue Event & A new issue was added & Both \\ \hline Watchers Event & User marked the repository was watched & Both \\ \hline Pull Request Event & A Pull request was created & Both \\ \hline \end{tabular} \caption{Repository's features that can be extracted via GraphQL and GH Archive} \label{tab:GitHub_features} \end{table*} \subsection{Data Pre-processing} \label{sec:preprocess} The main preprocessing method we used is Event-base Aggregation: Time elapsed between two events is not very meaningful, for example, it is insignificant if a fork was done one hour after a commit or two. Therefore, we can discard the date and time (and preserve only the temporal features that are one hot encoded). A configurable parameter is the \textit{window\_size}, which denotes the number of events before and after the security patch commit that are concatenated together to create a window (or a vector) of features. This window of features is one of many that will be fed into the model to train it, as detailed in the next section. Different from the time interval between events, other temporal features were found to be informative such as hour, day of the week, and month. These features, along with event types were encoded using one-hot encoding and fed to the LSTM units which usually take numbers and not events. At this point, we gather for each repository all its security patch commits. Additionally, in order to make the dataset balanced, we also collected a random sample of non-security patch commits. For each repository, we created a list of events with their date and time. Commit events also have additional normalized integer features: the number of lines added to a file, the number of lines deleted from a file, and the number of files modified. Furthermore, repositories that contained less than 100 events overall were discarded, since they were mostly insufficient for extracting the windows that we required. \subsection{Models} \label{sec:lstm} When dealing with large amounts of data, it is important to leverage the temporal information encapsulated in the data. A few types of models were examined for this cause. LSTM is an architecture that had proven its efficiency for such tasks. LSTM is based on Recurrent Neural Network (RNN) architecture, where performance decreases as a larger number of time steps are fed into the network. However, LSTM can forget some less important data, while preserving the more important parts of it. GRUs have an architecture that is similar to LSTMs but with fewer parameters, which might be an advantage for some learning tasks. Finally, Conv1D is a Convolutional Neural Network (CNN) that convolutes 1-dimensional data, such as time series. This model can be stacked to allow multi-level pattern recognition. These model architectures accept their data as a series of vectors, each can be associated with many features. The following process, as can be seen in Figure~\ref{fig:sliding_window} is employed to allow a time series to be given as input to LSTM, GRU, and Conv1D. For each repository, in our data-set, we gathered for each label - security and non-security patch commits, all the events that surround a commit, as a single input to the model. For example, an 11-event window (composed of a certain event, 5 events before and 5 events after) can be used to classify the window as one that contains a security patch (marked with a red column) or blue (as a window with non-security patches). As can be seen in the figure, some events might contain more than one feature (one column is composed of a few short lines). Window size is the number of events that are contained in the window, each window size is constant, and windows are fed into the models one by one. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{figs/sliding_window.drawio.png} \caption{Demonstration of the sliding window method.} \label{fig:sliding_window} \end{figure} \section{Experimental Design} \label{sec:experimental} To validate the proposed methodology, the overall experimental design is as follows: We randomly divided the repositories into training (90\%) and test sets (10\%). We further employed $k$-fold cross-validation on the training data to choose hyper-parameters, where $k=10$ as follows: On each iteration, 10\% of the repositories were kept as validation, which the model did not use for training. The distribution that achieved the best validation accuracy was used for hyper-tuning the parameters, to achieve even better validation accuracy. Finally, the obtained model was used to classify the windows that surrounds a commits of the test set, and performance metrics were calculated as described in Section~ Performance Evaluation. As mentioned above, we experimented with several learning models for training: \begin{itemize} \item \textit{Conv1D} - uses Conv1D layer, Max Pooling, and then fully connected layers (Table~\ref{tab:model-conv1d}). \item \textit{LSTM} - LSTM model, which uses LSTM neural network layers (Table~\ref{tab:model-lstm}). \item \textit{GRU} - GRU model, which uses GRU neural network layers (Table~\ref{tab:model-gru}). \end{itemize} \input{tables.tex} The proposed models were implemented using the Keras \cite{chollet2015} library with the TensorFlow backend \cite{abadi2016tensorflow} in Python. Training the model was done on a 64-bit Windows 10 Machine with Intel® Core™ i9-10940X CPU @ 3.30GHz with 16.0 GB RAM and NVIDIA GeForce RTX 3080 GPU, where training the training set takes about 4 minutes, and a single prediction takes about 5 milliseconds. The optimizer used is SGD and the selected batch size is 32 and the number of epochs is 50. \subsection{Performance Evaluation} \label{sec:performance_evaluation} To assess the performance of the trained models, we will define the metrics that were used. When solving binary classification problems, accuracy, as defined in \equationtxt{\ref{equ:accuracy}}, is usually used as the main evaluation criterion. Other important metrics are precision (\equationtxt{\ref{equ:precision}}), recall (\equationtxt{\ref{equ:recall}}), and F1-Score~ (\equationtxt{\ref{equ:f1}}), which is calculated from precision and recall. These metrics are defined as follows: \begin{equation} \label{equ:accuracy} Accuracy = \frac{\textnormal{TP + TN}}{\textnormal{TP + FP + TN + FN}}, \end{equation} \begin{equation} \label{equ:recall} Recall = \frac{\text{TP}}{\text{TP + FN} }, \end{equation} \begin{equation} \label{equ:precision} Precision = \frac{\text{TP}}{\text{TP + FP} }, \end{equation} \begin{equation} \label{equ:f1} F1 = 2 \cdot \frac{Precision \cdot Recall}{Precision + Recall}, \end{equation} where $TP$, $TN$, $FP$, and $FN$ are the count of \emph{true-positives}, \emph{true-negatives}, \emph{false-positives}, and \emph{false-negatives} respectively. Finally, we also report the Receiver operating characteristic (ROC). The ROC is a curve that shows the trade-off between the false-positive rate and the true-positive rate according to a selected threshold. The area under the ROC curve (AUC) gives a numerical grade between 0 and 1 to the classifier, where 1 is a perfect classification. \section{Results} \label{sec:results} As discussed in Section~ Experimental Design, a few models were evaluated to determine which is optimal for the task of classifying commits as security patches. We tested the three models with varied window sizes and found that for all window values Conv1D was the best model. Figure~ \ref{fig:model_compare} compares the three model accuracy for the optimal window size of 10. Conv1D is leading by 3 percentage points over the next model and hence, in the rest of the experiments, we will focus on this model. To discuss the rest of the results, we remind the reader that the window size determines the number of events that were gathered before and after the labeled event, e.g., if the window size is 5, we gathered overall 10 events: 5 before and 5 after the event). In the experiments, we checked the metrics when using different window sizes, which varied between 5 and 20. As can be seen in Figure~\ref{fig:window_size}, the optimal window size is 10 in both accuracy and F1-Score~, when using the Conv1D model. Table~\ref{tab:confusion-matrix} shows a confusion matrix for the best case, namely where the window size is set to 10 and the used model is Conv1D. In this case, the accuracy achieved was 83.93\%, F1-Score~ was 84.14\%, the precision was 0.7550, and the recall was 0.8769. The number of false positives (FPs) is rather high, which results in rather low precision. We suspect that some of the FPs are unreported security patches that our model identifies correctly. To validate this we manually examined 52 randomly selected FPs and found (see also Section~ Case Study) that 16 of them contain security patches, namely 30.8\%. If we apply this to the confusion matrix of Table~\ref{tab:confusion-matrix}, we get an estimate of 39 cases that are actually true positives (TPs). This results with a precision of 0.852. The accuracy also improves to 88.32\%, and the F1-Score~ to 89.75\%. Figure~\ref{fig:roc} depicts the AUC for a window size of 10, which is 0.91. Since we already discussed above that some of the FPs are actually TPs, the real AUC is higher. Table~\ref{tab:results-compare} compares our results with previous works that attempted to detect security patch commits. We noted that our paper is the only one that uses only behavioral git operations, and the amount of repositories used is much larger. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{figs/accuracy_compare.png} \caption{Comparison of the accuracy of different models.} \label{fig:model_compare} \end{figure} \begin{figure} \centering \includegraphics[width=0.5\textwidth]{figs/best_roc.png} \caption{ROC curve for the best model.} \label{fig:roc} \end{figure} \begin{table}[] \begin{tabular}{|l|l|l|} \hline & \begin{tabular}[c]{@{}l@{}}Not Classified\\ as a Security Patch\end{tabular} & \begin{tabular}[c]{@{}l@{}}Classified\\ as a Security Patch\end{tabular} \\ \hline \begin{tabular}[c]{@{}l@{}}Not Marked as\\ a Security Patch\end{tabular} & 373 (TN) & 128 (FP) \\ \hline \begin{tabular}[c]{@{}l@{}}Marked as\\ a Security Patch\end{tabular} & 28 (FN) & 473 (TP) \\ \hline \end{tabular} \caption{Confusion Matrix of the classification of patches in the test set (140 repositories).} \label{tab:confusion-matrix} \end{table} \begin{table*}[] \begin{tabular}{llll} \hline & Data Used & Amount Of Repositories & Accuracy Score \\ \hline \citet{wang2021patchrnn} & Commit message and code difference & 313 & 83.57\% \\ \hline \citet{sun2020identify} & Commit messages & 993 & 92.81\% \\ \hline \textbf{Our Paper with original labels} & Git \& GitHub behavioral data & 1389 & 83.93\% \\ \hline \textbf{Our Paper with estimated labels} & Git \& GitHub behavioral data & 1389 & 88.32 \% \\ \hline \end{tabular} \caption{Results Comparison.} \label{tab:results-compare} \end{table*} \begin{figure} \centering \includegraphics[width=0.5\textwidth]{figs/conv1d.png} \caption{Conv1D model prediction accuracy and F1-Score~ as a function of window size.} \label{fig:window_size} \end{figure} \subsection{Other Experiments} In this section, we report experiments that had not produced sufficiently positive results. \begin{itemize} \item Time-base Aggregation - As mentioned before, we used the Event-base Aggregation to build the horizon window. Another possibility is to use Time-base Aggregation by counting the events by type during time frames (Hour, 2 Hours, Day, etc...) and summing them up to a single data row. This turned out to achieve a low accuracy rate since events can be sparse and result in many zero entries. \begin{itemize} \item \textit{Hours / Days} - if Time-base Aggregation is used, the amount of hours/days recorded before the labeled event is the window size. \item \textit{Resample} - if Time-base Aggregation is used, we can aggregate all gathered events differently (for example, all the events in several hours can be aggregated into one vector) \end{itemize} \item Extracting location of repositories from GitHub - Since GitHub provides an API to the location of the owner we wanted to test if learning behavior by region or country can improve the prediction. Unfortunately, this field is free text and does not necessarily contain the actual location or is empty, which resulted in a high variety of answers and proved to be not useful. \item Gathering a window before the actual security patch: this is an attempt to predict a security patch in the future or as it occurs, as some events can indicate preparation for a security patch. However, the amount of data before the security patch is not sufficient to make such a prediction, and data after is also needed to achieve satisfactory results. \end{itemize} \section{Case Study} \label{sec:case-study} As discussed above, some vulnerabilities are fixed in commits but are not reported as vulnerabilities. In this case, our model will classify them as vulnerabilities, but they will not be labeled as such (false-positive), we manually examined the false-positive samples and checked for vulnerability-fixing changes in them, out of 52 false-positive commits, we found 16 to contain security patches (30\%). We will elaborate on two case studies. \subsection{LibTIFF} LibTIFF is a library for processing the TIFF image format. A Commit\footnote{\url{https://GitHub.com/vadz/libtiff/commit/5ed9fea523316c2f5cec4d393e4d5d671c2dbc33}} fixed 2 heap-based buffer overflow vulnerabilities and was detected by our model as a security patch, although it was not assigned a CVE (but only an issue at Bugzilla\footnote{\url{http://bugzilla.maptools.org/show_bug.cgi?id=2633}}, which we do not take labels from). \subsection{Wireshark} Wireshark is a network protocol analyzer that allows viewing network communication at several protocol layers. A Commit\footnote{\url{https://GitHub.com/wireshark/wireshark/commit/ba179a7ef7e660d788cbaade65982ffc7249b91f}} fixed a denial of service attack by null pointer dereference. This is clear from observing the code and also detected by our model but the commit was not assigned a CVE. \section{Conclusion} \label{sec:conclusion} In this work, we proposed a methodology to gather repositories' behavioral meta-data from 3 different sources. After merging the different sources into one time series data-set, we used the CVE Program to label the data-set's commits to security patches and non-security patches. We introduced 3 types of time series models and discovered that Conv1D achieved the best classification accuracy of 88.32\%. We did not use natural language processing tools, and thus our results are language insensitive (both programming language and natural language). Our results can be used to detect unreported security patches and warn the community to patch an open security problem. Our future research goal is to explore the impact of the different features on the classification, this can be done by using more interpretable models, comparing model accuracy on specific languages, etc.
\section{Introduction \label{Sec_Intro}} After the first binary black hole coalescence event, GW150914, detected by LIGO in 2015 \cite{Abbott2016}, there have been more than fifty compact binary merger events reported by the LIGO-Virgo Scientific Collaborations (LVSC) \cite{Abbott2019,Abbott2021} heralding the era of gravitational wave (GW) for astrophysics and cosmology which provides the first-ever window to explore the nature of gravity in the strong-field regime. So far, GR stands strongly against tests such as consistency checks \cite{Abbott2021a}, merger remnants \cite{Healy2014} and the properties of the generation and propagation (e.g. the propagating speed, dispersion relations and polarization states) of GWs \cite{Abbott2016a,Yunes:2016jcc,Cai2017,Samajdar2017,Abbott2017c,Abbott2017,Abbott2017a,Abbott2017b} (see \cite{Krishnendu2021} for reviews). In particular, due to the spacetime diffeomorphism symmetry, GR predicts that only two transverse-traceless tensor modes of GWs are propagating. This is a significant feature to distinguish GR from usual modified gravity theories \cite{Clifton:2011jh,Will2014}, in which additionally non-tensorial polarization mode(s) \cite{Arzoumanian2020,Chen2021,Arzoumanian2021} could be propagating as well. For instance, there is a scalar mode beyond the two tensor modes in the $f\left(R\right)$ and generic scalar-tensor (ST) theories \cite{Brans:1961sx,Horndeski:1974wa,ArmendarizPicon1999,Chiba:1999ka,Deffayet:2011gz,Langlois:2015cwa} (see also \cite{Liang2017,Gong2018a,Hou2018}), the vector modes appear in the vector-tensor theories (e.g. the Einstein-Æther theory \cite{Jacobson2004}) while both scalar and tensor modes could be excited simultaneously in addition to the tensor modes in scalar-vector-tensor theories, such as the TeVeS theory \cite{Bekenstein2004}. Therefore, people have put a lot of effort into extracting information on the polarization states from GWs signals \cite{Gong2018,Hagihara2018,Takeda2019,Takeda2021,Zhang2022} for the purpose of falsifying gravity theories via polarization states of GWs. However, limited by the orientation of the detectors arranged at LVSC, so far the best we have known about the polarization states from the GWs signals is that the purely tensor polarization is strongly favored over the purely scalar or vector polarizations \cite{Abbott2017c}. In light of the establishment of the network of ground-based detectors including advanced LIGO, Virgo \cite{LIGOScientific:2014pky,TheVirgo:2014hva,Abbott2018}, KAGRA \cite{Somiya2012,Aso2013} and LIGO India, more information will be available and we may then have the probing ability for separating polarization modes in the near future. Naturally, in this context there comes a crucial question, that is, whether GR is the unique theory with two tensorial degrees of freedom (TTDOF) of gravity. According to the Lovelock's theorem \cite{Lovelock:1970,Lovelock1972}, GR is the unique theory in which the metric is the only field in the gravity sector and obeys second order equations of motion with general covariance and locality in the four dimensional spacetime and therefore GR is indeed the unique TTDOF gravity theory when the assumptions of Lovelock's theorem are preserved. However, this uniqueness does not hold anymore when these assumptions are relaxed to some extent \footnote{Recently, the authors in \cite{Glavan2020} attempted to circumvent the Lovelock's theorem to construct an alternative gravity theory with TTDOF by rescaling the coupling constant of the Gauss-Bonnet term and therefore non-trivially modifying the Einstein's field equation in four dimensional spacetime. However, the Lovelock's theorem is a statement about the equations of motion (but not just about the action) and therefore directly excludes such a possibility. Indeed, it was soon realized that taking the limit of Gauss-Bonnet term from higher dimension to 4 dimension is path-dependent which should be regularized properly and, as a consequence, additional d.o.f. appears in the regularized 4D Einstein-Gauss-Bonnet theories (see \cite{Fernandes2022} for reviews). Alternatively, by breaking the 4D diffeomorphism invariance down to the 3D spatial diffeomorphism invariance, one can construct a consistent 4D Einstein-Gauss-Bonnet theory with TTDOF \cite{Aoki:2020lig,Aoki:2020iwm,Aoki:2020ila}.}. In fact, an alternative gravity theory with TTDOF was proposed and dubbed the Cuscuton in 2007 \cite{Afshordi2007} by introducing an incompressible (i.e. propagating at infinite sound speed) scalar field $\phi\left(t,\vec{x}\right)$ with a non-vanishing and timelike vacuum expectation value of its first derivative. The scalar d.o.f. with infinite sound speed in the Cuscuton manifests itself as an instantaneous mode. As discussed in \cite{DeFelice:2018ewo,DeFelice:2021hps} and \cite{DeFelice:2022uxv} for a generalized instantaneous mode called a shadowy mode in the context of U-DHOST and VCDM respectively, such a mode with infinite sound speed satisfies an elliptic equation on each constant-$\phi$ hypersurface. In the so-called unitary gauge, i.e. with $\phi=\phi\left(t\right)$ \cite{ArkaniHamed:2003uy}, these hypersurfaces on which the elliptic equation is defined agree with time slices and thus the equation of motion for the instantaneous/shadowy mode does not include time derivatives, meaning that the Cuscuton only propagates the TTDOF \cite{Gomes2017}. In other choices of time slicing, the equation of motion for the instantaneous/shadowy mode includes time derivatives but is still elliptic. Therefore by imposing a proper boundary condition the instantaneous/shadowy mode is uniquely determined by other degrees of freedom. As a result the Cuscuton propagates TTDOF only, irrespective of whether the unitary gauge is adopted or not (see \cite{DeFelice:2018ewo,DeFelice:2021hps} and \cite{DeFelice:2022uxv} for corresponding discussions in U-DHOST and VCDM ). Generally, in the unitary gauge, general covariance is broken into the spatial covariance therefore the Cuscuton (or a generic ST theory) can be classified as a spatially covariant (SC) framework \cite{Gao:2014soa} and inversely the ST theory can be also recovered from a SC theory by introducing a Stueckelberg field \cite{Gao2020b,Gao2020a,Hu2022}. Due to the reduction of symmetry, in addition to the two tensorial d.o.f., the SC gravity theory with a nondynamical lapse function propagates one scalar d.o.f. \cite{Gao:2014fra}. Nevertheless, a class of TTDOF gravity theories was proposed within a special SC framework where the lapse function enters the Lagrangian linearly. The resulting theory was dubbed the MMG theory \cite{Lin:2017oow}, which indicates that GR is modified without changing its d.o.f.. Similarly, a class of TTDOF theories was identified within the more general ST theory with higher order derivatives under the unitary gauge \cite{Iyonaga2018}. In the case of a nondynamical lapse function, the general conditions to eliminate the scalar d.o.f. were found in \cite{Gao:2019twq,Hu:2021yaq}. This idea was also applied to the more general SC framework with a dynamical lapse function that enters the Lagrangian nonlinearly \cite{Gao2019}. The conditions to have TTDOF in the presence of a dynamical lapse function were analyzed in \cite{Lin2021}. According to the above works, within the general SC framework, MMG theories exist as long as some additional conditions are satisfied, which we dub the TTDOF conditions. The example of the first TTDOF condition arose in \cite{Iyonaga2018}, which we dubbed the degeneracy condition to indicate that the sector of the lapse function and extrinsic curvature is degenerate. The self-consistency condition identified in \cite{Lin:2017oow}, which we dub the second TTDOF condition, is used to prevent the number of phase space dimensions from being odd. The TTDOF conditions are nonlinear functional differential equations of the Lagrangian, which are difficult to be solved in general. We are only able to solve them with some particular ansatz of actions, such as, the square root gravity in \cite{Lin:2017oow}, the extended Cuscuton in \cite{Iyonaga2018} and the quadratic extrinsic curvature gravity in \cite{Gao:2019twq} (see the cosmological constraints to this model in \cite{Iyonaga2021,Hiramatsu2022}). Another difficulty of MMG theories is the problem of coupling with matter consistently, which happens when there are extra first-class constraint(s) (other than the original six first-class constraints associated with the spatial diffeomorphism) appearing in the MMG theories \cite{Carballo-Rubio2018}. More precisely, the extra first-class constraint(s) would be downgraded to be second-class when the theory is naively coupled with Lorentz covariant matter, at which point the suppressed scalar d.o.f. arises again. The resolution of these difficulties arising for MMG theories become more transparent in the phase space than in the configuration space. This is because counting the number of d.o.f. is transparent by means of an explicit constraint analysis in the phase space. For this reason, a number of works have utilized the Hamiltonian approach. For instance, by imposing the linearity of the lapse function in the Hamiltonian \cite{Mukohyama2019} instead of the Lagrangian \cite{Lin:2017oow}, the self-consistency condition was reformulated in a much simpler expression by solving the simplified condition. In these works, the $f\left(\mathcal{H}\right)$ theory which is a particular MMG theory constructed in \cite{Carballo-Rubio2018} was rediscovered and the ``kink'' model based on the $f\left(\mathcal{H}\right)$ theory was shown later to fit the Planck data better than the $\Lambda$CDM model \cite{Aoki2020b}. The matter-coupling problem can also be addressed in the phase space. As another instance, in \cite{Aoki2018,Aoki:2018brq,DeFelice2020b}, the authors introduce the so-called gauge fixing condition to the Hamiltonian of the MMG theory obtained by performing a canonical transformation of GR. As a result, the first-class constraint associated with temporal diffeomorphism is split into a pair of second-class constraints, which allow the theory to couple with the Lorentz covariant matter consistently. Another proposal for addressing the same problem is adopted in \cite{Carballo-Rubio2018,Lin2019,Lin2019a}, where the additional first-class constraint is maintained by modifying the Hamiltonian constraint of the matter sector such that the constraints algebra is kept closed. However, as a price, matter no longer behaves in the usual Lorentz covariant manner. Inspired by the above works, a more straightforward approach to constructing the MMG theories was proposed in \cite{Yao2021}, where the so-called (scalar-type) auxiliary constraint (AC) is introduced to a general total Hamiltonian respecting the spatial diffeomorphism with a non-dynamical lapse function. The Hamiltonian carries two tensorial and one scalar d.o.f. at the beginning. The AC is used to constrain the trajectories of canonical variables such that the unwanted scalar d.o.f. is suppressed. It is therefore introduced to assist in locating the MMG theories in the space of theories and is eventually part of the definition of the theory. This AC can be also considered as the generalization of the gauge-fixing condition that addresses the matter-coupling problem mentioned above. Nevertheless, the phase space constrained by the AC is still insufficient to ensure a MMG theory because the AC is introduced via a generic function of the canonical variables. Generally, additional TTDOF conditions are still needed, which are renamed as the ``minimalizing conditions'' in \cite{Yao2021}, to underline that they are the conditions that ``minimalize'' the space of more general theories into the MMG theory space. Even though the AC is initially introduced by hand, we emphasize that it is actually nothing but one possible kind of constraint structure for the MMG theories and just part of the definition of the theory. In principle there could be more than one AC, which can be thought of as yet unrevealed territory among the constraint structures of the MMG theories. In this work, we are going to complete the constraint analysis for the MMG theories with multiple ACs. In principle, not only the scalar-type but also the vector- and the tensor-type ACs might possibly appear. Hence we will firstly investigate the possibilities of minimizing the number of d.o.f. by introducing an arbitrary number of any of the above types of ACs to a general total Hamiltonian, which still preserves spatial diffeomorphism invariance. Throughout, it is also important to limit the number of ACs, otherwise the system will be over-constrained thus become physically inconsistent. In order to determine the maximum number of each type of ACs, we will first assume that they are all classified as second-class then count the number of d.o.f. with respect to an arbitrary background via the Hamiltonian analysis. By requiring that the number of each type of d.o.f.~be non-negative, we will find limits on the number of each type of ACs. In fact, as we will see in the next section, the number of scalar-type ACs should not exceed four and no vector- and tensor-type ACs are allowed, because the phase space in the vector sector is already sufficiently constrained by the spatial diffeomorphism constraints, while the tensor sector should not be constrained in order to have the correct number of d.o.f. Following this, we will construct a consistent SC framework with multiple (scalar-type) ACs as our starting point for searching the MMG theories. According to the number of introduced ACs, we will divide the theories into four cases and for the purpose of obtaining the MMG theories, the scalar d.o.f. should be completely eliminated by the primary and secondary constraints, which will divide the ACs into different classifications for each case. To further contrive the classification, the ACs and the canonical Hamiltonian should satisfy not only the corresponding minimalizing conditions mentioned above but also symmetrizing conditions which are the sufficient but not necessary conditions to end up with a MMG theory and are required to enhance the gauge symmetries of the theory. As a results, we will exhaust all the possible constraint structures for the MMG theories with multiple ACs, thus leading to a complete classification. To illustrate this formalism, we will construct a concrete model with four ACs by using the Cayley-Hamilton theorem. This theory can couple with matter consistently without further conditions. We will investigate the dispersion relation of tensor perturbations around a flat FLRW background, and show how some coefficients of the theory can be constrained by the observations. The rest of the current paper is organized as follows. In Sec. \ref{Sec_ACF_MAC}, we investigate the possibilities of reducing the number of d.o.f. by introducing different types of ACs and determine a consistent general framework with multiple ACs as our starting point for searching the MMG theories. In Sec. \ref{Sec_MMG_MAC}, we find the minimalizing and symmetrizing conditions for each class of MMG theories, each of which is described in subsections \ref{Subsec_S4}-\ref{Subsec_S1}. As an illustrative example, we construct a concrete model with four ACs and study the modified dispersion relation of the GWs by performing a tensor perturbation in Sec. \ref{Sec_CH_FAC}. Finally, we conclude this work in Sec. \ref{Sec_cld}. \section{A consistent framework with auxiliary constraints \label{Sec_ACF_MAC}} In this section, we will investigate the possibilities of reducing the number of d.o.f. by introducing multiple primary ACs and construct a consistent framework as our starting point for searching for the MMG theories. We will adopt the Arnowitt-Deser-Misner (ADM) formalism in which the lapse function, shift vector, induced metric and their conjugate momenta are denoted by $\left\{ N,N^{i},h_{ij};\pi,\pi_{i},\pi^{ij}\right\} $ respectively and $\nabla_{i}$ is the spatially covariant derivative compatible with $h_{ij}$. Without loss of generality, we start with the following general total Hamiltonian \begin{eqnarray} H_{\text{T}} & = & \int\text{d}^{3}x\Big[\mathscr{H}\left(N,\pi,h_{ij},\pi^{ij};\nabla_{i}\right)+N^{i}\mathcal{H}_{i}\nonumber \\ & & +\lambda^{i}\pi_{i}+\mu_{\text{n}}\mathcal{S}^{\text{n}}+\nu_{\text{m}}^{i}\mathcal{V}_{i}^{\text{m}}+\rho_{\text{r}}^{ij}\mathcal{T}_{ij}^{\text{r}}\Big],\label{Int_HT_anz} \end{eqnarray} where $\mathscr{H}$ is a generic function of $\left(N,\pi,h_{ij},\pi^{ij};\nabla_{i}\right)$ which, with the second term, corresponds the usual canonical Hamiltonian and $N^{i}$, $\lambda^{i}$, $\mu_{\text{n}}$, $\nu_{\text{m}}^{i}$ and $\rho_{\text{r}}^{ij}$ play the role of the Lagrange multipliers corresponding to the following constraints, \begin{equation} \mathcal{H}_{i}\approx0_{i},\quad\pi_{i}\approx0_{i},\label{Int_3d_diff} \end{equation} which are associated with the spatial diffeomorphism with $\mathcal{H}_i$ the momentum constraints, and \begin{equation} \mathcal{S}^{\text{n}}\approx0^{\text{n}},\quad\mathcal{V}_{i}^{\text{m}}\approx0_{i}^{\text{m}},\quad\mathcal{T}_{ij}^{\text{r}}\approx0_{ij}^{\text{r}},\label{Int_SVT} \end{equation} which denote the introduced scalar-, vector- and (symmetric rank-$2$) tensor-type ACs with $\mathrm{n}$, $\mathrm{m}$ and $\mathrm{r}$ the corresponding indices, respectively. Here, scalar-, vector- and tensor-types refer to the transformation properties under the spatial diffeomorphism generated by $\mathcal{H}_{i}$~\footnote{By using the spatial metric $h_{ij}$, its inverse $h^{ij}$ and the spatial covariant derivative $\nabla_i$, one could decompose a spatial vector into the transverse and longitudinal parts, a spatial (symmetric rank-$2$) tensor into the transverse-traceless, traceless-longitudinal and trace parts, as far as the inverse of the Laplace operator is unique on the spatial manifold. In particular, the decomposition of a spatial (symmetric rank-$2$) tensor into the traceless and trace parts does not introduce any non-locality and thus is easy to adopt. Nonetheless, we shall not employ such decompositions since the main conclusion of the present paper does not change. Hereafter, we thus simply classify ACs under the transformation properties under the spatial diffeomorphism.}. Throughout this work, ``$\approx$'' represents ``weak equality'' that holds only on the constrained subspace $\Gamma_{\text{C}}$ of the phase space. The terminology ``primary constraint'' is usually referred to constraints due to a singular Lagrangian, from which we cannot solve all the conjugate momenta. In particular, in the case of GR or general SC theories, in (\ref{Int_3d_diff}) $\pi_{i}\approx 0_{i}$ are the primary constraints due to the absence of the velocity of the shift vector $N^{i}$ in the Lagrangian, while $\mathcal{H}_{i} \approx 0_{i}$ are the so-called secondary constraints, which arise after making use of the equations of motion. In this work, since we start from the Hamiltonian in the phase space from the beginning, a ``primary constraint'' is merely referred to a constraint that is introduced by hand when defining the total Hamiltonian. In this sense, both $\pi_{i} \approx 0_{i}$ and $\mathcal{H}_{i} \approx 0_{i}$, as well as constraints in (\ref{Int_SVT}), are treated as primary constraints in this work. We now make some comments on the above introduced constraints. First, as explained in sec. \ref{Sec_Intro}, in light of the restriction by the Lovelock's theorem, in order to enlarge the space of theories such that there is space for searching for the MMG theories, we reduce the symmetries of the theory from the general covariance to the spatial covariance. This requires that the spatial diffeomorphism constraints (\ref{Int_3d_diff}) must be present in the total Hamiltonian (\ref{Int_HT_anz}). For convenience, we will adopt the extended definition for the momentum constraints \cite{Gao:2014fra,Mukohyama:2015gia,Saitou:2016lvb,Gao2019} \begin{eqnarray} & & \mathcal{H}_{i}\equiv-2\sqrt{h}\nabla_{j}\frac{\pi_{i}^{j}}{\sqrt{h}}+\pi\nabla_{i}N\nonumber \\ & & +\pi_{j}\nabla_{i}N^{j}+\sqrt{h}\nabla_{j}\frac{\pi_{i}N^{j}}{\sqrt{h}}\approx0_{i},\label{Int_Hi} \end{eqnarray} which satisfy the following property \cite{Gao2019} \begin{equation} \left[\mathcal{H}_{i}\left(\vec{x}\right),Q\left(\vec{y}\right)\right]\approx0_{i},\quad\forall Q\approx0,\label{Int_=00005BHi,Q=00005D} \end{equation} with $Q$ an arbitrary quantity weakly vanishing on the constrained phase space $\Gamma_{\text{C}}$. The Poisson bracket $\left[\mathcal{F},\mathcal{G}\right]$ is defined by \begin{eqnarray} \left[\mathcal{F},\mathcal{G}\right] & \equiv & \int\text{d}^{3}z\sum_{I}\Big(\frac{\delta\mathcal{F}}{\delta\Phi_{I}\left(\vec{z}\right)}\frac{\delta\mathcal{G}}{\delta\Pi^{I}\left(\vec{z}\right)}\nonumber \\ & & -\frac{\delta\mathcal{F}}{\delta\Pi^{I}\left(\vec{z}\right)}\frac{\delta\mathcal{G}}{\delta\Phi_{I}\left(\vec{z}\right)}\Big),\label{Int_PB} \end{eqnarray} where we formally denote the ADM variables with $\Phi_{I}$ and their conjugate momenta with $\Pi^{I}$. By using the property in (\ref{Int_=00005BHi,Q=00005D}), it is easy to show that the constraints in (\ref{Int_3d_diff}), i.e.~the spatial diffeomorphism generators, are explicitly classified as the first-class in terms of Dirac's terminology. They eliminate 12 dimensions from the (in total) 20-dimensional phase space, leaving us with 8 dimensions at each point of the spacetime, i.e. four local d.o.f. Second, for the purpose of obtaining the MMG theories, one or several additional constraints are needed in order to reduce the number of d.o.f. from four to two. In this work, we perform this by introducing multiple ACs (\ref{Int_SVT}) to the total Hamiltonian (\ref{Int_HT_anz}) as part of the primary constraints of the theory. Our previous work \cite{Yao2021}, in which we introduced only one scalar-type AC with the assumption of a non-dynamical lapse function, can be considered a preliminary work in that regard. In principle, there could be more than one AC appearing in the Hamiltonian, including a priori all types of constraints, i.e.~scalar $\mathcal{S}^{\text{n}}$, vector $\mathcal{V}_{i}^{\text{m}}$ and tensor $\mathcal{T}_{ij}^{\text{r}}$, which are generic functions of $\left(N,\pi,h_{ij},\pi^{ij};\nabla_{i}\right)$ with the indices $\text{n}$, $\text{m}$ and $\text{r}$ indicating the number of each type of AC respectively. Note that it is fair to assume that the ACs are linearly independent from each other in order to avoid unnecessary complexity. Obviously, there must be an upper limit of the number of ACs, otherwise the system will become over-constrained and inconsistent physically even without coupling to any external fields. The maximum number of each type of ACs can be obtained in a scenario where all of the ACs (\ref{Int_SVT}) are assumed to be of the second-class. In this case, we count the number of d.o.f. as \begin{eqnarray} & & \#_{\mathrm{dof}}=\frac{1}{2}\left(\#_{\text{var}}\times2-\#_{\mathrm{1st}}\times2-\#_{\mathrm{2nd}}\right)\nonumber \\ & & =\frac{1}{2}\Big[\left(4_{\text{s}}+4_{\text{v}}+2_{\text{t}}\right)\times2-\left(1_{\text{s}}+2_{\text{v}}\right)\times2\times2\nonumber \\ & & -1_{\text{s}}\times\mathcal{N}-\left(1_{\text{s}}+2_{\text{v}}\right)\times\mathcal{M}-\left(2_{\text{s}}+2_{\text{v}}+2_{\text{t}}\right)\times\mathcal{R}\Big]\nonumber \\ & & =\left(2_{\text{t}}-\mathcal{R}_{\text{t}}\right)-\left(\mathcal{M}_{\text{v}}+\mathcal{R}_{\text{v}}\right)\nonumber \\ & & +\frac{1}{2}\left(4_{\text{s}}-\mathcal{N}_{\text{s}}-\mathcal{M}_{\text{s}}-2\times\mathcal{R}_{\text{s}}\right),\label{Int_=000023dof_1} \end{eqnarray} where $\mathcal{N},\mathcal{M},\mathcal{R}$ are the numbers of constraints in each type, and we use the subscripts $\text{s}$, $\text{v}$ and $\text{t}$ to denote the scalar, vector and tensor d.o.f. respectively. The classification of d.o.f. into various types are to be understood in the sense of spatial diffeomorphism with respect to an arbitrary background. Since the phase space is spanned by $N$, $N^{i}$, $h_{ij}$ and their conjugate momenta, $N$ will contribute one scalar d.o.f., i.e. $1_{\text{s}}$ in (\ref{Int_=000023dof_1}), $N^{i}$ will contribute one scalar and two vectorial d.o.f. accounting for $1_{\text{s}}+2_{\text{v}}$ and $h_{ij}$ will contribute two scalar, two vectorial and two tensorial d.o.f., accounting for $2_{\text{s}}+2_{\text{v}}+2_{\text{t}}$. Together with their conjugate momenta, the dimension of the phase space is therefore $\left(4_{\text{s}}+4_{\text{v}}+2_{\text{t}}\right)\times2$. The number of d.o.f.~removed by the ACs (\ref{Int_SVT}) are counted in the similar way in (\ref{Int_=000023dof_1}). Note that the tensor-type ACs, $\mathcal{T}_{ij}^{\text{r}}\approx0_{ij}^{\text{r}}$, are symmetric with respect to the subscripts therefore $\mathcal{T}_{ij}^{\text{r}}\approx0_{ij}^{\text{r}}$ account for $-\left(2_{\text{s}}+2_{\text{v}}+2_{\text{t}}\right)\times\text{r}$ in (\ref{Int_=000023dof_1}). The number of d.o.f. in each type should not be negative in the absence of external fields otherwise the theory is physically inconsistent. Therefore, from the last line of (\ref{Int_=000023dof_1}), we require \begin{equation} 2-\mathcal{R}\ge0,\quad \mathcal{M}+\mathcal{R}\le0, \end{equation} and \begin{equation} 4-\mathcal{N}-\mathcal{M}-2\mathcal{R}\ge0, \end{equation} which gives \begin{equation} \mathcal{R}=0,\quad \mathcal{M}=0,\quad \mathcal{N}\le4. \end{equation} We conclude that none of the tensor- and vector-type ACs are allowed, and no more than four scalar-type ACs should be introduced. In the case with four (necessarily second-class) independent scalar-type ACs, from (\ref{Int_=000023dof_1}) we see that (\ref{Int_HT_anz}) turns out to be an MMG theory automatically, i.e.~without requiring any further condition. In the next section, we will confirm this result again, via a more detailed Hamiltonian analysis accounting for all the possible classifications of the ACs. Before getting into the next section, we justify the introduction of (scalar-type) ACs as follows. Even though the ACs are introduced by hand in this work, we emphasize that they are nothing but part of the definition of the MMG theories. In other words, it is not possible to construct an MMG theory without introducing ACs because without any ACs, the number of d.o.f. in the theory (\ref{Int_HT_anz}) is four. Therefore additional constraints are necessary to reduce the number of d.o.f.. One may consider the possibility that extra constraint may come from the particular choice of the free function $\mathscr{H}\left(N,\pi,h_{ij},\pi^{ij};\nabla_{i}\right)$ in (\ref{Int_HT_anz}), for example by requiring that the lapse $N$ plays the role of a Lagrange multiplier. However, this also yields the constraint of $\pi\approx0$, which is actually a typical choice of the scalar-type AC and has been adopted in the previous related works \cite{Lin:2017oow,Iyonaga2018,Gao:2019twq,Mukohyama2019,Yao2021} based on the assumption of a non-dynamical lapse. In GR, $\pi\approx0$ is one of the constraints naturally required by the 4-dimensional spacetime diffeomorphism. In the more general framework with only spatial covariance, the lapse function could be dynamical in principle \cite{Domenech:2015tca,Gao2019,Lin2021}, therefore the conjugate momentum $\pi$ does not correspond to a constraint in general. From the viewpoint of the formalism presented here, the constraint $\pi\approx0$ is noting but a specific scalar-type AC, which generates the constraint originally imposed on $\mathscr{H}$. Another example of the AC in the literature is the gauge fixing term introduced in \cite{Aoki2018,Aoki:2018brq,DeFelice2020b}. By fixing the gauge condition, which by itself is of the second class, the first-class constraint becomes a second class constraint. As a result, the theory is able to couple with matter consistently \cite{Carballo-Rubio2018,Lin2019,Lin2019a} (see also \cite{Aoki2020,Aoki2020a,Aoki2021}). Based on the above discussions, we construct a consistent framework for searching for the MMG theories in the vacuum by introducing the ACs as follows: \begin{equation} H_{\text{T}}=\int\text{d}^{3}x\left(\mathscr{H}+\mu_{\text{n}}\mathcal{S}^{\text{n}}+N^{i}\mathcal{H}_{i}+\lambda^{i}\pi_{i}\right),\label{Int_HT_2} \end{equation} where $\mathscr{H}$ and $\mathcal{S}^{\text{n}}$ with $\mathrm{n} =1,\cdots, \mathcal{N} (\mathcal{N}\leq 4)$ are generic functions of $\left(N,\pi,h_{ij},\pi^{ij};\nabla_{i}\right)$. Before we start to search for the MMG theories based on (\ref{Int_HT_2}), it is convenient to split the total Hamiltonian (\ref{Int_HT_2}) into two parts \begin{equation} H_{\text{T}}=H_{\text{D}}+H_{\text{P}},\label{Int_HT=00003DHP+HD} \end{equation} where $H_{\text{D}}$ denotes the part of the Hamiltonian corresponding to the spatial diffeomorphism \begin{equation} H_{\text{D}}\equiv\int\text{d}^{3}x\left(N^{i}\mathcal{H}_{i}+\lambda^{i}\pi_{i}\right),\label{Int_HD} \end{equation} and the rest in (\ref{Int_HT_2}) is denoted by \begin{equation} H_{\text{P}}\equiv\int\text{d}^{3}x\left(\mathscr{H}+\mu_{\text{n}}\mathcal{S}^{\text{n}}\right),\label{Int_HP} \end{equation} which we dub the ``partial'' Hamiltonian \cite{Yao2021}. Clearly, $H_{\mathrm{D}}$ is fixed in all the SC gravity theories, and thus $H_{\mathrm{P}}$ plays the central role in the following discussions , which has nothing to do with $N^i$ and $\pi_{i}$. Indeed, we are allowed to deduct the $\left\{ N^{i},\pi_{i}\right\} $-sector from the system in the first place since the spatial diffeomorphism constraints (\ref{Int_3d_diff}) are retained and considered as the first-class. Therefore, the specificities of the theory such as the number of d.o.f.~will be completely encoded in $H_{\text{P}}$ with an $20-6\times2 = 8$ dimensional phase space. One can however restore the neglected part $H_{\text{D}}$ without any difficulty in the following discussions. With the partial Hamiltonian $H_{\text{P}}$ (\ref{Int_HP}), the number of d.o.f. of the theory is formally counted as \begin{eqnarray} \#_{\mathrm{dof}} & = & \frac{1}{2}\left[\left(2_{\text{t}}+2_{\text{s}}\right)\times2-\#_{\mathrm{1st}}^{\text{s}}\times2-\#_{\mathrm{2nd}}^{\text{s}}\right]\nonumber \\ & = & 2_{\text{t}}+\frac{1}{2}\left(4_{\text{s}}-\#_{\mathrm{1st}}^{\text{s}}\times2-\#_{\mathrm{2nd}}^{\text{s}}\right),\label{Int_=000023dof_3} \end{eqnarray} where $\#_{\mathrm{1st}}^{\text{s}}$ and $\#_{\mathrm{2nd}}^{\text{s}}$ are the numbers of the first- and the second-class constraints, which include the primary ACs and the possible secondary constraints generated from the ACs. Clearly, $\#_{\mathrm{1st}}^{\text{s}}$ and $\#_{\mathrm{2nd}}^{\text{s}}$ should satisfy \begin{equation} \mathcal{N}\le\#_{\mathrm{1st}}^{\text{s}}+\#_{\mathrm{2nd}}^{\text{s}}\le4,\label{Int_=0000231+=0000232} \end{equation} and \begin{equation} 4-\#_{\mathrm{1st}}^{\text{s}}\times2-\#_{\mathrm{2nd}}^{\text{s}}=0,\label{Int_4-2=0000231-=0000232} \end{equation} since, for the sake of having an MMG theory, the scalar d.o.f. should be completely eliminated. Combining (\ref{Int_=0000231+=0000232}) with (\ref{Int_4-2=0000231-=0000232}), we are able to exhaust all the possible constraint structures for the MMG theories case by case, which we will do in the next section. \section{Minimally modified gravity with auxiliary constraint(s) \label{Sec_MMG_MAC}} In this section, we are going to classify the ACs and their secondary constraints by solving Eqs.~(\ref{Int_4-2=0000231-=0000232}) with (\ref{Int_=0000231+=0000232}), and then find out the corresponding conditions needed in order to fully satisfy the classifications so that we are able to exhaust all the possible constraint structures for the MMG theories. As mentioned in the last section, one requires no condition in the case with four second-class (scalar-type) ACs, so we start the discussion from the case with four ACs, with more details than the previous section. \subsection{Case with four auxiliary constraints \label{Subsec_S4} } Let's start with the case with four ACs, i.e. \begin{equation} H_{\text{P}}\equiv\int\text{d}^{3}x\left(\mathscr{H}+\mu_{\text{n}}\mathcal{S}^{\text{n}}\right)\text{ with }\text{n}=1,2,3,4.\label{S4_HP} \end{equation} By solving eq. (\ref{Int_=0000231+=0000232}) with (\ref{Int_4-2=0000231-=0000232}), we find the unique class \begin{equation} \#_{\mathrm{1st}}^{\text{s}}=0,\quad\#_{\mathrm{2nd}}^{\text{s}}=4, \end{equation} which implies that the four ACs, $\mathcal{S}^{\text{n}}\approx0$, must be all of the second-class for the sake of having an MMG theory. This is also consistent with the discussions in the last section. As a consequence, there are two important properties to be stressed for this case. First, as an MMG theory, $\mathscr{H}$ and $\mathcal{S}^{\text{n}}$ in (\ref{S4_HP}) can be arbitrarily chosen as the independent functions of $\left(N,\pi,h_{ij},\pi^{ij};\nabla_{i}\right)$, since no condition is required to (\ref{S4_HP}). In the cases with less number of ACs, however, this is not true in general, some conditions on $\mathscr{H}$ and $\mathcal{S}^{\text{n}}$ are needed to obtain the MMG theories. This complexity is fortunately evaded in this case because we have introduced a sufficient number of additional constraints. Second, the MMG theory (\ref{S4_HP}) with (\ref{Int_HD}) can be coupled with matter consistently. A common problem for the MMG theories that include the first-class constraint(s) (in addition to the spatial diffeomorphism constraints (\ref{Int_3d_diff})) is how to couple with matter consistently. Naive coupling with matter may change the constraint structure of the theory and thus make the additional first-class constraint(s) become the second-class, thus reintroduce the scalar mode(s) suppressed before. Some strategies for dealing with this problem have been adopted, for example in \cite{Carballo-Rubio2018,Aoki2018,Aoki:2018brq,Lin2019,Lin2019a}, by making the gauge symmetries of the gravity- and matter-sector match each other. Owing to the absence of additional first-class constraint in (\ref{S4_HP}), the gauge symmetry of this theory, (\ref{S4_HP}) with (\ref{Int_HD}), is exactly the spatial diffeomorphism. Thus the coupling problem is automatically solved as long as the matter field preserves the spatial covariance as well. For instance, the total Hamiltonian consistently coupled with a scalar field $\phi$ with its conjugate momentum $p$ can be written as \begin{equation} H_{\text{T}}\equiv\int\text{d}^{3}x\left(\hat{\mathscr{H}}+\mu_{\text{n}}\mathcal{S}^{\text{n}}+N^{i}\hat{\mathcal{H}}_{i}+\lambda^{i}\pi_{i}\right)\label{S4_HT} \end{equation} where the momentum constraints are extended to \begin{equation} \hat{\mathcal{H}}_{i}\equiv\mathcal{H}_{i}+p\nabla_{i}\phi\approx0_{i},\label{S4_Hi_h} \end{equation} with $\mathcal{H}_{i}$ defined in (\ref{Int_Hi}) and the matter coupled with gravity through the following generic function \begin{equation} \hat{\mathscr{H}}=\hat{\mathscr{H}}\left(N,\pi,h_{ij},\pi^{ij},\phi,p;\nabla_{i}\right).\label{S4_scrH_h} \end{equation} Note that, at the classical level, the Lorentz covariance of the scalar matter could be enhanced by particular choices of the generic function $\hat{\mathscr{H}}$ although, at the quantum level, it may be violated via the loops induced effect from the Lorentz-violating gravitons \cite{Aoki2020}. To conclude, we show that (\ref{S4_HP}) is a partial Hamiltonian of an MMG theory without requiring any condition. It can be used to couple with the matter consistently therefore (\ref{S4_HT}) provides an extensive yet simple framework for investigating the cosmological properties of the MMG theories. As an illustrating example, we will construct a concrete model (by making some choices for the free functions) in sec. \ref{Sec_CH_FAC}. \subsection{Case with three auxiliary constraints \label{Subsec_S3} } In the case of three ACs, \begin{equation} H_{\text{P}}\equiv\int\text{d}^{3}x\left(\mathscr{H}+\mu_{\text{n}}\mathcal{S}^{\text{n}}\right)\text{ with }\text{n}=1,2,3,\label{S3_HP} \end{equation} there are two possible classifications according to eq. (\ref{Int_=0000231+=0000232}) with (\ref{Int_4-2=0000231-=0000232}) \begin{equation} \#_{\mathrm{1st}}^{\text{s}}=1,\quad\#_{\mathrm{2nd}}^{\text{s}}=2,\label{S3_=0000231=00003D1,=0000232=00003D2} \end{equation} or \begin{equation} \#_{\mathrm{1st}}^{\text{s}}=0,\quad\#_{\mathrm{2nd}}^{\text{s}}=4.\label{S3_=0000231=00003D0,=0000232=00003D4} \end{equation} The first case (\ref{S3_=0000231=00003D1,=0000232=00003D2}) means that one of the ACs in (\ref{S3_HP}) is first-class and the other two are second-class. The existence of a first-class constraint implies that the ``partial'' Dirac matrix \begin{equation} \left[\mathcal{S}^{\text{n}}\left(\vec{x}\right),\mathcal{S}^{\text{n}^{\prime}}\left(\vec{y}\right)\right],\label{S3_DM} \end{equation} is degenerate in one dimension and the corresponding linear combination of $\{\mathcal{S}^{\text{n}}\}$ has vanishing Poisson bracket with $\mathscr{H}$, which will yield some conditions on the generic functions $\mathscr{H}$ and $\mathcal{S}^{\text{n}}$. Hence, different from the case with four ACs, these functions cannot be arbitrarily chosen anymore. As a simple case in which the matrix (\ref{S3_DM}) is degenerate in one dimension, let us suppose \begin{equation} \left[\mathcal{S}^{1}\left(\vec{x}\right),\mathcal{S}^{\text{n}}\left(\vec{y}\right)\right]\approx0^{\text{n}}.\label{S3_MC_1} \end{equation} We are always able to make linear combinations among the ACs and redefine the Lagrange multipliers. So, without loss of generality, we will continue the discussion with the pattern in (\ref{S3_MC_1}) for its simplicity. The pattern (\ref{S3_MC_1}) actually defines the conditions to be imposed on the ACs in order to have an MMG theory. We dub this kind of conditions the ``minimalizing conditions'' \cite{Yao2021}, since this kind of condition helps to narrow the space of theories down to the MMG subspace. In other words, the scalar d.o.f.~are completely eliminated by introducing the ACs satisfying the minimalizing conditions. Once the minimalizing conditions (\ref{S3_MC_1}) are satisfied, we should check the consistency condition of $\mathcal{S}^{1}\approx0$, which is \begin{equation} \dot{\mathcal{S}}^{1}(\vec{x})=\big[\mathcal{S}^{1}(\vec{x}),H_{\text{P}}\big]=\int\text{d}^{3}y\big[\mathcal{S}^{1}(\vec{x}),\mathscr{H}(\vec{y})\big]\approx 0.\label{S3_S1_dot} \end{equation} According to the classification (\ref{S3_=0000231=00003D1,=0000232=00003D2}), there should be no secondary constraint generated from (\ref{S3_S1_dot}), which implies that \begin{equation} \left[\mathcal{S}^{1}\left(\vec{x}\right),\mathscr{H}\left(\vec{y}\right)\right]\approx0,\label{S3_GSC} \end{equation} must be satisfied. This is however not a necessary condition for obtaining an MMG theory. In fact, if eq. (\ref{S3_GSC}) is not satisfied, then a secondary constraint is generated in (\ref{S3_S1_dot}) and the system is classified as the class (\ref{S3_=0000231=00003D0,=0000232=00003D4}). So no matter whether the condition (\ref{S3_GSC}) is satisfied or not, we will always have an MMG theory as long as the minimalizing condition (\ref{S3_MC_1}) is satisfied. The condition (\ref{S3_GSC}) is just used to enhance the gauge symmetry of the theory without altering the number of d.o.f. We therefore dub this kind of condition the ``symmetrizing condition''. We conclude that the partial Hamiltonian (\ref{S3_HP}) describes an MMG theory as long as the minimalizing condition (\ref{S3_MC_1}) is satisfied and the symmetries of the theory will be enhanced when the symmetrizing condition (\ref{S3_GSC}) is satisfied. In this case, the enhanced gauge symmetry helps to suppress the unwanted scalar d.o.f., which is exactly what happens in GR where the would-be scalar d.o.f.~is completely suppressed by the spacetime diffeomorphism. One may ask what kind of gauge symmetry will be enhanced by adopting the symmetrizing conditions (e.g. (\ref{S3_GSC})) beyond the spatial diffeomorphism. Some interesting opinions have been discussed in \cite{Lin2019a,Tasinato2020a}. A detailed analysis is however beyond the scope of the current work. \subsection{Case with two auxiliary constraints \label{Subsec_S2}} In the case with two scalar-type ACs, i.e. \begin{equation} H_{\text{P}}\equiv\int\text{d}^{3}x\left(\mathscr{H}+\mu_{\text{n}}\mathcal{S}^{\text{n}}\right)\text{ with }\text{n}=1,2,\label{S2_HP} \end{equation} we find the possible classes from eqs. (\ref{Int_=0000231+=0000232}) with (\ref{Int_4-2=0000231-=0000232}) as follows \begin{equation} \#_{\mathrm{1st}}^{\text{s}}=2,\quad\#_{\mathrm{2nd}}^{\text{s}}=0,\label{S2_=0000231=00003D2,=0000232=00003D0} \end{equation} \begin{equation} \#_{\mathrm{1st}}^{\text{s}}=1,\quad\#_{\mathrm{2nd}}^{\text{s}}=2,\label{S2_=0000231=00003D1,=0000232=00003D2} \end{equation} and \begin{equation} \#_{\mathrm{1st}}^{\text{s}}=0,\quad\#_{\mathrm{2nd}}^{\text{s}}=4.\label{S2_=0000231=00003D0,=0000232=00003D2} \end{equation} Let's explain the implications of these three classes one by one: \begin{enumerate}[label=(\arabic{enumi})] \item Obviously, the first class (\ref{S2_=0000231=00003D2,=0000232=00003D0}) covers the case in which both of the ACs are first-class without generating secondary constraints. By performing a similar analysis as the one conducted in the last case (\ref{S3_=0000231=00003D1,=0000232=00003D2}), it is easy to find the following minimalizing conditions for this class \begin{equation} \left[\mathcal{S}^{\text{1}}\left(\vec{x}\right),\mathcal{S}^{\text{n}}\left(\vec{y}\right)\right]\approx0^{\text{n}},\label{S2_MC_1-1} \end{equation} and \begin{equation} \left[\mathcal{S}^{\text{2}}\left(\vec{x}\right),\mathcal{S}^{\text{2}}\left(\vec{y}\right)\right]\approx0,\label{S2_MC_1-2} \end{equation} with the symmetrizing conditions as \begin{equation} \left[\mathcal{S}^{\text{n}}\left(\vec{x}\right),\mathscr{H}\left(\vec{y}\right)\right]\approx0^{\text{n}},\label{S2_GSC_1} \end{equation} which prevent the secondary constraints from being generated. \item Similarly, the second class (\ref{S2_=0000231=00003D1,=0000232=00003D2}) implies that there is one secondary constraint generated from the two primary constraints and one of these three constraints is first-class. However, it is easy to show that the secondary constraint could not be first-class, because then the corresponding primary constraint would become first-class simultaneously. As a result there would be two first- and one second-class constraints, which lead to a negative number of scalar d.o.f.. Therefore, without loss of generality, we set the secondary constraint as being generated by the time evolution of $\mathcal{S}^{1}$, i.e., $\dot{\mathcal{S}}^{1}\approx0$. According to whether the first-class constraint is $\mathcal{S}^{1}\approx0$ or $\mathcal{S}^{2}\approx0$, we divide the class (\ref{S2_=0000231=00003D1,=0000232=00003D2}) into two parallel patterns: \begin{enumerate}[label=\alph{enumii})] \item The first-class constraint is $\mathcal{S}^{1}\approx0$ which yields the same minimalizing condition as in (\ref{S2_MC_1-1}) but with \begin{equation} \left[\mathcal{S}^{1}\left(\vec{x}\right),\dot{\mathcal{S}}^{1}\left(\vec{y}\right)\right]\approx0.\label{S2_MC_2} \end{equation} Once (\ref{S2_MC_2}) is satisfied, generally, the consistency condition of $\dot{\mathcal{S}}^{1}\approx0$ will generate a tertiary constraint as \begin{eqnarray} & & \ddot{\mathcal{S}}^{1}\left(\vec{x}\right)=\int\text{d}^{3}y\Big\{\left[\dot{\mathcal{S}}^{1}\left(\vec{x}\right),\mathscr{H}\left(\vec{y}\right)\right]\nonumber \\ & & +\mu_{\text{2}}\left(\vec{y}\right)\left[\dot{\mathcal{S}}^{1}\left(\vec{x}\right),\mathcal{S}^{\text{2}}\left(\vec{y}\right)\right]\Big\}\approx0,\label{S2_ddS1} \end{eqnarray} where the Lagrange multiplier $\mu_{2}$ has been fixed by the consistency condition of $\mathcal{S}^{2}\approx0$. However by requiring (\ref{S2_=0000231=00003D1,=0000232=00003D2}), $\ddot{\mathcal{S}}^{1}\approx0$ should be prevented from being a non-trivial constraint therefore (\ref{S2_ddS1}) is forced to be a symmetrizing condition. \item The first-class constraint is $\mathcal{S}^{2}\approx 0$, which gives the same minimalizing conditions (\ref{S2_MC_1-1}) and (\ref{S2_MC_1-2}). The symmetrizing conditions (\ref{S2_GSC_1}) should be replaced by \begin{equation} \left[\mathcal{S}^{2}\left(\vec{x}\right),\dot{\mathcal{S}}^{1}\left(\vec{y}\right)\right]\approx0,\label{S2_GSC_2-1} \end{equation} and \begin{equation} \left[\mathcal{S}^{2}\left(\vec{x}\right),\mathscr{H}\left(\vec{y}\right)\right]\approx0,\label{S2_GSC_2-2} \end{equation} to ensure that $\mathcal{S}^{2}\approx0$ is first-class and generates no secondary constraint. \end{enumerate} \item The last class (\ref{S2_=0000231=00003D0,=0000232=00003D2}) can be simply achieved by giving up the symmetrizing conditions (\ref{S2_ddS1}), which leads to two primary, one secondary, and one tertiary constraints, or (\ref{S2_GSC_2-1}) with (\ref{S2_GSC_2-2}), which leads to two primary and two secondary constraints. All the resulting constraints are the second-class and both choices require the same minimalizing conditions (\ref{S2_MC_1-1}), with (\ref{S2_MC_2}) or (\ref{S2_MC_1-2}), respectively. \end{enumerate} We summarize for this case that we find two kinds of minimalizing conditions, i.e. (\ref{S2_MC_1-1}), with (\ref{S2_MC_1-2}) or (\ref{S2_MC_2}) respectively, for the partial Hamiltonian (\ref{S2_HP}) with two ACs. For the former, i.e. (\ref{S2_MC_1-1}) with (\ref{S2_MC_1-2}), one should add the symmetrizing conditions (\ref{S2_GSC_1}), or (\ref{S2_GSC_2-1}) with (\ref{S2_GSC_2-2}). In the latter case, i.e., (\ref{S2_MC_1-1}) with (\ref{S2_MC_2}), one should impose the symmetrizing condition (\ref{S2_ddS1}). In the previous work, we have studied a special case of theories in the class (\ref{S2_HP}) in \cite{Yao2021} where $\pi\approx0$ is specifically chosen as one of the ACs and the particular minimalizing conditions of (\ref{S2_MC_1-1}) and (\ref{S2_MC_2}) for the other AC were also discovered. \subsection{Case with one auxiliary constraint \label{Subsec_S1}} As the last case, we study the theory with only one AC, i.e. \begin{equation} H_{\text{P}}\equiv\int\text{d}^{3}x\left(\mathscr{H}+\mu_{\text{1}}\mathcal{S}^{\text{1}}\right),\label{S1_HP} \end{equation} which may develop into the same classification as in (\ref{S2_=0000231=00003D2,=0000232=00003D0})-(\ref{S2_=0000231=00003D0,=0000232=00003D2}), i.e. \begin{equation} \#_{\mathrm{1st}}^{\text{s}}=2,\quad\#_{\mathrm{2nd}}^{\text{s}}=0,\label{S1_=0000232=0000230} \end{equation} \begin{equation} \#_{\mathrm{1st}}^{\text{s}}=1,\quad\#_{\mathrm{2nd}}^{\text{s}}=2,\label{S1_=0000231=0000232} \end{equation} and \begin{equation} \#_{\mathrm{1st}}^{\text{s}}=0,\quad\#_{\mathrm{2nd}}^{\text{s}}=4.\label{S1_=0000230=0000234} \end{equation} It's obvious in this case that the total number of constraints is equal to the level of the secondary constraints since $\mathcal{S}^{\text{1}}\approx0$ is the only primary constraint and the secondary constraints must be generated from it step by step. \begin{enumerate}[label=(\arabic{enumi})] \item In the first class (\ref{S1_=0000232=0000230}), the primary constraint $\mathcal{S}^{\text{1}}\approx0$ and the secondary constraint $\dot{\mathcal{S}}^{1}\approx0$ are both first-class constraints and it is easy to find the minimalizing conditions as \begin{equation} \left[\mathcal{S}^{1}\left(\vec{x}\right),\mathcal{S}^{1}\left(\vec{y}\right)\right]\approx0,\label{S1_MC_1-1} \end{equation} \begin{equation} \left[\mathcal{S}^{1}\left(\vec{x}\right),\dot{\mathcal{S}}^{1}\left(\vec{y}\right)\right]\approx0,\label{S1_MC_1-2} \end{equation} and \begin{equation} \left[\dot{\mathcal{S}}^{1}\left(\vec{x}\right),\dot{\mathcal{S}}^{1}\left(\vec{y}\right)\right]\approx0,\label{S1_MC_1-3} \end{equation} with the symmetrizing condition \begin{equation} \left[\dot{\mathcal{S}}^{1}\left(\vec{x}\right),\mathscr{H}\left(\vec{y}\right)\right]\approx0,\label{S1_GSC_1} \end{equation} which prevents further secondary constraints from being generated. \item The second class (\ref{S1_=0000231=0000232}) implies that only one of the three constraints, i.e., the primary constraint $\mathcal{S}^{\text{1}}\approx0$, the secondary constraint $\dot{\mathcal{S}}^{1}\approx0$ and the tertiary constraint $\ddot{\mathcal{S}}^{1}\approx0$, is first-class. Similarly to what happens to the class of (\ref{S2_=0000231=00003D1,=0000232=00003D2}), in this case, the tertiary constraint $\ddot{\mathcal{S}}^{1}\approx0$ is not allowed to be first-class. Therefore, according to whether the first-class is taken by $\mathcal{S}^{1}\approx0$ or by $\dot{\mathcal{S}}^{1}\approx0$, we have the following two scenarios for (\ref{S1_=0000231=0000232}): \begin{enumerate}[label=\alph{enumii})] \item If the first-class constraint is $\mathcal{S}^{1}\approx0$, one requires the same minimalizing conditions (\ref{S1_MC_1-1}) and (\ref{S1_MC_1-2}) but with \begin{equation} \left[\mathcal{S}^{1}\left(\vec{x}\right),\ddot{\mathcal{S}}^{1}\left(\vec{y}\right)\right]\approx0,\label{S1_MC_2} \end{equation} instead of (\ref{S1_MC_1-3}). In order to prevent the generation of a quaternary constraint we should require the following symmetrizing condition \begin{equation} \left[\ddot{\mathcal{S}}^{1}\left(\vec{x}\right),\mathscr{H}\left(\vec{y}\right)\right]\approx0.\label{S1_GSC_2} \end{equation} \item On the other hand, choosing $\dot{\mathcal{S}}^{1}\approx0$ as the first-class constraint leads exactly to the same minimalizing conditions as in (\ref{S1_MC_1-1})-(\ref{S1_MC_1-3}) but with a different symmetrizing condition \begin{equation} \left[\dot{\mathcal{S}}^{1}\left(\vec{x}\right),\ddot{\mathcal{S}}^{1}\left(\vec{y}\right)\right]\approx0.\label{Sn=00003D1_gsc_3} \end{equation} \end{enumerate} \item The last class (\ref{S1_=0000230=0000234}) requires that the primary, secondary, tertiary and quaternary constraints are all second-class, which yields the same minimalizing conditions as in case a) i.e., (\ref{S1_MC_1-1}), (\ref{S1_MC_1-2}) and (\ref{S1_MC_2}), without requiring the symmetrizing condition. \end{enumerate} In summary, we find two possible kinds of minimalizing conditions for the partial Hamiltonian (\ref{S1_HP}) with only one AC, both of which consist in (\ref{S1_MC_1-1}) and (\ref{S1_MC_1-2}), with (\ref{S1_MC_1-3}) or (\ref{S1_MC_2}) respectively. We can choose the symmetrizing conditions as either (\ref{S1_GSC_1}) or (\ref{Sn=00003D1_gsc_3}) for the former, and (\ref{S1_GSC_2}) for the latter. We also point out that these two kinds of minimalizing conditions become equivalent, i.e. \begin{equation} \left[\dot{\mathcal{S}}^{1}\left(\vec{x}\right),\dot{\mathcal{S}}^{1}\left(\vec{y}\right)\right]=\left[\mathcal{S}^{1}\left(\vec{x}\right),\ddot{\mathcal{S}}^{1}\left(\vec{y}\right)\right]\approx0,\label{S1_=00005BdS,dS=00005D=00003D=00005BS,ddS=00005D} \end{equation} when (\ref{S1_MC_1-2}) is satisfied strongly \begin{equation} \left[\mathcal{S}^{1}\left(\vec{x}\right),\dot{\mathcal{S}}^{1}\left(\vec{y}\right)\right]=0.\label{S1_=00005BS1,dS1=00005D} \end{equation} This is just what happened in \cite{Mukohyama2019} where $\mathcal{S}^{\text{1}}\approx0$ and $\mathscr{H}$ are specified as $\pi\approx0$ and \begin{equation} \mathscr{H}=\mathcal{V}+N\mathcal{H}_{0}, \end{equation} respectively, where $\mathcal{V}$ and $\mathcal{H}_{0}$ are two general functions of $\left(h_{ij},\pi^{ij};\nabla_{i}\right)$ so that both of the minimalizing conditions (\ref{S1_MC_1-1}) and (\ref{S1_MC_1-2}) are automatically satisfied strongly and (\ref{S1_=00005BdS,dS=00005D=00003D=00005BS,ddS=00005D}) reduces to \begin{equation} \left[\mathcal{H}_{0}\left(\vec{x}\right),\mathcal{H}_{0}\left(\vec{y}\right)\right]\approx0. \end{equation} With all the cases studied above, we have exhausted all of the possible constraint structures for the MMG theories with AC(s) and found the corresponding minimalizing and symmetrizing conditions for each class. For convenience, we summarize the results of Subsec.~\ref{Subsec_S4} to \ref{Subsec_S1} in the table in appendix \ref{App_summary}. In the next section, as an illustrating example for our formalism, we will show how to construct a concrete MMG model corresponding to the case with four ACs by using the generalized Cayley-Hamilton theorem. \section{The Cayley-Hamilton construction with mixed traces constraints \label{Sec_CH_FAC}} According to the discussions in Subsec.~\ref{Subsec_S4}, the total Hamiltonian with four ACs describes a broad consistent framework to construct MMG theories, which reads \begin{equation} H_{\text{T}}=\int\text{d}^{3}x\left(\mathscr{H}+\mu_{\text{n}}\mathcal{S}^{\text{n}}+N^{i}\mathcal{H}_{i}+\lambda^{i}\pi_{i}\right),\label{CH_HT} \end{equation} where $\mathscr{H}$ and $\mathcal{S}^{\text{n}}$ $\left(\text{n}=1,2,3,4\right)$ are generic functions of $\left(N,\pi,h_{ij},\pi^{ij};\nabla_{i}\right)$, of which the forms can be taken arbitrarily. This theory is able to couple with matter consistently and in a general manner, for example in (\ref{S4_scrH_h}). In order to pick out a concrete MMG model from this class of theories, we will choose some restrictions for the generic functions $\mathscr{H}$ and $\mathcal{S}^{\text{n}}$. First, for simplicity, we assume that the lapse function $N$ is non-dynamical, as being considered in \cite{Lin:2017oow,Iyonaga2018,Gao:2019twq,Mukohyama2019,Yao2021}, which means its conjugate momentum $\pi$ plays the role of an AC. We take \begin{equation} \mathcal{S}^{4}=\pi\approx0, \end{equation} therefore the remaining functions $\mathscr{H}$ and $\mathcal{S}^{\text{I}}$ $\left(\text{I}=1,2,3\right)$ can be rewritten as generic functions of $\left(N,h_{ij},\pi^{ij};\nabla_{i}\right)$ on the constrained hypersurface or by redefinition of $\mu_4$. Next we adopt the same restriction as what was imposed in \cite{Yao2021}, i.e.~that the spatial derivative $\nabla_{i}$ appears in the theory in terms of the Ricci tensor $R_{ij}$ only. Thus we consider the $\mathscr{H}$ and $\mathcal{S}^{\text{I}}$ to be generic functions of $\left(N,R_{ij},\pi^{ij}\right)$ only. A motivation for picking this restriction is that according to the generalized Cayley-Hamilton theorem \cite{Mertzios1986} (see also the appendix in \cite{Yao2021}), $\mathscr{H}$ and $\mathcal{S}^{\text{I}}$ can then be equivalently recast into generic functions of the traces $\left(N,\mathscr{R}^{\text{I}},\varPi^{\text{I}},\mathscr{Q}^{\text{I}}\right)$ constructed from $R_{ij}$ and $\pi^{ij}$, in which we denote the traces of $R_{ij}$ by \begin{equation} \mathscr{R}^{\text{\text{I}}}\equiv\left\{ R_{i}^{i},R_{j}^{i}R_{i}^{j},R_{j}^{i}R_{k}^{j}R_{i}^{k}\right\} ,\label{CH_RI} \end{equation} the traces of $\pi_{ij}$ by \begin{equation} \varPi^{\text{\text{I}}}\equiv\left\{ \pi_{i}^{i},\pi_{j}^{i}\pi_{i}^{j},\pi_{j}^{i}\pi_{k}^{j}\pi_{i}^{k}\right\} ,\label{CH_PiI} \end{equation} and the mixed traces by \begin{equation} \mathscr{Q}^{\text{\text{I}}}\equiv\left\{ R_{j}^{i}\pi_{i}^{j},R_{j}^{i}\pi_{k}^{j}\pi_{i}^{k},R_{j}^{i}R_{k}^{j}\pi_{i}^{k}\right\} .\label{CH_QI} \end{equation} In the model constructed in \cite{Yao2021}, the mixed traces terms (\ref{CH_QI}) were dropped for simplicity. Instead, in the current work, we use them to construct ACs by choosing \begin{equation} \mathcal{S}^{\text{\text{I}}}=\mathscr{Q}^{\text{\text{I}}}-\mathscr{P}^{\text{\text{I}}}\left(N\right)\approx0,\label{CH_QI-PI} \end{equation} where $\mathscr{P}^{\text{\text{I}}}$ are generic functions of $N$. Please keep in mind that we have complete freedom to determine the form for the ACs in this theory and each choice may define a different MMG theory. As a result, if we put together the above choices, we have picked a concrete MMG model from the class of theories (\ref{CH_HT}) as \begin{eqnarray} & & H_{\text{T}}^{(\text{C.H.})}=\int\text{d}^{3}x\Big[\mathscr{H}^{(\text{C.H.})}+N^{i}\mathcal{H}_{i}\nonumber \\ & & +\lambda^{i}\pi_{i}+\lambda\pi+\mu_{\text{\text{I}}}\left(\mathscr{Q}^{\text{\text{I}}}-\mathscr{P}^{\text{\text{I}}}\right)\Big],\label{CH_HT_CH} \end{eqnarray} where the fourth Lagrange multiplier is written as $\mu_{4}\equiv\lambda$ and $\mathscr{H}^{(\text{C.H.})}$ is a free function of $\left(N,\mathscr{R}^{\text{I}},\varPi^{\text{I}}\right)$ on the constrained hypersurface for this MMG model (\ref{CH_HT_CH}). We will dub this model the Cayley-Hamilton construction with mixed traces constraints. \subsection{The dispersion relation} In order to investigate the properties of the model (\ref{CH_HT_CH}) in a cosmological setting, we will derive the dispersion relation of gravitational waves as tensor perturbations on a cosmological background within this model. First, by performing a Legendre transformation from the Hamiltonian (\ref{CH_HT_CH}), its corresponding action can be obtained as \begin{equation} S^{(\text{C.H.})}=\int\text{d}t\text{d}^{3}x\Big[2NK_{ij}\pi^{ij}-\mathscr{H}^{(\text{C.H.})}-\mu_{\text{\text{I}}}\Big(\mathscr{Q}^{\text{\text{I}}}-\mathscr{P}^{\text{\text{I}}}\Big)\Big],\label{CH_S} \end{equation} where $\pi^{ij}$ should be understood as the solution of \begin{equation} 2NK_{ij}=\frac{\partial\mathscr{H}^{(\text{C.H.})}}{\partial\pi^{ij}}+\mu_{\text{I}}\frac{\partial\mathscr{Q}^{\text{I}}}{\partial\pi^{ij}},\label{CH_Can} \end{equation} and will rely on the concrete choice of $\mathscr{H}^{(\text{C.H.})}$. The Lagrange multipliers $\mu_{\text{I}}$ have been fixed by the consistency condition of $\pi\approx0$ as \begin{equation} \mu_{\text{I}}=\left(\frac{\partial\mathscr{P}^{\text{I}}}{\partial N}\right)^{-1}\frac{\partial\mathscr{H}^{(\text{C.H.})}}{\partial N}.\label{CH_muI} \end{equation} The tensor perturbations of the action (\ref{CH_S}) are defined around a flat Friedmann-Lemaître-Robertson-Walker (FLRW) background with \begin{equation} \mu_{\text{I}}=\bar{\mu}_{\text{I}}\left(t\right),\quad N=1,\quad N^{i}=0,\quad h_{ij}=a\left(t\right)^{2}\mathfrak{g}_{ij},\label{CH_BG_Var} \end{equation} where (and also throughout the rest of this paper) a bar`` $\bar{}$ '' represents the background values and $a\left(t\right)$ is the scale factor of the background FLRW metric \begin{equation} \text{d}s^{2}=-\text{d}t^{2}+a\left(t\right)^{2}\delta_{ij}\text{d}x^{i}\text{d}x^{j}. \end{equation} We expand \begin{equation} \mathfrak{g}_{ij}\equiv\delta_{ij}+\gamma_{ij}+\frac{1}{2!}\gamma_{ik}\gamma^{k}{}_{j}+\frac{1}{3!}\gamma_{ik}\gamma^{k}{}_{l}\gamma^{l}{}_{j}+\cdots,\label{CH_gij} \end{equation} with the tensor perturbation $\gamma^{i}{}_{j}$ satisfying the transverse and traceless conditions \begin{equation} \partial_{i}\gamma^{i}{}_{j}=0,\quad\gamma_{i}^{i}=0.\label{CH_TT_Gau} \end{equation} Note that we have turned off the scalar- and vector-type perturbations and in this subsection, spatial indices are raised and lowered by $\delta^{ij}$ and $\delta_{ij}$. For generality, we keep $\mathscr{H}^{(\text{C.H.})}$ as a general function. However this also means that we are only able to solve (\ref{CH_Can}) order by order for $\pi^{ij}$. By substituting this solution back into the action (\ref{CH_S}), we can nonetheless find the following quadratic action \begin{eqnarray} & & S_{2}^{(\text{C.H.})}=\int\text{d}t\text{d}^{3}x\frac{1}{4}\Big(\mathcal{G}_{0}\left(t\right)\dot{\gamma}_{ij}\dot{\gamma}^{ij}\nonumber \\ & & +\mathcal{W}_{0}\left(t\right)\gamma_{ij}\frac{\Delta}{a^{2}}\gamma^{ij}-\mathcal{W}_{2}\left(t\right)\gamma_{ij}\frac{\Delta^{2}}{a^{4}}\gamma^{ij}\Big),\label{CH_S_qua} \end{eqnarray} where \begin{equation} \mathcal{G}_{0}\left(t\right)\equiv\left[\left(\frac{\partial\mathscr{\bar{H}}}{\partial\varPi^{2}}\right)^{2}-3\frac{\partial\mathscr{\bar{H}}}{\partial\varPi^{3}}\left(\frac{\partial\mathscr{\bar{H}}}{\partial\varPi^{1}}-2H\right)\right]^{-1/2},\label{CH_G0} \end{equation} \begin{equation} \mathcal{W}_{0}\left(t\right)\equiv-\frac{\partial\bar{\mathscr{H}}}{\partial\mathscr{R}^{1}}+\varpi_{0}\left(t\right), \end{equation} and \begin{equation} \mathcal{W}_{2}\left(t\right)\equiv\frac{\partial\bar{\mathscr{H}}}{\partial\mathscr{R}^{2}}+\varpi_{2}\left(t\right), \end{equation} with \begin{eqnarray} & & \varpi_{0}\left(t\right)\equiv-\frac{1}{2}\mathcal{G}_{0}\bar{\mu}_{1}^{\prime}+\left(3\frac{\partial\bar{\mathscr{H}}}{\partial\varPi^{3}}\right)^{-1}\left(\mathcal{G}_{0}\frac{\partial\bar{\mathscr{H}}}{\partial\varPi^{2}}-1\right)\bar{\mu}_{2}^{\prime}\nonumber \\ & & +\left[\left(3\frac{\partial\bar{\mathscr{H}}}{\partial\varPi^{3}}\right)^{-1}\left(\frac{\partial\bar{\mathscr{H}}}{\partial\varPi^{2}}-\mathcal{G}_{0}^{-1}\right)-\frac{\mathcal{G}_{0}^{\prime}}{2}+\mathcal{G}_{0}H\right]\bar{\mu}_{1}\nonumber \\ & & +\left(3\frac{\partial\bar{\mathscr{H}}}{\partial\varPi^{3}}\mathcal{G}_{0}\right)^{-2}\Big[-1+\mathcal{G}_{0}\Big(3\mathcal{G}_{0}(\mathcal{G}_{0}\frac{\partial\bar{\mathscr{H}}}{\partial\varPi^{3}}\frac{\partial\bar{\mathscr{H}}}{\partial\varPi^{2}}^{\prime}\nonumber \\ & & +\frac{\partial\bar{\mathscr{H}}}{\partial\varPi^{3}}^{\prime}+2\frac{\partial\bar{\mathscr{H}}}{\partial\varPi^{3}}H)+\frac{\partial\bar{\mathscr{H}}}{\partial\varPi^{2}}(2-3\mathcal{G}_{0}(\mathcal{G}_{0}\frac{\partial\bar{\mathscr{H}}}{\partial\varPi^{3}}^{\prime}\nonumber \\ & & -\frac{\partial\bar{\mathscr{H}}}{\partial\varPi^{3}}\mathcal{G}_{0}^{\prime}+2\frac{\partial\bar{\mathscr{H}}}{\partial\varPi^{3}}\mathcal{G}_{0}H))-\frac{\partial\bar{\mathscr{H}}}{\partial\varPi^{2}}^{2}\mathcal{G}_{0}\Big)\Big]\bar{\mu}_{2},\label{CH_varpi_0} \end{eqnarray} and \begin{eqnarray} & & \varpi_{2}\left(t\right)\equiv\left(6\frac{\partial\mathscr{\bar{H}}}{\partial\varPi^{3}}\right)^{-2}\Big[12\frac{\partial\mathscr{\bar{H}}}{\partial\varPi^{3}}\left(\mathcal{G}_{0}^{-1}-\frac{\partial\mathscr{\bar{H}}}{\partial\varPi^{2}}\right)\bar{\mu}_{3}\nonumber \\ & & -\mathcal{G}_{0}\left(3\frac{\partial\mathscr{\bar{H}}}{\partial\varPi^{3}}\bar{\mu}_{1}+2\left(\mathcal{G}_{0}^{-1}-\frac{\partial\mathscr{\bar{H}}}{\partial\varPi^{2}}\right)\bar{\mu}_{2}\right)^{2}\Big].\label{CH_varpi_2} \end{eqnarray} Here, $\mathscr{H}^{(\text{C.H.})}$ is simply denoted by $\mathscr{H}$ for short and $H\equiv\dot{a}/a$ is the Hubble parameter. Note that the background values of the Lagrange multipliers $\bar{\mu}_{\text{I}}$ in (\ref{CH_varpi_0}) and (\ref{CH_varpi_2}) have been fixed by (\ref{CH_muI}). In order to prevent tensor perturbations from being ghosts, i.e.~from acquiring a negative kinetic term, only the positive branch of $\mathcal{G}_{0}\left(t\right)$ is taken in (\ref{CH_G0}) which holds for $\frac{\partial\mathscr{\bar{H}}}{\partial\varPi^{2}}>0$. The dispersion relation can be immediately read from (\ref{CH_S_qua}) as \cite{Gao2020} \begin{eqnarray} & & \omega_{\text{T}}^{2}=\frac{\mathcal{W}_{0}\left(\tau\right)}{\mathcal{G}_{0}\left(\tau\right)}\frac{k^{2}}{a^{2}}+\frac{\mathcal{W}_{2}\left(\tau\right)}{\mathcal{G}_{0}\left(\tau\right)}\frac{k^{4}}{a^{4}}\nonumber \\ & & =\frac{k^{2}}{a^{2}}\mathcal{G}_{0}^{-1}\left[\varpi_{0}-\frac{\partial\bar{\mathscr{H}}}{\partial\mathscr{R}^{1}}+\left(\varpi_{2}+\frac{\partial\bar{\mathscr{H}}}{\partial\mathscr{R}^{2}}\right)\frac{k^{2}}{a^{2}}\right].\label{CH_Dps} \end{eqnarray} On large scales, the speed of gravitational waves $c_{\text{T}}=\omega_{\text{T}}/k=1$ when \begin{equation} \frac{\partial\bar{\mathscr{H}}}{\partial\mathscr{R}^{1}}=\varpi_{0}-\mathcal{G}_{0}.\label{CH_cT=00003D1} \end{equation} According to the observation of the speed of gravitational waves \cite{Abbott2017,Abbott2017b} and the modified dispersion relation \cite{Abbott2017a}, we should impose the following constraints to (\ref{CH_Dps}): \begin{equation} -3\times10^{-15}<\frac{\mathcal{W}_{0}}{\mathcal{G}_{0}}-1<7\times10^{-16},\label{CH_W0/G0} \end{equation} and \begin{equation} \left|\frac{\mathcal{W}_{2}}{\mathcal{G}_{0}}\right|<10^{-19}\text{ peV}^{-2},\label{CH_W2/G0} \end{equation} where $1\text{ peV}\simeq h\times250\text{ Hz}$ with $h$ the Planck constant. \section{Conclusions \label{Sec_cld}} In this work, we have searched for all the possible Hamiltonian structures for minimally modified gravity (MMG) theories with multiple auxiliary constraints (ACs) in the phase space. To do this, we have first investigated the possibilities of reducing the number of degree(s) of freedom (d.o.f.) by introducing ACs to the total Hamiltonian (\ref{Int_HT_anz}) while respecting spatial diffeomorphism. An arbitrary number of scalar-, vector- and tensor-type ACs have been considered a priori, and in order to extract the maximum number for each type of ACs, they were firstly assumed to be linearly independent second-class constraints following Dirac's terminology. By counting the number of each type of d.o.f.~with respect to an arbitrary background in (\ref{Int_=000023dof_1}), and requiring that this number be non-negative, we have found that no vector- and no tensor-type should be introduced, and that there should be no more than four scalar-type of ACs in the absence of external fields~\footnote{This conclusion holds as far as we seek theories with only two tensorial d.o.f., even if we allow the traceless or transverse-traceless parts of tensor-type ACs (or the transverse parts of vector-type ACs) to be imposed separately.}. In fact, the vectorial d.o.f.~have been completely eliminated by the spatial diffeomorphism constraints (\ref{Int_3d_diff}) and the existence of vector- or tensor-type ACs would lead to a negative result, which is physically inconsistent in the vacuum. Hence, on the premise of retaining spatial covariance, we have determined a consistent framework (\ref{Int_HT_2}) with no more than four (scalar-type) ACs, $\mathcal{S}^{\text{n}}\approx0^{\text{n}}$ ($\mathrm{n} =1,\cdots, \mathcal{N} (\mathcal{N}\leq 4)$), as our starting point for searching for MMG theories which propagate only two tensorial d.o.f.. By this request, the residual scalar d.o.f.~should all be completely suppressed by the ACs and the possible secondary constraints being generated from the consistency conditions of the ACs. According to the number of introduced primary ACs, we have exhausted all possible classes of primary and secondary constraints and have found out the corresponding conditions for their consistency. In Subsec.~\ref{Subsec_S4} with four ACs (\ref{S4_HP}), we have confirmed that all of the ACs must be classified as second-class, and that one requires no extra condition to obtain a MMG theory. Therefore, (\ref{S4_HP}) together with (\ref{Int_HD}) provide an extensive framework for us to investigate several MMG theories with four ACs $\mathcal{S}^{\text{n}}\approx0^{\text{n}}$, thus leaving in addition to the free function $\mathscr{H}$, four other arbitrary choices of independent functions of $\left(N,\pi,h_{ij},\pi^{ij};\nabla_{i}\right)$, i.e.~a lot of freedom in terms of model building. More importantly, this type of structure can be used to couple with matter consistently in a very general manner in (\ref{S4_scrH_h}). In the Sec.~\ref{Sec_CH_FAC}, as an illustrating example of this type of structure, we have constructed a practical MMG model by starting from (\ref{CH_HT}). For simplicity, we have restricted ourselves to the special case of a non-dynamical lapse which yields $\pi\approx0$ as one of the four ACs. We have further chosen that the spatial derivative $\nabla_{i}$ should only appear in the theory in the form of the Ricci tensor $R_{ij}$ and, according to the generalized Cayley-Hamilton theorem, we were therefore able to recast $\mathscr{H}$ and $\mathcal{S}^{\text{I}}$ into generic functions of $\left(N,\mathscr{R}^{\text{\text{I}}},\varPi^{\text{I}},\mathscr{Q}^{\text{\text{I}}}\right)$. By choosing the mixed traces $\mathscr{Q}^{\text{\text{I}}}$ as the remaining ACs (\ref{CH_QI-PI}), we were able to pick out an interesting MMG model (\ref{CH_HT_CH}) which we dub the Cayley-Hamilton construction with mixed traces constraints. In order to investigate the properties of this model in the cosmological setting, we have studied the tensor perturbations of the corresponding action (\ref{CH_S}) on an FLRW background up to the quadratic order and thereby have derived the modified dispersion relation (\ref{CH_Dps}) for the gravitational waves (GW) from which we have found that the speed of GW is unity on large scales when (\ref{CH_cT=00003D1}) is satisfied. Besides, in order to prevent the tensor perturbations from being ghosts, the free function $\mathscr{H}^{(\text{C.H.})}\left(N,\mathscr{R}^{\text{I}},\varPi^{\text{I}}\right)$ in the model must satisfy $\frac{\partial\mathscr{\bar{H}}}{\partial\varPi^{2}}>0$ and the constraints (\ref{CH_W0/G0}) and (\ref{CH_W2/G0}) from observations. In Subsec.~\ref{Subsec_S3} to \ref{Subsec_S1}, we have determined all possible classes of primary and secondary constraints for the MMG theories with three, two and one AC(s) respectively. Different from the case with four ACs, in these cases with less AC(s), minimalizing conditions are required. These are the sufficient conditions to suppress the scalar d.o.f.~completely, e.g., (\ref{S3_MC_1}) for the case with three ACs. In particular, with a non-dynamical lapse, the specific minimalizing conditions, (\ref{S2_MC_1-1}) with (\ref{S2_MC_1-2}) or (\ref{S2_MC_2}), for the case with two ACs had already been discovered in \cite{Yao2021}; similarly, the minimalizing conditions (\ref{S1_MC_1-1}) and (\ref{S1_MC_1-2}) with (\ref{S1_MC_1-3}) or (\ref{S1_MC_2}) had already been discovered \cite{Mukohyama2019} respectively. On the other hand, with fewer ACs, there is room for the appearance of extra gauge symmetries other than the spatial diffeomorphism retained from the beginning of the construction. In order to allow for the extra gauge symmetries, so-called symmetrizing conditions have been imposed, e.g. (\ref{S3_GSC}) for the case with three ACs. The symmetrizing conditions of course help to suppress the scalar d.o.f., however, they are neither necessary nor sufficient conditions for obtaining a MMG theory because we are always able to fix the gauge symmetries by simply giving up these symmetrizing conditions. Nevertheless they are important for investigating the gauge symmetries of MMG theories \cite{Lin2019a,Tasinato2020a} and it would be interesting to clarify these properties in a future work. We have summarized the minimalizing and symmetrizing conditions for each class in Table \ref{tab_summary}. With this, we have exhausted all the possible constraint structures of the MMG theories with multiple ACs. We finish this paper with the following comments. First, as mentioned previously, we should clarify the possible gauge symmetries for the MMG theories and examine the possible deviations from the spacetime diffeomorphism. Second, we have not constructed a concrete model for the case with three ACs which is also an interesting case of MMG theory and should be studied in the future. Third, the cosmological behavior and evolution with matter of the Cayley-Hamilton construction with mixed traces constraints (\ref{CH_HT_CH}) should be investigated and tested against the observations. It would also be interesting to see whether it can be used to address current issues within cosmology, e.g.~the Hubble tension or the dark energy \cite{Ganz2022,Ganz2022a}. And more importantly, we should find the features of this theory with respect to GWs and see whether it can be practically distinguished from GR. We will come back to these questions in the near future. \acknowledgments This work of XG was supported by the National Natural Science Foundation of China (NSFC) under the grant No. 11975020 and No. 12005309. The work of SM was supported in part by JSPS Grants-in-Aid for Scientific Research No.~17H02890, No.~17H06359, and by World Premier International Research Center Initiative, MEXT, Japan.
\section{Introduction} For $s \in(0,1)$, $\mu \in {\mathbb R}$ and $x\in{\mathbb R}^N$ with $2 \leq N \in {\mathbb N}$, let $\CL_\mu^s$ be the fractional Hardy operator defined by \bal \CL_\mu^s := (-\Delta)^s +\frac{\mu}{|x|^{2s}}. \eal Here $ (-\Delta)^s $ denotes the fractional Laplacian defined by \bal (-\Delta)^s u(x):= C_{N,s}\lim_{\epsilon\to 0^+} \int_{{\mathbb R}^N\setminus B_\epsilon(x) }\frac{ u(x)- u(y)}{|x-y|^{N+2s}} dy, \eal where $B_\epsilon(x)$ is the ball centered $x \in {\mathbb R}^N$ with radius $\epsilon>0$, \bal C_{N,s}=2^{2s}\pi^{-\frac N2}s\frac{\Gamma(\frac{N+2s}2)}{\Gamma(1-s)}>0 \eal with $\Gamma$ being the Gamma function. In this article, we consider the semilinear problem \ba \label{eq:g(u)-kdirac-sum} \left\{\begin{aligned} \CL_\mu^s u+g(u)&= \tilde \nu &&\quad\text{in}\;\Omega,\\ u&=0&&\quad\text{in}\;\BBR^N\setminus\Omega, \end{aligned} \right. \ea where $g: {\mathbb R} \to {\mathbb R}$ is a nondecreasing continuous function such that $g(0)=0$ and $\tilde \nu$ is a bounded measure on $\Omega$. \subsection{Review of the literature} When $s=1$, the operator $\CL_\mu^s$ becomes the local Hardy operator $\CL_\mu^1:=-\Delta +\frac{\mu}{|x|^2}$ and problem \eqref{eq:g(u)-kdirac-sum} reduces to the following semilinear elliptic equation \ba \label{eq:g(u)-kdirac-sum-loc} \left\{\begin{aligned} \CL_\mu^1 u+g(u)&= \tilde \nu &&\quad\text{in}\;\,\Omega,\\ u&=0&&\quad\text{on}\;\, \partial\Omega. \end{aligned} \right. \ea In the free-potential case, namely $\mu=0$, fundamental contributions were due to Brezis \cite{B12} and B\'enilan and Brezis \cite{BB11}. When $N\geq 3$, it was proved that if $g:{\mathbb R}\to{\mathbb R}$ satisfies the {\it integral subcritical assumption} \bal \int_1^{+\infty}(g(s)-g(-s))s^{-1-\frac{N}{N-2}}ds<+\infty \eal then problem \eqref{eq:g(u)-kdirac-sum-loc} admits a unique weak solution. When $N=2$, Vazquez \cite{Va1} imposed a condition expressed in terms of exponential growth of $g$ under which there exists a unique weak solution of \eqref{eq:g(u)-kdirac-sum-loc} with $\mu=0$. Later on, Baras and Pierre \cite{BP2} studied \eqref{eq:g(u)-kdirac-sum-loc}) with $g(u)=|u|^{p-1}u$ for $p>1$ and they discovered that for $p\geq\frac{N}{N-2}$, the problem is solvable if and only if $\tilde \nu$ is absolutely continuous with respect to the Bessel capacity $c_{2,p'}$ with $p'=\frac{p}{p-1}$. Since then, significant developments on problem \eqref{eq:g(u)-kdirac-sum-loc} in different directions have been established; see e.g. \cite{BMP, MV-book,Ve-HandBook}. In case $\mu\not=0$, problem \eqref{eq:g(u)-kdirac-sum-loc} was studied in \cite{GuVe,D,BP} in connection with the Hardy inequality \cite{BV1,VazZua-00}. Thanks to a new notion of weak solutions of $\CL_\mu} \def\gn{\nu} \def\gp{\pi^1 u=0$ combined with a dual formulation of the equation introduced in \cite{CQZ}, the authors of the paper \cite{ChVe} investigated problem \eqref{eq:g(u)-kdirac-sum-loc}and proved a existence and uniqueness result provided that $g$ satisfies a subcritical integral assumption and the weak $\Delta_2$-condition. Moreover, when $g(u)=|u|^{p-1}u$ with $p>1$, they gave necessary and sufficient conditions for the existence of a weak solution to \eqref{eq:g(u)-kdirac-sum-loc}. For semilinear elliptic equations with more general potentials, we refer to \cite{GkiNg-absorption}. When $s\in(0,1)$ and $\mu=0$, problem \eqref{eq:g(u)-kdirac-sum} turns to the fractional semilinear elliptic equation \bal \left\{\begin{aligned} (-\Delta)^s u+g(u)&= \tilde \nu &&\quad\text{in}\;\Omega,\\ u&=0&&\quad\text{in}\;\BBR^N\setminus\Omega, \end{aligned} \right. \eal which has been studied in \cite{CV} with Radon measure $\tilde \nu$. The readers are referred to \cite{KMS} for the case $g=0$ and to \cite{NV} for boundary measures. Now we return to problem \eqref{eq:g(u)-kdirac-sum}, which is driven by the fractional Hardy operator $\CL_\mu^s$. This operator arises in physical models related to relativistic Schr\"odinger operator with Coulomb potential (see \cite{NRS,FLS1}), in the study of Hardy inequalities and Hardy-Lieb-Thirring inequalities (see, e.g., \cite{FLS,Fra-2009,tz}) and is closely related to the fractional Hardy inequality \ba \label{mu_00} \frac{C_{N,s}}{2}\int_{{\mathbb R}^N}\int_{{\mathbb R}^N} \frac{|\varphi(x)-\varphi(y)|^2}{|x-y|^{N+2s}}dydx + \mu_0 \int_{{\mathbb R}^N} \frac{|\varphi(x)|^2}{|x|^{2s}}dx \geq 0, \quad \forall \varphi \in C_0^\infty({\mathbb R}^N), \ea where the best constant in \eqref{mu_00} is explicitly determined by (see, e.g., \cite{FLS}) \bal \mu_0 =-2^{2s}\frac{\Gamma^2(\frac{N+2s}4)}{\Gamma^2(\frac{N-2s}{4})}. \eal Related inequalities could be found in \cite{BF,FLS,Fra-2009}. Note that when $\mu\geq \mu_0$, the fractional Hardy operator $\CL^s_\mu$ is positive definite. The potential $\mu |x|^{-2s}$ is of the same homogeneity $-2s$ as $(-\Delta)^s$, hence it cannot be understood as a lower order perturbation of $(-\Delta)^s$. Moreover, in non-relativistic quantum mechanics, this potential exhibits the borderline between regular potentials (for which ordinary stationary states exist) and singular potentials (for which the energy is not bounded from below), therefore it may lead to disclose anomalous phenomena (see \cite{FLS-71}). Further properties of $\CL_\mu^s$ were obtained in \cite{B,JW,MY}. Recent years have witnessed a growing interest in the study of elliptic equations with fractional Hardy potentials, evidenced by \cite{F,M,NRS,MW,WYZ,CW,CGN}. Let us recall relevant results on the linear equation with a fractional Hardy potential. It was shown in \cite{CW} that for $\mu\geq \mu_0$ the equation \bal \CL_\mu^s u=0\quad\, {\rm in}\ \, {\mathbb R}^N\setminus \{0\} \eal has two distinct radial solutions \ba\label{fu} \Phi_{s,\mu}(x)=\left\{ \begin{aligned} &|x|^{\tau_-(s,\mu)}\quad &&\text{if } \mu>\mu_0\\ &|x|^{-\frac{N-2s}{2}}|\ln|x|| \quad &&\text{if } \mu=\mu_0 \end{aligned} \right.\quad \text{and}\ \ \Gamma_{s,\mu}(x)=|x|^{\tau_+(s,\mu)} \ \ \text{for } x \in {\mathbb R}^N \setminus \{0\}, \ea where $\tau_-(s,\mu) \leq \tau_+(s,\mu)$. Additional properties of $\tau_-(s,\mu)$ and $\tau_+(s,\mu)$ were given in \cite[Proposition 1.2]{CW}. \textit{In the remaining of the paper, when there is no ambiguity, we write for short $\tau_+$ and $\tau_-$ instead of $\tau_+(s,\mu)$ and $\tau_-(s,\mu)$.} Note that for any $\xi\in C^2_c({\mathbb R}^N)$, \bal \int_{{\mathbb R}^N}\Phi_{s,\mu} (-\Delta)^s_{\tau_+}\xi \, dx =c_{s,\mu}\xi(0), \eal where $c_{s,\mu}>0$ and $(-\Delta)^s_{\tau_+}$ denotes the dual of the operator of $\CL^s_\mu$, which is a weighted fractional Laplacian given by \ba (-\Delta)^s_{\tau_+} v(x):= C_{N,s}\lim_{\epsilon\to0^+} \int_{{\mathbb R}^N\setminus B_\epsilon(x) }\frac{v(x)- v(y)}{|x-y|^{N+2s}} \, |y|^{\tau_+}dy. \ea By \cite[Theorem 4.14]{CW}, there exist a positive constant $c=c(N,s,\mu,\Omega)$ and a nonnegative function $\Phi_{s,\mu}^\Omega\in W^{s,2}_{\mathrm{loc}}(\BBR^N\setminus\{0\})$ such that $\Phi_{s,\mu}^\Omega=0$ in $\BBR^N\setminus\Omega,$ \ba \label{PhiOmega} \lim_{|x|\to 0^+}\frac{\Phi_{s,\mu}^\Omega(x)}{\Phi_{s,\mu}(x)}=1\quad \text{and}\quad\Phi_{s,\mu}^\Omega(x)\leq c |x|^{\tau_-}, \quad \forall x\in \Omega\setminus\{0\}. \ea Moreover, for any $v\in C_0^\infty(\Omega\setminus\{0\})$ \bal \ll \Phi_{s,\mu}^\Omega,v \gg_{\mu} :=\frac{C_{N,s}}{2}\int_{{\mathbb R}^N}\int_{{\mathbb R}^N}\frac{\big(u(x)-u(y)\big)\big(v(x)-v(y)\big)}{|x-y|^{N+2s}} dy dx+\mu \int_\Omega \frac{u(x) v(x)}{|x|^{2s}}dx= 0 \eal and for any $\psi\in C^{1,1}_0(\Omega)$ \bal \int_\Omega \Phi_{s,\mu}^\Omega(-\Delta)^s_{\tau_+}\psi\, dx=c_{s,\mu}\,\psi(0), \eal where $c_{s,\mu}$ is a constant given in \cite[(1.15)]{CW}. In a recent paper \cite{CGN}, the authors of the present paper set up an appropriate distributional framework to investigate of the form \ba\label{eq 1.0}\left\{\begin{aligned} \CL_\mu^s u&= \tilde \nu &&\quad\text{in}\;\Omega,\\ u&=0&&\quad\text{in}\;\BBR^N\setminus\Omega, \end{aligned}\right. \ea where $\tilde \nu$ is a bounded measure on $\Omega$. The approach in \cite{CGN} is to analyze the associated weighted fractional Laplace operator $(-\Delta)^s_{\gamma}$ which is defined by \ba \label{L} (-\Delta)^s_{\gamma} v(x)=C_{N,s}\lim_{\delta\to 0^+} \int_{{\mathbb R}^N\setminus B_\delta(x) }\frac{v(x)- v(y)}{|x-y|^{N+2s}} \, |y|^\gamma dy, \ea where $\gamma\in\big[ -\frac{N-2s}{2}, 2s\big)$. Particularly, $(-\Delta)^s_0$ reduces to the fractional Laplacian. From the integral-differential form of the weighted fractional Laplacian, a natural restriction for the function $v$ is \bal \|v\|_{L_{2s-\gamma}({\mathbb R}^N)}:=\int_{{\mathbb R}^N}\frac{|v(x)|}{(1+|x|)^{N+2s-\gamma}} dx<+\infty. \eal The weighted Sobolev space associated to $(-\Delta)_{\gamma}^s$ is $H_0^s(\Omega;|x|^\gamma)$, which is defined as the closure of the functions in $C^\infty({\mathbb R}^N)$ with the compact support in $\Omega$ under the norm \ba \norm{u}_{H_0^s(\Omega ;|x|^\gamma)}:=\sqrt{\int_{{\mathbb R}^N}\int_{{\mathbb R}^N}\frac{|u(x)-u(y)|^2}{|x-y|^{N+2s}}|y|^\gamma dy |x|^\gamma dx}. \ea Note that $H_0^s(\Omega;|x|^\gamma)$ is a Hilbert space with the inner product \ba \langle u,v\rangle_{s,\gamma}:=\int_{{\mathbb R}^N}\int_{{\mathbb R}^N}\frac{\big(u(x)-u(y)\big)\big(v(x)-v(y)\big)}{|x-y|^{N+2s}}|y|^\gamma dy |x|^\gamma dx. \ea {\it The results in \cite{CGN}, which will be recalled in Section \S 2, provide a basic framework for the study of problem \eqref{eq:g(u)-kdirac-sum} with Radon measures.} Semiliear equations with a fractional Hardy potential have been a research objective in numerous papers; see e.g. \cite{F,M,NRS,MW,WYZ}. However, the above-mentioned works focus only on the case of source nonlinearities and rely on variational methods. To the best of our knowledge, to date, a profound understanding of the absorption case, namely equation \eqref{eq:g(u)-kdirac-sum}, is still lacking. The interplay between the fractional Hardy operator, the absorption nonlinearity and the measure datum generates different types of substantial difficulties and requires a different approach. In this paper, we perform a deep analysis of this interplay and develop a theory for \eqref{eq:g(u)-kdirac-sum} in measure frameworks. The main ingredients includes recent results in \cite{CGN} (see subsection \ref{basic}), the local behavior near the origin of the solutions to the Poisson equation (see Proposition \ref{est1}) obtained by adapting ideas in \cite{DKP} and in \cite{KMS}, two-sided estimates of approximating solutions expressed in term of the fundamental solution $\Phi_{s,\mu}^{\Omega}$ (see Lemma \ref{aproxsol-sum}). \subsection{Framework, notion of solutions and main results} Let $\Omega$ be a bounded domain in ${\mathbb R}^N$ containing the origin and $d(x)=\mathrm{dist}(x,\partial \Omega)$. For $q \in [1,+\infty)$, $\alpha, \beta \in \mathbb{R}$, we denote by $L^q(\Omega;d(x)^{\alpha}|x|^{\beta})$ the weighted Lebesgue space of functions $v: \Omega \to \mathbb{R}$ such that \bal \| v \|_{L^q(\Omega;d(x)^{\alpha}|x|^{\beta})}:= \left( \int_{\Omega} |v|^q d(x)^{\alpha}|x|^{\beta} dx \right)^{\frac{1}{q}} < +\infty. \eal We denote by {\it $\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega;d(x)^\alpha|x|^{\beta})$ (resp. $\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega\setminus\{0\};d(x)^\alpha|x|^{\beta})$) the space of Radon measures $\nu$ on $\Omega$ (resp. $\Omega\setminus\{0\}$) such that \bal \| \nu\|_{\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega;d(x)^\alpha|x|^{\beta})} &:=\int_{\Omega}d(x)^\alpha|x|^{\beta} \, d|\nu|<+\infty, \\ \big(\text{resp. } \| \nu\|_{\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega\setminus\{0\};d(x)^\alpha|x|^{\beta})} &:=\int_{\Omega\setminus\{0\}}d(x)^\alpha|x|^{\beta} \, d|\nu|<+\infty\big) \eal and by $\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O^+(\Omega;d(x)^\alpha|x|^{\beta})$ (resp. $\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O^+(\Omega\setminus\{0\};d(x)^\alpha|x|^{\beta})$) its positive cone. } In order to specify the notion of weak solutions, we first introduce the space of test functions. \begin{definition} \label{def:weaksol} {\it Assume $\Omega\subset\BBR^N$ is a bounded domain satisfying the exterior ball condition and containing the origin. For $b<2s-\tau_+$, we denote by $\mathbf{X}_\mu(\Omega;|x|^{-b})$ the space of functions $\psi$ with the following properties: (i) $\psi\in H^{s}_0(\Omega;|x|^{\tau_+});$ (ii) $(-\Delta)^s_{\tau_+}\psi $ exists a.e. in $\Omega\setminus\{0\}$ and $\displaystyle\sup_{x\in \Omega\setminus\{0\}}\big||x|^b (-\Delta)^s_{\tau_+}\psi(x)\big| <+\infty$; (iii) for any compact set $K\subset\Omega\setminus\{0\}$, there exist $\delta_0>0$ and $w\in L^1_{\mathrm{loc}}(\Omega\setminus \{0\})$ such that \bal \sup_{0<\delta\leq\delta_0}|(-\Delta)^s_{\tau_+,\delta}\psi|\leq w\;\; \text{a.e. in}\;K \eal where \ba (-\Delta)^s_{\tau_+,\delta} \psi(x):= C_{N,s} \int_{{\mathbb R}^N\setminus B_{\delta}(x) }\frac{\psi(x)- \psi(y)}{|x-y|^{N+2s}} \, |y|^{\tau_+}dy, \quad x \in \Omega \setminus \{0\}. \eal } \end{definition} The concentration of the measure datum $\tilde \nu$ plays an important role in the study of problem (\ref{eq:g(u)-kdirac-sum}). For any $\tilde \nu \in \mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega;d(x)^s|x|^{\alpha})$, we decompose $\tilde \nu = \nu + \ell \delta_0$ where $\nu \in \mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega \setminus \{0\};d(x)^s|x|^{\alpha})$, $\ell \in {\mathbb R}$ and $\delta_0$ denotes the Dirac measure at the origin. \begin{definition} \label{sol:semieq-Dirac-sum} {\it Assume $g: {\mathbb R} \to {\mathbb R}$ is a nondecreasing continuous function such that $g(0)=0$, $\tilde \nu = \nu + \ell \delta_0$ where $\nu \in \mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega \setminus \{0\}; |x|^{\tau_+})$ and $\ell \in {\mathbb R}$. A function $u$ is called a \textit{weak solution} of problem \eqref{eq:g(u)-kdirac-sum} if for any $b<2s-\tau_+$, $u\in L^1(\Omega;|x|^{-b}),$ $g(u)\in L^1(\Omega;|x|^{\tau_+})$ and \ba \label{sol:g(u)-kdiracdef} \int_\Omega u(-\Delta)^s_{\tau_+}\psi dx+\int_\Omega g(u)\psi|x|^{\tau_+} dx= \int_{\Omega \setminus \{0\} } \psi |x|^{\tau_+}d\nu + \ell \int_{\Omega}\Phi_{s,\mu}^\Omega (-\Delta)^s_{\tau_+}\psi dx,\ \, \forall\psi\in \mathbf{X}_\mu(\Omega;|x|^{-b}). \ea } \end{definition} For $q>1$, we define \ba\label{subcond} \Lambda_{g,q}:=\int_1^\infty (g(t)-g(-t))t^{-1-q}dt. \ea We also put \ba \label{psmu*} p_{s,\mu}^* := \min\left\{ \frac{N}{N-2s}, \frac{N+\tau_+}{-\tau_-} \right\}. \ea We note that $p_{s,\mu}^*$ is the Serrin type critical exponent. If $\mu \geq 0$ then $p_{s,\mu}^*=\frac{N}{N-2s}$, and if $\mu_0\leq \mu<0$ then $p_{s,\mu}^*=\frac{N+\tau_+}{-\tau_-}$. The first main result deals with the case when the datum $\tilde \nu$ is concentrated away from the origin. \begin{theorem} \label{existence-semi-1} Assume $\mu \geq \mu_0$, $\tilde \nu = \nu\in\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega\setminus\{0\};|x|^{\tau_+})$ and $g\in C(\Omega)$ is a nondecreasing function such that $g(0)=0$ and $\Lambda_{g,\frac{N}{N-2s}}<+\infty$. Then there exists a unique weak solution $u_{\nu,0}$ to problem \eqref{eq:g(u)-kdirac-sum}. Moreover, for any $b<2s-\tau_+$, \ba \label{apriori-1} \| u_{\nu,0} \|_{L^1(\Omega;|x|^{-b})} \leq C(N,\Omega,s,\mu,b)\| \nu \|_{\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega \setminus \{0\};|x|^{\tau_+} )}. \ea \end{theorem} Let us point out that the weak solution stated in the above theorem is constructed by using an approximation procedure in which the local behavior near the origin of the weak solution to the Poisson problem plays an essential role. It is worth noting that ODE techniques, which are efficient in the local case, no longer fit our setting well. Instead, we use a different approach based on the adaption of ideas in \cite{DKP} and \cite{KMS}, the assumption that $\mathrm{supp}\, \nu \cap \{0\} = \emptyset$, and a performance of tedious calculations. The desired local behavior allows us to derive weak Lebesgue estimates, which in turn ensures the convergence of approximating nonlinearities. \medskip The next result treats the case when $\mu>\mu_0$ and $\tilde \nu$ is concentrated at the origin. \begin{theorem} \label{semi-dirac>} Assume $\mu>\mu_0$, $\tilde \nu=\ell \delta_0$ for some $\ell \in\BBR$ and $\Lambda_{g,\frac{N+\tau_+}{\tau_-}}<+\infty$. Then there exists a unique weak solution $u_{0,\ell}$ of problem \eqref{eq:g(u)-kdirac-sum}. \end{theorem} Let us sketch the idea of the proof. Since the datum $\tilde \nu$ is concentrated at the origin, we first construct approximating solutions $u_{\varepsilon}$ in $\Omega \setminus B_{\varepsilon}(0)$ by using the standard theory of monotone operators. Then we establish two-sided estimates on $u_{\varepsilon}$ expressed in term of $\Phi_{s,\mu}^{\Omega}$, which allow us to derive the existence and the asymptotic behavior of a weak solution to problem \eqref{eq:g(u)-kdirac-sum}. When $\mu=\mu_0$, a logarithmic correction is involved, which is reflected in the following result. For $q>1$, set \ba\label{critcond} \tilde \Lambda_{g,q}:=\int_1^\infty (g(|\ln t|t) - g(-|\ln t|t))t^{-1-q}dt. \ea By an analog argument as in the proof of Theorem \ref{semi-dirac>}, we can show that \begin{theorem} \label{semi-dirac=} Assume $\mu=\mu_0$, $\tilde \nu=\ell \delta_0$ for some $\ell \in\BBR,$ and $\tilde \Lambda_{g,\frac{N+2s}{N-2s}}<+\infty$. Then there exists a unique weak solution $u_{0,\ell}$ of \eqref{eq:g(u)-kdirac-sum}. \end{theorem} Next we treat the case where the measures may have support on the whole domain $\Omega$. \begin{theorem} \label{dirac>-sum} Assume $\mu>\mu_0$, $\tilde \nu = \nu + \ell \delta_0$ for some $\nu \in \mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O^+(\Omega \setminus \{0\};|x|^{\tau_+})$, $\ell \geq 0$ and $\Lambda_{g,p_{s,\mu}^*}<+\infty$. Then there exists a unique weak solution of problem \eqref{eq:g(u)-kdirac-sum}. \end{theorem} The existence of the weak solution stated in Theorem \ref{dirac>-sum} is also based on an approximation procedure, however since $\tilde \nu$ is supported on the whole domain $\Omega$, the analysis is more complicated and requires the treatment near the origin and far from the origin at the same time. We stress that in the proof of Theorem \ref{dirac>-sum}, no $\Delta_2$-condition is needed. Therefore, Theorem \ref{dirac>-sum} does not only extend \cite[Theorem B]{CV} to the local case, but also improve that result in the sense that the $\Delta_2$-condition can be relaxed. Finally, in case $\mu=\mu_0$, we also obtain the existence an uniqueness result. \begin{theorem} \label{dirac=-sum} Let $\mu=\mu_0$, $\tilde \nu = \nu + \ell \delta_0$ for some $\nu \in \mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O^+(\Omega \setminus \{0\};|x|^{\tau_+})$, $\ell \geq 0$ and $\Lambda_{g,\frac{N}{N-2s}}<\infty$. Then there exists a unique weak solution of \eqref{eq:g(u)-kdirac-sum}. \end{theorem} \noindent \textbf{Organization of the paper.} The rest of this paper is organized as follows. In Section 2, we recall basic properties and derive local behavior of solutions to the Poisson problem with a fractional Hardy and a source. Section 3 is devoted to the study of weak solution to semilinear problems involving Radon measures supported away from the origin. In Section 4, we address weak solutions of semilinear problem involving Dirac masses concentrated at the origin. Finally, in Section 5, we construct weak solutions in case measures have support in the whole domain $\Omega$. \medskip \noindent \textbf{Notation.} Throughout this paper, unless otherwise specified, we assume that $\Omega \subset {\mathbb R}^N$ ($N \geq 2)$ is a bounded domain containing the origin and $d(x)$ is the distance from $x \in \Omega$ to ${\mathbb R}^N \backslash \Omega$. We denote by $c, C, c_1, c_2, \ldots$ positive constants that may vary from one appearance to another and depend only on the data. The notation $c = c(a,b,\ldots)$ indicates the dependence of the constant $c$ on $a,b,\cdots$. For a function $u$, we denote that $u^+=\max\{u,0\}$ and $u^- = \max\{-u,0\}$. For a set $A \subset {\mathbb R}^N$, the function $\textbf{1}_A$ denotes the indicator function of $A$. \medskip \noindent \textbf{Acknowledgements.} {\small \it H. Chen is supported by NNSF of China, No: 12071189 and 11431005, by the Jiangxi Provincial Natural Science Foundation, No: 20212ACB211005. K. T. Gkikas acknowledges the support by the Hellenic Foundation for Research and Innovation (H.F.R.I.) under the “2nd Call for H.F.R.I. Research Projects to support Post-Doctoral Researchers” (Project Number: 59). P.-T. Nguyen is supported by Czech Science Foundation, Project GA22-17403S.} \section{Preliminary} \subsection{Basic study of Poisson problem } \label{basic} In this subsection, we recall the basic properties of Poisson problem with the fractional Hardy operator and Radon measures in \cite{CGN}. For $\gamma\in[ \frac{2s-N}{2}, 2s),$ we denote by $H_0^s(\Omega;|x|^\gamma)$ the closure of functions in $C^\infty({\mathbb R}^N)$ with compact support in $\Omega$ under the norm \bal \norm{u}_{H_0^s(\Omega ;|x|^\gamma)}:= \left(\int_{{\mathbb R}^N}\int_{{\mathbb R}^N}\frac{|u(x)-u(y)|^2}{|x-y|^{N+2s}}|y|^\gamma dy |x|^\gamma dx\right)^{\frac{1}{2}}. \eal Note that $H_0^s(\Omega;|x|^\gamma)$ is a Hilbert space with the inner product \bal \langle u,v\rangle_{s,\gamma}:=\int_{{\mathbb R}^N}\int_{{\mathbb R}^N}\frac{\big(u(x)-u(y)\big)\big(v(x)-v(y)\big)}{|x-y|^{N+2s}}|y|^\gamma dy |x|^\gamma dx. \eal For $\mu \geq \mu_0$, let $\mathbf{H}^{s}_{\mu,0}(\Omega)$ be the closure of functions in $C^\infty({\mathbb R}^N)$ with compact support in $\bar \Omega$ under the norm \bal \norm{u}_{\mu}:=\left(\frac{C_{N,s}}{2}\int_{{\mathbb R}^N}\int_{{\mathbb R}^N}\frac{|u(x)-u(y)|^2}{|x-y|^{N+2s}} dy dx+\mu\int_\Omega \frac{u^2}{|x|^{2s}}dx\right)^{\frac{1}{2}}. \eal This is a Hilbert space with the inner product \bal \ll u,v\gg_{\mu}:=\frac{C_{N,s}}{2}\int_{{\mathbb R}^N}\int_{{\mathbb R}^N}\frac{\big(u(x)-u(y)\big)\big(v(x)-v(y)\big)}{|x-y|^{N+2s}} dy dx+\mu \int_\Omega \frac{u(x) v(x)}{|x|^{2s}}dx. \eal The next result provides a relation between the above spaces. \begin{theorem}[{\cite[Theorem 1.1]{CGN}}] \label{th:main-1} Assume $\Omega$ is a bounded Lipschitz domain containing the origin. $(i)$ For any $\gamma\in[ \frac{2s-N}{2}, 2s)$ and $\mu\geq\mu_0$, the space $C_0^\infty(\Omega\setminus\{0\})$ is dense in $H_0^s(\Omega;|x|^\gamma)$ and in $\mathbf{H}_{\mu,0}^s(\Omega)$. $(ii)$ For any $\gamma\in[ \frac{2s-N}{2}, 2s)$, there is $\mu\geq \mu_0$ such that ${\tau_+(s,\xm)}=\gamma$ and \ba H_0^s(\Omega;|x|^\gamma) =\big\{|x|^{-\gamma}u: u \in \mathbf{H}_{\mu,0}^s(\Omega) \big\}. \ea $(iii)$ Let $\gamma\in[\frac{2s-N}{2},2s)$, $\beta<2s$ and $1\leq q<\min\Big\{ \frac{2N-2\beta}{N-2s},\ \frac{2N }{N-2s}\Big\}$. Then there exists a positive constant $c=c(N,\Omega,s,\gamma,\beta,q)$ such that \ba \big\| |\cdot|^{\gamma}v \big\|_{L^q(\Omega;|x|^{-\beta})} \leq c\, \| v \|_{s,\gamma}, \quad \forall v \in H_0^s(\Omega;|x|^\gamma). \ea \end{theorem} Firstly, a sharp condition for the source is considered for variational solution of the Poisson problem \ba \label{eq:1-1} \left\{ \begin{aligned} (-\Delta)^s_\gamma u &=f \quad && \text{in } \Omega, \\[0.5mm] \qquad\quad u &=0 && \text{in } {\mathbb R}^N\setminus \Omega. \end{aligned} \right. \ea Here $u$ is called a variational solution of (\ref{eq:1-1}) if $v\in H_0^s(\Omega;|x|^\gamma)$ and \bal \langle v,\xi\rangle_{s,\gamma} =(f,\xi)_\gamma \quad \forall \, \xi\in H_0^s(\Omega;|x|^\gamma), \eal where $ (f,\xi)_\gamma:=\int_{\Omega}f\xi |x|^\gamma dx. $ \begin{theorem}[{\cite[Theorem 1.3]{CGN}}] \label{th:main-2} Assume $\gamma\in[ \frac{2s-N}{2}, 2s)$, $\alpha\in{\mathbb R}$ and \ba \label{exs ex-0} p>\max\Big\{ \frac{2N}{N+2s},\, \frac{2N+2\alpha}{N+2s},\ 1+\frac{\alpha}{2s}\Big\}. \ea For any $ f\in L^p(\Omega;|x|^{\alpha})$, problem \eqref{eq:1-1} has a unique variational solution $u$. Moreover, there exists a constant $c=c(N,\Omega,s,\gamma,\alpha,p)$ such that \ba \label{varisol:est-1} \norm{u}_{s,\gamma} \leq c\, \| f\|_{L^p(\Omega;|x|^{\alpha})}. \ea In addition, the following Kato type inequality holds \ba\label{kato1} \langle u^+,\xi \rangle_{s,\gamma} \leq (f\mathrm{sign}^+(u),\xi)_{\gamma}, \quad \forall \, 0\leq \xi\in H_0^s(\Omega;|x|^\gamma). \ea \end{theorem} It is easy to check that for $\alpha<2s$, \eqref{exs ex-0} could be reduced to \bal p>\max\Big\{ \frac{2N}{N+2s},\, \frac{2N+2\alpha}{N+2s}\Big\}. \eal The Poisson problem involving $\CL_\mu^s$ of the form \ba\label{veryweaksolution} \left\{ \begin{aligned} \CL_\mu^s u&=f&&\quad\text{in}\;\Omega, \\ u&=0&&\quad\text{in}\;\BBR^N\setminus\Omega, \end{aligned} \right. \ea where $f \in L^1(\Omega;d^s|x|^{\tau_+})$, was studied in \cite{CGN} in which the authors introduced a notion of weak solutions in the following sense: A function $u$ is called a weak solution of \eqref{veryweaksolution} if for any $b <2s-\tau_+$, $u\in L^1(\Omega;|x|^{-b})$ and $u$ satisfies \bal \int_\Omega u(-\Delta)^s_{\tau_+}\psi dx=\int_\Omega f\psi |x|^{\tau_+} dx,\quad\forall\psi\in \mathbf{X}_\mu(\Omega;|x|^{-b}). \eal The solvability for \eqref{veryweaksolution} and Kato type inequalities were established in \cite{CGN}. \begin{theorem}[{\cite[Theorem 1.7]{CGN}}] \label{existence2} Assume $f\in L^1(\Omega;d(x)^s|x|^{\tau_+})$. Then problem \eqref{veryweaksolution} admits a unique weak solution $u$. For any $b<2s-\tau_+$, there exists a positive constant $C=C(N,\Omega,s,\mu,b)$ such that \bal \| u \|_{L^1(\Omega;|x|^{-b})} \leq C\| f \|_{L^1(\Omega;d(x)^s|x|^{\tau_+})}. \eal Furthermore, there holds \ba \label{Kato:+-1} \int_\Omega u^+(-\Delta)^s_{\tau_+}\psi dx\leq\int_\Omega f\mathrm{sign}^+(u)\psi |x|^{\tau_+} dx,\quad\forall \, 0\leq\psi\in \mathbf{X}_\mu(\Omega;|x|^{-b}) \ea and \ba \label{Kato||-1} \int_\Omega |u|(-\Delta)^s_{\tau_+}\psi dx\leq\int_\Omega f\mathrm{sign}(u)\psi |x|^{\tau_+} dx,\quad\forall \, 0\leq\psi\in \mathbf{X}_\mu(\Omega;|x|^{-b}). \ea As a consequence, the mapping $f \mapsto u$ is nondecreasing. In particular, if $f \geq 0$ then $u \geq 0$ a.e. in $\Omega \setminus \{0\}$. \end{theorem} Note that (\ref{Kato:+-1}) is the Kato's inequality in our weighted distributional sense, which plays a pivotal role in the proof of the uniqueness for weak solution for our problems involving the Radon measures. In case of measure data, weak solutions of \ba\label{veryweaksolutionmesure} \left\{ \begin{aligned} \CL_\mu^s u&=\nu + \ell \delta_0&&\quad\text{in}\;\Omega,\\ u&=0&&\quad\text{in}\;\BBR^N\setminus\Omega, \end{aligned} \right. \ea are understood in the sense of Definition \ref{sol:semieq-Dirac-sum} with $g\equiv 0$. Existence, uniqueness and a priori estimates of weak solutions are recalled below. \begin{theorem}[{\cite[Theorem 1.10]{CGN}}] \label{existence3-dirac} Assume $\ell \in {\mathbb R}$ and $\nu\in\mathfrak{M}(\Omega\setminus\{0\};|x|^{\tau_+})$. Then problem \eqref{veryweaksolutionmesure} admits a unique weak solution $u$. For any $b < 2s-\tau_+$, there exists a positive constant $C=C(N,\Omega,s,\mu,b)$ such that \bal \| u \|_{L^1(\Omega;|x|^{-b})} \leq C\bigg(\| \nu \|_{\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega \setminus \{0\};|x|^{\tau_+} )}+\ell\bigg). \eal Moreover, the mapping $(\nu,\ell) \mapsto u$ is nondecreasing. In particular, if $\nu \geq 0$ and $\ell \geq 0$ then $u \geq 0$ a.e. in $\Omega \setminus \{0\}$. \end{theorem} \subsection{Local behavior at the origin} Our aim in this subsection is to establish the local behavior of the solution to the Poisson problem \eqref{veryweaksolutionmesure} when the measure has the support away from the origin. More precisely, the main result of this subsection is stated below. \begin{theorem}\label{est1} Assume $\Omega\subset\BBR^N$ is a bounded domain satisfying the exterior ball condition and containing the origin, $\mu_0\leq\mu\leq0$ and $\nu\in\mathfrak{M}(\Omega\setminus\{0\};|x|^{\tau_+})$ with $\mathrm{dist}(\mathrm{supp}\,|\nu|,\{0\})=r>0$. Let $u$ be the unique solution of \eqref{veryweaksolutionmesure} with $\ell=0$. Then there exists a positive constant $C=C(N,\Omega,s,\mu,r)$ such that \ba \label{supu|x|} \sup_{x\in B_{\frac{r}{4}}(0) \setminus \{0\}}(|x|^{-\tau_+}|u(x)|)\leq C \| \nu \|_{\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega \setminus \{0\};|x|^{\tau_+})}. \ea \end{theorem} The proof of Theorem \ref{est1} consists of several intermediate technical lemmas which allow us to bound local subsolutions to $\CL_\mu^s u \leq 0$ from above in terms of their tails and mass in neighborhood of the origin. The first lemma, which is inspired by \cite[Theorem 1.4]{DKP}, is the following. \begin{lemma} Let $x_0\in \Omega$ and $r>0$ such that $B_r(x_0)\subset\Omega.$ We assume that $v\in H^{s}_0(\Omega;|x|^{\tau_+})$ satisfies \ba\label{subsolution} \int_{\BBR^N}\int_{\BBR^N}\frac{(v(x)-v(y))(\phi(x)-\phi(y))}{|x-y|^{N+2s}}|y|^{\tau_+}dy |x|^{\tau_+}dx \leq0, \quad \forall 0 \leq \phi\in C_0^\infty(B_r(x_0)). \ea For any $k \in {\mathbb R}$, put $w=v-k$. Then for any nonnegative $\phi\in C_0^\infty(B_r(x_0))$, there holds \ba\label{cacc}\begin{aligned} &\quad \int_{B_r(x_0)}\int_{B_r(x_0)}\frac{\big(w^+(x)\phi(x)-w^+(y)\phi(y)\big)^2}{|x-y|^{N+2s}}|y|^{\tau_+}dy |x|^{\tau_+}dx\\ &\leq 6 \int_{B_r(x_0)}\int_{B_r(x_0)}\max\{w^+(x)^2,w^+(y)^2\}\frac{(\phi(x)-\phi(y))^2}{|x-y|^{N+2s}}|y|^{\tau_+}dy |x|^{\tau_+}dx\\ &\quad +8\int_{B_r(x_0)}w^+(x)\phi(x)^2|x|^{\tau_+} dx\Big(\sup_{y\in\mathrm{supp}\,\phi}\int_{\BBR^N\setminus B_r(x_0)}\frac{w^+(x)}{|x-y|^{N+2s}}|x|^{\tau_+} dx\Big). \end{aligned} \ea \end{lemma} \begin{proof}[\textbf{Proof}] Let $\phi \in C_0^\infty(B_r(x_0))$ and due to the standard density argument, we can take $w^+\phi^2$ as a test function in \eqref{subsolution} to obtain \ba \label{test-wphi-1} \begin{aligned} 0&\geq \int_{\BBR^N}\int_{\BBR^N}\frac{(v(x)-v(y))(w^+(x)\phi(x)^2-w^+(y)\phi(y)^2)}{|x-y|^{N+2s}}|y|^{\tau_+}dy |x|^{\tau_+}dx\\ &=\int_{B_r(x_0)}\int_{B_r(x_0)}\frac{(v(x)-v(y))(w^+(x)\phi(x)^2-w^+(y)\phi(y)^2)}{|x-y|^{N+2s}}|y|^{\tau_+}dy |x|^{\tau_+}dx\\ &\quad +2\int_{\BBR^N\setminus B_r(x_0)}\int_{B_r(x_0)}\frac{(v(y)-v(x))w^+(y)\phi(y)^2}{|x-y|^{N+2s}}|y|^{\tau_+}dy |x|^{\tau_+}dx. \end{aligned} \ea We note that $(v(y)-v(x))w^+(y) \geq -w^+(x)w^+(y)$ for any $x,y \in {\mathbb R}^N$, hence \ba\label{27}\begin{aligned} &\quad \int_{\BBR^N\setminus B_r(x_0)}\int_{B_r(x_0)}\frac{(v(y)-v(x))w^+(y)\phi(y)^2}{|x-y|^{N+2s}}|y|^{\tau_+}dy |x|^{\tau_+}dx\\ &\geq -\int_{\BBR^N\setminus B_r(x_0)}\int_{B_r(x_0)}\frac{w^+(x)w^+(y)\phi(y)^2}{|x-y|^{N+2s}}|y|^{\tau_+}dy |x|^{\tau_+}dx\\ &=-\int_{B_r(x_0)}w^+(y)\phi(y)^2\int_{\BBR^N\setminus B_r(x_0)}\frac{w^+(x)}{|x-y|^{N+2s}}|x|^{\tau_+}dx|y|^{\tau_+}dy\\ &\geq-\int_{B_r(x_0)}w^+(y)\phi(y)^2dy \Big(\sup_{y\in\mathrm{supp}\,\phi}\int_{\BBR^N\setminus B_r(x_0)}\frac{w^+(x)}{|x-y|^{N+2s}}|x|^{\tau_+} dx\Big). \end{aligned} \ea Next, for any $x,y \in {\mathbb R}^N$, we can show that \ba \label{27-aa} (v(x)-v(y))(w^+(x)\phi(x)^2-w^+(y)\phi(y)^2)\geq (w^+(x)-w^+(y))(w^+(x)\phi(x)^2-w^+(y)\phi(y)^2). \ea Combining \eqref{test-wphi-1}--\eqref{27-aa} yields \ba \label{27-a} \begin{aligned} &\int_{B_r(x_0)}\int_{B_r(x_0)}\frac{(w^+(x)-w^+(y))(w^+(x)\phi(x)^2-w^+(y)\phi(y)^2)}{|x-y|^{N+2s}}|y|^{\tau_+}dy |x|^{\tau_+}dx \\ \leq& 2\int_{B_r(x_0)}w^+(y)\phi(y)^2dy\Big(\sup_{y\in\mathrm{supp}\,\phi}\int_{\BBR^N\setminus B_r(x_0)}\frac{w^+(x)}{|x-y|^{N+2s}}|x|^{\tau_+} dx\Big). \end{aligned} \ea Take arbitrary $x,y \in {\mathbb R}^N$. If $\phi(x)\leq\phi(y)$ then we obtain \bal\begin{aligned} &(w^+(x) -w^+(y))(w^+(x)\phi(x)^2-w^+(y)\phi(y)^2)\\[1mm] = &(w^+(x)-w^+(y))^2\phi(y)^2+w^+(x)(w^+(x)-w^+(y))(\phi(x)^2-\phi(y)^2)\\ \geq &\frac{1}{2}(w^+(x)-w^+(y))^2\phi(y)^2-2(w^+(x))^2(\phi(x)-\phi(y))^2. \end{aligned}\eal If $\phi(x)\geq\phi(y)$ and $w^+(x)\geq w^+(y)$ then \bal (w^+(x)&-w^+(y))(w^+(x)\phi(x)^2-w^+(y)\phi(y)^2)\geq (w^+(x)-w^+(y))^2\phi(x)^2. \eal Hence, in any case we have that \bal (w^+(x) -w^+(y))(w^+(x)\phi(x)^2-w^+(y)\phi(y)^2) &\geq \frac{1}{2}(w^+(x)-w^+(y))^2\max\{\phi(x)^2,\phi(y)^2\}\\[1mm]&\quad -2\max\{(w^+(x))^2,(w^+(y))^2\}(\phi(x)-\phi(y))^2. \eal On the other hand, we find that \bal (w^+(x)\phi(x) -w^+(y)\phi(y))^2 &\leq 2(w^+(x)-w^+(y))^2\max\{\phi(x)^2,\phi(y)^2\} \\[1mm]&\quad +2\max\{(w^+(x))^2,(w^+(y))^2\}(\phi(x)-\phi(y))^2. \eal Combining the last two displays leads to \ba\label{26}\begin{aligned} (w^+(x)\phi(x)-w^+(y)\phi(y))^2 &\leq 4(w^+(x)-w^+(y))(w^+(x)\phi(x)^2-w^+(y)\phi(y)^2) \\[1mm]&\quad + 6\max\{(w^+)^2(x),(w^+)^2(y)\}(\phi(x)-\phi(y))^2. \end{aligned} \ea Finally, plugging \eqref{27-a} into \eqref{26}, we derive \eqref{cacc}. \end{proof} In order to proceed further, we recall that if $\mu_0<\mu$ then for $u\in C^\infty_0(\Omega)$ \ba \label{subcritsobolev0} \begin{aligned} \frac{C_{N,s}}{2}\int_{\BBR^N}\int_{\BBR^N}\frac{|u(x)-u(y)|^2}{|x-y|^{N+2s}}dydx+\mu \int_{\BBR^N}\frac{|u|^2}{|x|^{2s}}dx &\geq\frac{C_{N,s}}{2}\frac{\mu_0-\mu}{\mu_0}\int_{\BBR^N}\int_{\BBR^N}\frac{|u(x)-u(y)|^2}{|x-y|^{N+2s}}dydx\\ &\geq c \left(\int_{\Omega}|u|^\frac{2N}{N-2s}dx\right)^{\frac{N-2s}{N}}, \end{aligned} \ea where $c=c(N,s,\mu)>0$. Setting $u=|x|^{\tau_+}v$, for any $\mu>\mu_0$, we have that for $u\in C^\infty_0(\Omega)$ \ba \label{subcritsobolev1} \begin{aligned} \frac{C_{N,s}}{2}\int_{\BBR^N}\int_{\BBR^N}\frac{|v(x)-v(y)|^2}{|x-y|^{N+2s}}|y|^{\tau_+}dy |x|^{\tau_+}dx &\geq c \left(\int_{\Omega}(|x|^{\tau_+}|v|)^\frac{2N}{N-2s}dx\right)^{\frac{N-2s}{N}}. \end{aligned} \ea If $\mu=\mu_0$ then by \cite[Theorem 3]{tz}, there exists a positive constant $C=C(N,s)$ such that for $u\in C^\infty_0(\Omega)$, \bal \frac{C_{N,s}}{2}\int_{\BBR^N}\int_{\BBR^N}\frac{|u(x)-u(y)|^2}{|x-y|^{N+2s}}dydx+\mu_0 \int_{\BBR^N}\frac{|u|^2}{|x|^{2s}}dx\geq C(N,s) \left(\int_{\Omega}|u|^\frac{2N}{N-2s}X(|x|)^{\frac{2(N-s)}{N-2s}}dx\right)^{\frac{N-2s}{N}}, \eal where $X(t)=1+\ln (\sup_{x\in\Omega} |x|)-\ln t$. Setting $u=|x|^{\frac{2s-N}{2}}v,$ Theorem \ref{th:main-1} implies that \ba \label{critsobolev1} \begin{aligned} \int_{\BBR^N}\int_{\BBR^N}\frac{|v(x)-v(y)|^2}{|x-y|^{N+2s}}|y|^{\frac{2s-N}{2}}dy |x|^{\frac{2s-N}{2}}dx &\geq C(N,s) \left(\int_{\Omega}|v|^\frac{2N}{N-s}|x|^{-N}X(|x|)^{\frac{2(N-s)}{N-2s}}dx\right)^{\frac{N-2s}{N}}\\&\geq C(N,s,\Omega) \left(\int_{\BBR^N}|v|^\frac{2N}{N-2s}|x|^{\frac{2s-N}{2}}dx\right)^{\frac{N-2s}{N}}. \end{aligned} \ea By Theorem \ref{th:main-1}, inequalities \eqref{subcritsobolev1}-\eqref{critsobolev1} are valid for any $v\in H^{s}_0(\Omega;|x|^{\tau_+} )$. Next, we introduce a notion of the tail adapted to the context of fractional Hardy potential. For any $v\in H^{s}_0(\Omega;|x|^{\tau_+})$, the nonlocal tail of $v$ in the ball $B_r(x_0)$ is defined by \ba \label{def:tail} T(v;x_0,r):=r^{2s}\max\{|x_0|,r\}^{-\tau_+}\int_{\BBR^N\setminus B_r(x_0)}\frac{|v||x|^{\tau_+}}{|x-x_0|^{N+2s}}dx. \ea \begin{proposition} Assume $\mu_0 \leq \mu<0$, $B_r(x_0)\subset\Omega$ and $v\in H^{s}_0(\Omega;|x|^{\tau_+})$ satisfy \eqref{subsolution}. We additionally assume that $|x_0|\geq \theta r $ with $\theta\in(1,2)$ if $x_0\neq0$. Then there exists a positive constant $C=C(\Omega,\mu,N,s,\gamma)$ such that \ba\label{supest} \sup_{ B_{\frac{r}{2}}(x_0)}(v-k)^+\leq \delta T((v-k)^+;x_0,\frac{r}{2})+C\delta^{-\frac{N}{4s}}\left(\Xint-_{B_r(x_0)}((v-k)^+)^2|x|^{\tau_+} dx\right)^\frac{1}{2} \ea for any $\delta\in(0,1]$ and $k\in \BBR.$ \end{proposition} \begin{proof}[\textbf{Proof}] The proof, which is based on a combination of the idea in \cite[Theorem 1.1]{DKP} and the fractional Hardy inequality, consists of several steps. \medskip \noindent \textit{Step 1.} If $x_0 \neq 0$ then by the assumption $|x_0|>\theta r$, we obtain \ba \label{xx_0} \frac{\theta-1}{\theta}|x_0|\leq|x|\leq\frac{\theta+1}{\theta}|x_0|, \quad \forall x \in B_r(x_0). \ea Consequently, \ba \label{Brxtp} \int_{B_r(x_0)}|x|^{\tau_+} dx\approx r^N|x_0|^{\tau_+}. \ea Let $r'<r$, for any $x \in {\mathbb R}^N \setminus B_r(x_0)$ and $y \in B_{r'}(x_0)$, we have \ba \label{xx0-1} \frac{|x-x_0|}{|x-y|}\leq 1+\frac{|y-x_0|}{|x-y|}\leq 1+\frac{r'}{r-r'}=\frac{r}{r-r'}. \ea Let $\zeta\in C_0^\infty(B_{r'}(x_0))$, then by \eqref{xx_0}, standard fractional Sobolev inequality and \eqref{xx0-1}, we obtain \ba\label{28}\begin{aligned} \Big(\int_{B_r(x_0)}|\zeta|^{\frac{2N}{N-2s}}|x|^{\tau_+} dx\Big)^{\frac{N-2s}{N}} &\leq C|x_0|^{\frac{(N-2s)\tau_+}{N}}\int_{\BBR^N}\int_{\BBR^N}\frac{|\zeta(x)-\zeta(y)|^2}{|x-y|^{N+2s}}dy dx\\ &=C|x_0|^{\frac{(N-2s)\tau_+}{N}}\int_{B_r(x_0)}\int_{B_r(x_0)}\frac{|\zeta(x)-\zeta(y)|^2}{|x-y|^{N+2s}}dy dx\\ &\quad+2C|x_0|^{\frac{(N-2s)\tau_+}{N}}\int_{\BBR^N\setminus B_r(x_0)}\int_{B_r(x_0)}\frac{|\zeta(y)|^2}{|x-y|^{N+2s}}dy dx\\ &\leq C|x_0|^{\frac{(N-2s)\tau_+}{N}-2\tau_+}\int_{B_r(x_0)}\int_{B_r(x_0)}\frac{|\zeta(x)-\zeta(y)|^2}{|x-y|^{N+2s}}|y|^{\tau_+} dy |x|^{\tau_+} dx\\ &\quad+ C|x_0|^{\frac{(N-2s)\tau_+}{N}-\tau_+}\left(\frac{r}{r-r'}\right)^{N+2s}r^{-2s}\int_{B_r(x_0)}|\zeta(x)|^2|x|^{\tau_+}dx, \end{aligned} \ea where $C=C(N,s,\mu)$. If $x_0=0,$ then by using a scaling argument, \eqref{subcritsobolev1} and \eqref{critsobolev1}, we can show that \ba\label{29}\begin{aligned} &\left(\int_{B_r(0)}|\zeta|^{\frac{2N}{N-2s}}|x|^{\tau_+} dx\right)^{\frac{N-2s}{N}}\\ &\leq C r^{\frac{N-2s}{N}(N + \tau_+)-N+2s-2\tau_+}\int_{\BBR^N}\int_{\BBR^N}\frac{|\zeta(x)-\zeta(y)|^2}{|x-y|^{N+2s}}|y|^{\tau_+} dy |x|^{\tau_+} dx\\ &\leq C r^{\frac{N-2s}{N}(N + \tau_+)-N+2s-2\tau_+}\int_{B_r(0)}\int_{B_r(0)}\frac{|\zeta(x)-\zeta(y)|^2}{|x-y|^{N+2s}}|y|^{\tau_+} dy |x|^{\tau_+} dx\\ &\quad +C r^{\frac{N-2s}{N}(N+ \tau_+)-N-\tau_+}\left(\frac{r}{r-r'}\right)^{N+2s}\int_{B_r(0)}|\zeta(x)|^2|x|^{\tau_+}dx, \end{aligned} \ea where $C=C(N,s,\mu,\Omega)$. For a function $\varphi \in L^1(B_r(x_0))$, set \bal \Xint-_{B_r(x_0)}\varphi(x) |x|^{\tau_+} dx:=\left(\int_{B_r(x_0)}|x|^{\tau_+}dx\right)^{-1}\int_{B_r(x_0)}\varphi |x|^{\tau_+} dx. \eal Then, by \eqref{Brxtp}, \eqref{28} and \eqref{29} can be written as follows \ba\label{30}\begin{aligned} \left(\Xint-_{B_r(x_0)}|\zeta|^{\frac{2N}{N-2s}}|x|^{\tau_+} dx\right)^{\frac{N-2s}{N}} &\leq C r^{2s}\max\{|x_0|,r\}^{-\tau_+}\Xint-_{B_r(x_0)}\int_{B_r(x_0)}\frac{|\zeta(x)-\zeta(y)|^2}{|x-y|^{N+2s}}|y|^{\tau_+} dy |x|^{\tau_+} dx\\ &\quad+ C\left(\frac{r}{r-r'}\right)^{N+2s}\Xint-_{B_r(x_0)}|\zeta(x)|^2|x|^{\tau_+}dx. \end{aligned} \ea \noindent \textit{Step 2.} For any $j\in \BBN\cup\{0\}$ we set \bal r_j=\frac{1}{2}(1+2^{-j})r,\quad\tilde r_j=\frac{r_j+ r_{j+1}}{2},\quad B_j=B_{r_j}(x_0)\quad\text{and}\;\;\tilde B_j=B_{\tilde r_j}(x_0). \eal Let $k\in \BBR,$ $\tilde k\in\BBR_+$, put \bal k_j=k+(1-2^{-j})\tilde k \quad \text{and} \quad \tilde k_j=\frac{k_{j}+k_{j+1}}{2}. \eal Set \bal w_j=(v-k_j)^+ \quad \text{and} \quad \tilde w_j=(v-\tilde k_j)^+. \eal Let $\phi_j \in C_0^\infty(\tilde B_j)$ such that $0 \leq \phi_j \leq 1$ in $\tilde B_j$, $\phi_j=1$ in $B_{j+1}$ and $|\nabla \phi_j|\leq \frac{2^{j+3}}{r}$ in $\tilde B_j$. By \eqref{30}, we have \ba \label{30-a}\begin{aligned} &\bigg(\Xint-_{B_j}|\tilde w_j\phi_j |^{\frac{2N}{N-2s}}|x|^{\tau_+}dx\bigg)^{\frac{N-2s}{N}}\\ &\qquad \leq C r^{2s}\max\{|x_0|,r\}^{-\tau_+}\Xint-_{B_j}\int_{B_j}\frac{|\tilde w_j(x)\phi_j(x)-\tilde w_j(y)\phi_j(y)|^2}{|x-y|^{N+2s}}|y|^{\tau_+}dy |x|^{\tau_+}dx\\ &\qquad\qquad+C2^{j(N+2s)}\Xint-_{B_j} |\tilde w_j(y)\phi_j(y)|^2|y|^{\tau_+}dy. \end{aligned} \ea We will estimate the first term on the right hand side of \eqref{30-a} by applying \eqref{cacc} with $B_j$, $\tilde w_j$, $\phi_j$ in place of $B_r(x_0)$, $w^+$, $\phi$ respectively. Hence, we obtain \ba\label{30-b}\begin{aligned} &\Xint-_{B_j}\int_{B_j}\frac{(\tilde w_j(x)\phi_j(x)-\tilde w_j(y)\phi_j(y))^2}{|x-y|^{N+2s}}|y|^{\tau_+}dy |x|^{\tau_+}dx\\ &\leq C \Xint-_{B_j}\int_{B_j}\max\{\tilde w_j(x)^2, \tilde w_j(y)^2\}\frac{(\phi_j(x)-\phi_j(y))^2}{|x-y|^{N+2s}}|y|^{\tau_+}dy |x|^{\tau_+}dx\\ &\quad +C\Xint-_{B_j}\tilde w_j(x)\phi(x)^2|x|^{\tau_+} dx\left(\sup_{y\in\mathrm{supp}\,\phi_j}\int_{\BBR^N\setminus B_j(x_0)}\frac{\tilde w_j(x)}{|x-y|^{N+2s}}|x|^{\tau_+} dx\right). \end{aligned} \ea We note that for $y \in \mathrm{supp}\, \phi_j \subset \tilde B_j$ and $x \in {\mathbb R}^N \setminus B_j$, \ba \label{x-x_0} \frac{|x-x_0|}{|x-y|} \leq 1 + \frac{\tilde r_j}{r_j -\tilde r_j} \leq 2^{j+4}. \ea Thanks to the estimates $\tilde w_j\leq \frac{w_j^2}{\tilde k_j-k_j}$, $\tilde w_j \leq w_j$, estimate\eqref{x-x_0} and the definition of nonlocal tail of $w_0$ in $B_{\frac{r}{2}}(x_0)$ in \eqref{def:tail}, we have \ba\label{31}\begin{aligned} &r^{2s}\max\{|x_0|,r\}^{-\tau_+}\Xint-_{B_j}\tilde w_j(x)\phi_j^2|x|^{\tau_+} dx\left(\sup_{y\in\mathrm{supp}\,\phi_j}\int_{\BBR^N\setminus B_j}\frac{\tilde w_j(x)}{|x-y|^{N+2s}}|x|^{\tau_+} dx\right)\\ &\leq Cr^{2s}\max\{|x_0|,r\}^{-\tau_+}2^{j(N+2s)}\Xint-_{B_j}\frac{w_j^2(x)}{\tilde k_j-k_j}|x|^{\tau_+} dx \int_{\BBR^N\setminus B_j}\frac{ w_j(x)}{|x-x_0|^{N+2s}}|x|^{\tau_+} dx\\ &\leq C\frac{2^{j(N+2s+1)}}{\tilde k}\left(\Xint-_{B_j}w_j^2(x)|x|^{\tau_+} dx\right) T(w_0;x_0,\frac{r}{2}). \end{aligned} \ea Next we estimate the first term on the right hand side of \eqref{30-b}. If $x_0 \neq 0$ then by using the estimate $|\nabla \phi_j| \leq \frac{2^{j+3}}{r}$ in $\tilde B_j$,\eqref{xx_0} and $\tilde w_j \leq w_j$, we obtain \ba\label{32}\begin{aligned} &r^{2s}|x_0|^{-\tau_+}\Xint-_{B_j}\int_{B_j}\max\{\tilde w_j(x)^2,\tilde w_j(y)^2\}\frac{(\phi_j(x)-\phi_j(y))^2}{|x-y|^{N+2s}}|y|^{\tau_+}dy |x|^{\tau_+}dx \\ &\leq C 2^{2j}r^{2s-2}|x_0|^{-\tau_+}\Xint-_{B_j}\tilde w_j(x)^2\left(\int_{B_j} |x-y|^{-N-2s+2}|y|^{\tau_+} dy\right)|x|^{\tau_+} dx\\ &\leq C 2^{2j}r^{2s-2}|x_0|^{-\tau_+} r^{-2s+2} |x_0|^{\tau_+} \Xint-_{B_j}|w_j(x)|^2|x|^{\tau_+} dx \\ &= C2^{2j}\Xint-_{B_j}|w_j(x)|^2|x|^{\tau_+} dx. \end{aligned} \ea Now let us consider the case $x_0 =0$. By using the assumption that $\phi_j=1$ in $B_{j+1}\Supset B_{\frac{r}{4}}$, we can split the first term on the right hand side of \eqref{30-b} as \ba\label{32-b}\begin{aligned} &r^{2s-\tau_+}\Xint-_{B_j}\int_{B_j}\max\{\tilde w_j(x)^2,\tilde w_j(y)^2\}\frac{(\phi_j(x)-\phi_j(y))^2}{|x-y|^{N+2s}}|y|^{\tau_+}dy |x|^{\tau_+}dx\\ &=S_jr^{2s-\tau_+} \left(2\int_{B_j \setminus B_{\frac{r}{4}}}\int_{B_{\frac{r}{4}}}\ldots dx +\; \int_{B_j \setminus B_{\frac{r}{4}}}\int_{B_j \setminus B_{\frac{r}{4}}}\ldots dx \right) \\ &=:I_{j,1} + I_{j,2}, \end{aligned} \ea where \bal S_j: = \left( \int_{B_j}|x|^{\tau_+}dx \right)^{-1}. \eal We will estimate $I_{j,1}$. By using the fact that $\phi_j=1$ in $B_{j+1}$, the estimate $|\nabla \phi_j| \leq \frac{2^{j+3}}{r}$ in $\tilde B_j$ and the estimate $\tilde w_j \leq w_j$, we obtain \ba \label{32-c-0} \begin{aligned} I_{j,1}&=2S_jr^{2s-\tau_+} \int_{B_j\setminus B_{j+1}}\int_{B_{\frac{r}{4}}}\max\{\tilde w_j(x)^2,\tilde w_j(y)^2\}\frac{(\phi_j(x)-\phi_j(y))^2}{|x-y|^{N+2s}}|y|^{\tau_+}dy |x|^{\tau_+}dx\\ &\leq C 2^{2j} S_j r^{2s-2-\tau_+}\int_{B_j \setminus B_{j+1}} w_j(x)^2\left(\int_{B_{\frac{r}{4}}} |x-y|^{-N-2s+2}|y|^{\tau_+} dy\right)|x|^{\tau_+} dx\\ &\leq C 2^{2j} S_j \int_{B_j \setminus B_{j+1}} w_j(x)^2|x|^{\tau_+} dx, \end{aligned} \ea since $|x-y|\geq \frac{r}{4}$ for any $x\in B_j \setminus B_{j+1}$ and $y\in B_{\frac{r}{4}}.$ By a similar, and simpler, argument as above, we can show that \ba \label{32-f} \begin{aligned} { I_{j,2}} \leq C2^{2j} S_j \int_{B_j \setminus B_{j+1}}w_j(x)^2|x|^{\tau_+} dx. \end{aligned} \ea From \eqref{32-b}-\eqref{32-f}, we obtain \ba\label{32-g}\begin{aligned} &r^{2s-\tau_+}\Xint-_{B_j}\int_{B_j}\max\{\tilde w_j(x)^2,\tilde w_j(y)^2\}\frac{(\phi_j(x)-\phi_j(y))^2}{|x-y|^{N+2s}}|y|^{\tau_+}dy |x|^{\tau_+}dx\\ &\leq C2^{2j} S_j\Xint-_{B_j \setminus B_{j}}w_j(x)^2|x|^{\tau_+} dx. \end{aligned} \ea Combining \eqref{30-a}, \eqref{31}, \eqref{32} and \eqref{32-g}, we derive \ba\label{33}\begin{aligned} &\bigg(\Xint-_{B_j}|\tilde w_j\phi_j |^{\frac{2N}{N-2s}}|x|^{\tau_+}dx\bigg)^{\frac{N-2s}{N}} \\ &\leq C 2^{j(N+2s+1)}\left(1+\frac{1}{\tilde k}T(w_0;x_0,\frac{r}{2})\right)\Xint-_{B_j}w_j(x)^2 |x|^{\tau_+} dx. \end{aligned} \ea \noindent \textit{Step 3.} Since \bal |\tilde w_j|^{\frac{2N}{N-2s}}\geq ( k_{j+1}-\tilde k_j)^{\frac{4s}{N-2s}} w_{ j+1}^2\geq (2^{-j-2}\tilde k)^\frac{4s}{N-2s}w_{j+1}^2, \eal it follows that (noticing that $\phi_j=1$ in $B_{j+1}$) \ba\label{34}\begin{aligned} \bigg(\Xint-_{B_j}|\tilde w_j\phi_j |^{\frac{2N}{N-2s}}|x|^{\tau_+}dx\bigg)^{\frac{N-2s}{N}}\geq (2^{-j-2}\tilde k)^\frac{4s}{N}\bigg(\Xint-_{B_{j+1}}w_{j+1}^2|x|^{\tau_+}dx\bigg)^{\frac{N-2s}{N}}. \end{aligned} \ea Set \bal A_j:=\bigg(\Xint-_{B_{j}} w_j ^2|x|^{\tau_+}dx\bigg)^{\frac{1}{2}}, \eal then by \eqref{34} and \eqref{33}, we deduce \bal (2^{-j-2}\tilde k)^\frac{4s}{N} A_{j+1}^{\frac{2(N-2s)}{N}}\leq C 2^{j(N+2s+1)}\left(1+\frac{T(w_0;x_0,\frac{r}{2})}{\tilde k}\right)A_j^2. \eal Assuming $\tilde k\geq \delta T(w_0;x_0,\frac{r}{2})$ for some $\delta\in (0,1],$ we obtain \ba\label{35} \left(\frac{A_{j+1}}{\tilde k}\right)\leq C 2^{j(\frac{N+2s+1}{2}+\frac{2s}{N})\frac{N}{N-2s}}\delta^{-\frac{N}{2(N-2s)}}\left(\frac{A_j}{\tilde k}\right)^{1+\frac{2s}{N-2s}}. \ea We will show by induction that there exists $\sigma>1$ such that \ba \label{Aj<A0} A_{j}\leq \sigma^{-j} A_0,\quad\forall j\in \BBN\cup\{0\}. \ea Obviously is valid for $j=0.$ We assume that it is true for $j=l-1.$ By \eqref{35} we have \bal A_{l} &\leq C 2^{l(\frac{N+2s+1}{2}+\frac{2s}{N})\frac{N}{N-2s}}\delta^{-\frac{N}{2(N-2s)}} \left(\frac{A_{l-1}}{\tilde k}\right)^{\frac{2s}{N-2s}} A_{l-1}\\ &\leq C 2^{l(\frac{N+2s+1}{2}+\frac{2s}{N})\frac{N}{N-2s}}\delta^{-\frac{N}{2(N-2s)}}\sigma^{(1-l)\frac{N}{N-2s}}\left(\frac{A_{0}}{\tilde k}\right)^{\frac{2s}{N-2s}} A_{0}\\ &\leq C\sigma^{\frac{N}{N-2s}}\sigma^{-l} 2^{l(\frac{N+2s+1}{2}+\frac{2s}{N})\frac{N}{N-2s}}\delta^{-\frac{N}{2(N-2s)}}\sigma^{-\frac{2s}{N-2s}l} \left(\frac{A_{0}}{\tilde k}\right)^{\frac{2s}{N-2s}}A_{0}. \eal Taking $\sigma=2^{(\frac{N+2s+1}{2}+\frac{2s}{N})\frac{N}{2s}}>1$ we obtain \bal A_{l} &\leq C\sigma^{\frac{N}{N-2s}}\sigma^{-l}\delta^{-\frac{N}{2(N-2s)}}\left(\frac{A_{0}}{\tilde k}\right)^{\frac{2s}{N-2s}}A_{0}. \eal Hence it is enough to choose $\tilde k$ such that \ba \label{A0k} C\sigma^{\frac{N}{N-2s}}\delta^{-\frac{N}{2(N-2s)}}\left(\frac{A_{0}}{\tilde k}\right)^{\frac{2s}{N-2s}}\leq1. \ea We choose \bal \tilde k = \delta T(w_0;x_0,\frac{r}{2})+C^\frac{N-2s}{2s}A_0 \delta^{\frac{-N}{4s}}\sigma^{\frac{N}{2s}}, \eal where $C$ is the constant in \eqref{A0k}, then $A_l \leq \sigma^{-l} A_0$. Then by induction, we deduce \eqref{Aj<A0}. Letting $j\to\infty$ in \eqref{Aj<A0}, we have that $\lim_{j\to\infty} A_j=0$, namely \bal (v-k-\tilde k)^+=0,\;\;a.e.\;\;\text{in}\;\;B_{\frac{r}{2}}(x_0), \eal which implies \eqref{supest}. The proof is complete. \end{proof} Employing the above result and adapting the idea in \cite[Corollary 2.1]{KMS} to our setting, we obtain the following lemma. \begin{lemma}\label{estimateorigin} Let $\mu_0\leq\mu\leq0,$ $r>0$ be such that $B_r(0)\subset\Omega$ and $v\in H^{s}_0(\Omega;|x|^{\tau_+})$ satisfy \eqref{subsolution}. Then there exists a positive constant $C=C(\Omega,N,s,\mu)$ such that \bal \sup_{B_{\frac{r}{2}}}v^+\leq C\left(T(v^+;0,\frac{r}{2})+\Xint-_{B_r}v^+(x)|x|^{\tau_+} dx\right). \eal \end{lemma} \begin{proof}[\textbf{Proof}] Let $\frac{1}{2}\leq t < \gamma \leq1$ and $z\in B_{t r}\setminus B_{\frac{r}{4}}$. We note that $B_{\frac{(\gamma-t)r}{100}}(z) \subset B_{\gamma r}$. Then by applying \eqref{supest} with $B_{\frac{(\gamma-t)r}{100}}(z)$ and $k=0$, we obtain \ba \label{36-a} \begin{aligned} \sup_{x\in B_{\frac{(\gamma-t)r}{200}}(z)}v^+&\leq C T(v^+;z,\frac{(\gamma-t)r}{200})+C\left(\Xint-_{B_{\frac{(\gamma-t)r}{100}}(z)}(v^+(x))^2|x|^{\tau_+} dx\right)^\frac{1}{2}\\ &\leq C T(v^+;z,\frac{(\gamma-t)r}{200})+\frac{C}{(\gamma-t)^{\frac{N}{2}}}\left(\Xint-_{B_{\gamma r}}(v^+(x))^2|x|^{\tau_+} dx\right)^\frac{1}{2}. \end{aligned} \ea Now, since $\frac{|x|}{|x-z|}\leq \frac{C}{\gamma-t}$ for any $x\in\BBR^N\setminus B_{\frac{(\gamma-t)r}{200}}(z),$ by \eqref{def:tail} and H\"older inequality, we have \ba\label{36}\begin{aligned} T(v^+;z,\frac{(\gamma-t)r}{200})&\leq C(\gamma-t)^{2s} r^{2s-\tau_+}\int_{\BBR^N\setminus B_{\frac{(\gamma-t)r}{200}}(z)} \frac{v^+}{|x-z|^{N+2s}}|x|^{\tau_+} dx\\ &\leq C(\gamma-t)^{-N}r^{2s-\tau_+}\int_{(\BBR^N\setminus B_{\frac{(\gamma-t)r}{200}}(z))\setminus B_{\frac{r}{2}}} \frac{v^+}{|x|^{N+2s}}|x|^{\tau_+} dx\\ &+C(\gamma-t)^{-N}r^{-N-\tau_+}\int_{(\BBR^N\setminus B_{\frac{(\gamma-t)r}{200}}(z))\cap B_{\frac{r}{2}}} v^+|x|^{\tau_+} dx\\ &\leq C(\gamma-t)^{-N}\bigg(T(v^+;0,\frac{r}{2})+\left(\Xint-_{B_{\gamma r}}(v^+(x))^2|x|^{\tau_+} dx\right)^\frac{1}{2}\bigg). \end{aligned} \ea Combining \eqref{36-a} and \eqref{36} yields \ba\label{100} \sup_{x\in B_{tr}}v^+\leq C(\gamma-t)^{-N}\bigg(T(v^+;0,\frac{r}{2})+\left(\Xint-_{B_{\gamma r}}(v^+(x))^2|x|^{\tau_+} dx\right)^\frac{1}{2}\bigg). \ea By Young's inequality, we have \bal (\gamma-t)^{-N}\left(\Xint-_{B_{\gamma r}}(v^+(x))^2|x|^{\tau_+} dx\right)^\frac{1}{2} &\leq (\gamma-t)^{-N}\left(\sup_{x\in B_{\gamma r}}v^+\Xint-_{B_{\gamma r}}v^+(x)|x|^{\tau_+} dx\right)^\frac{1}{2}\\ &\leq \frac{1}{2C}\sup_{x\in B_{\gamma r}}v^++2C(\gamma-t)^{-2N}\Xint-_{B_{\gamma r}}v^+(x)|x|^{\tau_+} dx, \eal where $C$ is the constant in \eqref{100}. Therefore \ba \label{supv+} \sup_{x\in B_{tr}}v^+\leq\frac{1}{2}\sup_{x\in B_{\gamma r}}v^++2C^2(\gamma-t)^{-2N}\left(\Xint-_{B_{\gamma r}}v^+(x)|x|^{\tau_+} dx+T(v^+;0,\frac{r}{2})\right). \ea For any $t\in[\frac{1}{2},1],$ we set $f(t)=\sup_{x\in B_{tr}}v^+$ and \bal c_0=2C^2\left(\Xint-_{B_{\gamma r}}v^+(x)|x|^{\tau_+} dx+T(v^+;0,\frac{r}{2})\right). \eal Then \eqref{supv+} can be written as \bal f(t)\leq \frac{1}{2}f(\gamma)+\frac{c_0}{(\gamma-t)^{2N}}\quad \text{for all } \frac{1}{2}\leq t<\gamma\leq1. \eal Let $\tau\in (0,1)$ and $\alpha=2N.$ We consider the sequence $t_0=t$ and \bal t_{i+1}=t_i+(1-\tau)\tau^i(\gamma-t)=t_0+(1-\tau)(\gamma-t)\sum_{j=0}^i \tau^{j}\to \gamma. \eal By iteration, we have \bal f(t)=f(t_0)=2^{-k}f(t_k)+\frac{c_0}{(1-\tau)^\alpha(\gamma-t)^\alpha}\sum_{i=0}^{k-1}2^{-i}\tau^{-i\alpha}. \eal Choosing $2^{-\frac{1}{\alpha}}<\tau<1$ and letting $k\to\infty$ in the above expression, we obtain \bal f(t)\leq C(\alpha,\tau)\frac{c_0}{(1-\tau)^\alpha(\gamma-t)^\alpha}, \eal which yields the desired inequality. \end{proof} Now, we turn to \begin{proof}[\textbf{Proof of Theorem \ref{est1}}] Let $\{\zeta_{\delta}\}_{\delta>0}$ be the sequence of standard mollifiers and denote $\nu_{1,\delta} = \zeta_{\delta} \ast \nu^+$ and $\nu_{2,\delta} = \zeta_{\delta} \ast \nu^-$. For $\delta>0$, $\nu_{i,\delta} \in C_0^\infty(\Omega\setminus\{0\})$, $i=1,2$, and $\mathrm{dist}(\mathrm{supp}\, \nu_{1,\delta},\{0\})>\frac{r}{2},$ $\mathrm{dist}(\mathrm{supp}\, \nu_{2,\delta},\{0\})>\frac{r}{2}$. Moreover, \ba \label{fngn} \int_{\Omega}\nu_{1,\delta}|x|^{\tau_+} dx\to \int_{\Omega\setminus\{0\}}|x|^{\tau_+} d\nu^+\quad\text{and}\quad \int_{\Omega} \nu_{2,\delta}|x|^{\tau_+} dx\to \int_{\Omega\setminus\{0\}}|x|^{\tau_+} d\nu^-. \ea Let $u_\delta$ be the weak solution of \bal \left\{ \begin{aligned} \CL_\mu^s u&=\nu_{1,\delta}- \nu_{2,\delta}&&\quad\text{in}\;\,\Omega,\\ u&=0&&\quad\text{in}\;\,\BBR^N\setminus\Omega. \end{aligned} \right. \eal {Since $\Omega$ is a bounded domain satisfying the exterior ball condition and containing the origin, by \cite[Theorem 1.6]{CGN}, for any $b<2s-\tau_+$,} there holds \ba \label{ud12} \int_{\Omega}|u_\delta||x|^{-b}dx\leq C(N,\Omega,\mu,s,b)\int_{\Omega}(\nu_{1,\delta}+\nu_{2,\delta})|x|^{\tau_+} dx. \ea Furthermore, in view of the proof of {\cite[Theorem 1.7]{CGN}}, $u_\delta \to u$ a.e. in $\Omega$ and in $L^1(\Omega;|x|^b)$. Put $v_\delta=|x|^{-\tau_+}u_\delta$, then $v_\delta\in H^{s}_0(\Omega;|x|^{\tau_+})$ and $v_\delta$ satisfies \bal \langle v_\delta,\phi \rangle_{s,\tau_+} =\int_{\Omega}\big(\nu_{1,\delta}(x)-\nu_{2,\delta}(x)\big)\phi(x)|x|^{2\tau_+}dx, \quad \forall \phi\in H^{s}_0(\Omega;|x|^{\tau_+}). \eal Hence, \bal \langle v_\delta,\phi \rangle_{s,\tau_+} =0, \quad \forall \phi\in C_0^\infty(B_{\frac{r}{2}}). \eal { By Lemma \ref{estimateorigin}, the definition of the tail in \eqref{def:tail} and the fact that $v_{\delta}^+ =0$ in $\Omega$, we deduce that \bal \begin{aligned} &\quad \sup_{x\in B_{\frac{r}{4}} \setminus \{0\} }v_\delta^+(x)\\ &\leq C(N,\Omega,s,\mu)\Big(T(v_\delta^+;0,\frac{r}{4})+\Xint-_{B_{\frac{r}{2} }}v_\delta^+(x)|x|^{\tau_+} dx\Big) \\ &\leq C(N,\Omega,s,\mu) \Big( 4^{N+2s}r^{-(N+\tau_+)}\int_{{\mathbb R}^N\setminus B_{\frac{r}{4} } }v_\delta^+(x)|x|^{\tau_+} dx + \big(\int_{B_{\frac{r}{2} }} |x|^{\tau_+}dx \big)^{-1} \int_{B_{\frac{r}{2} }}v_\delta^+(x)|x|^{\tau_+} dx \Big) \\ &\leq C(N,\Omega,s,\mu,r)\int_{\Omega}v_\delta^+(x)|x|^{\tau_+}dx. \end{aligned} \eal Similarly, we can show that \bal \sup_{x\in B_{\frac{r}{4}} \setminus \{0\} }v_\delta^-(x) \leq C(N,\Omega,s,\mu,r)\int_{\Omega}v_\delta^-(x)|x|^{\tau_+}dx. \eal Adding two preceding estimates and using estimate \eqref{ud12}, for any $b \in [0,2s-\tau_+)$, we obtain \bal \begin{aligned} \sup_{x\in B_{\frac{r}{4}}(0) \setminus \{0\} }|v_\delta(x)| &\leq C(N,\Omega,s,\mu,r)\int_{\Omega}|v_\delta||x|^{\tau_+} dx \\ &\leq C(N,\Omega,s,\mu,r)\int_{\Omega}|u_\delta||x|^{-b}dx\ \leq C(N,\Omega,s,\mu,r,b)\int_{\Omega}(\nu_{1,\delta}+\nu_{2,\delta})|x|^{\tau_+} dx. \end{aligned} \eal By letting $\delta \to 0$ and employing the convergence \eqref{fngn} and the fact that $v_\delta \to |x|^{-\tau_+}u$ a.e. in $\Omega$ as $\delta \to 0$, we derive \eqref{supu|x|}. } \end{proof} \section{The semilinear problem with interior measure data} \subsection{Estimates in the weighted weak Lebesgue space} We start this subsection by recalling the definition of weak Lebesgue space. For $\alpha \in {\mathbb R}$ and $1 \leq q <\infty$, we denote by $L_w^q(\Omega \setminus \{0\};|x|^{\alpha})$ the weighted weak Lebesgue space (or weighted Marcinkiewicz space) defined by \bal L_w^q(\Omega \setminus \{0\};|x|^{\alpha} ):= \left\{ u \in L^1_{\mathrm{loc}}(\Omega \setminus \{0\}): \sup_{\lambda > 0} \lambda^q \int_{\{ x \in \Omega \setminus \{0\}: |u(x)| \geq \lambda \} } |x|^{\alpha} dx < +\infty \right\}. \eal Denote \ba \label{semi} \norm{u}^*_{L_w^q(\Omega \setminus \{0\}; |x|^{\alpha})}:=\left(\sup_{\lambda > 0} \lambda^q \int_{\{ x \in \Omega \setminus \{0\}: |u(x)| \geq \lambda \} } |x|^{\alpha} dx\right)^{\frac{1}{q}}. \ea Note that $\norm{\cdot}_{L_w^q(\Omega \setminus \{0\}; |x|^{\alpha})}^*$ is not a norm, but for $\kappa>1$, it is equivalent to the norm \bal \norm{u}_{L_w^q(\Omega \setminus \{0\}; |x|^{\alpha})}:=\sup\left\{ \frac{\int_{A}|u||x|^{\alpha}dx}{(\int_A |x|^{\alpha}dx)^{1-\frac{1}{q}}}: A \subset D, \, A \text{ measurable},\, 0<\int_A |x|^{\alpha}dx <\infty \right\}. \eal More precisely, \ba \label{equinorm} \norm{u}_{L_w^q(\Omega \setminus \{0\}; |x|^{\alpha})}^* \leq \norm{u}_{L_w^q(\Omega \setminus \{0\}; |x|^{\alpha})} \leq \frac{q}{q-1}\norm{u}_{L_w^q(\Omega \setminus \{0\}; |x|^{\alpha})}^*. \ea The following strict continuous embedding hold \bal L^q(\Omega \setminus \{0\}; |x|^{\alpha}) \hookrightarrow L_w^q(\Omega \setminus \{0\}; |x|^{\alpha}) \hookrightarrow L^m(\Omega \setminus \{0\}; |x|^{\alpha}) \eal for $1 \leq m < q < \infty$. \begin{proposition} \label{Marcin-3} Assume $\mu \geq \mu_0$ and $\nu \in \mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega \setminus \{0\};|x|^{\tau_+})$ such that \bal \mathrm{dist}(\mathrm{supp}\,|\nu|,\{0\})>4r_0 .\eal Let $u$ be the unique solution of \eqref{veryweaksolutionmesure}. Then $u \in L_w^{\frac{N}{N-2s} }(\Omega \setminus \{0\};|x|^{\tau_+})$ and \ba \label{Marcin-2} \begin{aligned} \| u \|_{L_w^{\frac{N}{N-2s} }(\Omega \setminus \{0\};|x|^{\tau_+})} \leq C(N,\Omega,s,\mu,r_0) \| \nu \|_{\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega \setminus \{0\}; |x|^{\tau_+} )}. \end{aligned} \ea \end{proposition} To prove Proposition \ref{Marcin-3}, we need the following estimates on the level sets of $u$. \begin{lemma}\label{est2} Assume $\mu\geq\mu_0$, $\nu\in\mathfrak{M}(\Omega\setminus\{0\};|x|^{\tau_+})$ and let $u$ be the unique solution of \eqref{veryweaksolutionmesure}. (i) If $\mu_0\leq \mu<0$ then, for any $\lambda>1$ and any $r>0$ such that $B_{4r}(0)\subset\Omega,$ there holds \ba \label{u>k-1} |\{x\in\Omega\setminus B_r(0):\;|u(x)|>\lambda\}|\leq C(N,\Omega,s,\mu,r)\lambda^{-\frac{N}{N-2s}}\| \nu \|_{\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega \setminus \{0\};|x|^{\tau_+})}^{\frac{N}{N-2s} }. \ea (ii) If $\mu_0\geq 0$ then, for any $\lambda>1$, \ba \label{u>k-1+} |\{x\in\Omega:\;|u(x)|>\lambda\}|\leq { C(N,s,\mu)}\lambda^{-\frac{N}{N-2s}}\| \nu \|_{\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega \setminus \{0\};|x|^{\tau_+})}^{\frac{N}{N-2s} }. \ea \end{lemma} \begin{proof}[\textbf{Proof}] In view of the proof of Theorem \ref{est1}, we may assume that $\nu\in C_0^\infty(\Omega).$ Then $v=|x|^{-\tau_+}u \in H^{s}_0(\Omega;|x|^{\tau_+}) $ and satisfies \bal \langle v,\phi \rangle_{s,\tau_+} =\int_{\Omega}\phi(x)|x|^{\tau_+}\nu(x)dx, \quad \forall \phi\in C_0^\infty(B_{\frac{r}{2}}(0)). \eal Let $\lambda>0,$ taking $v_\lambda=\max\{-\lambda,\min \{v,\lambda\}\}$ as a test function, we have \bal \langle v,v_\lambda \rangle_{s,\tau_+} &=\int_{\Omega} v_\lambda(x)|x|^{\tau_+} \nu(x)dx\leq \lambda\int_{\Omega}|x|^{\tau_+} |\nu(x)|dx. \eal We see that \bal (v(x)-v(y))(v_\lambda(x)-v_\lambda(y))\geq (v_\lambda(x)-v_\lambda(y))^2, \quad \forall x,y \in {\mathbb R}^N. \eal Hence from the two proceeding inequalities, we obtain \ba\label{101} \langle v_\lambda,v_\lambda \rangle_{s,\tau_+} \leq \lambda \int_{\Omega}|x|^{\tau_+} |\nu(x)|dx. \ea (i) Assume $\mu_0\leq\mu<0$. In this case $\frac{2s-N}{2} \leq \tau_+ <0$. Let $r>0$ is small enough such that $B_{4r}(0) \subset \Omega$ and set $\lambda_1=\lambda r^{-\tau_+}$. Then by \eqref{subcritsobolev1}, \eqref{critsobolev1} and \eqref{101}, we have \bal |\{x\in\Omega \setminus B_r(0):\;|u(x)|\geq \lambda\}|&\leq |\{x\in\Omega\setminus B_r(0):\;|v_{\lambda_1}(x)|\geq \lambda_1\}\\ &\leq C(N,s,\mu,r)\lambda^{-\frac{2N}{N-2s}}\int_{\Omega\setminus B_r(0)}|v_{\lambda_1}|^{\frac{2N}{N-2s}} dx\\ &\leq C(N,s,\mu,\Omega,r)\lambda^{-\frac{2N}{N-2s}}\int_{\Omega}|v_{\lambda_1}|^{\frac{2N}{N-2s}} |x|^{\tau_+} dx\\ &\leq C(N,s,\mu,\Omega,r)\lambda^{-\frac{2N}{N-2s}}\langle v_{\lambda_1},v_{\lambda_1} \rangle_{s,\tau_+}^{\frac{N}{N-2s}}\\ &\leq C(N,s,\mu,\Omega,r)\lambda^{-\frac{N}{N-2s}}\left(\int_{\Omega\setminus \{0\}}|x|^{\tau_+}|\nu(x)|dx\right)^{\frac{N}{N-2s}}, \eal which implies \eqref{u>k-1}. (ii) Assume $\mu\geq 0$. In this case $\tau_+ \geq 0$. Set $\lambda_2=(\sup_{x\in\Omega}|x|)^{-\tau_+}\lambda$, then by \eqref{subcritsobolev1} and \eqref{101}, we have \bal |\{x\in\Omega:\;|u(x)|\geq \lambda\}|&\leq C(N,s,\mu)\lambda^{-\frac{2N}{N-2s}}\int_{\{x\in\Omega :\;|v(x)|\geq \lambda|x|^{-\tau_+}\}}\big(|x|^{\tau_+}|v|\big)^{\frac{2N}{N-2s}} dx \\ &\leq C(N,s,\mu)\lambda^{-\frac{2N}{N-2s}}\int_{\Omega}\big(|x|^{\tau_+}|v_{\lambda_2}|\big)^{\frac{2N}{N-2s}} dx \\ &\leq { C(N,s,\mu)}\lambda^{-\frac{2N}{N-2s}}\langle v_{\lambda_2},v_{\lambda_2} \rangle_{s,\tau_+}^{\frac{N}{N-2s}}\\ &\leq { C(N,s,\mu)}\lambda^{-\frac{N}{N-2s}}\left(\int_{\Omega\setminus \{0\}}|x|^{\tau_+}|\nu(x)|dx\right)^{\frac{N}{N-2s}}, \eal which implies \eqref{u>k-1+}. \end{proof} Now we are ready to prove Proposition \ref{Marcin-3}. \begin{proof}[\textbf{Proof of Proposition \ref{Marcin-3}}] By the linearity, we may assume that $\| \nu \|_{\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega \setminus \{0\};|x|^{\tau_+})}=1$.\smallskip \noindent \textit{Case 1: $\mu_0 \leq \mu <0$}. In this case, $\frac{2s-N}{2}\leq \tau_+<0$. Fix $0<r<r_0$ small. Since $\tau_+<0$, by Theorem \ref{est1}, we have { (noting that $\| \nu \|_{\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega \setminus \{0\};|x|^{\tau_+})}=1$) \bal |u(x)| \leq C_1 |x|^{\tau_+},\quad\forall x \in B_r(0) \setminus \{0\}, \eal where $C_1=C_1(N,\Omega,s,\mu,r)$. It follows that \bal \{x \in B_r(0) \setminus \{0\}: |u(x)|>\lambda\}\subset B_{R_1}(0) \eal where \bal R_1=\left(C_1\lambda^{-1}\right)^{-\frac{1}{\tau_+}}. \eal Hence, \bal \int_{\{ x \in B_r(0) \setminus \{0\}: |u(x)|> \lambda \}} |x|^{\tau_+}dx &\leq \int_{B_{R_1}(0)}|x|^{\tau_+}dx =C(N,\Omega,s,\mu,r) \lambda^{\frac{N+\tau_+}{\tau_+} }. \eal} Since $\tau_+\geq \frac{2s-N}{2}$, we have $-\frac{N+\tau_+}{\tau_+} \geq \frac{N}{N-2s}$. From the above estimate, we can easily deduce that, {for any $\lambda>1$}, \ba \label{Br-1} \int_{\{ x \in B_r(0) \setminus \{0\}: |u(x)|> \lambda \}} |x|^{\tau_+}dx \leq C(N,\Omega,s,\mu,r){\lambda^{-\frac{N}{N-2s} }}. \ea Next by (\ref{u>k-1}) and since $\tau_+<0$, we have, {for any $\lambda>1$}, \ba \label{Br-2} \begin{aligned} \int_{\{ x \in \Omega \setminus B_r(0): |u(x)|> \lambda \}} |x|^{\tau_+}dx \leq r^{\tau_+}\big|\{ x \in \Omega \setminus B_r(0): |u(x)|> \lambda \}\big| \leq C(N,\Omega,s,\mu,r) {\lambda^{-\frac{N}{N-2s} }.} \end{aligned} \ea By combining \eqref{Br-1} and \eqref{Br-2}, we obtain, for any $\lambda>1$, that \ba \label{Marcin-2a} \int_{\{ x \in \Omega \setminus \{0\}: |u(x)|> \lambda \}} |x|^{\tau_+}dx \leq C(N,\Omega,s,\mu,r) \lambda^{-\frac{N}{N-2s} }. \ea Then we can easily show that \eqref{Br-1} holds for any $\lambda>0$. \noindent \textit{Case 2: $\mu \geq 0$}. In this case $\tau_+ \geq0$. Put $v=|x|^{-\tau_+}u$ and $D_{\Omega}=\sup_{x \in \Omega}|x|^{\tau_+}$, then \bal \int_{\{x\in\Omega \setminus \{0\}:\;|u(x)|\geq \lambda \}}|x|^{\tau_+} dx\leq \int_{\{x\in\Omega \setminus \{0\}:\;D_\Omega|v(x)|\geq \lambda \}}|x|^{\tau_+} dx. \eal This and \eqref{u>k-1+} imply \eqref{Marcin-2a} for any $\lambda>0$. Finally, estimate \eqref{Marcin-2} follows from \eqref{Marcin-2a}, \eqref{semi} and \eqref{equinorm}. \end{proof} \subsection{Existence and uniqueness} In this subsection, we aim to establish the existence and uniqueness of the weak solution to problem \eqref{eq 1.0} with $\ell=0$. First, we show the solvability for semilinear problem involving the dual operator $(-\Delta)_{\gamma}^s$ in the variational framework. We assume that \begin{itemize} \item[$({\bf h}_1)$] $h \in C({\mathbb R}^N \setminus \{0\} \times {\mathbb R}) \cap L^\infty ({\mathbb R}^N \times {\mathbb R})$; \item[$({\bf h}_2)$] the map $s\mapsto h(\cdot,s)$ is nondecreasing and $h(\cdot,0)=0$ in ${\mathbb R}^N \setminus \{0\}$. \end{itemize} In the sequel, we will use the notations: $H(t)=\int_0^th(s)ds$, $(h \circ u)(x) = h(x,u(x))$, $(H \circ u)(x) = H(x,u(x))$ for $x \in {\mathbb R}^N \setminus \{0\}$. \begin{definition} A function $u$ is called a \textit{variational solution} to problem \ba \label{prob:semi-var} \left\{ \begin{aligned} (-\Delta)^s_\gamma u +h \circ u &=f \quad && \text{in } \Omega, \\[1mm] \qquad\quad u &=0 && \text{in } {\mathbb R}^N\setminus \Omega, \end{aligned} \right. \ea if $u \in H_0^s(\Omega;|x|^\gamma)$ and \bal \langle u, \xi \rangle_{s,\gamma} + (h \circ u,\xi)_{\gamma} = (f,\xi)_{\gamma}, \quad\forall\, \xi \in H_0^s(\Omega;|x|^\gamma). \eal \end{definition} \begin{proposition} \label{exist-semi-varsol} Assume $\gamma\in[ \frac{2s-N}{2}, 2s)$, $\alpha\in{\mathbb R}$, $f \in L^p(\Omega;|x|^{\alpha})$ with $p$ satisfying \eqref{exs ex-0} and $h$ satisfies $({\bf h}_1)$ and $({\bf h}_2)$. Then problem \eqref{prob:semi-var} admits a unique variational solution. \end{proposition} \begin{proof}[\textbf{Proof}] Under the assumptions $({\bf h}_1)$ and $({\bf h}_2)$, we consider the functional \bal \mathscr{J}(\varphi) := \frac{1}{2}\| \varphi \|_{s,\gamma}^2 + \int_{\Omega}(H \circ u) |x|^{\gamma} dx - \int_{\Omega} f u |x|^\gamma dx, \quad \varphi \in H_0^s(\Omega;|x|^\gamma). \eal Since $H$ is a nonnegative function, by proceeding similarly as in the proof of Theorem \ref{th:main-2}, we can show that $\mathscr{J}$ is coercive and semi-continuous in $H_0^s(\Omega;|x|^\gamma)$. Thus $\mathscr{J}$ has a critical point $v \in H_0^s(\Omega;|x|^\gamma)$, which is a variational solution of \eqref{prob:semi-var}. The uniqueness follows from Kato type inequality \eqref{kato1}. \end{proof} \begin{theorem}\label{existence4} Assume $\mu_0\leq\mu$, $\nu_i\in\mathfrak{M}^+(\Omega\setminus\{0\};|x|^{\tau_+})$, $i=1,2$, and $g\in C({\mathbb R})\cap L^\infty({\mathbb R})$ is a nondecreasing function such that $g(0)=0$. Then there exist unique weak solutions $u,u_1,u_2,v_1,v_2$ of the following problems respectively \ba \label{prob:gu} \left\{ \begin{aligned} \CL_\mu^s u+g(u)&=\nu_1-\nu_2&&\quad\text{in}\;\, \Omega,\\ u&=0&&\quad\text{in}\;\,\BBR^N\setminus\Omega, \end{aligned} \right. \ea \ba \label{prob:gu1} \left\{ \begin{aligned} \CL_\mu^s u_1+g(u_1)&=\nu_1&&\quad\text{in}\;\, \Omega,\\ u_1&=0&&\quad\text{in}\;\, \BBR^N\setminus\Omega, \end{aligned} \right. \ea \ba \label{prob:gu2} \left\{ \begin{aligned} \CL_\mu^s u_2-g(-u_2)&=\nu_2&&\quad\text{in}\;\, \Omega,\\ u_2&=0&&\quad\text{in}\;\, \BBR^N\setminus\Omega, \end{aligned} \right. \ea and \ba \label{linear-vi} \left\{ \begin{aligned} \CL_\mu^s v_i&=\nu_i&&\quad\text{in}\;\, \Omega,\\ v_i&=0&&\quad\text{in}\;\, \BBR^N\setminus\Omega, \end{aligned} \right. \ea such that \ba \label{order-1} -v_2\leq-u_2\leq u\leq u_1\leq v_1 \quad \text{in } \Omega \setminus \{0\}. \ea \end{theorem} \begin{proof}[\textbf{Proof}] \noindent {\sc Existence. } \medskip \noindent \textbf{Step 1.} First we assume that $\nu_i$, $i=1,2$, has compact support in $\Omega\setminus\{0\}$. Let $\{\zeta_\delta\}_{\delta>0}$ be the sequence of standard mollifiers. Put $\nu_{i,\delta}=\zeta_\delta*\nu_i$ then there exists an open set $D\Subset\Omega\setminus\{0\}$ such that $\nu_{i,\delta} \in C^\infty_0(D)$ for $\delta>0$ small enough. Then \ba \label{nuntonu} \int_{\Omega} d(x)^s |x|^{\tau_+}\nu_{\delta} dx\to \int_{\Omega\setminus\{0\}} d(x)^s |x|^{\tau_+}d\nu \quad \text{as } \delta \to 0 \ea and \ba \label{nun<nu} \| \nu_{i,\delta} \|_{L^1(\Omega;|x|^{\tau_+})} \leq c \| \nu_i \|_{\mathfrak{M}(\Omega\setminus\{0\}; d(x)^s |x|^{\tau_+})}, \quad \forall \delta > 0. \ea Define the function $h: {\mathbb R}^N \setminus \{0\} \times {\mathbb R} \to {\mathbb R}$ by $h(x,t)=g(|x|^{\tau_+} t)$ for $x \in {\mathbb R}^N \setminus \{0\}$, $t \in {\mathbb R}$. By Proposition \ref{exist-semi-varsol}, there exist variational solutions $\tilde u_{\delta},\tilde u_{1,\delta},\tilde u_{2,\delta},\tilde v_{1,\delta},\tilde v_{2,\delta}\in H_0^s(\Omega;|x|^{\tau_+})$ of the following problems respectively \bal \left\{ \begin{aligned} (-\Delta)_{\tau_+}^s \tilde u_{\delta}+h \circ \tilde u_{\delta}&=\nu_{1,\delta}-\nu_{2,\delta}&&\quad\text{in}\;\Omega,\\ \tilde u_{\delta}&=0&&\quad\text{in}\;\BBR^N\setminus\Omega, \end{aligned} \right. \eal \bal \left\{ \begin{aligned} (-\Delta)_{\tau_+}^s \tilde u_{1,\delta}+h \circ \tilde u_{1,\delta}&=\nu_{1,\delta}&&\quad\text{in}\;\Omega,\\ \tilde u_{1,\delta}&=0&&\quad\text{in}\;\BBR^N\setminus\Omega, \end{aligned} \right. \eal \bal \left\{ \begin{aligned} (-\Delta)_{\tau_+}^s \tilde u_{2,\delta}-h \circ (-\tilde u_{2,\delta})&=\nu_{2,\delta}&&\quad\text{in}\;\Omega,\\ \tilde u_{2,\delta}&=0&&\quad\text{in}\;\BBR^N\setminus\Omega, \end{aligned} \right. \eal and \bal \left\{ \begin{aligned} (-\Delta)_{\tau_+}^s \tilde v_{i,\delta}&=\nu_{i,\delta}&&\quad\text{in}\;\Omega,\\ \tilde v_{i,\delta}&=0&&\quad\text{in}\;\BBR^N\setminus\Omega. \end{aligned} \right. \eal We infer from Kato type inequality \eqref{kato1} that $\tilde u_{i,\delta} \geq 0$, $\tilde v_{i,\delta} \geq 0$, $i=1,2$, and \bal -\tilde v_{2,\delta}\leq-\tilde u_{2,\delta}\leq \tilde u_{n}\leq \tilde u_{1,\delta}\leq \tilde v_{1,\delta} \quad \text{a.e. in } \Omega \setminus \{0\}. \eal Put $u_\delta = |x|^{\tau_+}\tilde u_\delta$, $u_{i,\delta}=|x|^{\tau_+}\tilde u_\delta$ and $v_{i,n}=|x|^{\tau_+} \tilde v_{i,\delta}$, then $u_{i,\delta} \geq 0$, $v_{i,\delta} \geq 0$ and \ba \label{uivi-1} -v_{2,\delta}\leq-u_{2,\delta}\leq u_{\delta}\leq u_{1,\delta}\leq v_{1,\delta} \quad \text{a.e. in } \Omega \setminus \{0\}. \ea This implies that \bal |u_\delta| \leq u_{1,\delta} + u_{2,\delta} \leq v_{1,\delta} + v_{2,\delta} \quad \text{a.e. in } \Omega \setminus \{0\}. \eal Moreover, since $g(u_\delta(x)) = ( h \circ\tilde u_\delta)(x)$ and $g(u_{i,\delta}(x)) = (h \circ\tilde u_{i,\delta})(x)$, $i=1,2$, it follows that \bal |g(u_\delta)| \leq g(u_{1,\delta}) - g(- u_{2,\delta}) \quad \text{a.e. in } \Omega \setminus \{0\}. \eal From Theorem \ref{existence2}, we find that $u_\delta$, $u_{1,\delta}$, $u_{2,\delta}$, $v_{1,\delta}$ and $v_{2,\delta}$ are respectively weak solutions to the following problems \ba \label{gun} \left\{ \begin{aligned} \CL_\mu^s u_{\delta}+g( u_{\delta})&=\nu_{1,\delta}-\nu_{2,\delta}&&\quad\text{in}\;\Omega,\\ u_{\delta}&=0&&\quad\text{in}\;\BBR^N\setminus\Omega, \end{aligned} \right. \ea \ba \label{guin} \left\{ \begin{aligned} \CL_\mu^s u_{1,\delta}+g(u_{1,\delta})&=\nu_{1,\delta}&&\quad\text{in}\;\Omega,\\ u_{1,\delta}&=0&&\quad\text{in}\;\BBR^N\setminus\Omega, \end{aligned} \right. \ea \ba \label{gvin} \left\{ \begin{aligned} \CL_\mu^s u_{2,\delta}-g(- u_{2,\delta})&=\nu_{2,\delta}&&\quad\text{in}\;\Omega,\\ u_{2,\delta}&=0&&\quad\text{in}\;\BBR^N\setminus\Omega, \end{aligned} \right. \ea and \bal \left\{ \begin{aligned} \CL_\mu^s v_{i,\delta}&=\nu_{i,\delta}&&\quad\text{in}\;\Omega,\\ v_{i,\delta}&=0&&\quad\text{in}\;\BBR^N\setminus\Omega. \end{aligned} \right. \eal Since $g \in C({\mathbb R}) \cap L^\infty({\mathbb R})$, we can modify the approximation argument in \cite[Theorem 5.1]{CGN} in order to show that there exist functions $u,u_1,u_2,v_1,v_2$ such that $\{u_\delta\}$, $\{u_{i,\delta}\}$ and $\{v_{i,\delta}\}$ converge to $u$, $u_i$ and $v_i$, $i=1,2$, a.e. in $\Omega \setminus \{0\}$ and in $L^1(\Omega;|x|^{-b})$, for any $b<2s-\tau_+$, respectively as $\delta \to 0$. From Theorem \ref{existence2}, $v_i$ is the solution to problem \eqref{linear-vi}, $i=1,2$. Since $g \in C({\mathbb R}) \cap L^\infty({\mathbb R})$, we deduce from the dominated convergence theorem that $\{g(u_\delta)\}$, $\{g(u_{i,\delta})\}$ and $\{g(v_{i,\delta})\}$ convergence to $g(u)$, $g(u_i)$ and $g(v_i)$, $i=1,2$, a.e. in $\Omega \setminus \{0\}$ and in $L^1(\Omega;|x|^{\tau_+})$ respectively as $\delta \to 0$. Therefore, by passing to the limit in the weak formulation for problems \eqref{gun}--\eqref{gvin}, we derive that $u$, $u_1$, $u_2$ are solutions to problems \eqref{prob:gu}--\eqref{prob:gu2} respectively. The uniqueness for problems \eqref{prob:gu}--\eqref{prob:gu2} follows from Kato type inequality \eqref{Kato:+-1} and the monotonicity of $g$. Moreover, from \eqref{uivi-1}, we obtain \eqref{order-1}. \medskip \noindent \textbf{Step 2.} Next we drop the assumption that $\nu_i$, $i=1,2$, has compact support. Let $\{O_l\}_{l \in {\mathbb N}}$ be a smooth exhaustion of $\Omega \setminus \{0\}$, i.e. smooth open sets $\{O_l\}_{l \in{\mathbb N}}$ such that \bal O_l \Subset O_{l+1}\Subset\Omega\setminus \{0\}\quad\text{and}\quad\cup_{l \in {\mathbb N}} O_l=\Omega\setminus\{0\}. \eal Set $\nu_{i,l} = \textbf{1}_{\overline{O}_l}\nu_i$, $i=1,2$, and let $u_l$, $u_{1,l}$, $u_{2,l}$, $v_{i,l}$ be respectively the nonnegative weak solutions to \eqref{prob:gu}, \eqref{prob:gu1}, \eqref{prob:gu2} and \eqref{linear-vi} with $\nu_i$ replaced by $\nu_{i,l}$, $i=1,2$. Then we have \ba \label{u12lvl} -v_{2,l} \leq -u_{2,l} \leq u_{l} \leq u_{1,l} \leq v_{1,l} \quad \text{a.e. in } \Omega \setminus \{0\}. \ea Let $b<2s-\tau_+$, then $u_l \in L^1(\Omega;|x|^{-b})$ and $u_l$ satisfies the weak formulation \ba \label{ulsol-a} \begin{aligned} \int_\Omega u_l (-\Delta)^s_{\tau_+}\psi dx + \int_{\Omega}g(u_{l}) \psi |x|^{\tau_+}dx = \int_{\Omega\setminus\{0\}}\psi |x|^{\tau_+} d(\nu_{1,l}- \nu_{2,l}) \end{aligned} \ea for all $0 \leq \psi\in \mathbf{X}_\mu(\Omega;|x|^{-b})$. We know from Step 1 that $u_l$ is the limit of the sequence of $\{u_{l,\delta}\}_{\delta > 0}$, where $u_{l,\delta}$ is the weak solution of \bal \left\{ \begin{aligned} \CL_\mu^s u+g( u)&=\nu_{1,l,\delta}-\nu_{2,l,\delta}&&\quad\text{in}\;\Omega,\\ u_{\delta}&=0&&\quad\text{in}\;\BBR^N\setminus\Omega, \end{aligned} \right. \eal where $\nu_{i,l,\delta}:=\zeta_\delta \ast \nu_{i,l}$, $i=1,2$. For $l > l'$, since $\nu_{i,l} \geq \nu_{i,l'}$, it follows that $\nu_{i,l,\delta} \geq \nu_{i,l',\delta}$ for $i=1,2$ and any $\delta>0$. Let $\xi_b$ be the solution of \ba \label{xib} \left\{ \begin{aligned} \CL_\mu^s \xi &= |x|^{-b} \quad &&\text{in } \Omega, \\ \xi &=0 \quad &&\text{in } {\mathbb R}^N \setminus \Omega. \end{aligned} \right. \ea Then $\xi_b \in \mathbf{X}_\mu(\Omega;|x|^{-b})$ and $|\xi_b| \leq Cd^s$ a.e. in $\Omega$ (see \cite[estimate (1.16)]{CGN}). By using Kato type inequality \eqref{Kato||-1} for $u_{l,\delta}-u_{l',\delta}$ and $\psi=\xi_b$ as the test function, we obtain that \ba \label{ulsol-aa} \begin{aligned} &\int_\Omega |u_{l,\delta}-u_{l',\delta}||x|^{-b} dx + \int_{\Omega}|g(u_{l,\delta}) - g(u_{l',\delta})|\xi_b |x|^{\tau_+}dx \\ &\leq \int_{\Omega\setminus\{0\}}\xi_b \mathrm{sign}(u_{l,\delta} - u_{l',\delta}) |x|^{\tau_+} [(\nu_{1,l,\delta}- \nu_{1,l',\delta}) - (\nu_{2,l,\delta}-\nu_{2,l',\delta})]dx \\ &\leq C\int_{\Omega\setminus\{0\}} |x|^{\tau_+} (\nu_{1,l,\delta}- \nu_{1,l',\delta})dx + C\int_{\Omega\setminus\{0\}} |x|^{\tau_+} (\nu_{2,l,\delta}-\nu_{2,l',\delta})dx. \end{aligned} \ea We note that $u_{l,\delta}-u_{l',\delta} \to u_{l}-u_{l'}$ in $L^1(\Omega;|x|^{-b})$, $g(u_{l,\delta}) - g(u_{l',\delta}) \to g(u_{l}) - g(u_{l'})$ in $L^1(\Omega;|x|^{\tau_+})$ as $\delta \to 0$ and for any $l>0$, \bal \int_{\Omega \setminus \{0\}}|x|^{\tau_+}\nu_{i,l,\delta}dx \to \int_{\Omega \setminus \{0\}}|x|^{\tau_+}d\nu_{i,l} \quad \text{as } \delta \to 0. \eal Therefore, by letting $\delta \to 0$ in \eqref{ulsol-aa}, we find \ba \label{ulsol-ab} \| u_l - u_{l'} \|_{L^1(\Omega;|x|^{-b})} \leq C( \| \nu_{1,l}- \nu_{1,l'}\|_{\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega \setminus \{0\};|x|^{\tau_+})} + \|\nu_{2,l}-\nu_{2,l'} \|_{\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega \setminus \{0\};|x|^{\tau_+})}). \ea Since $\nu_{i,l} \uparrow \nu_{i}$ as $l \to \infty$, we infer from \eqref{ulsol-ab} that $\{u_l\}_{l \in {\mathbb N}}$ is a Cauchy sequence in $L^1(\Omega;|x|^{-b})$. Therefore there exists $u \in L^1(\Omega;|x|^{-b})$ such that $u_l \to u$ a.e. in $\Omega \setminus \{0\}$ and in $L^1(\Omega;|x|^{-b})$. Since $g \in C({\mathbb R}) \cap L^\infty({\mathbb R})$, by the dominated convergence theorem, we deduce that $g(u_l) \to g(u)$ a.e. in $\Omega \setminus \{0\}$ and in $L^1(\Omega;|x|^{\tau_+})$. Thus by letting $l \to \infty$ in \eqref{ulsol-a}, we derive that $u$ is a weak solution of \eqref{prob:gu}. By a similar argument, we can show that $\{u_{i,l}\}_{l \in {\mathbb N}}$ and $\{v_{i,l}\}_{l \in {\mathbb N}}$ converge to $u_{i}$ and $v_i$ in $L^1(\Omega;|x|^{-b})$ respectively as $l \to \infty$ and $\{g(u_{i,l})\}_{l \in {\mathbb N}}$ converges to $g(u_i)$, $i=1,2$, in $L^1(\Omega;|x|^{\tau_+})$ as $l \to \infty$. Moreover, $u_1,u_2,v_i$ are solutions of problems \eqref{prob:gu1}, \eqref{prob:gu2} and \eqref{linear-vi}. Estimate \eqref{order-1} follows from \eqref{u12lvl}. \medskip \noindent {\sc Uniqueness.} The uniqueness for problem \eqref{linear-vi} was established in Theorem \ref{existence2}. The uniqueness for problems \eqref{prob:gu}--\eqref{prob:gu2} follows from Kato's inequality \eqref{Kato:+-1} and the monotonicity of $g$. \end{proof} \begin{lemma} \label{subcrcon} Assume \ba \label{subcd0} \int_1^\infty t^{-q-1}(\ln t)^{m} (g(t)-g(-t)) dt<\infty \ea for $q,m \in {\mathbb R}$, $q >0$ and $m \geq 0$. Let $v$ be a function defined in $\Omega \setminus \Sigma$. For $t>0$ and $G \subseteq \Omega \setminus \{0\}$, set \bal E_{G}(t):=\{x\in \Omega\setminus \{0\}:| v(x)|>t\} \quad \text{and} \quad e_{G}(t):=\int_{E_{G}(t)} |x|^{\tau_+} dx. \eal Assume that there exists a positive constant $C_0$ such that \ba \label{e} e_{G}(t) \leq C_0t^{-q}(\ln s)^m, \quad \forall t>e^\frac{2 m}{q}. \ea Then for any $t_0>e^\frac{2 m}{q},$ there holds \ba\label{53} \int_{G}g(|v|)|x|^{\tau_+}dx &\leq g(t_0)\int_{G} |x|^{\tau_+} dx+ C_0 q\int_{t_0}^\infty t^{-q-1}(\ln t)^{m} g(t) dt, \\ \label{53-a} -\int_{G}g(-|v|)|x|^{\tau_+}dx&\leq - g(-t_0)\int_{G} |x|^{\tau_+} dx-C_0 q\int_{t_0}^\infty t^{-q-1}(\ln t)^{m} g(-t) dt. \ea \end{lemma} \begin{proof}[\textbf{Proof}] We note that $g(|v|) \geq g(0)=0$. Let $G \subseteq \Omega \setminus \{0\}$ and $t_0>1$ to be determined later on. Using the fact that $g$ is nondecreasing, we obtain \bal \begin{aligned} \int_{G} g(|v|) |x|^{\tau_+} dx &\leq \int_{G \setminus E_{t_0}(v)} g(|v|)|x|^{\tau_+} dx + \int_{E_{t_0}(v)} g(|v|)|x|^{\tau_+} dx \\ &\leq g(t_0)e(t) -\int_{t_0}^{\infty}g(t) de(t). \end{aligned} \eal From \eqref{subcd0}, we deduce that there exists an increasing sequence $\{T_n\}$ such that \ba \label{Tn} \lim_{T_n \to \infty}T_n^{-q}(\ln T_n)^m g(T_n) = 0. \ea For $T_n > t_0$, we have \bal \begin{aligned} -\int_{t_0}^{T_n}g(t)de(t) &= -g(T_n)e(T_n) + g(t_0)e(t_0) + \int_{t_0}^{T_n} e(t) dg(t) \\ &\leq -g(T_n)e(T_n) + g(t_0)e(t_0)+C_0\int_{t_0}^{T_n}t^{-q}(\ln t)^m dg(t)\\ &\leq (CT_n^{-q}(\ln T_n)^m - e(T_n))g(T_n) - C_0\int_{t_0}^{T_n} (t^{-q}(\ln t)^m)' g(t) dt. \end{aligned} \eal Here in the last estimate, we have used \eqref{e}. Note that if we choose $t_0>e^{\frac{2 m}{q}}$ then \ba \label{deriv} -q t^{-q-1}(\ln t)^m < (t^{-q}(\ln t)^m)' < -\frac{q}{2}t^{-q-1}(\ln t)^m \quad \forall t \geq t_0. \ea Combining \eqref{Tn}--\eqref{deriv} and then letting $n \to \infty$, we obtain \bal -\int_{t_0}^{\infty}g(t) de(t) < C_0q \int_{t_0}^{\infty} t^{-q-1}(\ln t)^m g(t) dt. \eal Thus we have proved estimate \eqref{53}. By applying estimate \eqref{53} with $g$ replaced by $\tilde g(t)=-g(-t)$, we obtain \eqref{53-a}. \end{proof} \begin{lemma} \label{lem:equi} Assume that $\{g_n\}_{n \in {\mathbb N}}$ is a sequence of nondecreasing continuous functions vanishing at $0$ such that \ba \label{gk} \begin{aligned} &g_n(t) - g_n(-t) \leq C_1(t), \quad \forall t \geq 1, \, \forall n \in {\mathbb N}, \\ &\int_{1}^\infty (g_n(t)-g_n(-t))t^{-q-1}dt < C_2, \quad \forall n \in {\mathbb N}, \end{aligned} \ea for some $q>1$ and positive constants $C_1,C_2$ independent of $n$. Let $\{v_n\}_{n \in {\mathbb N}}$ be a uniformly bounded in $L_w^q(\Omega;|x|^{\tau_+})$. Then the sequence $\{g_n(v_n)\}_{n \in {\mathbb N}}$ is uniformly bounded and equi-integrable in $L^1(\Omega;|x|^{\tau_+})$. \end{lemma} \begin{proof}[\textbf{Proof}] By the assumption, there exists a positive constant $C$ such that \bal \| v_n \|_{L_w^q(\Omega \setminus \{0\};|x|^{\tau_+})} \leq C, \quad \forall n \in {\mathbb N}, \eal which implies that \bal \int_{ \{x \in \Omega \setminus \{0\}: |v_n(x)|> t \} }|x|^{\tau_+}dx \leq t^{-q}\| v_n \|_{L_w^q(\Omega \setminus \{0\};|x|^{\tau_+})} \leq Ct^{-q}, \quad \forall t>0. \eal Take arbitrarily $t_0 \geq 1$ and $G \subseteq \Omega \setminus \{0\}$. By Lemma \ref{subcrcon}, we obtain \ba \label{uni-equi} \begin{aligned} \int_{G} |g_n(v_n)||x|^{\tau_+}dx &\leq \int_{\Omega \setminus \{0\}} (g_n(|v_n|)-g_n(-|v_n|))|x|^{\tau_+}dx \\ & \leq (g_n(t_0)-g_n(-t_0))\int_{G} |x|^{\tau_+} dx+ Cq\int_{t_0}^\infty t^{-q-1}(g_n(t)-g_n(-t)) dt \\ &\leq C(N,\Omega,s,\mu,q,C_1(t_0),C_2). \end{aligned} \ea Here in the last estimate we have used the assumption \eqref{gk}. Therefore, by taking $t_0=1$ and $G=\Omega \setminus \{0\}$ in \eqref{uni-equi}, we derive that $\{g_n(v_n)\}$ is uniformly bounded in $L^1(\Omega;|x|^{\tau_+})$. From \eqref{uni-equi}, we can also deduce that $\{g_n(v_n)\}$ is equi-integrable in $L^1(\Omega;|x|^{\tau_+})$. \end{proof} \begin{proof}[\textbf{Proof of Theorem \ref{existence-semi-1}}] Set $g_n:=\max\{-n,\min\{g,n\}\}$ with $n\in{\mathbb N}$ and let $\{\zeta_{\delta}\}_{\delta>0}$ be the sequence of standard mollifiers. Let $r_0>0$ small such that $B_{4r_0}(0)\subset\Omega$. For $\delta< \frac{1}{8}r <\frac{1}{8} r_0$, put \bal \nu_{r,\delta}=\zeta_{\delta} \ast (\textbf{1}_{\Omega\setminus B_r(0)}\nu) , \quad \nu_{1,r,\delta}=\nu_{r,\delta}^+, \quad \nu_{2,r,\delta}=\nu_{r,\delta}^-. \eal Then $\{ \nu_{r,\delta}\}$, $\{ \nu_{1,r,\delta}\}$, {\color{blue}$\{ \nu_{2,r, \delta}\}$} converge weakly to $\textbf{1}_{\Omega\setminus B_r(0)}\nu$, $\textbf{1}_{\Omega\setminus B_r(0)}\nu^+$, $\textbf{1}_{\Omega\setminus B_r(0)}\nu^-$ in $\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega\setminus \{0\};|x|^{\tau_+})$ respectively. By Theorem \ref{existence4}, there exist weak solutions $u_{r,\delta,n}$, $u_{1,r,\delta,n}$, $u_{2,r,\delta,n}$, $v_{1,r,\delta}$, $v_{2,r,\delta}$ of the following problems respectively \bal \left\{ \begin{aligned} \CL_\mu^s u+g_n(u)&=\nu_{r,\delta}&&\quad\text{in}\;\Omega,\\ u & = 0 &&\quad\text{in}\;\BBR^N\setminus\Omega, \end{aligned} \right. \eal \ba \label{gknu1e+} \left\{ \begin{aligned} \CL_\mu^s u +g_n(u)&=\nu_{1,r,\delta}&&\quad\text{in}\;\Omega,\\ u&=0&&\quad\text{in}\;\BBR^N\setminus\Omega, \end{aligned} \right. \ea \ba \label{gknu2e+} \left\{ \begin{aligned} \CL_\mu^s u -g_n(-u)&=\nu_{2,r,\delta}&&\quad\text{in}\;\Omega,\\ u & = 0 &&\quad\text{in}\;\BBR^N\setminus\Omega, \end{aligned} \right. \ea and \bal \left\{ \begin{aligned} \CL_\mu^s v &=\nu_{i,r,\delta}&&\quad\text{in}\;\Omega,\\ v & = 0 &&\quad\text{in}\;\BBR^N\setminus\Omega. \end{aligned} \right. \eal Moreover, for any $b<2s-\tau_+$, $u_{r,\delta,n}$, $u_{1,r,\delta,n}$, $u_{2,r,\delta,n}$, $v_{1,r,\delta}$, $v_{2,r,\delta} \in L^1(\Omega;|x|^{-b})$. We also have $u_{i,r,\delta,n} \geq 0$, $v_{i,r,\delta} \geq 0$ and \ba \label{order-2} -v_{2,r,\delta}\leq-u_{2,r,\delta,n}\leq u_{r,\delta,n}\leq u_{1,r,\delta,n}\leq v_{1,r,\delta}. \ea Moreover, since $g_n$ is nondecreasing with $g_n(0)=0$, we deduce that $\{u_{i,r,\delta,n}\}$, $i=1,2$, is nonincreasing with respect to $n$. Therefore, there exist positive functions $u_{i,r,\delta}$, $i=1,2$, such that $u_{i,r,\delta,n} \downarrow u_{i,r,\delta}$ a.e. in $\Omega \setminus \{0\}$ and in $L^1(\Omega;|x|^{-b})$ as $n \to +\infty$ for any $b<2s-\tau_+$. Using Dini's lemma with respect to the sequence $\{g_n\}_{n \in {\mathbb N}}$ in compact sets of $(0,+\infty)$, we deduce that $g_n(u_{i,r,\delta,n}) \to g(u_{i,r,\delta})$ a.e. in $\Omega $ as $n \to +\infty$. Since $0 \leq u_{i,r,\delta,n} \leq v_{i,r,\delta} \in L_w^{\frac{N}{N-2s}}(\Omega \setminus \{0\};|x|^{\tau_+})$ (due to Proposition \ref{Marcin-3}), it follows that $\{u_{i,r,\delta,n} \}$ is uniform bounded in $L_w^{\frac{N}{N-2s}}(\Omega \setminus \{0\};|x|^{\tau_+})$ with respect to $n$. From Lemma \ref{lem:equi}, we infer that the sequences $\{g_n(u_{i,r,\delta,n})\}_{n \in {\mathbb N}}$, $i=1,2$, are uniformly bounded and equi-integrable in $L^1(\Omega;|x|^{\tau_+})$ with respect to $n$. By Vitali's convergence theorem, $g_n(u_{i,r,\delta,n}) \to g(u_{i,r,\delta})$ in $L^1(\Omega;|x|^{\tau_+})$ as $n \to +\infty$. By letting $n \to +\infty$ in the weak formulation for problem \eqref{gknu1e+} and \eqref{gknu2e+}, we derive that $u_{1,r,\delta}$ and $u_{2,r,\delta}$ are respectively weak solutions to the problems \ba \label{gknu1e} \left\{ \begin{aligned} \CL_\mu^s u +g(u)&=\nu_{1,r,\delta}&&\quad\text{in}\;\Omega,\\ u&=0&&\quad\text{in}\;\BBR^N\setminus\Omega, \end{aligned} \right. \ea \ba \label{gknu2e} \left\{ \begin{aligned} \CL_\mu^s u -g(-u)&=\nu_{2,r,\delta}&&\quad\text{in}\;\Omega,\\ u & = 0 &&\quad\text{in}\;\BBR^N\setminus\Omega. \end{aligned} \right. \ea From \eqref{order-2}, we deduce that \ba \label{urkebound-1} \begin{aligned} |u_{r,\delta,n}| &\leq u_{1,r,\delta,n} + u_{2,r,\delta,n} \leq v_{1,r,\delta} + v_{2,r,\delta}, \\ |g_n(u_{r,\delta,n})| &\leq g_n(u_{1,r,\delta,n}) - g_n(-u_{2,r,\delta,n}), \end{aligned} \ea which in turn implies that $\{u_{r,\delta,n}\}_{n \in {\mathbb N}}$ is uniformly bounded in $L^1(\Omega;|x|^{-b})$ for any $b<2s-\tau_+$, as well as $\{g_n(u_{i,r,\delta,n})\}_{n \in {\mathbb N}}$ is uniformly bounded in $L^1(\Omega;|x|^{\tau_+})$. By using a similar argument as in the proof of Theorem \ref{existence4}, we derive that $\{u_{r,\delta,n}\}$ converges to a function $u_{r,\delta}$ a.e. in $\Omega \setminus \{0\}$ and in $L^1(\Omega;|x|^{-b})$ as $n \to +\infty$. We note that $g_n^+ =\min\{g^+,n\}$ and $g_n^- = \min\{g^-,n\}$, hence $\{g_n^+\}$ and $\{g_n^-\}$ are nondecreasing sequences of bounded continuous nonnegative functions and $g_n^{\pm} \uparrow g^{\pm}$ as $n \to \infty$. Using Dini's lemma with respect to $\{g_n^\pm\}$ in compact sets of $(0,+\infty)$, we deduce that $g_n^{\pm}(u_{r,\delta,n}) \to g^{\pm}(u_{r,\delta})$ a.e. in $\Omega \setminus \{0\}$ as $n \to +\infty$, consequently, $g_n(u_{r,\delta,n}) \to g(u_{r,\delta})$ a.e. in $\Omega$. By \eqref{urkebound-1} and the generalized dominated convergence theorem, we deduce that $g_n(u_{r,\delta,n}) \to g(u_{r,\delta})$ in $L^1(\Omega;|x|^{\tau_+})$ as $n \to +\infty$. Passing to the limit, we deduce that $u_{r,\delta}$ is a weak solution of \ba \label{gknue} \left\{ \begin{aligned} \CL_\mu^s u+g(u)&=\nu_{r,\delta}&&\quad\text{in}\;\Omega,\\ u & = 0 &&\quad\text{in}\;\BBR^N\setminus\Omega. \end{aligned} \right. \ea From \eqref{order-2} and \eqref{urkebound-1}, we deduce that $u_{i,r,\delta} \geq 0$ and \bal \begin{aligned} &-v_{2,r,\delta}\leq-u_{2,r,\delta}\leq u_{r,\delta}\leq u_{1,r,\delta}\leq v_{1,r,\delta}, \\ &|u_{r,\delta}| \leq u_{1,r,\delta} + u_{2,r,\delta} \leq v_{1,r,\delta} + v_{2,r,\delta}, \\ &|g(u_{r,\delta})| \leq g(u_{1,r,\delta}) - g(-u_{2,r,\delta}). \end{aligned} \eal By Theorem \ref{existence2}, for any $b<2s-\tau_+$, we have \bal \| v_{i,r,\delta} \|_{L^1(\Omega;|x|^{-b})} &\leq C(N,\Omega,s,\mu,b)\| \nu_{i,r,\delta} \|_{L^1(\Omega;|x|^{\tau_+} )} \leq C(N,\Omega,s,\mu,b,r) \| \nu_{i,r} \|_{\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega \setminus \{0\};|x|^{\tau_+} )}. \eal Therefore \ba \label{apriori-2} \| u_{r,\delta} \|_{L^1(\Omega;|x|^{-b})} + \sum_{i=1,2}\| u_{i,r,\delta} \|_{L^1(\Omega;|x|^{-b})} \leq C(N,\Omega,s,\mu,b,r) \| \nu_{i,r} \|_{\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega \setminus \{0\};|x|^{\tau_+} )}. \ea As above, we can show that the sequences $\{g(u_{r,\delta})\}_{\delta}$, $\{g(u_{i,r,\delta})\}_{\delta}$, $i=1,2$, are uniformly bounded and equi-integrable in $L^1(\Omega;|x|^{\tau_+})$ with respect to $\delta$. Again, by a similar argument as in the proof of Theorem \ref{existence4}, we deduce that there exist functions $u_r$, $u_{1,r}$, $u_{2,r} $ such that $\{u_{r,\delta}\}_{\delta>0}$, $\{u_{1,r,\delta}\}_{\delta>0}$, $\{u_{2,r,\delta}\}_{\delta>0}$ converge to $u_r$, $u_{1,r}$ and $u_{2,r}$ a.e. in $\Omega \setminus \{0\}$ and in $L^1(\Omega;|x|^{-b})$ for any $b<2s-\tau_+$ respectively as $\delta \to 0$. This implies that $\{g(u_{r,\delta})\}_{\delta>0}$, $\{g(u_{1,r,\delta})\}_{\delta>0}$, $\{g(u_{2,r,\delta})\}_{\delta>0}$ converge to $g(u_r)$, $g(u_{1,r})$ and $g(u_{2,r})$ a.e. in $\Omega \setminus \{0\}$ as $\delta \to 0$ respectively. Employing an analogous argument as above, we can show that $\{g(u_{2,r,\delta})\}_{\delta>0}$ converge to $g(u_r)$, $g(u_{1,r})$ and $g(u_{2,r})$ in $L^1(\Omega;|x|^{\tau_+})$ as $\delta \to 0$. By passing to the limit in the weak formulation for problems \eqref{gknue}, \eqref{gknu1e}, \eqref{gknu2e}, we deduce that $u_r$, $u_{1,r}$, $u_{2,r}$ are respectively weak solutions to the following problems \bal \left\{ \begin{aligned} \CL_\mu^s u+g(u)&=\nu_{r}&&\quad\text{in}\;\Omega,\\ u & = 0 &&\quad\text{in}\;\BBR^N\setminus\Omega, \end{aligned} \right. \eal \bal \left\{ \begin{aligned} \CL_\mu^s u+g(u)&=\nu_{1,r}&&\quad\text{in}\;\Omega,\\ u & = 0 &&\quad\text{in}\;\BBR^N\setminus\Omega, \end{aligned} \right. \eal \bal \left\{ \begin{aligned} \CL_\mu^s u+g(u)&=\nu_{2,r}&&\quad\text{in}\;\Omega,\\ u & = 0 &&\quad\text{in}\;\BBR^N\setminus\Omega. \end{aligned} \right. \eal Proceeding as in {\it Step 2} of the proof of Theorem \ref{existence4}, we can show that there exist functions $u,u_i,v_i $, $i=1,2$, such that $\{u_r\}$, {\color{blue}$\{u_{i,r}\}$, $\{v_{i,r}\}$} converge to $u$, $u_i$, $v_i$, $i=1,2$. Moreover, $u$, $u_1$, $u_2$, $v_i$ are the unique weak solutions to problems \eqref{prob:gu}, \eqref{prob:gu1}, \eqref{prob:gu2}, \eqref{linear-vi} respectively. Finally, estimate \eqref{apriori-1} follows from \eqref{apriori-2} by letting $\delta \to 0$ and $r \to 0$ successively. \end{proof} \section{Semilinear problem with Dirac measures concentrated at $0$} Let $\ell \in\BBR$ and $\Omega'$ be an open bounded domain such that $\Omega\Subset\Omega'$ and $\varepsilon\leq \frac{d(0)}{16}.$ Set $H(x):= \ell \Phi_{s,\mu}^\Omega(x)|x|^{-\tau_+}$ for $x \neq 0$, where $\Phi_{s,\mu}^{\Omega}$ is given in \eqref{PhiOmega}. Inspired by \cite{KKP2}, we will prove the existence using the respective monotone operator. Set $\Omega_\varepsilon'=\Omega'\setminus B_{\varepsilon}(0)$ and $\Omega_\varepsilon=\Omega\setminus B_{\varepsilon}(0).$ For any $u,v\in H^s(\Omega_{\frac{\varepsilon}{2}}'),$ we define the operators \bal \mathcal{A}_1u(v):=\frac{C_{N,s}}{2}\int_{\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_{\frac{\varepsilon}{2}}'}\frac{(u(x)-u(y))(v(x)-v(y))}{|x-y|^{N+2s}}|y|^{\tau_+} dy |x|^{\tau_+} dx \eal and \bal \mathcal{A}_2u(v)&:=C_{N,s}\int_{\BBR^N\setminus\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_\varepsilon}\frac{(u(y)-H(x))v(y)}{|x-y|^{N+2s}}|y|^{\tau_+} dy |x|^{\tau_+} dx+\int_{\Omega_\varepsilon} g(|x|^{\tau_+} u)v|x|^{\tau_+} dx, \eal where $g\in C(\BBR)\cap L^\infty(\Omega)$ is a nondecreasing function such that $g(0)=0.$ We set \ba \label{AA1A2} \mathcal{A}u(v):=\mathcal{A}_1u(v)+\mathcal{A}_2u(v)\quad \text{for } u,v\in H^s(\Omega_{\frac{\varepsilon}{2}}'). \ea Finally, set $M=\sup_{t\in\BBR}|g(t)|$. \begin{lemma} \label{dual} Let $u\in H^s(\Omega_{\frac{\varepsilon}{2}}'),$ then $\mathcal{A}u\in (H^s(\Omega_{\frac{\varepsilon}{2}}'))^*.$ \end{lemma} \begin{proof}[\textbf{Proof}] Let $v\in H^s(\Omega_{\frac{\varepsilon}{2}}'),$ then using the H\"{older} inequality, we can easily show that \bal |\mathcal{A}_1u(v)|\leq C(N,s,\Omega',\varepsilon)\norm{u}_{H^s(\Omega_{\frac{\varepsilon}{2}}')}\norm{v}_{H^s(\Omega_{\frac{\varepsilon}{2}}')}. \eal By the H\"{o}lder inequality and the definition of $H$, we have \bal &\quad \bigg|\int_{\BBR^N\setminus\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_\varepsilon}\frac{(u(y)-H(x))v(y)}{|x-y|^{n+2s}}|y|^{\tau_+} dy |x|^{\tau_+} dx\bigg|\\ &\leq C(\Omega,\Omega',\varepsilon,N,s)\bigg(\norm{u}_{H^s(\Omega_{\frac{\varepsilon}{2}}')} +\int_{\BBR^N\setminus B_{d(0)}(0)}\frac{H(x)|x|^{\tau_+}}{1+|x|^{N+2s}}\bigg)\norm{v}_{H^s(\Omega_{\frac{\varepsilon}{2}}')} \\ &\leq C(\Omega,\Omega',\varepsilon,N,s,\ell)(\norm{u}_{H^s(\Omega_{\frac{\varepsilon}{2}}')} +1)\norm{v}_{H^s(\Omega_{\frac{\varepsilon}{2}}')}. \eal Again, by the H\"older inequality, we also obtain \bal \bigg|\int_{\Omega_\varepsilon} g(|x|^{\tau_+} u)v|x|^{\tau_+} dx\bigg|\leq C(\Omega,M,\varepsilon) \norm{v}_{H^s(\Omega_{\frac{\varepsilon}{2}}')}. \eal From the above preceding estimates and \eqref{AA1A2}, we obtain \bal |\mathcal{A}u(v)|\leq C(N,s,\Omega,\Omega',\varepsilon,\ell,M,\norm{u}_{H^s(\Omega_{\frac{\varepsilon}{2}}')})\norm{v}_{H^s(\Omega_{\frac{\varepsilon}{2}}')}, \eal which implies the desired result. \end{proof} Set \ba \label{Ke} \mathcal{K}_{\varepsilon}&:=\big\{v\in H^s(\Omega_{\frac{\varepsilon}{2}}'):\;v=H \text{ a.e. in }\;\BBR^N\setminus \Omega_{\varepsilon} \big\}. \ea We note that $\mathcal{K}_{\varepsilon}$ is not empty since $H\in \mathcal{K}_{\varepsilon}$ convex and closed. \begin{lemma}\label{monotone} The operator $\mathcal{A}$ is monotone, coercive and weakly continuous on the set $\mathcal{K}_\varepsilon.$ \end{lemma} \begin{proof}[\textbf{Proof}] We split the proof into three steps. \medskip \noindent \textbf{Step 1.} \emph{We claim that the operator $\mathcal{A}$ is monotone on the set $\mathcal{K}_\varepsilon$}, namely \ba \label{Amonotone} \mathcal{A}u(u-v)-\mathcal{A}v(u-v)\geq 0, \quad\forall u,v\in \mathcal{K}_\varepsilon. \ea Indeed, we have \ba\label{15+}\begin{aligned} \mathcal{A}_1u(u-v)&-\mathcal{A}_1v(u-v)= \frac{C_{N,s}}{2}\int_{\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_{\frac{\varepsilon}{2}}'}\frac{|u(x)-v(x)-(u(y)-v(y))|^2}{|x-y|^{N+2s}}|y|^{\tau_+} dy |x|^{\tau_+} dx \geq 0 \end{aligned} \ea and \ba\label{16}\begin{aligned} \mathcal{A}_2u(u-v)-\mathcal{A}_2v(u-v)&=C_{N,s}\int_{\BBR^N\setminus\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_\varepsilon}\frac{|u(y)-v(y)|^2}{|x-y|^{N+2s}}|y|^{\tau_+} dy |x|^{\tau_+} dx\\ &\quad +\int_{\Omega_\varepsilon} (g(|x|^{\tau_+} u)-g(|x|^{\tau_+} v))(u-v)|x|^{\tau_+} dx\\ &\geq C_{N,s}\int_{\BBR^N\setminus\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_\varepsilon}\frac{|u(y)-v(y)|^2}{|x-y|^{N+2s}}|y|^{\tau_+} dy |x|^{\tau_+} dx \geq 0, \end{aligned} \ea since $g$ is nondecreasing. Combining \eqref{15+} and \eqref{16} leads to \eqref{Amonotone}. \medskip \noindent \textbf{Step 2.} \emph{We claim that the operator $\mathcal{A}$ is coercive on the set $\mathcal{K}_\varepsilon$}, namely, there exists $v\in \mathcal{K}_\varepsilon$ such that \bal \frac{\mathcal{A}u_j(u_j-v)-\mathcal{A}v(u_j-v)}{\norm{u_j-v}_{H^s(\Omega_{\frac{\varepsilon}{2}}')}}\to +\infty\quad \text{as}\;\;\norm{u_j-v}_{H^s(\Omega_{\frac{\varepsilon}{2}}')}\to +\infty. \eal We fix a function $v\in \mathcal{K}_\varepsilon.$ In view of the proof of \eqref{15+} and \eqref{16}, we have \bal \mathcal{A}u_j(u_j-v)-\mathcal{A}v(u_j-v)&\geq \frac{C_{N,s}}{2}\int_{\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_{\frac{\varepsilon}{2}}'}\frac{|u_j(x)-v(x)+v(y)-u_j(y)|^2}{|x-y|^{n+2s}}|y|^{\tau_+} dy |x|^{\tau_+} dx\\ &\geq C(N,s,\Omega,\Omega',\varepsilon)\norm{u_j-v}_{H^s(\Omega_{\frac{\varepsilon}{2}}')}^2, \eal where in the last inequality we have used the standard fractional Sobolev embedding since $u_j-v\in W^{s,2}_0(\Omega_{\frac{\varepsilon}{2}}')$. \medskip \noindent \textbf{Step 3.} \emph{We claim that the operator $\mathcal{A}$ is weakly continuous on the set $\mathcal{K}_\varepsilon$}. To this purpose, we need to show that if $\{u_j\}_{j=1}^\infty\subset\mathcal{K}_\varepsilon$ such that $u_j\to u\in\mathcal{K}_\varepsilon $ in $H^s(\Omega_{\frac{\varepsilon}{2}}')$ then $\mathcal{A}u_j(v)-\mathcal{A}u(v)\to 0$ for any $v\in H^s(\Omega_{\frac{\varepsilon}{2}}').$ First we note that, for any $v\in H^s(\Omega_{\frac{\varepsilon}{2}}')$, \ba\label{15}\begin{aligned} &\quad |\mathcal{A}_1u_j(v)-\mathcal{A}_1u(v)|\\ &\leq \frac{C_{N,s}}{2}\int_{\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_{\frac{\varepsilon}{2}}'}\frac{|u_j(x)-u(x)-(u_j(y)-u(y))||v(x)-v(y)|}{|x-y|^{N+2s}}|y|^{\tau_+} dy |x|^{\tau_+} dx \\ &\leq \frac{C_{N,s}}{2} \| u_j-u \|_{H^s(\Omega'_{\frac{\varepsilon}{2}})} \| v \|_{H^s(\Omega'_{\frac{\varepsilon}{2}})} \to 0 \quad \text{as } j \to +\infty. \end{aligned} \ea Next we have \bal \begin{aligned} |\mathcal{A}_2u_j (v) - \mathcal{A}_2 u(v)| &\leq C_{N,s}\int_{\BBR^N\setminus\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_\varepsilon}\frac{|u_j(y)-u(y)||v(y)|}{|x-y|^{N+2s}}|y|^{\tau_+} dy |x|^{\tau_+} dx\\ &\quad +\int_{\Omega_\varepsilon} (g(|x|^{\tau_+} u_j(x))-g(|x|^{\tau_+} u(x)))v(x)|x|^{\tau_+} dx. \end{aligned} \eal Since $u_j\to u\in\mathcal{K}_\varepsilon $ in $H^s(\Omega_{\frac{\varepsilon}{2}}'),$ we have that $u_j\to u$ in $L^2(\Omega_\varepsilon).$ By the H\"older inequality and the estimate (due to the fact $\frac{2s-N}{2} \leq \tau_+ <2s<N$) \bal \int_{\BBR^N\setminus\Omega_{\frac{\varepsilon}{2}}'} \frac{|x|^{\tau_+}}{|x-y|^{N+2s}}dx < C(N,\Omega,\Omega',s,\mu,\varepsilon), \quad \forall y \in \Omega_{\varepsilon}, \eal we deduce that \bal \begin{aligned} &\quad \int_{\BBR^N\setminus\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_\varepsilon}\frac{|u_j(y)-u(y)||v(y)|}{|x-y|^{N+2s}}|y|^{\tau_+} dy |x|^{\tau_+} dx \\ &\leq C(s,\mu,\varepsilon)\int_{\Omega_\varepsilon}|u_j(y)-u(y)||v(y)| \int_{\BBR^N\setminus\Omega_{\frac{\varepsilon}{2}}'} \frac{|x|^{\tau_+}}{|x-y|^{N+2s}}dx dy \\ &\leq C(N,\Omega,\Omega',s,\mu,\varepsilon)\|u_j-u \|_{L^2(\Omega_{\varepsilon})}\|v \|_{L^2(\Omega_{\varepsilon})} \to 0 \quad \text{as } j \to \infty. \end{aligned} \eal Since $g$ is bounded and uniformly continuous in $\BBR,$ $\varepsilon<|x|<\mathrm{diam}(\Omega)$ for any $x \in \Omega_\varepsilon$ and $u_\varepsilon\to u$ in measure in $\Omega_\varepsilon,$ we may deduce that \bal \int_{\Omega_\varepsilon} |g(|x|^{\tau_+} u_j)-g(|x|^{\tau_+} u)|^2dx\to 0 \quad \text{as } j \to +\infty. \eal Therefore, by the H\"older inequality, we obtain \ba \label{17-b} \begin{aligned} &\quad \bigg|\int_{\Omega_\varepsilon} (g(|x|^{\tau_+} u_j)-g(|x|^{\tau_+} u))v|x|^{\tau_+} dx\bigg|\\ &\leq C(s,\mu,\varepsilon,\Omega)\left(\int_{\Omega_\varepsilon} |g(|x|^{\tau_+} u_j)-g(|x|^{\tau_+} u)|^2dx\right)^{\frac{1}{2}}\norm{v}_{L^2(\Omega_\varepsilon)} \to 0 \quad \text{as } j \to +\infty. \end{aligned} \ea Combining \eqref{15}--\eqref{17-b}, we conclude that $\mathcal{A}u_j(v)-\mathcal{A}u(v)\to 0$ as $j \to +\infty$. The proof is complete. \end{proof} \begin{lemma}\label{aproxsol} Assume $\ell>0$ and $g\in C(\BBR)\cap L^\infty(\Omega)$ is a nondecreasing function such that $g(0)=0$. There exists a function $u_\varepsilon\in W^{s,2}(\Omega_{\frac{\varepsilon}{2}}')$ such that $u_{\varepsilon}=\ell \Phi_{s,\mu}^\Omega$ in $\BBR^N\setminus \Omega_\varepsilon$ and \ba \label{aprox-1} \frac{C_{N,s}}{2}\int_{\BBR^N}\int_{\BBR^N}\frac{(u_\varepsilon(x)-u_\varepsilon(y))(\phi(x)-\phi(y))}{|x-y|^{N+2s}}dy dx+\mu\int_{\Omega_\varepsilon}\frac{u_\varepsilon(x)\phi(x)}{|x|^{2s}}dx +\int_{\Omega_\varepsilon} g(u_\varepsilon)\phi dx=0 \ea for all $\phi\in C_0^\infty(\Omega_{\varepsilon})$. Furthermore there holds \ba \label{uplow-1} (\ell \Phi_{s,\mu}^\Omega-\psi_M)^+\leq u_{\varepsilon} \leq \ell \Phi_{s,\mu}^\Omega \quad \text{in } {\color{blue}\Omega_{\varepsilon}}, \ea where $M=\sup_{t\in\BBR}|g(t)|$, $\psi_M$ is the nonnegative weak solution of \ba \label{psiM} \left\{ \begin{aligned} \CL_\mu^s \psi&=M&&\quad\text{in}\;\, \Omega,\\ u&=0&&\quad\text{in}\;\, \BBR^N\setminus\Omega. \end{aligned} \right. \ea \end{lemma} \begin{proof}[\textbf{Proof}] By Lemma \ref{monotone} and the standard theory of monotone operators (see, e.g., \cite[Proposition 17.2]{HKM}), there exists $v_\varepsilon\in \mathcal{K}_\varepsilon$ such that \bal \mathcal{A}v_\varepsilon(\zeta-v_\varepsilon)\geq0, \eal for any $\zeta\in \mathcal{K}_\varepsilon.$ Set $\zeta_\pm=\pm\tilde\phi+v_\varepsilon$ for $\tilde\phi\in C_0^\infty(\Omega_\varepsilon),$ then $\zeta_\pm\in \mathcal{K}_\varepsilon$ and by the above inequality we can easily show that \ba \label{aprox-2} \begin{aligned} 0&=\mathcal{A}v_\varepsilon(\tilde\phi) \\ &=\frac{C_{N,s}}{2}\int_{\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_{\frac{\varepsilon}{2}}'}\frac{(v_\varepsilon(x)-v_\varepsilon(y))(\tilde\phi(x)-\tilde\phi(y))}{|x-y|^{N+2s}}|y|^{\tau_+} dy|x|^{\tau_+} dx\\ &\quad +C_{N,s}\int_{\BBR^N\setminus\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_\varepsilon}\frac{(v_\varepsilon(y)-H(x))\tilde\phi(y)}{|x-y|^{N+2s}}|y|^{\tau_+} dy |x|^{\tau_+} dx+\int_{\Omega_\varepsilon} g(|x|^{\tau_+(s,\xm)} v_\varepsilon)\tilde\phi|x|^{\tau_+} dx\\ &=\frac{C_{N,s}}{2}\int_{\BBR^N}\int_{\BBR^N}\frac{(v_\varepsilon(x)-v_\varepsilon(y))(\tilde\phi(x)-\tilde\phi(y))}{|x-y|^{N+2s}}|y|^{\tau_+} dy|x|^{\tau_+} dx+\int_{\Omega_\varepsilon} g(|x|^{\tau_+} v_\varepsilon)\tilde\phi|x|^{\tau_+} dx. \end{aligned} \ea Setting $u_\varepsilon=|x|^{\tau_+} v_\varepsilon$ and $\phi=|x|^{\tau_+}\tilde\phi,$ we obtain \eqref{aprox-1}. We have \ba \label{aprox-3} \begin{aligned} \langle H, \tilde \phi \rangle_{s,\tau_+} +\int_{\Omega_\varepsilon} g(|x|^{\tau_+} H)\tilde\phi|x|^{\tau_+} dx\geq 0, \quad \forall \; 0 \leq \tilde\phi\in C_0^\infty(\Omega_{\varepsilon}). \end{aligned} \ea Put $w_{\varepsilon}=v_{\varepsilon}-H$ then from \eqref{aprox-2} and \eqref{aprox-3}, we have \ba \label{aprox-4} \langle w_{\varepsilon}, \tilde \phi \rangle_{s,\tau_+} +\int_{\Omega_\varepsilon} (g(|x|^{\tau_+} v_{\varepsilon}) - g(|x|^{\tau_+} H))\tilde\phi|x|^{\tau_+} dx \leq 0, \quad \forall \; 0 \leq \tilde\phi\in C_0^\infty(\Omega_{\varepsilon}). \ea Note that $w_{\varepsilon}^+\in W^{s,2}(\Omega_{\frac{\varepsilon}{2}}')$ and $w_{\varepsilon}^+=0$ in $\BBR^N\setminus \Omega_\varepsilon.$ Since $\Omega_\varepsilon$ is smooth, we deduce that $w_{\varepsilon}^+\in W^{s,2}_0(\Omega_\varepsilon),$ hence we may use it as a test function in \eqref{aprox-4} and the standard density argument together with the monotonicity assumption on $g$ to obtain that \bal 0 \leq \langle w_{\varepsilon}, w_\varepsilon^+ \rangle_{s,\tau_+} +\int_{\Omega_\varepsilon} (g(|x|^{\tau_+} v_{\varepsilon}) - g(|x|^{\tau_+} H))w_{\varepsilon}^+|x|^{\tau_+} dx \leq 0. \eal This implies $w_{\varepsilon}^+=0$ a.e. in $\BBR^N \setminus \{0\}$, hence $v_\varepsilon\leq H$ a.e. in $\Omega_{\varepsilon}$. This implies the upper bound in \eqref{uplow-1}. As for the lower bound in \eqref{uplow-1}, by taking $\tilde \phi = v_{\varepsilon}^- \in W_0^{s,2}(\Omega_\varepsilon)$ in \eqref{aprox-2}, the standard density argument and the assumption that $g$ is nondecreasing and $g(0)=0$, we have \bal 0=\langle v_{\varepsilon}, v_{\varepsilon}^- \rangle_{s,\tau_+} +\int_{\Omega_\varepsilon} g(|x|^{\tau_+} v_\varepsilon)v_{\varepsilon}^-|x|^{\tau_+} dx \leq 0, \eal which implies $v_\varepsilon^-=0$ a.e. in ${\mathbb R}^N \setminus \{0\}$. Therefore $v_{\varepsilon} \geq 0$ in $\Omega_{\varepsilon}$, and hence $u_{\varepsilon} \geq 0$ a.e. in $\Omega_{\varepsilon}$. Since $\psi_M$ is the nonnegative solution of \eqref{psiM}, we have \bal \CL_\mu^s(\ell\Phi_{s,\mu}^\Omega-\psi_M)+g(\ell\Phi_{s,\mu}^\Omega-\psi_M) \leq 0 \eal in the sense of distribution in $\Omega_\varepsilon.$ By a similar argument as above, we may show that $u_\varepsilon\geq \ell\Phi_{s,\mu}^\Omega-\psi_M$ a.e. in $\Omega_{\varepsilon}$. Thus $u \geq (\ell\Phi_{s,\mu}^\Omega-\psi_M)^+$ a.e. in $\Omega_{\varepsilon}$. \end{proof} \begin{definition} \label{sol:semieq-Dirac} {\it Assume $\ell \in {\mathbb R}$ and $g: {\mathbb R} \to {\mathbb R}$ is a nondecreasing continuous function such that $g(0)=0$. A function $u$ is called a \textit{weak solution} to problem \ba \label{eq:g(u)-kdirac} \left\{\begin{aligned} \CL_\mu^s u+g(u)&=\ell \delta_0&&\quad\text{in}\;\,\Omega,\\ u&=0&&\quad\text{in}\;\,\BBR^N\setminus\Omega, \end{aligned} \right. \ea if for any $b<2s-\tau_+$, $u\in L^1(\Omega;|x|^{-b}),$ $g(u)\in L^1(\Omega;|x|^{\tau_+})$ and \ba \label{sol:g(u)-kdirac} \int_\Omega u(-\Delta)^s_{\tau_+}\psi dx+\int_\Omega g(u)\psi|x|^{\tau_+} dx=\ell\int_{\Omega}\Phi_{s,\mu}^\Omega (-\Delta)^s_{\tau_+}\psi dx,\quad\forall\psi\in \mathbf{X}_\mu(\Omega;|x|^{-b}), \ea where $\mathbf{X}_\mu(\Omega;|x|^{-b})$ is defined in Definition \ref{def:weaksol}.} \end{definition} \begin{theorem} \label{existence-gLinf} Assume $\ell >0$ and $g\in C(\BBR)\cap L^\infty(\Omega)$ is a nondecreasing function such that $g(0)=0$. Then there exists a unique weak solution $u\in W^{s,2}_{\mathrm{loc}}(\Omega'\setminus\{0\})\cap C(\Omega\setminus\{0\})$ of \eqref{eq:g(u)-kdirac}. The solution $u$ satisfies \ba\label{est} (\ell \Phi_{s,\mu}^\Omega-\psi_M)^+ \leq u\leq \ell\Phi_{s,\mu}^\Omega\quad \text{a.e. in } \;\Omega \setminus \{0\} \ea and \ba \label{assym-1} \lim_{\Omega \ni x \to 0}\frac{u(x)}{\Phi_{s,\mu}^\Omega(x)}=\ell. \ea \end{theorem} \begin{proof}[\textbf{Proof}] {\sc Uniqueness.} Suppose that $u_1,u_2$ are two weak solutions of \eqref{eq:g(u)-kdirac}. Then for any $b<2s-\tau_+$, by Theorem \ref{existence2}, for any nonnegative $\psi \in \mathbf{X}_{\mu}(\Omega;|x|^{-b})$, \ba \label{u1-u2} \int_{\Omega}(u_1-u_2)^+ (-\Delta)_{\tau_+}^s \psi dx + \int_{\Omega} (g(u_1)- g(u_2))(\mathrm{sign}^+(u_1-u_2))\psi |x|^{\tau_+} dx \leq 0. \ea Taking $\psi=\xi_b$, the solution of \eqref{xib}, in \eqref{u1-u2} and noting that $g$ is nondecreasing, we deduce $(u_1-u_2)^+ = 0$ in $\Omega$. This implies $u_1 \leq u_2$ a.e. in $\Omega$. Similarly, $u_2 \leq u_1$ a.e. in $\Omega$. Thus $u_1 = u_2$ a.e. in $\Omega$. \medskip {\sc Existence.} For $\varepsilon>0$, let $u_\varepsilon$ be the solution in Lemma \ref{aproxsol} and $\eta \in C^\infty({\mathbb R})$ such that $0\leq\eta\leq1$, $\eta(t)=0$ for any $|t|\leq 1$ and $\eta(t)=1$ for any $|t|\geq 2$. For $\varepsilon>0$, set $\eta_{\varepsilon}(x)=\eta(\varepsilon^{-1} |x|)$. Consider $\varepsilon$ small enough such that $B_{16\varepsilon}(0)\subset \Omega.$ Using $\eta_\varepsilon^2(x)u_\varepsilon(x)$ as a test function in \eqref{aprox-1}, we obtain \ba\label{18} \begin{aligned} &\quad \frac{C_{N,s}}{2}\int_{\BBR^N}\int_{\BBR^N}\frac{(u_\varepsilon(x)-u_\varepsilon(y))(\eta^2_\varepsilon(x)u_\varepsilon(x)-\eta^2_\varepsilon(y)u_\varepsilon(y))}{|x-y|^{N+2s}}dy \\ &= -\int_{\Omega_\varepsilon} g(u_\varepsilon)u_\varepsilon\eta^2_\varepsilon dx-\mu\int_{\Omega_\varepsilon}\frac{u_\varepsilon^2(x)\eta^2_\varepsilon(x)}{|x|^{2s}}dx. \end{aligned} \ea By \eqref{uplow-1}, it is easy to see that \bal \left|\int_{\Omega_\varepsilon} g(u_\varepsilon)u_\varepsilon\eta^2_\varepsilon dx \right| + \left|\mu\int_{\Omega_\varepsilon}\frac{u_\varepsilon^2(x)\eta^2_\varepsilon(x)}{|x|^{2s}}dx \right|\leq C(N,s,\mu,\Omega,\varepsilon,\ell,M), \eal where $M=\sup_{t\in\BBR}|g(t)|$. We write \bal \begin{aligned} &\quad \int_{\BBR^N}\int_{\BBR^N}\frac{(u_\varepsilon(x)-u_\varepsilon(y))(\eta^2_\varepsilon(x)u_\varepsilon(x)-\eta^2_\varepsilon(y)u_\varepsilon(y))}{|x-y|^{N+2s}}dydx\\ &= \int_{\Omega_{\frac{\varepsilon}{2}}'}\eta^2_\varepsilon(x)\int_{\Omega_{\frac{\varepsilon}{2}}'}\frac{|u_\varepsilon(x)-u_\varepsilon(y)|^2}{|x-y|^{N+2s}}dydx\\ &\quad+\int_{\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_{\frac{\varepsilon}{2}}'}u_\varepsilon(y)\frac{(u_\varepsilon(x)-u_\varepsilon(y))(\eta^2_\varepsilon(x)-\eta^2_\varepsilon(y))}{|x-y|^{N+2s}}dydx +2\int_{\BBR^N\setminus\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_{\frac{\varepsilon}{2}}'} \frac{\eta^2_\varepsilon(y)u_\varepsilon^2(y)}{|x-y|^{N+2s}}dydx. \end{aligned} \eal By Young's inequality, we have \bal \begin{aligned} &\quad \left| \int_{\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_{\frac{\varepsilon}{2}}'}u_\varepsilon(y)\frac{(u_\varepsilon(x)-u_\varepsilon(y))(\eta^2_\varepsilon(x)-\eta^2_\varepsilon(y))}{|x-y|^{N+2s}}dydx \right| \\ &\leq \frac{1}{8}\int_{\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_{\frac{\varepsilon}{2}}'}\frac{(u_\varepsilon(x)-u_\varepsilon(y))^2 (\eta_{\varepsilon}(x)+\eta_{\varepsilon}(y))^2}{|x-y|^{N+2s}}dydx +8\int_{\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_{\frac{\varepsilon}{2}}'}u_\varepsilon^2(y)\frac{(\eta_\varepsilon(x)-\eta_\varepsilon(y))^2}{|x-y|^{N+2s}}dydx \\ &\leq\frac12 \int_{\Omega_{\frac{\varepsilon}{2}}'}\eta^2_\varepsilon(x)\int_{\Omega_{\frac{\varepsilon}{2}}'}\frac{(u_\varepsilon(x)-u_\varepsilon(y))^2}{|x-y|^{N+2s}}dydx + 8\int_{\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_{\frac{\varepsilon}{2}}'}u_\varepsilon^2(y)\frac{(\eta_\varepsilon(x)-\eta_\varepsilon(y))^2}{|x-y|^{N+2s}}dydx \end{aligned} \eal and by Lemma \ref{aproxsol} and the regularity of $\eta_{\varepsilon}$, we deduce \ba \label{21-b} \int_{\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_{\frac{\varepsilon}{2}}'}u_\varepsilon^2(y)\frac{(\eta_\varepsilon(x)-\eta_\varepsilon(y))^2}{|x-y|^{N+2s}}dydx \leq C(N,\Omega,s,\mu,\varepsilon,\ell). \ea Moreover, by using the fact that $\eta_{\varepsilon}=0$ in $B_{\varepsilon}(0)$ and $u_{\varepsilon}=0$ in ${\mathbb R}^N \setminus \Omega$, we have \ba \label{21-c} \int_{\BBR^N\setminus\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_{\frac{\varepsilon}{2}}'} \frac{\eta^2_\varepsilon(y)u_\varepsilon^2(y)}{|x-y|^{N+2s}}dydx = \int_{\BBR^N\setminus\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_\varepsilon} \frac{\eta^2_\varepsilon(y)u_\varepsilon^2(y)}{|x-y|^{N+2s}}dydx \leq C(N,s,\mu,\Omega,\Omega',\varepsilon,\ell). \ea Combining \eqref{18}--\eqref{21-c} yields \ba \label{21-d} \int_{\Omega_{\frac{\varepsilon}{2}}'}\eta^2_\varepsilon(x)\int_{\Omega_{\frac{\varepsilon}{2}}'}\frac{(u_\varepsilon(x)-u_\varepsilon(y))^2}{|x-y|^{N+2s}}dydx \leq C(N,s,\mu,\Omega,\Omega',\varepsilon,\ell,M). \ea Now, let us estimate the following term \ba\label{24}\begin{aligned} &\int_{\BBR^N}\int_{\BBR^N}\frac{|\eta_\varepsilon(x)u_\varepsilon(x)-\eta_\varepsilon(y)u_\varepsilon(y)|^2}{|x-y|^{N+2s}}dydx \\ &=\int_{\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_{\frac{\varepsilon}{2}}'}\frac{|\eta_\varepsilon(x)u_\varepsilon(x)-\eta_\varepsilon(y)u_\varepsilon(y)|^2}{|x-y|^{N+2s}}dydx+2\int_{\BBR^N\setminus\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_{\frac{\varepsilon}{2}}'} \frac{\eta^2_\varepsilon(y)u_\varepsilon^2(y)}{|x-y|^{N+2s}}dydx. \end{aligned} \ea The first term on the right of \eqref{24} is bounded from above by using \eqref{21-d} and \eqref{21-b} \ba\label{25}\begin{aligned} &\int_{\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_{\frac{\varepsilon}{2}}'}\frac{|\eta_\varepsilon(x)u_\varepsilon(x)-\eta_\varepsilon(y)u_\varepsilon(y)|^2}{|x-y|^{N+2s}}dydx \\ &\leq 2\int_{\Omega_{\frac{\varepsilon}{2}}'}\eta^2_\varepsilon(x)\int_{\Omega_{\frac{\varepsilon}{2}}'}\frac{(u_\varepsilon(x)-u_\varepsilon(y))^2}{|x-y|^{N+2s}}dydx +2\int_{\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_{\frac{\varepsilon}{2}}'}u_\varepsilon^2(y)\frac{(\eta_\varepsilon(x)-\eta_\varepsilon(y))^2}{|x-y|^{N+2s}}dydx \\ &\leq C(N,s,\mu,\Omega,\Omega',\varepsilon,\ell,M). \end{aligned} \ea Plugging \eqref{25} and \eqref{21-c} into \eqref{24} leads to \ba\label{28-1} \int_{\BBR^N}\int_{\BBR^N}\frac{|\eta_\varepsilon(x)u_\varepsilon(x)-\eta_\varepsilon(y)u_\varepsilon(y)|^2}{|x-y|^{N+2s}}dydx \leq C(N,s,\mu,\Omega,\Omega',\varepsilon,\ell,M). \ea By the standard fractional compact Sobolev embedding and a diagonal argument, there exists a subsequence $\{u_{\varepsilon_k}\}_{k \in {\mathbb N}}$ such that $u_{\varepsilon_k}\to u$ a.e. in $\Omega \setminus \{0\}$. We find that $u\in W^{s,2}_{\mathrm{loc}}(\BBR^N\setminus \{0\})\cap C(\Omega\setminus\{0\})$ and $u=0$ in $\BBR^N\setminus\Omega$. Moreover, for any $\phi\in C_0^\infty(\Omega \setminus \{0\})$, there exists $\bar \varepsilon >0$ such that $\phi \in C_0^\infty(\Omega_{\bar \varepsilon})$. Thus, for $2\varepsilon_k \leq \bar \varepsilon$, $\phi \in C_0^\infty(\Omega_{\varepsilon_k})$. Therefore, by the dominated convergence theorem, we obtain \bal \lim_{k\to\infty}\int_{\BBR^N}\int_{\BBR^N}\frac{(u_{\varepsilon_k}(x)-u_{\varepsilon_k}(y))(\phi(x)-\phi(y))}{|x-y|^{N+2s}}dy dx&= \int_{\BBR^N}\int_{\BBR^N}\frac{(u(x)-u(y))(\phi(x)-\phi(y))}{|x-y|^{N+2s}}dy dx, \\ \lim_{n\to\infty}\int_{\Omega_{\varepsilon_k}} \frac{u_{\varepsilon_k}(x)\phi(x)}{|x|^{2s}}dx&=\int_\Omega\frac{u(x)\phi(x)}{|x|^{2s}}dx, \\ \lim_{k\to\infty}\int_{\Omega_{\varepsilon_k}} g(u_{\varepsilon_k})\phi dx&=\int_{\Omega} g(u)\phi dx. \eal Thus by passing $k \to \infty$ in \eqref{aprox-1} with $\varepsilon$ replaced by $\varepsilon_k$, we obtain \ba\label{eq-usol}\begin{aligned} \frac{C_{N,s}}{2}\int_{\BBR^N}\int_{\BBR^N}\frac{(u(x)-u(y))(\phi(x)-\phi(y))}{|x-y|^{N+2s}}dy dx+\mu\int_\Omega\frac{u(x)\phi(x)}{|x|^{2s}}dx+\int_{\Omega} g(u)\phi dx=0 \end{aligned} \ea for all $\phi\in C_0^\infty(\Omega\setminus\{0\})$. We see that $u$ satisfies \eqref{est} due to \eqref{uplow-1}. Next by \cite[Lemma 4.4,4.5]{CGN}, $\psi_M \in C^\beta(\Omega\setminus\{0\})$ for any $\beta\in (0,2s)$ and \bal \psi_M(x) \leq C(M,\Omega,s,N,\mu) d(x)^s|x|^{\tau_+} \quad \forall x \in \Omega \setminus \{0\}, \eal which implies \ba \label{psiM/Phi} \lim_{\Omega \ni x \to 0}\frac{\psi_M(x)}{\Phi_{s,\mu}^\Omega(x)}=0. \ea This and \eqref{est} lead to \eqref{assym-1}. Since $g \in L^\infty({\mathbb R})$, by Theorem \ref{existence2}, there exists a unique weak solution $w \in L^1(\Omega;|x|^{-b})$ of \bal \left\{ \begin{aligned} \CL_\mu^s w &=g(u)&&\quad\text{in}\;\,\Omega,\\ w&=0&&\quad\text{in}\;\, \BBR^N\setminus\Omega, \end{aligned} \right. \eal namely \ba\label{102} \int_\Omega w(-\Delta)^s_{\tau_+}\psi dx=\int_\Omega g(u) \psi |x|^{\tau_+} dx,\quad\forall\psi\in \mathbf{X}_\mu(\Omega;|x|^{-b}). \ea Thus, together with \eqref{eq-usol}, we obtain that for $ \phi\in C_0^\infty(\Omega\setminus\{0\})$ \bal \frac{C_{N,s}}{2} \int_{\BBR^N}\int_{\BBR^N}\frac{(u(x)+w(x)-u(y)-w(y))(\phi(x)-\phi(y))}{|x-y|^{N+2s}}dy dx +\mu\int_\Omega\frac{(u(x)+w(x))\phi(x)}{|x|^{2s}}dx=0. \eal By \cite[Lemma 4.4, 4.5]{CGN}, $w \in C^\beta(\Omega\setminus\{0\})$ for any $\beta\in (0,2s)$ and \ba \label{wi-est-1a} w(x)\leq C(M,\Omega,s,N,\mu) d(x)^s|x|^{\tau_+}, \quad \forall x \in \Omega \setminus \{0\}. \ea Combining \eqref{assym-1}, \eqref{wi-est-1a}, the definition of $\Phi_{s, \mu}$ in \eqref{fu} and the fact that $\tau_+ \geq \tau_-$, we derive \bal \lim_{|x|\to 0}\frac{u(x)+w(x)}{\Phi_{s,\mu}(x)}=\ell. \eal Hence by \cite[Theorem 4.14]{CW}, we have that $u_i+w_i=\ell\Phi_{s,\mu}^\Omega$ a.e. in $\Omega \setminus \{0\}$. This and \eqref{102} imply the desired result. \end{proof} \begin{remark}\label{remark} If $\ell <0$ then we put $\tilde g(t) = -g(-t)$ and consider the problem \ba \label{eq:-l} \left\{ \begin{aligned} \CL_\mu^s u + \tilde g(u)&=-\ell\delta_0&&\quad\text{in}\;\,\Omega,\\ u&=0&&\quad\text{in}\;\, \BBR^N\setminus\Omega. \end{aligned} \right. \ea By Theorem \ref{existence-gLinf}, there exists a unique weak solution $\tilde u$ of problem \eqref{eq:-l}. Therefore, $-\tilde u$ is the unique weak solution of problem \eqref{eq:g(u)-kdirac}. \end{remark} \begin{proof}[\textbf{Proof of Theorem \ref{semi-dirac>}}] In view of Remark \ref{remark}, we may assume that $\ell>0$. The uniqueness follows from Kato inequality \eqref{Kato||-1}. Next we show the existence of a solution to problem \eqref{eq:g(u)-kdirac}. Let $g_n=\max\{-n,\min\{g,n\}\}$ then $g_n \in C({\mathbb R}) \cap L^\infty({\mathbb R})$. By Theorem \ref{existence-gLinf}, there exists a unique positive weak solution $u_n$ of \bal \left\{ \begin{aligned} \CL_\mu^s u_n+g_n(u)&=\ell \delta_0&&\quad\text{in}\;\,\Omega,\\ u&=0&&\quad\text{in}\;\, \BBR^N\setminus\Omega, \end{aligned} \right. \eal namely, for any $b<2s-\tau_+$, $u_n\in L^1(\Omega;|x|^{-b})$ and \ba\label{solg(un)dirac} \int_\Omega u_n(-\Delta)^s_{\tau_+}\psi dx+\int_\Omega g_n(u_n)\psi|x|^{\tau_+} dx=\ell \int_{\Omega}\Phi_{s,\mu}^\Omega (-\Delta)^s_{\tau_+}\psi dx,\quad\forall\psi\in \mathbf{X}_\mu(\Omega;|x|^{-b}). \ea From the above formula and \eqref{Kato:+-1}, we deduce that $u_{n+1}\leq u_{n}$ for any $n \in {\mathbb N}$. Put $u:=\displaystyle\lim_{n \to\infty}u_n$. For any $n\in\BBN$, by Theorem \ref{existence-gLinf}, we have \ba \label{unPhi-} u_{n}(x)\leq \ell\Phi_{s,\mu}^\Omega(x)\leq \ell |x|^{\tau_-},\quad\forall x\in \Omega\setminus\{0\}, \ea which implies $u(x) \leq \ell \Phi_{\mu}^\Omega(x)$ for all $x \in \Omega \setminus \{0\}$. By the monotone convergence theorem, $u_n \to u$ in $L^1(\Omega;|x|^{-b})$. We notice that $g_n(u_n) \to g(u)$ a.e. in $\Omega \setminus \{0\}$ and in view of \eqref{unPhi-} and assumption $\Lambda_g <\infty$, $0 \leq g_n(u_n) \leq g(\ell |x|^{\tau_-}) \in L^1(\Omega;|x|^{\tau_+})$. Hence by the dominated convergence theorem, we have that $g_n(u_n) \to g(u)$ in $L^1(\Omega;|x|^{\tau_+})$. Let $\psi \in \mathbf{X}_{\mu}(\Omega;|x|^{-b})$ then by \cite[Lemma 4.4]{CGN}, $|\psi| \leq Cd^s$ in $\Omega$. By letting $n \to \infty$ in \eqref{solg(un)dirac}, we conclude \eqref{sol:g(u)-kdirac}. \end{proof} \begin{proof}[\textbf{Proof of Theorem \ref{semi-dirac=}}] The proof of this Theorem is similar to that of Theorem \eqref{semi-dirac>} with minor modification, hence we omit it. \end{proof} \section{Measures on $\Omega$} \subsection{Bounded absorption} Let $\ell \in\BBR$ and $\Omega'$ be an open bounded domain such that $\Omega\Subset\Omega'$ and $\varepsilon\leq \frac{\min_{x\in\partial\Omega}|x| }{16}$. Recall that $H(x)= \ell \Phi_{s,\mu}^\Omega(x)|x|^{-\tau_+}$ for $x \neq 0$. Set $\Omega_\varepsilon'=\Omega'\setminus B_{\varepsilon}(0)$ and $\Omega_\varepsilon=\Omega\setminus B_{\varepsilon}(0)$. For any $u,v\in W^{s,2}(\Omega_{\frac{\varepsilon}{2}}')$, we define the operators \bal \CB u(v): = \int_{\Omega_{\varepsilon}} fv |x|^{\tau_+}dx \quad {\rm and}\quad {\mathcal T}} \def\CU{{\mathcal U}} \def\CV{{\mathcal V} u(v):={\mathcal A}} \def\CB{{\mathcal B}} \def\CC{{\mathcal C} u(v) - \CB u(v), \eal where $g\in C(\BBR)\cap L^\infty(\Omega)$ is a nondecreasing function such that $g(0)=0$, $f \in L^\infty(\Omega_{\varepsilon})$ and ${\mathcal A}} \def\CB{{\mathcal B}} \def\CC{{\mathcal C}$ is defined in \eqref{AA1A2}. Recall that $M=\sup_{t\in\BBR}|g(t)|$ and $\CK_{\varepsilon}$ is the nonempty convex closed set of $W^{s,2}(\Omega_{\frac{\varepsilon}{2}}')$ defined in \eqref{Ke}. Using an analogous argument as in the proof of Lemma \ref{dual}, Lemma \ref{monotone}, we can show that ${\mathcal T}} \def\CU{{\mathcal U}} \def\CV{{\mathcal V}$ is monotone, coercive and weakly continuous on $\CK_{\varepsilon}$. By proceeding as in the proof of Lemma \ref{aproxsol}, we can obtain the following result. \begin{lemma}\label{aproxsol-sum} Assume $\ell \geq 0$ and $g\in C(\BBR)\cap L^\infty(\Omega)$ is a nondecreasing function such that $g(0)=0$ and $0 \leq f \in L^\infty(\Omega_{\varepsilon})$. There exists a function $u_\varepsilon = u_{\varepsilon,f,\ell}\in W^{s,2}(\Omega_{\frac{\varepsilon}{2}}')$ such that $u_{\varepsilon,f,\ell}=\ell \Phi_{s,\mu}^\Omega$ in $\BBR^N\setminus \Omega_\varepsilon$ and \ba \label{aprox-1-sum} \begin{aligned} \frac{C_{N,s}}{2}\int_{\BBR^N}\int_{\BBR^N}&\frac{(u_{\varepsilon,f,\ell}(x)-u_{\varepsilon,f,\ell}(y))(\phi(x)-\phi(y))}{|x-y|^{N+2s}}dy dx\\ & +\mu\int_{\Omega_\varepsilon}\frac{u_{\varepsilon,f,\ell}(x)\phi(x)}{|x|^{2s}}dx +\int_{\Omega_\varepsilon} g(u_{\varepsilon,f,\ell})\phi dx = \int_{\Omega_\varepsilon} f\phi dx \end{aligned} \ea for all $\phi\in C_0^\infty(\Omega_{\varepsilon})$. Furthermore there holds \ba \label{uplow-1-sum} \max\{(\ell\Phi_{s,\mu}^\Omega-\psi_M)^+,u_{\varepsilon,f,0}\} \leq u_{\varepsilon,f,\ell} \leq \ell \Phi_{s,\mu}^\Omega + u_{\varepsilon,f,0} \quad \text{in } \Omega_{\varepsilon}, \ea where $\psi_M$ is the nonnegative solution of \eqref{psiM} and $u_{\varepsilon,f,0}$ satisfies \eqref{aprox-1-sum} and $u_{\varepsilon,f,0}=0$ in ${\mathbb R}^N \setminus \Omega_{\varepsilon}$. \end{lemma} \begin{proof}[\textbf{Proof}] By the standard theory of monotone operators (see, e.g., \cite[Proposition 17.2]{HKM}), there exists $v_{\varepsilon,f,\ell}\in \mathcal{K}_\varepsilon$ such that \bal \mathcal{A}v_{\varepsilon,f,\ell}(\zeta-v_{\varepsilon,f,\ell})\geq0, \eal for any $\zeta\in \mathcal{K}_\varepsilon.$ Set $\zeta_\pm=\pm\tilde\phi+v_{\varepsilon,f,\ell}$ for $\tilde\phi\in C_0^\infty(\Omega_\varepsilon),$ then $\zeta_\pm\in \mathcal{K}_\varepsilon$ and by the above inequality we can easily show that \ba \label{aprox-2-sum} \begin{aligned} 0&=\mathcal{A}v_{\varepsilon,f,\ell}(\tilde\phi) \\ &=\frac{C_{N,s}}{2}\int_{\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_{\frac{\varepsilon}{2}}'}\frac{(v_{\varepsilon,f,\ell}(x)-v_{\varepsilon,f,\ell}(y))(\tilde\phi(x)-\tilde\phi(y))}{|x-y|^{N+2s}}|y|^{\tau_+} dy|x|^{\tau_+} dx\\ &\quad +C_{N,s}\int_{\BBR^N\setminus\Omega_{\frac{\varepsilon}{2}}'}\int_{\Omega_\varepsilon}\frac{(v_{\varepsilon,f,\ell}(y)-H(x))\tilde\phi(y)}{|x-y|^{N+2s}}|y|^{\tau_+} dy |x|^{\tau_+} dx \\ &\quad +\int_{\Omega_\varepsilon} g(|x|^{\tau_+} v_{\varepsilon,f,\ell})\tilde\phi|x|^{\tau_+} dx - \int_{\Omega_\varepsilon} f \tilde\phi|x|^{\tau_+} dx\\ &=\langle v_{\varepsilon,f,\ell}, \tilde \phi \rangle_{s,\tau_+} + \int_{\Omega_\varepsilon} g(|x|^{\tau_+} v_{\varepsilon,f,\ell})\tilde\phi|x|^{\tau_+} dx - \int_{\Omega_\varepsilon} f \tilde\phi|x|^{\tau_+} dx. \end{aligned} \ea Setting $u_{\varepsilon,f,\ell}=|x|^{\tau_+} v_{\varepsilon,f,\ell}$ and $\phi=|x|^{\tau_+}\tilde\phi,$ we obtain \eqref{aprox-1-sum}. Moreover, since $v_{\varepsilon,f,\ell} \in \CK_{\varepsilon}$, $v_{\varepsilon,f,\ell} = H$ a.e. in ${\mathbb R}^N \setminus \Omega_{\varepsilon}$, hence $u_{\varepsilon,f,\ell} = \ell\Phi_{s,\mu}^\Omega$ a.e. in ${\mathbb R}^N \setminus \Omega_{\varepsilon}$. By taking $\tilde \phi = (v_{\varepsilon,f,\ell})^- \in W_0^{s,2}(\Omega_\varepsilon)$ in \eqref{aprox-2-sum}, the standard density argument and the assumption that $g$ is nondecreasing and $g(0)=0$, we have \bal \begin{aligned} 0&=\langle v_{\varepsilon,f,\ell}, (v_{\varepsilon,f,\ell})^- \rangle_{s,\tau_+} +\int_{\Omega_\varepsilon} g(|x|^{\tau_+} v_{\varepsilon,f,\ell})(v_{\varepsilon,f,\ell})^-|x|^{\tau_+} dx - \int_{\Omega_\varepsilon} f(v_{\varepsilon,f,\ell})^-|x|^{\tau_+} dx \leq 0, \end{aligned} \eal which implies $(v_{\varepsilon,f,\ell})^-=0$ a.e. in ${\mathbb R}^N$. Therefore $v_{\varepsilon,f,\ell} \geq 0$, and hence $u_{\varepsilon,f,\ell} \geq 0$ a.e. in $\Omega_{\varepsilon}$. In particular, $v_{\varepsilon,f,0}$ satisfies \eqref{aprox-2-sum} with $\ell=0$, namely \ba \label{vef0} \langle v_{\varepsilon,f,0}, \tilde \phi \rangle_{s,\tau_+} + \int_{\Omega_\varepsilon} g(|x|^{\tau_+} v_{\varepsilon,f,0})\tilde\phi|x|^{\tau_+} dx - \int_{\Omega_\varepsilon} f \tilde\phi|x|^{\tau_+} dx = 0, \quad \forall \tilde \phi \in C_0^\infty(\Omega_{\varepsilon}). \ea Moreover, $0 \leq v_{\varepsilon,f,0} \in W^{2,s}(\Omega_{\frac{\varepsilon}{2}}')$ and $v_{\varepsilon,f,0}=0$ a.e. in ${\mathbb R}^N \setminus \Omega_{\varepsilon}$, which in turn implies $v_{\varepsilon,f,0} \in W_0^{2,s}(\Omega_{\varepsilon})$. Therefore, by a density argument, we can take $v_{\varepsilon,f,0}$ as a test function in \eqref{vef0} and use estimate $g(t)t \geq 0$ for any $t \in {\mathbb R}$, and by the embedding inequalities \eqref{subcritsobolev0}--\eqref{subcritsobolev1}, we obtain \bal \| v_{\varepsilon,f,0} \|_{s,\tau_+}^2 \leq C(N,s,\Omega,\mu)\| f \|_{L^\infty(\Omega_{\varepsilon})}. \eal Put $u_{\varepsilon,f,0} = |x|^{\tau_+}v_{\varepsilon,f,0}$ then $u_{\varepsilon,f,0} = 0$ a.e. in ${\mathbb R}^N \setminus \Omega_{\varepsilon}$, and \ba \label{uef0-2} \| u_{\varepsilon,f,0} \|_{\mu}^2 \leq C(N,s,\Omega,\mu)\| f \|_{L^\infty(\Omega_{\varepsilon})}. \ea We have \ba \label{aprox-3-sum} \begin{aligned} \langle H, \tilde \phi \rangle_{s,\tau_+} = 0, \quad \forall \; \tilde\phi\in C_0^\infty(\Omega_{\varepsilon}). \end{aligned} \ea Therefore, \bal \langle v_{\varepsilon,f,0} + H, \tilde \phi \rangle_{s,\tau_+} + \int_{\Omega_{\varepsilon}} g(|x|^{\tau_+} (\tilde v_{\varepsilon,f,0}+H)) \tilde\phi|x|^{\tau_+} dx \geq \int_{\Omega_{\varepsilon}} f \tilde \phi |x|^{\tau_+}dx, \quad \forall 0 \leq \tilde \phi \in C_0^\infty(\Omega_{\varepsilon}). \eal Put $w_{\varepsilon}=v_{\varepsilon,f,\ell}-v_{\varepsilon,f,0}- H$ then from \eqref{aprox-2-sum} and \eqref{aprox-3-sum}, we have \ba \label{aprox-4-sum} \begin{aligned} \langle w_{\varepsilon}, \tilde \phi \rangle_{s,\tau_+} +\int_{\Omega_\varepsilon} (g(|x|^{\tau_+} v_{\varepsilon,f,\ell}) - g(|x|^{\tau_+} (\tilde v_{\varepsilon,f,0}+H)))\tilde\phi|x|^{\tau_+} dx \leq 0, \; \forall \; 0 \leq \tilde\phi\in C_0^\infty(\Omega_{\varepsilon}). \end{aligned} \ea Note that $w_{\varepsilon}^+\in W^{s,2}(\Omega_{\frac{\varepsilon}{2}}')$ and $w_{\varepsilon}^+=0$ in $\BBR^N\setminus \Omega_\varepsilon.$ Since $\Omega_\varepsilon$ is smooth, we deduce that $w_{\varepsilon}^+\in W^{s,2}_0(\Omega_\varepsilon),$ hence, by the density argument, we may use it as test function in \eqref{aprox-4-sum} together with the monotonicity assumption on $g$ to obtain that \ba \label{aprox-5-sum} \begin{aligned} 0& \leq \langle w_{\varepsilon}, w_\varepsilon^+ \rangle_{s,\tau_+} +\int_{\Omega_\varepsilon} (g(|x|^{\tau_+} v_{\varepsilon,f,\ell}) - g(|x|^{\tau_+}(v_{\varepsilon,f,0} + H)))w_{\varepsilon}^+|x|^{\tau_+} dx \leq 0. \end{aligned} \ea This implies $(w_{\varepsilon})^+=0$ a.e. in $\BBR^N$, hence $v_{\varepsilon,f,\ell} \leq H+ v_{\varepsilon,f,0}$ a.e. in $\Omega_{\varepsilon}$. This implies \bal u_{\varepsilon,f,\ell} \leq \ell\Phi_{s,\mu}^\Omega + u_{\varepsilon,f,0} \quad \text{a.e. in } \Omega_{\varepsilon}. \eal Next we show the lower bound in \eqref{uplow-1-sum}. Since $\displaystyle M=\sup_{t\in\BBR}|g(t)|$ and $\psi_M$ is the nonnegative solution of \eqref{psiM}, we have \bal \CL_\mu^s(\ell\Phi_{s,\mu}^\Omega-\psi_M)+g(\ell \Phi_{s,\mu}^\Omega-\psi_M) \leq 0 \eal in the sense of distribution in $\Omega_\varepsilon.$ By a similar argument as above, we may show that $u_{\varepsilon,f,\ell} \geq \ell \Phi_{s,\mu}^\Omega-\psi_M$ a.e. in $\Omega_{\varepsilon}$. Thus $u_{\varepsilon,f,\ell} \geq (\ell \Phi_{s,\mu}^\Omega-\psi_M)^+$ a.e. in $\Omega_{\varepsilon}$. From \eqref{aprox-2-sum} and \eqref{vef0}, we see that \ba \label{ve-vef-sum} \langle v_{\varepsilon,f,0} - v_{\varepsilon,f,\ell}, \tilde \phi \rangle_{s,\tau_+} + \int_{\Omega_{\varepsilon}} (g(|x|^{\tau_+} v_{\varepsilon,f,0}) - g(|x|^{\tau_+} v_{\varepsilon,f,\ell})) \tilde \phi |x|^{\tau_+}dx = 0, \quad \forall \tilde \phi \in C_0^\infty(\Omega_{\varepsilon}). \ea We note that $(v_{\varepsilon,f,0} - v_{\varepsilon,f,\ell})^+ \in W_0^{s,2}(\Omega_{\varepsilon})$. By density argument, we can take $(v_{\varepsilon,f,0} - v_{\varepsilon,f,\ell})^+$ as a test function in \eqref{ve-vef-sum} to deduce $(v_{\varepsilon,f,0} - v_{\varepsilon,f,\ell})^+ = 0$ in $\Omega_{\varepsilon}$. Therefore $v_{\varepsilon,f,0} \leq v_{\varepsilon,f,\ell}$ a.e. in $\Omega_{\varepsilon}$. The proof is complete. \end{proof} \begin{theorem} \label{existence-gLinf-sum} Assume $\ell >0$ and $g\in C(\BBR)\cap L^\infty(\Omega)$ is a nondecreasing function such that $g(0)=0$ and $\nu \in \mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O^+(\Omega \setminus \{0\}; |x|^{\tau_+})$. Then there exists a unique weak solution $u_{\nu,\ell}\in W^{s,2}_{\mathrm{loc}}(\Omega'\setminus\{0\})\cap C(\Omega\setminus\{0\})$ of \eqref{eq:g(u)-kdirac-sum}. The solution $u$ satisfies \ba\label{est-sum} \max\{(\ell \Phi_{s,\mu}^\Omega-\psi_M)^+, u_{\nu,0} \} \leq u_{\nu,\ell} \leq u_{\nu,0} + \ell \Phi_{s,\mu}^\Omega\quad \text{a.e. in } \;\Omega \setminus \{0\}, \ea where $u_{\nu,0}$ is the weak solution to \bal \left\{ \begin{aligned} \CL_\mu^s u + g(u)&= \nu &&\quad\text{in}\;\, \Omega,\\ u&=0&&\quad\text{in}\;\, \BBR^N\setminus\Omega. \end{aligned} \right. \eal \end{theorem} \begin{proof}[\textbf{Proof}] {\sc Uniqueness.} Suppose that $u_1,u_2$ are two weak solutions of \eqref{eq:g(u)-kdirac-sum}. Then by Theorem \ref{existence2}, \ba \label{u1-u2-sum} \int_{\Omega}(u_1-u_2)^+ (-\Delta)_{\tau_+}^s \psi dx + \int_{\Omega} (g(u_1)- g(u_2))\psi |x|^{\tau_+} dx \leq 0, \quad \forall \, 0 \leq \psi \in \mathbf{X}_{\mu}(\Omega;|x|^{-b}). \ea Taking $\psi=\xi_b$, the solution of \eqref{xib}, in \eqref{u1-u2-sum} and noting that $g$ is nondecreasing, we deduce $(u_1-u_2)^+ = 0$ in $\Omega$. This implies $u_1 \leq u_2$ a.e. in $\Omega$. Similarly, $u_2 \leq u_1$ a.e. in $\Omega$. Thus $u_1 = u_2$ a.e. in $\Omega$. \medskip {\sc Existence.} The proof of the existence is divided into three steps. \medskip \noindent \textbf{Step 1.} First we consider the case $\nu=f \in L^\infty(\Omega)$. For $\varepsilon>0$, let $u_{\varepsilon,f,\ell}$ be the solution in Lemma \ref{aproxsol-sum} and $\eta \in C^\infty({\mathbb R})$ such that $0\leq\eta\leq1$, $\eta(t)=0$ for any $|t|\leq 1$ and $\eta(t)=1$ for any $|t|\geq 2$. For $\varepsilon>0$, set $\eta_{\varepsilon}(x)=\eta(\varepsilon^{-1} |x|)$. Consider $\varepsilon$ small enough such that $B_{16\varepsilon}(0)\subset \Omega.$ Using $\eta^2_\varepsilon(x)u_\varepsilon(x)$ as a test function in \eqref{aprox-1-sum}, we obtain \bal \begin{aligned} &\frac{C_{N,s}}{2}\int_{\BBR^N}\int_{\BBR^N}\frac{(u_{\varepsilon,f,\ell}(x)-u_{\varepsilon,f,\ell}(y))(\eta^2_\varepsilon(x)u_{\varepsilon,f,\ell}(x)-\eta^2_\varepsilon(y)u_{\varepsilon,f,\ell}(y))}{|x-y|^{N+2s}}dy \\ &= -\int_{\Omega_\varepsilon} g(u_{\varepsilon,f,\ell})u_{\varepsilon,f,\ell}\eta^2_\varepsilon dx-\mu\int_{\Omega_\varepsilon}\frac{u_{\varepsilon,f,\ell}^2(x)\eta^2_\varepsilon(x)}{|x|^{2s}}dx + \int_{\Omega_{\varepsilon}} f u_{\varepsilon,f,\ell}\eta^2_\varepsilon dx. \end{aligned} \eal By Lemma \ref{aproxsol-sum}, it is easy to see that \bal \begin{aligned} &\Big|\int_{\Omega_\varepsilon} g(u_{\varepsilon,f,\ell})u_{\varepsilon,f,\ell}\eta^2_\varepsilon dx \Big| + \Big|\mu\int_{\Omega_\varepsilon}\frac{u_{\varepsilon,f,\ell}^2(x)\eta^2_\varepsilon(x)}{|x|^{2s}}dx \Big| + \Big| \int_{\Omega_{\varepsilon}} f u_{\varepsilon,f,\ell}\eta^2_\varepsilon dx \Big| \\[1mm] & \leq C(N,s,\mu,\Omega,\varepsilon,\ell,M, \| f\|_{L^\infty(\Omega)}). \end{aligned} \eal By (\ref{28-1}), we have that \bal &\int_{\BBR^N}\int_{\BBR^N}\frac{|\eta_\varepsilon(x)u_{\varepsilon,f,\ell}(x)-\eta_\varepsilon(y)u_{\varepsilon,f,\ell}(y)|^2}{|x-y|^{N+2s}}dydx \leq C(N,s,\mu,\Omega,\Omega',\varepsilon,\ell,M, \| f \|_{L^\infty(\Omega)}). \eal By the standard fractional compact Sobolev embedding and a diagonal argument, there exists a subsequence $\{u_{\varepsilon_{n},f,\ell}\}_{n \in {\mathbb N}}$ such that $u_{\varepsilon_{n},f,\ell}\to u_{f,\ell}$ a.e. in $\Omega \setminus \{0\}$ as $\varepsilon_n \to 0$. We find that $u_{f,\ell}\in W^{s,2}_{\mathrm{loc}}(\BBR^N\setminus \{0\})\cap C(\Omega\setminus\{0\})$ and $u=0$ in $\BBR^N\setminus\Omega$. Moreover, for any $\phi\in C_0^\infty(\Omega \setminus \{0\})$, there exists $\bar \varepsilon >0$ such that $\phi \in C_0^\infty(\Omega_{\bar \varepsilon})$. Thus, for $2\varepsilon_n \leq \bar \varepsilon$, $\phi \in C_0^\infty(\Omega_{\varepsilon_n})$. Therefore, by dominated convergence theorem, we obtain \bal &\lim_{n\to\infty}\int_{\BBR^N}\int_{\BBR^N}\frac{(u_{\varepsilon_{n},f,\ell}(x)-u_{\varepsilon_{n},f,\ell}(y))(\phi(x)-\phi(y))}{|x-y|^{N+2s}}dy dx \\ &\qquad = \int_{\BBR^N}\int_{\BBR^N}\frac{(u_{f,\ell}(x)-u_{f,\ell}(y))(\phi(x)-\phi(y))}{|x-y|^{N+2s}}dy dx, \\ &\lim_{n\to\infty}\int_{\Omega_{\varepsilon_n}} \frac{u_{\varepsilon_{n},f,\ell}(x)\phi(x)}{|x|^{2s}}dx=\int_\Omega\frac{u_{f,\ell}(x)\phi(x)}{|x|^{2s}}dx, \\ &\lim_{n\to\infty}\int_{\Omega_{\varepsilon_n}} g(u_{\varepsilon_{n},f,\ell})\phi dx=\int_{\Omega} g(u_{f,\ell})\phi dx, \\ &\lim_{n \to \infty} \int_{\Omega_{\varepsilon_n}} f \phi dx = \int_{\Omega} f \phi dx. \eal Thus by passing $n \to \infty$ in \eqref{aprox-1-sum} with $\varepsilon$ replaced by $\varepsilon_n$, we obtain \ba\label{eq-usol-sum} \begin{aligned} &\frac{C_{N,s}}{2}\int_{\BBR^N}\int_{\BBR^N}\frac{(u_{f,\ell}(x)-u_{f,\ell}(y))(\phi(x)-\phi(y))}{|x-y|^{N+2s}}dy dx \\ &\qquad \qquad +\mu\int_\Omega\frac{u_{f,\ell}(x)\phi(x)}{|x|^{2s}}dx +\int_{\Omega} g(u_{f,\ell})\phi dx= \int_{\Omega} f \phi dx, \quad \forall \phi\in C_0^\infty(\Omega\setminus\{0\}). \end{aligned} \ea Employing estimate \eqref{uplow-1-sum} with $\varepsilon$ replaced by $\varepsilon_n$ and letting $\varepsilon_n \to 0$, we find that \ba\label{est-ufk} \max\{(\ell \Phi_{s,\mu}^\Omega-\psi_M)^+, u_{f,0} \} \leq u_{f,\ell} \leq u_{f,0} + \ell \Phi_{s,\mu}^\Omega\quad \text{a.e. in } \;\Omega \setminus \{0\}. \ea Next, by \eqref{uef0-2}, $u_{f,0} \in \mathbf{H}_{\mu,0}^s(\Omega)$ and by \cite[Lemma 4.4,4.5]{CGN}, we deduce that $u_{f,0} \in C^\beta(\Omega\setminus\{0\})$ for any $\beta\in (0,2s)$ and \bal u_{f,0}(x) \leq C(N,\Omega,s,\mu) d(x)^s|x|^{\tau_+}\| f\|_{L^\infty(\Omega)} \quad \forall x \in \Omega \setminus \{0\}, \eal which implies \ba \label{uf0/Phi} \lim_{|x| \to 0}\frac{u_{f,0}(x)}{\Phi_{ \mu}^\Omega(x)}=0. \ea Combining \eqref{est-ufk}, \eqref{psiM/Phi} and \eqref{uf0/Phi} lead to \bal \lim_{|x| \to 0}\frac{u_{f,\ell}(x)}{\Phi_{\mu}(x)}=\ell. \eal Since $g \in L^\infty({\mathbb R})$, by Theorem \ref{existence2}, there exists a unique weak solution $w_{f,\ell}$ of \bal \left\{ \begin{aligned} \CL_\mu^s w &=g(u_{f,\ell}) + f &&\quad\text{in}\;\Omega,\\ w&=0&&\quad\text{in}\;\BBR^N\setminus\Omega, \end{aligned} \right. \eal namely for any $b<2s-\tau_+$, $w_{f,\ell} \in L^1(\Omega;|x|^{-b})$ and \ba \label{sol-w} \int_\Omega w_{f,\ell}(-\Delta)^s_{\tau_+}\psi dx=\int_\Omega g(u_{f,\ell}) \psi |x|^{\tau_+} dx + \int_\Omega f \psi |x|^{\tau_+} dx,\quad\forall\psi\in \mathbf{X}_\mu(\Omega;|x|^{-b}). \ea This and \eqref{eq-usol-sum} imply \bal \frac{C_{N,s}}{2}&\int_{\BBR^N}\int_{\BBR^N}\frac{(u_{f,\ell}(x)+w_{f,\ell}(x)-u_{f,\ell}(y)-w_{f,\ell}(y))(\phi(x)-\phi(y))}{|x-y|^{N+2s}}dy dx\\ &+\mu\int_\Omega\frac{(u_{f,\ell}(x)+w_{f,\ell}(x))\phi(x)}{|x|^{2s}}dx=0,\quad\forall \phi\in C_0^\infty(\Omega\setminus\{0\}). \eal Since $g \in L^\infty({\mathbb R})$ and $f \in L^\infty(\Omega)$, in view of the proof of Theorem \ref{existence2}, $w_{f,\ell} \in \mathbf{H}_{\mu,0}^s(\Omega)$. It follows by \cite[Lemma 4.4,4.5]{CGN} that $w_{f,\ell} \in C^\beta(\Omega\setminus\{0\})$ for any $\beta\in (0,2s)$ and \ba \label{wi-est-1} w_{f,\ell}(x)\leq C(M,\Omega,s,N,\mu) d(x)^s|x|^{\tau_+}, \quad \forall x \in \Omega \setminus \{0\}. \ea Combining \eqref{assym-1}, \eqref{wi-est-1}, the definition of $\Phi_{s,\mu}$ in \eqref{fu} and the fact that $\tau_+ \geq \tau_-$, we derive \bal \lim_{|x|\to 0}\frac{u_{f,\ell}(x)+w_{f,\ell}(x)}{{\Phi_{s,\mu}(x)}}=\ell. \eal Hence by \cite[Theorem 4.14]{CW}, we have that $u_{f,\ell}+w_{f,\ell}=\ell \Phi_{s,\mu}^\Omega$ a.e. in $\Omega \setminus \{0\}$. Plugging it into \eqref{sol-w} leads to \eqref{sol:g(u)-kdiracdef}, namely $u_{f,\ell}$ is a weak solution of \eqref{eq:g(u)-kdirac-sum}. \medskip \noindent \textbf{Step 2.} We assume that $\nu \in \mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O^+(\Omega \setminus \{0\}; |x|^{\tau_+})$ has compact support in $\Omega \setminus \{0\}$. Let $\{ \zeta_\delta\}$ be the sequence of standard mollifiers. Put $\nu_\delta = \zeta_\delta \ast \nu$ then $0 \leq \nu_\delta \in C_0^\infty(D)$ where $D \Subset \Omega \setminus \{0\}$, then \eqref{nuntonu} and \eqref{nun<nu} hold. Let $u_{\nu_\delta,\ell}$ be the unique weak solution of \eqref{eq:g(u)-kdirac-sum} with $\nu$ replaced by $\nu_\delta$, namely for any $b<2s-\tau_+$, $u_{\nu_\delta,\ell} \in L^1(\Omega;|x|^{-b}),$ $g(u_{\nu_\delta,\ell})\in L^1(\Omega;|x|^{\tau_+})$ and \ba \label{sol:g(u)-kdirac-sum} \int_\Omega u_{\nu_\delta,\ell}(-\Delta)^s_{\tau_+}\psi dx+\int_\Omega g(u_{\nu_\delta,\ell})\psi|x|^{\tau_+} dx= \int_{\Omega \setminus \{0\} } \psi |x|^{\tau_+}\nu_\delta dx + \ell \int_{\Omega}\Phi_{s,\mu}^\Omega (-\Delta)^s_{\tau_+}\psi dx, \ea for any $\psi\in \mathbf{X}_\mu(\Omega;|x|^{-b})$. Since $g \in L^\infty({\mathbb R})$, by Theorem \ref{existence2}, there exists a unique weak solution $w_{\nu_\delta,\ell}$ of \bal \left\{ \begin{aligned} \CL_\mu^s w &=g(u_{\nu_\delta,\ell}) + \nu_\delta &&\quad\text{in}\;\Omega,\\ w&=0&&\quad\text{in}\;\BBR^N\setminus\Omega. \end{aligned} \right. \eal As in step 1, $u_{\nu_\delta,\ell} + w_{\nu_\delta,\ell} = \ell \Phi_{s,\mu}^\Omega$ in $\Omega \setminus \{0\}$ for any $n \in {\mathbb N}$. By proceeding analogously as in the proof of Theorem \ref{existence-semi-1} and employing \eqref{nun<nu} and the fact that $g \in L^\infty({\mathbb R})$, we may show that there exists $w_{\nu,\ell}$ such that, up to a subsequence, $w_{\nu_\delta,\ell} \to w_{\nu,\ell}$ a.e. in $\Omega \setminus \{0\}$ and in $L^1(\Omega;|x|^{-b})$ as $\delta \to 0$ for any $b<2s-\tau_+$. Put $u_{\nu,\ell} = \ell\Phi_{s,\mu}^\Omega - w_{\nu,\ell}$ then $u_{\nu_\delta,\ell} \to u_{\nu,\ell}$ a.e. in $\Omega \setminus \{0\}$ and in $L^1(\Omega;|x|^{-b})$ as $\delta \to 0$ for any $b<2s-\tau_+$. Since $g \in L^\infty(\Omega) \cap C({\mathbb R})$, by the dominated convergence theorem, $g(u_{\nu_\delta,\ell}) \to g(u_{\nu,\ell})$ a.e. in $\Omega \setminus \{0\}$ and in $L^1(\Omega;|x|^{\tau_+})$ as $\delta \to 0$. Therefore, letting $\delta \to 0$ in \eqref{sol:g(u)-kdirac-sum} leads to \bal \int_\Omega u_{\nu,\ell}(-\Delta)^s_{\tau_+}\psi dx+\int_\Omega g(u_{\nu,\ell})\psi|x|^{\tau_+} dx= \int_{\Omega \setminus \{0\} } \psi |x|^{\tau_+}\nu dx + \ell \int_{\Omega}\Phi_{s,\mu}^\Omega (-\Delta)^s_{\tau_+}\psi dx \eal for any $\psi\in \mathbf{X}_\mu(\Omega;|x|^{-b})$. It means $u_{\nu,\ell}$ is a weak solution of \eqref{eq:g(u)-kdirac-sum}. \medskip \noindent \textbf{Step 3.} We consider $\nu \in \mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O^+(\Omega \setminus \{0\}; |x|^{\tau_+})$. Put $\nu_r = \textbf{1}_{\Omega \setminus B_r(0)}\nu$ and $\nu_{r,\delta}=\zeta_\delta \ast (\textbf{1}_{\Omega \setminus B_r(0)}\nu)$. Denote by $u_{\nu_{r},\ell}$ and $u_{\nu_{r,\delta},\ell}$ the nonnegative weak solutions of \eqref{eq:g(u)-kdirac-sum} with $\nu$ replaced by $\nu_r$ and by $\nu_{r,\delta}$ respectively. By step 2, $u_{\nu_{r,\delta},\ell} \to u_{\nu_{r},\ell}$ a.e. in $\Omega \setminus \{0\}$ and in $L^1(\Omega;|x|^{-b})$ as $\delta \to 0$ for any $b<2s-\tau_+$. Since $\nu_{r} \geq \nu_{r'} \geq 0$ for $0<r \leq r'$, it follows that $\nu_{r,\delta} \geq \nu_{r',\delta}$. By \eqref{Kato:+-1} and the monotonicity of $g$, we deduce that $u_{\nu_{r,\delta},\ell} \geq u_{\nu_{r',\delta},\ell} \geq 0$ for any $0<r<r'$ and $\delta > 0$. Letting $\delta \to 0$ yields $u_{\nu_{r},\ell} \geq u_{\nu_{r'},\ell} \geq 0$ for any $0<r<r'$. Employing the monotonicity convergence theorem, we derive that $u_{\nu_{r},\ell} \uparrow u_{\nu,\ell}$ a.e. in $\Omega$ and in $L^1(\Omega;|x|^{-b})$ as $r \to 0$ for any $b<2s-\tau_+$. Consequently, $g(u_{\nu_{r},\ell}) \uparrow g(u_{\nu,\ell})$ a.e. in $\Omega$ and in $L^1(\Omega;|x|^{\tau_+})$ as $r \to 0$. Passing to the limit, we conclude that $u_{\nu,\ell}$ is a weak solution to \eqref{eq:g(u)-kdirac-sum}. \end{proof} \subsection{Unbounded absorption} \begin{proof}[\textbf{Proof of Theorem \ref{dirac>-sum}}] The uniqueness follows from Kato inequality \eqref{Kato||-1}. Next we show the existence of a solution to problem \eqref{eq:g(u)-kdirac-sum}. Let $g_n=\max\{-n,\min\{g,n\}\}$ then $g_n \in C({\mathbb R}) \cap L^\infty({\mathbb R})$. For $r>0$ and $0<\delta<\frac{r}{4}$, put $\nu_r = \textbf{1}_{\Omega \setminus B_r(0)}\nu$ and $\nu_{r,\delta} = \zeta_{\delta} \ast (\textbf{1}_{\Omega \setminus B_r(0)}\nu)$. By Theorem \ref{existence-gLinf-sum}, there exists a unique positive weak solution $u_{\nu_{r,\delta},\ell,n}$ of \bal \left\{ \begin{aligned} \CL_\mu^s u +g_n(u)&= \nu_{r,\delta} + \ell \delta_0 &&\quad\text{in}\;\Omega,\\ u&=0&&\quad\text{in}\;\BBR^N\setminus\Omega, \end{aligned} \right. \eal namely, for any $b<2s-\tau_+$, $u_{\nu_{r,\delta},\ell,n} \in L^1(\Omega;|x|^{-b})$ and \ba\label{solg(un)-rldirac} \int_\Omega u_{\nu_{r,\delta},\ell,n}(-\Delta)^s_{\tau_+}\psi dx+\int_\Omega g_n(u_{\nu_{r,\delta},\ell,n})\psi|x|^{\tau_+} dx= \int_{\Omega \setminus \{0\}}\psi |x|^{\tau_+}\nu_{r,\delta}dx + \ell\int_{\Omega}\Phi_{s,\mu}^\Omega (-\Delta)^s_{\tau_+}\psi dx \ea for all $\psi\in \mathbf{X}_\mu(\Omega;|x|^{-b})$. From the above formula and \eqref{Kato:+-1}, we deduce that $u_{\nu_{r,\delta},\ell,n+1}\leq u_{\nu_{r,\delta},\ell,n}$ for any $n \in {\mathbb N}$. Put $u_{\nu_{r,\delta},\ell}:=\lim_{n \to\infty}u_{\nu_{r,\delta},\ell,n}$. For any $n\in\BBN$, by Theorem \ref{existence-gLinf-sum}, we have \ba \label{ulnPhi} \max\{ (\ell \Phi_{s,\mu}^\Omega - \psi_M)^+, u_{\nu_{r,\delta},0,n} \} \leq u_{\nu_{r,\delta},\ell,n} \leq u_{\nu_{r,\delta},0,n} + \ell \Phi_{s,\mu}^\Omega \quad \text{a.e. in } \Omega\setminus\{0\}, \ea which implies \eqref{est-sum}. By Theorem \ref{existence4}, $u_{\nu_{r,\delta},0,n} \leq v_{\nu_{r,\delta}}$ a.e. in $\Omega \setminus \{0\}$, where $v_{\nu_{r,\delta}}$ is the unique solution of \bal \left\{ \begin{aligned} \CL_\mu^s v&=\nu_{r,\delta}&&\quad\text{in}\;\, \Omega,\\ v&=0&&\quad\text{in}\;\,\BBR^N\setminus\Omega. \end{aligned} \right. \eal The existence and uniqueness of $v_{\nu_r,\varepsilon}$ is guaranteed by Theorem \ref{existence2}. Moreover $v_{\nu_r,\delta} \geq 0$ and for any $b<2s-\tau_+$, \bal \| v_{\nu_r,\delta} \|_{L^1(\Omega;|x|^{-b})} \leq C(N,\Omega,s,\mu,b)\| \nu_{r,\delta} \|_{L^1(\Omega;|x|^{\tau_+})} \leq C(N,\Omega,s,\mu,b,r)\| \nu \|_{\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega \setminus \{0\};|x|^{\tau_+})}. \eal We also note that $\Phi_{s,\mu}^\Omega \in L^1(\Omega;|x|^{-b})$. Therefore, by the monotone convergence theorem, $u_{\nu_{r,\delta},\ell,n} \to u_{\nu_{r,\delta},\ell}$ in $L^1(\Omega;|x|^{-b})$ as $n \to \infty$. By Lemma \ref{Marcin-3}, \bal \| v_{\nu_{r,\delta}} \|_{L_w^{\frac{N}{N-2s}}(\Omega \setminus \{0\};|x|^{\tau_+})} \leq C(N,\Omega,s,\mu,r) \| \nu_{r,\delta} \|_{L^1(\Omega \setminus \{0\};|x|^{\tau_+})}, \eal which implies \ba \label{Marcin-4} \| u_{\nu_{r,\delta},0,n} \|_{L_w^{\frac{N}{N-2s}}(\Omega \setminus \{0\};|x|^{\tau_+})} \leq C(N,\Omega,s,\mu,r) \| \nu_{r,\delta} \|_{L^1(\Omega \setminus \{0\};|x|^{\tau_+})}, \quad \forall n \in {\mathbb N}. \ea We can also check that \ba \label{Marcin-5} \| \Phi_{s,\mu}^\Omega \|_{L_w^{\frac{N+\tau_+}{-\tau_-}}(\Omega \setminus \{0\};|x|^{\tau_+})} \leq C(N,s,\mu). \ea Combining \eqref{ulnPhi}, \eqref{Marcin-4} and \eqref{Marcin-5} yields \bal \| u_{\nu_{r,\delta},\ell,n} \|_{L_w^{p_{s,\mu}^*}(\Omega \setminus \{0\};|x|^{\tau_+})} \leq C(N,\Omega,s,\mu,r) \| \nu_{r,\delta} \|_{L^1(\Omega \setminus \{0\};|x|^{\tau_+})} + C(N,s,\mu,\ell), \quad \forall n \in {\mathbb N}. \eal Then Lemma \ref{lem:equi} ensures that the sequence $\{ g_n(u_{\nu_{r,\delta},\ell,n}) \}$ is uniformly bounded and equi-integrable in $L^1(\Omega;|x|^{\tau_+})$. On the other hand, we derive that $g_n(u_{\nu_{r,\delta},\ell,n}) \to g(u_{\nu_{r,\delta},\ell})$ a.e. in $\Omega \setminus \{0\}$ as $n \to \infty$. By the Vitali convergence theorem, we conclude that $g_n(u_{\nu_{r,\delta},\ell,n}) \to g(u_{\nu_{r,\delta},\ell})$ in $L^1(\Omega;|x|^{\tau_+})$ as $n \to \infty$. Therefore, by sending $n \to \infty$ in \eqref{solg(un)-rldirac}, we derive \ba\label{solg(un)-ldirac} \int_\Omega u_{\nu_{r,\delta},\ell}(-\Delta)^s_{\tau_+}\psi dx+\int_\Omega g(u_{\nu_{r,\delta},\ell})\psi|x|^{\tau_+} dx= \int_{\Omega \setminus \{0\}}\psi |x|^{\tau_+}\nu_{r,\delta}dx + \ell\int_{\Omega}\Phi_{s,\mu}^\Omega (-\Delta)^s_{\tau_+}\psi dx \ea for all $\psi\in \mathbf{X}_\mu(\Omega;|x|^{-b})$. By a similar argument as above, we can show that $u_{\nu_{r,\delta},\ell} \to u_{\nu_{r},\ell}$ a.e. in $\Omega \setminus \{0\}$ and in $L^1(\Omega;|x|^{-b})$ for any $b<2s-\tau_+$ and $g(u_{\nu_{r,\delta},\ell}) \to g(u_{\nu_{r},\ell})$ a.e. in $\Omega \setminus \{0\}$ and in $L^1(\Omega;|x|^{\tau_+})$ as $\delta \to 0$. By letting $\delta \to 0$ in \eqref{solg(un)-ldirac}, we obtain \ba\label{solg(un)-rdirac} \int_\Omega u_{\nu_{r},\ell}(-\Delta)^s_{\tau_+}\psi dx+\int_\Omega g(u_{\nu_{r},\ell})\psi|x|^{\tau_+} dx= \int_{\Omega \setminus \{0\}}\psi |x|^{\tau_+}d\nu_{r} + \ell\int_{\Omega}\Phi_{s,\mu}^\Omega (-\Delta)^s_{\tau_+}\psi dx \ea for all $\psi\in \mathbf{X}_\mu(\Omega;|x|^{-b})$. Next we see that $\nu_{r',\delta} \geq \nu_{r,\delta}$ for any $0<r<r'$. By the Kato type inequality \eqref{Kato:+-1} and the monotonicity of $g$, we deduce that $u_{\nu_{r',\delta},\ell} \leq u_{\nu_{r,\delta},\ell}$. It follows that $u_{\nu_{r'},\ell} \leq u_{\nu_{r},\ell}$ for any $0<r<r'$. Put $u_{\nu,\ell}=\lim_{r \to 0}u_{\nu_{r},\ell}$. Next by taking $\psi=\xi_b$, the solution of problem \eqref{xib}, we deduce that for any $b<2s-\tau_+$, \bal \| u_{\nu_{r},\ell} \|_{L^1(\Omega;|x|^{-b})} + \| g(u_{\nu_{r},\ell}) \|_{L^1(\Omega;|x|^{\tau_+})} \leq \| \nu \|_{\mathfrak M} \def\GTN {\mathfrak N} \def\GTO {\mathfrak O(\Omega \setminus \{0\};|x|^{\tau_+})} + C(N,s,\mu,\ell). \eal Therefore, from the monotone convergence theorem and the monotonicity of $g$, we deduce that $u_{\nu_{r},\ell} \to u_{\nu,\ell}$ in $L^1(\Omega;|x|^{-b})$ and $g(u_{\nu_{r},\ell}) \to g(u_{\nu,\ell})$ in $L^1(\Omega;|x|^{\tau_+})$ as $r \to 0$. Thus, letting $r \to 0$ in \eqref{solg(un)-rdirac}, we obtain \bal \int_\Omega u_{\nu,\ell}(-\Delta)^s_{\tau_+}\psi dx+\int_\Omega g(u_{\nu,\ell})\psi|x|^{\tau_+} dx= \int_{\Omega \setminus \{0\}}\psi |x|^{\tau_+}d\nu + \ell\int_{\Omega}\Phi_{s,\mu}^\Omega (-\Delta)^s_{\tau_+}\psi dx \eal for all $\psi\in \mathbf{X}_\mu(\Omega;|x|^{-b})$. It means $u_{\nu,\ell}$ is a weak solution to problem \eqref{eq:g(u)-kdirac-sum}. \end{proof} \begin{proof}[\textbf{Proof of Theorem \ref{dirac=-sum}}] The proof of this theorem can be proceeded similarly to that of Theorem \ref{dirac>-sum}. \end{proof}
\section{Feature Descriptions} \label{appsec:data_description} Tables~\ref{tab:ooni_features} and~\ref{tab:satellite_features} contain complete lists of the features we extract from OONI and Satellite to train ML models. \begin{table}[t] \resizebox{\columnwidth}{!}{ \begin{tabular}{l|l|l|l} \toprule \textbf{Feature Name} & \textbf{\makecell{Feature\\Type}} & \textbf{\makecell{One-Hot\\Encoding}} & \textbf{Derived} \\ \midrule Measurement\_start\_time* & continuous & N & N\\ probe\_asn & discrete & Y & N \\ probe\_network\_name & discrete & Y & N \\ resolver\_asn & discrete & Y & N \\ resolver\_network\_name & discrete & Y & N \\ test\_runtime & continuous & N & N \\ test\_start\_time* & continuous & N & N \\ dns\_experiment\_failure & discrete & N & N \\ dns\_consistency & discrete & N & Y \\ http\_experiment\_failure* & discrete & Y & N \\ body\_length\_match & discrete & N & Y \\ body\_proportion & continuous & N & Y \\ status\_code\_match & discrete & N & Y \\ headers\_match & discrete & N & Y \\ title\_match & discrete & N & Y\\ test\_keys\_asn & discrete & Y & N \\ test\_keys\_as\_org\_name& discrete & Y & N \\ \bottomrule \end{tabular}} \caption{Features extracted from OONI that are used in training our machine learning models.} \label{tab:ooni_features} \end{table} \begin{table}[t] \resizebox{\columnwidth}{!}{ \begin{tabular}{l|l|l|l|l} \toprule \textbf{Feature Name} & \textbf{\makecell{Feature\\Type}} & \textbf{\makecell{One-Hot\\Encoding}} & \textbf{Derived} & \textbf{Repetitions}\\ \midrule untagged\_controls & Discrete & N & N & NA \\ untagged\_response & Discrete & N & N & NA \\ passed\_liveness & Discrete & N & N & NA \\ connect\_error & Discrete & N & N & NA \\ in\_control\_group & Discrete & N & N & NA \\ excluded\_below\_threshold & Discrete & N & N & NA \\ delta\_time & Continuous & N & Y & NA \\ control\_response\_start\_success & Discrete & N & Y & NA \\ control\_response\_start\_has\_type\_a & Discrete & N & N & NA \\ control\_response\_start\_rcode & Discrete & Y & N & NA \\ control\_response\_end\_has\_type\_a & Discrete & N & N & NA \\ control\_response\_end\_rcode & Discrete & Y & N & NA \\ test\_query\_successful & Discrete & N & Y & NA \\ test\_query\_unsuccessful\_attempts & Continuous & N & Y & NA \\ test\_noresponse\_i\_has\_type\_a & Discrete & Y & N & 4 \\ test\_noresponse\_i\_rcode & Discrete & Y & N & 4 \\ test\_response\_has\_type\_a & Discrete & Y & N & NA \\ test\_response\_rcode & Discrete & Y & N & NA \\ test\_response\_IP\_count & Continuous & N & Y & NA \\ more\_IPs & Discrete & N & Y & NA \\ include\_IP\_i & Discrete & N & Y & 5 \\ test\_response\_i\_IP\_match & Discrete & Y & Y & 5 \\ test\_response\_i\_http\_match & Discrete & Y & Y & 5 \\ test\_response\_i\_cert\_match & Discrete & Y & Y & 5 \\ test\_response\_i\_asnum\_match & Discrete & Y & Y & 5 \\ test\_response\_i\_asname\_match & Discrete & Y & Y & 5 \\ test\_response\_ i\_match\_percentage & Continuous & N & N & 5 \\ test\_response\_i\_asnum* & Discrete & Y & N & 5 \\ average\_matchrate & Continuous & N & N & NA \\ \bottomrule \end{tabular}} \caption{Features extracted from Satellite that are used in training our machine learning models.} \label{tab:satellite_features} \end{table} \section{Additional results} \label{appsec:additional_results} \begin{table}[t] \centering \resizebox{\columnwidth}{!}{ \begin{tabular}{l|llllll} \toprule ASN& \makecell{Number of\\IPs} &\makecell{Domains Tested} &\makecell{Number of\\OONI DNS\\Blockings} &\makecell{Number of\\Inconsistent OONI\\DNS Blockings} &Inconsistency Rate &\makecell{Contribution to\\Total Inconsistent\\Measurements}\\ \midrule AS134775&0.3M&2&0&0&0.00\% & 0.00\%\\ AS56040&2M&1&0&0&0.00\%&0.00\%\\ AS56047&0.7M&15&1&0&0.00\%&0.00\%\\ AS132525&0.4M&2&1&0&0.00\%&0.00\%\\ AS4538&17M&1&1&1&100.0\%&0.18\%\\ AS56044&1.0M&2&1&0&0.00\%&0.00\%\\ AS17622&0.7M &12& 2& 0&0.00\% &0.00\%\\ AS56048& 1.2M &11 &5& 1& 20.00\%& 0.18\%\\ AS4812& 8.6M &8 &4 &0& 0.00\% &0.00\%\\ AS17816& 4.0M &30& 4 &0& 0.00\% &0.00\%\\ AS4808& 8.3M &40& 17& 4 &23.53\%& 0.71\%\\ AS17926& 0.7M& 2033 &117 &52 &44.44\% &9.22\%\\ AS9808& 36.4M& 460 &134& 2& 1.49\% &0.35\%\\ AS134773& 0.2M& 1289 &392& 15& 3.83\% &2.66\%\\ AS17624 &1.0M &1421& 429 &23 &5.36\% &4.08\%\\ AS4837 &60M& 1640&449 &22& 4.90\% & 3.90\%\\ AS56046 &3.0M &1664 &480 &34 &7.08\% &6.03\%\\ AS140308 &0.2M &1847& 817 &332 &40.64\% &58.87\%\\ AS4134 &110.7M& 1970& 564& 79 &14.01\% &14.01\%\\ \midrule Total &255.6M &12448 &3418 &564 &16.50\% &100.00\%\\ \bottomrule \end{tabular} } \caption{A comparison of inconsistency rates and contributions to total inconsistent measurements between OONI and GFWatch.} \label{tab:ooni_one_month} \end{table} \myparab{Feature weights for OONI data.} Tables~\ref{tab:satellite_fi} and~\ref{tab:ooni_fi} contain the feature importance of the optimal models chosen in this study. For models including OCSVM\_SGD and XGBoost, the SHAP values \cite{lundberg2017unified}) are used to measure the feature contributions to the prediction results. For Isolation Forest models, the feature importance of features are computed by measuring their average frequencies of utilization by the different trees. We provide the top 10 features for all models because features beyond this range show negligible importance. \begin{table}[t] \centering \resizebox{\columnwidth}{!}{ \begin{tabular}{l?l?l} \toprule \textbf{\makecell{Rank}} & \textbf{\makecell{OCSVM\_SGD (GFWatch Labels)\\Feature Importance}}& \textbf{\makecell{XGBoost (GFWatch Labels)\\Feature Importance}}\\ \midrule 1&test\_noresponse\_i\_rcode (0.102)&test\_response\_i\_asnum (0.912)\\ 2&untagged\_response (0.096) &test\_response\_i\_IP\_match (0.010)\\ 3&test\_response\_i\_match\_percentage (0.081)&test\_response\_i\_asnum\_match (0.009)\\ 4&test\_noresponse\_i\_has\_type\_a (0.080)&test\_noresponse\_i\_rcode (0.009)\\ 5&test\_response\_i\_IP\_match (0.074)&test\_response\_i\_asname\_match (0.009)\\ 6&test\_response\_i\_asnum\_match (0.069)&test\_response\_i\_cert\_match (0.009)\\ 7&test\_response\_i\_asname\_match (0.068)&test\_response\_i\_http\_match (0.009)\\ 8&test\_response\_i\_http\_match (0.056)&test\_noresponse\_i\_has\_type\_a (0.006)\\ 9&test\_response\_i\_cert\_match (0.056)&include\_IP\_i (0.006)\\ 10&test\_query\_successful (0.054)&test\_response\_i\_match\_percentage (0.003)\\ \bottomrule \end{tabular}} \caption{Top 10 feature importance for OCSVM\_SGD and XGBoost classifiers when using Satellite data.} \label{tab:satellite_fi} \end{table} \begin{table}[t] \centering \resizebox{\columnwidth}{!}{ \begin{tabular}{l?l?l?l} \toprule \textbf{\makecell{Example IPs}} & \textbf{\makecell{Missed by\\ OONI}} & \textbf{\makecell{Missed by\\ GFWatch}}& \textbf{\makecell{Missed by\\ Both}} \\\hline 199.19.54.1&Y&Y&Y\\ 199.19.56.1&Y&Y&Y\\ 199.19.57.1&Y&Y&Y\\ 203.98.7.65&Y&N&N\\ 8.7.198.45&Y&N&N\\ 59.24.3.173&Y&N&N\\ 243.185.187.39&Y&N&N\\ 4.36.66.178&Y&N&N\\ 203.161.230.171&Y&N&N\\ 157.240.18.18&Y&N&N\\ 174.37.54.20&Y&N&N\\ 74.86.3.208&Y&N&N\\ 64.33.88.161&Y&N&N\\ \bottomrule \end{tabular}} \caption{Example instances of injected forged IPs detected across models when using OONI data.} \label{tab:ips} \end{table} \begin{table} \centering \resizebox{\columnwidth}{!}{ \begin{tabular}{lllllllll} \toprule Model & ASN Included & TPR& FPR& TNR & FNR& Acc.&Prec.\\ \midrule Supervised (XGBoost) & Y & \textbf{99.4} & 0.9 &99.1&0.6& 99.1 & 95.4 \\ Supervised (XGBoost) & N & \textbf{99.4} &1.4&98.6& 0.6 & 98.7& 93.3\\ \midrule Unsupervised (OCSVM\_SGD) & Y & \textbf{99.2} &19.3 &80.7&0.7& 83.8 & 50.1 \\ Unsupervised (OCSVM\_SGD) & N & \textbf{99.1} & 17.4&82.6&0.9& 85.3 & 52.7 \\ \bottomrule \end{tabular}} \caption{Satellite model performance with and without including ASN in the features when trained, validated, and tested using GFWatch labels.} \label{tab:satelliteasndropping} \vspace*{-15pt} \end{table} \section{Motivation} \label{sec:motivation} The Domain Name System~(DNS) plays a foundational role on the Internet~\cite{rfc1035} by translating human-readable domain names to corresponding IP addresses. DNS is thus necessary for the initiation of almost every online communication. The insecure design of DNS~\cite{rfc1035} makes it a popular means for censorship~\cite{Aryan:2013, Pearce:2017:Iris, USESEC21:GFWatch, Padmanabhan2021AMV}. State-sponsored censors can use DNS to point users to invalid IPs or redirect them to a blockpage by modifying DNS resource records at ISP-provided resolvers~\cite{Pearce:2017:Iris, Padmanabhan2021AMV, hoang:2019:measuringI2P, hoang2022measuring, USESEC21:GFWatch, Nourin2023:TMC}. \subsection{Measuring DNS Censorship is Challenging} As a countermeasure, censored users may rely on public resolvers (e.g., \texttt{8.8.8.8}, \texttt{1.1.1.1}) to bypass DNS manipulation occurring at default DNS resolvers, such as the ones operated by their ISPs. Nevertheless, upon detecting censored domains from users' queries, an on-path filtering system can still inject forged responses~\cite{Satellite, Iris, niaki2020iclab}. China, for example, is known to use on-path DNS filtering systems~\cite{Sparks:CCR2012, holdonDNS, USESEC21:GFWatch}. Despite its prevalence, DNS manipulation is challenging to measure. A common challenge faced by censorship measurement platforms concerns drawing inferences about whether censorship is taking place. For example, in the case of DNS, a censorship event, such as via manipulation or redirection, can sometimes be difficult to detect reliably because DNS responses vary depending on time and geography as part of normal operations. As a result, even the most advanced and reliable heuristic-based approaches in DNS censorship detection may not result in a complete absence of false negatives, i.e., missing censorship instances, despite the fact that they are built to continuously monitor DNS censorship. To this end, we explore how some of those challenges can cause censorship measurement systems to reach inconsistent conclusions about DNS manipulation (\sectionref{subsec:heuristics}). Furthermore, heuristic-based approaches that prioritize high precision require significant effort and resources, as they necessitate ongoing censorship confirmation procedures such as the verification of censorship instances with local advocacy groups within censored locations, which can be both time-consuming and costly. These outstanding shortcomings lead us to consider, in this paper, whether and how machine-learning models could improve upon these existing rule-based systems (\sectionref{subsec:ml}). \begin{figure*}[t] \includegraphics[width=\textwidth]{figures/ooni_vs_satellite.pdf} \caption{A longitudinal comparison of China's DNS censorship measured by OONI and Satellite.} \label{fig:ooni_cp_compare} \end{figure*} \subsection{Rule-Based Heuristics Are Inconsistent} \label{subsec:heuristics} Different tools have developed static, rule-based heuristics to detect censorship. Unfortunately, these heuristics (and the lack of ground truth labels to properly design them) have led to inconsistent inferences among different heuristic techniques. For example, one approach to detect DNS censorship is to compare responses obtained via a vantage point being tested with responses obtained via a control server located in a network where it is believed that censorship is not occurring. This approach can be effective when forged DNS responses contain static records that have been known to be invalid (e.g., private non-routable IPs, NXDOMAIN) or point to blockpages~\cite{rfc8020, syriacensorship, Aryan:2013, Padmanabhan2021AMV}. Unfortunately, this heuristic results in erroneous conclusions when forged DNS responses contain dynamic records created by censors to confuse detection. China's Great Firewall (GFW) engages in such behavior~\cite{Tripletcensors, USESEC21:GFWatch}. To show the impact of such an adversarial behavior on DNS censorship detection, we performed a longitudinal comparison between DNS censorship measurements collected by OONI and Satellite. We analyzed measurements for China collected by both platforms over 32 weeks, from July 1, 2021 to February 9, 2022~\footnote{Both platforms have been collecting datasets prior to this period, yet, to ensure consistency, we opt to analyze data from July 2021 because this is the first full month after the Censored Planet team made the latest modifications to Satellite v2.2~\cite{Satellitev2.2}.}. Although both platforms test the same list of domains curated by the Citizen Lab~\cite{CitizenLabtestlist}, they have different testing frequencies. We thus perform our comparisons using biweekly time intervals to (1)~make the sets of results comparable; and (2)~ensure that the set of domains tested overlaps as much as possible. When the same domain is tested multiple times over two weeks, its blocking status is determined by the blocking status of the majority of all tests. As shown in Figure~\ref{fig:ooni_cp_compare}, there are around 1.6K common domains tested biweekly by both platforms (note that the y-axis is in log-scale for better visibility of the plot). Although both platforms agree largely on domains that are \emph{not} censored ($75\%$ of tested domains), the number of `DNS anomaly' cases (i.e., a potential sign of DNS manipulation) is relatively small ($<0.5\%$ most of the time). Such discrepancies exist because each platform has a different design and employs different `anomaly' inference heuristics, and thus being susceptible to dynamic and adversarial filtering behaviors of censors like China's GFW. To measure DNS censorship, both platforms issue DNS lookups for test domains from their control servers and vantage points. DNS responses are then compared to mark anomaly cases (i.e., likely censorship) if significant inconsistency exists among these responses. However, the characteristics of vantage points used by these platforms are inherently different since Satellite leverages public infrastructures (e.g., open resolvers) whereas OONI relies on volunteer-based tests. These probes are mostly conducted from residential networks which may experience localized filtering policies (e.g., parental controls, school or corporate firewalls). This can cause these platforms to arrive at different conclusions when inferring country-level censorship. We sample one month (July 2021) of OONI data from China, which performs DNS censorship~\cite{Tripletcensors, USESEC21:GFWatch}. We cross-validate DNS anomalies observed by OONI with data from GFWatch~\cite{USESEC21:GFWatch}, a measurement system that focuses primarily on monitoring DNS filtering in China. We find that many of OONI's DNS anomalies are from probes conducted in ASes allocated with a small number of IPs (e.g., AS17926, AS140308) that may be experiencing localized filtering policies, and may not represent China's national-level censorship as they are inconsistent with those detected by GFWatch for national-level DNS censorship. Table~\ref{tab:ooni_one_month} in the Appendix~\ref{appsec:additional_results} shows more details. \subsection{Machine Learning Models May Help}\label{subsec:ml} Machine learning has emerged as an effective approach to scale up the detection and classification of vulnerabilities in many security~\cite{ho2019detecting, zhu2016featuresmith, arp2014drebin, hounsel2020identifying} and networking~\cite{mirsky2018kitsune,yang2020feature} contexts, including malware, network anomaly and disinformation detection. Both supervised models~\cite{alpaydin2020introduction}, which use labeled data for training, as well as unsupervised models~\cite{aggarwal2017introduction} that aim to detect deviations from `normal' behavior have been used. Tree-based classifiers work well and are interpretable~\cite{ho2019detecting, hounsel2020identifying}. Recent work has also focused on creating measures of interpretability for features that are model-agnostic and suited for applications beyond computer vision and language~\cite{guo2018lemna, lundberg2017unified}. These developments, in conjunction with the recent widespread availability of measurement data from censorship measurement tools such as OONI and Censored Planet, motivate us to investigate whether ML can help automate censorship detection using trained models. \section{Discussion and Future Work} \label{sec:discussion} \myparab{Synthesizing disparate information sources.} One of the main insights we have obtained in the course of this research is the effectiveness of combining disparate sources of information for the purposes of censorship detection. Comparing the outputs of heuristics and ML models led to the identification of new instances of censorship. Further, using records from one source and labels from another allows us to make use of sources of records like Satellite where the labeling method has been deprecated. Using unsupervised models, we are also able to consistently find common domains for which both records from OONI and Satellite indicate possible DNS censorship (Figure \ref{fig:prediction_ooni_vs_satellite}). This allows us to effectively bypass the lack of reliable labels from the data sources. It also makes effective use of multiple sets of measurements, with the set of overlapping domains being extremely likely targets of censorship. Aggregating predictions over time also allows us to increase confidence in whether a domain is actually censored. Thus, synthesizing information from different models (including heuristics), at different times, allows for reliable determination of censorship trends. \myparab{Generalization across countries.} An important direction for future work is to validate if models trained on data from one country will generalize to another. To test if our models will be effective at this, we dropped all the country- and region-specific features such as AS numbers from our data before retraining. In Table~\ref{tab:satelliteasndropping}, we can see that even without these features, both supervised and unsupervised models perform well. This is important in particular for unsupervised models, since the lack of a system like GFWatch can then be overcome by using a model of ``normal'' behavior obtained from other countries to detect censorship in countries whose DNS control systems are poorly understood. \myparab{Looking ahead.} We believe that future efforts to build censorship detection systems should employ both heuristics and the outputs of trained ML models. This is because hand-labeled methods like GFWatch are imperfect and cannot cover all variations of censorship within each country. Moreover, since `ground-truth' datasets like GFWatch do not exist for countries other than China, our results indicate that unsupervised models can be used as a general-purpose tool for discovering DNS censorship in countries around the world. However, our analysis of the cases where inconsistencies arise between heuristics and ML models reveals that the former act as an important backstop, with our models sometimes missing `obvious' instances of censorship or being overly aggressive in marking censorship). Overall, our results point to the need for an ensemble of models and heuristics whose design is carefully calibrated by expert supervision for reliable detection of censorship. \section{Introduction} \label{sec:intro} As the Internet becomes an indispensable medium for modern communications, authoritarian governments are increasingly making use of technologies to control the free flow of online information, especially in repressive regimes~\cite{deibert2020reset, Aryan:2013, Ramesh2020DecentralizedCA, USESEC21:GFWatch}. In response, there have been tremendous efforts by researchers and other stakeholders committed to Internet freedom to detect and circumvent Internet censorship around the world~\cite{Tor, filasto2012ooni, Nobori2014, Pearce:2017:Iris, Bock2019GenevaEC, niaki2020iclab, Raman2020CensoredPlanet}. Measurement platforms such as OONI~\cite{filasto2012ooni} have been collecting large-scale datasets of global censorship to highlight its prevalence, as well as the mechanisms used to implement it~\cite{niaki2020iclab, Raman2020CensoredPlanet}. These datasets consist of network probes conducted via remote vantage points; the resulting measurements are typically compared against known censorship `signatures', based on anecdotes and heuristics, to confirm cases of censorship~\cite{OONI-rules}. Unfortunately, censorship detection via such heuristics can be quite brittle, because censors {\em adapt}; specifically, they routinely change their blocking behaviors to evade fixed rules and heuristics, which can render these rule-based approaches far less effective and accurate~\cite{Tripletcensors, USESEC21:GFWatch}. This situation is further investigated in \sectionref{sec:motivation} where we analyze two large-scale censorship datasets and find that they disagree considerably on the blocking status (i.e., `anomaly'~\footnote{The term ``anomaly'' refers to a network probe in which censorship is suspected. According to these platforms themselves, this `anomaly' may or may not be instances of actual censorship~\cite{OONI_qa}.}) of many domain names despite employing similar heuristic approaches. Given the inconsistencies we observe between heuristics and the need for accurate censorship detection, we aim to explore more robust, automated approaches. Machine learning (ML) methods are a potentially compelling and sensible alternative in this context, due to the plethora of measurement data, the existence of patterns that can be discovered, and in some cases even the existence of labels. Furthermore, recent advances in ML have enabled efficient, large-scale and interpretable anomaly detection, with promising results in adjacent domains, such as malware~\cite{arp2014drebin,ho2019detecting,zhu2016featuresmith} and disinformation detection~\cite{hounsel2020identifying}. The availability of large-scale censorship datasets, along with the existence of easy-to-use, yet scalable ML methods compels us to investigate \textit{whether ML models can assist in detecting DNS-based censorship}. Specifically, by applying different ML models to datasets collected by DNS censorship measurement platforms, we examine \textit{whether we can successfully identify instances of Internet censorship while reducing dependence on hardcoded heuristics.} The first step in training reliable ML models in any new domain is data engineering; that is, obtaining clean data in the appropriate format. For this study, we cleaned and formatted millions of probes/records~\footnote{We use probes and records interchangeably throughout.} over 7 months from the two prevailing large-scale measurement platforms, Satellite \cite{Satellite} (maintained as part of the Censored Planet platform~\cite{Raman2020CensoredPlanet}) and OONI \cite{filasto2012ooni}. We focus our analysis on two countries: China and the US (\sectionref{sec:method}). Unfortunately, we discovered that the measurement data from Satellite and OONI could not directly be used to train ML models, due to challenges such as inconsistent data formatting, the presence of irrelevant features, and incomplete records (e.g., failed measurements). Our \textbf{first contribution} was thus to transform these datasets into a \emph{curated format amenable to ML}, generating two datasets with over $3.5$M records from Satellite and $1.2$M records from OONI ~(\cref{sec:method}). These datasets will be open-sourced for the community's use. After performing appropriate data engineering, we study the feasibility of ML models for DNS censorship detection. We consider models from the two main ML paradigms, \emph{supervised} and \emph{unsupervised} learning. \emph{Supervised models} require labeled data and we use labels obtained from the accompanying heuristics for each data source to label each record. Additionally, when it comes to measure DNS censorship in China, the GFWatch~\cite{USESEC21:GFWatch} platform presents an alternative source of labels for existing probes. This third dataset enables us to make an important and new methodological innovation when using ML for censorship detection: {\em training models on the same records, with labels obtained from different sources} enables higher-confidence detection, even in the absence of ground truth labels. In the context of \emph{unsupervised models}, we extend this approach to more accurately identify ``clean'' (i.e., uncensored) records, which we then use to build a model of ``normal'' behavior. \textbf{The second contribution} of this study is thus a thorough analysis of the ability of ML models to both learn existing rules about censorship detection, as well as to find new instances of (suspected) censorship in large-scale datasets (\cref{subsec:results_original_rq}). Given the lack of ``ground-truth'' information about the censorship of a given probe, it is challenging to train ML models that act as perfect indicators of censorship. Regardless, we show that ML models enable the discovery of new instances and signatures of censorship at scale, providing a valuable additional perspective for censorship detection. Our key research questions and results are as follows: \myparab{RQ 1.} \emph{\textbf{Can supervised models learn anomaly detection heuristics employed by different measurement platforms?}} Yes. Given data with anomaly labels assigned by a measurement platform's heuristics, optimal supervised models can achieve true positive rates (TPR) in excess of $90\%$ while maintaining low false positive rates (FPR) below $5\%$ (Table~\ref{tab:supervised_all_results}). This demonstrates that there is a generalizable signal of anomalous behavior in the records that is highly correlated with the given labels that can be learned, regardless of whether the labels themselves are accurate. \myparab{RQ 2.} \emph{\textbf{Can supervised models infer DNS censorship using records and labels collected from independent sources?}} Yes. Using GFWatch labels for records from both Satellite and OONI, we find that supervised models can obtain high TPRs ($99.4\%$ for Satellite and $86.7\%$ for OONI) with respect to these labels as well. This result highlights the richness of the censorship signal contained within these probes as well as the methodological soundness of using multiple labels for a given record. Because GFWatch labels only contain true positives by construction, the positive instances identified by these models are extremely likely to be true instances of censorship. In addition, our \emph{post facto} analysis shows these supervised models find instances of non-censorship and localized censorship that GFWatch has missed since the platform does not guarantee a \emph{zero} FNR. \myparab{RQ 3.} \emph{\textbf{Can unsupervised models discern censorship instances that existing, state-of-the-art heuristics miss?}} Yes. Our unsupervised models, trained on clean records unlikely to contain any instances of censorship, are able to detect anomalous records with a high level of agreement with existing heuristics (Table \ref{tab:unsupervised_all_results}). Further, an in-depth case analysis of the disagreements between model predictions and the anomaly status determined by any of the heuristics shows these often occur in corner cases missed by heuristics. For instance, among false negative cases, unsupervised models are able to discern instances of temporarily accessible domains due to firewall failures, which GFWatch is not designed to detect. Among false positives, we find instances of censorship occasionally missed by all existing heuristics due to their reliance on hard-coded rules. These results demonstrate how unsupervised models can complement existing methods to create more comprehensive censorship detection systems. A deeper analysis of results reveals (\cref{sec:results_in_depth}) that we can map the predicted censorship instances back to their original records, resulting in the discovery of \textit{hundreds of injected fake IP addresses} that can serve as blocking signatures to confirm DNS censorship but are overlooked by current heuristics. Feature importance analysis shows the most important features are interpretable, and can be explained from first principles, increasing our confidence that the models that are learned automatically are relying on the appropriate signals for detecting censorship. These results collectively demonstrate that ML models can learn existing anomaly detection heuristics at scale, even when the heuristics used to label the data are independent of the particular measurement dataset. This observation makes it possible to ensemble models for detecting censorship. We discuss potential future directions in \cref{sec:discussion}. Our code and curated datasets are open-sourced~\footnote{\url{https://github.com/noise-lab/automated-dns-censorship}} for the community to provide a strong foundation for further research efforts towards improving ML-based censorship detection. \section{Method} \label{sec:method} In this section, we describe how we curate training datasets to train ML models from the Satellite and OONI datasets. We also describe the ML pipeline that uses supervised and unsupervised models to detect DNS censorship. \subsection{Datasets} \label{sec:datasets} To the best of our knowledge, active platforms that are still collecting and publishing global censorship data at the time of writing include the Open Observatory of Network Interference~\cite{filasto2012ooni} and Censored Planet~\cite{Raman2020CensoredPlanet}, whose datasets we use for our analysis in this study. Many other studies have investigated regional censorship~\cite{Aryan:2013, pakistancensorship, khattak.2014.isp, Yadav2018, Bock2020DetectingAE, Nourin2023:TMC}. \myparab{Open Observatory of Network Interference (OONI)~\cite{filasto2012ooni}.} Launched in 2012, OONI is one of the earliest platforms developed to measure global censorship. The OONI Probe software is built with different modules running on a volunteer's device. These modules test the connectivity of websites, instant messaging services, and censorship-circumvention applications (e.g., virtual private networks, Tor~\cite{Tor}). To date, OONI volunteers have conducted 986.6M measurements from 24.2K network locations in 200 countries around the world. Numerous case studies on regional censorship have been conducted based on this massive dataset~\cite{xynou_how_2021, xynou_zambia_2021, xynou_uganda_2021, basso_measuring_nodate, xynou_russia_2021, xynou_new_2022}. \myparab{Censored Planet~\cite{Raman2020CensoredPlanet}.} Unlike platforms that rely on volunteers~\cite{filasto2012ooni} or dedicated vantage points~\cite{niaki2020iclab}, Censored Planet takes advantage of public infrastructure and uses established measurement techniques (i.e., Satellite~\cite{Satellite}, Augur~\cite{Pearce2017AugurID}, Iris~\cite{Iris}, Quack~\cite{Quack}, and Hyperquack~\cite{Raman2020MeasuringTD}). Censored Planet curates several datasets that collectively cover both application and network-layer censorship. We use the Satellite dataset, which is based on the Iris tool~\cite{Pearce:2017:Iris}. Satellite DNS measurements are performed twice per week using more than 20K public resolvers in more than 170 countries. Since its initial launch, Satellite has gone through several revisions to improve accuracy and efficiency~\cite{Satellitev2.2}. \myparab{GFWatch~\cite{USESEC21:GFWatch}.} China has perhaps the most sophisticated censorship infrastructure of any nation-state, which motivated the development of GFWatch for determining censored domains in China. The platform performs daily large-scale DNS measurements for more than 400M domains using its own machines located at both sides of the ``Great Firewall'' (GFW), continuously monitoring the GFW's DNS filtering behavior. Unlike OONI and Satellite, the use of controlled machines enables GFWatch to ensure that the domains it determines to be censored, definitely are at a national-level. In addition, censored domains detected by GFWatch are frequently shared with owners of blocked domains and local Chinese advocacy groups. The groups can cross-check the results using their own independent testing infrastructure located in multiple network locations across the country. {\em We thus use GFWatch as an additional source of labels for records from both Satellite and OONI}, providing a label set with no false positives with respect to ground truth national-level censorship. GFWatch may still miss instances of local or regional censorship, and is thus not free of false negatives (\sectionref{sec:results}). \subsection{Data Labeling and Cleaning} \label{subsec:data_curation} Training first requires datasets that have minimal label errors and contain anomalies of the type we are hoping to detect. Table \ref{tab:dataset_details} summarizes these datasets. \myparab{Initial dataset and labels.} We examine data (\emph{records}) from China and the United States (US) from July 1, 2021 to February 9, 2022. We use \emph{labels} from Satellite~\footnote{While the `anomaly' field is now deprecated, it is available for the Satellite records within our time frame of investigation and we use it for data cleaning as well as testing model performance, with the caveat that their reliability is limited.} and OONI, as well as GFWatch as an alternative label source in the case of China. We note that records marked as ``anomalies'' \emph{may not} be censored~\cite{OONI_qa} since ground truth about censorship is challenging to obtain. This motivates our methodology of training multiple models with different labels for the same records, to obtain higher confidence predictions and to perform case analysis over the disagreements. We choose China as it has been shown to be one of the most sophisticated censors on the Internet. In particular, the country's DNS blocking mechanisms have continuously changed over the past two decades to hinder straightforward detection and circumvention~\cite{USESEC21:GFWatch}. If our models work well on China, they will also likely be capable of learning censors' signatures in other countries, as well as adapt to changes in censors' behavior over time. In addition, GFWatch is available as a highly credible alternative label source and enables us to train our models with different labels for the same records, each reflecting a partial view of the ground truth. Note that, using GFWatch labels for Satellite records is not perfect because of the different measurement frequency and misalignment of probing times. There may be periods in which a newly censored domain is probed by Satellite, but not yet probed and detected as censored by GFWatch. As a result, a machine learning model acting on Satellite records may identify the domain as censored even if it is not labeled as such. The same situation could happen in reverse if the GFWatch probe date occurs before Satellite. However, because the blocking status of domains change relatively infrequently, this time misalignment has no significant impact on our study. Since the US does not perform censorship through DNS manipulation at a national level, the data collected by both OONI and Satellite makes the US an ideal candidate as a control country. There are naturally some probes in the US that experience DNS blocking due to corporate firewalls or parental controls. These instances are detectable and we have removed them from our dataset. \myparab{Data sampling.} For countries with large Internet infrastructures like China and the US, there are thousands of open DNS resolvers that Satellite can use. These resolvers are probed twice a week with thousands of domains from the Citizen Lab test lists~\cite{CitizenLabtestlist}. We retain probes collected from vantage points located in autonomous systems (ASes) with large Internet-population ratios using the RIPE Atlas Population Coverage data~\cite{RIPE-PopCover}. This yields a representative dataset while maximizing coverage of the Chinese and US population. For OONI, the amount of probes collected in the US is disproportionately large compared to China. To address this issue, we downsample the US dataset uniformly at random to ensure a comparable ratio of US and CN probes relative to those from Satellite. Given more than one million records in our final training dataset, changing the composition of the random set has a negligible effect on the models' performance. \myparab{Verifying probe validity.} Neither OONI nor Satellite have control over the network environment of their volunteers and remote vantage points. Thus, tests can fail for reasons other than censorship, including misconfiguration or failure. For Satellite, we exclude probes if: (1) the initial control query fails to resolve, (2) the record shows \textit{zero} control resolvers with a valid response for the test domain, or (3) the total number of DNS responses received for the test domain is less than or equal to two across all countries during a single probing period (i.e., the test domain was not active at that moment). For OONI, we exclude probes if (1) its control test failed, (2) the ASN for the testing client or the client DNS resolver is missing or invalid (i.e., AS0), or (3) the \texttt{body\_proportion} value between the control and response HTML bodies is invalid, likely due to the inactivity of the tested website. Moreover, we only retain OONI records that are marked either as `accessible' or `DNS-tampered' since we are focusing on DNS censorship in this paper. \myparab{Classifying probes as ``clean'' or ``anomalous''.} Unsupervised models need ``clean'' records that are unlikely to be censored. Supervised models need to be trained on a mixed dataset with both ``clean'' records and ``anomalous'' records (probes with unclear censorship status). For Satellite, we classify a probe as ``clean'' only if it satisfies all of the following conditions: \begin{itemize}[wide, labelindent=3pt] \item It is not marked as ``anomaly'' by Satellite's heuristics and not marked as censored by GFWatch (China only). \item It does not contain features that could indicate censorship (i.e., a failed terminal control query). \item Every control query does not contain a connection error. \item The ground-truth ASN of the test domain appears in the Censys/MaxMind lookup of the IPs in the probe's \texttt{response} section. \end{itemize} For OONI, a record is considered as ``clean'' if (1) it is not marked as ``DNS tampered'' by OONI and is not marked as censored by GFWatch (China only), and (2) the returned IP(s) in its DNS response is consistent with the one(s) observed at OONI's control server. Records eliminated in this process are classified as ``anomalous'' and not used when training unsupervised models. We highlight the use of two different sources of labels for each dataset to more accurately identify ``clean'' records. \begin{table} \centering \resizebox*{\columnwidth}{!}{ \begin{tabular}{l|llll} \toprule & Satellite (CN) & Satellite (US)& OONI (CN) & OONI (US) \\ \midrule Initial & 1.85M & 1.74M & 937K & 28M \\ \textit{sans} errors & 1.76M & 1.73M & 671K & 590K \\ Clean & 1.14M & 1.54M & 496K & 590K \\ Anomalous & 618K & 189K & 175K & 0K \\ \midrule Initial Features & 68 & 68 & 17 & 17 \\ Post conversion & 1633 & 1633 & 77 & 77 \\ \bottomrule \end{tabular} } \caption{Number of records and features in curated datasets.} \label{tab:dataset_details} \vspace*{-25pt} \end{table} \subsection{Machine Learning Pipeline} \label{subsec:ml_pipeline} \begin{figure}[h] \includegraphics[scale=0.775]{figures/ml_pipeline_new.pdf} \caption{The machine learning pipeline for anomaly detection using Satellite/OONI datasets.} \label{fig:ml_pipeline_diagram} \vspace{-15pt} \end{figure} \myparab{Feature selection.} Both datasets include heterogeneous features such as IPs and domains. Since only a few records share the same values, we remove these features to reduce the likelihood of overfitting. For the remaining features, we keep the numerical ones (e.g., measurement time length) and convert the rest into categorical variables (e.g., response codes). We group features that are strings, such as \texttt{http\_experimental\_failure} into error groups before applying one-hot encoding. The features are then scaled and normalized. In addition, we are also interested in examining whether there is any performance gain if features (1) deemed as less-relevant to national-level DNS censorship by domain experts and (2) highly correlated with one another, are excluded. We compare the performance of the models with and without dropping those features and find negligible performance difference. See Tables~\ref{tab:satellite_features} and~\ref{tab:ooni_features} in Appendix~\ref{appsec:data_description} for the list of features extracted from both datasets~\footnote{Detailed descriptions of these features can be found in the OONI~\cite{ooni_fd} and Satellite~\cite{satellite_fd} documentations.}, with (*) indicating the features that we have tried excluding from our models. \myparab{Dataset curation.} We split the records into training, validation, and testing datasets as shown in Figure~\ref{fig:ml_pipeline_diagram}. For \emph{supervised models}, we create mixed datasets that contain \emph{both} ``clean'' and ``anomalous'' data (Table \ref{tab:supervised_all_results}). For \emph{unsupervised models} (Table \ref{tab:unsupervised_all_results}), the training dataset only contains ``clean'' data, while the validation and test datasets use all the probes. The two sets of records for China (OONI and Satellite) are labeled twice, once with their own labels and once using GFWatch, leading to two separate models. The validation data is used for hyperparameter selection while the test data is held-out and for performance evaluation. We conduct three-fold cross-validation and observe only small changes to the results. \myparab{Model selection.} Because the data is large, we select models that are both memory and computation efficient. For supervised models, we used Gradient Boosted Trees (XGBoost)~\cite{friedman2001greedy}, an ensemble learning algorithm based on distributed gradient-boosted decision trees. XGBoost performed better than all alternatives we tested such as SVMs and Random Forests. For unsupervised models, we chose One-Class SVMs (OCSVMs)~\cite{scholkopf2002learning} and Isolation Forests (IF)~\cite{liu2008isolation} because of their ability to train on large data sets. OCSVM can run in linear time when using the stochastic gradient descent (SGD) heuristic. We avoid neural networks due to their computational expense as well as recent work showing that on tabular data, tree-based models typically perform better \cite{grinsztajn2022tree}. We chose the optimal hyperparameter set using grid search. While we did not perform the search over all possible hyperparameters due to exponential growth in the grid search trial count, we did include the most important ones, such as maximum tree depth and tree number for XGBoost, as well as the maximum number of iterations for OCSVM. \myparab{Evaluation metrics.} We use multiple metrics to evaluate each model due to class imbalance across the dataset. In our terminology a ``positive'' label implies the presence of an anomaly, possibly indicating censorship, while a ``negative'' label implies no censorship. With this in mind, we report the true positive rate (sensitivity), the true negative rate (specificity), the false positive rate (FPR), and the false negative rate (FNR). Other metrics, such as the area-under-curve (AUC) and precision/recall, are also used to evaluate models' performance. We report overall accuracy but do not use it in our evaluation schemes because of the class imbalance. \section{Results} \label{sec:results} \begin{table*} \centering \resizebox{.75\textwidth}{!}{ \begin{tabular}{llllllll} \toprule Train/Val./Test Records & Train/Val./Test Labels & TPR& FPR& TNR & FNR& Acc.&Prec.\\ \midrule Satellite (China, Mixed) & GFWatch & \textbf{99.4} & 0.9 &99.1&0.6& 99.1 & 95.4 \\ Satellite (China, Mixed) & Satellite & \textbf{100} & 0.00 &100&0.00& 100 & 100 \\ \midrule OONI (China, Mixed) & GFWatch & \textbf{86.7} & 0.6&99.4&13.3& 96.1 & 98.1 \\ OONI (China, Mixed) & OONI & \textbf{99.8} & 0.2 &99.8&0.2& 99.8 & 99.1 \\ \bottomrule \end{tabular}} \caption{Performance of XGBoost, which is the most optimal \emph{supervised} model for both Satellite and OONI.} \label{tab:supervised_all_results} \vspace*{-15pt} \end{table*} \begin{table*} \centering \resizebox{.9\textwidth}{!}{ \begin{tabular}{lllllllll} \toprule Train Records & Val./Test Records & Val./Test Labels &TPR& FPR& TNR & FNR& Acc.&Prec.\\ \midrule Satellite (China, Clean) & Satellite (China, Mixed) & GFWatch & \textbf{99.1}&17.4&82.6& 0.9 & 85.3&52.7 \\ Satellite (China, Clean) & Satellite (China, Mixed) & Satellite & \textbf{100}&28.8&71.2& 0.00 & 74.3&29.6 \\ Satellite (US, Clean) & Satellite (US, Clean) & Satellite& \textbf{0.00} & 0.00 & 100 & 0.00 & 100 & 0.00\\ \midrule OONI (China, Clean) & OONI (China, Mixed) & GFWatch & \textbf{73.7}&10.0&90.0& 26.3 & 85.7& 72.4\\ OONI (China, Clean) & OONI (China, Mixed) & OONI & \textbf{88.8}&10.5&89.5& 11.1 & 89.3&68.9 \\ OONI (US, Clean) & OONI (US, Clean) & OONI & \textbf{0.00} & 0.00&100& 0.00 & 100&0.00\\ \bottomrule \end{tabular}} \caption{Performance of OCSVMs and IFs, which are the most optimal \emph{unsupervised models} for Satellite and OONI, respectively.} \label{tab:unsupervised_all_results} \vspace*{-15pt} \end{table*} We present a detailed analysis of the performance of both supervised and unsupervised ML models in this section in two parts. We first validate the use of ML for DNS censorship detection with respect to the research questions laid out in~\sectionref{sec:intro}. We analyze the false negatives and positives found by our models with respect to the 3 labeling heuristics used, uncovering errors in the heuristics as well as the discovery of new censorship instances. We then explore our results, with a focus on the interpretability of the results via feature importance analysis, along with case studies on new censorship behavior found by our models. \subsection{Evaluation at scale} \label{subsec:results_original_rq} \myparab{RQ1: Can ML models learn ``anomaly'' detection heuristics employed by various measurement platforms?} We verify whether the `anomaly' labeling heuristics of the Satellite and OONI measurement platforms can be learned automatically without the rules being specified explicitly. We find that among all \emph{supervised models}, XGBoost performs the best (Table~\ref{tab:supervised_all_results}), achieving nearly perfect TPRs ($100\%$ for Satellite and $99.8\%$ for OONI) at very low FPRs ($0.0\%$ and $0.2\%$ respectively). This demonstrates that heuristics can be learned without rule specification. However, it is more interesting to verify whether \emph{unsupervised models} can learn heuristics without the use of labels during training, as this can enable post-heuristic censorship detection systems. Unsupervised models (Table~\ref{tab:unsupervised_all_results}) achieve high TPRs at the expense of also having high FPRs, indicating the calibration of our models tends to make them more aggressive while determining potential instances of censorship. Regardless, their ability to pick up anomalies as determined by the heuristic methods without explicit labels provided during training shows their effectiveness at creating a model of ``normal'' behavior. We perform a sanity check of our unsupervised models by assessing their performance against US records which contain \textit{zero} DNS censorship. This is to ensure that our models are not badly calibrated and identify anomalies where there are none. For both OONI and Satellite datasets, our models pass the sanity check against the clean US records with TNRs at $100\%$ (Table~\ref{tab:unsupervised_all_results}). \myparab{RQ2: Can supervised models infer DNS censorship using records and labels collected from independent sources?} As seen in~\sectionref{subsec:heuristics}, the labels obtained from Satellite and OONI for marking instances of censorship are unreliable and inconsistent. Our aim, then, is to leverage the availability of GFWatch for labeling probes with respect to national-level DNS censorship in China \emph{with a FPR of zero} to create a reliable labeled dataset. This allows us to train supervised models at scale that have trustworthy positive predictions, and also provides a unified way to compare DNS probes of different varieties. Table~\ref{tab:supervised_all_results} shows the performance of our supervised ML models on this curated dataset. For both OONI and Satellite, the XGBoost models achieve relatively good performance. However, a discrepancy exists between the datasets: for Satellite, the best model achieves a very high TPR and low FPR, implying a high degree of correlation between the information contained in the Satellite records and GFWatch labels. On the other hand, the model using OONI probes has a lower TPR (86.7\%), implying the existence of a significant fraction of probes where GFWatch indicates the domain should be censored but our model marks probes from those domains as uncensored. Overall, however, this shows we can train models to extract censorship signals correlated with different label sets, allowing for the study of discrepancies and higher confidence predictions with ensembling. \emph{\textbf{False Negative Analysis of OONI probes with GFWatch labels:}} We perform a thorough manual investigation of the probes belonging to the 13.3\% of cases marked as false negative, i.e., probes that our supervised OONI model using GFWatch labels model predicted as \emph{not} censored but was marked as censored by GFWatch labels. Intriguingly, we find that more than 67\% of these false negatives are \emph{truly negative} cases, i.e., \emph{not} censored probes. Prior work has discovered that the GFW is sometimes overloaded and may fail to inject forged DNS responses~\cite{USESEC21:GFWatch}. By manually examining these FN cases, we verify that these probes could actually obtain the correct IP(s) associated with their test domains. For instance, this probe~\cite{OONI-supervised-corner-case} of \texttt{www.washingtonpost.com} conducted by a volunteer located in AS4134 (CHINA UNICOM) is marked as `DNS tampering' by OONI and is also labeled as censored by GFWatch. However, the resolved IP correctly points to AS20940 Akamai (the primary hosting provider for Washington Post), indicating that the GFW failed to inject a forged DNS response in this case. As a result, our model was able to correctly classify the DNS resolution of this probe as \emph{not} censored. In addition, localized censorship also contributes to the false negative cases. Localized censorship can be caused either by local filtering (e.g., corporate firewalls) or server-side blocking (e.g., geoblocking of websites that do not want to serve clients in particular countries~\cite{McDonald:2018:403}). We found several false negatives that did not actually experience the Great Firewall's DNS censorship but were redirected to blockpages due to web-application firewalls (e.g., \texttt{192.124.249.111}). In summary, we can see that our ML models allow for finer-grained discovery of aspects of DNS censorship. Even heuristics like GFWatch which deploy physical machines in censorship regimes can have erroneous labels for specific probes due to their reliance on aggregate trends. \myparab{RQ3: Are unsupervised models capable of discerning censorship instances and variations missed by existing heuristics?} Table~\ref{tab:unsupervised_all_results} reports the performance of the most optimal unsupervised models trained on both OONI and Satellite records on China, labeled with GFWatch's labels. With a TPR of $99.1\%$ and a FPR of $17.4\%$, a Linear OCSVM model trained on Satellite provides relatively better performance in comparison to the Isolation Forest (IF) model trained on OONI ($73.3\%$ TPR and $10.0\%$ FPR). The latter, however, has a slightly higher overall accuracy ($85.7\%$ vs. $85.3\%$). The positive instances identified by these models are validated using GFWatch which resolves the domains of interest in China to determine if they are truly blocked. \emph{\textbf{False Negative Analysis:}} By examining the FN cases, we found that more than half of them are \emph{truly negative}. In other words, the ``normal'' behavior that the unsupervised models have learnt could also correctly discern corner cases due to temporary failures of the GFW or incorrect geolocation of IPs. Thus, even though the domain is actually blocked in China, individual probes may go through due to known overloading of the GFW \cite{USESEC21:GFWatch} or incorrect locations of the testing vantage point as determined by MaxMind \cite{Raman2020CensoredPlanet}. \emph{\textbf{False Positive Analysis:}} The unsupervised models do indeed have a higher number of false positives as verified by a domain expert, indicating conservative boundaries for ``normal'' behavior. However, this aspect does lead to a number of potential false positives with respect to the heuristics being \emph{instances of possible censorship caught only by our model}, with all the label sets missing them. For example, we find that some probes from Satellite to \texttt{messenger.com} occasionally undergo DNS censorship since the returned IP points to a known fake IP used by the GFW. However, this website in general only undergoes HTTP/HTTPS censorship, with rare instances when DNS filtering is also activated. Our model is thus sensitive enough to uncover these rare events. In addition, more than 10\% of the FP cases are due to the inactivity of the test domains at the time of being probed leading both Satellite and OONI to be unable to fetch their websites. The good performance and ability of unsupervised models at discerning DNS censorship cases under scenarios missed by existing labeling heuristics is encouraging for future automated censorship detection. Models with minimal labels are able to find anomalies, which can aid in the detection of censorship in regimes where it is poorly understood. \begin{figure}[t] \centering \includegraphics[width=\columnwidth]{figures/temporal.pdf} \caption{A longitudinal analysis of the performance change of ML models over time. The baseline performance number is the average accuracy of the most recent possible model (1 month).} \label{fig:temporal_supervised} \vspace{-15pt} \end{figure} \subsection{In-Depth Analysis of Results} \label{sec:results_in_depth} We now analyze the performance of our models further by interpreting the features used, their performance variation over time as well as the the discovery of new aspects of censorship behavior. \begin{table*}[!ht] \centering \resizebox{\textwidth}{!}{ \begin{tabular}{l?l?l?l?l} \toprule \textbf{\makecell{Rank}} & \textbf{\makecell{IF (OONI Labels)\\Feature Importance}}& \textbf{\makecell{IF (GFWatch Labels)\\Feature Importance}}& \textbf{\makecell{XGBoost (OONI Labels)\\Feature Importance}}& \textbf{\makecell{XGBoost (GFWatch Labels)\\Feature Importance}}\\ \midrule 1 & test\_keys\_asn (0.131) & test\_keys\_asn (0.131) &test\_keys\_asn (0.142)&resolver\_asn( 0.138) \\ 2&resolver\_network\_name (0.128) & \ resolver\_network\_name (0.128)& resolver\_asn (0.135) & test\_keys\_asn (0.133) \\ 3 &resolver\_asn (0.121) & resolver\_asn (0.121)& test\_keys\_as\_org\_name (0.132) & test\_keys\_as\_org\_name (0.128) \\ 4 &probe\_asn (0.121) & probe\_asn (0.121) & probe\_asn (0.122) & probe\_network\_name (0.122) \\ 5 &test\_keys\_as\_org\_name (0.120) & test\_keys\_as\_org\_name (0.120) & probe\_network\_name (0.117) &probe\_asn (0.118) \\ 6 &probe\_network\_name (0.118) & probe\_network\_name (0.118) & resolver\_network\_name (0.109) & resolver\_network\_name (0.092) \\ 7 &http\_experiment\_failure (0.083)& http\_experiment\_failure (0.083) & http\_experiment\_failure (0.062) & http\_experiment\_failure (0.084) \\ 8 &status\_code\_match (0.029) & status\_code\_match (0.029) &status\_code\_match (0.046) & status\_code\_match (0.041) \\ 9 &title\_match (0.028) & title\_match (0.028) & title\_match (0.023) & body\_length\_match (0.026) \\ 10 &body\_length\_match (0.027) & body\_length\_match (0.027) & headers\_match (0.022) & headers\_match (0.025) \\ \bottomrule \end{tabular}} \caption{Top 10 important features for Isolation Forests (IF) and XGBoost classifiers when using OONI data.} \label{tab:ooni_fi} \vspace{-15pt} \end{table*} \noindent \textbf{Feature importance analysis.} To demonstrate how our supervised models pick up signals used by heuristics, we apply the SHAP feature importance method~\cite{lundberg2017unified} on the XGBoost model for OONI as reported in Table~\ref{tab:ooni_fi}. Encouragingly, the model's most important features (as ranked by SHAP) align with those used by the OONI's heuristics, including the AS number and organization name of the returned IP(s) in the DNS response. In particular, OONI compares the returned IPs between the test and control queries, and concludes ``anomaly'' if these addresses do not match. Since an IP can be mapped to its respective AS information, the supervised model is essentially learning this logic. Similarly, we find that our unsupervised models also make predictions based on a set of important features that domain experts would typically utilize to confirm censorship, \textit{e.g.}, AS number and organization name of returned IP(s) together with other HTTP-related elements, including failure codes, and HTML body length to confirm the blocking status. They also exhibit remarkable consistency with their supervised counterparts in terms of the most important features. Feature importance analysis for Satellite is in Table~\ref{tab:satellite_fi} (Appendix~\ref{appsec:additional_results}). To that end, both models show promising learning capability by properly identifying AS information as one of the most important features. This is because AS-related features are more robust than IP information alone since a website may be mapped to different IP addresses, depending on when and from where its DNS query is resolved~\cite{Hoang2020TheWI, Hoang2021:IP-WF, Hoang2020:ASIACCS}. \begin{figure*}[t] \includegraphics[width=\textwidth]{figures/prediction_ooni_vs_satellite.pdf} \caption{A longitudinal comparison of China's DNS censorship predicted using unsupervised models trained on OONI and Satellite data. We find much greater agreement among the predictions from the two sources of records when compared to using the original labels for the records.} \label{fig:prediction_ooni_vs_satellite} \end{figure*} \myparab{Model validity over time.} For our baseline experiments, we simply combined data from the entire $7$-month time period we considered before splitting it into training, validation and test data. The implicit assumption we used here is that the data is i.i.d. over time. However, in real-world settings, models can only be trained on currently available data to predict censorship for future probes. Since censor behavior can change over time, the i.i.d. assumption may be violated and models may need to be retrained frequently. In light of this, we conduct experiments where we train models using a month of data, and test them on all subsequent months. We then average the performance of all models of a given age with respect to the test data and plot the results in Figure~\ref{fig:temporal_supervised}. For Satellite models, both supervised and unsupervised, we find that the performance decreases steadily over time as expected, although the change is quite small. For OONI data, however, we observe considerable variation over time, with performance even increasing for older models. We believe this arises due to the scattershot nature of OONI data collection from volunteers, as opposed to the regular probing done by Satellite. This can lead to older models being more relevant even though more time has elapsed. To summarize, our analysis indicates that, for both datasets, there exists at least one trained model that exhibits robust performance as time elapses. This serves as strong evidence that the models have successfully learned transferable features, as opposed to features that are specific to the context of the original datasets, and can generalize to future datasets collected in different time-frames. \myparab{DNS blocking signature discovery.} To confirm instances of DNS censorship, platforms such as OONI maintain lists of IPs where censored queries are redirected~\cite{OONIIPs, OONI-rules}. However, these lists are often static and small, leading to inadequate coverage and the inability to confirm censorship cases in many instances. We thus perform a frequency analysis of the associated IPs of probes~\footnote{Note that we excluded DNS response IP addresses from the feature set to prevent overfitting, but we can still map the predicted censorship instances back to the original records to examine the associated DNS response IP addresses.} marked as censored by our models to find new fake IPs that serve as DNS blocking signatures. Table~\ref{tab:ooni_signatures} demonstrates that our models successfully discovered hundreds of distinct, injected fake IPs that went unnoticed by OONI. We also compare our results with those of GFWatch, which maintains a highly comprehensive list of blocking signatures. Our model was able to identify several new, previously undetected, injected ISP-specific censorship signatures that are not picked up even by GFWatch. We provide a list of example signatures found across models in Table~\ref{tab:ips} (Appendix~\ref{appsec:additional_results}). Based on the results, we are confident that these newly discovered DNS blocking signatures from our machine learning models can significantly enhance the measurement platforms' ability to accurately confirm cases of DNS censorship, providing more comprehensive coverage. This, in turn, enhances the usefulness of the collected data for wider public consumption. \begin{table} \resizebox{\columnwidth}{!}{ \begin{tabular}{llll} \hline \textbf{Model} & \textbf{\makecell{Train/Val./Test\\Labels}} & \textbf{\makecell{New Signatures\\ (missed by OONI)}} & \textbf{\makecell{New Signatures\\ (missed by GFWatch)}} \\ \hline Supervised & GFWatch & 748 & 3 \\ & OONI & 747 & 2 \\ \hline Unsupervised & GFWatch & 729 & 2 \\ & OONI & 728 & 1 \\ \hline \end{tabular}} \caption{New DNS blocking signatures uncovered by models when using OONI data.} \label{tab:ooni_signatures} \vspace{-20pt} \end{table}
\section{Introduction} The lack of experimental evidence continues to constrain the parameter space of Supersymmetry (SUSY). There are however several reasons why SUSY is still a viable candidate for physics beyond the Standard Model (SM) as it can be employed to solve some of the issues in the Standard Model (SM) such as the gauge hierarchy problem and the unification of gauge couplings. Moreover, the Minimal Supersymmetric Standard Model (MSSM) with R-parity entails a cold dark matter candidate and a 125 GeV Higgs boson can be readily accommodated in various SUSY models. The ATLAS and CMS experiments have performed various searches for SUSY particles but, to date, no signals have been detected by these experiments. Run 2 of the Large Hadron Collider (LHC) with an integrated luminosity of $\sim$ 139 fb$^{-1}$ require a limit of $m_{\tilde{g}} \gtrsim 2.3~{\rm TeV}$ on the gluino masses and the top squark masses limits are $m_{\tilde{t}_1} \gtrsim 1.2 ~{\rm TeV}$, respectively. LHC Run 3 started in July 2022 delivering proton-proton collisions with center-of-mass energies of 13.6 TeV and the search for SUSY signals continues. Several recent studies have considered the affect of these constraints on the parameter space of various SUSY models \cite{Ellis:2022emx}. In addition to the experiments at the LHC, Fermilab's Muon experiment is also at the forefront of testing physics beyond the SM. Its measurement of the anomalous magnetic moment of the muon can also be an indication of new physics beyond the SM. The observed $4.2 \sigma$ deviation in the muon anomalous magnetic moment $a_{\mu}=(g-2)_{\mu}/2$ (muon $g-2$) from its SM prediction \cite{Muong-2:2021ojo} % \begin{eqnarray} \label{gg-22} \Delta a_{\mu}\equiv a_{\mu}({\rm exp})-a_{\mu}({\rm SM})= (25.1 \pm 5.9) \times 10^{-10}. \end{eqnarray} There have been several studies in recent year that have attempted to explain this long standing anomaly \cite{Wang:2021bcx}. In this paper we revisit the Non-Universal Gaugino Mass and the Non-Universal Higgs mass (NUGM + NUHM2) models and analyze the implications of constraints from direct and indirect experiments. In addition, we will also explore the parameter space which explains the observed deviation in $\ensuremath{(g-2)_{\mu}}$ given in equation (1). We will explore the nature of the neutralino in the model's parameter space and present results for different coannihilation scenarios. Furthermore, we will also present results for the Higgs production cross section and decay widths. We will highlight the region of the parameter space that satisfies the $\ensuremath{(g-2)_{\mu}}$ constraint and also predicts an enhancement in the diphoton channel. The paper is orgranized as follows: In section \ref{g-2}, we briefly review the SUSY contribution to the muon anomalous magnetic moment and present the expression for $\ensuremath{\Delta a_{\mu}}$. In section \ref{sec:parameter} we describe the scanning procedure, the constraints we implement and the parameter space of the models we study. In section \ref{sec:results}, we display and discuss the results of our parameter space scan. We conclude in section \ref{sec:conclude} \section{\label{g-2}The Muon Anomalous Magnetic Moment} In the MSSM, the dominant contribution to the muon anomalous magnetic moment arises from neutralino-charge slepton and chargino-sneutrino loop diagrams given by \cite{Moroi:1995yh, Martin:2001st}: \begin{eqnarray} \label{eqq1} \Delta a_\mu &=& \frac{\alpha \, m^2_\mu \, \mu\, \tan\beta}{4\pi} {\bigg \{ } \frac{M_{2}}{ \sin^2\theta_W \, m_{\tilde{\mu}_{L}}^2} \left[ \frac{f_{\chi}(M_{2}^2/m_{\tilde{\mu}_{L}}^2)-f_{\chi}(\mu^2/m_{\tilde{\mu}_{L}}^2)}{M_2^2-\mu^2} \right] \nonumber\\ &+& \frac{M_{1} }{ \cos^2\theta_W \, (m_{\tilde{\mu}_{R}}^2 - m_{\tilde{\mu}_{L}}^2)} \left[\frac{f_{N}(M^2_1/m_{\tilde{\mu}_{R}}^2)}{m_{\tilde{\mu}_{R}}^2} - \frac{f_{N}(M^2_1/m_{\tilde{\mu}_{L}}^2)}{m_{\tilde{\mu}_{L}}^2}\right] \, {\bigg \} }, \end{eqnarray} where $\alpha$ is the fine-structure constant, $m_\mu$ is the muon mass, $\mu$ denotes the bilinear Higgs mixing term, and $\tan\beta$ is the ratio of the vacuum expectation values (VEV) of the MSSM Higgs doublets. $M_1$ and $M_2$ denote the $U(1)_Y$ and $SU(2)$ gaugino masses respectively, $\theta_W$ is the weak mixing angle, and $m_{\tilde{\mu}_{L}}$ and $m_{\tilde{\mu}_{R}}$ are the left and right handed smuon masses. The loop functions are defined as follows: \begin{eqnarray} f_{\chi}(x) &=& \frac{x^2 - 4x + 3 + 2\ln x}{(1-x)^3}~,\qquad ~f_{\chi}(1)=-2/3, \\ f_{N}(x) &=& \frac{ x^2 -1- 2x\ln x}{(1-x)^3}\,,\qquad\qquad f_{N}(1) = -1/3 \, . \label{eqq2} \end{eqnarray} The first term in equation (\ref{eqq1}) stands for the dominant contribution coming from one loop diagram with charginos (Higgsinos and Winos), while the second term describes inputs from the bino-smuon loop. \section{Non-Universal Gaugino and Higgs Masses}\label{sec:parameter} It has been shown that non-universal gaugino masses can be generated from an F-term which is a linear combination of two distinct fields of different dimensions. \cite{Martin:2013aha}. Another possibility is to consider two distinct sources for supersymmetry breaking \cite{Anandakrishnan:2013cwa}. With many distinct possibilities available for realizing non-universal gaugino masses at $M_{\rm GUT}$, we employ three independent masses for the MSSM gauginos in our study. The NUGM model is an extensively studied model and there have been several recent studies exploring this model \cite{Ajaib:2017zba}. In the Non-Universal Higgs Model 2 (NUHM2) \cite{Baer:2021aax}, the universality of the scalar masses is relaxed compare to the CMSSM and the Higgs Soft SUSY-Breaking (SSB) mass terms are assumed to be independent parameters at the GUT scale ($m_{H_u}^2 \neq m_{H_d}^2$). We choose the following ranges for the parameters of this model: \begin{eqnarray} 0\leq & m_{0} & \leq 30\, \textrm{TeV} \nonumber \\ -3 \le & A_0/m_{0} & \le 3 \nonumber \nonumber \\ 2 \le & \tan\beta & \le 60 \nonumber \\ 0 \le & M_1 &\le {\mathrm {5 \ TeV} } \nonumber \\ 0 \le & M_2 &\le {\mathrm {5 \ TeV} } \nonumber \\ {\mathrm {-5 \ TeV} } \le & M_3 &\le 0 \nonumber \\ 0 \le & m_{H_u} &\le {\mathrm {5 \ TeV} } \nonumber \\ 0 \le & m_{H_d} &\le {\mathrm {5 \ TeV} } \nonumber \\ &\mu >0 \nonumber \end{eqnarray} Here $M_{1}$, $M_{2}$, and $M_{3}$ denote the SSB gaugino masses for $U(1)_{Y}$, $SU(2)_{L}$ and $SU(3)_{c}$ respectively. $ \tan\beta $ is the ratio of the vacuum expectation values (VEVs) of the two MSSM Higgs doublets, and $ A_{0} $ is the universal SSB trilinear scalar interaction (with corresponding Yukawa coupling factored out). In order to obtain the correct sign for the desired contribution to $ \ensuremath{(g-2)_{\mu}} $, we set same signs for the parameters $\mu$, $M_1$ and $M_2$. For the top quark mass, we use {the} value $m_t = 173.3\, {\rm GeV}$. \renewcommand{\arraystretch}{1.5} \begin{table}[t!] \begin{center} \begin{tabular}{|p{11cm}|p{3cm}|} \hline Constraint & Ref. \\ \hline $123~{\rm GeV} \leq m_h \leq 127~{\rm GeV}$ & \cite{:2012gk,:2012gu}\\ \hline $ 0.8 \times 10^{-9} \leq BR(B_s \rightarrow \mu^+ \mu^-) \leq\, 6.2 \times 10^{-9} \; (2\sigma)$ & \cite{Aaij:2012nna}\\ \hline $2.99 \times 10^{-4} \leq BR(b \rightarrow s \gamma) \leq\, 3.87 \times 10^{-4} \; (2\sigma)$ & \cite{Amhis:2012bh}\\ \hline $0.15 \leq \frac{BR(B_u\rightarrow \tau \nu_{\tau})_{\rm MSSM}}{BR(B_u\rightarrow \tau \nu_{\tau})_{\rm SM}} \leq\, 2.41 \; (3\sigma)$ & \cite{Asner:2010qj}\\ \hline $m_{\tilde{g}} \gtrsim 2.3~{\rm TeV}$, $m_{\tilde{q}} \gtrsim 2 ~{\rm TeV}$ &\cite{Aaboud:2017vwy,Vami:2019slp,Sirunyan:2017kqq}\\ \hline $m_{\tilde{\chi}^\pm} \gtrsim 430~{\rm GeV}$ & \cite{lhc-chargino}.\\ \hline \hline \end{tabular} \end{center} \caption{Table of constraints we apply in our analysis } \label{table0} \end{table} \renewcommand{\arraystretch}{1} {We employ Isajet~7.84 \cite{ISAJET} interfaced with Micromegas 2.4 \cite{Belanger:2008sj} and FeynHiggs \cite{Bahl:2018qog} to perform random scans over the parameter space of this model.} We use Micromegas to calculate the relic density and $BR(b \rightarrow s \gamma)$. The Higgs cross section and decay rates have been calculated using FeynHiggs. Further details regarding our scanning procedure can be found in \cite{Ajaib:2015ika}. After collecting the data, we impose the experimental constraints given in Table \ref{table0} on the parameter space. In addition we subsequently implement the following two constraints on the parameter space that satisfies the above constraints: \begin{equation} 20 \times 10^{-10} < \Delta a_\mu < 30 \times 10^{-10} \,\, (1\sigma) \end{equation} \begin{equation} \Omega h^2< 1 \ \end{equation} The parameter space consistent with the above $\Delta a_\mu$ constraint is scanned more rigorously. We consider a wider region of the parameter space because of the uncertainties involved in the calculations of the relic density in different spectrum codes. The benchmark scenarios we present are going to satisfy the WMAP relic density constraint given by \cite{Akrami:2018vks}: \begin{equation} 0.114 < \Omega h^2 < 0.116 \end{equation} \begin{figure} \includegraphics[width=8cm, height=6.5cm]{spectrum-plots/mglu-msq.jpg}\hfill \includegraphics[width=8cm, height=6.5cm]{spectrum-plots/ma-mneu.jpg}\vspace{2mm} \\ \includegraphics[width=8cm, height=6.5cm]{spectrum-plots/mchar-mneu.jpg}\hfill \includegraphics[width=8cm, height=6.5cm]{spectrum-plots/muL-mneu.jpg}\vspace{2mm} \\ \includegraphics[width=8cm, height=6.5cm]{spectrum-plots/mstau-mneu.jpg}\hfill \includegraphics[width=8cm, height=6.5cm]{spectrum-plots/mstop-mstau.jpg} \caption{Plots in the $m_{\tilde{g}}$ vs. $m_{\tilde{q}}$, $M_A$ vs. $M_{\tilde{\chi}_1^0}$, $M_{\tilde{\chi}_1^\pm}$ vs. $m_{\tilde{\chi}_1^0}$, $m_{\tilde{\mu}_L}$ vs. $M_{\tilde{\chi}_1^0}$, $m_{\tilde{\mu}_L}$ vs. $M_{\tilde{\chi}_1^0}$ and $m_{\tilde{t}_1}$ vs. $m_{\tilde{\tau}_1}$ planes. \textit{Green} points satisfy the sparticle mass constraints and B-physics constraints described in Section \ref{sec:parameter}. \textit{Brown} points form a subset of the \textit{green} points and satisfy $0.001 \le \Omega h^2 \le 1 $. \textit{Orange} points are subset of the green points and satisfy the muon $g-2$ constraint described in Section \ref{sec:parameter}.} \label{fig:sparticle} \end{figure} \section{Results and Analysis}\label{sec:results} In this section, we present our results for the parameter space scan given in the previous section. In Figure \ref{fig:sparticle}, shows our results in the $m_{\tilde{g}}$ vs. $m_{\tilde{q}}$, $M_A$ vs. $M_{\tilde{\chi}_1^0}$, $M_{\tilde{\chi}_1^\pm}$ vs. $m_{\tilde{\chi}_1^0}$, $m_{\tilde{\mu}_L}$ vs. $M_{\tilde{\chi}_1^0}$, $m_{\tilde{\tau}_1}$ vs. $M_{\tilde{\chi}_1^0}$ and $m_{\tilde{t}_1}$ vs. $m_{\tilde{\tau}_1}$ planes. We can see that the $\ensuremath{(g-2)_{\mu}}$ constraint implies heavy colored sparticle masses bounded in narrow intervals, namely, $5 {\rm \ TeV} \lesssim m_{\tilde{q}} \lesssim 8 {\rm \ TeV}$, $6 {\rm \ TeV} \lesssim m_{\tilde{g}} \lesssim 10 {\rm \ TeV}$, $ m_{\tilde{t}_1} \gtrsim 4.5 {\rm \ TeV}$. We use the following convention for all the following plots unless stated otherwise: \begin{figure}[t!] \begin{center} \includegraphics[width=11cm, height=7.5cm]{M1mu-M1M2.jpg} \end{center} \caption{Plots in the $M_1/\mu$ vs. $M_1/M_2$ planes. Color coding is the same as in Figure \ref{fig:sparticle}.} \label{fig:m1mu-m1m2} \end{figure} \begin{itemize} \item \textit{Green} points satisfy the sparticle mass constraints and B-physics constraints described in Section \ref{sec:parameter} \item \textit{Brown} points form a subset of the \textit{green} points and satisfy $0.001 \le \Omega h^2 \le 1 $ \item \textit{Orange} points are a subset of the \textit{green} points and satisfy the muon $g-2$ constraint described in Section \ref{sec:parameter}. \end{itemize} \begin{figure} \includegraphics[width=8cm, height=6.5cm]{mneu-si_comp.jpg}\hfill \includegraphics[width=8cm, height=6.5cm]{mneu-sd_comp.jpg} \\ \includegraphics[width=8cm, height=6.5cm]{mneu-si_comp_gm2.jpg}\hfill \includegraphics[width=8cm, height=6.5cm]{mneu-sd_comp_gm2.jpg} \\ \caption{Plots in the $\sigma_{SI}$ vs. $M_{\tilde{\chi}_1^0}$ and $\sigma_{SD}$ vs. $M_{\tilde{\chi}_1^0}$ planes. Color coding represents the composition of the neutralino and different coannihilation channels (as shown in the plot legend).} \label{fig:sisd} \end{figure} LHC Run 3 started in July 2022 delivering proton-proton collisions with center-of-mass energies of 13.6 TeV. A portion of the parameter space of this model may be accessible at LHC Run 3 energies. We can see from the $M_A$ vs. $M_{\tilde{\chi}_1^0}$ that the pseudoscalar Higgs boson mass can be as light 500 GeV, which is within the reach of the LHC. In the lower right panel, we can see that the g-2 constraint predicts a light stau and its mass is bounded in the interval $100 {\rm \ GeV} \lesssim m_{\tilde{\tau}_1} \lesssim 600 {\rm \ GeV}$. Figure \ref{fig:m1mu-m1m2} gives an overview of the different types of neutralino compositions in the parameter space we study. In the region $M_1/\mu < 1$ and $M_1/M_2 < 1$, the neutralino is expected to essentially be a pure bino. It is well known in literature that a pure bino yields a large relic abundance due to small cross sections involved. However, coannihilation of the bino with other sparticles can yield the correct relic abundance particularly if the neutralino acquires a wino or a higgsino component \cite{Ajaib:2015yma}. This is possible in our analysis since the region $M_1/\mu < 1$ and $M_1/M_2 > 1 $ corresponds to a mixed bino-wino type neutralino. In the parameter space we explore, the neutralino is predominantly a bino or a mixed bino-wino type. \begin{figure} \includegraphics[width=9cm, height=6.5cm]{mneu-oh2.jpg}\hfill \includegraphics[width=9cm, height=6.5cm]{mneu-oh2gm2.jpg} \\ \caption{Plots in the $\Omega h^2$ vs. $M_{\tilde{\chi}_1^0}$ planes. The color coding corresponds to the various solutions of LSP neutralino to be a dark matter candidate. } \label{fig:oh2} \end{figure} In Figure \ref{fig:oh2}, we present the parameter space in the $\Omega h^2$ vs. $M_{\tilde{\chi}_1^0}$ plane. The color coding in the Figures corresponds to the various composition of the LSP neutralino. We can see from the left panel that there are several co-annihilation channels such as the chargino-neutralino, smuon-neutralino and stau-neutralino coannihilation channels that come into play in order to yield the desired relic abundance. We can see that the neutralino is predominantly a bino (red points) and a notable portion of the parameter space corresponds the neutralino being a mixed bino-wino type. All the points in the right panel satisfy the $\ensuremath{(g-2)_{\mu}}$ constraint. The points corresponding to stau-coannihilation (yellow points) lead to a small relic density ($\Omega h^2 \lesssim 0.1$) for dark matter. In Figure \ref{fig:sisd}, we present the prospects of direct detection of neutralino dark matter in the $\sigma_{SI}$ vs. $M_{\tilde{\chi}_1^0}$ plane (left panels). The top panel displays the neutralino decomposition along with the different co-annihilation channels. The bottom left panel shows the parameter space that satisfies the $\ensuremath{(g-2)_{\mu}}$ constraint. The solid lines represent the XENON1T~\cite{Aprile:2015uzo}, XENONnT~\cite{Aprile:2015uzo}, Lux-Zeplin ~\cite{Akerib:2015cja} and LUX2016 bound~\cite{Akerib:2016vxi}. We can observe that the parameter space of this model, particularly the region corresponding to a bino-wino type neutralino, can be tested by direct detection experiments. A portion of parameter space is already excluded by the Xenon and LUX experiments. A notable region of the parameter space with considerably low cross sections is not accessible to any of the projected sensitivities of these experiments. The parameter space consistent with the $\ensuremath{(g-2)_{\mu}}$ constraint (lower left panel) corresponds to low cross sections for a bino and will be accessible to these experiments in the near future. The spin-dependent neutralino cross section is displayed in the right panels of Figure \ref{fig:sisd} in the $\sigma_{SD}$ vs. $M_{\tilde{\chi}_1^0}$ plane. Experimental limits from IceCube~\cite{Aartsen:2016exj} and LZ~\cite{Akerib:2015cja} experiments. We can observe that the parameter space of this model is accessible to these experiments. The parameter space corresponding to the $\ensuremath{(g-2)_{\mu}}$ constraint (lower right panel), which corresponds to a stau-coannihilation and a bino like neutralino, has very low cross sections and is beyond the current search limit of these experiments. \begin{figure} \includegraphics[ width=9cm, height=6.5cm]{BR-figs/mstau-br1.jpg} \includegraphics[width=9cm, height=6.5cm]{BR-figs/mstau-br2.jpg} \includegraphics[width=9cm, height=6.5cm]{BR-figs/mstau-R2.jpg} \includegraphics[width=9cm, height=6.5cm]{BR-figs/mstau-RxxDM.jpg} \caption{Plots to display the Higgs production cross-section $(\sigma/\sigma_{SM})_{gg \rightarrow h}$, the diphoton branching ratio $(BR/BR_{SM})_{h \rightarrow \gamma \gamma}$ and $R_{\gamma \gamma}$ vs. $m_{\tilde{\tau}_1}$. Color coding for the top panels and the lower left panels is the same as in Figure \ref{fig:sparticle}. The lower right panel shows the composition of the neutralino along with various coannihilation channels shown in the plot legend.} \label{fig:higgs-xsec} \end{figure} We next present the Higgs production cross section and decay in the diphoton channel. We saw in Figure \ref{fig:oh2} that the coannihilation of a light stau can lead to the desired WMAP relic abundance. In addition, the squarks are essentially decoupled in the parameter space we consider. Several studies have shown that a light stau in the decoupling limit can lead to an enhancement in the diphoton channel \cite{AdeelAjaib:2015xbe}. The ratio of the product of production cross sections times branching ratio to the diphoton final state compared to the theoretical expectation for the SM is given by \cite{AdeelAjaib:2015xbe} \begin{eqnarray} R_{\gamma \gamma} \equiv \frac{\sigma(h) \times Br(h\rightarrow \gamma \gamma)}{(\sigma(h) \times Br(h\rightarrow \gamma \gamma))_{SM}}. \label{eq:ratio} \end{eqnarray} From Figure \ref{fig:higgs-xsec} we can see that there is essentially no enhancement in the Higgs production cross-section whereas the decay width to two photons is considerably enhanced. This leads to an enhancement in the ratio $R_{\gamma \gamma}$. We can see that a section of the parameter space that explains the g-2 constraint (\textit{orange} points) also corresponds to an enhancement in the diphoton channel. The lower right panel shows the parameter space with the composition of the neutralino and various coannihilation channels. We can see that enhancement in the diphoton channel corresponds to a light stau and a neutralino which is essentially a pure bino. Lastly, we display three benchmark points in Table \ref{tab1}. The three points satisfy the experimental constraints presented in Section \ref{sec:parameter}. In addition, the $\ensuremath{(g-2)_{\mu}}$ constraint is also satisfied and the relic density is consistent with WMAP. The three points have a light slepton spectrum and essentially a decoupled colored spectrum. The points exhibit stau and smuon-neutralino coannihilation to achieve the desired WMAP relic abundance. Points 2 and 3 correspond to an enhancement in the Higgs production cross-section ($R_{\gamma \gamma} > 1$) due to the light slepton spectrum\footnote{The SLHA files for these benchmark points are available on the Authors github page \url{https://github.com/Madeelajaib/nugm-nuhm2-benchmark}}. \begin{table}[t!]\vspace{1.5cm} \centering \begin{tabular}{|p{3cm}|p{3cm}p{3cm}p{3cm}|} \hline \hline & Point 1 & Point 2 & Point 3 \\ \hline $m_{0} $ &$ 378.88 $&$ 451.54 $&$ 314.56 $\\ $M_1$ &$ 837.08 $&$ 565.72 $&$ 122.83 $\\ $M_2$ &$ 805.73 $&$ 739.22 $&$ 798.95 $\\ $M_3$ &$ -4936.84 $&$ -4204.34 $&$ -4654.15 $\\ $A_0$ &$ -150.77 $&$ -129 $&$ 0 $\\ $\tan\beta$ &$ 42.45 $&$ 40.14 $&$ 14.96 $\\ $m_{H_{u}} $ &$ 144.85 $&$ 142.13 $&$ 334.28 $\\ $m_{H_{d}} $ &$ 14.97 $&$ 18.98 $&$ 136.21 $\\ \hline $\mu$ &$ 811 $&$ 720 $&$ 511 $\\ \hline $m_h$ &$ 124.54 $&$ 123.93 $&$ 123.55 $\\ $m_H$ &$ 1245 $&$ 1990 $&$ 4624 $\\ $m_A$ &$ 1237 $&$ 1977 $&$ 4594 $\\ $m_{H^{\pm}}$ &$ 1249 $&$ 1993 $&$ 4625 $\\ \hline $m_{\tilde{\chi}^0_{1,2}}$ &$ \textbf{412}, 796 $&$ \textbf{284}, 725 $&$ \textbf{88}, 786 $\\ $m_{\tilde{\chi}^0_{3,4}}$ &$ 4940, 4940 $&$ 4263, 4263 $&$ 4628, 4628 $\\ $m_{\tilde{\chi}^{\pm}_{1,2}}$ &$ 799, 4894 $&$ 727, 4223 $&$ 791, 4584 $\\ $m_{\tilde{g}}$ &$ 9766 $&$ 8402 $&$ 9229 $\\ \hline $m_{ \tilde{u}_{L,R}}$ &$ 8309, 8319 $&$ 7174, 7183 $&$ 7849, 7859 $\\ $m_{\tilde{t}_{L,R}}$ &$ 7229, 7351 $&$ 6238, 6404 $&$ 6826, 7393 $\\ \hline $m_{ \tilde{d}_{L,R}}$ &$ 8309, 8323 $&$ 7174, 7187 $&$ 7850, 7865 $\\ $m_{\tilde{b}_{R}}$ &$ 7232, 7370 $&$ 6333, 6466 $&$ 7351, 7777 $\\ \hline $m_{ \tilde{\mu}_{L,R}}$ &$ 584, \textbf{455} $&$ 618, 470 $&$ 587, \textbf{116} $\\ $m_{\tilde{\tau}_{L,R}}$ &$ \textbf{457}, 957 $&$ \textbf{324}, 837 $&$ \textbf{123}, 558 $\\ \hline $\Delta a_{\mu} \times 10^{10}$ &$ 28.20 $&$ 22.55 $&$ 20.06 $\\ $\sigma_{SI}({\rm pb})$ &$ 1.22\times 10^{-13} $&$ 3.15\times 10^{-14} $&$ 9.45\times 10^{-15} $\\ $\sigma_{SD}({\rm pb})$ &$ 9.60\times 10^{-11} $&$ 1.78\times 10^{-10} $&$ 1.33\times 10^{-10} $\\ $\Omega_{CDM}h^{2}$ &$ 0.126 $&$ 0.124 $&$ 0.1 $\\ $R_{\gamma \gamma}$ &$ 0.996 $&$ 1.045 $&$ 1.257 $\\ \hline \hline \end{tabular} \caption{Masses in the table are in units of GeV. All the points satisfy the constraints presented in section \ref{sec:parameter} and have good $\ensuremath{(g-2)_{\mu}}$ values with light sleptons. The colored sparticles are essentially decoupled for these points. As can be seen from the highlighted slepton masses, these points exhibit stau-coannihilation to achieve the desired relic density} \label{tab1} \end{table} \section{Conclusion}\label{sec:conclude} We revisited the NUGM+NUHM2 model while focusing on the long standing g-2 anomaly in the magnetic moment of the muon. We explored the parameter space of the model by highlighting the different compositions of the neutralino LSP dark matter. We find that a narrow region of the parameter space can explain the g-2 anomaly while being consistent with current experimental limits. The neutralino is predominantly a pure bino or a mixed bino-wino type in the explored parameter space. We find that a portion of the parameter space that explains the g-2 anomaly also predicts an enhancement in the Higgs production cross-section due to the light spectrum of the sleptons. \section{Acknowledgments} The authors would like to thank Abdur Rehman, Bilal Riaz and Waqas Ahmed for useful discussions. \newpage
\section{Introduction} One of the most natural and important problems in mathematics is the problem of classifying objects into a given category. For instance, an important result of classification is the classification of compact (without boundary) smooth surfaces under diffeomorphisms. It is well known the following: {\it Let $X\subset \mathbb{R}^n$ and $Y\subset \mathbb{R}^m$ be two connected smooth (without boundary) compact surfaces. Then the following statements are equivalent: \begin{itemize} \item [(1)] $X$ and $Y$ are diffeomorphic; \item [(2)] $X$ and $Y$ are (inner or outer) lipeomorphic; \item [(3)] $\theta(X)=\theta(Y)$ and $g(X)=g(Y)$, \end{itemize}} \noindent where $g(M)$ denotes the genus of $M$, $\theta(M)=1$ if $M$ is orientable and $\theta(M)=-1$ if $M$ is non-orientable. In the setting of (not necessarily compact) properly embedded smooth surfaces in $\mathbb{R}^n$, the problem of classifying is much harder and changes drastically, as it is shown in the next example. \begin{example} Let $X=\mathbb{R}^2$, $Y=\{(x,y,z)\in \mathbb{R}^3;x^2+y^2=1\}$ and $Z=\{(x,y,z)\in \mathbb{R}^3;z=x^2+y^2\}$. \begin{itemize} \item [a)] $\theta(X)=\theta(Y)$, $g(X)=g(Y)$, but $X$ and $Y$ are not homeomorphic; \item [(b)] $X$ and $Z$ are diffeomorphic, but they are not inner lipeomorphic; \end{itemize} \end{example} If we allow singularities then the problem of classifying is even harder. In order to have some control on the topology of such surfaces, let us assume they are semialgebraic. Since compact manifolds (without boundary) are diffeomorphic to semialgebraic ones (see \cite{Nash}), in some sense that assumption is not too restrictive. With that assumption on the surfaces, the first author and Fernandes in \cite{FernandesS:2022} presented a complete classification of all semialgebraic surfaces with isolated singularities under inner lipeomorphisms. Since there is no local classification of semialgebraic surfaces under outer lipeomorphisms, we believe that we are far away from obtaining a global classification of such surfaces under outer lipeomorphisms. However, any semialgebraic outer lipeomorphism is a blow-spherical homeomorphism (see Definition \ref{def:bs_homeomorphism} and Proposition \ref{Lip_implies_bs}), thus an intermediate step in the problem of classifying complex algebraic surfaces or semialgebraic surfaces under outer lipeomorphisms is to classify algebraic surfaces under blow-spherical homeomorphisms. In order to learn more about the local properties of the blow-spherical equivalence see \cite{BirbrairFG:2012}, \cite{BirbrairFG:2017}, \cite{Sampaio:2020a}, \cite{Sampaio:2020}, \cite{Sampaio:2021b}. The problem of classification of the complex algebraic curves under outer lipeomorphisms was recently done by Targino in \cite{Targino:2022}. This is an important result alone, but it is also important to classify complex algebraic surfaces under outer lipeomorphisms, since an outer lipeomorphism between two complex algebraic surfaces induces an outer lipeomorphism between their singular sets (see \cite{Sampaio:2016} and \cite{BirbrairFLS:2016}), which are points or complex algebraic curves. Let us remark that there are algebraic curves which are blow-spherical homeomorphic, but are not outer lipeomorphic (see Example \ref{main_example}). But the blow-spherical equivalence is still a strong enough equivalence which is capable to catch singular points. In fact, it follows from \cite{Sampaio:2020} that a blow-spherical homeomorphism between two complex algebraic surfaces induces a blow-spherical homeomorphism between their singular sets. So, it becomes natural to try classifying complex algebraic curves under blow-spherical homeomorphisms and the main aim of this article is to present such a classification (see Theorems \ref{thmequivinfinity} and \ref{main_theorem}). More precisely, we present two classifications: one under blow-spherical homeomorphisms at infinity (see Theorem \ref{thmequivinfinity}) and one under (global) blow-spherical homeomorphisms (see Theorem \ref{main_theorem}). Moreover, for the classification under blow-spherical homeomorphisms at infinity, we also present normal forms (see Theorem \ref{thm:normal_forms}). It is important to say that classifications presented here hold true for spacial algebraic curves, not only for plane algebraic curves as it was done in \cite{Targino:2022}. Moreover, since there are spacial algebraic curves which are not blow-spherical homeomorphic to any plane algebraic curve (see Remark \ref{rem:plane_spacial_are_not-same}), the problem of classifying spacial algebraic curves is harder than the problem of classifying plane algebraic curves. \bigskip \section{Preliminaries}\label{section:cones} Here, all the real algebraic sets are supposed to be pure dimensional. \subsection{Tangent Cones} Let $X\subset \mathbb{R}^{n+1}$ be an unbounded semialgebraic set (resp. subanalytic set with $p\in \overline{X}$). We say that $v\in \mathbb{R}^{n+1}$ is a tangent vector of $X$ at infinity (resp. $p$) if there are a sequence of points $\{x_i\}\subset X$ tending to infinity (resp. $p$) and a sequence of positive real numbers $\{t_i\}$ such that $$\lim\limits_{i\to \infty} \frac{1}{t_i}x_i= v \quad (\mbox{resp. } \lim\limits_{i\to \infty} \frac{1}{t_i}(x_i-p)= v).$$ Let $C(X,\infty)$ (resp. $C(X,p)$) denote the set of all tangent vectors of $X$ at infinity (resp. $p$). We call $C(X,\infty)$ the {\bf tangent cone of $X$ at infinity} (resp. $p$). \begin{remark} If $A\subset \mathbb{C}^n$ is a complex algebraic set and $p\in A\cup \{\infty\}$ then $C(A,p)$ is the zero set of a set of homogeneous polynomials (see \cite[p. 84, Proposition 2]{Chirka:1989}, \cite[Theorem 1.1]{LeP:2018} and \cite[Theorem 3.1]{Sampaio:2023}). In particular, $C(A,p)$ is a union of complex lines passing through at the origin. \end{remark} We have the following characterization. \begin{corollary}[Corollary 2.16 \cite{FernandesS:2020}]\label{corollary 2.16FernandesS:2020} Let $X\subset \mathbb{R}^n$ be an unbounded semialgebraic set. Then $C(X,\infty)=\{v\in\mathbb{R}^n;\, \exists \gamma:(\varepsilon,+\infty )\to Z$ $C^0$ semialgebraic such that $\lim\limits _{t\to +\infty }|\gamma(t)|=+\infty$ and $\gamma(t)=tv+o_{\infty }(t)\}$, where $g(t)=o_{\infty }(t)$ means $\lim\limits_{t\to +\infty}\frac{g(t)}{t}=0$. \end{corollary} Thus, we have the following \begin{corollary}[Corollary 2.18 \cite{FernandesS:2020}]\label{dimension_tg_cone} Let $Z\subset \mathbb{R}^n$ be an unbounded semialgebraic set. Let $\phi:\mathbb{R}^n\setminus\{0\}\to \mathbb{R}^n\setminus\{0\}$ be the semialgebraic mapping given by $\phi(x)=\frac{x}{\|x\|^2}$ and denote $X=\phi(Z\setminus \{0\})$. Then $C(Z,\infty)$ is a semialgebraic set satisfying $C(Z,\infty)=C(X,0)$ and $\dim_{\mathbb{R}} C(Z,\infty) \leq \dim_{\mathbb{R}} Z$. \end{corollary} Another way to present the tangent cone at infinity (resp. $p$) of a subset $X\subset\mathbb{R}^{n+1}$ is via the spherical blow-up at infinity (resp. $p$) of $\mathbb{R}^{n+1}$. Let us consider the {\bf spherical blowing-up at infinity} (resp. $p$) of $\mathbb{R}^{n+1}$, $\rho_{\infty}\colon\mathbb{S}^n\times (0,+\infty )\to \mathbb{R}^{n+1}$ (resp. $\rho_p\colon\mathbb{S}^n\times [0,+\infty )\to \mathbb{R}^{n+1}$), given by $\rho_{\infty}(x,r)=\frac{1}{r}x$ (resp. $\rho_p(x,r)=rx+p$). Note that $\rho_{\infty}\colon\mathbb{S}^n\times (0,+\infty )\to \mathbb{R}^{n+1}\setminus \{0\}$ (resp. $\rho_p\colon\mathbb{S}^n\times (0,+\infty )\to \mathbb{R}^{n+1}\setminus \{0\}$) is a homeomorphism with inverse mapping $\rho_{\infty}^{-1}\colon\mathbb{R}^{n+1}\setminus \{0\}\to \mathbb{S}^n\times (0,+\infty )$ (resp. $\rho_p \colon\mathbb{S}^n\times (0,+\infty )\to \mathbb{R}^{n+1}\setminus \{0\}$) given by $\rho_{\infty}^{-1}(x)=(\frac{x}{\|x\|},\frac{1}{\|x\|})$ (resp. $\rho_p^{-1}(x)=(\frac{x-p}{\|x-p\|},\|x-p\|)$). The {\bf strict transform} of the subset $X$ under the spherical blowing-up $\rho_{\infty}$ is $X'_{\infty}:=\overline{\rho_{\infty}^{-1}(X\setminus \{0\})}$ (resp. $X'_{p}:=\overline{\rho_{p}^{-1}(X\setminus \{0\})}$). The subset $X_{\infty}'\cap (\mathbb{S}^n\times \{0\})$ (resp. $X_{p}'\cap (\mathbb{S}^n\times \{0\})$) is called the {\bf boundary} of $X'_{\infty}$ (resp. $X'_p$) and it is denoted by $\partial X'_{\infty}$ (resp. $\partial X'_p$). \begin{remark}\label{remarksimplepointcone} {\rm If $X\subset \mathbb{R}^{n+1}$ is a semialgebraic set, then $\partial X'_{\infty}=(C(X,\infty)\cap \mathbb{S}^n)\times \{0\}$ (resp. $\partial X'_{p}=(C(X,p)\cap \mathbb{S}^n)\times \{0\}$).} \end{remark} \subsection{Relative multiplicities} Let $X\subset \mathbb{R}^{m+1}$ be a $d$-dimensional subanalytic subset and $p\in \mathbb{R}^{m+1}\cup \{\infty\}$. We say $x\in\partial X'_p$ is {\bf a simple point of $\partial X'_p$}, if there is an open subset $U\subset \mathbb{R}^{m+2}$ with $x\in U$ such that: \begin{itemize} \item [a)] the connected components $X_1,\cdots , X_r$ of $(X'_p\cap U)\setminus \partial X'_{p}$ are topological submanifolds of $\mathbb{R}^{m+2}$ with $\dim X_i=\dim X$, for all $i=1,\cdots,r$; \item [b)] $(X_i\cup \partial X'_{p})\cap U$ are topological manifolds with boundary, for all $i=1,\cdots ,r$. \end{itemize} Let ${\rm Smp}(\partial X'_{p})$ be the set of simple points of $\partial X'_{p}$ and we define $C_{\rm Smp}(X,p)=\{t\cdot x; \, t>0\mbox{ and }x\in {\rm Smp}(\partial X'_{p})\}$. Let $k_{X,p}\colon {\rm Smp}(\partial X'_{p})\to \mathbb{N}$ be the function such that $k_{X,p}(x)$ is the number of connected components of the germ $(\rho_{p}^{-1}(X\setminus\{p\}),x)$. \begin{remark}\label{remarksimplepointdense} ${\rm Smp}(\partial X'_p)$ is an open dense subset of the $(d-1)$-dimensional part of $\partial X'_p$ whenever $\partial X'_p$ is a $(d-1)$-dimensional subset, where $d=\dim X$. \end{remark} \begin{definition}\label{def:relative_mult} It is clear the function $k_{X,p}$ is locally constant. In fact, $k_{X,p}$ is constant on each connected component $C_j$ of ${\rm Smp}(\partial X'_{p})$. Then, we define {\bf the relative multiplicity of $X$ at $p$ (along of $C_j$)} to be $k_{X,p}(C_j):=k_{X,p}(x)$ with $x\in C_j$. Moreover, when $X$ is a complex algebraic set, there is a complex algebraic set $\sigma$ with $\dim \sigma <\dim X$, such that $X_j\setminus \sigma$ intersect only one connected component $C_i$ (see \cite{Chirka:1989}, pp. 132-133), for each irreducible component $X_j$ of tangent cone $C(X,p)$. Then we define also $k_{X,p}(X_j):=k_{X,p}(C_i)$. Let $X_1,...,X_r$ be the irreducible components of $C(X,p)$. By reordering indices, if necessary, we assume that $k_{X,p}(X_1)\leq \cdots \leq k_{X,p}(X_r)$. Then we define $k(X,p)=(k_{X,p}(X_1),...,k_{X,p}(X_r))$. \end{definition} \subsection{Degree of complex algebraic sets} \begin{definition} Let $X\subset \mathbb{C}^n$ be a pure $p$-dimensional complex algebraic set such that and let $L\in G(n-p,n)$ such that $L\cap C(Y ,\infty) = \{0\}$. Let $\Pi \colon \mathbb{C}^n\rightarrow \mathbb{C}^p$ be the orthogonal projection such that $L=\Pi^{-1}(0)$. Therefore, there exists a proper algebraic subset $\sigma\subset \mathbb{C}^p$ such that $d=\#(\Pi^{-1}(t)\cap X)$ does not depend on $t\in \mathbb{C}^p\setminus \sigma$. We highlight that, $d$ does not depend also on $L$. Thus, we define {\bf the degree of $X$} to be ${\rm deg}(X)=d$. \end{definition} \begin{proposition}[Proposition 3.3 in \cite{FernandesS:2020}]\label{propdegone} Let $X\subset \mathbb{C}^n$ be a pure dimensional algebraic subset. Then, $\deg(X)=1$ if and only if $X$ is an affine linear subspace of $\mathbb{C}^n$. \end{proposition} \begin{remark}[\cite{BobadillaFS:2018}]\label{remarkdegree} Let $X\subset \mathbb{C}^n$ be a pure dimensional complex algebraic set and $X_1, \cdots, X_r$ be the irreducible components of $C(X,\infty)$. Then $$\deg(X)=\sum_{j=1}^r{k_{X,\infty}(X_j)\cdot \deg(X_j)}.$$ \end{remark} \subsection{Ends of semialgebraic sets} For $R>0$ we denote $\mathbb{S}^{n-1}_{R}=\{x\in \mathbb{R}^n; \|x\|=R\}$ and $B^{n}_R=\{x\in \mathbb{R}^n; \|x\|< R\}$. Moreover, if $X\subset \mathbb{R}^n$, we define $\mbox{Cone}_{\infty}(X)=\{tx; x\in X \ \ \mbox{and} \ \ t\in [1,+\infty)\}$. \begin{proposition}\label{propconicalstru} Let $C\subset \mathbb{R}^n$ be a semialgebraic set. Then there exists $R_0>0$ such that for each $R\geq R_0$ there exists a homeomorphism $h\colon C\setminus B_R(0)\rightarrow \mbox{Cone}_{\infty}(C\cap \mathbb{S}^{n-1}_{R})$ such that $\|h(x)\|=\|x\|$ for all $x\in C\setminus B_R(0)$. Moreover, if $C$ has isolated singularities then we can choose $R_0$ such that $C\cap \mathbb{S}^{n-1}_R$ is smooth for all $R\geq R_0$. \end{proposition} Each connected component of $C\setminus B_R(0)$ is called an {\bf end of $C$}. \section{The blow-spherical equivalence and some examples and properties} \subsection{Definition of the blow-spherical equivalence} \begin{definition}\label{def:bs_homeomorphism} Let $X$ and $Y$ be subsets in $\mathbb{R}^n$ and $\mathbb{R}^m$ respectively. Let $p\in \mathbb{R}^n\cup \{\infty\}$, $q\in \mathbb{R}^m\cup \{\infty\}$. A homeomorphism $\varphi:X\rightarrow Y$ such that $q=\lim\limits_{x\rightarrow p}{\varphi(x)}$ is said a {\bf blow-spherical homeomorphism at $p$}, if the homeomorphism $$\rho^{-1}_{m}\circ \varphi\circ \rho_n \colon X'_p\setminus \partial X'_p\rightarrow Y'_q\setminus \partial Y'_q$$ extends to a homeomorphism $\varphi'\colon X'_p\rightarrow Y'_q$. A homeomorphism $\varphi\colon X\rightarrow Y$ is said a {\bf blow-spherical homeomorphism} if it is a blow-spherical homeomorphism for all $p\in \overline{X}\cup \{\infty\}$. In this case, we say that the sets $X$ and $Y$ are {\bf blow-spherical homeomorphic} or {\bf blow-isomorphic} ({\bf at $(p,q)$}). \end{definition} \begin{definition}\label{def:strong_diffeo} Let $X$ and $Y$ be subsets in $\mathbb{R}^n$ and $\mathbb{R}^m$, respectively. We say that a blow-spherical homeomorphism $h\colon X\rightarrow Y$ is a {\bf strong blow-spherical homeomorphism} if $h({\rm Sing}_1(X))={\rm Sing}_1(Y)$ and $h|_{X\setminus {\rm Sing}_1(X)}\colon X\setminus {\rm Sing}_1(X)\rightarrow Y\setminus {\rm Sing}_1(Y)$ is a $C^1$ diffeomorphism, where, for $A\subset \mathbb{R}^p$, ${\rm Sing}_k(A)$ denotes the points $x\in A$ such that, for any open neighbourhood $U$ of $x$, $A\cap U$ is not a $C^k$ submanifold of $\mathbb{R}^p$. A blow-spherical homeomorphism at $\infty$, $\varphi\colon X\rightarrow Y$, is said a {\bf strong blow-spherical homeomorphism at $\infty$ } if there are compact sets $K\subset \mathbb{R}^n$ and $\tilde{K}\subset\mathbb{R}^m$ such that $\varphi(X\setminus K)=Y\setminus \tilde{K}$ and the restriction $\varphi|_{X\setminus K}\colon X\setminus K\to Y\setminus \tilde{K}$ is a strong blow-spherical homeomorphism. \end{definition} \begin{remark} We have some examples: \begin{enumerate} \item $\mbox{Id}:X \rightarrow X$ is a blow-spherical homeomorphism for any $X\subset \mathbb{R}^n$; \item Let $X\subset \mathbb{R}^n$, $Y\subset \mathbb{R}^m$ and $Z\subset \mathbb{R}^k$ be subsets. If $f\colon X\rightarrow Y$ and $g\colon Y\rightarrow Z$ are blow-spherical homeomorphisms, then $g\circ f\colon X\rightarrow Z$ is a blow-spherical homeomorphism. \end{enumerate} \end{remark} Thus we have a category called {\bf blow-spherical category}, which is denoted by $\mbox{BS}$, where its objects are all the subsets of Euclidean spaces and its morphisms are all blow-spherical homeomorphisms. By definition, if $X$ and $Y$ are strongly blow-spherical homeomorphic then they are blow-spherical homeomorphic, but the converse does not hold in general, as we can see in the next example. \begin{example} Let $V=\{(x,y)\in\mathbb{R}^2; y=|x|\}$. The mapping $\varphi\colon \mathbb{R}\to V$ given by $\varphi(x)=(x,|x|)$ is a blow-spherical homeomorphism (see Proposition \ref{Lip_implies_bs}). However, since ${\rm Sing}_1(\mathbb{R})=\emptyset$ and ${\rm Sing}_1(V)=\{(0,0)\}$, there is no strong blow-spherical homeomorphism $h\colon \mathbb{R}\to V$ and, in particular, $\mathbb{R}$ and $V$ are not strongly blow-spherical homeomorphic. \end{example} \subsection{Blow-spherical invariance of the relative multiplicities} \begin{proposition}\label{propinvarianciamultiplicidaderelativa} Let $X$ and $Y$ be semialgebraic set in $\mathbb{R}^n$ and $\mathbb{R}^m$ respectively. Let $\varphi:X\rightarrow Y$ be a blow-spherical homeomorphism at $p\in \mathbb{R}^n\cup \{\infty\}$. Then $$k_{X,p}(x)=k_{Y,q}(\varphi'(x)),$$ for all $x\in Smp(\partial X'_p)\subset \partial X'_p$, where $q=\lim\limits_{x\to p}\varphi(x)$. In particular, $k(X,p)=k(Y,q)$. \end{proposition} \begin{proof} Since $\varphi\colon X\rightarrow Y$ is a blow-spherical homeomorphism at $p$, we have that $\varphi':X'_p\rightarrow Y'_q$ is a homeomorphism such that $\varphi'(\partial X'_p)=\partial Y'_q$ and $\varphi'({\rm Smp}(\partial X'_p))= {\rm Smp}(\partial Y'_q)$. Thus, for each $x\in {\rm Smp}(\partial X'_p)$, the number of connected components of the germ $(\rho_{p}^{-1}(X\setminus\{p\}),x)=(X'_p\setminus \partial X'_p,x)$ is equal to the number of connected components of the germ $(\rho_{q}^{-1}(Y\setminus\{q\}),\varphi'(x))=(Y'_q\setminus \partial Y'_q,\varphi'(x)) $, which implies $k_{X,p}(x)=k_{Y,q}(\varphi'(x))$. \end{proof} \subsection{Blow-spherical invariance of the tangent cones} The next result is a generalization of Proposition 3.3 in \cite{Sampaio:2020}. \begin{proposition}\label{coneinvarianteblow} If $h\colon X\rightarrow Y$ is a blow-spherical homeomorphism at $p\in X\cup \{\infty\}$, then $C(X,p)$ and $C(Y,h(p))$ are blow-spherical homeomorphic at $0$. \end{proposition} \begin{proof} Let $q=\lim_{x\rightarrow p} h(x)$. Thus $h'_{p}\colon \partial X'_{p}\rightarrow \partial Y'_{q}$ is a homeomorphism. Let $\nu_{h}\colon C(X,p)\cap \mathbb{S}^{n-1}\rightarrow C(Y,q)\cap \mathbb{S}^{m-1}$ be the homeomorphism satisfying $h'_{p}(x,0)=(\nu_{h}(x),0)$ for all $x\in C(X,p)\cap \mathbb{S}^{n-1}$. Now, we define $d_{p}h\colon C(X,p)\rightarrow C(Y,q)$ by \[d_{p}h(x) = \left\{ \begin{array}{ll} \|x\|\nu_h\left(\frac{x}{\|x\|}\right) & \mbox{if} \ x \neq 0\\ 0 & \mbox{if} \ x= 0. \end{array} \right. \] Since $\rho_{0}^{-1}\circ d_{p}h\circ \rho_{0}(x,t)= (\nu_h(x),t)$, $d_{p}h$ is a blow-spherical homeomorphism at $0$. \end{proof} \subsection{Blow-spherical invariance of the degree of curves} \begin{proposition}\label{invariance_of_degree} Let $X$ and $Y$ be two complex algebraic curves. If $X$ and $Y$ are blow-spherical homeomorphic at $\infty$, then ${\rm deg}(X)={\rm deg}(Y)$. \end{proposition} \begin{proof} Let $X_1,...,X_r$ (resp. $Y_1,...,Y_s$) be the irreducible components of $C(X,\infty)$ (resp. $C(Y,\infty)$). By Proposition \ref{coneinvarianteblow}, we have that $C(X,\infty)$ and $C(Y,\infty)$ are blow-spherical homeomorphic and, consequently, $r=s$. Since each $X_i$ (resp. $Y_j$) is a complex line, it follows from Proposition \ref{propinvarianciamultiplicidaderelativa} and Remark \ref{remarkdegree} that \begin{eqnarray*} \deg X & = & \sum_{i=1}^r{k_{X,\infty}(X_i)\deg X_i}\\ & = & \sum_{i=1}^r{k_{X,\infty}(X_i)}\\ & = & \sum_{i=1}^r{k_{Y,\infty}(Y_i)}\\ & = & \sum_{i=1}^r{k_{Y,\infty}(Y_i)\deg Y_i}=\deg Y. \end{eqnarray*} \end{proof} \subsection{A Bernstein-type result} \begin{definition} A subset $X\subset \mathbb{R}^n$ is called blow-spherical regular at infinity if there are compact subsets $K$ and $\tilde{K}$ in $X$ and $\mathbb{R}^d$ respectively such that $X\setminus K$ is a blow-spherical homeomorphic at $\infty$ to an $\mathbb{R}^d\setminus \tilde{K}$. \end{definition} Now we remember Prill's Theorem proved in \cite{Prill:1967}. \begin{lemma}[\cite{Prill:1967}, Theorem] Let $C\subset \mathbb{C}^n$ be a complex cone which is a topological manifold. Then $C$ is a linear subspace of $\mathbb{C}^n$. \end{lemma} \begin{proposition} Let $X\subset \mathbb{C}^n$ be a pure dimensional complex algebraic set. If $X$ is blow-spherical regular at infinity, then $X$ is an affine linear subspace of $\mathbb{C}^n$. \end{proposition} \begin{proof} By Proposition \ref{coneinvarianteblow}. $C(X,\infty)$ is homeomorphic to $\mathbb{C}^k$, where $k=\dim X$, consequently, $C(X,\infty)$ is a topological manifold. By Prill's theorem $C(X,\infty)$ is a linear subspace of $\mathbb{C}^n$, in particular $C(X,\infty)$ is irreducible. Hence $\deg(C(X,\infty))=1$ and by Proposition \ref{propinvarianciamultiplicidaderelativa}, we have $k_{X,\infty}(C(X,\infty))=1$ and using Remark \ref{remarkdegree}, we have that $$\deg X=k_{X,\infty}(C(X,\infty))\cdot \deg(C(X,\infty))=1.$$ Then, by Proposition \ref{propdegone}, $X$ is an affine linear subspace of $\mathbb{C}^n$. \end{proof} \subsection{Semi-algebraic outer lipeomorphisms are blow-spherical homeomorphisms} \begin{proposition}\label{Lip_implies_bs} Let $X\subset \mathbb{R}^n$ and $Y\subset \mathbb{R}^m$ be semialgebraic sets. If $h\colon X\rightarrow Y$ is a semialgebraic outer lipeomorphism then $h$ is a blow-spherical homeomorphism. \end{proposition} \begin{proof} Firstly, let us prove that $h$ is a blow-spherical homeomorphism at $\infty$. So, consider $h_{\infty}'\colon X_{\infty}'\rightarrow Y_{\infty}'$ given by \[h_{\infty}'(u,t) = \left\{ \begin{array}{lr} \left( \frac{h(\frac{u}{t})}{\|h(\frac{u}{t})\|},\frac{1}{\|h(\frac{u}{t})\|}\right) & \mbox{if} \ t \neq 0\\ \left( \frac{d_{\infty}h(u)}{\|d_{\infty}h(u)\|},0\right) & \mbox{if} \ t= 0 \end{array} \right. \] where $d_{\infty}h\colon C(X,\infty)\rightarrow C(Y,\infty)$ is the mapping given by in the following way: Given $v\in C(X,\infty)$, let $\gamma: (\epsilon, +\infty)\rightarrow X$ be a semialgebraic arc such that $\gamma(t)=tv+o_{\infty}(t)$. Then $h\circ \gamma(t)=tw+o_{\infty}(t)$, for some $w\in C(Y,\infty)$. Thus, we set $d_{\infty}h(v)=w$. \begin{claim}\label{caim:dh-bilipischitz} $d_{\infty}h\colon C(X,\infty)\rightarrow C(Y,\infty)$ is a bi-Lipschitz map. \end{claim} \begin{proof}[Proof of Claim \ref{caim:dh-bilipischitz}] By hypotheses, there is a $K\geq 1$ such that $$\frac{1}{K}\|x-y\| \leq \|h(x)-h(y)\|\leq K\|x-y\|.$$ Now, consider $v_1,v_2\in C(X,\infty)$ and let $\gamma_1,\gamma_2 \colon (\epsilon,+\infty)\rightarrow X$ semialgebraic curve such that $\gamma_i(t)=tv_i+o_{\infty}(t)$, for $i=1,2$. Therefore, $$\frac{1}{K}\frac{\|\gamma_1(t)-\gamma_2(t)\|}{t}\leq \frac{\|h(\gamma_1(t))-h(\gamma_2(t))\|}{t}\leq K\frac{\|\gamma_1(t)-\gamma_2(t)\|}{t}.$$ Sending $t$ to infinity, we obtain $$\frac{1}{K}\|v_1-v_2\|\leq \|d_{\infty}h(v_1)-d_{\infty}h(v_2)\| \leq K\|v_1-v_2\|.$$ Thus, $d_{\infty}h$ is well-defined and bi-Lipschitz. \end{proof} Therefore, $$\frac{d_{\infty}h}{\|d_{\infty}h\|}\colon C(X,\infty)\cap \mathbb{S}^n\rightarrow C(Y,\infty)\cap \mathbb{S}^n$$ is a homeomorphism. \begin{claim}\label{claim:h-continuous} $h_{\infty}' \colon X_{\infty}' \rightarrow Y_{\infty}'$ is a continuous map. \end{claim} \begin{proof}[Proof of Claim \ref{claim:h-continuous}.] Clearly, $h_{\infty}'$ is continuous in $X_{\infty}'\setminus \partial X_{\infty}'$. Thus, it is enough to prove that $h_{\infty}'$ is continuous at each point $(u,0)\in \partial X_{\infty}'$. So, let $\{(x_n,t_n)\}\subset X_{\infty}'$ such that $(x_n,t_n)\rightarrow (u,0)$. We have to show that $$\lim_{n\rightarrow +\infty} h_{\infty}'(x_n,t_n)=h_{\infty}'(u,0)=\left(\frac{d_{\infty}h(u)}{\|d_{\infty}h(u)\|},0\right).$$ Since $h_{\infty}'{\big|}_{\partial X_{\infty}'}\colon \partial X_{\infty}'\rightarrow \partial Y_{\infty}'$ is continuous, we may assume that $t_n> 0$, $\forall n$. Thus, by setting $s_n=\frac{1}{t_n}$, we have \begin{eqnarray*} \lim_{n\rightarrow +\infty} h_{\infty}'(x_n,t_n) & = & \lim_{n\rightarrow +\infty} \left( \frac{h(\frac{u}{t_n})}{\|h(\frac{u}{t_n})\|},\frac{1}{\|h(\frac{u}{t_n})\|}\right)\\ & = & \lim_{n\rightarrow +\infty} \left( \frac{\frac{h(s_nu)}{s_n}}{\|\frac{h(s_nu)}{s_n}\|},\frac{1}{\|h(s_nu)\|}\right). \end{eqnarray*} Let $\gamma\colon (\epsilon,+\infty)\rightarrow X$ be a semialgebraic arc such that $\gamma(s)=su+o_{\infty}(s)$. Then $\lim_{n\rightarrow +\infty}\frac{h(s_nu)}{s_n}= d_{\infty}h(u)$. Indeed, \begin{eqnarray*} \left\| \frac{h(s_nu)}{s_n}-\frac{h(\gamma(s_n))}{s_n}\right\| & \leq & K\frac{\|s_nu-\gamma(s_n)\|}{s_n}\\ & = & K\left\| \frac{o_{\infty}(s_n)}{s_n}\right\|. \end{eqnarray*} Therefore, \begin{eqnarray*} 0 & = & \lim_{n\rightarrow +\infty}\left\| \frac{h(s_nu)}{s_n}-\frac{h(\gamma(s_n))}{s_n}\right\|\\ & = & \left\| \lim_{n\rightarrow +\infty} \frac{h(s_nu)}{s_n}-d_{\infty}h(u)\right\|. \end{eqnarray*} which implies that $h'_{\infty}$ is continuous. \end{proof} Similarly, we also prove that $h'^{-1}_{\infty}$ is continuous and this finishes the proof that $h$ is a blow-spherical homeomorphism at $\infty$. Now, let $p\in \overline{X}$ and $q=\lim\limits_{x\to p}h(p)$. Let $T_p\colon \mathbb{R}^n\to \mathbb{R}^n$ and $T_q\colon \mathbb{R}^m\to \mathbb{R}^m$ the mappings given by $T_p(x)=x+p$ and $T_q(y)=x+q$. It follows from \cite[Proposition 3.8]{Sampaio:2020} that $T_q^{-1}\circ h\circ T_p$ is a blow spherical homeomorphism at $0$. Therefore, $h$ is a blow spherical homeomorphism at $p$. \end{proof} \subsection{The projective closure of algebraic curves which are blow-spherical homeomorphic} Let $\iota\colon\mathbb{C}^n\rightarrow \mathbb{CP}^n$ be the mapping given by $\iota(xn)=(1:x)$. The hyperplane at infinity, denoted by $L_{\infty}$, is the complement of $\iota(\mathbb{C}^n)$ in $\mathbb{CP}^n$. Here, we identify $\mathbb{C}^n$ with $\iota(\mathbb{C}^n)$. With this identification, for a set $X\subset \mathbb{C}^n$, the closure of $X$ in $\mathbb{CP}^n$ is called the {\bf projective closure of $X$}. \begin{proposition}\label{homeoprojective} Let $X\subset \mathbb{C}^m$ and $Y\subset \mathbb{C}^k$ be complex algebraic curves. Let $h\colon X\rightarrow Y$ be a homeomorphism which is a blow-spherical homeomorphism at $\infty$. Then $h$ extends to a homeomorphism between the projective closures of $X$ and $Y$. \end{proposition} \begin{proof} Let $\overline{X}$ and $\overline{Y}$ be the projective closures of $X$ and $Y$, respectively. Thus $$h\colon \overline{X}\setminus L_{\infty}\rightarrow \overline{Y}\setminus L_{\infty}$$ $$(1:z)\mapsto (1:h(z))$$ Let $\{a_1,\cdots, a_r\}=\overline{X}\cap L_{\infty}$ and $\{b_1,\cdots, b_s\}=\overline{Y}\cap L_{\infty}$. We write $a_i=(0:c_i)$ (resp. $b_j=(0:d_j)$) for $i=1,\cdots, r$ (resp. $j=1,\cdots, s$). Note that $C(X, \infty)=\bigcup{\mathbb{C}\cdot c_i}$ (resp. $C(Y, \infty)=\bigcup{\mathbb{C}\cdot d_j}$). Since $h$ is a blow-spherical homeomorphism at $\infty$, then $h$ induces a homeomorphism $\phi\colon C(X,\infty)\rightarrow C(Y,\infty)$ and, consequently, there is a bijection $\sigma\colon \{1,\cdots, r\}\rightarrow \{1,\cdots, s\}$ such that $$\phi(\mathbb{C}\cdot c_i)=\mathbb{C}\cdot d_{\sigma(i)},$$ where $\phi\colon C(X,\infty)\rightarrow C(Y,\infty)$ is defined as follows \[\phi(v) = \left\{ \begin{array}{lr} \|v\|\cdot \nu_{\infty}\left(\frac{v}{\|v\|} \right), & v \neq 0\\ 0, & v= 0. \end{array} \right. \] and $\nu_{\infty}\colon C(X,\infty)\cap \mathbb{S}^{2m-1}\rightarrow C(Y,\infty)\cap \mathbb{S}^{2k-1} $ is the homeomorphism such that $h_{\infty}'(v,0)=\left(\nu_{\infty}(v),0\right)$. Thus, we define $\overline{h}\colon \overline{X}\rightarrow \overline{Y}$ by \[\overline{h}(v) = \left\{ \begin{array}{ll} h(v), & v \in \overline{X}\setminus L_{\infty}\\ b_{\sigma(i)}, & v= a_i \end{array} \right. \] Fix $i\in \{1,\cdots,r\}$ and let $(z_n:x_n)\in \overline{X}$ with $z_n\neq 0$ such that $(z_n:x_n)\rightarrow a_i=(0:c_i)$. Since $c_i=(c_i^1:...:c_i^m)\not=0$, we may assume, without loss of generality, $c_i^1\neq 0$. So, there exists $n_0\in \mathbb{N}$ such that $x_n^1\neq 0$ $\forall n\geq n_0$, where $x_n=(x_n^1:...:x_n^m)=(x_n^1:y_n)$. Then $$w_n=\left( 1:\frac{x_n^1}{z_n}:\frac{y_n}{z_n}\right)\rightarrow (0:1:c).$$ Note that if $\{u_n\}\subset X$ such that $\frac{u_n}{\|u_n\|}\rightarrow u$ then there exists $n_0\in \mathbb{N}$ such that $u_n\in \bigcup_{i\in J}{X_i}$, $\forall n>n_0$ and $C(X_i,\infty)=L=\mathbb{C}\cdot u$, $\forall i\in J$. Moreover, $h(u_n)\in \bigcup_{j\in J'}{Y_j}$ such that $C(Y_j,\infty)=\phi(L)=L'$, $\forall j\in J'$. In fact, $$h_{\infty}'\left(\frac{u_n}{\|u_n\|},\frac{1}{\|u_n\|}\right)= \left(\frac{h(u_n)}{\|h(u_n)\|},\frac{1}{\|h(u_n)\|}\right)\rightarrow h_{\infty}'(u,0)$$ and, in particular, $\frac{h(u_n)}{\|h(u_n)\|}\rightarrow \phi(u)\in \phi(L)=L'=\mathbb{C}\cdot v$. This implies that \begin{eqnarray*} \overline{h}(w_n) & = & \overline{h}\left(1:\frac{x_n^1}{z_n}:\frac{y_n}{z_n}\right)=\left(1:h\left(\frac{x_n^1}{z_n},\frac{y_n}{z_n}\right)\right) \rightarrow b_{\sigma(i)}, \end{eqnarray*} which shows that $\overline{h}$ is continuous. Similarly, we prove that $\overline{h}^{-1}$ is continuous as well. Therefore, $\overline{h}:\overline{X}\rightarrow \overline{Y}$ is a homeomorphism. \end{proof} The next example shows that we can not remove the condition that $h$ is a blow-spherical homeomorphism at $\infty$ in Proposition \ref{homeoprojective}. \begin{example} Let $X=\{(x,y)\in \mathbb{C}^2;xy=0\}$ and $Y=\{(x,y)\in \mathbb{C}^2;(y-x^2)x=0\}$. Then $X$ and $Y$ are homeomorphic, but their projective closures $\overline{X}$ and $\overline{X}$ are not homeomorphic. Indeed, $(\overline{X},p)$ is irreducible for any $p\in \overline{X}\setminus \{(1:0:0)\}$ and $(\overline{Y},p)$ is reducible for any $p\in \{(1:0:0),(0:0:1)\}$ (see also Figures \ref{fig:complexbstreeinfinity_one} and \ref{fig:complexbstreeinfinity_two}). \end{example} As we can see in the next example, the reciprocal of Proposition \ref{homeoprojective} is not true. \begin{example} Let $L=\{(x,y)\in \mathbb{C}^2;y=0\}$ and $C=\{(x,y)\in \mathbb{C}^2;x^2+y^2=1\}$. Then the projective closures $\overline{L}$ and $\overline{C}$ are smooth projective curves with genus zero. Therefore, $\overline{L}$ and $\overline{C}$ are diffeomorphic. However, $L$ and $C$ are not blow-spherical homeomorphic at infinity and, in particular, they are not blow-spherical homeomorphic (see also Figures \ref{fig:complexbstreeinfinity_three} and \ref{fig:complexbstreeinfinity_four}). \end{example} \section{Classification of complex algebraic curves under blow-spherical equivalence} \subsection{Classification of complex algebraic curves at infinity} We are going to prove that blow-spherical geometry at infinity of a complex algebraic curve determines and is determined by the blow-spherical tree at infinity. \begin{definition} Let $C\subset \mathbb{C}^n$ be a complex algebraic curve and let $X_1,\cdots , X_r$ be the irreducible components of the tangent cone at infinity $C(C,\infty)$. The {\bf complex blow-spherical tree at infinity of $C$} is the rooted tree with a root with the label $\infty$, with vertices $D_i$'s corresponding to the lines $X_i$'s and we put edges joining each vertex $D_i$ to the root. Finally, for each direction at infinity $X_i$, we put, for each end $E_{i,j}$ of the curve $C$ which is tangent to the $X_{i}$, a new vertex $A_{i,j}$ and an edge joining $A_{i,j}$ to $D_i$ with weight $k_{E_{i,j}}(X_i)$. \end{definition} Some examples of complex blow-spherical trees at infinity are presented in Figures \ref{fig:complexbstreeinfinity_one}, \ref{fig:complexbstreeinfinity_two}, \ref{fig:complexbstreeinfinity_three} and \ref{fig:complexbstreeinfinity_four}. \begin{figure}[H] \begin{tabular}{cc} \begin{minipage}[c][6cm][c]{6cm} \centering \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=0.7cm,y=0.7cm] \clip(-5,-1) rectangle (5,6.2); \draw [line width=1pt] (0,0)-- (0,2); \draw [line width=1pt] (0,2)-- (1,4); \draw [line width=1pt] (0,2)-- (-1,4); \draw [line width=1pt] (0,0) circle (2pt); \begin{scriptsize} \draw [fill=black] (0,0) circle (2pt); \draw [fill=black] (0,2) circle (2pt); \draw [fill=black] (-1,4) circle (2pt); \draw [fill=black] (1,4) circle (2pt); \draw [fill=black] (1 ,3) node {\normalsize $1$}; \draw [fill=black] (-1 ,3) node {\normalsize $2$}; \draw [fill=black] (0.4,0) node {\normalsize $\infty$}; \end{scriptsize} \end{tikzpicture} \caption{Complex blow-spherical at infinity of the curve $(y-x^2)x=0$.} \label{fig:complexbstreeinfinity_one} \end{minipage} & \begin{minipage}[c][6cm][c]{6cm} \centering \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=0.7cm,y=0.7cm] \clip(-5,-1) rectangle (5,6.2); \draw [line width=1pt] (0,0)-- (-1,2); \draw [line width=1pt] (0,0)-- (1,2); \draw [line width=1pt] (-1,2)-- (-1,4); \draw [line width=1pt] (1,2)-- (1,4); \draw [line width=1pt] (0,0) circle (2pt); \begin{scriptsize} \draw [fill=black] (0,0) circle (2pt); \draw [fill=black] (-1,4) circle (2pt); \draw [fill=black] (1,2) circle (2pt); \draw [fill=black] (-1,2) circle (2pt); \draw [fill=black] (1,4) circle (2pt); \draw [fill=black] (0.4 ,0) node {\normalsize $\infty$}; \draw [fill=black] (-1.4 ,3) node {\normalsize $1$}; \draw [fill=black] (1.4 ,3) node {\normalsize $1$}; \end{scriptsize} \end{tikzpicture} \caption{complex blow-spherical tree at infinity of the curve $xy=0$.} \label{fig:complexbstreeinfinity_two} \end{minipage} \end{tabular} \end{figure} \bigskip \begin{figure}[H] \begin{tabular}{cc} \begin{minipage}[c][6cm][c]{6cm} \centering \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=0.7cm,y=0.7cm] \clip(-5,-1) rectangle (5,6.2); \draw [line width=1pt] (0,0)-- (0,2); \draw [line width=1pt] (0,2)-- (0,4); \draw [line width=1pt] (0,0) circle (2pt); \begin{scriptsize} \draw [fill=black] (0,0) circle (2pt); \draw [fill=black] (0,4) circle (2pt); \draw [fill=black] (0,2) circle (2pt); \draw [fill=black] (0.4 ,0) node {\normalsize $\infty$}; \draw [fill=black] (0.4 ,3) node {\normalsize $1$}; \end{scriptsize} \end{tikzpicture} \caption{Real blow-spherical tree at infinity of the curve $y=0$.} \label{fig:complexbstreeinfinity_three} \end{minipage} & \begin{minipage}[c][6cm][c]{6cm} \centering \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=0.7cm,y=0.7cm] \clip(-5,-1) rectangle (5,6.2); \draw [line width=1pt] (0,0)-- (-1,2); \draw [line width=1pt] (0,0)-- (1,2); \draw [line width=1pt] (-1,2)-- (-1,4); \draw [line width=1pt] (1,2)-- (1,4); \draw [line width=1pt] (0,0) circle (2pt); \begin{scriptsize} \draw [fill=black] (0,0) circle (2pt); \draw [fill=black] (-1,4) circle (2pt); \draw [fill=black] (1,2) circle (2pt); \draw [fill=black] (-1,2) circle (2pt); \draw [fill=black] (1,4) circle (2pt); \draw [fill=black] (0.4 ,0) node {\normalsize $\infty$}; \draw [fill=black] (-1.4 ,3) node {\normalsize $1$}; \draw [fill=black] (1.4 ,3) node {\normalsize $1$}; \end{scriptsize} \end{tikzpicture} \caption{Real blow-spherical tree at infinity of the curve $x^2+y^2=1$.} \label{fig:complexbstreeinfinity_four} \end{minipage} \end{tabular} \end{figure} \bigskip \begin{theorem}\label{thmequivinfinity} Let $C$ and $\Gamma$ be two complex algebraic curves. Let $X_1,...,X_r$ (resp. $Y_1,...,Y_s$) be the irreducible components of $C(C,\infty)$ (resp. $C(\Gamma,\infty)$). We index the ends of $C$ and $\Gamma$ in such a way: $$C\setminus B_R=\bigcup_{i=1}^r\bigcup_{j=1}^{e_i}{E_{ij}}$$ and $$\Gamma\setminus B_R=\bigcup_{l=1}^s\bigcup_{m=1}^{\widetilde{e}_l}{F_{lm}},$$ satisfying $C(E_{ij},\infty)=X_i$ for all $i\in\{1,\cdots,r\}$ and $C(F_{lm},\infty)=Y_l$ for all $l\in\{1,\cdots,s\}$. Then, the following statements are equivalent: \begin{enumerate} \item [(1)] $C$ and $\Gamma$ are blow-spherical homeomorphic at infinity; \item [(2)] there exists $\sigma\colon \{1,\cdots,r\}\rightarrow \{1,\cdots,s\}$ such that for each $i$, there exists $\sigma_i\colon \{1,\cdots,e_i\}\rightarrow \{1,\cdots, \widetilde{e}_{\sigma(i)}\}$ such that $k_{E_{ij},\infty}(X_i)=k_{F_{\sigma(i)\sigma_i(j)},\infty}(Y_{\sigma(i)})$; \item [(3)] The blow-spherical trees at infinity of $C$ and $\Gamma$ are isomorphic; \item [(4)] $C$ and $\Gamma$ are strongly blow-spherical homeomorphic at infinity. \end{enumerate} \end{theorem} \begin{proof} By identifying $\mathbb{C}^n$ with $\mathbb{C}^n\times \{0\}\subset \mathbb{C}^n\times \mathbb{C}^k=\mathbb{C}^{n+k}$, for any $k\in \mathbb{N}$, we may assume that $X$ and $Y$ are in the same $\mathbb{C}^n$. $ (1)\Rightarrow (2)$. Let $h\colon C\setminus K\to \Gamma\setminus \tilde K$ be a blow-spherical homeomorphism, for some compact subsets $K$ and $\tilde K$. By Proposition \ref{coneinvarianteblow}, $h$ induces a homeomorphism $d_{\infty}h\colon C(C,\infty)\to C(\Gamma,\infty)$ and, consequently, $d_{\infty}h$ sends each irreducible component of $C(C,\infty)$ onto an irreducible component of $C(\Gamma,\infty)$. Thus, there is a bijection $\sigma\colon \{1,\cdots,r\}\rightarrow \{1,\cdots,s\}$ such that $Y_{\sigma(i)}=d_{\infty}h(X_i)$ for all $i\in \{1,\cdots,r\}$. For each $i\in \{1,\cdots,r\}$, by Proposition \ref{propinvarianciamultiplicidaderelativa}, $\{k_{E_{i,j},\infty}(X_i);j=1,...,e_i\}=\{k_{F_{\sigma(i),m},\infty}(Y_{\sigma(i)});m=1,...,\tilde e_{\sigma(i)}\}$. Then we can choose a bijection $\sigma_i\colon \{1,...,e_i\}\to \{1,...,\tilde e_{\sigma(i)}\}$ such that $k_{E_{i,j},\infty}(X_i)=k_{F_{\sigma(i),\sigma_i(j)},\infty}(Y_{\sigma(i)})$. $ (2)\Rightarrow (3)$. We assume that there is a bijection $\sigma\colon \{1,\cdots,r\}\rightarrow \{1,\cdots,s\}$ such that for each $i\in \{1,\cdots,r\}$ there is a bijection $\sigma_i\colon \{1,\cdots,e_i\}\rightarrow \{1,\cdots,\widetilde{e}_{\sigma(i)}\}$ such that $k_{E_{ij},\infty}(X_i)=k_{F_{\sigma(i)\sigma_i(j)},\infty}(Y_{\sigma(i)})$. Then we define the isomorphism between the blow-spherical trees at infinity of $C$ and $\Gamma$ by sending the root on the root and sending each vertex $D_i$ (corresponding to the line $X_i$) to the vertex $\widetilde{D}_{\sigma(i)}$ (corresponding to the line $Y_{\sigma(i)}$), sending the edge joining the root and $D_i$ to the edge joining the root and $\widetilde{D}$, sending each vertex $A_{i,j}$ (corresponding to the end $E_{i,j}$) to $\widetilde{A}_{\sigma(i),\sigma_i(j)}$ (corresponding to the end $F_{\sigma(i),\sigma_i(j)}$) and sending the edge joining $A_{i,j}$ to $D_i$ to the edge joining $\widetilde{A}_{\sigma(i),\sigma_i(j)}$ and $\widetilde{D}$. $ (3)\Rightarrow (4)$. Let $\Psi$ be an isomorphism between the complex blow-spherical trees at infinity of $C$ and $\Gamma$. So, we have $\Psi(D_i)=\widetilde{D}_{\sigma(i)}$ and $\Psi(A_{i,j})=\widetilde{A}_{\sigma(i),\sigma_i(j)}$ such that $k_{E_{ij},\infty}(X_i)=k_{F_{\sigma(i)\sigma_i(j)},\infty}(Y_{\sigma(i)})$. Fix $i\in \{1,\cdots,r\}$. Let $T_{i}\colon \mathbb{C}^n\rightarrow \mathbb{C}^n$ and $L_{\sigma(i)}\colon \mathbb{C}^n\rightarrow \mathbb{C}^n$ be linear isomorphisms such that $T(X_i)=L_{\sigma(i)}(Y_{\sigma(i)})=L:=\{(0,\xi)\in \mathbb{C}^{n-1}\times \mathbb{C};\xi \in \mathbb{C}\}$. Fix $j\in \{1,\cdots,e_i\}$. Let $E=T_i(E_{ij})$ and $F=L_{\sigma(i)}(F_{\sigma(i)\sigma_i(j)})$. Note that $T_i\colon E_{ij}\to E$ and $L_{\sigma(i)}\colon F_{\sigma(i)\sigma_i(j)}\to F$ are strong blow-spherical homeomorphic at infinity. Thus, by Proposition \ref{propinvarianciamultiplicidaderelativa}, $k_{E_{ij},\infty}(X_i)=k_{E,\infty}(L)$ and $k_{F_{\sigma(i)\sigma_i(j)},\infty}(Y_{\sigma(i)})=k_{F,\infty}(L)$. \begin{claim} \label{claim:propequivblowdeg} $E$ and $F$ are strongly blow-spherical homeomorphic at infinity \end{claim} \begin{proof} Let $\psi\colon \mathbb{C}\setminus D_{\epsilon}\rightarrow E$ and $\widetilde{\psi}\colon\mathbb{C}\setminus D_{\epsilon}\rightarrow F$ be Puiseux's parametrizations at infinity, for some disc $D_{\epsilon}\subset \mathbb{C}$. Since $k=k_{E_{ij},\infty}(L)=k_{F_{\sigma(i)\sigma_i(j)},\infty}(L)$, there are holomorphic mappings $\phi,\widetilde{\phi}\colon\mathbb{C}\setminus D_{\epsilon}\to \mathbb{C}^{n-1}$ satisfying $\lim\limits_{t\to \infty} \frac{\phi(t)}{t^k}=\lim\limits_{t\to \infty} \frac{\widetilde{\phi}(t)}{t^k}=0$ and such that $\psi$ and $\widetilde{\psi}$ are homeomorphisms given by $$\psi(t)=(\phi(t),t^{k})$$ and $$\widetilde{\psi}(t)=(\widetilde{\phi}(t),t^{k}). $$ Now define $\varphi\colon E\rightarrow F$ given by $\varphi=\widetilde{\psi}\circ \psi^{-1}$. Note that $\varphi$ is a diffeomorphism. Thus, we have to prove that $\varphi$ is a blow-spherical homeomorphism at infinity. Indeed, let $(x,0)\in \partial C'_{\infty}$ and for any sequence $\{z_n\}_{n\in \mathbb{N}}\subset E'\setminus \partial {E'}_{\infty}$ such that $\lim_{n\rightarrow +\infty}{z_n}=(x,0)$ and for all $n$ we write $z_n=(x_n,t_n)$ and $s_n=\psi^{-1}(\frac{x_n}{t_n})$. Then, we have \begin{eqnarray*} \varphi'_{\infty}(z_n) & = & \left(\frac{\varphi(\frac{x_n}{t_n})}{\|\varphi(\frac{x_n}{t_n})\|},\frac{1}{\|\varphi(\frac{x_n}{t_n})\|}\right)\\ & = & \left(\frac{(\widetilde{\phi}(s_n),s_n^{k})}{\|(\widetilde{\phi}(s_n),s_n^{k})\|},\frac{1}{\|(\widetilde{\phi}(s_n),s_n^{k})\|}\right). \end{eqnarray*} On the other hand, $\frac{x_n}{t_n}=(\phi(s_n),s_n^{k})$ and consequently we have $$z_n=\left(\frac{(\phi(s_n),s_n^{k})}{\|(\phi(s_n),s_n^{k})\|},\frac{1}{\|(\phi(s_n),s_n^{k})\|}\right).$$ Finally, since $\lim\limits_{t\to \infty} \frac{\phi(t)}{t^k}=\lim\limits_{t\to \infty} \frac{\widetilde{\phi}(t)}{t^k}=0$, we have $$\lim_{n\rightarrow +\infty}{\varphi'(z_n)}=\lim_{n\rightarrow +\infty}{z_n}=(x,0).$$ Therefore, $\varphi$ is a blow-spherical homeomorphism at infinity such that $\varphi'|_{\partial {E'}_{\infty}}=\mbox{id}_{\partial {E'}_{\infty}}$. \end{proof} Since $\varphi\colon E\to F$ is a strong blow-spherical homeomorphism at infinity, then $\varphi_{ij}:=L_{\sigma(i)}\circ \varphi\circ T_{i}^{-1}\colon E_{ij}\to F_{\sigma(i)\sigma_i(j)})$ is a strong blow-spherical homeomorphism at infinity. Now, we define $h\colon C\setminus B_R\to \Gamma \setminus B_R$ by $h(x)=\varphi_{ij}(x)$ if $x\in E_{ij}$. Since each $\varphi_{ij}$ is a strong blow-spherical homeomorphism and for each $i\in\{1,...,r\}$, $\varphi_{ij}'|_{\partial {E_{ij}'}_{\infty}}=\varphi_{il}'|_{\partial {E_{il}'}_{\infty}}$ for all $j,l\in\{1,...,e_i\}$, we obtain that $h$ is a strong blow-spherical homeomorphism. $ (4)\Rightarrow (1)$. Trivial. \end{proof} \subsection{Normal forms for the classification at infinity} Let $p_1\colon \mathbb Z_{>0}\times \mathcal P(\mathbb Z_{>0})\to \mathbb Z_{>0}$ and $p_2\colon \mathbb Z_{>0}\times \mathcal P(\mathbb Z_{>0})\to \mathcal P(\mathbb Z_{>0})$ be the canonical projections, where $\mathcal P(\mathbb Z_{>0})$ denotes the power set of $\mathbb Z_{>0}$ and $\mathbb Z_{>0}=\{n\in \mathbb Z; n>0\}$; Let $\mathcal A$ the subset of $\mathbb \mathbb Z_{>0}\times \mathcal P(\mathbb Z_{>0})$ formed by the all finite and non-empty subsets $A$ satisfying the following: \begin{itemize} \item [i)] $p_1(A)=\{1,...,r\}$ for some $r\in \mathbb Z_{>0}$; \item [ii)] $p_2(p_1^{-1}(i ))=\{k_{i, 1},...,k_{i ,e_{i }}\}\subset \mathbb Z_{>0}$ and $k_{i, j}\leq k_{i, j+1}$ for all $j\in\{1,...,e_{i}-1\}$ and for all $i\in \{1,...,r\}$. \item [iii)] $e_{i }\leq e_{i +1}$ for all $i \in \{1,...,r-1\}$. \end{itemize} For a set $A\in \mathcal A$ as above, we define the realization of $A$ to be the curve $$ X_A= \{(x,y)\in \mathbb{C}^2; \displaystyle\prod \limits_{i=1}^r\displaystyle\prod \limits_{j=1}^{e_i}(j(y-i x)^{k_{i, j}-1}-(y+i x)^{k_{i, j}})=0\}. $$ Thus, it follows from Theorem \ref{thmequivinfinity} and definition of $\mathcal A$, the following classification result: \begin{theorem}\label{thm:normal_forms} For each complex algebraic curve $X\subset \mathbb{C}^n$, there exists a unique set $A\in \mathcal A$ such that $X_A$ and $X$ are blow-spherical homeomorphic at infinity. \end{theorem} \begin{remark}\label{rem:plane_spacial_are_same} Theorem \ref{thm:normal_forms} says in particular that any spacial algebraic curve is blow-spherical homeomorphic at infinity to a plane algebraic curve. \end{remark} \subsection{Global classification of complex algebraic curves} \begin{definition} Let $C\subset \mathbb{C}^n$ be a complex algebraic curve and let $p_1,\cdots , p_s$ be the singular points of $C$. The {\bf complex blow-spherical tree of $C$} is the rooted tree with a root corresponding to the curve, with vertices $C_j's$ corresponding to the irreducible components of the curve $C$, we put edges joining each vertex $C_j$ equipped with a weight given by the Euler characteristic of the corresponding irreducible component. Fixed $j$, for each singular point $p_i$ of $C$ such that $p_i\in C_j$, we add a new vertex with the label $i$, we add also a new vertex with the label $\infty$ and we put edges joining each such a new vertex and $C_j$. For each $i\in\{1,..,s\}$, let $X_{i,1},...,X_{i,d_i}$ be the irreducible components of $C(C,p_i)$. Let $X_{\infty,1},...,X_{\infty,d_{\infty}}$ be the irreducible components of $C(C,\infty)$. We put a new vertex with the label $m$ for each tangent direction $X_{\infty,m}$ satisfying $X_{\infty,m}\subset C(C_j,\infty)$ and we put edges joining each vertex $m$ with the vertex $\infty$. If $p_i\in C_j$, then we put a new vertex with the label $m$ for each tangent direction $X_{i,m}$ satisfying $X_{i,m}\subset C(C_j,p_i)$ and we put edges joining each vertex $m$ with the vertex corresponding to $p_i$. Finally, for each irreducible component $C_{j,p_i}^l$ (resp. for each end $E_{jl}$) of the germ $(C_j,p_i)$ (resp. of $C_j$) which is tangent to $X_{i,m}$ (resp. $X_{\infty,m}$), we put a new vertex and an edge joining this new vertex and $m$ equipped with the weight given by the relative multiplicity $k_{C_{j,q_l}^l,p_i}(X_{i,m})$ (resp. $k_{E_{jl},\infty}(X_{\infty,m})$). \end{definition} Some examples of complex blow-spherical trees are presented in Figures \ref{fig:complexbstree} and \ref{fig:complexbstree_two}. \begin{figure}[h] \centering \begin{tikzpicture}[line cap=round,line join=round,>=triangle 60,x=0.7cm,y=0.7cm] \clip(-5,-1) rectangle (5,8.2); \draw [line width=1pt] (0,0)-- (2,2); \draw [line width=1pt] (0,0)-- (-2,2); \draw [line width=1pt] (2,2)-- (1,4); \draw [line width=1pt] (2,2)-- (2,4); \draw [line width=1pt] (2,2)-- (3,4); \draw [line width=1pt] (-2,2)-- (-3,4); \draw [line width=1pt] (-2,2)-- (-2,4); \draw [line width=1pt] (-2,2)-- (-1,4); \draw [line width=1pt] (-1,4)-- (-1,6); \draw [line width=1pt] (-2,4)-- (-2,6); \draw [line width=1pt] (-3,4)-- (-3,6); \draw [line width=1pt] (1,4)-- (1,6); \draw [line width=1pt] (2,4)-- (2,6); \draw [line width=1pt] (3,4)-- (3,6); \draw [line width=1pt] (-1,6)-- (-1,8); \draw [line width=1pt] (-2,6)-- (-2,8); \draw [line width=1pt] (-3,6)-- (-3,8); \draw [line width=1pt] (1,6)-- (1,8); \draw [line width=1pt] (2,6)-- (2,8); \draw [line width=1pt] (3,6)-- (3,8); \draw [line width=1pt] (0,0) circle (2pt); \begin{scriptsize} \draw [fill=black] (0,0) circle (2pt); \draw [fill=black] (2,2) circle (2pt); \draw [fill=black] (-2,2) circle (2pt); \draw [fill=black] (1,4) circle (2pt); \draw [fill=black] (2,4) circle (2pt); \draw [fill=black] (3,4) circle (2pt); \draw [fill=black] (-3,4) circle (2pt); \draw [fill=black] (-2,4) circle (2pt); \draw [fill=black] (-1,4) circle (2pt); \draw [fill=black] (-1,6) circle (2pt); \draw [fill=black] (-2,6) circle (2pt); \draw [fill=black] (-1,8) circle (2pt); \draw [fill=black] (-2,8) circle (2pt); \draw [fill=black] (-3,8) circle (2pt); \draw [fill=black] (1,8) circle (2pt); \draw [fill=black] (2,8) circle (2pt); \draw [fill=black] (3,8) circle (2pt); \draw [fill=black] (-3,6) circle (2pt); \draw [fill=black] (1,6) circle (2pt); \draw [fill=black] (2,6) circle (2pt); \draw [fill=black] (3,6) circle (2pt); \draw [fill=black] (0.4 ,0) node {\normalsize $C$}; \draw [fill=black] (-1.4 ,1) node {\normalsize $1$}; \draw [fill=black] (1.4 ,1) node {\normalsize $1$}; \draw [fill=black] (-2.4 ,2) node {\normalsize $C_1$}; \draw [fill=black] (2.4 ,2) node {\normalsize $C_2$}; \draw [fill=black] (3.4 ,4) node {\normalsize $\infty$}; \draw [fill=black] (2.4 ,4) node {\normalsize $2$}; \draw [fill=black] (1.4 ,4) node {\normalsize $1$}; \draw [fill=black] (-3.4 ,4) node {\normalsize $1$}; \draw [fill=black] (-2.4 ,4) node {\normalsize $2$}; \draw [fill=black] (-1.4 ,4) node {\normalsize $\infty$}; \draw [fill=black] (-1.3 ,7) node {\normalsize $2$}; \draw [fill=black] (-2.3 ,7) node {\normalsize $1$}; \draw [fill=black] (-3.3 ,7) node {\normalsize $1$}; \draw [fill=black] (1.3 ,7) node {\normalsize $1$}; \draw [fill=black] (2.3 ,7) node {\normalsize $1$}; \draw [fill=black] (3.3 ,7) node {\normalsize $3$}; \draw [fill=black] (-1.3 ,6) node {\normalsize $1$}; \draw [fill=black] (-2.3 ,6) node {\normalsize $2$}; \draw [fill=black] (-3.3 ,6) node {\normalsize $1$}; \draw [fill=black] (1.3 ,6) node {\normalsize $1$}; \draw [fill=black] (2.3 ,6) node {\normalsize $2$}; \draw [fill=black] (3.3 ,6) node {\normalsize $1$}; \end{scriptsize} \end{tikzpicture} \caption{Complex blow-spherical tree of the curve $(y-x^2)(y-x^3)=0$.} \label{fig:complexbstree} \end{figure} \begin{figure}[h] \centering \begin{tikzpicture}[line cap=round,line join=round,>=triangle 60,x=0.7cm,y=0.7cm] \clip(-5,-1) rectangle (5,8.2); \draw [line width=1pt] (0,0)-- (0,2); \draw [line width=1pt] (0,2)-- (1,4); \draw [line width=1pt] (0,2)-- (-1,4); \draw [line width=1pt] (1,4)-- (1,6); \draw [line width=1pt] (-1,4)-- (-1,6); \draw [line width=1pt] (-1,6)-- (-1,8); \draw [line width=1pt] (1,6)-- (1,8); \draw [line width=1pt] (0,0) circle (2pt); \begin{scriptsize} \draw [fill=black] (0,0) circle (2pt); \draw [fill=black] (0,2) circle (2pt); \draw [fill=black] (1,4) circle (2pt); \draw [fill=black] (-1,6) circle (2pt); \draw [fill=black] (-1,8) circle (2pt); \draw [fill=black] (-1,4) circle (2pt); \draw [fill=black] (1,8) circle (2pt); \draw [fill=black] (1,6) circle (2pt); \draw [fill=black] (0.4 ,0) node {\normalsize $C$}; \draw [fill=black] (0.4 ,2) node {\normalsize $C_1$}; \draw [fill=black] (-1.4 ,4) node {\normalsize $1$}; \draw [fill=black] (1.4 ,4) node {\normalsize $\infty$}; \draw [fill=black] (1.4 ,6) node {\normalsize $1$}; \draw [fill=black] (1.4 ,7) node {\normalsize $3$}; \draw [fill=black] (-1.4 ,6) node {\normalsize $1$}; \draw [fill=black] (-1.4 ,7) node {\normalsize $2$}; \draw [fill=black] (0.4,1) node {\normalsize $1$}; \end{scriptsize} \end{tikzpicture} \caption{Complex blow-spherical tree of the curve $y^2-x^3=0$.} \label{fig:complexbstree_two} \end{figure} \begin{theorem}\label{main_theorem} Let $C=\bigcup_{i\in I}{C_i}$ and $\widetilde{C}=\bigcup_{j\in J}{\widetilde{C}_j}$ be two complex algebraic curves, where $\{{C_i}\}_{i\in I}$ and $\{\widetilde{C}_j\}_{j\in J}$ are the irreducible components of $C$ and $\widetilde{C}$, respectively. The following statements are equivalent: \begin{enumerate} \item [(1)] $C$ and $\widetilde{C}$ are blow-spherical homeomorphic; \item [(2)] There is an isomorphism between the complex blow-spherical trees of $C$ and $\widetilde C$; \item [(3)] $C$ and $\widetilde{C}$ are strongly blow-spherical homeomorphic. \end{enumerate} \end{theorem} \begin{proof} $ (1)\Rightarrow (2)$. Assume that we have a blow-spherical homeomorphism $\varphi\colon C\rightarrow \widetilde{C}$. Thus we have that there is a bijection $\sigma\colon I\rightarrow J$ such that each irreducible component $C_i$ of $C$ is sent by $\varphi$ onto an irreducible component $\widetilde{C}_{\sigma(i)}$ of $\widetilde{C}$. Consequently $\chi(C_i)=\chi(\widetilde{C}_{\sigma(i)})$, where $\chi(C)$ is the Euler characteristic of $C$. Since $\varphi({\rm Sing}_1(C))={\rm Sing}_1(\widetilde C)$, by Corollary 6.2 in \cite{Sampaio:2020} and by Theorem \ref{thmequivinfinity}, we can obtain an isomorphism between the complex blow-spherical trees of $C$ and $\widetilde C$. $ (2)\Rightarrow (3)$. Assume that there is an isomorphism between the complex blow-spherical trees of $C$ and $\widetilde C$. Thus, we may assume that $C$ and $\widetilde C$ has the same complex blow-spherical tree. We fix $r\in \{1,...,s\}$. We denote $X=C_r$ and $\widetilde X=\widetilde C_r$. Let $p_1,\cdots,p_s$ (resp. $\widetilde{p}_1,\cdots, \widetilde{p}_s$) be the singular points of $C$ (resp. $\widetilde{C}$) which are in $X$ (resp. $Y$). So, by hypothesis we have $\chi(X)=\chi(\widetilde{X})$, $k(X,\infty)=k(\widetilde{X},\infty)$ and $k(X,p_j)=k(\widetilde{X},\widetilde{p}_j)$, $j=1,\cdots, s$. It follows from Corollary 6.2 in \cite{Sampaio:2020} that for a small enough $\epsilon>0$, there exist strong blow-spherical homeomorphisms $$g_j\colon C\cap \overline{B_{\epsilon}(p_j)}\rightarrow \widetilde{C}\cap \overline{B_{\epsilon}(\widetilde{p}_j)},$$ for any $j\in \{1,\cdots, s\}$. By Theorem \ref{thmequivinfinity}, for a sufficiently large $R>0$, there exist a strong blow-spherical homeomorphism $$h\colon X\setminus B_R(0)\rightarrow \widetilde{X}\setminus B_R(0).$$ We denote by $E_1,\cdots, E_{e}$ and $F_1,\cdots,F_e$ the ends of $X$ and $\widetilde{X}$, respectively, in such a way that $h(E_i\setminus B_R(0))= F_i\setminus B_R(0)$ for any $i\in \{1,\cdots, e\}$. Now, we define the following surfaces with boundary $$M= \Bigl(C\cap \overline{B_R(0)} \Bigr)\setminus \Bigl\{B_{\epsilon}(p_1)\cup \cdots \cup B_{\epsilon}(p_s)\Bigr\}$$ and $$N=\left(\widetilde{C}\cap \overline{B_R(0)}\right)\setminus \Bigl\{B_{\epsilon}(\widetilde{p}_1)\cup \cdots \cup B_{\epsilon}(\widetilde{p}_s)\Bigr\}.$$ Note that $f\colon \partial M\rightarrow \partial N$ is given by \[ f(z) = \begin{cases} g_j(z), &\quad\text{if} \ z\in C; \|z-p_j\|=\epsilon\\ h(z), &\quad\text{if} \ z\in X; \|z\|=R\\ \end{cases} \] is a diffeomorphism. The boundaries $\partial M$ and $\partial N$ are smooth compact manifolds of dimension 1 and, consequently, their connected components $S_i$ and $\widetilde{S}_i$ are diffeomorphic to $\mathbb{S}^1$, i.e., $\partial M=\bigcup_{i=1}^{k}{S_i}$ and $\partial N=\bigcup_{i=1}^{k}{\widetilde{S}_i}$ Since $M$ and $N$ are orientable and have the same genus and the same number of boundaries, we have a diffeomorphism $\nu\colon M\rightarrow N$ given by the theorem of classification for compact surfaces (see \cite{Hirsch}). The restriction $\nu\vert_{S_i}\colon S_i \rightarrow \widetilde{S}_i$ is an orientation-preserving diffeomorphism. Now $\nu^{-1}\circ h_{i} \colon S_{i}\rightarrow S_i$ and by Theorem 3.3 in \cite{Hirsch} there is an isotopy $H_i\colon S_i\times [R',R]\rightarrow S_i\times [R',R]$ such that $H_i(\cdot,R')=\mbox{id}$ and $H_i(\cdot,R)=\nu^{-1}\circ h$. Let $s\colon [R',R]\rightarrow [R',R]$ a smooth function such that \[ s(t) = \begin{cases} R', &\quad\text{if} \ t\in [R',\frac{R+2R'}{3}]\\ g(t), &\quad\text{if} \ t\in [\frac{R+2R'}{3},\frac{2R-R'}{3}]\\ R, &\quad\text{if} \ t\in[\frac{2R-R'}{3},R]\\ \end{cases}, \] where $g$ is a smooth bump function such that \[ g(t) = \begin{cases} R', &\quad\text{if} \ t\leq \frac{R+2R'}{3}\\ R, &\quad\text{if} \ t\geq \frac{2R-R'}{3}\\ \end{cases}. \] Now we define $\Phi\colon C\cap \overline{ann(0;R',R)}\rightarrow \partial M\times [R',R]$ by $\Phi(x)=(h(x),|x|)$ and $\Psi\colon \partial M\times [R',R]\rightarrow \nu\left(C\cap \overline{ann(0;R',R)}\right)$ such that the diagram below commutes \begin{center} \begin{tikzcd} C\cap \overline{ann(0;R',R)} \arrow[r]{d}{\Phi} \arrow[dr]{d}{\nu} & \partial M\times [R',R] \arrow[d]{d}{\Psi}\\ & \nu\left(C\cap \overline{ann(0;R',R)}\right) \end{tikzcd} \end{center} where $ann(0;R',R)=\overline{B_R(0)}\setminus B_{R'}(0)$. So, we have \begin{eqnarray*} \Psi\left(H(h(x),R'),|x|\right) & = & \Psi\left(h(x),|x|\right)\\ & = & \nu\circ \Phi^{-1}\left(\Phi(h(x))\right)\\ & = & \nu(h(x)), \end{eqnarray*} and \begin{eqnarray*} \Psi\left(H(h(x),R),|x|\right) & = & \Psi\left(\nu^{-1}\circ h(x),|x|\right)\\ & = & \nu\circ \Phi^{-1}\left(\nu^{-1}\circ h(x),|x|\right)\\ & = & \nu\left(\nu^{-1}\circ h(x)\right)\\ & = & h(x), \end{eqnarray*} By Theorem 3.3 in \cite{Hirsch}, there is a diffeomorphism $F\colon M\rightarrow N$ that extends $f\colon \partial M\rightarrow \partial N$. Therefore, we define the strong blow-spherical homeomorphism $\phi_r\colon X\rightarrow \widetilde{X}$ by: \[ \phi_r(z) = \begin{cases} g_j(z), &\quad\text{if} \ z\in X; \|z-p_j\|\leq \epsilon\\ h(z), &\quad\text{if} \ z\in X; \|z\|\geq R\\ F(z), &\quad\text{if} \ z\in M.\\ \end{cases} \] Finally, the mapping $\varphi\colon C \rightarrow \widetilde{C}$, defined by $\varphi(z) = \phi_r(z)$ whenever $z\in C_r$, is a strong blow-spherical homeomorphism. Since $ (3)\Rightarrow (1)$ by definition, this finishes the proof. \end{proof} As a consequence we obtain the following example: \begin{example}\label{main_example} Let $C_1=\{(x,y)\in \mathbb{C}^2; y-x^4=0\}$, $C_2=\{(x,y)\in \mathbb{C}^2; y-x^2-x^4=0\}$ and $C_3=\{(x,y)\in \mathbb{C}^2; y-x^3-x^4=0\}$. Then $C=C_1\cup C_2$ and $\widetilde C=C_1\cup C_3$ are blow-spherical homeomorphic (see Figure \ref{fig:complexbstree_three}). Since the coincidence between $C_1$ and $C_2$ at $0$ is 2 and the coincidence between $C_1$ and $C_3$ at $0$ is 3 (see the definition of coincidence between curves in \cite{Fernandes:2003}), we have that $C$ and $\widetilde C$ are not outer lipeomorphic (see \cite[Theorem 3.2]{Fernandes:2003}). \end{example} \begin{figure}[H] \begin{tabular}{cc} \begin{minipage}[c][8cm][c]{6cm} \centering \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=0.7cm,y=0.7cm] \clip(-5,-1) rectangle (5,6.2); \draw [line width=1pt] (0,0)-- (2,2); \draw [line width=1pt] (0,0)-- (-2,2); \draw [line width=1pt] (-2,2)-- (-3,4); \draw [line width=1pt] (-2,2)-- (-1,4); \draw [line width=1pt] (2,2)-- (3,4); \draw [line width=1pt] (2,2)-- (1,4); \draw [line width=1pt] (1,4)-- (1,6); \draw [line width=1pt] (3,4)-- (3,6); \draw [line width=1pt] (-1,4)-- (-1,6); \draw [line width=1pt] (-3,4)-- (-3,6); \draw [line width=1pt] (0,0) circle (2pt); \begin{scriptsize} \draw [fill=black] (0,0) circle (2pt); \draw [fill=black] (2,2) circle (2pt); \draw [fill=black] (-2,2) circle (2pt); \draw [fill=black] (-3,4) circle (2pt); \draw [fill=black] (-1,4) circle (2pt); \draw [fill=black] (3,4) circle (2pt); \draw [fill=black] (1,4) circle (2pt); \draw [fill=black] (-1,6) circle (2pt); \draw [fill=black] (-3,6) circle (2pt); \draw [fill=black] (1,6) circle (2pt); \draw [fill=black] (3,6) circle (2pt); \draw [fill=black] (0.4 ,0) node {\normalsize $C$}; \draw [fill=black] (-1.4 ,1) node {\normalsize $1$}; \draw [fill=black] (1.4 ,1) node {\normalsize $1$}; \draw [fill=black] (-2.6 ,2) node {\normalsize $C_1$}; \draw [fill=black] (2.6 ,2) node {\normalsize $C_2$}; \draw [fill=black] (-3.4 ,4) node {\normalsize $1$}; \draw [fill=black] (-1.4 ,4) node {\normalsize $\infty$}; \draw [fill=black] (1.4 ,4) node {\normalsize $1$}; \draw [fill=black] (3.4 ,4) node {\normalsize $\infty$}; \draw [fill=black] (-1.4 ,5) node {\normalsize $4$}; \draw [fill=black] (-3.4 ,5) node {\normalsize $1$}; \draw [fill=black] (1.4 ,5) node {\normalsize $1$}; \draw [fill=black] (3.4 ,5) node {\normalsize $4$}; \end{scriptsize} \end{tikzpicture} \caption{Complex blow-spherical tree of the curve $C$.} \label{fig:complexbstree_three} \end{minipage} & \begin{minipage}[c][8cm][c]{6cm} \centering \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=0.7cm,y=0.7cm] \clip(-5,-1) rectangle (5,6.2); \draw [line width=1pt] (0,0)-- (2,2); \draw [line width=1pt] (0,0)-- (-2,2); \draw [line width=1pt] (-2,2)-- (-3,4); \draw [line width=1pt] (-2,2)-- (-1,4); \draw [line width=1pt] (2,2)-- (3,4); \draw [line width=1pt] (2,2)-- (1,4); \draw [line width=1pt] (1,4)-- (1,6); \draw [line width=1pt] (3,4)-- (3,6); \draw [line width=1pt] (-1,4)-- (-1,6); \draw [line width=1pt] (-3,4)-- (-3,6); \draw [line width=1pt] (0,0) circle (2pt); \begin{scriptsize} \draw [fill=black] (0,0) circle (2pt); \draw [fill=black] (2,2) circle (2pt); \draw [fill=black] (-2,2) circle (2pt); \draw [fill=black] (-3,4) circle (2pt); \draw [fill=black] (-1,4) circle (2pt); \draw [fill=black] (3,4) circle (2pt); \draw [fill=black] (1,4) circle (2pt); \draw [fill=black] (-1,6) circle (2pt); \draw [fill=black] (-3,6) circle (2pt); \draw [fill=black] (1,6) circle (2pt); \draw [fill=black] (3,6) circle (2pt); \draw [fill=black] (0.4 ,0) node {\normalsize $\widetilde{C}$}; \draw [fill=black] (-1.4 ,1) node {\normalsize $1$}; \draw [fill=black] (1.4 ,1) node {\normalsize $1$}; \draw [fill=black] (-2.6 ,2) node {\normalsize $\widetilde{C}_1$}; \draw [fill=black] (2.6 ,2) node {\normalsize $\widetilde{C}_2$}; \draw [fill=black] (-3.4 ,4) node {\normalsize $1$}; \draw [fill=black] (-1.4 ,4) node {\normalsize $\infty$}; \draw [fill=black] (1.4 ,4) node {\normalsize $1$}; \draw [fill=black] (3.4 ,4) node {\normalsize $\infty$}; \draw [fill=black] (-1.4 ,5) node {\normalsize $4$}; \draw [fill=black] (-3.4 ,5) node {\normalsize $1$}; \draw [fill=black] (1.4 ,5) node {\normalsize $1$}; \draw [fill=black] (3.4 ,5) node {\normalsize $4$}; \end{scriptsize} \end{tikzpicture} \caption{Complex blow-spherical tree of the curve $\widetilde{C}$.} \label{fig:complexbstree_four} \end{minipage} \end{tabular} \end{figure} \begin{remark}\label{rem:plane_spacial_are_not-same} It was presented in \cite[Example 4.10]{BirbrairFJ:2021} an example of an algebraic curve $\Gamma\subset \mathbb{C}^n$ with nine cusps and such that its projective closure is a rational curve with nine cusps. Thus, there is no algebraic curve $\Lambda \subset \mathbb{C}^2$ which is blow-spherical homeomorphic to $\Gamma$. Indeed, assume that there is a blow-spherical homeomorphism $\varphi \colon \Gamma\to \Lambda$ and $\Lambda\subset \mathbb{C}^2$ is an algebraic curve. By \cite[Theorem 4.3]{Sampaio:2020} the curve $\Lambda$ has also nine cusps, hence by Proposition the projective closure of $\Lambda$ in $\mathbb{C} \mathbb{P}^2$ is a rational cuspidal curve with at least nine cusps, which is a contradiction by \cite[Corollary 1.2]{Tono:2005} \end{remark} \noindent{\bf Acknowledgements}. The authors would like to thank Alexandre Fernandes for his interest in this research.
\section{Introduction} For several decades, many authors have studied linear and nonlinear equations with fractional diffusions from a mathematical point of view and applied them to diverse fields such as biology \cite{BRR13}, financial mathematics \cite{A04}, and probability \cite{SV03}. Particularly important models from fluid mechanics are generalized Navier-Stokes equations (see e.g \cite{L67,L69,CDD18,T09}) and surface quasi-geographic equations (see e.g. \cite{CCCGW12,CV10}). In this paper, we consider the following initial value problem for a Stokes-Magneto system with fractional diffusions in $\mathbb{R}^d$, $d\geq 2$: \begin{equation}\label{eq:MHD-relaxed} \left\{ \begin{alignedat}{2} \nu \Lambda^{2\alpha} \bm{u} +\nabla {p_*} &=(\bm{b}\cdot \nabla)\bm{b}&&\quad \text{in } \mathbb{R}^d\times (0,\infty),\\ \partial_t \bm{b}+\eta \Lambda^{2\beta} \bm{b} +(\bm{u}\cdot \nabla)\bm{b} &=(\bm{b}\cdot \nabla)\bm{u} &&\quad \text{in }\mathbb{R}^d \times(0,\infty),\\ \Div \bm{u} =\Div \bm{b} &=0 &&\quad \text{in } \mathbb{R}^d\times (0,\infty),\\ \bm{b}(\cdot,0)&=\bm{b}_0 &&\quad \text{on } \mathbb{R}^d. \end{alignedat} \right. \end{equation} Here $\bm{u}:\mathbb{R}^d\times [0,\infty)\rightarrow \mathbb{R}^d$ is the velocity field, $\bm{b}: \mathbb{R}^d\times [0,\infty)\rightarrow \mathbb{R}^d$ is the magnetic field, and ${p_*}:\mathbb{R}^d\times [0,\infty)\rightarrow \mathbb{R}$ denotes the total pressure: ${p_*} = p + \frac{1}{2}|\bm{b}|^2$ with $p$ being the pressure on the fluid. The positive constants $\nu$ and $\eta$ stand for the viscosity constant and the magnetic diffusivity, respectively. For $s\in \mathbb{R}$, $\Lambda^s = (-\Delta)^{s/2}$ denotes the fractional Laplacian of order $s$ (see Section 2 for more details). Our model \eqref{eq:MHD-relaxed} was motivated by Moffatt \cite{M85,M21} who proposed the magnetic relaxation method to construct magnetohydrodynamics (MHD) equilibria from a given magnetic field $\bm{b}_0$. More precisely, Moffatt \cite{M85} first suggested the method of magnetic relaxation to construct a magnetic equilibrium from a solution of ideal MHD equations by letting $t\rightarrow \infty$. Later, in 2009, Moffatt suggested another possible way to construct an MHD equilibrium by introducing the system \eqref{eq:MHD-relaxed} with $\alpha=1$ and $\eta=0$. See Beekie-Friedlander-Vicol \cite{BFV21}, Constantin-Pasqualotto \cite{CP22}, and references therein for further motivation of magnetic relaxation. In comparison to \eqref{eq:MHD-relaxed}, we recall the generalized MHD system: \begin{equation}\label{eq:MHD} \left\{ \begin{alignedat}{2} \partial_t\bm{u}+\nu \Lambda^{2\alpha} \bm{u} +(\bm{u}\cdot\nabla)\bm{u}+\nabla {p_*} &=(\bm{b}\cdot \nabla)\bm{b}&&\quad \text{in } \mathbb{R}^d\times (0,\infty),\\ \partial_t \bm{b}+\eta \Lambda^{2\beta} \bm{b} +(\bm{u}\cdot \nabla)\bm{b} &=(\bm{b}\cdot \nabla)\bm{u} &&\quad \text{in }\mathbb{R}^d\times(0,\infty),\\ \Div \bm{u}=\Div \bm{b}&=0 &&\quad \text{in } \mathbb{R}^d\times (0,\infty),\\ \bm{u}(\cdot,0)=\bm{u}_0,\quad \bm{b}(\cdot,0)&=\bm{b}_0 &&\quad \text{on } \mathbb{R}^d. \end{alignedat} \right. \end{equation} When $\nu,\eta>0$ and $\alpha=\beta=1$, Duvaut-Lions \cite{DL72} proved global existence of weak solutions of \eqref{eq:MHD} with $\Leb{2}$-initial data. Later, Wu \cite{W03} extended this result to arbitrary $\alpha,\beta>0$ and also proved existence of global classical solutions for smooth initial data when $\alpha,\beta$ satisfy $\alpha, \beta \geq d/4+1/2$. The existence results in \cite{W03} were later improved by the same author \cite{W11} when $\alpha\geq d/4+1/2$, $\beta>0$, and $\alpha + \beta \geq d/2+1$. In addition to these results, many authors proved global regularity of classical solutions of \eqref{eq:MHD} in two-dimensional spaces under various hypotheses on $\alpha$ and $\beta$; see Yamazaki \cite{Y19} and references therein. On the other hand, when $\nu=0$ and $\eta>0$, Kozono \cite{K89} proved local existence and uniqueness of classical solutions of \eqref{eq:MHD} when $\beta=1$. This result was extended to any $\beta>0$ by Wu \cite{W11} for sufficiently smooth initial data. Recently, Fefferman et.al \cite{FMRR14,FMRR17} established local existence of strong solutions of \eqref{eq:MHD} when $\nu>0$, $\eta=0$, and $\alpha=1$, which was extended by Kim-Zhou \cite{KZ20} to general $\alpha$. In contrast to the generalized MHD system, there are few results for the Stokes-Magneto system with or without fractional diffusions. When $\nu,\eta>0$, $\alpha=\beta=1$, and $d=2,3$, McCormick-Robinson-Rodrigo \cite{MRR14} proved global existence of weak solutions of \eqref{eq:MHD-relaxed}. For the two-dimensional case, they also proved uniqueness and regularity of weak solutions. Recently, Ji-Tan \cite{JT21} proved global existence of strong solutions of \eqref{eq:MHD-relaxed} when $d=3$, $\alpha=1$, and $\beta\geq 3/2$. On the other hand, when $\nu>0$, $\eta=0$, and $\alpha=0$, Brenier \cite{B14} proved global existence of dissipative weak solutions on the two-dimensional torus $\mathbb{T}^2$. When $\nu>0$, $\eta=0$, and $\alpha=1$, Fefferman et.al. \cite{FMRR14} proved local existence and uniqueness of strong solutions of \eqref{eq:MHD-relaxed} on $\mathbb{R}^d$, $d=2,3$. Recently, when $\nu>0$, $\eta=0$, and $\alpha>d/2+1$, Beekie-Friedlander-Vicol \cite{BFV21} established global existence of strong solutions of \eqref{eq:MHD-relaxed} on the torus $\mathbb{T}^d$, $d=2,3$. Moreover, they also investigated 2D stability and 3D instability as well as the long-time behavior of solutions. In this paper, we establish global existence and uniqueness of weak solutions of the Stokes-Magneto system \eqref{eq:MHD-relaxed} with fractional diffusions. To elaborate a motivation of our notion of weak solutions, we multiply the first equation in \eqref{eq:MHD-relaxed} by $\bm{u}$ and the second equation by $\bm{b}$, and then integrate the resulting equations on $\mathbb{R}^d$. Using the divergence-free condition on $\bm{u}$ and $\bm{b}$, we have \[ \nu\int_{\mathbb{R}^d} |\Lambda^\alpha \bm{u}|^2 \myd{x}=-\int_{\mathbb{R}^d} (\bm{b} \otimes \bm{b}):\nabla \bm{u} \myd{x} \] and \[ \frac{1}{2}\frac{d}{dt}\int_{\mathbb{R}^d} |\bm{b}|^2 \myd{x} + \eta\int_{\mathbb{R}^d} |\Lambda^\beta \bm{b}|^2 \myd{x}=\int_{\mathbb{R}^d} (\bm{b} \cdot \nabla)\bm{u} \cdot \bm{b} \myd{x}.\] Adding these two identities and integrating it in time, we derive the energy identity \begin{equation}\label{eq:energy-equality} \int_{\mathbb{R}^d}|\bm{b}(t)|^2\myd{x} + 2 \int_0^t\int_{\mathbb{R}^d} \left( \nu|\Lambda^\alpha \bm{u}(s)|^2+ \eta |{\Lambda^\beta \bm{b}(s)}|^2 \right) \myd{x}\myd{s}=\int_{\mathbb{R}^d}|\bm{b}_0|^2\myd{x} \end{equation} for all $t \ge 0$. Furthermore, it will be shown in Subsection \ref{subsec:sol-formula} that if $1/2<\alpha<(d+1)/2$, then $\bm{u}$ is given by \begin{equation}\label{sol-formula-int} \bm{u}=\mathbf{U}_{\alpha}*(\bm{b}\otimes \bm{b}) \end{equation} where $\mathbf{U}_\alpha$ is a matrix-valued function satisfying \[ |\mathbf{U}_{\alpha}(x)|\leq \frac{C}{|x|^{d+1-2\alpha}} \] for some constant $C$ depending only on $d$ and $\alpha$. By Young's convolution inequality in weak spaces (Lemma \ref{lem:Young}), we deduce that \begin{equation}\label{eq:weak-spaces-estimate} \@ifstar{\@normb}{\@normi}{\bm{u}(t)}{\Lor{d/(d+1-2\alpha)}{\infty}}\leq C \@ifstar{\@normb}{\@normi}{\bm{b}(t)\otimes \bm{b}(t)}{\Leb{1}}\leq C\@ifstar{\@normb}{\@normi}{\bm{b}(t)}{\Leb{2}}^2 \end{equation} for some constant $C=C(d,\alpha)$. Here $\Leb{p}$ and $\Lor{p}{q}$ denote the Lebesgue spaces and Lorentz spaces on $\mathbb{R}^d$, respectively, where $1\leq p<\infty$ and $1\leq q\leq \infty$. For $s\in \mathbb{R}$, let $\thSob{s}$ be the homogeneous Sobolev spaces on $\mathbb{R}^d$ (see Section \ref{sec:prelim} for details). Then motivated by \eqref{eq:energy-equality} and \eqref{eq:weak-spaces-estimate}, we define weak solutions of \eqref{eq:MHD-relaxed} as follows. \begin{defn} Let $1/2< \alpha < (d+1)/2$ and $0< \beta < \infty$. Suppose that $\bm{b}_0 \in \Leb{2}$, ${\rm div}\, \bm{b}_0 =0$ in $\mathbb{R}^d$, and $0<T \le \infty$. Then a pair $(\bm{u},\bm{b} )$ of vector fields satisfying \begin{align*} \bm{u} &\in \Leb{\infty}(0,T;\Lor{{d}/{(d+1-2\alpha)}}{\infty})\cap \Leb{2}(0,T;\thSob{\alpha}), \\ \bm{b} &\in \Leb{\infty}(0,T;\Leb{2}) \cap \Leb{2}(0,T;\thSob{\beta}) \end{align*} is called a \emph{weak solution} of \eqref{eq:MHD-relaxed} in $[0, T)$ if the following are satisfied: \begin{enumerate}[label=\textnormal{(\arabic*)}] \item For all $\Phi \in C_{c}^\infty(\mathbb{R}^d;\mathbb{R}^d )$ with $\Div \Phi=0$, \begin{equation}\label{eq:velocity} \int_{\mathbb{R}^d} \nu \Lambda^{\alpha} \bm{u} (t) \cdot \Lambda^\alpha \Phi \myd{x}=-\int_{\mathbb{R}^d} \bm{b} (t)\otimes \bm{b} (t): \nabla \Phi \myd{x} \end{equation} for almost all $t\in (0,T)$. \item For all $\Phi \in C_c^\infty(\mathbb{R}^d\times[0,T);\mathbb{R}^d)$, \begin{equation}\label{eq:magnetic} \begin{aligned} \relphantom{=}\int_0^T \int_{\mathbb{R}^d} \bm{b} \cdot (-\partial_t \Phi + \eta \Lambda^{2\beta}\Phi)\myd{x}dt & -\int_0^T\int_{\mathbb{R}^d} (\bm{u}\otimes \bm{b}-\bm{b}\otimes \bm{u}):\nabla \Phi \myd{x}dt\\ &= \int_{\mathbb{R}^d} \bm{b}_0 \cdot \Phi( 0) \,dx. \end{aligned} \end{equation} \item For all $\psi \in C_{c}^\infty(\mathbb{R}^d )$, \[ \int_{\mathbb{R}^d} \bm{u} (t) \cdot \nabla \psi \myd{x}= \int_{\mathbb{R}^d} \bm{b} (t) \cdot \nabla \psi \myd{x} =0 \] for almost all $t\in (0,T)$. \end{enumerate} A weak solution of \eqref{eq:MHD-relaxed} in $[0, \infty)$ will be called a \emph{global weak solution}. \end{defn} Now we are ready to present the main results of the paper. We first establish existence of global weak solutions of \eqref{eq:MHD-relaxed} under a suitable assumption on $\alpha$ and $\beta$. \begin{thm}\label{thm:GWP} Let $\alpha$ and $\beta$ satisfy \[ \frac{1}{2}<\alpha<\frac{d+1}{2},\quad \beta>0 ,\quad\mbox{and}\quad \min\{ \alpha+\beta,2\alpha+\beta-1\}>\frac{d}{2}. \] Then for any $\bm{b}_0\in \Leb{2}$ with ${\rm div}\, \bm{b}_0 =0$, there exists at least one global weak solution of \eqref{eq:MHD-relaxed}. \end{thm} Next, we prove the time-continuity, energy identity, and uniqueness of weak solutions of \eqref{eq:MHD-relaxed} for larger values of $\alpha$ and $\beta$. \begin{thm}\label{thm:uniqueness} Let $\alpha$ and $\beta$ satisfy \[ \frac{1}{2}<\alpha<\frac{d+1}{2},\quad \beta \geq 1,\quad \text{and}\quad \min\{\alpha+\beta,2\alpha+\beta-1\}\geq \frac{d}{2}+1. \] Then for any $\bm{b}_0\in \Leb{2}$ with ${\rm div}\, \bm{b}_0 =0$, there exists a unique global weak solution $(\bm{u},\bm{b} )$ of \eqref{eq:MHD-relaxed}. Moreover, the solution $(\bm{u},\bm{b} )$ is continuous in $\Lor{{d}/{(d+1-2\alpha)}}{\infty} \times \Leb{2}$ and satisfies the energy identity \eqref{eq:energy-equality} for any $t\ge 0$. \end{thm} \begin{rem*} (a) Assume that $\alpha =1$ and $\beta >d/2 -1$. Then it follows from Theorem \ref{thm:GWP} that for any $\bm{b}_0\in \Leb{2}$ with ${\rm div}\, \bm{b}_0 =0$, there exists a global weak solution $(\bm{u},\bm{b} )$ of \eqref{eq:MHD-relaxed}. This result extends the existence result of McCormick-Robinson-Rodrigo \cite{MRR14} who considered the case when $d =2, 3$ and $\beta =1$. Moreover, by Theorem \ref{thm:uniqueness}, weak solutions of \eqref{eq:MHD-relaxed} are unique if $\beta \ge d/2 $. Hence it follows from the existence theorem for strong solutions due to Ji-Tan \cite{JT21} that if $d=3$ and $\bm{b}_0\in H^1$, then $(\bm{u},\bm{b})$ satisfies the following strong regularity properties: $$ \bm{u} \in C ( [0,T]; H^{3/2} )\cap L_2 ( 0,T;H^2 ), \quad \bm{b} \in C ([0,T]; H^{1} )\cap L_2 ( 0,T;H^{1+\beta} ) $$ for any $T<\infty$. (b) Assume that $\beta =1$ and $\max \{ 1/2, d/2 -1 , d/4 \} < \alpha <(d+1)/2$. Then it follows from Theorem \ref{thm:GWP} that for any $\bm{b}_0\in \Leb{2}$ with ${\rm div}\, \bm{b}_0 =0$, the problem \eqref{eq:MHD-relaxed} has global weak solutions. Moreover, by Theorem \ref{thm:uniqueness}, weak solutions of \eqref{eq:MHD-relaxed} are unique if $ \alpha \ge d/2 $ in addition. (c) Assume that $2 \le d \le 4$ and $(d+2)/6 < \alpha =\beta <(d+1)/2$. Then it follows from Theorems \ref{thm:GWP} and \ref{thm:uniqueness} that for any $\bm{b}_0\in \Leb{2}$ with ${\rm div}\, \bm{b}_0 =0$, the problem \eqref{eq:MHD-relaxed} has global weak solutions, which are unique if $(d+2)/4 \le \alpha =\beta <(d+1)/2$. \end{rem*} One of our main tools to prove Theorems \ref{thm:GWP} and \ref{thm:uniqueness} is the following product estimate (see Lemma \ref{lem:product-estimate}): if $1/2<\alpha<(d+1)/2$, $\beta>0$, and $\alpha+\beta>d/2$, then there exist constants $0<\theta_1,\theta_2<1$ such that \begin{equation}\label{eq:prod-est} \@ifstar{\@normb}{\@normi}{fg}{\NLeb{2}}\apprle \@ifstar{\@normb}{\@normi}{f}{\NLor{d/(d+1-2\alpha)}{\infty}}^{1-\theta_1}\@ifstar{\@normb}{\@normi}{f}{\thSob{\alpha}}^{\theta_1}\@ifstar{\@normb}{\@normi}{g}{\NLeb{2}}^{1-\theta_2}\@ifstar{\@normb}{\@normi}{g}{\thSob{\beta}}^{\theta_2} \end{equation} for all $f\in\Lor{d/(d+1-2\alpha)}{\infty}\cap \thSob{\alpha}$ and $g\in \tSob{\beta}$. Moreover, if $\alpha+(1-\mu)\beta \geq d/2+1$ for some $0\leq \mu \le 1$, we can choose $\theta_1$ and $\theta_2$ so that $(1+\mu)\theta_1+\theta_2+1/\beta \leq 2$. This additional condition enables us to establish uniqueness of weak solutions of \eqref{eq:MHD-relaxed}. The estimate \eqref{eq:prod-est} will be derived from generalized Gagliardo-Nirenberg interpolation inequalities that were obtained recently by Byeon-Kim-Oh \cite{BKO21} and Wang-Wei-Ye \cite{WWY21}. To prove existence of weak solutions (Theorem \ref{thm:GWP}) of \eqref{eq:MHD-relaxed}, we first construct a family of solutions $\{(\bm{u}_R,\bm{b}_R)\}$ of the $R$-truncated problems \eqref{eq:MHD-relaxed-approx}. Moreover, it is shown that these solutions satisfy uniform bounds. Then by a standard Aubin-Lions compactness argument combined with the estimate \eqref{eq:prod-est}, we construct a sequence of functions $\{\bm{b}_{R_k}\}$ that has strong convergence in $\Leb{2}(0,T;\Leb{2}(K))$ for every finite $T>0$ and compact $K \subset \mathbb{R}^d$. To show strong convergence of $\bm{u}_{R_k}$, we utilize the solution formula (\ref{sol-formula-int}) for the fractional Stokes system that will be derived in Section 3 (Theorem \ref{theorem:Frational Stokes-Lpdata}). Very weak solutions of the fractional Stokes system are introduced to apply the solution formula (\ref{sol-formula-int}) for $L^1$-data. Finally, making crucial use of the assumption $2 \alpha +\beta >d/2+1$, we show that the nonlinear terms $\bm{u}_{R_k} \otimes \bm{b}_{R_k}$ converge strongly in $L_{1,\mathrm{loc}} (\mathbb{R}^d \times (0,\infty ))$. The strong convergence properties of $ \bm{u}_{R_k}$ and $\bm{b}_{R_k}$ enable us to complete the proof of existence of weak solutions of \eqref{eq:MHD-relaxed} by passing to the limit $k\to\infty$. To prove uniqueness of weak solutions (Theorem \ref{thm:uniqueness}), we first study weak solutions of perturbed fractional heat equations. Then applying a standard Gronwall-type argument combined with product estimates (Lemmas \ref{lem:product-estimate} and \ref{lem:commutator}), we show that weak solutions are unique. This paper proceeds in six sections and three appendix sections. In Section \ref{sec:prelim}, we introduce our notations, the fractional Laplacian, homogeneous Sobolev spaces, and Lorentz spaces. We also provide proofs of product estimates that play crucial roles in proving existence and uniqueness of weak solutions. In Section \ref{sec:Stokes}, we prove the solution formula \eqref{sol-formula-int} for the fractional Stokes system. The notion of very weak solutions is also introduced. In Section \ref{sec:perturbed-heat}, we prove existence and regularity properties of weak solutions of perturbed fractional heat equations that will be used in the proof of uniqueness of weak solutions of \eqref{eq:MHD-relaxed}. The main theorems are proved in Sections \ref{sec:proofs} and \ref{sec:uniqueness}. Finally we give somewhat detailed proofs of some technical results in Appendices. \section{Preliminaries}\label{sec:prelim} \subsection{Notations} Let $\mathbb{N}_0 =\{0,1,2,\ldots\}$ be the set of nonnegative integers. For $\gamma =(\gamma_1,\dots,\gamma_d)\in \mathbb{N}^d_0$ and a function $u: \mathbb{R}^d\rightarrow \mathbb{R}$, we write \[ D^\gamma u = D_1^{\gamma_1}\cdots D_d^{\gamma_d}u \quad\mbox{and}\quad |\gamma|=\gamma_1+\cdots+\gamma_d. \] We write $\nabla u = (D_1 u,\dots,D_d u)$ for the gradient of $u$. We use bolditalic to denote vector fields, e.g., $\bm{u}:\mathbb{R}^d\times (0,\infty)\rightarrow \mathbb{R}^d$. Similarly we use boldroman to denote 2-tensors, e.g., $\mathbf{F} :\mathbb{R}^d\times (0,\infty)\rightarrow \mathbb{R}^{d\times d}$. For two vector fields $\bm{u}=(u^1,\dots,u^d)$ and $\bm{v}=(v^1,\dots,v^d)$, let $\bm{u}\otimes \bm{v}$ be the $2$-tensor whose $(i,j)$ component is $u^i v^j$ for $1\leq i,j\leq d$. Also, $(\bm{u} \cdot \nabla) \bm{v}$ is the vector field defined by \[ [(\bm{u} \cdot \nabla) \bm{v}]^i = \sum_{j=1}^d u^j \frac{\partial v^i}{\partial x_j} \quad (1\leq i\leq d). \] For two 2-tensors $\mathbf{F}=[F^{ij}]_{i,j=1}^d$ and $\mathbf{G}=[G^{ij}]_{i,j=1}^d$, their inner product is defined by \[ \mathbf{F}:\mathbf{G} = \sum_{i,j=1}^d F^{ij} G^{ij} \] For $\Omega\subset \mathbb{R}^d$ and $1\leq p\leq \infty$, $\Leb{p}(\Omega)$ denotes the $\Leb{p}$-space over $\Omega$ with the norm $\@ifstar{\@normb}{\@normi}{\cdot}{\NLeb{p};\Omega}$. For $1 \le p<\infty$ and $1\leq q\leq \infty$, we denote by $\Lor{p}{q}(\Omega)$ the Lorentz space over $\Omega$ with the quasi-norm $\@ifstar{\@normb}{\@normi}{\cdot}{\NLor{p}{q};\Omega}$. Let $C^\infty_c(\Omega)$ denote the space of all smooth functions (or vector fields) that have compact supports in $\Omega$. We denote by $C_{c,\sigma}^\infty (\Omega)$ the set of all vector fields in $C_c^\infty(\Omega)$ that are divergence-free. For the sake of convenience, we drop $\Omega$ in function spaces and their (quasi-)norms if $\Omega=\mathbb{R}^d$, e.g., $L_p =L_p (\mathbb{R}^d )$ and $\|\cdot \|_p = \|\cdot\|_{p; \mathbb{R}^d}$. For $x\in \mathbb{R}^d$ and $r>0$, let $B_r (x)$ denote the open ball of radius $r$ centered at $x$. We write $B_r$ for open balls centered at the origin. For two nonnegative quantities $A$ and $B$, we write $A\apprle_{\alpha,\beta,\ldots} B$ if $A\leq CB$ for some positive constant $C$ depending on the parameters $\alpha$, $\beta$, \ldots. If the dependence is evident, we usually omit the subscripts and simply write $A\apprle B$. We write $A\approx B$ if $A\apprle B$ and $B\apprle A$. For two topological vector spaces $X$ and $Y$ with $X \subset Y$, we write $X\hookrightarrow Y$ if $X$ is continuously embedded into $Y$, that is, the embedding $x \mapsto x$ is continuous. For a topological vector space $X$, we denote by $X^*$ the (topological) dual space of $X$. The dual pairing between $X^*$ and $X$ is denoted by $\action{\cdot,\cdot}$. Let $\mathscr{S}$ and $\mathscr{S}'$ be the Schwartz class and the space of tempered distributions on $\mathbb{R}^d$, respectively. For an integrable function $f$ on $\mathbb{R}^d$, we denote by $\hat{f}$ and $f^{\vee}$ the Fourier transform and the inverse Fourier transform, respectively, of $f$: \[ \hat{f}(\xi) = \int_{\mathbb{R}^d} e^{-2\pi i x\cdot \xi} f(x) \myd{x}\quad \text{and}\quad f^{\vee}(x)=\int_{\mathbb{R}^d} e^{2\pi i x\cdot \xi} f (\xi) \myd{\xi}.\] If $f$ is a tempered distribution, then $\hat{f}$ and $f^{\vee}$ are defined via duality by \[ \langle{\hat{f},\phi}\rangle = \langle{f, \hat{\phi}}\rangle \quad\mbox{and}\quad \action{f^{\vee},\phi} = \action{f,\phi^\vee} \quad\mbox{for all}\,\,\phi \in \mathscr{S}. \] \subsection{Sobolev spaces} For $s\in \mathbb{R}$ and $1<p<\infty$, the \emph{inhomogeneous Sobolev space} $\tSob{s}_p$ is defined by \[ \tSob{s}_p = \{ f \in \mathscr{S}' : J^s f \in \Leb{p} \},\] where $J^s = (I-\Delta)^{s/2} : \mathscr{S}'\rightarrow \mathscr{S}'$ is defined via the Fourier transform by \[ \widehat{J^s f} = \left( 1+4\pi^2 |\cdot|^2 \right)^{s/2} \hat{f}\quad \text{for } f\in \mathscr{S}'.\] For $p=2$, we write $\tSob{s} =\tSob{s}_2$. Then the Sobolev space $\tSob{s}$ is indeed a Hilbert space equipped with the inner product \[ (u,v)_{\tSob{s}} = \left( J^s u, J^s v \right) \] with $(\cdot,\cdot)$ denoting the inner product on $\Leb{2}$. By the Plancherel theorem, we have \[ (u,v)_{\tSob{s}} = \int_{\mathbb{R}^d} \left( 1+4\pi^2 |\xi|^2 \right)^s \hat{u}(\xi)\overline{\hat{v}(\xi)} \,\myd{\xi}.\] To define homogeneous Sobolev spaces, we need to introduce the following subspace of $\mathscr{S}$: \[ \mathscr{S}_0 =\{ \phi \in \mathscr{S} : D^\gamma \hat{\phi}(0)=0\quad \text{for all } \gamma \in \mathbb{N}^d_0 \}.\] Let $\mathscr{S}_0'$ be the dual space of $\mathscr{S}_0$. Then since $\mathscr{S}_0 \hookrightarrow \mathscr{S} \hookrightarrow \Leb{1} \cap \Leb{\infty}$, we have \[ \Leb{1}+\Leb{\infty} \hookrightarrow\mathscr{S} ' \hookrightarrow \mathscr{S}_0 ' . \] Moreover, it follows from the Hahn-Banach theorem that every $f \in \mathscr{S}_0 '$ can be extended to a tempered distribution $F$. Such an $F$ is unique up to additive polynomials, thanks to the following simple lemma (see e.g. \cite[Proposition 1.1.3]{G14-1}). \begin{lem}\label{lem:polynomial-isomorphism} Let $f $ be a tempered distribution. Then $f$ is a polynomial if and only if $\action{f,\psi}=0$ for all $\psi \in \mathscr{S}_0$. \end{lem} The fractional Laplacian $\Lambda^s : \mathscr{S}_0\rightarrow \mathscr{S}_0$ of order $s\in \mathbb{R}$ is defined by \[ \Lambda^s \phi = \left((2\pi |\cdot|)^s \hat{\phi} \right)^{\vee}\quad \text{for all } \phi \in \mathscr{S}_0.\] Then since $\Lambda^{s+t}=\Lambda^s \Lambda^t$ for any $s,t \in \mathbb{R}$, it follows that $\Lambda^s : \mathscr{S}_0\rightarrow \mathscr{S}_0$ is an isomorphism with the inverse $\Lambda^{-s}$. Hence for each $u\in \mathscr{S}_0'$, we define $\Lambda^s u\in \mathscr{S}_0'$ via duality by \[ \action{\Lambda^s u,\phi}=\action{u,\Lambda^s \phi}\quad \text{for all } \phi \in \mathscr{S}_0. \] Note also that $\Lambda^s : \mathscr{S}_0'\rightarrow \mathscr{S}_0'$ is an isomorphism. For $s\in \mathbb{R}$ and $1<p<\infty$, the \emph{homogeneous Sobolev space} $\thSob{s}_p$ is defined by \[ \thSob{s}_p = \{ f\in \mathscr{S}_0' : \Lambda^s f\in \Leb{p} \}.\] For $p=2$, we write $\thSob{s}=\thSob{s}_p$. The space $\thSob{s}$ is a Hilbert space equipped with the inner product \[ (u,v)_{\thSob{s}} = \left(\Lambda^s u,\Lambda^s v \right).\] It should be remarked that $\Lambda^t : \thSob{s+t} \rightarrow \thSob{s}$ is an isometric isomorphism for any $s,t \in \mathbb{R}$. It is standard that $\tSob{s}=\Leb{2}\cap \thSob{s}$ for any $s\geq 0$ (see e.g. \cite[Theorem 6.3.2]{BL76}). The following density results will be used several times in the paper. \begin{lem}\label{lem:density-approx-S0}\leavevmode \begin{enumerate}[label=\textnormal{(\arabic*)}] \item $C_c^\infty$ is dense in $\mathscr{S}$. \item For each $\phi\in \mathscr{S}$, there exists a sequence $\{\phi_k\}$ in $\mathscr{S}_0$ such that $\phi_k \rightarrow \phi$ in $\tSob{s}$ for any $s \ge 0$ \item$ \mathscr{S}_0$ is dense in both $\tSob{s}$ and $\thSob{s}$ for $s \in \mathbb{R}$. \item $\mathscr{S}_0$ is dense in $\Leb{p}\cap \thSob{s}$ for $1<p<\infty$ and $s\in \mathbb{R}$. \end{enumerate} \end{lem} \begin{proof} To prove Parts (1) and (2), we choose $\psi \in C^\infty$ such that $0\leq \psi\leq 1$, $\psi=0$ in $B_1$, and $\psi=1$ outside $B_2$. Given $\phi\in \mathscr{S}$, we define $\phi_k (x) = \left[1-\psi (x/k )\right]\phi (x)$ for $k\in \mathbb{N}$. Then $\phi_k \in C_c^\infty$ and $\phi_k \rightarrow \phi$ in $\mathscr{S}$. Moreover, if $\psi_k = \left(\psi (k \cdot ) \hat{\phi} \right)^{\vee}$ for $k\in \mathbb{N}$, then $\psi_k \in \mathscr{S}_0$ and $$ \@ifstar{\@normb}{\@normi}{\psi_k -\phi}{\tSob{s}}^2 = \int_{\mathbb{R}^d} \left( 1+4\pi^2 |\xi|^2 \right)^s \left| \psi (k \xi )- 1 \right|^2 |\hat{\phi}(\xi)|^2 \,\myd{\xi} \rightarrow 0 $$ for any $s \ge 0$, by the dominated convergence theorem. Suppose that $f \in \thSob{s}$ and $u= \Lambda^s f$. Then since $\mathscr{S}$ is dense in $L_2$, it follows from Part (2) that there exists a sequence $\{u_k\}$ in $\mathscr{S}_0$ such that $u_k \to u$ in $L_2$. If $f_k = \Lambda^{-s} u_k$, then $f_k \in \mathscr{S}_0$ and $\@ifstar{\@normb}{\@normi}{f_k-f}{\thSob{s}} = \@ifstar{\@normb}{\@normi}{u_k-u}{2} \to 0$. This proves that $\mathscr{S}_0$ is dense in $\thSob{s}$. Similarly, using $J^s$ instead of $\Lambda^s$, one easily shows that $\mathscr{S}_0$ is dense in $\tSob{s}$. This proves Part (3). A proof of (4) will be given later in Appendix \ref{sec:app-b}. \end{proof} An immediate consequence of Lemma \ref{lem:density-approx-S0} (3) is that every $f \in \thSob{-s}$ can be extended to a bounded linear functional on $\thSob{s}$ in such a way that the inequality \begin{equation}\label{dual-Hspace} \action{f,g } \le \|f\|_{\thSob{-s}}\|g\|_{\thSob{s}} \end{equation} holds for all $g \in \thSob{s}$. Moreover, since $L^2$ is self-dual and $\Lambda^{t} : \dot{H}^{t} \to L^2$ is an isomorphism for any $t \in \mathbb{R}$, it is easily shown that $\dot{H}^{-s}$ is the dual space of $\dot{H}^s$. Assume now that $s > 0$. Then it can be shown (see e.g. \cite[Lemma 1]{GO14}) that $\Lambda^s$ is well-defined on $\mathscr{S}$ and maps $\mathscr{S}$ to $ \mathscr{S}_s$, where \[ \mathscr{S}_s =\left\{ f\in C^\infty : \left( 1+|\cdot|^{d+s} \right)D^\gamma \psi \in \Leb{\infty} \,\,\text{ for all } \gamma \in \mathbb{N}_0^d \right\} . \] In particular, $\Lambda^s$ is bounded from $\mathscr{S}$ to $\Leb{1}\cap \Leb{\infty}$. Hence for each $u\in \Leb{1}+\Leb{\infty}$, we can extend $\Lambda^s u$ to a tempered distribution by defining \[ \action{\Lambda^s u ,\phi}=\int_{\mathbb{R}^d} u \Lambda^s \phi \myd{x}\quad \mbox{for all}\,\, \phi \in \mathscr{S} .\] \subsection{Lorentz spaces} Let $\Omega$ be any domain in $\mathbb{R}^d$. For a measurable function $f:\Omega \rightarrow \mathbb{C}$, the \emph{decreasing rearrangement} $f^*$ of $f$ is defined by \[ f^*(t) = \inf \{ s>0 : d_f(s)\leq t\}\quad (t>0), \] where $d_f(s)=|\{ x\in \Omega : |f(x)|>s\}|$. For $1\leq p<\infty$ and $1\leq q\leq \infty$, we define \[ \@ifstar{\@normb}{\@normi}{f}{\NLor{p}{q};\Omega} =\begin{dcases*} \left( \int_0^\infty [t^{1/p}f^*(t)]^q\frac{dt}{t} \right)^{1/q} & if $q<\infty$,\\ \sup_{t>0} t^{1/p}f^*(t)& if $q=\infty$. \end{dcases*} \] The set of all $f$ satisfying $\@ifstar{\@normb}{\@normi}{f}{\NLor{p}{q};\Omega}<\infty$ is denoted by $\Lor{p}{q}(\Omega)$ and called the \emph{Lorentz space} over $\Omega$ with indices $p$ and $q$. It is well-known that $\Lor{p}{q}(\Omega)$ is a complete quasi-normed space and is normable if $1<p<\infty$ (see e.g. \cite[Theorem 3.22]{SW71}). Moreover, for $1 \le p<\infty$, we have \ \Lor{p}{1}(\Omega)\hookrightarrow \Lor{p}{p}(\Omega)=\Leb{p}(\Omega)\hookrightarrow \Lor{p}{\infty}(\Omega). \ Using Lorentz spaces, we can refine several well-known inequalities in analysis. The first one is H\"older's inequality in Lorentz spaces which was proved by O'Neil \cite[Theorems 3.4, 3.5]{O63} \begin{lem}\label{lem:Holder} Let $1 \le p,p_1,p_2 <\infty$ and $1 \le q,q_1,q_2\leq \infty$ satisfy \[ \frac{1}{p}=\frac{1}{p_1}+\frac{1}{p_2}\quad \text{and}\quad \frac{1}{q}\leq \frac{1}{q_1}+\frac{1}{q_2}. \] Then for all $f\in \Lor{p_1}{q_1}(\Omega)$ and $g\in \Lor{p_2}{q_2}(\Omega)$, \[ \@ifstar{\@normb}{\@normi}{fg}{\NLor{p}{q};\Omega}\apprle \@ifstar{\@normb}{\@normi}{f}{\NLor{p_1}{q_1};\Omega}\@ifstar{\@normb}{\@normi}{g}{\NLor{p_2}{q_2};\Omega}. \] \end{lem} The second one is the following refinement of Sobolev's inequality (see e.g. \cite[Theorem 7.34]{AF03} and \cite[Theorem 6.5.1]{BL76}). \begin{lem}\label{lem:embedding} Let $0<s<d/2$. Then for all $u\in \thSob{s}$, we have \[ \@ifstar{\@normb}{\@normi}{u}{\NLor{{2d}/{(d-2s)}}{2}}\apprle \@ifstar{\@normb}{\@normi}{u}{\thSob{s}}.\] \end{lem} The third one is the following generalization of Young's convolution inequality due to O'Neil \cite[Theorem 2.6]{O63} (see also \cite[Theorems 1.2.13 and 1.4.24]{G14-2}). \begin{lem}\label{lem:Young} Let $1 < p,p_1 < \infty$ and $1 \le p_2 < \infty$ satisfy $$ \frac{1}{p}+1=\frac{1}{p_1}+\frac{1}{p_2} . $$ Then for all $f \in L^{p_1, \infty} $ and $g \in L^{p_2} $, we have \begin{align*} \|f*g\|_{p}& \apprle \|f\|_{p_1, \infty} \|g\|_{p_2} \quad\mbox{if}\,\, 1< p_2 < \infty;\\ \|f*g\|_{p,\infty}& \apprle \|f\|_{p_1, \infty} \|g\|_{1} \quad\mbox{if}\,\, p_2 =1 . \end{align*} \end{lem} Recall the following classical Gagliardo-Nirenberg interpolation inequality (see e.g. \cite[Theorem 5.10]{BKO21}). \begin{prop}\label{prop:Gagliardo} Let $0\leq s_0< s$, $1<p,p_1<\infty$, and $0<\theta<1$ satisfy \[ \frac{1}{p}-\frac{s_0}{d}=\frac{1-\theta}{p_1}+\theta \left(\frac{1}{2}-\frac{s}{d}\right)\quad\text{and}\quad \theta\geq \frac{s_0}{s}.\] Then for all $f\in \Leb{p_1}\cap \thSob{s}$, we have \[ \@ifstar{\@normb}{\@normi}{\Lambda^{s_0} f}{\NLeb{p}}\apprle \@ifstar{\@normb}{\@normi}{f}{\NLeb{p_1}}^{1-\theta}\@ifstar{\@normb}{\@normi}{\Lambda^{s}f}{\NLeb{2}}^{\theta}.\] \end{prop} Particularly, if $s_0 =0$ and $p_1 =2$ in Proposition \ref{prop:Gagliardo}, we deduce the well-known Sobolev embedding $H^s \hookrightarrow L^p $ for $s>0$ and $2 \le p<\infty$ satisfying $1/p \ge 1/2 -s/d$. The Gagliardo-Nirenberg interpolation inequality can be refined by using Lorentz spaces. The following is a special case of the Gagliardo-Nirenberg interpolation inequalities in Sobolev-Lorentz spaces (see \cite[Theorem 1.1]{WWY21} and \cite[Theorem 5.17]{BKO21}). \begin{prop}\label{prop:upper-critical} Let $ s >0$, $1<p , p_1 < \infty$, and $0<\theta<1$ satisfy \[ \frac{1}{p}=\frac{1-\theta}{p_1}+\theta \left(\frac{1}{2}-\frac{s}{d} \right)\quad \text{and}\quad \frac{1}{p_1}\neq \frac{1}{2}-\frac{s}{d}. \] Then for all $f\in \Lor{p_1}{\infty}\cap \thSob{s}$, we have \[ \@ifstar{\@normb}{\@normi}{f }{\NLor{p}{1}}\apprle \@ifstar{\@normb}{\@normi}{f}{\NLor{p_1}{\infty}}^{1-\theta}\@ifstar{\@normb}{\@normi}{\Lambda^s f}{\NLeb{2}}^{\theta}.\] \end{prop} \subsection{Product estimates} In this subsection, we prove product estimates that will be used in the paper. The first product estimate plays a crucial role in the proof of existence and uniqueness of weak solutions of \eqref{eq:MHD-relaxed}. \begin{lem}\label{lem:product-estimate} Let $\alpha , \beta>0$ satisfy $1/2<\alpha<(d+1)/2$ and $\alpha+\beta >d/2$. Then there exist $0<\theta_1,\theta_2<1$ such that \[ \@ifstar{\@normb}{\@normi}{fg}{\NLeb{2}}\apprle \@ifstar{\@normb}{\@normi}{f}{\NLor{d/(d+1-2\alpha)}{\infty}}^{1-\theta_1}\@ifstar{\@normb}{\@normi}{f}{\thSob{\alpha}}^{\theta_1}\@ifstar{\@normb}{\@normi}{g}{\NLeb{2}}^{1-\theta_2}\@ifstar{\@normb}{\@normi}{g}{\thSob{\beta}}^{\theta_2} \] for all $f\in \Lor{d/(d+1-2\alpha)}{\infty}\cap \thSob{\alpha}$ and $g\in \tSob{\beta}$. Moreover, if $\alpha+(1-\mu)\beta \geq d/2+1$ for some $0\leq \mu \le 1$, then $\theta_1$ and $\theta_2$ can be chosen so that $(1+\mu)\theta_1+\theta_2+1/\beta\leq 2$. \end{lem} \begin{proof} We will show that there exists $2< p< \infty$ satisfying \begin{equation}\label{eq:GN-pair} \frac{d}{2}-\frac{d}{p}<\alpha<\frac{d+1}{2}-\frac{d}{2p}\quad \text{and}\quad \beta >\frac{d}{p}. \end{equation} For such $p$, we define \[ \theta_1=\frac{d+1-2\alpha-d/p}{{d}/{2}+1-\alpha}\quad \text{and }\quad \theta_2 =\frac{d}{p\beta}. \] Then since \begin{equation}\label{eq:p-theta-relation} \begin{aligned} \frac{1}{p} &= (1-\theta_1 ) \frac{d+1-2\alpha}{d} +\theta_1 \left(\frac{1}{2}-\frac{\alpha}{d}\right),\\ \frac{p-2}{2p} &= \frac{1-\theta_2}{2} +\theta_2 \left(\frac{1}{2}-\frac{\beta}{d}\right), \quad\mbox{and}\quad 0< \theta_1 , \theta_2 < 1 , \end{aligned} \end{equation} it follows from H\"older's inequality and Proposition \ref{prop:upper-critical} that \begin{align*} \@ifstar{\@normb}{\@normi}{fg}{\NLeb{2}}\leq \@ifstar{\@normb}{\@normi}{f}{\NLeb{p}}\@ifstar{\@normb}{\@normi}{g}{\NLeb{2p/(p-2)}}\apprle \@ifstar{\@normb}{\@normi}{f}{\NLor{d/(d+1-2\alpha)}{\infty}}^{1-\theta_1}\@ifstar{\@normb}{\@normi}{f}{\thSob{\alpha}}^{\theta_1}\@ifstar{\@normb}{\@normi}{g}{\NLeb{2}}^{1-\theta_2}\@ifstar{\@normb}{\@normi}{g}{\thSob{\beta}}^{\theta_2}. \end{align*} Moreover, since \begin{equation*} {\beta \theta_2} = \frac{d}{p}= (1-\theta_1)\left({d+1-2\alpha}\right)+\theta_1 \left(\frac{d}{2}-{\alpha}\right), \end{equation*} we deduce that if $\alpha+(1-\mu)\beta \geq d/2+1$ for some $0\leq \mu \le 1$, then \begin{align*} \beta\left[(1+\mu)\theta_1+\theta_2-2\right]+1&= \left[\alpha+(1+\mu)\beta-\frac{d}{2}-1\right] \theta_1 -2\alpha -2\beta +d+2\\ &\leq -\alpha-(1-\mu)\beta+\frac{d}{2}+1\leq 0. \end{align*} Therefore it remains to prove existence of $2< p<\infty$ satisfying \eqref{eq:GN-pair}. First, if ${d}/{2}\leq \alpha<{(d+1)}/{2}$ and $\beta >0$, then choosing a sufficiently large $2<p<\infty$, we obviously have \[ \frac{d}{2}-\frac{d}{p}< \frac{d}{2} \le \alpha<\frac{d+1}{2}-\frac{d}{2p}\quad \text{and}\quad \beta >\frac{d}{p}. \] Suppose next that ${1}/{2}<\alpha< {d}/{2}$ and $ \beta >d/2 -\alpha$. Then \[ \max \left\{ 2 , \frac{d}{\beta}, \frac{d}{d+1-2\alpha} \right\} < \frac{d}{{d}/{2}-\alpha} < \infty . \] Choosing any $p$ such that \[ \max \left\{ 2 , \frac{d}{\beta}, \frac{d}{d+1-2\alpha} \right\} < p< \frac{d}{{d}/{2}-\alpha} , \] we have \[ 2<p<\infty , \quad \frac{d}{2}-\frac{d}{p}< \alpha<\frac{d+1}{2}-\frac{d}{2p} , \quad \text{and}\quad \beta >\frac{d}{p}. \] This completes the proof of Lemma \ref{lem:product-estimate}. \end{proof} To prove uniqueness of weak solutions of \eqref{eq:MHD-relaxed} particularly when $1/2<\alpha <1$, we also need the following product estimate. \begin{lem}\label{lem:commutator} Let $\gamma>d/2$ and $0<s\leq \gamma$. Then for all $f\in \tSob{s}$ and $g\in \tSob{\gamma}$, \[ \@ifstar{\@normb}{\@normi}{\Lambda^s(fg)}{\NLeb{2}}\leq C \@ifstar{\@normb}{\@normi}{f}{\tSob{s}}\@ifstar{\@normb}{\@normi}{g}{\tSob{\gamma}}, \] where $C=C(d,\gamma,s)>0$. \end{lem} \begin{proof} A proof is given in \cite[Lemma 3.2]{KZ20}. However, we provide a detailed proof of the lemma for the sake of convenience. Suppose that $0<s < \gamma$. Then since $\gamma >d/2$, there exists $2 < p < \infty$ such that \[ \max \left\{ \frac{1}{2}-\frac{s}{d},0\right\} < \frac{1}{p} < \min \left\{\frac{1}{2},\frac{\gamma-s}{d}\right\}.\] By the Sobolev embedding theorem, we have \[ \@ifstar{\@normb}{\@normi}{f}{\NLeb{p}}\apprle \@ifstar{\@normb}{\@normi}{f}{\tSob{s}}\quad \text{and}\quad\@ifstar{\@normb}{\@normi}{J^s g}{\NLeb{{2p}/{(p-2)}}}\apprle \@ifstar{\@normb}{\@normi}{J^s g}{\tSob{\gamma-s}}.\] Therefore, it follows from the fractional Leibniz rule (see e.g. \cite[Theorem 1]{GO14}) and Sobolev embedding theorem that \begin{align*} \@ifstar{\@normb}{\@normi}{\Lambda^s(fg)}{\NLeb{2}}&\apprle \@ifstar{\@normb}{\@normi}{f}{\NLeb{p}}\@ifstar{\@normb}{\@normi}{\Lambda^s g}{\NLeb{{2p}/{(p-2)}}}+\@ifstar{\@normb}{\@normi}{\Lambda^s f}{\NLeb{2}}\@ifstar{\@normb}{\@normi}{g}{\NLeb{\infty}}\\ &\apprle \@ifstar{\@normb}{\@normi}{f}{\tSob{s}}\@ifstar{\@normb}{\@normi}{J^s g}{\tSob{\gamma-s}}+\@ifstar{\@normb}{\@normi}{\Lambda^s f}{\NLeb{2}}\@ifstar{\@normb}{\@normi}{g}{\tSob{\gamma}}\\ &\apprle \@ifstar{\@normb}{\@normi}{f}{\tSob{s}}\@ifstar{\@normb}{\@normi}{g}{\tSob{\gamma}}. \end{align*} Similarly, if $s =\gamma$, then \begin{align*} \@ifstar{\@normb}{\@normi}{\Lambda^s(fg)}{\NLeb{2}}&\apprle \@ifstar{\@normb}{\@normi}{f}{\NLeb{\infty}}\@ifstar{\@normb}{\@normi}{\Lambda^s g}{\NLeb{2}}+\@ifstar{\@normb}{\@normi}{\Lambda^s f}{\NLeb{2}}\@ifstar{\@normb}{\@normi}{g}{\NLeb{\infty}} \\ &\apprle \@ifstar{\@normb}{\@normi}{f}{\tSob{s}}\@ifstar{\@normb}{\@normi}{g}{\tSob{\gamma}}. \end{align*} This completes the proof of Lemma \ref{lem:commutator}. \end{proof} \begin{lem}\label{lem:product2} Let $\alpha$ and $\beta$ satisfy either one of the following conditions: \begin{enumerate}[label=\textnormal{(\arabic*)}] \item $\alpha <1$, $\beta >d/2$, and $\alpha +\beta \ge 1$. \item $1 \le \alpha <d/2 +1$ and $\alpha +2 \beta \ge d/2 +1$. \end{enumerate} Then for all $f , g\in \tSob{\beta}$, \[ \@ifstar{\@normb}{\@normi}{fg}{\thSob{1-\alpha}}\leq C \@ifstar{\@normb}{\@normi}{f}{\tSob{\beta}}\@ifstar{\@normb}{\@normi}{g}{\tSob{\beta}}, \] where $C=C(d,\alpha , \beta )>0$. \end{lem} \begin{proof} Suppose that $\alpha <1$, $\beta >d/2$, and $\alpha +\beta \ge 1$. Then since $0< 1-\alpha \le \beta$, it immediately follows from Lemma \ref{lem:commutator} that \[ \@ifstar{\@normb}{\@normi}{fg}{\thSob{1-\alpha}}\leq C \@ifstar{\@normb}{\@normi}{f}{\tSob{1-\alpha}}\@ifstar{\@normb}{\@normi}{g}{\tSob{\beta}}\leq C \@ifstar{\@normb}{\@normi}{f}{\tSob{\beta}}\@ifstar{\@normb}{\@normi}{g}{\tSob{\beta}}. \] Suppose next that $1 \le \alpha < d/2 +1$ and $\alpha +2 \beta \ge d/2 +1$. Recall then that $$ \thSob{1-\alpha}=\left(\thSob{\alpha-1}\right)^* . $$ Let $2 \le r<\infty$ be defined by $$ \frac{1}{r}= \frac{1}{2}-\frac{\alpha-1}{d}. $$ Note that \[ \beta>0 \quad\mbox{and}\quad \frac{1}{2 r'} = \frac{1}{2}-\frac{1}{2}\left(\frac{1}{2}-\frac{\alpha-1}{d} \right) \ge \frac{1}{2} -\frac{\beta}{d} . \] Hence by the Sobolev embedding theorem (see Lemma \ref{lem:embedding} and Proposition \ref{prop:Gagliardo} with $p_1 =2$ e.g.), we have \[ \int_{\mathbb{R}^d} (fg) \phi \myd{x} \leq \@ifstar{\@normb}{\@normi}{f }{\NLeb{2r'}} \@ifstar{\@normb}{\@normi}{g}{\NLeb{2r'}}\@ifstar{\@normb}{\@normi}{\phi}{\NLeb{r}} \apprle \@ifstar{\@normb}{\@normi}{f}{\tSob{\beta}} \@ifstar{\@normb}{\@normi}{g}{\tSob{\beta}} \@ifstar{\@normb}{\@normi}{\phi}{\thSob{\alpha-1}} \] for any $\phi \in \thSob{\alpha-1}$. This completes the proof of Lemma \ref{lem:product2}. \end{proof} \section{Fractional Stokes equations}\label{sec:Stokes} In this section, we consider the fractional Stokes equations in $\mathbb{R}^d , d \ge 2$: \begin{equation}\label{frac-Stokes} \Lambda^{2\alpha}\bm{u}+\nabla {p_*} = \Div\mathbf{F}, \quad \Div\bm{u}=0 \quad\mbox{in}\,\, \mathbb{R}^d , \end{equation} where $\alpha$ is a real number. Here $\mathbf{F} = [F^{jk}]_{1 \le j, k \le d}$ is a given matrix-valued function and $\Div \mathbf{F}$ is the vector field whose $j$-th component is given by \[ (\Div \mathbf{F})^j = \sum_{k=1}^d D_{k} F^{jk}; \] hence \[ \Div \Div \mathbf{F} = \sum_{j,k=1}^d D_{jk} F^{jk} \] and \[ \widehat{\Div \Div \mathbf{F}}(\xi ) = (2 \pi i \xi ) \otimes (2\pi i \xi ) : \widehat{\mathbf{F}}(\xi ) = - 4 \pi^2 \sum_{j,k=1}^d \xi_j \xi_k \widehat{F}^{jk}(\xi ) . \] This section consists of three subsections. In Subsection \ref{subsec:sol-Sob}, we prove solvability results in Sobolev spaces for \eqref{frac-Stokes}. In Subsection \ref{subsec:sol-formula}, we derive a solution formula for the problem \eqref{frac-Stokes} that will be used in several places in the rest of the paper. Finally, very weak solutions of \eqref{frac-Stokes} are studied in Subsection \ref{subsec:very-weak}. \subsection{Solutions in Sobolev spaces}\label{subsec:sol-Sob} The problem \eqref{frac-Stokes} is first solved in the class $\mathscr{S}_0$ by decoupling the fractional Stokes system into two elliptic equations. \begin{lem}\label{lemma:frac-Stokes-S and S'} Let $\alpha$ be any real number. Then for each $\mathbf{F} \in \mathscr{S}_0$, there exists a unique solution $(\bm{u},{p_*}) \in \mathscr{S}_0 \times \mathscr{S}_0$ of \eqref{frac-Stokes}. \end{lem} \begin{proof} Suppose that $\mathbf{F} \in \mathscr{S}_0 $. Then since $\Div \mathbf{F} \in \mathscr{S}_0$ and $\Delta = - \Lambda^2 $ is an isomorphism from $\mathscr{S}_0$ onto itself, there exists a unique ${p_*} \in \mathscr{S}_0$ such that \begin{equation}\label{Lapl-equation} \Delta {p_*} =\Div \Div \mathbf{F} \quad\mbox{in}\,\, \mathbb{R}^d . \end{equation} Let $\mathbf{I}$ denote the identity matrix. Then since $\Lambda^{2\alpha}: \mathscr{S}_0 \rightarrow \mathscr{S}_0$ is an isomorphism, there exists a unique $\bm{u} \in \mathscr{S}_0$ such that \begin{equation}\label{frac-Stokes-u only} \Lambda^{2\alpha}\bm{u} = \Div (\mathbf{F} - {p_*} \mathbf{I} ) \quad\mbox{in}\,\, \mathbb{R}^d . \end{equation} Since $\Div ({p_*} \mathbf{I} ) =\nabla {p_*}$, we have $$ \Lambda^{2\alpha}\bm{u}+\nabla {p_*} = \Div\mathbf{F} \quad\mbox{in}\,\, \mathbb{R}^d. $$ Moreover, taking the divergence in (\ref{frac-Stokes-u only}), we have \[ \Lambda^{2\alpha} (\Div \bm{u} ) = \Div \Div \mathbf{F} -\Delta {p_*} =0 \quad\mbox{in}\,\, \mathbb{R}^d . \] Since $\Div \bm{u} \in \mathscr{S}_0$ and $\Lambda^{2\alpha}: \mathscr{S}_0 \rightarrow \mathscr{S}_0$ is an isomorphism, it follows that $\Div \bm{u} =0$ in $\mathbb{R}^d$. This proves existence of a solution in $ \mathscr{S}_0 \times \mathscr{S}_0$ of \eqref{frac-Stokes}. To prove the uniqueness assertion, let $(\bm{u},{p_*}) \in \mathscr{S}_0 \times \mathscr{S}_0$ be a solution of \eqref{frac-Stokes} with the trivial data $\mathbf{F}= {\mathbf 0}$. Then since $\Div \bm{u}=0$ in $\mathbb{R}^d$ and $\Lambda^{2\alpha}\Div =\Div \Lambda^{2\alpha}$ in $\mathscr{S}_0$, we take the divergence in (\ref{frac-Stokes}) to obtain \[ \Delta {p_*} = 0\quad\mbox{in}\,\, \mathbb{R}^d . \] Since $\Delta : \mathscr{S}_0 \rightarrow \mathscr{S}_0$ is an isomorphism, it follows that ${p_*} =0$ in $\mathbb R^d$. Then since $\Lambda^{2\alpha}\bm{u} = \mathbf{0}$ in $\mathbb{R}^d$, we conclude that $\bm{u} =\mathbf{0}$ in $\mathbb R^d$. This completes the proof of Lemma \ref{lemma:frac-Stokes-S and S'}. \end{proof} Using the decomposition of \eqref{frac-Stokes} into \eqref{Lapl-equation} and \eqref{frac-Stokes-u only}, we prove unique solvability of \eqref{frac-Stokes} in homogeneous Sobolev spaces of arbitrary orders. \begin{thm}\label{thm:fractional-Stokes0} Let $\alpha , s\in \mathbb{R}$. Then for each $\mathbf{F} \in \thSob{s}$, there exists a unique solution $(\bm{u},{p_*})$ in $\thSob{2\alpha+s-1}\times \thSob{s}$ of \eqref{frac-Stokes}. Moreover, we have \[ \@ifstar{\@normb}{\@normi}{\bm{u}}{\thSob{2\alpha+s-1}}+\@ifstar{\@normb}{\@normi}{{p_*}}{\thSob{s}}\apprle \@ifstar{\@normb}{\@normi}{\mathbf{F}}{\thSob{s}}. \] \end{thm} \begin{proof} Suppose that $\mathbf{F} \in \thSob{s}$. Then since $\Div \Div \mathbf{F} \in \thSob{s-2}$ and $\Delta$ is an isometric isomorphism from $\thSob{t+2}$ to $\thSob{t}$ for any $t \in \mathbb{R}$, there exists a unique solution ${p_*} \in \thSob{s}$ of \eqref{Lapl-equation}, which satisfies \[ \@ifstar{\@normb}{\@normi}{{p_*}}{\thSob{s}}\apprle \@ifstar{\@normb}{\@normi}{\mathbf{F}}{\thSob{s}}.\] Moreover, since $\Lambda^{2\alpha}$ is an isomorphism from $\thSob{2\alpha+s-1}$ to $\thSob{s-1}$, there exists a unique $\bm{u}\in \thSob{2\alpha+s-1}$ satisfying \eqref{frac-Stokes-u only}. Note also that \[ \@ifstar{\@normb}{\@normi}{\bm{u}}{\thSob{2\alpha+s-1}}\apprle \@ifstar{\@normb}{\@normi}{\mathbf{F}}{\thSob{s}}+\@ifstar{\@normb}{\@normi}{{p_*}}{\thSob{s}}\apprle \@ifstar{\@normb}{\@normi}{\mathbf{F}}{\thSob{s}}.\] Finally, since $\Div \bm{u} \in \thSob{2\alpha+s-2}$ and $ \Lambda^{2\alpha} (\Div \bm{u} )=0$ in $\thSob{s-2}$, it follows that $\Div \bm{u}=0$ in $\mathbb{R}^d$. This proves the existence assertion of the theorem. To show the uniqueness, suppose that $(\bm{u},{p_*})\in \thSob{2\alpha+s-1}\times \thSob{s}$ satisfies \eqref{frac-Stokes} with $\mathbf{F}=\mathbf{0}$. Since $\Div \bm{u}=0$ in $\mathbb{R}^d$ and $\Lambda^{2\alpha}\Div =\Div \Lambda^{2\alpha}$ in $\mathscr{S}_0'$, it follows from (\ref{frac-Stokes}) that $\Delta {p_*} =0$ in $\mathbb{R}^d$. Since $\Delta$ is an isomorphism, we then deduce that ${p_*}=0$ in $\mathbb{R}^d$. From \eqref{frac-Stokes} again, we have $\Lambda^{2\alpha}\bm{u}=\mathbf{0}$ in $\mathbb{R}^d$. Since $\Lambda^{2\alpha}$ is an isomorphism, we then conclude that $\bm{u}=\mathbf{0}$ in $\mathbb{R}^d$. This completes the proof of Theorem \ref{thm:fractional-Stokes0}. \end{proof} \begin{thm}\label{thm:fractional-Stokes} Let $\alpha $ be any real number. Then for each $\mathbf{F} \in \thSob{1-\alpha}$, there exists a unique solution $(\bm{u},{p_*})$ in $\thSob{\alpha}\times \thSob{1-\alpha}$ of \eqref{frac-Stokes}. Moreover, we have \[ \@ifstar{\@normb}{\@normi}{\bm{u}}{\thSob{\alpha}}+\@ifstar{\@normb}{\@normi}{{p_*}}{\thSob{1-\alpha}}\apprle \@ifstar{\@normb}{\@normi}{\mathbf{F}}{\thSob{1-\alpha}}. \] In addition, $\bm{u}$ satisfies the energy identity \begin{equation}\label{eq:divF-identity} \int_{\mathbb{R}^d} |\Lambda^{\alpha} \bm{u}|^2 \myd{x}= \action{ \Div \mathbf{F}, \bm{u}} . \end{equation} \end{thm} \begin{proof} By Theorem \ref{thm:fractional-Stokes0}, it remains to show that the solution $(\bm{u},{p_*})$ in $\thSob{\alpha}\times \thSob{1-\alpha}$ of \eqref{frac-Stokes} satisfies the energy identity \eqref{eq:divF-identity}. Note first that \[ \int_{\mathbb{R}^d} \Lambda^\alpha \bm{u} \cdot \Lambda^\alpha \Phi \myd{x}-\action{{p_*},\Div \Phi}=\action{\Lambda^{2\alpha}\bm{u}, \Phi}+\action{\nabla {p_*},\Phi}= \action{ \Div \mathbf{F}, \Phi} \] for all $\Phi \in \mathscr{S}_0$. By Lemma \ref{lem:density-approx-S0}, there exists a sequence $\{\bm{u}_k\}$ in $\mathscr{S}_0$ such that $\@ifstar{\@normb}{\@normi}{\bm{u}_k-\bm{u}}{\thSob{\alpha}}\rightarrow 0$. For each $k$, we have \[ \int_{\mathbb{R}^d} \Lambda^\alpha \bm{u} \cdot \Lambda^\alpha \bm{u}_k \myd{x}-\action{{p_*},\Div \bm{u}_k}= \action{ \Div \mathbf{F}, \bm{u}_k} . \] Hence by the duality inequality (\ref{dual-Hspace}), $\bm{u}$ satisfies \[ \int_{\mathbb{R}^d} |\Lambda^\alpha \bm{u}|^2 \myd{x}-\action{{p_*},\Div \bm{u}}= \action{ \Div \mathbf{F}, \bm{u}}. \] Since $\Div \bm{u}=0$, we get the energy identity \eqref{eq:divF-identity}. This completes the proof of Theorem \ref{thm:fractional-Stokes}. \end{proof} \subsection{A solution formula}\label{subsec:sol-formula} Given $\mathbf{F} = [F^{jk}]_{1 \le j, k \le d} \in \mathscr{S}_0$, let $(\bm{u} ,{p_*}) \in \mathscr{S}_0 \times \mathscr{S}_0$ be the solution of (\ref{frac-Stokes}). First, taking the Fourier transform in (\ref{Lapl-equation}), we have \[ -(2\pi |\xi|)^{2 } \widehat{{p_*}}(\xi ) = (2 \pi i \xi ) \otimes (2\pi i \xi ) : \widehat{\mathbf{F}}(\xi ) \quad\mbox{for all } \xi \in {\mathbb R}^d \] or equivalently \[ \widehat{{p_*}}(\xi ) = \frac{ \xi \otimes \xi}{ |\xi|^{2}} : \widehat{\mathbf{F}}(\xi ) \quad\mbox{for all } \xi \neq 0 . \] Next, taking the Fourier transform in (\ref{frac-Stokes-u only}), we have \begin{align*} (2\pi |\xi|)^{2 \alpha } \widehat{u}^j(\xi ) &= \sum_{l=1}^d (2 \pi i \xi_l ) \widehat{F}^{jl}(\xi) - (2 \pi i \xi_j ) \widehat{{p_*}}(\xi ) \\ &= \sum_{k,l=1}^d (2 \pi i \xi_l ) \left( \delta_{jk} - \frac{\xi_j \xi_k}{|\xi|^2} \right) \widehat{F}^{kl}(\xi) \end{align*} and so \[ \widehat{u}^j (\xi ) = \sum_{k,l=1}^d \frac{(2 \pi i \xi_l )}{(2\pi |\xi|)^{2 \alpha }} \left( \delta_{jk} - \frac{\xi_j \xi_k}{|\xi|^2} \right) \widehat{F}^{kl}(\xi) \] for $j =1 , \ldots , d$. Assuming that $ 2\alpha < d+1 $, let $U_{\alpha,j}^{kl} \in \mathscr{S}'$ be the inverse Fourier transform of the locally integrable function \[ \frac{(2 \pi i \xi_l )}{(2\pi |\xi|)^{2 \alpha }} \left( \delta_{jk} - \frac{\xi_j \xi_k}{|\xi|^2} \right) \] in $\mathscr{S}'$. The following lemma will be proved later in Appendix \ref{sec:Gaussian}. \begin{lem}\label{prop:Fourier-transform-Gaussian-derivatives} Suppose that $j, k, l \in \{1 , ..., d \}$, $\lambda \in \mathbb C$, and $\psi \in \mathscr{S}$. Let $\Gamma$ be the Gamma function. \begin{enumerate}[label=\textnormal{(\arabic*)}] \item If $1<\Re \lambda<d+1$, then \[ \int_{\mathbb{R}^d} \frac{-2 \pi i \xi_j}{|\xi|^{\lambda}} {\psi}^{\vee}(\xi) \, d\xi =\frac{2\Gamma((d+2-\lambda)/2) }{ \Gamma( \lambda/2)\pi^{d/2- \lambda } } \int_{\mathbb{R}^d} \frac{x_j}{|x|^{d+2-\lambda }} \psi(x) \, dx. \] \item If $2<\Re \lambda<d+2$, then \begin{align*} & \int_{\mathbb{R}^d} \frac{(-2 \pi i \xi_j )(-2 \pi i \xi_k )}{|\xi|^\lambda} {\psi}^{\vee}(\xi) \, d\xi \\ &\quad = \frac{2\Gamma((d+2-\lambda)/2) }{ \Gamma( \lambda/2) \pi^{d/2-\lambda}} \int_{\mathbb{R}^d} \frac{(d+2-\lambda )x_j x_k -\delta_{jk} |x|^2}{|x|^{d+4-\lambda }} {\psi}(x) \, dx . \end{align*} \item If $3<\Re \lambda<d+3$, then \begin{align*} & \int_{\mathbb{R}^d} \frac{(-2\pi i \xi_j)(-2\pi i \xi_k)(-2\pi i \xi_l)}{|\xi|^\lambda} {\psi}^{\vee}(\xi) \, d\xi \\ & \quad = \frac{4\Gamma((d+4-\lambda)/2) }{ \Gamma( \lambda/2) \pi^{d/2-\lambda}} \int_{\mathbb{R}^d} \left[- D_l \left( \frac{ x_j x_k}{|x|^{d+4-\lambda }} \right) - \frac{\delta_{jk} x_l }{|x|^{d+4-\lambda }} \right] {\psi}(x)\myd{x} . \end{align*} \end{enumerate} \end{lem} Assume that $1< 2\alpha < d+1 $. Then using Lemma \ref{prop:Fourier-transform-Gaussian-derivatives}, we can find $U_{\alpha,j}^{kl}$ explicitly. First of all, it follows from Lemma \ref{prop:Fourier-transform-Gaussian-derivatives} (1) that the inverse Fourier transform of $(2 \pi i \xi_l )(2\pi |\xi|)^{-2 \alpha }$ is \[ - \frac{2 \Gamma(1+d/2-\alpha) }{2^{2 \alpha} \pi^{d/2} \Gamma( \alpha) } \frac{x_l}{|x|^{d+2-2\alpha}} . \] Next, by Lemma \ref{prop:Fourier-transform-Gaussian-derivatives} (3) with $\lambda =2\alpha +2$, we have \begin{align*} & \int_{\mathbb{R}^d} \frac{2\pi i \xi_j \xi_k \xi_l }{|\xi|^{2\alpha+2} } {\psi}^{\vee}(\xi) \, d\xi \\ & \quad = \frac{ \Gamma(1+d/2 -\alpha) }{ \Gamma(1+\alpha) \pi^{d/2-2\alpha}} \int_{\mathbb{R}^d} \left[- D_l \left( \frac{ x_j x_k}{|x|^{d+2-2\alpha }} \right) - \frac{\delta_{jk} x_l }{|x|^{d+2-2\alpha }} \right] {\psi}(x)\myd{x} \end{align*} for all $\psi \in \mathscr{S}$. Hence the inverse Fourier transform of $(2 \pi i \xi_l \xi_j \xi_k )(2\pi |\xi|)^{-2 \alpha }|\xi|^{-2}$ is \[ \frac{ \Gamma(1+d/2-\alpha) }{2^{2 \alpha} \pi^{d/2} \Gamma (1+ \alpha)} \left[ - D_l \left( \frac{ x_j x_k}{|x|^{d+2-2\alpha }} \right) - \frac{\delta_{jk} x_l }{|x|^{d+2-2\alpha }} \right]. \] Therefore, \begin{equation}\label{eq:Stokes-Green} U_{\alpha,j}^{kl}(x) = \frac{ \Gamma(1+d/2-\alpha) }{2^{2 \alpha} \pi^{d/2}\Gamma(1+ \alpha) }\left[ D_l \left( \frac{ x_j x_k}{|x|^{d+2-2\alpha }} \right) - \frac{\delta_{jk}( 2\alpha -1 ) x_l }{|x|^{d+2-2\alpha }} \right] . \end{equation} Note that $$ U_{\alpha ,j}^{kl} \in \Lor{d/(d+1-2\alpha)}{\infty} . $$ Now, setting $\mathbf{U}_{\alpha} = [U_{\alpha, j}^{kl}]_{1 \le j,k,l \le d}$, we have \[ \bm{u} = \mathbf{U}_{\alpha} * \mathbf{F} \] or componentwise \[ u^j = \sum_{k,l=1}^d U_{\alpha , j}^{kl} * F^{kl} \quad (j=1,\ldots , d) . \] \subsection{Very weak solutions}\label{subsec:very-weak} The notion of very weak solutions is introduced to solve the fractional Stokes system \eqref{frac-Stokes} for $\mathbf{F} \in \Leb{1}$. Recall that if $s \ge 0$, then $\Lambda^s$ is bounded from $\mathscr{S}$ to $\Leb{1}\cap \Leb{\infty}$. \begin{defn} Let $\alpha \ge 0$. Suppose that $\mathbf{F}$ is a distribution. Then we say that $\bm{u} \in \Leb{1}+\Leb{\infty}$ is a \emph{very weak solution} of \eqref{frac-Stokes} if \begin{equation}\label{eq:very-weaksol} \int_{\mathbb{R}^d} \bm{u} \cdot \left( \Lambda^{2\alpha} \Phi +\nabla \psi \right) dx =- \action{ \mathbf{F} ,\nabla \Phi} \end{equation} for all $\Phi \in C_{c,\sigma}^\infty$ and $\psi\in C_c^\infty$. \end{defn} Indeed, taking $\Phi=0$ in (\ref{eq:very-weaksol}), we deduce that if $\bm{u}$ is a very weak solution of \eqref{frac-Stokes}, then it is divergence-free: \[ \int_{\mathbb{R}^d} \bm{u} \cdot \nabla \psi \myd{x}=0 \quad\mbox{for all}\,\, \psi\in C_c^\infty . \] Existence of a pressure associated with a very weak solution of \eqref{frac-Stokes} is an easy consequence of the following more or less standard result, which will be proved later in Appendix \ref{sec:deRham}. \begin{lem}\label{lem:de-Rham} If $\bm{u} \in \mathscr{S}'$ satisfies $\action{\bm{u},\Phi}=0$ for all $\Phi \in C_{c,\sigma}^\infty$, then there exists $p \in \mathscr{S}'$ such that $\bm{u}=\nabla p$. \end{lem} \begin{lem}\label{lem:existence of p} Let $\alpha \geq 0$. If $\bm{u}$ is a very weak solution of \eqref{frac-Stokes} with $\mathbf{F} \in \mathscr{S}'$, then there exists ${p_*}\in \mathscr{S}'$ such that \[ \int_{\mathbb{R}^d} \bm{u} \cdot \left( \Lambda^{2\alpha} \Phi +\nabla \psi \right) dx -\action{{p_*},\Div \Phi}=- \action{ \mathbf{F} ,\nabla \Phi} \] for all $( \Phi , \psi ) \in \mathscr{S}$. \end{lem} \begin{proof} Since $C_c^\infty$ is dense in $\mathscr{S}$, we easily have \[ \int_{\mathbb{R}^d} \bm{u} \cdot \nabla \psi \myd{x}=0 \quad\mbox{for all}\,\, \psi \in \mathscr{S}. \] Note that $\Lambda^{2\alpha}\bm{u} -\Div \mathbf{F} \in \mathscr{S}'$. Moreover, for all $\Phi \in C_{c,\sigma}^\infty$, we have $$ \action{\Lambda^{2\alpha}\bm{u} -\Div \mathbf{F},\Phi}=\int_{\mathbb{R}^d} \bm{u} \cdot \Lambda^{2\alpha} \Phi \myd{x} + \action{ \mathbf{F} ,\nabla \Phi} = 0 . $$ Hence by Lemma \ref{lem:de-Rham}, there exists ${p_*}\in \mathscr{S}'$ such that $$ \int_{\mathbb{R}^d} \bm{u} \cdot \Lambda^{2\alpha} \Phi \myd{x} + \action{ \mathbf{F} ,\nabla \Phi} = \action{\Lambda^{2\alpha}\bm{u} -\Div \mathbf{F} ,\Phi}= \action{{p_*},\Div \Phi} $$ for all $\Phi \in \mathscr{S}$. This completes the proof of Lemma \ref{lem:existence of p}. \end{proof} We are now able to prove uniqueness of very weak solutions of \eqref{eq:very-weaksol}. \begin{lem}\label{lem:Liouville-type-theorem} Let $\alpha \geq 0$. If $\bm{u}\in \Leb{1}+\Leb{\infty}$ is a very weak solution of \eqref{frac-Stokes} with $\mathbf{F}=\mathbf{0}$, then $\bm{u}$ is constant. In addition, if $\bm{u} \in \Lor{q}{\infty}$ for some $1<q<\infty$, then $\bm{u}$ is identically zero. \end{lem} \begin{proof} By Lemma \ref{lem:existence of p}, there exists ${p_*}\in \mathscr{S}'$ such that $$ \int_{\mathbb{R}^d} \bm{u} \cdot \Lambda^{2\alpha} \Phi \myd{x}-\action{{p_*},\Div \Phi} =0 \quad\mbox{and}\quad \int_{\mathbb{R}^d} \bm{u} \cdot \nabla \psi \myd{x}=0 $$ for all $( \Phi , \psi ) \in \mathscr{S}$. Let $\psi\in \mathscr{S}_0$ be given. Then since $\nabla \psi \in \mathscr{S}_0$, $\Lambda^{2\alpha}\psi \in \mathscr{S}_0$, and $\Lambda^{2\alpha}\nabla \psi = \nabla \Lambda^{2\alpha}\psi$, we have \[ \action{{p_*} ,\Delta \psi}= \int_{\mathbb{R}^d} \bm{u} \cdot \Lambda^{2\alpha} \nabla \psi \myd{x}= \int_{\mathbb{R}^d} \bm{u} \cdot \nabla (\Lambda^{2\alpha}\psi) \myd{x}=0.\] Since $\Delta = -\Lambda^2 : \mathscr{S}_0 \rightarrow \mathscr{S}_0$ is an isomorphism, it follows from Lemma \ref{lem:polynomial-isomorphism} that ${p_*}$ is a polynomial. Hence, for all $\Phi \in \mathscr{S}_0$, we have \[ \int_{\mathbb{R}^d} \bm{u} \cdot \Lambda^{2\alpha} \Phi \myd{x}= \action{{p_*},\Div \Phi}=0 .\] Therefore, by Lemma \ref{lem:polynomial-isomorphism} again, $\bm{u}$ is a polynomial. It is easy to check that polynomials in $\Leb{1}+\Leb{\infty}$ are constant and the only constant function belonging to $\Lor{q}{\infty}$ is the zero function. This completes the proof of Lemma \ref{lem:Liouville-type-theorem}. \end{proof} The following theorem shows existence and uniqueness of very weak solutions in $\Leb{q}$ of \eqref{frac-Stokes} when $\mathbf{F} \in \Leb{p}$, where $1<p<d/(2\alpha-1)$ and $1/q=1/p-(2\alpha-1)/d$. \begin{thm}\label{theorem:Frational Stokes-Lpdata} Let $1/2<\alpha<(d+1)/2$, $1< p<d/(2\alpha-1)$, and $1/q=1/p-(2\alpha-1)/d$. Then for each $\mathbf{F}\in \Leb{p}$, there exists a unique very weak solution $\bm{u}$ in $\Leb{q}$ of \eqref{frac-Stokes}. Moreover, the solution $\bm{u}$ is given by $\bm{u}=\mathbf{U}_\alpha * \mathbf{F}$ and satisfies $$ \@ifstar{\@normb}{\@normi}{\bm{u} }{\NLeb{q}}\apprle \@ifstar{\@normb}{\@normi}{\mathbf{F}}{\NLeb{p}}. $$ In addition, if $\mathbf{F}\in \thSob{1-\alpha}$, then $\bm{u} $ belongs to $ \thSob{\alpha}$ and satisfies the energy identity \eqref{eq:divF-identity}. \end{thm} \begin{proof} Define $\bm{u}=\mathbf{U}_\alpha * \mathbf{F}$. Then since $\mathbf{U}_\alpha \in \Lor{d/(d+1-2\alpha)}{\infty}$, it follows from Lemma \ref{lem:Young} that $\bm{u} \in \Leb{q}$ and $\@ifstar{\@normb}{\@normi}{\bm{u} }{\NLeb{q}}\apprle \@ifstar{\@normb}{\@normi}{\mathbf{F}}{\NLeb{p}}$. We now show that $\bm{u}$ is a very weak solution of \eqref{frac-Stokes}. To show this, choose a sequence $\{\mathbf{F}_l\}$ in $\mathscr{S}_0$ such that $\mathbf{F}_l \rightarrow \mathbf{F}$ in $\Leb{p}$. By Lemma \ref{lemma:frac-Stokes-S and S'}, there exists a unique solution $( \bm{u}_l , p_{*, l} ) \in \mathscr{S}_0 \times \mathscr{S}_0$ of \eqref{frac-Stokes} with $\mathbf{F} = \mathbf{F}_l$. Moreover, it was shown in Subsection 3.2 that \[ \bm{u}_l=\mathbf{U}_\alpha *\mathbf{F}_l.\] For all $(\Phi , \psi ) \in \mathscr{S}_0$, we have \[ \int_{\mathbb{R}^d} \bm{u}_l \cdot \Lambda^{2\alpha} \Phi \myd{x} =\int_{\mathbb{R}^d} (\Lambda^{2\alpha} \bm{u}_l)\cdot \Phi \myd{x}=-\int_{\mathbb{R}^d} (\mathbf{F}_l : \nabla \Phi + \nabla p_{*,l} \cdot \Phi) \myd{x} \] and \[ \int_{\mathbb{R}^d} \bm{u}_l \cdot \nabla \psi \myd{x} =0 . \] Since $\bm{u}_l, {p_*}_l, \mathbf{F}_l\in \mathscr{S}_0$, it follows from Lemma \ref{lem:density-approx-S0} that \begin{align*} \int_{\mathbb{R}^d} \bm{u}_l \cdot \left( \Lambda^{2\alpha} \Phi + \nabla \psi \right) dx &=-\int_{\mathbb{R}^d} (\mathbf{F}_l : \nabla \Phi + \nabla p_{*,l} \cdot \Phi ) \myd{x} \\ \intertext{for any $(\Phi ,\psi ) \in \mathscr{S}$. Hence for all $\Phi \in C_{c,\sigma}^\infty$ and $\psi \in C_c^\infty$, we get} \int_{\mathbb{R}^d} \bm{u}_l \cdot \left(\Lambda^{2\alpha} \Phi +\nabla \psi\right) dx &=-\int_{\mathbb{R}^d} \mathbf{F}_l :\nabla \Phi \myd{x}. \end{align*} Since $\mathbf{F}_l\rightarrow \mathbf{F}$ in $\Leb{p}$, it follows from Lemma \ref{lem:Young} that $\bm{u}_l\rightarrow \bm{u}$ in $\Leb{q}$. Therefore, for all $\Phi \in C_{c,\sigma}^\infty$ and $\psi \in C_c^\infty$, we have \[ \int_{\mathbb{R}^d} \bm{u} \cdot \left( \Lambda^{2\alpha} \Phi +\nabla \psi \right) dx=-\int_{\mathbb{R}^d} \mathbf{F} :\nabla \Phi \myd{x}. \] Hence $\bm{u}$ is a very weak solution of \eqref{frac-Stokes}, which is unique due to Lemma \ref{lem:Liouville-type-theorem}. To complete the proof, suppose in addition that $\mathbf{F}\in \thSob{1-\alpha}$. Then by Lemma \ref{lem:density-approx-S0}, there is a sequence $\{\mathbf{G}_l\}$ in $\mathscr{S}_0$ such that $\mathbf{G}_l \rightarrow \mathbf{F}$ in both $\Leb{p}$ and $\thSob{1-\alpha}$. By Lemma \ref{lemma:frac-Stokes-S and S'}, there exists a unique solution $( \bm{v}_l , \tilde{p}_{*, l} ) \in \mathscr{S}_0 \times \mathscr{S}_0$ of \eqref{frac-Stokes} with $\mathbf{F} = \mathbf{G}_l$. Moreover, by Theorem \ref{thm:fractional-Stokes}, $\{ \bm{v}_l \}$ converges in $\thSob{\alpha}$ to some $\bm{v} \in \thSob{\alpha}$ satisfying \[ \int_{\mathbb{R}^d} |\Lambda^{\alpha} \bm{v}|^2 \myd{x}= \action{ \Div \mathbf{F}, \bm{v}} . \] On the other hand, it was already shown that $\bm{v}_l =\mathbf{U}_\alpha *\mathbf{G}_l$ and $\bm{v}_l \to \bm{u}$ in $\Leb{q}$. Hence, for all $\Phi \in \mathscr{S}$, we have \begin{align*} \int_{\mathbb{R}^d}\bm{u} \cdot \Lambda^{\alpha} \Phi \,dx & = \lim_{l\to\infty} \int_{\mathbb{R}^d}\bm{v}_l \cdot \Lambda^{\alpha} \Phi \,dx \\ &= \lim_{l\to\infty} \int_{\mathbb{R}^d}\Lambda^{\alpha} \bm{v}_l \cdot \Phi \,dx = \int_{\mathbb{R}^d}\Lambda^{\alpha} \bm{v} \cdot \Phi \,dx , \end{align*} which implies that $\Lambda^{\alpha} \bm{u} = \Lambda^{\alpha} \bm{v}$ in $\mathscr{S}'$. Since $\Lambda^\alpha : \mathscr{S}_0 \rightarrow \mathscr{S}_0$ is an isomorphism, we also have \[ \int_{\mathbb{R}^d} \bm{u} \cdot \Phi \, dx = \int_{\mathbb{R}^d} \bm{v} \cdot \Phi \, dx \quad\mbox{for all}\,\, \Phi \in \mathscr{S}_0 . \] Therefore, \[ \action{ {\rm div}\, \mathbf{F} , \bm{u} } = \lim_{l\to\infty} \int_{\mathbb{R}^d} \bm{u} \cdot {\rm div}\, \mathbf{G}_l \, dx = \lim_{l\to\infty} \int_{\mathbb{R}^d} \bm{v} \cdot {\rm div}\, \mathbf{G}_l \, dx = \action{ {\rm div}\, \mathbf{F} , \bm{v} }. \] This shows that $\bm{u}$ satisfies the energy identity \eqref{eq:divF-identity}. The proof of Theorem \ref{theorem:Frational Stokes-Lpdata} is completed. \end{proof} The following theorem shows existence and uniqueness of very weak solutions in $\Lor{d/(d+1-2\alpha)}{\infty}$ of \eqref{frac-Stokes} when $\mathbf{F} \in \Leb{1}$. \begin{thm}\label{theorem:Frational Stokes-Lpdata-intersection} Let $1/2<\alpha<(d+1)/2$. Then for each $\mathbf{F}\in \Leb{1} $, there exists a unique very weak solution $\bm{u} $ of \eqref{frac-Stokes} in $\Lor{d/(d+1-2\alpha)}{\infty}$. Moreover, the solution $\bm{u}$ is given by $\bm{u}=\mathbf{U}_\alpha * \mathbf{F}$ and satisfies $$ \@ifstar{\@normb}{\@normi}{ \bm{u}}{\NLor{d/(d+1-2\alpha)}{\infty}}\apprle \@ifstar{\@normb}{\@normi}{{\mathbf{F}}}{\NLeb{1}}. $$ \end{thm} \begin{proof} Given $\mathbf{F}\in \Leb{1} $, we define $\bm{u}=\mathbf{U}_\alpha * \mathbf{F}$. Then it follows from Lemma \ref{lem:Young} that $\bm{u} \in \Lor{d/(d+1-2\alpha)}{\infty}$ and $\@ifstar{\@normb}{\@normi}{ \bm{u}}{\NLor{d/(d+1-2\alpha)}{\infty}}\apprle \@ifstar{\@normb}{\@normi}{{\mathbf{F}}}{\NLeb{1}}$. Hence by Lemma \ref{lem:Liouville-type-theorem}, it remains to show that $\bm{u}$ is a very weak solution of \eqref{frac-Stokes}. Fixing any $r$ with $1<r<d/(2\alpha-1)$, we choose a sequence $\{\mathbf{G}_l\}$ in $\Leb{1}\cap \Leb{r}$ such that $\mathbf{G}_l\rightarrow \mathbf{F}$ in $\Leb{1}$. Then by Theorem \ref{theorem:Frational Stokes-Lpdata}, $\bm{v}_l = \mathbf{U}_\alpha * \mathbf{G}_l$ satisfies \[ \int_{\mathbb{R}^d} \bm{v}_l \cdot ( \Lambda^{2\alpha} \Phi + \nabla \psi ) \myd{x}=-\int_{\mathbb{R}^d} \mathbf{G}_l :\nabla \Phi \myd{x} \] for all $\Phi \in C_{c,\sigma}^\infty$ and $\psi \in C_c^\infty$. By Lemma \ref{lem:Young} again, $\bm{v}_l \rightarrow \bm{u}$ in $\Lor{d/(d+1-2\alpha)}{\infty}$. Hence for all $\Phi \in C_{c,\sigma}^\infty$ and $\psi \in C_c^\infty$, we obtain \[ \int_{\mathbb{R}^d} \bm{u} \cdot ( \Lambda^{2\alpha} \Phi +\nabla \psi ) \myd{x}=-\int_{\mathbb{R}^d} \mathbf{F}:\nabla \Phi \myd{x}. \] This completes the proof of Theorem \ref{theorem:Frational Stokes-Lpdata-intersection}. \end{proof} \section{Perturbed fractional heat equations}\label{sec:perturbed-heat} For $0<T<\infty$, we consider the following initial value problem for perturbed fractional heat equations in $\mathbb{R}^d , d \ge 2$: \begin{equation}\label{eq:PFHE} \left\{ \begin{alignedat}{2} \partial_t\bm{b} +\Lambda^{2\beta}\bm{b}+\Div\hspace{0.1em}(\bm{u}\otimes \bm{b}) &=\Div\mathbf{F} &&\quad \text{in } \mathbb{R}^d\times (0,T), \\ \bm{b}(\cdot,0) &=\bm{b}_0 &&\quad \text{on } \mathbb{R}^d , \end{alignedat} \right. \end{equation} where $\beta$ is a positive number and $\bm{u}:\mathbb{R}^d\times (0,T)\rightarrow \mathbb{R}^d$ is a given vector field with $\Div\bm{u}=0$. By a \emph{weak solution} of \eqref{eq:PFHE}, we mean a vector field $\bm{b}\in \Leb{\infty}(0,T;\Leb{2})\cap \Leb{2}(0,T;\tSob{\beta})$ satisfying \begin{align*} \int_0^T \int_{\mathbb{R}^d} \bm{b} \cdot(-\partial_t \Phi + \Lambda^{2\beta}\Phi) \myd{x}dt\, & -\int_0^T\int_{\mathbb{R}^d} (\bm{u}\otimes \bm{b}):\nabla \Phi \myd{x}dt \\ = & -\int_0^T\int_{\mathbb{R}^d} \mathbf{F}:\nabla \Phi \myd{x}dt+ \int_{\mathbb{R}^d} \bm{b}_0 \cdot \Phi( 0) \,dx \end{align*} for all $\Phi \in C_c^\infty (\mathbb{R}^d\times [0,T))$, provided that the integrals are all well-defined. Note that if $\beta \geq 1$, then by Proposition \ref{prop:Gagliardo}, \begin{equation}\label{eq:our-interpolation} \@ifstar{\@normb}{\@normi}{\nabla\bm{b}}{\NLeb{2}} \apprle \@ifstar{\@normb}{\@normi}{\bm{b}}{\NLeb{2}}^{1-1/\beta}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \bm{b}}{\NLeb{2}}^{1/\beta}. \end{equation} Hence if $\beta\geq 1$, then every weak solution of \eqref{eq:PFHE} belongs to $\Leb{2\beta}(0,T;\thSob{1})$. This section consists of two parts. We first show that if $\mathbf{F} \in \Leb{2\beta/(2\beta -1)}(0,T;\Leb{2})$, $\beta\geq 1$, and $\bm{b}_0 \in \Leb{2}$, then there exists a unique weak solution of \eqref{eq:PFHE} with $\bm{u}=0$ satisfying the energy identity. Next, extending this result to nonzero $\bm{u}$, we prove that if $\beta \ge 1$ and $\bm{u} \in \Leb{\infty}(0,T;\Lor{d/(d+1-2\alpha)}{\infty})\cap \Leb{2}(0,T;\thSob{\alpha})$, then for every $\mathbf{F} \in \Leb{2\beta/(2\beta -1)}(0,T;\Leb{2})$ and $\bm{b}_0 \in \Leb{2}$, there exists a unique weak solution $\bm{b}$ of \eqref{eq:PFHE}. Moreover, the solution $\bm{b}$ satisfies the energy identity, which will be used to prove uniqueness of weak solutions of the original nonlinear problem \eqref{eq:MHD-relaxed}. To prove existence and uniqueness of weak solutions of \eqref{eq:PFHE} when $\bm{u}=0$, we introduce the Fourier truncation operators $\mathcal{S}_R$ ($R>0$) defined by \[ \widehat{\mathcal{S}_R f}(\xi) = \chi_{B_R}(\xi)\hat{f}(\xi) \quad (f \in L_2 ),\] where $\chi_{B_R}$ is the characteristic function of $B_R$. The following properties of $\mathcal{S}_R$ are quite elementary. \begin{lem}\label{lem:truncation-operator} Let $0 \le s < t$. \begin{enumerate}[label=\textnormal{(\arabic*)}] \item If $f\in \Leb{2}$, then $\mathcal{S}_R f \in H^s$ and $\@ifstar{\@normb}{\@normi}{\mathcal{S}_R f}{\tSob{s}} \apprle (1+R)^{s} \@ifstar{\@normb}{\@normi}{f}{\NLeb{2}}$. \item If $f\in \tSob{s}$, then $\mathcal{S}_R f\rightarrow f$ in $\tSob{s}$ as $R\rightarrow \infty$ \item If $f\in H^t$, then $\@ifstar{\@normb}{\@normi}{\mathcal{S}_R f -f}{\tSob{s}}\apprle (1+R)^{-(t-s )} \@ifstar{\@normb}{\@normi}{f}{\tSob{t}}$. \end{enumerate} \end{lem} For $R>0$, we denote by $V_{R}$ the space of all vector fields $\bm{b} \in \Leb{2}$ such that $\supp \hat{\bm{b}}\subset \overline{B_R}$. Note that $V_{R}$ is a closed subspace of $\Leb{2}$. Moreover, since $\mathcal{S}_R\bm{b}=\bm{b}$ for any $\bm{b} \in V_{R}$, it follows from Lemma \ref{lem:truncation-operator} that $V_{R}$ is continuously embedded into $\tSob{s}$ for any $s\geq 0$. \begin{lem}\label{lem:linear-heat} Suppose that $\beta\geq 1$ and $\gamma=2\beta/(2\beta-1)$. Then for every $\mathbf{F}\in \Leb{\gamma}(0,T;\Leb{2})$ and $\bm{b}_0 \in \Leb{2}$, there exists a unique weak solution $\bm{b}$ of \eqref{eq:PFHE} with $\bm{u}=0$. Moreover, $\bm{b}$ belongs to $C([0,T];\Leb{2})$ and satisfies the energy identity: \[ \@ifstar{\@normb}{\@normi}{\bm{b}(t)}{\NLeb{2}}^2+2\int_0^t\@ifstar{\@normb}{\@normi}{\Lambda^\beta \bm{b}(s)}{\NLeb{2}}^2 \, ds=-2\int_0^t \int_{\mathbb{R}^d} \mathbf{F} : \nabla \bm{b} \myd{x}ds + \@ifstar{\@normb}{\@normi}{\bm{b}_0}{2}^2 \] for $0\leq t\leq T$. \end{lem} \begin{proof} Choose a sequence $\{\mathbf{F}_k\}$ in $C ([0,T];\Leb{2})$ such that $\mathbf{F}_k \rightarrow \mathbf{F}$ in $\Leb{\gamma}(0,T;\Leb{2})$ and $\@ifstar{\@normb}{\@normi}{\mathbf{F}_k(t)}{\NLeb{2}}\leq \@ifstar{\@normb}{\@normi}{\mathbf{F}(t)}{\NLeb{2}}$ for all $t$ and $k$. For each $k\in \mathbb{N}$, we consider the following truncated problem for $\bm{b}_k \in C^1([0,T);V_k )$: \begin{equation}\label{eq:PFHE-truncated} \left\{ \begin{alignedat}{2} \partial_t \bm{b}_{k} +\Lambda^{2\beta}\bm{b}_{k} &=\Div \mathcal{S}_k\mathbf{F}_k &&\quad \text{in } \mathbb{R}^d\times (0,T) \\ \bm{b}_{k}(\cdot,0) &= \mathcal{S}_k \bm{b}_0 &&\quad \text{on } \mathbb{R}^d . \end{alignedat} \right. \end{equation} Since $\Lambda^{2\beta}:V_k \rightarrow V_k$ is a bounded linear operator, it follows from a standard theory of linear differential equations (see e.g. Cartan \cite[Theorem 1.9.1]{C71}) in Banach spaces that the problem \eqref{eq:PFHE-truncated} has a unique solution $\bm{b}_{k} \in C^1([0,T];V_k )$. Given $k,m\in \mathbb{N}$, write $\tilde{\bm{b}}=\bm{b}_k-\bm{b}_m$, $\tilde{\mathbf{F}}=\mathcal{S}_k \mathbf{F}_k -\mathcal{S}_m \mathbf{F}_m$, and $\tilde{\bm{b}}_0= \mathcal{S}_k \bm{b}_0- \mathcal{S}_m \bm{b}_0$. Then $\tilde{\bm{b}}$ satisfies \begin{equation}\label{eq:PFHE-truncated-diff} \left\{ \begin{alignedat}{2} \partial_t \tilde{\bm{b}} +\Lambda^{2\beta}\tilde{\bm{b}} &=\Div \tilde{\mathbf{F}} &&\quad \text{in } \mathbb{R}^d\times (0,T) \\ \tilde{\bm{b}}(\cdot,0) &=\tilde{\bm{b}}_0 &&\quad \text{on } \mathbb{R}^d . \end{alignedat} \right. \end{equation} Multiplying \eqref{eq:PFHE-truncated-diff} by $\tilde{\bm{b}}$ and then integrating over $\mathbb{R}^d\times [0,t]$, we have \ \frac{1}{2}\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}(t)}{\NLeb{2}}^2 +\int_0^t \@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}(s)}{\NLeb{2}}^2 \, \myd{s} =-\int_0^t\int_{\mathbb{R}^d} \tilde{\mathbf{F}} : \nabla \tilde{\bm{b}} \,\myd{x}ds + \frac{1}{2}\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}_0}{\NLeb{2}}^2 \ for all $0\leq t\leq T$. By Lemma \ref{lem:truncation-operator}, \eqref{eq:our-interpolation}, and Young's inequality, we have \begin{align*} - \int_{\mathbb{R}^d} \tilde{\mathbf{F}} : \nabla \tilde{\bm{b}}\myd{x} &\leq C\@ifstar{\@normb}{\@normi}{\tilde{\mathbf{F}}}{\NLeb{2}} \@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}}^{1-1/\beta}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}}{\NLeb{2}}^{1/\beta}\\ &\leq C\@ifstar{\@normb}{\@normi}{\tilde{\mathbf{F}}}{\NLeb{2}}^{\gamma} \@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}}^{2(\beta-1)/(2\beta-1)}+\frac{1}{2}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}}{\NLeb{2}}^2 . \end{align*} Since $0\leq {(\beta-1)}/{(2\beta-1)}<1$, it follows that \begin{align*} \@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}(t)}{\NLeb{2}}^2+\int_0^t \@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}(s)}{\NLeb{2}}^2\myd{s}&\leq \@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}_0}{\NLeb{2}}^2+ C \int_0^t \@ifstar{\@normb}{\@normi}{\tilde{\mathbf{F}}(s)}{\NLeb{2}}^\gamma \@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}(s)}{\NLeb{2}}^{2(\beta-1)/(2\beta-1)}\myd{s}\\ &\leq \@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}_0}{\NLeb{2}}^2 + C \int_0^t \@ifstar{\@normb}{\@normi}{\tilde{\mathbf{F}}(s)}{\NLeb{2}}^\gamma \left(1+\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}(s)}{\NLeb{2}}^{2}\right) ds \end{align*} for all $0\leq t\leq T$. Hence by Gronwall's inequality, we get \begin{align*} \sup_{0\leq t\leq T}\@ifstar{\@normb}{\@normi}{\bm{b}_k(t)-\bm{b}_m(t)}{\NLeb{2}}^2 &+\int_0^T \@ifstar{\@normb}{\@normi}{\Lambda^\beta (\bm{b}_k-\bm{b}_m)(t)}{\NLeb{2}}^2 \myd{t} \\ & \leq \left(\|\mathcal{S}_k \bm{b}_0- \mathcal{S}_m \bm{b}_0 \|_2^2 + C\int_0^T \@ifstar{\@normb}{\@normi}{\mathcal{S}_k \mathbf{F}_k(t) -\mathcal{S}_m\mathbf{F}_m(t)}{\NLeb{2}}^\gamma \myd{t}\right) \\ & \quad \times \exp\left(C\int_0^T \@ifstar{\@normb}{\@normi}{\mathcal{S}_k \mathbf{F}_k(t) -\mathcal{S}_m\mathbf{F}_m(t)}{\NLeb{2}}^\gamma \myd{t}\right) \end{align*} for some constant $C$ depending only on $d$, $\beta$, and $T$. By the dominated convergence theorem, we easily show that $\mathcal{S}_k \mathbf{F}_k\rightarrow \mathbf{F}$ in $\Leb{\gamma}(0,T;\Leb{2})$. Therefore, the sequence $\{\bm{b}_k\}$ converges in $C([0,T];\Leb{2})\cap \Leb{2}(0,T;\tSob{\beta})$ to a function $\bm{b}$. It is easy to check that $\bm{b}$ is a weak solution of \eqref{eq:PFHE} with $\bm{u}=0$. To show that $\bm{b}$ satisfies the energy identity, we multiply \eqref{eq:PFHE-truncated} by $\bm{b}_k$ to obtain \begin{equation}\label{eq:approximation-B} \frac{1}{2}\@ifstar{\@normb}{\@normi}{{\bm{b}}_k(t)}{\NLeb{2}}^2 +\int_0^t \@ifstar{\@normb}{\@normi}{\Lambda^\beta {\bm{b}}_k(s)}{\NLeb{2}}^2 \, \myd{s} =-\int_0^t\int_{\mathbb{R}^d} \mathcal{S}_k\mathbf{F}_k : \nabla {\bm{b}}_k \myd{x}ds + \frac{1}{2}\@ifstar{\@normb}{\@normi}{\mathcal{S}_k\bm{b}_0}{\NLeb{2}}^2 . \end{equation} By the interpolation inequality \eqref{eq:our-interpolation}, we get \begin{align*} \int_0^T \@ifstar{\@normb}{\@normi}{\nabla (\bm{b}_k-\bm{b})}{\NLeb{2}}^{2\beta}\myd{t}\leq C\int_0^T \@ifstar{\@normb}{\@normi}{\bm{b}_k-\bm{b}}{\NLeb{2}}^{2(\beta-1)}\@ifstar{\@normb}{\@normi}{\Lambda^\beta (\bm{b}_k-\bm{b})}{\NLeb{2}}^2 \myd{t}\rightarrow 0. \end{align*} Hence the energy identity follows from \eqref{eq:approximation-B} by letting $k\rightarrow \infty$. Finally, to show the uniqueness, let $\bm{b}$ be a weak solution of \eqref{eq:PFHE} with $(\bm{u},\mathbf{F})=(\mathbf{0},\mathbf{0})$. Then the truncations $\bm{b}_k=\mathcal{S}_k\bm{b}$ satisfy \[ \left\{ \begin{alignedat}{2} \partial_t \bm{b}_{k} +\Lambda^{2\beta}\bm{b}_{k} &=\mathbf{0} &&\quad \text{in } \mathbb{R}^d\times (0,T), \\ \bm{b}_{k}(\cdot,0) &=\mathbf{0}&&\quad \text{on } \mathbb{R}^d . \end{alignedat} \right. \] It is easy to see that $\bm{b}_k$ is identically zero. Since $\bm{b}_k \to \bm{b}$ in $L_2 (0,T; L_2 )$, we conclude that $\bm{b}$ is identically zero. This completes the proof of Lemma \ref{lem:linear-heat}. \end{proof} \begin{lem}\label{lem:div-free} Let $\alpha$ and $\beta$ satisfy \[ \frac{1}{2}<\alpha<\frac{d+1}{2},\quad \beta \geq 1,\quad \text{and}\quad \alpha+\beta\geq \frac{d}{2}+1.\] \begin{enumerate}[label=\textnormal{(\arabic*)}] \item For all $\bm{u} \in \Lor{d/(d+1-2\alpha)}{\infty}\cap \thSob{\alpha}$ and $\bm{v},\bm{w}\in \tSob{\beta}$, we have \begin{equation}\label{eq:trilinear-boundedness} \int_{\mathbb{R}^d} | \bm{u} | \, | \bm{v} | \, | \nabla \bm{w} | \myd{x} \apprle (\@ifstar{\@normb}{\@normi}{\bm{u}}{\NLor{d/(d+1-2\alpha)}{\infty}} +\@ifstar{\@normb}{\@normi}{\bm{u}}{\thSob{\alpha}})\@ifstar{\@normb}{\@normi}{\bm{v}}{\tSob{\beta}}\@ifstar{\@normb}{\@normi}{\bm{w}}{\tSob{\beta}}. \end{equation} Moreover, if $\Div \bm{u}=0$, then \begin{equation}\label{eq:trilinear} \int_{\mathbb{R}^d} \bm{u} \otimes \bm{v} : \nabla \bm{w} \myd{x}=-\int_{\mathbb{R}^d} (\bm{u}\cdot \nabla)\bm{v} \cdot \bm{w} \myd{x}. \end{equation} \item If $\bm{u}\in \Leb{\infty}(0,T;\Lor{d/(d+1-2\alpha)}{\infty})\cap \Leb{2}(0,T;\thSob{\alpha})$ and $\bm{b} \in \Leb{\infty}(0,T;\Leb{2})\cap \Leb{2}(0,T;\thSob{\beta})$, then \[\bm{b} \in L_{2\beta} (0,T; \dot{H}^1 ) \quad\mbox{and}\quad \bm{u}\otimes \bm{b}\in \Leb{2\beta /(2\beta-1)}(0,T;\Leb{2}).\] Moreover, if $\Div \bm{u}=0$, then \begin{equation}\label{eq:div-free-u} \int_{\mathbb{R}^d} \bm{u} (t) \otimes \bm{b} (t) : \nabla \bm{b} (t) \myd{x}=0\quad \text{for almost all } t\in (0,T) \end{equation} \end{enumerate} \end{lem} \begin{proof} (1) Let $\gamma =2\beta /(2\beta-1)$. Then by Lemma \ref{lem:product-estimate}, there exist $0<\theta_1,\theta_2<1$ with $\theta_1+\theta_2\leq 2-1/\beta=2/\gamma$ such that \begin{equation}\label{eq:prod-3} \@ifstar{\@normb}{\@normi}{| \bm{u}| \, | \bm{v}| }{\NLeb{2}}\apprle \@ifstar{\@normb}{\@normi}{\bm{u}}{\NLor{d/(d+1-2\alpha)}{\infty}}^{1-\theta_1}\@ifstar{\@normb}{\@normi}{\bm{u}}{\thSob{\alpha}}^{\theta_1}\@ifstar{\@normb}{\@normi}{\bm{v}}{\NLeb{2}}^{1-\theta_2}\@ifstar{\@normb}{\@normi}{\bm{v}}{\thSob{\beta}}^{\theta_2}. \end{equation} By Young's inequality, we have \begin{align*} \int_{\mathbb{R}^d} | \bm{u} | \, | \bm{v} | \, | \nabla \bm{w} | \myd{x} &\leq \@ifstar{\@normb}{\@normi}{| \bm{u}| \, | \bm{v}|}{\NLeb{2}}\@ifstar{\@normb}{\@normi}{\nabla \bm{w}}{\NLeb{2}}\\ &\apprle (\@ifstar{\@normb}{\@normi}{\bm{u}}{\NLor{d/(d+1-2\alpha)}{\infty}} +\@ifstar{\@normb}{\@normi}{\bm{u}}{\thSob{\alpha}})\@ifstar{\@normb}{\@normi}{\bm{v}}{\tSob{\beta}}\@ifstar{\@normb}{\@normi}{\bm{w}}{\tSob{\beta}}, \end{align*} which proves \eqref{eq:trilinear-boundedness}. To show \eqref{eq:trilinear}, choose sequences $\{\bm{v}_k\}$ and $\{\bm{w}_k\}$ in $C_c^\infty$ satisfying $\bm{v}_k\rightarrow \bm{v}$ and $\bm{w}_k\rightarrow \bm{w}$ in $\tSob{\beta}$. Since $\Div \bm{u}=0$, it follows that \[ 0=\int_{\mathbb{R}^d} \bm{u}\cdot \nabla (\bm{v}_k \cdot \bm{w}_k)\myd{x}=\int_{\mathbb{R}^d} (\bm{u}\cdot \nabla)\bm{v}_k \cdot \bm{w}_k \myd{x}+\int_{\mathbb{R}^d} \bm{u}\otimes\bm{v}_k : \nabla \bm{w}_k \myd{x} \] for all $k$. Hence the identity \eqref{eq:trilinear} is derived by letting $k\rightarrow \infty$ and using \eqref{eq:trilinear-boundedness}. (2) It immediately follows from (\ref{eq:our-interpolation}) that $\bm{b} \in L_{2\beta} (0,T; \dot{H}^1 )$. Let $1<r\leq \infty$ be defined by \[ \frac{1}{r} = 1-\frac{\gamma}{2}\left(\theta_1+\theta_2\right).\] Then by \eqref{eq:prod-3} and H\"older's inequality, \begin{align*} \int_0^T\@ifstar{\@normb}{\@normi}{\bm{u}\otimes \bm{b}}{\NLeb{2}}^\gamma \myd{t}&\apprle \int_0^T \@ifstar{\@normb}{\@normi}{\bm{u}}{\NLor{d/(d+1-2\alpha)}{\infty}}^{\gamma(1-\theta_1)}\@ifstar{\@normb}{\@normi}{\bm{u}}{\thSob{\alpha}}^{\gamma\theta_1}\@ifstar{\@normb}{\@normi}{\bm{b}}{\NLeb{2}}^{\gamma(1-\theta_2)}\@ifstar{\@normb}{\@normi}{\bm{b}}{\thSob{\beta}}^{\gamma\theta_2}\myd{t}\\ &\apprle \int_0^T \@ifstar{\@normb}{\@normi}{\bm{u}}{\thSob{\alpha}}^{\gamma\theta_1}\@ifstar{\@normb}{\@normi}{\bm{b}}{\thSob{\beta}}^{\gamma\theta_2}\myd{t}\\ &\apprle T^{1/r}\left(\int_0^T \@ifstar{\@normb}{\@normi}{\bm{u}}{\thSob{\alpha}}^2 \myd{t}\right)^{\gamma \theta_1 /2} \left(\int_0^T \@ifstar{\@normb}{\@normi}{\bm{b}}{\thSob{\beta}}^2 \myd{t} \right)^{\gamma \theta_2 /2}. \end{align*} Finally, the identity \eqref{eq:div-free-u} is obtained by taking $\bm{v} = \bm{w}=\bm{b}$ in \eqref{eq:trilinear}. This completes the proof of Lemma \ref{lem:div-free}. \end{proof} \begin{thm}\label{thm:energy-equality} Let $\alpha$ and $\beta$ satisfy \[ \frac{1}{2}<\alpha<\frac{d+1}{2},\quad \beta \geq 1,\quad \text{and}\quad \alpha+\beta \geq \frac{d}{2}+1.\] Suppose that $\bm{u} \in \Leb{\infty}(0,T;\Lor{d/(d+1-2\alpha)}{\infty})\cap \Leb{2}(0,T;\thSob{\alpha})$ and $\Div \bm{u}=0$ on $\mathbb{R}^d \times (0,T)$. Then for every $\mathbf{F}\in \Leb{2\beta/(2\beta-1)}(0,T;\Leb{2})$ and $\bm{b}_0 \in \Leb{2}$, there exists a unique weak solution $\bm{b}$ of \eqref{eq:PFHE}. Moreover, the solution $\bm{b}$ belongs to $C([0,T];\Leb{2})$ and satisfies the energy identity: \begin{equation}\label{eq:energy-identity-thm} \@ifstar{\@normb}{\@normi}{\bm{b}(t)}{\NLeb{2}}^2+2\int_0^t\@ifstar{\@normb}{\@normi}{\Lambda^\beta \bm{b}(s)}{\NLeb{2}}^2 \, ds=-2\int_0^t \int_{\mathbb{R}^d} \mathbf{F} : \nabla \bm{b} \myd{x}ds + \@ifstar{\@normb}{\@normi}{\bm{b}_0}{\NLeb{2}}^2 \end{equation} for $0\leq t\leq T$. \end{thm} \begin{proof} We first show that every weak solution $\bm{b}$ of \eqref{eq:PFHE} belongs to $ C([0,T];\Leb{2})$ and satisfies the energy identity \eqref{eq:energy-identity-thm}. Let $\bm{b}$ be a weak solution of \eqref{eq:PFHE} with $\mathbf{F}\in \Leb{2\beta/(2\beta-1)}(0,T;\Leb{2})$. Then $\bm{b}$ satisfies \[ \left\{ \begin{alignedat}{2} \partial_t \bm{b} +\Lambda^{2\beta} \bm{b} &= \Div \tilde{\mathbf{F}}&&\quad \text{in } \mathbb{R}^d\times (0,T),\\ \bm{b}( \cdot , 0) &=\bm{b}_0 &&\quad \text{on } \mathbb{R}^d , \end{alignedat} \right. \] where $\tilde{\mathbf{F}}=\mathbf{F}-\bm{u}\otimes \bm{b}$. By Lemma \ref{lem:div-free}, we have \[ \tilde{\mathbf{F}}\in \Leb{2\beta/(2\beta-1)}(0,T;\Leb{2})\quad \text{and}\quad \int_{\mathbb{R}^d} \tilde{\mathbf{F}}: \nabla \bm{b}\myd{x}=\int_{\mathbb{R}^d} \mathbf{F} :\nabla \bm{b} \myd{x}. \] Hence it follows from Lemma \ref{lem:linear-heat} that $\bm{b}$ belongs to $ C([0,T];\Leb{2})$ and satisfies the energy identity \eqref{eq:energy-identity-thm}. Uniqueness of weak solutions of \eqref{eq:PFHE} is an immediate consequence of the energy identity. Indeed, if $\bm{b}$ is a weak solution of \eqref{eq:PFHE} with $(\mathbf{F} , \bm{b}_0 ) =(\mathbf{0}, \mathbf{0})$, then since it satisfies the energy identity, we have \[ \@ifstar{\@normb}{\@normi}{\bm{b}(t)}{\NLeb{2}}^2+2\int_0^t \@ifstar{\@normb}{\@normi}{\Lambda^\beta \bm{b}(s)}{\NLeb{2}}^2 \, \myd{s}=0 \] for all $0\leq t\leq T$, which implies that $\bm{b}$ is identically zero. To complete the proof, it remains to prove existence of a weak solution of \eqref{eq:PFHE}. To prove this, we may consider truncated problems as in the proof of Lemma \ref{lem:linear-heat}. The resulting truncated problems are still linear but non-autonomous with coefficients being singular in time. To avoid this difficulty, we apply the Galerkin approximation method. Choose a sequence $\{\Phi_k\}$ in $\mathscr{S}$ such that the span of $\{\Phi_k\}$ is dense in $\tSob{\beta}$ and $\{\Phi_k\}$ is orthonormal in $\Leb{2}$. Then for a fixed $m\in \mathbb{N}$, we seek a function $\bm{b}_m$ of the form \[ \bm{b}_m(t)=\sum_{k=1}^m c_k^m(t) \Phi_k \] that satisfies \[ \bm{b}_m(0)=\sum_{k=1}^m \left(\bm{b}_0 , \Phi_j \right) \] and \begin{equation}\label{eq:ODE-Galerkin} \left(\partial_t\bm{b}_m (t) ,\Phi_j \right)+ \left(\Lambda^\beta \bm{b}_m (t) ,\Lambda^\beta \Phi_j \right)- \left( \bm{u}(t) \otimes \bm{b}_m (t),\nabla \Phi_j \right)=- \left( \mathbf{F} (t),\nabla \Phi_j \right) \end{equation} for $1\leq j\leq m$. Equivalently, since $\{\Phi_k\}$ is orthonormal in $\Leb{2}$, we look for a vector function $\bm{c}^m =(c_1^m,\dots,c_m^m): [0,T] \to \mathbb{R}^m$ satisfying \begin{equation}\label{eq:system} \frac{d}{dt} \bm{c}^m(t)+ A(t) \bm{c}^m (t) = \bm{f}(t)\quad\mbox{and}\quad \bm{c}^m (0)=\bm{c}_0 , \end{equation} where $A (t) = [ A_{jk}(t)]_{1\le j,k\le m}$, $\bm{f}(t) = ( f_1 (t) , \ldots , f_m (t))$, and $\bm{c}_0 = ( c_{0,1} , \ldots , c_{0,m} )$ are defined by \[ A_{jk}(t)= \left( \Lambda^\beta \Phi_k , \Lambda^\beta \Phi_j \right) - \left( \bm{u} (t) \otimes\Phi_k , \nabla \Phi_j \right), \] \[ f_j(t)=- \left( \mathbf{F} (t) , \nabla \Phi_j \right) , \quad\mbox{and}\quad c_{0,j}= \left(\bm{b}_0 , \Phi_j \right) \] for $1 \le j,k \le m$. By Lemma \ref{lem:div-free}, we have \[ |A(t)|\apprle \left(1+\@ifstar{\@normb}{\@normi}{\bm{u}(t)}{\NLor{d/(d+1-2\alpha)}{\infty}}+\@ifstar{\@normb}{\@normi}{\bm{u}(t)}{\thSob{\alpha}}\right) \@ifstar{\@normb}{\@normi}{ \Phi_k}{H^\beta}\@ifstar{\@normb}{\@normi}{ \Phi_j}{H^\beta} , \] which implies that $A \in \Leb{2}(0,T)$. Moreover, since $\bm{f} \in \Leb{2\beta/(2\beta-1)}(0,T)$, it follows from a standard theory of ordinary differential equations (ODEs) that there exists a unique absolutely continuous function $\bm{c}^m : [0,T] \to \mathbb{R}^m$ satisfying \eqref{eq:system}. Multiplying \eqref{eq:ODE-Galerkin} by $c_j^m$ and taking summation over $1\leq j\leq m$, we get \[ \frac{1}{2} \frac{d}{dt}\@ifstar{\@normb}{\@normi}{\bm{b}_m}{\NLeb{2}}^2+\@ifstar{\@normb}{\@normi}{\Lambda^\beta \bm{b}_m}{\NLeb{2}}^2-\left(\bm{u}\otimes \bm{b}_m,\nabla \bm{b}_m \right)=- \left( \mathbf{F},\nabla \bm{b}_m \right). \] By Lemma \ref{lem:div-free}, \eqref{eq:our-interpolation}, and Young's inequality, $$ \left( \bm{u} \otimes \bm{b}_m,\nabla \bm{b}_m \right)=0 $$ and \begin{align*} -\left(\mathbf{F},\nabla \bm{b}_m \right) &\leq C \@ifstar{\@normb}{\@normi}{\mathbf{F}}{\NLeb{2}}\@ifstar{\@normb}{\@normi}{\bm{b}_m}{\NLeb{2}}^{1-1/\beta} \@ifstar{\@normb}{\@normi}{\Lambda^\beta \bm{b}_m}{\NLeb{2}}^{1/\beta}\\ &\leq C \@ifstar{\@normb}{\@normi}{\mathbf{F}}{\NLeb{2}}^{\gamma} \@ifstar{\@normb}{\@normi}{\bm{b}_m}{\NLeb{2}}^{2(\beta-1)/(2\beta-1)}+\frac{1}{2}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \bm{b}_m}{\NLeb{2}}^2. \end{align*} Since $0 \le (\beta-1)/(2\beta -1)< 1$, we have \begin{align*} \frac{d}{dt} \@ifstar{\@normb}{\@normi}{\bm{b}_m}{\NLeb{2}}^2+ \@ifstar{\@normb}{\@normi}{\Lambda^\beta \bm{b}_m}{\NLeb{2}}^2&\leq 2C \@ifstar{\@normb}{\@normi}{\mathbf{F}}{\NLeb{2}}^{\gamma} \left(1+ \@ifstar{\@normb}{\@normi}{\bm{b}_m}{\NLeb{2}}^{2}\right). \end{align*} Hence, by Gronwall's inequality, \begin{align*} \sup_{0<t<T}\@ifstar{\@normb}{\@normi}{\bm{b}_m(t)}{\NLeb{2}}^2+\int_0^T\@ifstar{\@normb}{\@normi}{\Lambda^\beta \bm{b}_m(t)}{\NLeb{2}}^2 \, \myd{t}\leq \@ifstar{\@normb}{\@normi}{\bm{b}_0}{\NLeb{2}}^2 \, \exp \left(C\int_0^T \@ifstar{\@normb}{\@normi}{\mathbf{F} (t) }{\NLeb{2}}^\gamma \, \myd{t}\right) \end{align*} for some constant $C$ depending only on $d$, $\beta$, and $T$. This shows that the sequence $\{\bm{b}_m\}$ is uniformly bounded in $\Leb{\infty}(0,T;\Leb{2})\cap \Leb{2}(0,T;\tSob{\beta})$. Therefore, by weak-* compactness, there exist a subsequence $\{\bm{b}_{m_k}\}$ and a function $\bm{b}$ such that \[ \bm{b}_{m_k}\rightarrow \bm{b} \quad \text{weakly-* in } \Leb{\infty}(0,T;\Leb{2})\cap \Leb{2}(0,T;\tSob{\beta}). \] It is quite standard to show that $\bm{b}$ is a weak solution of \eqref{eq:PFHE}. The proof of Theorem \ref{thm:energy-equality} is complete. \end{proof} \section{Proof of Theorem \ref{thm:GWP}}\label{sec:proofs} This section is fully devoted to proving Theorem \ref{thm:GWP}. Throughout the remaining sections, we assume that $\nu=\eta=1$ for simplicity. \subsection{Approximation of the problem by truncations} Let $\mathbb{P}$ be the Leray projection defined by \[ \widehat{\mathbb{P} (\bm{u})}(\xi) = \left(I - \frac{\xi \otimes \xi}{|\xi|^2} \right) \widehat{\bm{u}} (\xi) . \] It is well-known that the Leray projection $\mathbb{P}$ has the following properties: \begin{enumerate}[label=\textnormal{(\arabic*)}] \item $\Div \mathbb{P}(\bm{u}) =0$ for all $\bm{u} \in \mathscr{S}$; \item $\mathbb{P}(\nabla \phi)=0$ for all $\phi \in \mathscr{S}$; \item $\mathbb{P}(\bm{u})=\bm{u}$ for all $\bm{u} \in \mathscr{S}$ with $\Div \bm{u}=0$; \item $\mathbb{P}[\mathbb{P}(\bm{u})]=\mathbb{P}(\bm{u})$ for all $\bm{u} \in \mathscr{S}$; \item $\mathbb{P}$ is bounded from $\Leb{q}$ to itself for $1<q<\infty$. \end{enumerate} Note also that $ \mathbb{P} \mathcal{S}_R (\bm{u} ) \in V_{R,\sigma}$ for all $\bm{u} \in L_2$, where $V_{R,\sigma}$ is the space of all vector fields $\bm{v} \in V_R$ such that $\Div \bm{v}=0$. \medskip The following lemma is necessary to construct approximate solutions of \eqref{eq:MHD-relaxed}. \begin{lem}\label{lem:b_R and u_R} Let $1/2 < \alpha < (d+1)/2$. Given $\bm{b} \in \Leb{2}$, we define \[ \bm{u} = \mathbf{U}_\alpha * (\bm{b} \otimes \bm{b} ), \] where $\mathbf{U}_{\alpha} = [U_{\alpha, j}^{kl}]_{1 \le j,k,l \le d}$ is defined by \eqref{eq:Stokes-Green}. Then \begin{equation}\label{eq:sol-estimate-bob-R} \bm{u} \in \Lor{d/(d+1-2\alpha)}{\infty} \quad\mbox{and}\quad \@ifstar{\@normb}{\@normi}{\bm{u} }{\NLor{d/(d+1-2\alpha)}{\infty}}\apprle \@ifstar{\@normb}{\@normi}{\bm{b} }{\NLeb{2}}^2 . \end{equation} Moreover, if $\bm{b} \in V_R$, then for any $\gamma \in \mathbb{N}_0^d$ and $d/(d+1-2\alpha) < q< \infty$, \begin{equation}\label{eq:sol-estimate-R-s} D^\gamma \bm{u} \in L_q , \quad \@ifstar{\@normb}{\@normi}{D^\gamma \bm{u} }{q}\apprle_R \@ifstar{\@normb}{\@normi}{\bm{b} }{\NLeb{2}}^2, \end{equation} and \begin{equation}\label{eq:sol-estimate-u0b-R-s} \@ifstar{\@normb}{\@normi}{D^\gamma (\bm{u} \otimes \bm{b} ) }{\NLeb{2}}+ \@ifstar{\@normb}{\@normi}{D^\gamma (\bm{b} \otimes \bm{u} )}{\NLeb{2}}\apprle_R \@ifstar{\@normb}{\@normi}{\bm{b} }{\NLeb{2}}^3. \end{equation} \end{lem} \begin{proof} Set $\mathbf{F} = \bm{b} \otimes \bm{b} $. Then since $\mathbf{F} \in L_1$ and $\mathbf{U}_{\alpha}\in \Lor{d/(d+1-2\alpha)}{\infty}$, the estimate (\ref{eq:sol-estimate-bob-R}) immediately follows from Lemma \ref{lem:Young}. Suppose in addition that $\bm{b} \in V_R$. Since $V_R \hookrightarrow \tSob{s}$ and $\tSob{d+s}\hookrightarrow L_\infty$ for any $s > 0$, it follows from H\"{o}lder's inequality that \[ \| D^\gamma \mathbf{F} \|_{L_1 \cap L_\infty} \apprle_R \@ifstar{\@normb}{\@normi}{\bm{b} }{\NLeb{2}}^2 \quad\mbox{for all}\,\, \gamma \in {\mathbb N}_0^d . \] Let $\gamma \in {\mathbb N}_0^d$ be fixed. Then since $D^\gamma \bm{u} = \mathbf{U}_\alpha * D^\gamma \mathbf{F}$, it follows from Lemma \ref{lem:Young} that \[ \| D^\gamma \bm{u} \|_{q} \apprle \| D^\gamma \mathbf{F} \|_{L_1 \cap L_\infty} \apprle_R \@ifstar{\@normb}{\@normi}{\bm{b} }{\NLeb{2}}^2 \] for any $d/(d+1-2\alpha) < q< \infty$. Finally, since there exist $p$ and $q$ such that \[ 2< p< \infty , \quad \frac{d}{d+1-2\alpha} < q < \infty , \quad\mbox{and}\quad \frac{1}{2} = \frac{1}{p}+\frac{1}{q}, \] the estimate (\ref{eq:sol-estimate-u0b-R-s}) is easily deduced from (\ref{eq:sol-estimate-R-s}) by using H\"{o}lder's inequality. This completes the proof of Lemma \ref{lem:b_R and u_R}. \end{proof} By virtue of Lemma \ref{lem:b_R and u_R}, we may consider the following truncated problem for $\bm{b}_R \in C^1([0,\infty);V_{R,\sigma})$: \begin{equation}\label{eq:MHD-relaxed-approx} \left\{ \begin{alignedat}{2} \partial_t \bm{b}_R + \Lambda^{2\beta} \bm{b}_R &=\mathbb{P}\mathcal{S}_R[\Div\hspace{0.1em} (\bm{b}_R\otimes \bm{u}_R-\bm{u}_R\otimes \bm{b}_R)] &&\quad \text{in }\mathbb{R}^d\times(0,\infty),\\ \bm{u}_R & = \mathbf{U}_\alpha * (\bm{b}_R\otimes \bm{b}_R)&&\quad \text{in }\mathbb{R}^d\times(0,\infty),\\ \bm{b}_R(\cdot,0)&=\mathbb{P}\mathcal{S}_R\bm{b}_0 &&\quad \text{on } \mathbb{R}^d , \end{alignedat} \right. \end{equation} where $\bm{b}_0 \in \Leb{2}$ with ${\rm div} \,\bm{b}_0=0$ is given. Note here that if $\bm{b}_R \in C^1([0,T);V_{R,\sigma})$, $0<T \le \infty$, and $\bm{u}_R = \mathbf{U}_\alpha * (\bm{b}_R\otimes \bm{b}_R)$, then by Lemma \ref{lem:b_R and u_R}, $$ \bm{u}_R \in C([0,T);\Lor{d/(d+1-2\alpha)}{\infty} ) $$ and \begin{equation}\label{eq:sol-estimate-R} \@ifstar{\@normb}{\@normi}{\bm{u}_R (t)}{\NLor{d/(d+1-2\alpha)}{\infty}}\apprle \@ifstar{\@normb}{\@normi}{\bm{b}_R(t)}{\NLeb{2}}^2 \quad\mbox{for}\,\, 0 \le t < T . \end{equation} Moreover, it follows from Theorem \ref{theorem:Frational Stokes-Lpdata-intersection} that for each $t \in (0,T)$, $\bm{u}_R (t) $ is a very weak solution of the fractional Stokes system \begin{equation}\label{eq:U-equation} \Lambda^{2\alpha} \bm{u}_R (t) +\nabla {p_*} (t) = \Div\hspace{0.1em} (\bm{b}_R (t)\otimes \bm{b}_R (t) ),\quad \Div \bm{u}_R (t) =0\quad\mbox{in}\,\,\mathbb{R}^d ; \end{equation} that is, $\bm{u}_R (t) $ satisfies \begin{equation}\label{eq:weak-sol-R} \int_{\mathbb{R}^d} \bm{u}_R(t) \cdot \left(\Lambda^{2\alpha} \Phi + \nabla \psi\right) dx = - \int_{\mathbb{R}^d}\bm{b}_R (t)\otimes \bm{b}_R (t) : \nabla \Phi \myd{x} \end{equation} for all $( \Phi , \psi ) \in \mathscr{S}$ with $\Div \Phi=0$. We shall show that for each $R>0$, there exists a unique solution $\bm{b}_R \in C^1([0,\infty);V_{R,\sigma})$ of the $R$-truncated problem (\ref{eq:MHD-relaxed-approx}) and then that some sequence $\{(\bm{u}_{R_k} , \bm{b}_{R_k} ) \}$ converges to a weak solution of the original problem \eqref{eq:MHD-relaxed}. \subsection{Existence of approximate solutions} Let $0<R<\infty$ be fixed. For $\bm{b} \in V_{R,\sigma}$, we define \[ G_R (\bm{b} ) = - \Lambda^{2\beta} \bm{b} + \mathbb{P}\mathcal{S}_R[\Div\hspace{0.1em}(\bm{b} \otimes \bm{u} -\bm{u} \otimes \bm{b})], \] where $\bm{u} = \mathbf{U}_\alpha * (\bm{b} \otimes \bm{b} )$. By Lemma \ref{lem:b_R and u_R}, $G_R$ is a well-defined mapping from $V_{R,\sigma}$ into $V_{R,\sigma}$. Therefore, the $R$-truncated problem (\ref{eq:MHD-relaxed-approx}) can be rewritten as the following Cauchy problem on an ODE in the Hilbert space $V_{R,\sigma}$: \begin{equation}\label{eq:MHD-relaxed-approx-ODE} \left\{ \begin{alignedat}{2} \partial_t \bm{b}_R (t) &=G_R (\bm{b}_R (t) ) \quad (0< t< \infty),\\ \bm{b}_R( 0)&=\mathbb{P}\mathcal{S}_R\bm{b}_0 , \end{alignedat} \right. \end{equation} where $\bm{b}_0 \in \Leb{2}$ with ${\rm div} \,\bm{b}_0=0$ is given. Suppose that $\bm{b}^i \in V_{R,\sigma}$ and $\bm{u}^i = \mathbf{U}_\alpha * (\bm{b}^i \otimes \bm{b}^i ) $ for $i=1,2$. Then since $V_{R,\sigma}\hookrightarrow \tSob{s}\hookrightarrow \thSob{s}$ for any $s \ge 0$, we have \[ \| \Lambda^{2\beta} \bm{b}^1 - \Lambda^{2\beta} \bm{b}^2 \|_2 \apprle_R \| \bm{b}^1 - \bm{b}^2 \|_2 . \] Following the proof of Lemma \ref{lem:b_R and u_R}, we also obtain \begin{align*} &\@ifstar{\@normb}{\@normi}{ \Div \hspace{0.1em} ( \bm{b}^1\otimes \bm{u}^1 -\bm{b}^2\otimes \bm{u}^2 )}{\NLeb{2}}\\ &\quad \le \@ifstar{\@normb}{\@normi}{ \Div\hspace{0.1em} ( (\bm{b}^1 -\bm{b}^2 )\otimes \bm{u}^1 )}{\NLeb{2}} + \@ifstar{\@normb}{\@normi}{ \Div\hspace{0.1em} ( \bm{b}^2\otimes (\bm{u}^1 - \bm{u}^2 ) )}{\NLeb{2}}\\ &\quad \apprle_R \|\bm{b}^1 -\bm{b}^2 \|_2 \|\bm{b}^1 \|_2^2 + \|\bm{b}^2 \|_2 \left(\|\bm{b}^1 \|_2 +\|\bm{b}^2 \|_2 \right)\|\bm{b}^1 -\bm{b}^2 \|_2 \end{align*} and \begin{align*} &\@ifstar{\@normb}{\@normi}{ \Div\hspace{0.1em}( \bm{u}^1\otimes \bm{b}^1 -\bm{u}^2\otimes \bm{b}^2 )}{\NLeb{2}}\\ &\quad \le \@ifstar{\@normb}{\@normi}{ \Div\hspace{0.1em} ( (\bm{u}^1 -\bm{u}^2 )\otimes \bm{b}^1 )}{\NLeb{2}} + \@ifstar{\@normb}{\@normi}{ \Div \hspace{0.1em} ( \bm{u}^2\otimes (\bm{b}^1 - \bm{b}^2 ) )}{\NLeb{2}}\\ &\quad \apprle_R \left(\|\bm{b}^1 \|_2 +\|\bm{b}^2 \|_2 \right) \|\bm{b}^1 -\bm{b}^2 \|_2 \|\bm{b}^1 \|_2 + \|\bm{b}^2 \|_2^2 \|\bm{b}^1 -\bm{b}^2 \|_2 . \end{align*} Hence by the $L_2$-boundedness of $\mathbb{P} \mathcal{S}_R$, we conclude that \begin{align*} \|G_R (\bm{b}^1 ) -G_R (\bm{b}^2 ) \|_{2} & \apprle_R \left(1+ \|\bm{b}^1 \|_2 +\|\bm{b}^2 \|_2 \right)^2 \| \bm{b}^1 - \bm{b}^2 \|_2 , \end{align*} which implies that $G_R$ is locally Lipschitz continuous on $V_{R,\sigma}$. Therefore it follows from Picard's theorem for ODEs in infinite dimensional spaces that for every $\bm{b}_0 \in \Leb{2}$ with ${\rm div} \,\bm{b}_0=0$, the $R$-truncated problem \eqref{eq:MHD-relaxed-approx} has a unique local classical solution $\bm{b}_R \in C^1([0,T_R);V_{R,\sigma})$. Here $0<T_R \le \infty$ denotes the maximal existence time of the local solution $\bm{b}_R$. Indeed, $\bm{b}_R$ exists globally, that is, $T_R =\infty$. To show this, let $\bm{u}_R = \mathbf{U}_\alpha * (\bm{b}_R\otimes \bm{b}_R)$. Since $V_{R,\sigma}\hookrightarrow \tSob{s}\hookrightarrow \thSob{s}$ and $(\thSob{s})^*=\thSob{-s}$ for any $s \ge 0$, it follows that $\bm{b}_R \otimes \bm{b}_R \in C([0,T_R);\thSob{1-\alpha} ).$ Hence by Theorem \ref{theorem:Frational Stokes-Lpdata}, $\bm{u}_R$ belongs to $C([0,T_R);\thSob{\alpha} )$ and satisfies the energy identity \[ \int_{\mathbb{R}^d} |\Lambda^{\alpha} \bm{u}_R (t)|^2 \myd{x}= - \int_{\mathbb{R}^d} \bm{b}_R (t)\otimes \bm{b}_R (t) : \nabla \bm{u}_R (t) \, dx \] for $0< t< T_R$. Multiply the $\bm{b}_R$-equation in \eqref{eq:MHD-relaxed-approx} by $\bm{b}_R$ and using the divergence-free condition, we get \[ \frac{d}{dt}\left(\frac{1}{2}\@ifstar{\@normb}{\@normi}{\bm{b}_R (t)}{\NLeb{2}}^2 \right)+ \@ifstar{\@normb}{\@normi}{\Lambda^\beta \bm{b}_R (t)}{\NLeb{2}}^2 =-\int_{\mathbb{R}^d} \bm{b}_R (t)\otimes \bm{u}_R (t) : \nabla \bm{b}_R (t) \, dx \] for $0< t< T_R$. Adding these two identities and using the divergence-free condition, we have \[ \frac{d}{dt}\left(\frac{1}{2}\@ifstar{\@normb}{\@normi}{\bm{b}_R (t) }{\NLeb{2}}^2 \right)+ \@ifstar{\@normb}{\@normi}{\Lambda^\alpha \bm{u}_R (t)}{\NLeb{2}}^2+ \@ifstar{\@normb}{\@normi}{\Lambda^\beta \bm{b}_R (t) }{\NLeb{2}}^2=0 ,\] from which we derive the global energy estimate \begin{equation}\label{eq:energy-estimate} \@ifstar{\@normb}{\@normi}{\bm{b}_R(t)}{\NLeb{2}}^2+2 \int_0^t \@ifstar{\@normb}{\@normi}{\Lambda^\alpha \bm{u}_R(\tau)}{\NLeb{2}}^2 \, d\tau +2 \int_0^t \@ifstar{\@normb}{\@normi}{\Lambda^\beta \bm{b}_R(\tau)}{\NLeb{2}}^2 \, d\tau \leq \@ifstar{\@normb}{\@normi}{\bm{b}_0}{\NLeb{2}}^2 \end{equation} for $0\leq t<T_R$. Therefore, by a standard ODE theory, we conclude that $T_R= \infty$. \medskip The following lemma will be used to construct weak solutions of \eqref{eq:MHD-relaxed} by applying the Aubin-Lions compactness lemma. \begin{lem}\label{lem:Aubin} There exist $r>1$ and $s\geq 1$ such that $\{\partial_t \bm{b}_R \}$ is bounded in $L_r(0,T;H^{-s})$ for any $0<T<\infty$. \end{lem} \begin{proof} To show this, let $s =\max \{\beta,1\}$. Then since $-s+1 \le 0$ and $2\beta-s \le \beta$, it follows that \begin{align*} \action{\partial_t \bm{b}_R,\Phi}&=\action{-\Lambda^{2\beta}\bm{b}_R,\Phi} - \int_{\mathbb{R}^d} (\bm{b}_R\otimes \bm{u}_R - \bm{u}_R\otimes \bm{b}_R ):\nabla ( \mathbb{P}\mathcal{S}_R\Phi )\myd{x}\\ &\apprle \@ifstar{\@normb}{\@normi}{\Lambda^{2\beta} \bm{b}_R}{\tSob{-s}}\@ifstar{\@normb}{\@normi}{\Phi}{\tSob{s}}+\@ifstar{\@normb}{\@normi}{|\bm{u}_R| | \bm{b}_R| }{\tSob{-s+1}}\@ifstar{\@normb}{\@normi}{\nabla ( \mathbb{P}\mathcal{S}_R\Phi )}{\tSob{s-1}}\\ &\apprle \left( \@ifstar{\@normb}{\@normi}{\bm{b}_R}{\tSob{2\beta-s}}+\@ifstar{\@normb}{\@normi}{ |\bm{u}_R| | \bm{b}_R| }{\tSob{-s+1}} \right)\@ifstar{\@normb}{\@normi}{\Phi}{\tSob{s}}\\ &\apprle \left( \@ifstar{\@normb}{\@normi}{\bm{b}_R}{\tSob{\beta}}+\@ifstar{\@normb}{\@normi}{|\bm{u}_R| | \bm{b}_R| }{\NLeb{2}} \right)\@ifstar{\@normb}{\@normi}{\Phi}{\tSob{s}} \end{align*} for all $\Phi \in \mathscr{S}$. Therefore, \begin{equation}\label{eq:time-estimate} \@ifstar{\@normb}{\@normi}{\partial_t \bm{b}_R(t)}{\tSob{-s}}\apprle \@ifstar{\@normb}{\@normi}{\bm{b}_R}{\tSob{\beta}}+\@ifstar{\@normb}{\@normi}{|\bm{u}_R | | \bm{b}_R |}{\NLeb{2}}. \end{equation} By Lemma \ref{lem:product-estimate}, there exist $0< \theta_1 , \theta_2 < 1$ such that \ \@ifstar{\@normb}{\@normi}{|\bm{u}_R | | \bm{b}_R | }{2}\apprle \@ifstar{\@normb}{\@normi}{\bm{u}_R }{\NLor{d/(d+1-2\alpha)}{\infty}}^{1-\theta_1} \@ifstar{\@normb}{\@normi}{\bm{u}_R }{\thSob{\alpha}}^{\theta_1}\@ifstar{\@normb}{\@normi}{\bm{b}_R }{\NLeb{2}}^{1-\theta_2} \@ifstar{\@normb}{\@normi}{\bm{b}_R }{\thSob{\beta}}^{\theta_2} . \ Setting $r_0 = 2/(\theta_ 1 +\theta_2 ) >1$ and using Young's inequality, we have \[ \@ifstar{\@normb}{\@normi}{|\bm{u}_R | | \bm{b}_R | }{2} \apprle \left(\@ifstar{\@normb}{\@normi}{\bm{u}_R }{\NLor{d/(d+1-2\alpha)}{\infty}}^{1-\theta_1} \@ifstar{\@normb}{\@normi}{\bm{u}_R }{\thSob{\alpha}}^{\theta_1} \right)^{2/r_0 \theta_1}+ \left(\@ifstar{\@normb}{\@normi}{\bm{b}_R }{\NLeb{2}}^{1-\theta_2} \@ifstar{\@normb}{\@normi}{\bm{b}_R }{\thSob{\beta}}^{\theta_2} \right)^{2/r_0 \theta_2} \] and so \[ \@ifstar{\@normb}{\@normi}{|\bm{u}_R | | \bm{b}_R | }{2}^{r_0} \apprle \@ifstar{\@normb}{\@normi}{\bm{u}_R }{\NLor{d/(d+1-2\alpha)}{\infty}}^{2(1-\theta_1)/ \theta_1}\@ifstar{\@normb}{\@normi}{\Lambda^\alpha \bm{u}_R}{\NLeb{2}}^{2} + \@ifstar{\@normb}{\@normi}{\bm{b}_R }{\NLeb{2}}^{2(1-\theta_2)/\theta_2} \@ifstar{\@normb}{\@normi}{\Lambda^\beta\bm{b}_R}{\NLeb{2}}^{2}. \] By \eqref{eq:sol-estimate-R} and (\ref{eq:energy-estimate}), we thus obtain \[ \int_0^\infty \@ifstar{\@normb}{\@normi}{|\bm{u}_R | | \bm{b}_R | }{2}^{r_0} \, dt \apprle \@ifstar{\@normb}{\@normi}{\bm{b}_0}{\NLeb{2}}^{4/\theta_1 -2} + \@ifstar{\@normb}{\@normi}{\bm{b}_0}{\NLeb{2}}^{2/\theta_2 } . \] Now, let $r= \min \{2,r_0 \}$. Then by \eqref{eq:energy-estimate} and \eqref{eq:time-estimate}, we have \begin{align*} \@ifstar{\@normb}{\@normi}{\partial_t \bm{b}_R}{\Leb{r}(0,T;\tSob{-s})}&\apprle T^{1/r-1/2}\@ifstar{\@normb}{\@normi}{\bm{b}_R}{\Leb{2}(0,T;\tSob{\beta})} +T^{1/r-1/r_0}\@ifstar{\@normb}{\@normi}{\bm{u}_R \otimes \bm{b}_R}{\Leb{r_0}(0,T;\Leb{2})} \\ &\leq C(d,\alpha,\beta,T, \@ifstar{\@normb}{\@normi}{\bm{b}_0}{\NLeb{2}}) , \end{align*} which proves that $\{\partial_t \bm{b}_R\}$ is bounded in $\Leb{r}(0,T;\tSob{-s})$ for any $0<T<\infty$. \end{proof} \subsection{Completion of the proof of Theorem \ref{thm:GWP}} We have shown that for each $0<R<\infty$, the $R$-truncated problem \eqref{eq:MHD-relaxed-approx} has a unique global solution $\bm{b}_R \in C^1([0, \infty );V_{R,\sigma})$. By (\ref{eq:sol-estimate-R}) and (\ref{eq:energy-estimate}), the families $\{\bm{b}_R\}_{R>0}$ and $\{\bm{u}_R\}_{R>0}$ are bounded in $\Leb{\infty}(0,\infty;\Leb{2})\cap \Leb{2}(0,\infty; \dot{H}^\beta)$ and $\Leb{\infty}(0,\infty;\Lor{d/(d+1-2\alpha)}{\infty})\cap \Leb{2}(0,\infty;\dot{H}^\alpha)$, respectively. By the weak-* compactness result and (\ref{eq:energy-estimate}), there exists a sequence $\{R_k\}$ with $R_k\rightarrow \infty$ such that \[ \bm{u}_{R_k}\rightarrow \bm{u} \quad\mbox{weakly-* in}\,\, \Leb{\infty}(0,\infty;\Lor{d/(d+1-2\alpha)}{\infty})\cap \Leb{2}(0,\infty;\thSob{\alpha}) \] and \[ \bm{b}_{R_k}\rightarrow \bm{b} \quad\mbox{weakly-* in} \,\, \Leb{\infty}(0,\infty;\Leb{2})\cap \Leb{2}(0,\infty;\thSob{\beta}) \] for some $(\bm{u} , \bm{b} )$ satisfying \begin{equation}\label{eq:energy-estimate-limit} \| \bm{b} \|_{\Leb{\infty}(0,\infty;\Leb{2})}^2+ \| \bm{b}\|_{\Leb{2}(0,\infty;\thSob{\beta})}^2+ \| \bm{u}\|_{\Leb{2}(0,\infty;\thSob{\alpha})}^2 \le 2 \@ifstar{\@normb}{\@normi}{\bm{b}_0}{\NLeb{2}}^2 . \end{equation} By Lemma \ref{lem:Aubin} and the Aubin-Lions compactness lemma, there exists a subsequence of $\{\bm{b}_{R_k}\}$, denoted still by $\{\bm{b}_{R_k}\}$, such that \begin{equation}\label{strong conv-b} \bm{b}_{R_k}\rightarrow \bm{b} \quad\mbox{in}\,\, \Leb{2}(K \times (0,T) ) \end{equation} for any compact $K \subset \mathbb{R}^d$ and finite $T>0$. Moreover, by \eqref{eq:energy-estimate}, we have \begin{align*} \@ifstar{\@normb}{\@normi}{ \bm{b}_{R_k}\otimes \bm{b}_{R_k}-\bm{b}\otimes \bm{b} }{\NLeb{1};K}&\leq \@ifstar{\@normb}{\@normi}{ \bm{b}_{R_k}\otimes (\bm{b}_{R_k}-\bm{b}) }{\NLeb{1};K} +\@ifstar{\@normb}{\@normi}{ (\bm{b}_{R_k} -\bm{b} )\otimes \bm{b} }{\NLeb{1};K}\\ &\leq 2 \@ifstar{\@normb}{\@normi}{\bm{b}_0}{\NLeb{2}} \@ifstar{\@normb}{\@normi}{\bm{b}_{R_k} -\bm{b} }{\NLeb{2};K} \end{align*} and so \begin{equation}\label{strong conv-bob} \bm{b}_{R_k}\otimes \bm{b}_{R_k}\rightarrow \bm{b}\otimes \bm{b} \quad\mbox{in}\,\, \Leb{2}(0,T;\Leb{1}(K)) \end{equation} for any compact $K \subset \mathbb{R}^d$ and finite $T>0$. Next, we show that \begin{equation}\label{strong conv-u} \bm{u}_{R_k}\rightarrow \mathbf{U}_\alpha * (\bm{b} \otimes \bm{b} ) \quad\mbox{in}\,\, \Leb{2}(0,T;\Lor{d/(d+1-2\alpha)}{\infty}(K)) \end{equation} for any finite $T$ and compact $K \subset \mathbb{R}^d$, which automatically implies that \begin{equation}\label{u=Ubb} \bm{u} = \mathbf{U}_\alpha * (\bm{b} \otimes \bm{b} ); \end{equation} hence $\bm{u}$ satisfies (\ref{eq:velocity}). Let $\bm{v} = \mathbf{U}_\alpha * (\bm{b} \otimes \bm{b} )$. Fixing $0<r, T< \infty$, we write \begin{align*} \bm{u}_{R_k} (x,t)- \bm{v} (x,t) &=\int_{B_{M+r}} \mathbf{U}_\alpha (x-y): (\bm{b}_{R_k}\otimes \bm{b}_{R_k} -\bm{b} \otimes \bm{b} ) (y,t) \myd{y}\\ &\relphantom{=}+\int_{\mathbb{R}^d \setminus B_{M+r}} \mathbf{U}_\alpha (x-y): (\bm{b}_{R_k}\otimes \bm{b}_{R_k} -\bm{b} \otimes \bm{b} ) (y,t)\myd{y}\\ &=\bm{I}_1^k ( x,t)+\bm{I}_2^k (x,t ) \end{align*} for $(x,t) \in B_r \times (0,T)$, where $M>1$ is a large number to be determined later. Recall from \eqref{eq:Stokes-Green} that $$ |\mathbf{U}_\alpha(x)|\apprle \frac{1}{|x|^{d+1-2\alpha}}. $$ Hence by Lemma \ref{lem:Young} and (\ref{strong conv-bob}), we have \begin{align*} \@ifstar{\@normb}{\@normi}{\bm{I}_1^k}{L_2 (0,T;\Lor{d/(d+1-2\alpha)}{\infty})} &\apprle \@ifstar{\@normb}{\@normi}{\mathbf{U}_\alpha}{\NLor{d/(d+1-2\alpha)}{\infty}}\@ifstar{\@normb}{\@normi}{\bm{b}_{R_k}\otimes \bm{b}_{R_k}-\bm{b} \otimes \bm{b} }{L_2(0,T; \Leb{1}(B_{M+r}) )}\\ & \rightarrow 0 \quad\mbox{as}\,\, k \rightarrow \infty . \end{align*} To estimate $|\bm{I}_2^k |$, we choose $0<\theta \le 1/2$ and $2<p<{2d}/{(2\alpha-1)}$ such that \[ \frac{1}{p}= \frac{1}{2}-\frac{\theta \beta}{d}. \] Then by Proposition \ref{prop:Gagliardo}, \[ \|\bm{b}_{R_k}\|_{p} \apprle \|\bm{b}_{R_k}\|_{2}^{1-\theta}\@ifstar{\@normb}{\@normi}{\Lambda^\beta\bm{b}_{R_k}}{\NLeb{2}}^\theta . \] Hence setting $q= 2/\theta $, we have \[ \@ifstar{\@normb}{\@normi}{\bm{b}_{R_k}}{\Leb{q}(0,\infty;\Leb{p})} \apprle\@ifstar{\@normb}{\@normi}{\bm{b}_{R_k}}{\Leb{\infty}(0,\infty;\Leb{2})}^{1-\theta} \@ifstar{\@normb}{\@normi}{\bm{b}_{R_k}}{\Leb{2}(0,\infty;\thSob{\beta})}^{\theta} \apprle \|\bm{b}_{0}\|_{2} \] and similarly \[ \@ifstar{\@normb}{\@normi}{\bm{b}}{\Leb{q}(0,\infty;\Leb{p})} \apprle \|\bm{b}_{0}\|_{2}. \] On the other hand, since $d+1-2\alpha-{d(p-2)}/{p}>0$, it follows that if $|x|\leq r$, then \begin{align*} |\bm{I}_2^k (x,t)| &\leq \left(\int_{\mathbb{R}^d \setminus B_M} |\mathbf{U}_\alpha(z)|^{(p/2)'}dz \right)^{1/(p/2)'} \@ifstar{\@normb}{\@normi}{ [\bm{b}_{R_k}\otimes \bm{b}_{R_k}-\bm{b} \otimes \bm{b}](t) }{\NLeb{p/2}}\\ &\apprle M^{-[d+1-2\alpha-d(p-2)/p] } \left(\@ifstar{\@normb}{\@normi}{\bm{b}_{R_k}(t)}{\NLeb{p}}^2 + \@ifstar{\@normb}{\@normi}{\bm{b} (t)}{\NLeb{p}}^2 \right). \end{align*} Therefore, noting that $q \ge 4$, we deduce that \begin{align*} \@ifstar{\@normb}{\@normi}{\bm{u}_{R_k}-\bm{v}}{\Leb{2}(0,T;\Lor{d/(d+1-2\alpha)}{\infty}(B_r))} &\le \@ifstar{\@normb}{\@normi}{\bm{I}_1^k}{\Leb{2}(0,T;\Lor{d/(d+1-2\alpha)}{\infty}(B_r))}\\ & \quad + C(r,T) M^{-[d+1-2\alpha-d(p-2)/ p]} \|\bm{b}_{0}\|_{2}^2 \end{align*} for some constant $C(r,T)$ independent of $k$ and $M$. Now, let $\delta>0$ be given. Then choosing $M>1$ so large that $$ C(r,T) M^{-[d+1-2\alpha-d(p-2)/ p]} \|\bm{b}_{0}\|_{2}^2 <\delta , $$ and then letting $k \to \infty$, we have \[ \limsup_{k\rightarrow \infty} \@ifstar{\@normb}{\@normi}{\bm{u}_{R_k}-\bm{v}}{\Leb{2}(0,T;\Lor{d/(d+1-2\alpha)}{\infty}(B_r))}\leq \delta, \] which proves (\ref{strong conv-u}). Finally, we show that \begin{equation}\label{strong cov-bu} \begin{aligned} &\bm{u}_{R_k}\otimes \bm{b}_{R_k} \rightarrow \bm{u}\otimes \bm{b} \quad\mbox{in}\,\, \Leb{1}(K \times (0,T)), \\ &\bm{b}_{R_k}\otimes \bm{u}_{R_k} \rightarrow \bm{b}\otimes \bm{u} \quad\mbox{in}\,\, \Leb{1}(K \times (0,T)) \end{aligned} \end{equation} for any compact $K \subset \mathbb{R}^d$ and finite $T>0$. By symmetry, it suffices to show the first assertion. We write \[ \bm{u}_{R_k}\otimes \bm{b}_{R_k} - \bm{u} \otimes \bm{b}= ( \bm{u}_{R_k} - \bm{u})\otimes \bm{b}_{R_k} + \bm{u} \otimes( \bm{b}_{R_k} - \bm{b}). \] First, since $1/2<\alpha<(d+1)/2$, $\beta>0$, and $2\alpha+\beta>d/2+1$, there exists $2<p_1 <\infty$ such that \[ \max\left\{ \frac{1}{2}-\frac{\beta}{d}, 0 \right\} < \frac{1}{p_1}< \min \left\{ \frac{1}{2}, \frac{2\alpha-1}{d} \right\}. \] Then by Proposition \ref{prop:upper-critical}, \[ \|\bm{b}_{R_k}\|_{\NLor{p_1}{1}} \apprle \|\bm{b}_{R_k}\|_{2}^{1-\theta_1}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \bm{b}_{R_k} }{\NLeb{2}}^{\theta_1} , \] where $0<\theta_1 <1$ is defined by $1/p_1 = 1/2 -(\theta_1 \beta )/d$. Let $K \subset \mathbb{R}^d$ be compact. Then since $1/p_1 > 1/2 -\beta/d$ and $d/(2\alpha -1) < p_1$, it follows from Lemma \ref{lem:Holder} and the Sobolev embedding theorem that \begin{align*} \|( \bm{u}_{R_k} - \bm{u} )\otimes \bm{b}_{R_k}\|_{1;K} & \apprle \| \bm{u}_{R_k} - \bm{u} \|_{d/(d+1-2\alpha),\infty ;K}\|\bm{b}_{R_k}\|_{d/(2\alpha-1),1; K } \\ & \apprle_K \| \bm{u}_{R_k} - \bm{u} \|_{d/(d+1-2\alpha),\infty ;K} \|\bm{b}_{R_k}\|_{H^{\beta}}. \end{align*} Hence by \eqref{eq:energy-estimate}, (\ref{strong conv-u}) and (\ref{u=Ubb}), we have \begin{align*} \|( \bm{u}_{R_k} - \bm{u} )\otimes \bm{b}_{R_k}\|_{L_1 (0,T; L_1 (K)) } & \apprle_{K,T} \@ifstar{\@normb}{\@normi}{\bm{u}_{R_k}-\bm{u}} {\Leb{2}(0,T;\Lor{d/(d+1-2\alpha)}{\infty}(K))}\|\bm{b}_{0}\|_{2} \\ & \rightarrow 0 \quad\mbox{as}\,\, k \to \infty \end{align*} for any finite $T$. To estimate $\bm{u}\otimes ( \bm{b}_{R_k} - \bm{b})$, we choose $2<p_2 < \infty$ such that \[ \max\left\{ \frac{1}{2}-\frac{\alpha}{d}, 0 \right\} < \frac{1}{p_2}< \min \left\{ \frac{1}{2}, \frac{d+1-2\alpha}{d} \right\}. \] By Proposition \ref{prop:upper-critical} again, \[ \|\bm{u} \|_{2;K} \apprle_K \|\bm{u} \|_{p_2} \apprle \| \bm{u} \|_{d/(d+1-2\alpha),\infty}^{1-\theta_2} \|\Lambda^{\alpha} \bm{u} \|_{2}^{\theta_2} \] for some $0< \theta_2 < 1$. Hence by (\ref{eq:energy-estimate-limit}), (\ref{strong conv-b}), and (\ref{u=Ubb}), we have \begin{align*} \|\bm{u} \otimes ( \bm{b}_{R_k} - \bm{b} )\|_{L_1 (0,T; L_1 (K)) } & \le \|\bm{u} \|_{L_2 (0,T; L_2 (K)) }\|\bm{b}_{R_k} - \bm{b} \|_{L_2 (0,T; L_2 (K)) }\\ & \apprle_{K,T} \left( \|\bm{b}_{0}\|_{2} + \|\bm{b}_{0}\|_{2}^2 \right) \@ifstar{\@normb}{\@normi}{\bm{b}_{R_k}-\bm{b}} {\Leb{2}(0,T;L_2 (K))} \\ & \rightarrow 0 \quad\mbox{as}\,\, k \to \infty , \end{align*} which proves (\ref{strong cov-bu}). We have shown strong convergence for the nonlinear terms $\bm{b}_{R_k}\otimes \bm{b}_{R_k} $, $\bm{u}_{R_k}\otimes \bm{b}_{R_k} $, and $\bm{b}_{R_k}\otimes \bm{u}_{R_k}$. Hence by a standard argument, we can show that $(\bm{u},\bm{b})$ satisfies \eqref{eq:magnetic}. It is obvious that both $\bm{u}$ and $\bm{b}$ are divergence-free. This completes the proof of Theorem \ref{thm:GWP}. \hfill $\square$ \section{Proof of Theorem \ref{thm:uniqueness}}\label{sec:uniqueness} This section is devoted to proving Theorem \ref{thm:uniqueness}. By Theorem \ref{thm:GWP} and its proof, there exists a global weak solution $(\bm{u},\bm{b} )$ of \eqref{eq:MHD-relaxed}, which also satisfies $\bm{u} = \mathbf{U}_\alpha * (\bm{b} \otimes \bm{b} )$ in $\mathbb{R}^d\times [0, \infty )$. Since $\bm{b}$ is divergence-free, $\bm{b}$ is a weak solution of \eqref{eq:PFHE} with $\mathbf{F} = \bm{b} \otimes \bm{u}$. It follows from Lemma \ref{lem:div-free} that $\bm{b} \otimes \bm{u} \in \Leb{2\beta /(2\beta-1)}(0,T;\Leb{2})$ for any $T<\infty$. Hence by Theorem \ref{thm:energy-equality}, $\bm{b}$ belongs to $C([0, \infty );\Leb{2})$ and satisfies \begin{equation}\label{energy identity-b-F2} \frac{1}{2} \frac{d}{dt} \@ifstar{\@normb}{\@normi}{\bm{b} (t)}{\NLeb{2}}^2+ \@ifstar{\@normb}{\@normi}{\Lambda^\beta \bm{b}(t)}{\NLeb{2}}^2 =- \int_{\mathbb{R}^d} \bm{b} (t) \otimes \bm{u} (t) : \nabla \bm{b} (t) \myd{x} \end{equation} for almost all $t \in (0, \infty )$. Using Young's inequality (Lemma \ref{lem:Young}), we easily deduce that $\bm{u} \in C( [ 0,\infty );\Lor{{d}/{(d+1-2\alpha)}}{\infty})$. Let $1< p< d/(2\alpha -1)$ be chosen so that $H^\beta \hookrightarrow L_{2p}$. Then it follows from H\"{o}lder's inequality and Lemma \ref{lem:product2} that $$ \bm{b} (t) \otimes \bm{b} (t) \in L_p \cap \dot{H}^{1-\alpha} \quad\mbox{and}\quad \Div\hspace{0.1em}(\bm{b} (t) \otimes \bm{b} (t) ) = ( \bm{b} (t) \cdot \nabla ) \bm{b} (t) \in L_{2p/(p+1)} $$ for almost all $t \in (0,\infty)$. Hence by Theorem \ref{theorem:Frational Stokes-Lpdata} and Lemma \ref{lem:div-free}, $\bm{u}$ satisfies \begin{equation}\label{eq:energy-identity-u2} \int_{\mathbb{R}^d} |\Lambda^{\alpha} \bm{u} (t) |^2 \myd{x}= \int_{\mathbb{R}^d} ( \bm{b} (t) \cdot \nabla ) \bm{b} (t) \cdot \bm{u} (t) \, dx \end{equation} for almost all $t \in (0,\infty ) $. Adding (\ref{energy identity-b-F2}) and (\ref{eq:energy-identity-u2}) and then integraing over $(0,t)$, we get the energy identity (\ref{eq:energy-equality}) for any $t \ge 0$. To complete the proof of Theorem \ref{thm:uniqueness} it remains to prove the uniqueness assertion. Let $(\bm{u}^1,\bm{b}^1)$ and $(\bm{u}^2,\bm{b}^2)$ be two weak solutions of \eqref{eq:MHD-relaxed} for the same initial data $\bm{b}_0 \in \Leb{2}$ with ${\rm div} \, \bm{b}_0 =0$. Write $\tilde{\bm{u}}=\bm{u}^1-\bm{u}^2$ and $\tilde{\bm{b}}=\bm{b}^1-\bm{b}^2$. Then $(\tilde{\bm{u}},\tilde{\bm{b}})$ satisfies \[ \partial_t \tilde{\bm{b}}+\Lambda^{2\beta}\tilde{\bm{b}}+(\bm{u}^1\cdot\nabla)\tilde{\bm{b}}= \Div\hspace{0.1em} (\tilde{\bm{b}}\otimes \bm{u}^1+\bm{b}^2 \otimes \tilde{\bm{u}}-\tilde{\bm{u}}\otimes\bm{b}^2) \] and \[ \tilde{\bm{u}} = \mathbf{U}_\alpha * (\tilde{\bm{b}}\otimes \bm{b}^1+\bm{b}^2 \otimes \tilde{\bm{b}}).\] Moreover, by Lemma \ref{lem:div-free}, \[ \bm{u}^i \otimes \bm{b}^j \in L_{2\beta /(2\beta -1)}(0,T; L_2 ) \quad\mbox{and}\quad \bm{b}^i \in L_{2\beta}(0,T; \dot{H}^1 ) \] for any $T< \infty$, where $i,j=1,2$. Hence by Theorem \ref{thm:energy-equality}, we have \begin{align*} \frac{1}{2}\frac{d}{dt} \@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}}^2+\@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}}{\NLeb{2}}^2&=- \int_{\mathbb{R}^d} \tilde{\bm{b}}\otimes \bm{u}^1:\nabla \tilde{\bm{b}}\myd{x}+\int_{\mathbb{R}^d} \left(-\bm{b}^2 \otimes \tilde{\bm{u}} +\tilde{\bm{u}}\otimes \bm{b}^2 \right): \nabla \tilde{\bm{b}}\myd{x}\\ &=I+II. \end{align*} Hence by Gronwall's inequality, it suffices to show that \begin{equation}\label{eq:Gronwall-estimate} I+II\leq C\phi(t)\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}}^2+\frac{1}{2}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}}{\NLeb{2}}^2 \end{equation} for some constant $C$, where $\phi$ is a locally integrable function defined by \[ \phi(t)=1+\@ifstar{\@normb}{\@normi}{\Lambda^\alpha \bm{u}^1(t)}{\NLeb{2}}^2 + \@ifstar{\@normb}{\@normi}{\Lambda^\alpha \bm{u}^2(t)}{\NLeb{2}}^2+\@ifstar{\@normb}{\@normi}{\Lambda^\beta \bm{b}^1(t)}{\NLeb{2}}^2 + \@ifstar{\@normb}{\@normi}{\Lambda^\beta \bm{b}^2(t)}{\NLeb{2}}^2. \] To do this, we make crucial use of Lemma \ref{lem:product-estimate}; that is, we choose $0<\theta_1,\theta_2<1$ with $\theta_1+\theta_2+1/\beta \leq 2$ such that \begin{equation}\label{est-ui and bj} \@ifstar{\@normb}{\@normi}{\bm{u}^i \otimes \bm{b}^j}{\NLeb{2}} \apprle \@ifstar{\@normb}{\@normi}{\bm{u}^i}{\NLor{d/(d+1-2\alpha)}{\infty}}^{1-\theta_1} \@ifstar{\@normb}{\@normi}{\Lambda^\alpha\bm{u}^i}{\NLeb{2}}^{\theta_1} \@ifstar{\@normb}{\@normi}{\bm{b}^j}{\NLeb{2}}^{1-\theta_2}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \bm{b}^j}{\NLeb{2}}^{\theta_2} \end{equation} for $i,j=1,2$. Note also that if $\alpha<1$ and $\mu={(1-\alpha)}/{\beta}$, then since $\alpha+(1-\mu)\beta \geq d/2+1$, the numbers $\theta_1$ and $\theta_2$ can be chosen so that $(1+\mu)\theta_1+\theta_2+1/\beta\leq 2$. Now, by (\ref{est-ui and bj}) and Proposition \ref{prop:Gagliardo}, we obtain \begin{align*} I&\leq \@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}\otimes \bm{u}^1}{\NLeb{2}}\@ifstar{\@normb}{\@normi}{\nabla \tilde{\bm{b}}}{\NLeb{2}}\\ &\apprle \@ifstar{\@normb}{\@normi}{\bm{u}^1}{\NLor{d/(d+1-2\alpha)}{\infty}}^{1-\theta_1}\@ifstar{\@normb}{\@normi}{\Lambda^\alpha\bm{u}^1}{\NLeb{2}}^{\theta_1}\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}}^{1-\theta_2}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}}{\NLeb{2}}^{\theta_2} \@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}}^{1-1/\beta}\@ifstar{\@normb}{\@normi}{\Lambda^\beta\tilde{\bm{b}}}{\NLeb{2}}^{1/\beta}. \end{align*} and \begin{equation}\label{eq:estimate-II} II\apprle \@ifstar{\@normb}{\@normi}{\tilde{\bm{u}}}{\NLor{d/(d+1-2\alpha)}{\infty}}^{1-\theta_1}\@ifstar{\@normb}{\@normi}{\Lambda^\alpha\tilde{\bm{u}}}{\NLeb{2}}^{\theta_1}\@ifstar{\@normb}{\@normi}{\bm{b}^2}{\NLeb{2}}^{1-\theta_2}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \bm{b}^2}{\NLeb{2}}^{\theta_2}\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}}^{1-1/\beta}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}}{\NLeb{2}}^{1/\beta}. \end{equation} It is easy to estimate $I$. Indeed, by Lemma \ref{lem:b_R and u_R}, the energy identity \eqref{eq:energy-equality}, and Young's inequality, we have \begin{align*} I&\apprle \@ifstar{\@normb}{\@normi}{\bm{b}_0}{\NLeb{2}}^{2(1-\theta_1)} \left(\@ifstar{\@normb}{\@normi}{\Lambda^\alpha {\bm{u}}^1}{\NLeb{2}}^{\theta_1}\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}}^{2-\theta_2-1/\beta} \right)\@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}}{\NLeb{2}}^{\theta_2 +1/\beta},\\ &\leq C \@ifstar{\@normb}{\@normi}{\Lambda^{\alpha}\bm{u}^1}{\NLeb{2}}^{\frac{2\theta_1}{2-\theta_2-1/\beta}}\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}}^2+\frac{1}{4}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}}{\NLeb{2}}^2\\ &\leq C \phi(t)^{\frac{\theta_1}{2-\theta_2-1/\beta}}\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}}^2+\frac{1}{4}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}}{\NLeb{2}}^2 \end{align*} for some $C=C(\alpha,\beta,d,\@ifstar{\@normb}{\@normi}{\bm{b}_0}{\NLeb{2}})$. Since $\theta_1 / (2-\theta_2-1/\beta)\leq 1$ and $\phi(t)\geq 1$, we get \[ I\leq C \phi(t)\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}}^2+\frac{1}{4}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}}{\NLeb{2}}^2.\] To estimate $II$, we recall that \[ \tilde{\bm{u}} = \mathbf{U}_\alpha * (\tilde{\bm{b}}\otimes \bm{b}^1+\bm{b}^2 \otimes \tilde{\bm{b}}).\] By Theorems \ref{theorem:Frational Stokes-Lpdata} and \ref{theorem:Frational Stokes-Lpdata-intersection}, we have \begin{equation}\label{eq:weak-Lp-estimates} \@ifstar{\@normb}{\@normi}{\tilde{\bm{u}}}{\NLor{d/(d+1-2\alpha)}{\infty}}\apprle \left(\@ifstar{\@normb}{\@normi}{\bm{b}^1}{\NLeb{2}}+\@ifstar{\@normb}{\@normi}{\bm{b}^2}{\NLeb{2}} \right)\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}} \apprle \@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}} \end{equation} and \begin{equation}\label{eq:difference-u} \@ifstar{\@normb}{\@normi}{\Lambda^\alpha \tilde{\bm{u}}}{\NLeb{2}} \apprle \@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}\otimes \bm{b}^1+\bm{b}^2 \otimes \tilde{\bm{b}}}{\thSob{1-\alpha}}. \end{equation} Suppose first that $\alpha \geq 1$. Then \[ \thSob{1-\alpha}=\left(\thSob{\alpha-1}\right)^*\quad \text{and}\quad \thSob{\alpha-1}\hookrightarrow \Leb{r},\] where $1<r<\infty$ is defined by ${1}/{r}={1}/{2}-{(\alpha-1)}/{d}$. Fix any $\Phi \in \thSob{\alpha-1}$. Then by H\"older's inequality and Proposition \ref{prop:Gagliardo}, we have \begin{align*} &\int_{\mathbb{R}^d} \left(\tilde{\bm{b}}\otimes \bm{b}^1+\bm{b}^2\otimes \tilde{\bm{b}} \right):\Phi \myd{x}\\ &\quad \leq \left(\@ifstar{\@normb}{\@normi}{\bm{b}^1}{\NLeb{2r'}}+\@ifstar{\@normb}{\@normi}{\bm{b}^2}{\NLeb{2r'}}\right)\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2r'}}\@ifstar{\@normb}{\@normi}{\Phi}{\NLeb{r}}\\ &\quad \apprle \left(\@ifstar{\@normb}{\@normi}{\bm{b}^1}{\NLeb{2r'}}+\@ifstar{\@normb}{\@normi}{\bm{b}^2}{\NLeb{2r'}}\right)\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{2r'}\@ifstar{\@normb}{\@normi}{\Phi}{\thSob{\alpha-1}}\\ &\quad \apprle \left(\@ifstar{\@normb}{\@normi}{\bm{b}^1}{2}^{1-\lambda}\@ifstar{\@normb}{\@normi}{\bm{b}^1}{\thSob{\beta}}^{\lambda}+\@ifstar{\@normb}{\@normi}{\bm{b}^2}{2}^{1-\lambda}\@ifstar{\@normb}{\@normi}{\bm{b}^2}{\thSob{\beta}}^{\lambda} \right)\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{2}^{1-\lambda}\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\thSob{\beta}}^{\lambda} \@ifstar{\@normb}{\@normi}{\Phi}{\thSob{\alpha-1}}, \end{align*} where \[ 0<\lambda =\frac{d}{2\beta r}= \frac{d+2-2\alpha}{4\beta}\leq \frac{1}{2}.\] Hence by \eqref{eq:difference-u}, \begin{equation}\label{eq:phi-estimate-u} \begin{aligned} \@ifstar{\@normb}{\@normi}{\Lambda^\alpha\tilde{\bm{u}}}{2}&\apprle\left(\@ifstar{\@normb}{\@normi}{\bm{b}^1}{2}^{1-\lambda}\@ifstar{\@normb}{\@normi}{\bm{b}^1}{\thSob{\beta}}^{\lambda}+\@ifstar{\@normb}{\@normi}{\bm{b}^2}{2}^{1-\lambda}\@ifstar{\@normb}{\@normi}{\bm{b}^2}{\thSob{\beta}}^{\lambda} \right) \@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{2}^{1-\lambda}\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\thSob{\beta}}^{\lambda}\\ &\apprle \phi(t)^{\lambda/2}\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{2}^{1-\lambda}\@ifstar{\@normb}{\@normi}{\Lambda^\beta\tilde{\bm{b}}}{\NLeb{2}}^{\lambda}. \end{aligned} \end{equation} Combining \eqref{eq:estimate-II}, \eqref{eq:weak-Lp-estimates}, and \eqref{eq:phi-estimate-u}, we have \begin{align*} II&\leq C\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}}^{1-\theta_1}\left(\phi(t)^{\lambda/2}\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}}^{1-\lambda}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}}{\NLeb{2}}^{\lambda} \right)^{\theta_1}\phi(t)^{\theta_2/2}\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}}^{1-1/\beta}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}}{\NLeb{2}}^{1/\beta} \\ &=C \phi(t)^{(\lambda\theta_1 +\theta_2)/2}\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{2}^{2-\lambda\theta_1-1/\beta}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}}{\NLeb{2}}^{\lambda\theta_1 + 1/\beta} \\ &\leq C\phi(t)^{\frac{\lambda\theta_1 +\theta_2}{2-\lambda\theta_1-1/\beta}}\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}}^2+\frac{1}{4}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}}{\NLeb{2}}^2. \end{align*} Since $\theta_1+\theta_2+1/\beta\leq 2$ and $2\lambda \leq 1$, it follows that \[ \frac{\lambda\theta_1+\theta_2}{2-\lambda\theta_1 - 1/\beta}\leq 1.\] Therefore, \[ II\leq C\phi(t)\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}}^2+\frac{1}{4}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}}{\NLeb{2}}^2. \] Suppose next that $\alpha <1$. Then since $\beta \geq \frac{d}{2}+1-\alpha>\frac{d}{2}$, it follows from \eqref{eq:difference-u} and Lemma \ref{lem:commutator} that \begin{align*} \@ifstar{\@normb}{\@normi}{\Lambda^\alpha \tilde{\bm{u}}}{\NLeb{2}} \apprle \@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}\otimes \bm{b}^1+\bm{b}^2\otimes \tilde{\bm{b}}}{\thSob{1-\alpha}}\apprle \left(\@ifstar{\@normb}{\@normi}{\bm{b}^1}{\tSob{1-\alpha}}+\@ifstar{\@normb}{\@normi}{\bm{b}^2}{\tSob{1-\alpha}} \right)\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\tSob{\beta}}. \end{align*} Moreover, by Proposition \ref{prop:Gagliardo}, \begin{align*} \@ifstar{\@normb}{\@normi}{\bm{b}^i}{\tSob{1-\alpha}}&\apprle \@ifstar{\@normb}{\@normi}{\bm{b}^i}{\NLeb{2}}+\@ifstar{\@normb}{\@normi}{\bm{b}^i}{\thSob{1-\alpha}}\\ &\apprle \@ifstar{\@normb}{\@normi}{\bm{b}^i}{\NLeb{2}}+\@ifstar{\@normb}{\@normi}{\bm{b}^i}{\NLeb{2}}^{1-\mu}\@ifstar{\@normb}{\@normi}{\bm{b}^i}{\thSob{\beta}}^{\mu}\apprle \phi(t)^{\mu/2} \end{align*} for $i=1,2$, where $\mu=(1-\alpha)/\beta$. Hence \begin{align*} II&\leq C\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}}^{1-\theta_1}\left[\phi(t)^{\mu/2}\left(\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}}+\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\thSob{\beta}} \right)\right]^{\theta_1}\phi(t)^{\theta_2/2}\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}}^{1-1/\beta}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}}{\NLeb{2}}^{1/\beta} \\ &\leq C \phi(t)^{(\mu\theta_1+\theta_2)/2}\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{2}^{2-1/\beta}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}}{\NLeb{2}}^{1/\beta} \\ &\relphantom{=}+C \phi(t)^{(\mu\theta_1 +\theta_2)/2}\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{2}^{2-\theta_1-1/\beta}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}}{\NLeb{2}}^{\theta_1 + 1/\beta} \\ &\leq C\left[\phi(t)^{\frac{\mu\theta_1+\theta_2}{2-1/\beta}}+\phi(t)^{\frac{\mu \theta_1+\theta_2}{2-\theta_1-1/\beta}}\right]\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}}^2+\frac{1}{4}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}}{\NLeb{2}}^2. \end{align*} Since $(1+\mu)\theta_1+\theta_2+1/\beta\leq 2$, it follows that \[ \frac{\mu\theta_1+\theta_2}{2-1/\beta}\leq \frac{\mu \theta_1+\theta_2}{2-\theta_1-1/\beta}\leq 1. \] Therefore, \[ II\leq C\phi(t)\@ifstar{\@normb}{\@normi}{\tilde{\bm{b}}}{\NLeb{2}}^2+\frac{1}{4}\@ifstar{\@normb}{\@normi}{\Lambda^\beta \tilde{\bm{b}}}{\NLeb{2}}^2. \] This completes the proof of \eqref{eq:Gronwall-estimate}. By Gronwall's inequality, we conclude that $\bm{b}^1=\bm{b}^2$ on $[0,\infty)$. Moreover, it follows from \eqref{eq:weak-Lp-estimates} that $\bm{u}^1=\bm{u}^2$ on $[0,\infty)$. This completes the proof of Theorem \ref{thm:uniqueness}. \hfill \qed
\section{Introduction} In classical categry theory the left adjoint of an oplax monoidal functor between monoidal categories is lax monoidal. Dually, the right adjoint of a lax monoidal functor is oplax monoidal. These correpondences give rise to a dual equivalence between the category of monoidal categories with right adjoint lax monoidal functors and that with left adjoint oplax monoidal functors. Generalizations of this equivalence have been considered in the setting of $\infty$-categories. Lurie~\cite{Lurie2} showed that the right adjoint of a strong monoidal functor between monoidal $\infty$-categoreis is lax monoidal. In \cite{Torii2} we showed that the right adjoint of an oplax monoidal functor is lax monoidal, and vice versa. Haugseng, Hebestreit, Linskens, Nuiten~\cite{HHLN1} constructed a bidual equivalence between the $(\infty,2)$-category of $\mathcal{O}$-monoidal $\infty$-categories with left adjoint oplax $\mathcal{O}$-monoidal functors and that with right adjoint lax $\mathcal{O}$-monoidal functors for any $\infty$-operad $\mathcal{O}$. They constructed the equivalence by introducing notions of curved orthofibrations and (op-)Gray fibrations. In \cite{Torii4} we showed that there is a dual equivalence between the $\infty$-category ${\rm Mon}_{\mathcal{O}}^{\rm lax, R}(\cat)$ of $\mathcal{O}$-monoidal $\infty$-cateogries with right adjoint lax $\mathcal{O}$-monoidal functors and the $\infty$-category ${\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)$ of $\mathcal{O}$-monidal $\infty$-catergories with left adjoint oplax $\mathcal{O}$-monoidal functors by constructing a perfect pairing between them. Thus, we have two equivalecnes between ${\rm Mon}_{\mathcal{O}}^{\rm lax, R}(\cat)$ and ${\rm Mon}_{\mathcal{O}}^{\rm oplax, L}(\cat)^{\rm op}$. One is the restriction of the equivalence obtained by Haugseng, Hebestreit, Linskens, Nuiten~\cite{HHLN1}, and the other is by the author~\cite{Torii4}. The purpose of this paper is to give a uniqueness result of such equivalences. In \cite{Torii4} we have studied $\mathcal{O}$-monoidal presheaf functors $\mathbb{P}_{\mathcal{O}!}: {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat) \to {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})$ and $\mathbb{P}_{\mathcal{O}}^*: {\rm Mon}_{\mathcal{O}}^{\rm oplax}(\cat)^{\rm op} \to {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})$. In this paper we consider a space ${\mathcal Eq}$ of equivalences $F$ between ${\rm Mon}_{\mathcal{O}}^{\rm lax, R}(\cat)$ and ${\rm Mon}_{\mathcal{O}}^{\rm oplax, L}(\cat)^{\rm op}$ equipped with an equivalence $\mathbb{P}_{\mathcal{O!}}\stackrel{\simeq}{\to} \mathbb{P}_{\mathcal{O}}^*\circ F$. The first main result of this paper is the following theorem. \begin{theorem}[{cf.~Theorem~\ref{thm:uniqueness-equivalences}}] \label{theorem:main-theorem-1} The space ${\mathcal Eq}$ is contractible. \end{theorem} By construction, the equivalence $T$ in \cite{Torii4} is equipped with an equivalence $\theta: \mathbb{P}_{\mathcal{O}!}\stackrel{\simeq}{\to} \mathbb{P}_{\mathcal{O}}^*\circ T$. Hence, we can regard the pair $(T,\theta)$ as an object of ${\mathcal Eq}$. For the restriction $H$ of the equivalence in \cite{HHLN1}, we will show that there is a canonical equivalence $\gamma: \mathbb{P}_{\mathcal{O}!}\stackrel{\simeq}{\to} \mathbb{P}_{\mathcal{O}}^*\circ H$ which is compatible with Yoneda embeddings. Hence, we can also regard the pair $(H,\gamma)$ as an object of ${\mathcal Eq}$. By Theorem~\ref{theorem:main-theorem-1}, we obtain the following theorem, which is the second main theorem of this paper. \begin{theorem}[{cf.~Theorem~\ref{thm:T-eq-H}}] \label{theorem:main-theorem-2} The pair $(T,\theta)$ is canonically equivalent to $(H,\gamma)$. \end{theorem} This theorem implies the following corollary. \begin{corollary}[{cf. Corollary~\ref{cor:main-claim}}] The equivalence $T$ in \cite{Torii4} is equivalent to the restriction $H$ of the equivalence in \cite{HHLN1}. \end{corollary} The organization of this paper is as follows: In \S\ref{section:monoidal-presheaf-functors} we review properties of monoidal presheaf functors $\mathbb{P}_{\mathcal{O}!}$ and $\mathbb{P}_{\mathcal{O}}^*$ studied in \cite{Torii4}. In \S\ref{section:uniqueness} we prove a uniqueness result (Theorem~\ref{theorem:main-theorem-1}). We introduce the space ${\mathcal Eq}$ of equivalences between ${\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)$ and ${\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op}$ compatible with monoidal presheaf functors, and show that ${\mathcal Eq}$ is contractible. In \S\ref{section:canonical-equivalence} we prove the second main theorem (Theorem~\ref{theorem:main-theorem-2}). Showing that the restriction $H$ of the equivalence in \cite{HHLN1} extends to an object $(H,\gamma)$ in ${\mathcal Eq}$, we prove that the pair $(T,\theta)$ is canonically equivalent to $(H,\gamma)$. \if0 In category theory the right adjoint of an oplax monoidal functor between monoidal categories is lax monoidal. It is reasonable to expect the similar statement holds in higher category theory. \if0 In this paper we give another proof of the fact that the opposite of the $\infty$-category of monoidal $\infty$-categories and left adjoint oplax monoidal functors is equivalent to that of monoidal $\infty$-categories and right adjoint lax monoidal functors. There are several models of $(\infty,1)$-categories, Quasi-categories are one of these models. Quasi-categories were introduced by Boardman-Vogt. The theory of quasi-category was developed by Joyal and Lurie. \fi In \cite{Lurie1,Lurie2} Lurie has developed higher category theory using quasi-categories, which are models for $(\infty,1)$-categories. In particular, he has proved that the right adjoint of a strong monoidal functor is lax monoidal between monoidal $\infty$-categories in \cite{Lurie2}. In \cite{Torii2} we showed that the right adjoint of an oplax monoidal functor is lax monoidal. Haugseng-Hebestreit-Linskens-Nuiten~\cite{HHLN1} proved that the $\infty$-category ${\rm Mon}_{\mathcal{O}}^{\rm oplax,L} ({\rm Cat}_{\infty})$ of $\mathcal{O}$-monoidal $\infty$-categories with left adjoint oplax $\mathcal{O}$-monoidal functors is dual equivalent to the $\infty$-category ${\rm Mon}_{\mathcal{O}}^{\rm lax, R} ({\rm Cat}_{\infty})$ of $\mathcal{O}$-monoidal $\infty$-category with right adjoint lax $\mathcal{O}$-monoidal functors for each $\infty$-operad $\mathcal{O}^{\otimes}$. \begin{theorem}[{\cite{HHLN1}}] \label{thm:main-theorem} There is an equivalence \[ {\rm Mon}_{\mathcal{O}}^{\rm oplax,L} ({\rm Cat}_{\infty})^{\rm op} \stackrel{\simeq}{\longrightarrow} {\rm Mon}_{\mathcal{O}}^{\rm lax, R} ({\rm Cat}_{\infty})\] of $\infty$-categories, which is identity on objects, and which assigns to a left adjoint oplax $\mathcal{O}$-monoidal functor its right adjoint lax $\mathcal{O}$-monoidal functor. \end{theorem} The purpose of this paper is to give another proof of Theorem~\ref{thm:main-theorem}. For this purpose we study functorialities of the monoidal Yoneda embeddings. After that, we will prove Theorem~\ref{thm:main-theorem} by constructing a perfect pairing between ${\rm Mon}_{\mathcal{O}}^{\rm oplax,L} ({\rm Cat}_{\infty})$ and ${\rm Mon}_{\mathcal{O}}^{\rm lax, R} ({\rm Cat}_{\infty})$ (Theorem~\ref{thm:main-this-note}). The author thinks that the method of the proof might be interesting in its own right. In fact, Haugseng-Hebestreit-Linskens-Nuiten~\cite{HHLN1} proved a more general statement than Theorem~\ref{thm:main-theorem}. They showed that there is a bidual equivalence between the $(\infty,2)$-category of $\mathcal{O}$-monoidal $\infty$-categories with left adjoint oplax $\mathcal{O}$-monoidal functors and that of $\mathcal{O}$-monoidal $\infty$-categories with right adjoint lax $\mathcal{O}$-monoidal functors. We will not give a proof of the $(\infty,2)$-categorical statement since it needs a more sophisticated method to organize equivalences between mapping $(\infty,1)$-categories of the two $(\infty,2)$-categories. Instead we will compare the equivalence in this paper with the restriction of the equivalence in \cite{HHLN1} and show that they are canonically equivalent. Now, we will describe an outline of our proof. A small $\infty$-category $\mathcal{C}$ can be embedded into the $\infty$-category ${\rm P}(\mathcal{C})$ of presheaves on $\mathcal{C}$ by the Yoneda lemma. If $\mathcal{C}$ is an $\mathcal{O}$-monoidal $\infty$-category, then we can construct an $\mathcal{O}$-monoidal $\infty$-category $\mathbb{P}_{\mathcal{O}}(\mathcal{C})$ such that $\mathbb{P}_{\mathcal{O}}(\mathcal{C})_X \simeq {\rm P}(\mathcal{C}_X)$ for each $X\in\mathcal{O}$ by Day convolution product~\cite{Lurie2}. We will construct a pairing between the $\infty$-category ${\rm Mon}_{\mathcal{O}}^{\rm oplax}({\rm Cat}_{\infty})$ of $\mathcal{O}$-monoidal $\infty$-categories with oplax $\mathcal{O}$-monoidal functors and the $\infty$-category ${\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Cat}_{\infty})$ of $\mathcal{O}$-monoidal $\infty$-categories with lax $\mathcal{O}$-monoidal functors. The pairing corresponds to a functor ${\rm Mon}_{\mathcal{O}}^{\rm oplax}({\rm Cat}_{\infty}) \times {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Cat}_{\infty}) \to\widehat{\mathcal{S}}$, which assigns to a pair $(\mathcal{C},\mathcal{D})$ the mapping space ${\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}), \mathbb{P}_{\mathcal{O}}(\mathcal{D}))$. By restricting the pairing to the full subcategory spanned by those vertices corresponding to right adjoint lax $\mathcal{O}$-monoidal functors $\mathcal{C}\to \mathcal{D}$, we obtain a perfect pairing between ${\rm Mon}_{\mathcal{O}}^{\rm oplax, L}({\rm Cat}_{\infty})$ and ${\rm Mon}_{\mathcal{O}}^{\rm lax, R}({\rm Cat}_{\infty})$, which gives the desired dual equivalence. \if0 and pairing of $\infty$-categories. If the $\infty$-category is $\mathcal{O}$monoidal for an $\infty$-operad $\mathcal{O}$, then we can equip the $\infty$-category of presheaves on it an $\mathcal{O}$-monoidal structure by Day convolution product. Furthermore, we can promote the Yoneda embedding to an embedding of $\mathcal{O}$-monoidal $\infty$-categories. A Yoneda embedding is related to a pairing of $\infty$-categories \cite[\S5.2.1]{Lurie2}. In particular, if there exists a perfect pairing between $\infty$-categories $\mathcal{C}$ and $\mathcal{D}$, then we can conclude that $\mathcal{C}$ and $\mathcal{D}$ are an opposite equivalence. Thus, by constructing a perfect pairing, we will show that there exists a dual equivalence (antiequivalence) between the $\infty$-category of $\mathcal{O}$-monoidal $\infty$-category with lax monoidal functors and that with oplax monoidal functors. \fi The organization of this paper is as follows: In \S\ref{section:monoidal-structure-on-presheaves} we study monoidal structures on $\infty$-categories of presheaves and Yoneda embeddings. In \S\ref{section:presheaf-functor} we consider monoidal functorialities for the construction of $\infty$-categories of presheaves. In \S\ref{section:lax-oplax-duality} we prove Theorem~\ref{thm:main-theorem} by constructing the perfect pairing. In \S\ref{section:uniqueness} we compare the equivalence in this paper with the restriction of the equivalence in \cite{HHLN1}. \fi \begin{notation}\rm We fix Grothendieck universes $\mathcal{U}\in \mathcal{V}\in\mathcal{W} \in \mathcal{X}$ throughout this paper. We say that an element of $\mathcal{U}$ is small, an element of $\mathcal{V}$ is large, an element of $\mathcal{W}$ is very large, and an element of $\mathcal{X}$ is super large. We denote by ${\rm Cat}_{\infty}$ the large $\infty$-category of small $\infty$-categories, and by $\widehat{\rm Cat}_{\infty}$ the very large $\infty$-category of large $\infty$-categories. We denote by $\mathrm{Pr}^{\rm L}$ the subcategory of $\widehat{\rm Cat}_{\infty}$ spanned by presentable $\infty$-categories and colimit-preserving functors. We write $\mathcal{S}$ for the large $\infty$-category of small spaces, $\widehat{\mathcal{S}}$ for the very large $\infty$-category of large spaces, and $\widetilde{S}$ for the super large $\infty$-category of very large spaces. For an $\infty$-category $\mathcal{C}$, we denote by $h\mathcal{C}$ its homotopy category, and by $\pi_{\mathcal{C}}: \mathcal{C}\to h\mathcal{C}$ the canonical functor. For a functor $F: \mathcal{C}\to\mathcal{D}$ between $\infty$-categories, we write $hF: h\mathcal{C}\to h\mathcal{D}$ for the induced functor on homotopy categories. For an $\infty$-operad $\mathcal{O}^{\otimes}\to {\rm Fin}_*$, we write $\mathcal{O}$ for $\mathcal{O}^{\otimes}_{\langle 1\rangle}$. For an $\mathcal{O}$-monoidal $\infty$-category $\mathcal{C}^{\otimes}\to \mathcal{O}^{\otimes}$, we denote by $\mathcal{C}$ the underlying $\infty$-category $\mathcal{C}^{\otimes}\times_{\mathcal{O}^{\otimes}}\mathcal{O}$, and we say that $\mathcal{C}$ is an $\mathcal{O}$-monoidal $\infty$-category for simplicity. \end{notation} \noindent {\bf Acknowledgements}. The author would like to thank Jonathan Beardsley for letting him know references for the result by Haugseng-Hebestreit-Linskens-Nuiten. He would also like to thank the referee of the preprint~\cite{Torii4} becasuse this paper grows out of his trying to answer questions and comments by the referee. The author was partially supported by JSPS KAKENHI Grant Numbers JP17K05253. \if0 \section{Monoidal structure on presheaves} \label{section:monoidal-structure-on-presheaves} Let $\mathcal{O}^{\otimes}$ be a small $\infty$-operad. When $\mathcal{C}$ is a small $\mathcal{O}$-monoidal $\infty$-category, we can construct an $\mathcal{O}$-monoidal $\infty$-category $\mathbb{P}_{\mathcal{O}}(\mathcal{C})^{\otimes}\to \mathcal{O}^{\otimes}$ by using Day convolution product. In this section we study the $\mathcal{O}$-monoidal $\infty$-category $\mathbb{P}_{\mathcal{O}}(\mathcal{C})$. First, we recall that there is an $\mathcal{O}$-monoidal $\infty$-category $\mathbb{P}_{\mathcal{O}}(\mathcal{C})^{\otimes}\to\mathcal{O}^{\otimes}$ by Day convolution product if $\mathcal{C}$ is a small $\mathcal{O}$-monoidal $\infty$-category. We denote by $\mathcal{S}^{\times}\to{\rm Fin}_*$ the symmetric monoidal $\infty$-category for the $\infty$-category $\mathcal{S}$ of spaces with Cartesian symmetric monoidal structure. Taking pullback along the map $\mathcal{O}^{\otimes}\to{\rm Fin}_*$, we obtain an $\mathcal{O}$-monoidal $\infty$-category $\mathcal{S}_{\mathcal{O}}^{\otimes} \to\mathcal{O}^{\otimes}$, where $\mathcal{S}_{\mathcal{O}}^{\otimes} =\mathcal{S}^{\times}\times_{{\rm Fin}_*}\mathcal{O}^{\otimes}$. For an $\mathcal{O}$-monoidal $\infty$-category $\mathcal{C}^{\otimes}\to\mathcal{O}^{\otimes}$, there is an opposite $\mathcal{O}$-monoidal $\infty$-category $(\mathcal{C}^{\vee})^{\otimes}\to \mathcal{O}^{\otimes}$ such that $(\mathcal{C}^{\vee})^{\otimes}_X\simeq \mathcal{C}_X^{\rm op}$ for each $X\in\mathcal{O}$. By \cite[Construction~2.2.6.7]{Lurie2}, we can construct a fibration $\mathbb{P}_{\mathcal{O}}(\mathcal{C})^{\otimes} \to\mathcal{O}^{\otimes}$ of $\infty$-operads, where $\mathbb{P}_{\mathcal{O}}(\mathcal{C})^{\otimes} ={\rm Fun}^{\mathcal{O}} (\mathcal{C}^{\vee},\mathcal{S}_{\mathcal{O}})^{\otimes}$. In fact, it is a coCartesian fibration of $\infty$-operads by \cite[Proposition~2.2.6.16]{Lurie2}. \begin{lemma}[{\cite[Proposition~2.2.6.16]{Lurie2}}] \label{lemma:presheaf-monoidal-Day-convolution} If $\mathcal{C}$ is a small $\mathcal{O}$-monoidal $\infty$-category, then there is an $\mathcal{O}$-monoidal $\infty$-category $\mathbb{P}_{\mathcal{O}}(\mathcal{C})^{\otimes}\to\mathcal{O}^{\otimes}$ in ${\rm Pr}^{\rm L}$ by Day convolution product such that $\mathbb{P}_{\mathcal{O}}(\mathcal{C})^{\otimes}_X\simeq {\rm P}(\mathcal{C}_X)$ for each $X\in\mathcal{O}$. \end{lemma} \begin{notation}\rm For $\mathcal{O}$-monoidal $\infty$-categories $\mathcal{C}$ and $\mathcal{D}$, we denote by \[ {\rm Fun}_{\mathcal{O}}^{\rm lax}(\mathcal{C},\mathcal{D}) \] the $\infty$-category ${\rm Alg}_{\mathcal{C}/\mathcal{O}}(\mathcal{D})$ of lax $\mathcal{O}$-monoidal functors between $\mathcal{C}$ and $\mathcal{D}$. \end{notation} By the universal property of Day convolution product (\cite[Definition~2.2.6.1]{Lurie2}), we can characterize a lax $\mathcal{O}$-monoidal functor $\mathcal{C}\to \mathbb{P}_{\mathcal{O}}(\mathcal{D})$ by its associated functor $\mathcal{C}\times_{\mathcal{O}}\mathcal{D}^{\vee}\to \mathcal{S}_{\mathcal{O} $. \begin{lemma}[{\cite[Definition~2.2.6.1]{Lurie2}}] \label{lemma:adjoint-characterization-lax-functor} Let $\mathcal{C}$ be a small $\mathcal{O}$-monoidal $\infty$-category and let $\mathcal{D}$ be an $\mathcal{O}$-monoidal $\infty$-category. There is a lax $\mathcal{O}$-monoidal functor $\mathbb{P}_{\mathcal{O}}(\mathcal{C}) \times_{\mathcal{O}}\mathcal{C}^{\vee} \to \mathcal{S}_{\mathcal{O}}$ which induces an equivalence \[ {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{D}, \mathbb{P}_{\mathcal{O}}(\mathcal{C})) \stackrel{\simeq}{\longrightarrow} {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{D}\times_{\mathcal{O}}\mathcal{C}^{\vee}, \mathcal{S}_{\mathcal{O}}) \] of $\infty$-categories. \end{lemma} When $\mathcal{C}$ is a small $\infty$-category, we have the Yoneda embedding $j: \mathcal{C}\to{\rm P}(\mathcal{C})$ which is fully faithful, and the $\infty$-category ${\rm P}(\mathcal{C})$ is freely generated by $j(\mathcal{C})$ under small colimits in the sense of \cite[Theorem~5.1.5.6]{Lurie1}. We will show that $j$ is promoted to a strong $\mathcal{O}$-monoidal functor if $\mathcal{C}$ is a small $\mathcal{O}$-monoidal $\infty$-category. \begin{lemma} \label{lemma:Yoneda-embedding-strong-monoidal} Let $\mathcal{C}$ be a small $\mathcal{O}$-monoidal $\infty$-category. There is a strong $\mathcal{O}$-monoidal functor $J: \mathcal{C}\to \mathbb{P}_{\mathcal{O}}(\mathcal{C})$ such that $J_X: \mathcal{C}_X\to \mathbb{P}_{\mathcal{O}}(\mathcal{C})_X\simeq {\rm P}(\mathcal{C}_X)$ is equivalent to the Yoneda embedding for each $X\in\mathcal{O}$. \end{lemma} \proof First, we shall show that there is a lax $\mathcal{O}$-monoidal functor $J: \mathcal{C}\to\mathbb{P}_{\mathcal{O}}(\mathcal{C})$ such that $J_X$ is equivalent to the Yoneda embedding for each $X\in\mathcal{O}$. By Lemma~\ref{lemma:adjoint-characterization-lax-functor}, it suffices to construct a lax $\mathcal{O}$-monoidal functor $\mathcal{C}^{\vee}\times_{\mathcal{O}}\mathcal{C}\to \mathcal{S}_{\mathcal{O}} $ whose restriction $\mathcal{C}_X^{\vee}\times\mathcal{C}_X \to\mathcal{S}$ is equivalent to the mapping space functor for each $X\in\mathcal{O}$. By \cite[Example~5.2.2.23]{Lurie2}, we have a pairing of $\mathcal{O}$-monoidal $\infty$-categories \[ \lambda^{\otimes}:{\rm TwArr}(\mathcal{C})^{\otimes} \longrightarrow \mathcal{C}^{\otimes}\times_{\mathcal{O}^{\otimes}} (\mathcal{C}^{\vee })^{\otimes}. \] Note that this is a strong $\mathcal{O}$-monoidal functor. By taking opposite $\mathcal{O}$-monoidal $\infty$-categories, we obtain a strong $\mathcal{O}$-monoidal functor \[ (\lambda^{\vee })^{\otimes}: ({\rm TwArr}(\mathcal{C})^{\vee })^{\otimes} \longrightarrow (\mathcal{C}^{\vee})^{\otimes}\times_{\mathcal{O}^{\otimes}} \mathcal{C}^{\otimes}. \] The restriction $(\lambda^{\vee})^{\otimes}_X: ({\rm TwArr}(\mathcal{C})^{\vee})^{\otimes}_X \to (\mathcal{C}^{\vee})^{\otimes}_X\times \mathcal{C}^{\otimes}_X$ is a left fibration for any $X\in\mathcal{O}^{\otimes}$. By using coCartesian pushforward, we can show that $(\lambda^{\vee})^{\otimes}$ is a left fibration. Thus, we obtain a $(\mathcal{C}^{\vee})^{\otimes}\times_{\mathcal{O}^{\otimes}} \mathcal{C}^{\otimes}$-monoid object of $\mathcal{S}$. This means there is a lax $\mathcal{O}$-monoidal functor $\mathcal{C}^{\vee}\times_{\mathcal{O}}\mathcal{C}\to \mathcal{S}_{\mathcal{O}} $ by \cite[Proposition~2.4.2.5]{Lurie2}. Furthermore, we can see that the restriction over each $X\in\mathcal{O}$ is equivalent to the mapping space functor by \cite[Proposition~5.2.1.11]{Lurie2}. Next, we shall show that $J$ is strong $\mathcal{O}$-monoidal. Let $\phi: X\to Y$ be an active morphism of $\mathcal{O}^{\otimes}$ with $Y\in\mathcal{O}$. Let $C\in \mathcal{C}^{\otimes}_X$. If $X\simeq X_1\oplus\cdots\oplus X_n$, then $C\simeq C_1\oplus\cdots\oplus C_n$, where $C_i\in \mathcal{C}_{X_i}$ for $1\le i\le n$. There is a coCartesian morphism $C\to C'$ of $\mathcal{C}^{\otimes}$ over $\phi$, where $C'\simeq \bigotimes_{\phi}C_i$. By \cite[Proof of Corollary~2.2.6.14]{Lurie2}, we have to show that \[ \alpha: \times\circ (\prod j(C_i)) \longrightarrow j(C')\circ \bigotimes_{\phi} \] exhibits $j(C')$ as a left Kan extension of $\times\circ \prod j(C_i)$ along $\bigotimes_{\phi}$: \[ \xymatrix{ \mathcal{C}_{X_1}^{\rm op}\times\cdots \mathcal{C}_{X_n}^{\rm op} \ar[r]^{\prod j(C_i)} \ar[d]_{\bigotimes_{\phi}}& \mathcal{S}\times\cdots\times \mathcal{S}\ar[r]^-{\times}& \mathcal{S}\\ \mathcal{C}_{Y}^{\rm op}.\ar[rru]_{j(C')}& & \\ }\] This follows from the facts that a left Kan extension of a representable functor is also representable by Yoneda's lemma and that $\times\circ\prod j(C_i)$ is represented by the object $(C_1,\ldots,C_n) \in \mathcal{C}_{X_1}\times\cdots\times\mathcal{C}_{X_n}$. \qed \begin{remark}\label{remark:J-fully-faithful} \rm Note that $J^{\otimes}: \mathcal{C}^{\otimes}\to \mathbb{P}_{\mathcal{O}}(\mathcal{C})^{\otimes}$ is fully faithful. Hence, it induces a fully faithful functor \[ J_*: {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{D},\mathcal{C}) \longrightarrow {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{D},\mathbb{P}_{\mathcal{O}}(\mathcal{C})) \] for any small $\mathcal{O}$-monoidal $\infty$-category $\mathcal{D}$. We also call $J: \mathcal{C}\to \mathbb{P}_{\mathcal{O}}(\mathcal{C})$ the Yoneda embedding. \end{remark} \begin{definition}\rm Suppose that $\mathcal{C}$ and $\mathcal{D}$ are compatible with small colimits in the sense of \cite[Variant~3.1.1.19]{Lurie2}. We denote by \[ {\rm Fun}^{\rm lax,cp}_{\mathcal{O}} (\mathcal{C},\mathcal{D}) \] the full subcategory of ${\rm Fun}^{\rm lax}_{\mathcal{O}}(\mathcal{C},\mathcal{D})$ spanned by those lax $\mathcal{O}$-monoidal functors $f$ such that $f_X: \mathcal{C}_X\to \mathcal{D}_X$ is colimit-preserving for each $X\in\mathcal{O}$. \end{definition} \begin{proposition} \label{prop:presheaf-monoidal-universality} Let $\mathcal{C}$ be a small $\mathcal{O}$-monoidal $\infty$-category, and let $\mathcal{D}$ be an $\mathcal{O}$-monoidal $\infty$-category which is compatible with small colimits. Then the Yoneda embedding $J: \mathcal{C}\to\mathbb{P}_{\mathcal{O}}(\mathcal{C})$ induces an equivalence \[ J^*: {\rm Fun}_{\mathcal{O}}^{\rm lax,cp} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}),\mathcal{D}) \stackrel{\simeq}{\longrightarrow} {\rm Fun}_{\mathcal{O}}^{\rm lax}(\mathcal{C},\mathcal{D}) \] of $\infty$-categories. \end{proposition} In order to prove Proposition~\ref{prop:presheaf-monoidal-universality}, we need the following lemma. \begin{lemma}\label{lemma:cofinal-lemma} Let $\mathcal{C}$ be a small $\mathcal{O}$-monoidal $\infty$-category. For any $X\in\mathcal{O}$ and $G\in {\rm P}(\mathcal{C}_X)$, the inclusion map $(\mathcal{C}_X)_{/G}\hookrightarrow (\mathcal{C}^{\otimes}_{\rm act})_{/G}$ is cofinal. \end{lemma} \proof For an object $\overline{D}=(D,J^{\otimes}(D)\to G)$ of $(\mathcal{C}^{\otimes}_{\rm act})_{/G}$, we set $\mathcal{E}_{\overline{D}}= (\mathcal{C}_X)_{/G}\times_{(\mathcal{C}^{\otimes}_{\rm act})_{/G}} ((\mathcal{C}^{\otimes}_{\rm act})_{/G})_{\overline{D}/}$. By \cite[Theorem~4.1.3.1]{Lurie1}, it suffices to show that $\mathcal{E}_{\overline{D}}$ is weakly contractible for any $\overline{D}$. We shall show that $\mathcal{E}_{\overline{D}}$ has an initial object, which implies that it is weakly contractible. Let $\phi$ be an active morphism in $\mathcal{O}^{\otimes}$ over which $J^{\otimes}(D)\to G$ lies. We take a coCartesian morphism $D\to \phi_!D$ in $\mathcal{C}^{\otimes}$ covering $\phi$. Since $J^{\otimes}: \mathcal{C}^{\otimes}\to \mathbb{P}_{\mathcal{O}}(\mathcal{C})^{\otimes}$ preserves coCartesian morphisms by Lemma~\ref{lemma:Yoneda-embedding-strong-monoidal}, we can factor $J^{\otimes}(D)\to G$ as $J^{\otimes}(D)\to J^{\otimes}(\phi_!D)\to G$. Then we can see that $(D\to \phi_!D, J^{\otimes}(D)\to J^{\otimes}(\phi_!D)\to G)$ is an initial object of $\mathcal{E}_{\overline{D}}$. \qed \proof[Proof of Proposition~\ref{prop:presheaf-monoidal-universality}] By \cite[Proposition~3.1.1.20 and Corollary~3.1.3.4]{Lurie2}, the functor \[ J^*: {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}),\mathcal{D}) \to {\rm Fun}_{\mathcal{O}}^{\rm lax}(\mathcal{C},\mathcal{D}) \] admits a left adjoint $J_!$. Lemma~\ref{lemma:cofinal-lemma} implies that the restriction $J_!(f)_X: \mathbb{P}_{\mathcal{O}}(\mathcal{C})_X \to \mathcal{D}_X$ can be identified with a left Kan extension of $f_X$ along the Yoneda embedding $j: \mathcal{C}_X\to {\rm P}(\mathcal{C}_X)$ for any $X\in\mathcal{O}$. Hence $J_!(f)$ lands in the full subcategory ${\rm Fun}_{\mathcal{O}}^{\rm lax, cp}(\mathbb{P}_{\mathcal{O}} (\mathcal{C}),\mathcal{D})$ and $J^*J_!(f)\simeq f$. In particular, we see that $J_!$ is fully faithful and the essential image is ${\rm Fun}_{\mathcal{O}}^{\rm lax, cp} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}),\mathcal{D})$. This completes the proof. \qed \begin{definition}\rm For $\mathcal{O}$-monoidal $\infty$-categories $\mathcal{C}$ and $\mathcal{D}$, we set \[ {\rm Fun}_{\mathcal{O}}^{\rm oplax}(\mathcal{C},\mathcal{D}) ={\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{C}^{\vee},\mathcal{D}^{\vee})^{\rm op}, \] and call it the $\infty$-category of oplax $\mathcal{O}$-monoidal functors. For $ f \in {\rm Fun}_{\mathcal{O}}^{\rm oplax}(\mathcal{C},\mathcal{D})$, we say that $f$ is left adjoint if $f_X: \mathcal{C}_X\to \mathcal{D}_X$ is left adjoint for all $X\in\mathcal{O}$. We denote by \[ {\rm Fun}^{\rm oplax,L}_{\mathcal{O}}(\mathcal{C},\mathcal{D}) \] the full subcategory of ${\rm Fun}^{\rm oplax}_{\mathcal{O}}(\mathcal{C},\mathcal{D})$ spanned by those oplax $\mathcal{O}$-monoidal functors which are left adjoint. For $f \in {\rm Fun}_{\mathcal{O}}^{\rm lax}(\mathcal{C},\mathcal{D})$, we also say that $f$ is right adjoint if $f_X: \mathcal{C}_X\to \mathcal{D}_X$ is right adjoint for all $X\in\mathcal{O}$. We denote by \[ {\rm Fun}^{\rm lax,R}_{\mathcal{O}}(\mathcal{C},\mathcal{D}) \] the full subcategory of ${\rm Fun}^{\rm lax}_{\mathcal{O}}(\mathcal{C},\mathcal{D})$ spanned by those lax $\mathcal{O}$-monoidal functors which are right adjoint. \end{definition} Note that there is an equivalence \[ {\rm Fun}_{\mathcal{O}}^{\rm oplax, L} (\mathcal{C},\mathcal{D})\simeq {\rm Fun}_{\mathcal{O}}^{\rm lax, R} (\mathcal{C}^{\vee},\mathcal{D}^{\vee})^{\rm op}\] of $\infty$-categories by definition. \begin{definition}\label{def:P-O-upper-star} \rm Let $\mathcal{C}$ and $\mathcal{D}$ be small $\mathcal{O}$-monoidal $\infty$-categories. We define a functor \[ \mathbb{P}_{\mathcal{O},(\mathcal{C},\mathcal{D})}^*: {\rm Fun}_{\mathcal{O}}^{\rm oplax} (\mathcal{C},\mathcal{D})^{\rm op} \longrightarrow {\rm Fun}_{\mathcal{O}}^{\rm lax,cp} (\mathbb{P}_{\mathcal{O}}(\mathcal{D}), \mathbb{P}_{\mathcal{O}}(\mathcal{C})) \] by the following commutative diagram \begin{align}\label{align:definition-P-star} \begin{array}{ccccc} {\rm Fun}_{\mathcal{O}}^{\rm oplax} (\mathcal{C},\mathcal{D})^{\rm op}& \stackrel{\mathbb{P}_{\mathcal{O},(\mathcal{C},\mathcal{D})}^*} {\hbox to 10mm{\rightarrowfill}} &{\rm Fun}_{\mathcal{O}}^{\rm lax,cp} (\mathbb{P}_{\mathcal{O}}(\mathcal{D}), \mathbb{P}_{\mathcal{O}}(\mathcal{C})) &\stackrel{J^*}{\subrel{\simeq}{\hbox to 10mm{\rightarrowfill}}}& {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{D},\mathbb{P}_{\mathcal{O}}(\mathcal{C}))\\ \mbox{$\scriptstyle\simeq$} \bigg\downarrow \phantom{\mbox{$\scriptstyle\simeq$}} & & & & \phantom{\mbox{$\scriptstyle\simeq\hspace{1mm}$}} \bigg\downarrow \mbox{$\scriptstyle\simeq\hspace{1mm}$} \\ {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{C}^{\vee},\mathcal{D}^{\vee}) &\stackrel{J_*}{\hbox to 10mm{\rightarrowfill}}& {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{C}^{\vee}, \mathbb{P}_{\mathcal{O}}(\mathcal{D}^{\vee}))& \stackrel{\simeq}{\hbox to 10mm{\rightarrowfill}}& {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{C}^{\vee}\times_{\mathcal{O}}\mathcal{D}, \mathcal{S}_{\mathcal{O}})\\ \end{array} \end{align} \if0 \begin{align}\label{align:definition-P-star} \begin{array}{ccc} {\rm Fun}_{\mathcal{O}}^{\rm oplax} (\mathcal{C},\mathcal{D})^{\rm op}& \stackrel{\mathbb{P}_{\mathcal{O},(\mathcal{C},\mathcal{D})}^*} {\hbox to 15mm{\rightarrowfill}} &{\rm Fun}_{\mathcal{O}}^{\rm lax,cp} (\mathbb{P}_{\mathcal{O}}(\mathcal{D}), \mathbb{P}_{\mathcal{O}}(\mathcal{C})) \\ \phantom{\mbox{$\scriptstyle\simeq$}} \bigg\downarrow \mbox{$\scriptstyle\simeq$} & & \mbox{$\scriptstyle\simeq\hspace{1mm}$} \bigg\downarrow \mbox{$\scriptstyle J^*$}\\ {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{C}^{\vee},\mathcal{D}^{\vee})&& {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{D},\mathbb{P}_{\mathcal{O}}(\mathcal{C}))\\ \mbox{$\scriptstyle J_*$} \bigg\downarrow \phantom{\mbox{$\scriptstyle J_*$}} & & \mbox{$\scriptstyle\simeq$} \bigg\downarrow \phantom{\mbox{$\scriptstyle \simeq$}}\\ {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{C}^{\vee}, \mathbb{P}_{\mathcal{O}}(\mathcal{D}^{\vee}))& \stackrel{\simeq}{\hbox to 15mm{\rightarrowfill}}& {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{C}^{\vee}\times_{\mathcal{O}}\mathcal{D}, \mathcal{S}_{\mathcal{O}})\\ \end{array} \end{align} \fi in $\wcat$, where the top right horizontal arrow is an equivalence by Proposition~\ref{prop:presheaf-monoidal-universality} and the right vertical and the bottom right horizontal arrows are equivalences by Lemma~\ref{lemma:adjoint-characterization-lax-functor}. Note that $\mathbb{P}_{\mathcal{O},(\mathcal{C},\mathcal{D})}^*$ is fully faithful since $J_*$ is fully faithful by Remark~\ref{remark:J-fully-faithful}. For an oplax $\mathcal{O}$-monoidal functor $f: \mathcal{C}\to \mathcal{D}$, we simply write $f^*$ for $\mathbb{P}_{\mathcal{O},(\mathcal{C},\mathcal{D})}^*(f)$. \end{definition} \begin{proposition} \label{prop:oplax-upper-star-lax-functor} Let $f: \mathcal{C}\to \mathcal{D}$ be an oplax $\mathcal{O}$-monoidal functor between small $\mathcal{O}$-monoidal $\infty$-categories. Then $(f^*)_X$ is equivalent to the functor $(f_X)^*: {\rm P}(\mathcal{D}_X)\to {\rm P}(\mathcal{C}_X)$ for each $X\in\mathcal{O}$. \end{proposition} \proof This follows by restricting diagram~(\ref{align:definition-P-star}) over $X\in\mathcal{O}$. \if0 By Proposition~\ref{prop:presheaf-monoidal-universality}, it suffices to construct a lax $\mathcal{O}$-monoidal functor $g: \mathcal{D}\to \mathbb{P}_{\mathcal{O}}(\mathcal{C})$ such that $g_X$ is equivalent to the functor $(f_X)^*\circ j: \mathcal{D}_X\to {\rm P}(\mathcal{D}_X) \to {\rm P}(\mathcal{C}_X)$ for each $X\in \mathcal{O}$. By definition, $f: \mathcal{C}\to \mathcal{D}$ is oplax $\mathcal{O}$-monoidal if and only if $f^{\vee}: \mathcal{C}^{\vee}\to\mathcal{D}^{\vee}$ is lax $\mathcal{O}$-monoidal. In this case, the composite $J\circ f^{\vee}: \mathcal{C}^{\vee}\to\mathcal{D}^{\vee} \to \mathbb{P}_{\mathcal{O}}(\mathcal{D}^{\vee})$ is lax $\mathcal{O}$-monoidal by Lemma~\ref{lemma:Yoneda-embedding-strong-monoidal}. This implies that $\mathcal{C}^{\vee}\times_{\mathcal{O}}\mathcal{D}\to \mathcal{S}_{\mathcal{O}} $ is lax $\mathcal{O}$-monoidal by Lemma~\ref{lemma:adjoint-characterization-lax-functor}. By Lemma~\ref{lemma:adjoint-characterization-lax-functor} again, we obtain the desired functor $g: \mathcal{D}\to \mathbb{P}_{\mathcal{O}}(\mathcal{C})$. \fi \qed \begin{corollary} \label{cor:oplax-left-lax-right} Let $f: \mathcal{C}\to \mathcal{D}$ be a left adjoint oplax $\mathcal{O}$-monoidal functor between small $\mathcal{O}$-monoidal $\infty$-categories. Then there exists a right adjoint lax $\mathcal{O}$-monoidal functor $f^R: \mathcal{D}\to \mathcal{C}$ such that $(f^R)_X\simeq (f_X)^R$, where $(f_X)^R$ is a right adjoint to $f_X$. In this case we have a commutative diagram \[ \begin{array}{ccc} \mathcal{D} &\stackrel{f^R}{\longrightarrow}& \mathcal{C}\\ \mbox{$\scriptstyle J$} \bigg\downarrow \phantom{\mbox{$\scriptstyle J$}} & & \phantom{\mbox{$\scriptstyle J$}} \bigg\downarrow \mbox{$\scriptstyle J$}\\ \mathbb{P}_{\mathcal{O}}(\mathcal{D}) &\stackrel{f^*}{\longrightarrow}& \mathbb{P}_{\mathcal{O}}(\mathcal{C})\\ \end{array}\] in ${\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)$. \end{corollary} \proof \if0 There is a commutative diagram \[ \begin{array}{ccc} \mathcal{D} & \stackrel{g}{\longrightarrow} & \mathcal{C} \\%[1mm] \mbox{$\scriptstyle J$}\bigg\downarrow \phantom{\mbox{$\scriptstyle J$}} & & \phantom{\mbox{$\scriptstyle J$}} \bigg\downarrow\mbox{$\scriptstyle J$}\\[2mm] \mathbb{P}_{\mathcal{O}}(\mathcal{D})& \stackrel{f^*}{\longrightarrow}& \mathbb{P}_{\mathcal{O}}(\mathcal{C}),\\ \end{array}\] where the vertical arrows are the Yoneda embeddings. \fi By Lemma~\ref{lemma:Yoneda-embedding-strong-monoidal} and Definition~\ref{def:P-O-upper-star}, the composite $f^*\circ J:\mathcal{D}\to \mathbb{P}_{\mathcal{O}}(\mathcal{C})$ is lax $\mathcal{O}$-monoidal. We can regard $\mathcal{C}$ as a full subcategory of $\mathbb{P}_{\mathcal{O}}(\mathcal{C})$ through $J$ by Remark~\ref{remark:J-fully-faithful}. For each $X\in\mathcal{O}$, we have a commutative diagram \[ \begin{array}{ccc} \mathcal{D}_X & \stackrel{(f_X)^R}{\longrightarrow} & \mathcal{C}_X \\%[1mm] \mbox{$\scriptstyle j$} \bigg\downarrow \phantom{\mbox{$\scriptstyle j$}} & & \phantom{\mbox{$\scriptstyle j$}} \bigg\downarrow \mbox{$\scriptstyle j$}\\%[2mm] \mathrm{P}(\mathcal{D}_X)& \stackrel{(f_X)^*}{\longrightarrow}& \mathrm{P}(\mathcal{C}_X),\\ \end{array}\] where the vertical arrows are the Yoneda embeddings. By Lemma~\ref{lemma:Yoneda-embedding-strong-monoidal} and Proposition~\ref{prop:oplax-upper-star-lax-functor}, $f^*\circ J$ factors through $J: \mathcal{C}\to \mathbb{P}_{\mathcal{O}}(\mathcal{C})$, and we obtain the desired lax $\mathcal{O}$-monoidal functor $f^R: \mathcal{D}\to\mathcal{C}$. \qed \if0 Let $\mathcal{C}$ and ${\rm D}$ be large $\mathcal{O}$-monoidal $\infty$-category. We denote by \[ {\rm Fun}_{\mathcal{O}}^{\rm oplax,L}(\mathcal{C},\mathcal{D}) \] the full subcategory of ${\rm Fun}_{\mathcal{O}}^{\rm oplax}(\mathcal{C},\mathcal{D})$ spanned by those oplax $\mathcal{O}$-monoidal functors which admit right adjoints. We also denote by \[ {\rm Fun}_{\mathcal{O}}^{\rm lax,R}(\mathcal{C},\mathcal{D}) \] the full subcategory of ${\rm Fun}_{\mathcal{O}}^{\rm lax}(\mathcal{C},\mathcal{D})$ spanned by those lax $\mathcal{O}$-monoidal functors which admit left adjoints. \fi \bigskip \begin{remark}\rm Let $f: \mathcal{C}\to\mathcal{D}$ be a right adjoint lax $\mathcal{O}$-monoidal functor between small $\mathcal{O}$-monoidal $\infty$-categories. Then $f^{\vee}: \mathcal{C}^{\vee}\to\mathcal{D}^{\vee}$ is a left adjoint oplax $\mathcal{O}$-monoidal functor. By Corollary~\ref{cor:oplax-left-lax-right}, we have a right adjoint lax $\mathcal{O}$-monoidal functor $(f^{\vee})^R: \mathcal{D}^{\vee}\to\mathcal{C}^{\vee}$. We set $f^L=((f^{\vee})^R)^{\vee}: \mathcal{D}\to \mathcal{C}$. Then $f^L$ is a left adjoint oplax $\mathcal{O}$-monoidal functor such that $(f^L)_X\simeq (f_X)^L$, where $(f_X)^L: \mathcal{D}_X\to \mathcal{C}_X$ is a left adjoint to $f_X: \mathcal{C}_X\to\mathcal{D}_X$. \end{remark} \begin{definition}\label{def:P-O-shriek} \rm Let $\mathcal{C}$ and $\mathcal{D}$ be small $\mathcal{O}$-monoidal $\infty$-categories. We define a functor \[ \mathbb{P}_{\mathcal{O}!,(\mathcal{C},\mathcal{D})}: {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{C},\mathcal{D}) \longrightarrow {\rm Fun}_{\mathcal{O}}^{\rm lax,cp} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}), \mathbb{P}_{\mathcal{O}}(\mathcal{D})) \] by the following commutative diagram \[ \xymatrix{ {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{C},\mathcal{D}) \ar[rr]^{\mathbb{P}_{\mathcal{O}!,(\mathcal{C},\mathcal{D})}} \ar[dr]_{J_*} && {\rm Fun}_{\mathcal{O}}^{\rm lax,cp} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}), \mathbb{P}_{\mathbb{O}}(\mathcal{D})) \ar[dl]^{J^*}\\ & {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{C}, \mathbb{P}_{\mathcal{O}}(\mathcal{D}))&\\ }\] in $\wcat$, where the right vertical arrow is an equivalence by Proposition~\ref{prop:presheaf-monoidal-universality}. Note that $\mathbb{P}_{\mathcal{O}!,(\mathcal{C},\mathcal{D})}$ is fully faithful since $J_*$ is fully faithful by Remark~\ref{remark:J-fully-faithful}. For a lax $\mathcal{O}$-monoidal functor $f: \mathcal{C}\to \mathcal{D}$, we simply write $f_!$ for $\mathbb{P}_{\mathcal{O}!,(\mathcal{C},\mathcal{D})}(f)$. \end{definition} \begin{remark}\label{remark:f-shriek-characterization} \rm Let $f: \mathcal{C}\to \mathcal{D}$ be a lax $\mathcal{O}$-monoidal functor between small $\mathcal{O}$-monoidal $\infty$-categories. By construction, we have a commutative diagram \[ \begin{array}{ccc} \mathcal{C} &\stackrel{f}{\longrightarrow}& \mathcal{D}\\ \mbox{$\scriptstyle J$} \bigg\downarrow \phantom{\mbox{$\scriptstyle J$}} && \phantom{\mbox{$\scriptstyle J$}} \bigg\downarrow \mbox{$\scriptstyle J$}\\ \mathbb{P}_{\mathcal{O}}(\mathcal{C}) &\stackrel{f_!}{\longrightarrow}& \mathbb{P}_{\mathcal{O}}(\mathcal{D})\\ \end{array}\] in ${\rm Mon}^{\rm lax}(\wcat)$. \end{remark} \begin{lemma}\label{lemma:star-R-shriek-R} Let $\mathcal{C}$ and $\mathcal{D}$ be small $\mathcal{O}$-monoidal $\infty$-categories. If $f: \mathcal{D}\to \mathcal{C}$ is a left adjoint oplax $\mathcal{O}$-monoidal functor, then we have an equivalence $f^* \simeq (f^R)_!$ in ${\rm Fun}_{\mathcal{O}}^{\rm lax,cp} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}), \mathbb{P}_{\mathcal{O}}(\mathcal{D}))$. Dually, if $g: \mathcal{C}\to\mathcal{D}$ is a right adjoint lax $\mathcal{O}$-monoidal functor, then we have $(g^L)^*\simeq g_!$. \end{lemma} \proof The Yoneda embedding induces an equivalence of $\infty$-categories ${\rm Fun}_{\mathcal{O}}^{\rm lax,cp} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}), \mathbb{P}_{\mathcal{O}}(\mathcal{D})) \stackrel{\simeq}{\to} {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{C},\mathbb{P}_{\mathcal{O}}(\mathcal{D}))$ by Proposition~\ref{prop:presheaf-monoidal-universality}. If $f$ is a left adjoint oplax $\mathcal{O}$-monoidal functor, then Corollary~\ref{cor:oplax-left-lax-right} and Remark~\ref{remark:f-shriek-characterization} imply that $f^*\circ J\simeq J\circ f^R\simeq (f^R)_!\circ J$ in ${\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{C},\mathbb{P}_{\mathcal{O}}(\mathcal{D}))$. Hence $f^*\simeq (f^R)_!$. If $g$ is a right adjoint lax $\mathcal{O}$-monoidal functor, then we have $(g^L)^*\simeq ((g^L)^R)_!\simeq g_!$. \qed \if0 \begin{remark}\rm If $f: \mathcal{C}\to \mathcal{D}$ is a right adjoint lax $\mathcal{O}$-monoidal functor between $\mathcal{O}$-monoidal $\infty$-categories, then we have $(f^L)^*\simeq ((f^L)^R)_!\simeq f_!$ by Lemma~\ref{lemma:star-R-shriek-R}. \end{remark} \fi \begin{proposition}\label{prop:lax-oplax-duality-two-objects} Let $\mathcal{C}$ and $\mathcal{D}$ be small $\mathcal{O}$-monoidal $\infty$-categories. There is a natural equivalence \[ D_{(\mathcal{C},\mathcal{D})} : {\rm Fun}_{\mathcal{O}}^{\rm oplax, L} (\mathcal{C},\mathcal{D})^{\rm op} \stackrel{\simeq}{\longrightarrow} {\rm Fun}_{\mathcal{O}}^{\rm lax,R} (\mathcal{D},\mathcal{C}) \] of $\infty$-categories, which makes the following diagram commute \[ \xymatrix{ {\rm Fun}_{\mathcal{O}}^{\rm oplax, L} (\mathcal{C},\mathcal{D})^{\rm op} \ar[rr]^{D_{(\mathcal{C},\mathcal{D})}} \ar[dr]_{\mathbb{P}_{\mathcal{O},(\mathcal{C},\mathcal{D})}^*} && {\rm Fun}_{\mathcal{O}}^{\rm lax,R} (\mathcal{D},\mathcal{C}) \ar[dl]^{\hspace{5mm} \mathbb{P}_{\mathcal{O}!,(\mathcal{C},\mathcal{D})}}\\ &{\rm Fun}_{\mathcal{O}}^{\rm lax,cp} (\mathbb{P}_{\mathcal{O}}(\mathcal{D}), \mathbb{P}_{\mathcal{O}}(\mathcal{C})).& }\] in $\wcat$. The functor $D_{(\mathcal{C},\mathcal{D})}$ associates to a left adjoint oplax $\mathcal{O}$-monoidal functor $f$ its right adjoint lax $\mathcal{O}$-monoidal functor $f^R$. \end{proposition} \proof Since $\mathbb{P}_{\mathcal{O},(\mathcal{C},\mathcal{D})}^*$ and $\mathbb{P}_{\mathcal{O}!,(\mathcal{C},\mathcal{D})}$ are fully faithful, it suffices to show that the essential images are the same for the existence of the equivalence $D_{(\mathcal{C},\mathcal{D})}$. This follows from Lemma~\ref{lemma:star-R-shriek-R}. We also obtain the last part by Lemma~\ref{lemma:star-R-shriek-R}. \if0 We consider the $\infty$-category ${\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{D}\times_{\mathcal{O}}\mathcal{C}^{\vee}, \mathcal{S}_{\mathcal{O}} )$. We denote by \[ {\rm Fun}_{\mathcal{O}}^{\rm lax,LRep} (\mathcal{D}\times_{\mathcal{O}}\mathcal{C}^{\vee}, \mathcal{S}_{\mathcal{O}} ) \] the full subcategory of ${\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{D}\times_{\mathcal{O}}\mathcal{C}^{\vee}, \mathcal{S}_{\mathcal{O}} )$ spanned by those lax $\mathcal{O}$-monoidal functors $F:\mathcal{D}\times_{\mathcal{O}} \mathcal{C}^{\vee}\to \mathcal{S}_{\mathcal{O}} $ whose adjoint $\mathcal{D}\to \mathbb{P}_{\mathcal{O}}(\mathcal{C})$ factors through the Yoneda embedding $J: \mathcal{C}\to \mathbb{P}_{\mathcal{O}}(\mathcal{C})$. By Lemma~\ref{lemma:adjoint-characterization-lax-functor} and Remark~\ref{remark:J-fully-faithful}, the Yoneda embedding $J: \mathcal{C}\to \mathbb{P}_{\mathcal{O}}(\mathcal{C})$ induces a fully faithful functor \[ {\rm Fun}_{\mathcal{O}}^{\rm lax}(\mathcal{D},\mathcal{C}) \longrightarrow {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{D},\mathbb{P}_{\mathcal{O}}(\mathcal{C})) \simeq {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{D}\times_{\mathcal{O}}\mathcal{C}^{\vee}, \mathcal{S}_{\mathcal{O}}).\] Since the essential image is ${\rm Fun}_{\mathcal{O}}^{\rm lax,LRep} (\mathcal{D}\times_{\mathcal{O}}\mathcal{C}^{\vee}, \mathcal{S}_{\mathcal{O}})$, we obtain an equivalence \[ {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{D},\mathcal{C}) \stackrel{\simeq}{\longrightarrow} {\rm Fun}_{\mathcal{O}}^{\rm lax,LRep} (\mathcal{D}\times_{\mathcal{O}}\mathcal{C}^{\vee}, \mathcal{S}_{\mathcal{O}}).\] \if0 there is an equivalence \[ {\rm Fun}_{\mathcal{O}}^{\rm lax,LRep} (\mathcal{D}\times_{\mathcal{O}}\mathcal{C}^{\vee}, {\mathcal{S}_{\mathcal{O}}} ) \simeq {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{D},\mathcal{C}) \] of $\infty$-categories. \fi We denote by \[ {\rm Fun}_{\mathcal{O}}^{\rm lax, BRep} (\mathcal{D}\times_{\mathcal{O}} \mathcal{C}^{ \vee}, {\mathcal{S}_{\mathcal{O}}} ) \] the full subcategory of ${\rm Fun}_{\mathcal{O}}^{\rm lax,LRep} (\mathcal{D}\times_{\mathcal{O}}\mathcal{C}^{\vee}, {\mathcal{S}_{\mathcal{O}}} )$ spanned by those functors $F: \mathcal{D}\times_{\mathcal{O}}\mathcal{C}^{\vee}\to {\mathcal{S}_{\mathcal{O}}} $ whose adjoint $\mathcal{C}^{\vee}\to \mathbb{P}_{\mathcal{O}}(\mathcal{D}^{\vee})$ factors through the Yoneda embedding $J: \mathcal{D}^{\vee}\to \mathbb{P}_{\mathcal{O}}(\mathcal{D}^{\vee})$. Note that there is an equivalence \[ {\rm Fun}_{\mathcal{O}}^{\rm lax,BRep} (\mathcal{D}\times_{\mathcal{O}}\mathcal{C}^{\vee}, {\mathcal{S}_{\mathcal{O}}} ) \simeq {\rm Fun}_{\mathcal{O}}^{\rm lax,R} (\mathcal{D},\mathcal{C}). \] Similarly, we have equivalences \[ {\rm Fun}_{\mathcal{O}}^{\rm lax,LRep} (\mathcal{C}^{\vee}\times_{\mathcal{O}}\mathcal{D}, {\mathcal{S}_{\mathcal{O}}} ) \simeq {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{C}^{\vee},\mathcal{D}^{\vee}). \] and \[ {\rm Fun}_{\mathcal{O}}^{\rm lax,BRep} (\mathcal{C}^{\vee}\times_{ \mathcal{O} } \mathcal{D}, {\mathcal{S}_{\mathcal{O}}} ) \simeq {\rm Fun}_{\mathcal{O}}^{\rm lax, R} (\mathcal{C}^{\vee},\mathcal{D}^{\vee}). \] Since ${\rm Fun}_{\mathcal{O}}^{\rm lax, R} (\mathcal{C}^{\vee},\mathcal{D}^{\vee}) \simeq {\rm Fun}_{\mathcal{O}}^{\rm oplax, L} (\mathcal{C},\mathcal{D})^{\rm op}$, we obtain the desired equivalence. \fi \qed \if0 \begin{remark}\rm The equivalence in Proposition~\ref{prop:lax-oplax-duality-two-objects} associates to a left adjoint oplax $\mathcal{O}$-monoidal functor its right adjoint lax $\mathcal{O}$-monoidal functor. \end{remark} \fi \section{Presheaf functors} \label{section:presheaf-functor} In this section we study monoidal functorialities of the construction $\mathbb{P}_{\mathcal{O}}(\mathcal{C})$ from a small $\mathcal{O}$-monoidal $\infty$-category $\mathcal{C}$. \subsection{Contravariant functor $\mathbb{P}_{\mathcal{O}}^{*}$} \if0 In this subsection we will construct a functor $\mathbb{P}_{\mathcal{O}}^*: {\rm Cat}_{\infty}^{\rm op}\to {\rm Pr}^{\rm L}$, which assigns to $\mathcal{C}\in{\rm Cat}_{\infty}$ the $\infty$-category $\mathbb{P}_{\mathcal{O}}(\mathcal{C})$. There is a functor \[ \mathbf{Map}_{\wcat}: \wcat^{\rm op} \times\wcat \longrightarrow\wcat, \] which associates to $(\mathcal{C},\mathcal{D})\in \wcat^{\rm op}\times\wcat$ the functor $\infty$-category ${\rm Fun}(\mathcal{C},\mathcal{D})\in\wcat$. By restricting the functor $\mathbf{Map}_{\wcat}(-,\mathcal{S}): \widehat{\rm Cat}_{\infty}^{\rm op}\to\widehat{\rm Cat}_{\infty}$ to the full subcategory $\cat$, we obtain a functor \[ \mathbb{P}_{\mathcal{O}}^*:\cat^{\rm op}\longrightarrow \wcat,\] which associates to a small $\infty$-category $\mathcal{C}$ the $\infty$-category $\mathbb{P}_{\mathcal{O}}(\mathcal{C})$ of presheaves on $\mathcal{C}$, and to a functor $f: \mathcal{C}\to \mathcal{D}$ of small $\infty$-categories the induced functor \[ \mathbb{P}_{\mathcal{O}}^*(f)=f^*: \mathbb{P}_{\mathcal{O}}(\mathcal{D})\longrightarrow \mathbb{P}_{\mathcal{O}}(\mathcal{C}),\] which is obtained by composition with $f^{\rm op}$. \fi There is a functor \[ \mathrm{P}^*:\cat^{\rm op}\longrightarrow {\rm Pr}^{\rm L},\] which associates to a small $\infty$-category $\mathcal{C}$ the $\infty$-category $\mathrm{P}(\mathcal{C})$ of presheaves on $\mathcal{C}$, and to a functor $f:\mathcal{C}\to\mathcal{D}$ the functor $f^*: \mathrm{P}(\mathcal{D}) \to\mathrm{P}(\mathcal{C})$ that is obtained by composing with $f^{\rm op}$. In this subsection we will construct a functor \[ \mathbb{P}_{\mathcal{O}}^{*}: {\rm Mon}_{\mathcal{O}}^{ \rm oplax } (\cat)^{\rm op} \longrightarrow {\rm Mon}_{\mathcal{O}}^{\rm lax} ({\rm Pr}^{\rm L}) \] which is a lifting of the functor $\mathrm{P}^*$. First, we consider the composite of functors \[ F_{\mathcal{O}}^*: {\rm Mon}_{\mathcal{O}}^{\rm oplax}(\cat)^{\rm op} \stackrel{\simeq}{\longrightarrow} {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)^{\rm op} \stackrel{}{\longrightarrow} {\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat), \] where the first arrow is an equivalence given by $\mathcal{C}\mapsto \mathcal{C}^{\vee}$ and the second arrow is given by $\mathcal{C}\mapsto {\rm Fun}^{\mathcal{O}} (\mathcal{C},\mathcal{S}_{\mathcal{O}}) =\mathbb{P}_{\mathcal{O}}(\mathcal{C}^{\vee})$. We note that $F_{\mathcal{O}}^*$ assigns $\mathbb{P}_{\mathcal{O}}(\mathcal{C})$ to a small $\mathcal{O}$-monoidal $\infty$-category $\mathcal{C}$. For any oplax $\mathcal{O}$-monoidal functor $f: \mathcal{C}\to \mathcal{D}$, the restriction of $F_{\mathcal{O}}^*(f): \mathbb{P}_{\mathcal{O}}(\mathcal{D}) \to \mathbb{P}_{\mathcal{O}}(\mathcal{C})$ over $X\in\mathcal{O}$ is equivalent to $(f_X)^*: {\rm P}(\mathcal{D}_X)\to {\rm P}(\mathcal{C}_X)$. Since $(f_X)^*$ admits a right adjoint $(f_X)_*$, the functor $F_{\mathcal{O}}^*$ factors through ${\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})$. Hence we obtain the desired functor $\mathbb{P}_{\mathcal{O}}^*$ For small $\mathcal{O}$-monoidal $\infty$-categories $\mathcal{C}$ and $\mathcal{D}$, the functor $\mathbb{P}_{\mathcal{O}}^*$ induces a functor \[ {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm oplax}(\cat)} (\mathcal{C},\mathcal{D}) \longrightarrow {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})} (\mathbb{P}_{\mathcal{O}}(\mathcal{D}), \mathbb{P}_{\mathcal{O}}(\mathcal{C})) \] of mapping spaces. We notice that it is equivalent to the functor obtained from $\mathbb{P}_{\mathcal{O},(\mathcal{C},\mathcal{D})}^*$ in Definition~\ref{def:P-O-upper-star} by taking core. \if0 This follows from the following commutative diagram \[ \begin{array}{ccc} {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm oplax}(\cat)} (\mathcal{C},\mathcal{D})& \stackrel{M_{\mathcal{O},(\mathcal{C},\mathcal{D})}^*} {\hbox to 15mm{\rightarrowfill}} &{\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax} ({\rm Pr}^{\rm L})} (\mathbb{P}_{\mathcal{O}}(\mathcal{D}), \mathbb{P}_{\mathcal{O}}(\mathcal{C})) \\ \phantom{\mbox{$\scriptstyle\simeq$}} \bigg\downarrow \mbox{$\scriptstyle\simeq$} & & \mbox{$\scriptstyle\simeq\hspace{1mm}$} \bigg\downarrow \mbox{$\scriptstyle J^*$}\\ {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)} (\mathcal{C}^{\vee},\mathcal{D}^{\vee})&& {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{D},\mathbb{P}_{\mathcal{O}}(\mathcal{C}))\\ \mbox{$\scriptstyle J_*$} \bigg\downarrow \phantom{\mbox{$\scriptstyle J_*$}} & & \mbox{$\scriptstyle\simeq$} \bigg\downarrow \phantom{\mbox{$\scriptstyle \simeq$}}\\ {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{C}^{\vee}, \mathbb{P}_{\mathcal{O}}(\mathcal{D}^{\vee}))& \stackrel{\simeq}{\hbox to 15mm{\rightarrowfill}}& {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{C}^{\vee}\times_{\mathcal{O}}\mathcal{D}, \mathcal{S}_{\mathcal{O}})\\ \end{array}\] in $\widehat{\mathcal{S}}$, which is obtained by the definition of $\mathbb{P}_{\mathcal{O}}^*$ and Lemma~\ref{lemma:adjoint-characterization-lax-functor}. \fi Hence we obtain the following proposition. \if0 Since ${\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)$ has finite products, we have a functor \[ {\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)\times {\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)\longrightarrow {\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat),\] which is given by Cartesian products. By composing with the mapping space functor \[ {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (-, \mathcal{S}_{\mathcal{O}} ): {\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)^{\rm op} \longrightarrow \widehat{\mathcal{S}},\] we obtain a functor \[ {\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)^{\rm op}\times {\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)^{\rm op}\longrightarrow \widehat{\mathcal{S}}.\] By restriction, we obtain a functor \[ \chi: {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)^{\rm op}\times {\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)^{\rm op}\longrightarrow \widehat{\mathcal{S}},\] which is given by \[ (\mathcal{C},\mathcal{D})\mapsto {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{C}\times_{\mathcal{O}}\mathcal{D}, \mathcal{S}_{\mathcal{O}} ).\] We let \[ \mathcal{M}\longrightarrow {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)\times {\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat) \] be the associated right fibration, which we regard as a paring of $\infty$-categories. \begin{lemma} \label{lemma:Day-convolution-pairing-left-representable} The pairing $\mathcal{M}\to {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)\times {\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)$ is left representable. \end{lemma} \proof Let $\mathcal{C}\in {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)$. We denote by \[ \chi_{\mathcal{C}}: {\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)^{\rm op} \longrightarrow \widehat{\mathcal{S}} \] the functor given by \[ \mathcal{D}\mapsto {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{C}\times_{\mathcal{O}}\mathcal{D}, \mathcal{S}_{\mathcal{O}} ). \] We have to show that $\chi_{\mathcal{C}}$ is representable for any $\mathcal{C}\in {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)$. By Lemma~\ref{lemma:adjoint-characterization-lax-functor}, there is an equivalence \[ {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{C}\times_{\mathcal{O}}\mathcal{D},\mathcal{S}) \simeq {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{D},\mathbb{P}_{\mathcal{O}}(\mathcal{C}^{\vee})) \] of mapping spaces. This means that $\chi_{\mathcal{C}}$ is represented by the $\mathcal{O}$-monoidal $\infty$-category $\mathbb{P}_{\mathcal{O}}(\mathcal{C}^{\vee})$. \qed \bigskip By Lemma~\ref{lemma:Day-convolution-pairing-left-representable}, we obtain a functor \[ M: {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)^{\rm op} \longrightarrow {\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat),\] which is given by $\mathcal{C}\mapsto \mathbb{P}_{\mathcal{O}}(\mathcal{C}^{\vee})$. There is an equivalence \[ {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat) \simeq {\rm Mon}_{\mathcal{O}}^{\rm oplax}(\cat) \] of large $\infty$-categories, which is given by assigning to an $\mathcal{O}$-monoidal $\infty$-category its opposite $\mathcal{O}$-monoidal $\infty$-category. We define a functor \[ \mathbb{P}_{\mathcal{O}}^{*}: {\rm Mon}_{\mathcal{O}}^{\rm oplax}(\cat)^{\rm op} \longrightarrow {\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)\] to be the following composition of functors \[ {\rm Mon}_{\mathcal{O}}^{\rm oplax}(\cat)^{\rm op} \stackrel{\simeq}{\longrightarrow} {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)^{\rm op} \stackrel{M}{\longrightarrow} {\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat).\] For an $\mathcal{O}$-monoidal $\infty$-category $\mathcal{C}$, we have \[ \mathbb{P}_{\mathcal{O}}^{*}(\mathcal{C})= \mathbb{P}_{\mathcal{O}}(\mathcal{C}). \] For an oplax $\mathcal{O}$-monoidal functor $f: \mathcal{C}\to \mathcal{D}$, we have a lax $\mathcal{\mathcal{O}}$-monoidal functor \[ \mathbb{P}_{\mathcal{O}}^{*}(f)= f^*: \mathbb{P}_{\mathcal{O}}(\mathcal{D})\longrightarrow \mathbb{P}_{\mathcal{O}}(\mathcal{C}). \] Since $(f^*)_X\simeq (f_X)^*: {\rm P}(\mathcal{D}_X) \to {\rm P}(\mathcal{C}_X)$ admits a right adjoint $(f_X)_*$ for any $X\in\mathcal{O}$, the functor $P$ factors through ${\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})$. \fi \begin{proposition} \label{prop:P-star-monoidal} There is a functor \[ \mathbb{P}_{\mathcal{O}}^{*}: {\rm Mon}_{\mathcal{O}}^{\rm oplax}(\cat)^{\rm op} \longrightarrow {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L}),\] which associates to a small $\mathcal{O}$-monoidal $\infty$-category $\mathcal{C}$ the $\mathcal{O}$-monoidal $\infty$-category $\mathbb{P}_{\mathcal{O}}(\mathcal{C})$, and to an oplax $\mathcal{O}$-monoidal functor $f: \mathcal{C}\to \mathcal{D}$ the lax $\mathcal{O}$-monoidal functor $f^*: \mathbb{P}_{\mathcal{O}}(\mathcal{D})\to \mathbb{P}_{\mathcal{O}}(\mathcal{C})$. \end{proposition} \if0 \proof For small $\mathcal{O}$-monoidal $\infty$-categories $\mathcal{C}$ and $\mathcal{D}$, the functor $\mathbb{P}_{\mathcal{O}}^*$ induces a functor \[ F: {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm oplax}(\cat)} (\mathcal{C},\mathcal{D}) \longrightarrow {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}), \mathbb{P}_{\mathcal{O}}(\mathcal{D})) \] of mapping spaces. We have to prove that it is equivalent to the map induced by the functor $\mathbb{P}_{\mathcal{O}}^*: {\rm Fun}_{\mathcal{O}}^{\rm oplax}(\mathcal{C},\mathcal{D})^{\rm op} \to {\rm Fun}_{\mathcal{O}}^{\rm lax,cp} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}), \mathbb{P}_{\mathcal{O}}(\mathcal{D}))$. We can verify that the following diagram is commutative \[ \begin{array}{ccc} {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm oplax}(\cat)} (\mathcal{C},\mathcal{D})& \stackrel{F}{\longrightarrow} &{\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax} ({\rm Pr}^{\rm L})} (\mathbb{P}_{\mathcal{O}}(\mathcal{D}), \mathbb{P}_{\mathcal{O}}(\mathcal{C})) \\ \phantom{\mbox{$\scriptstyle\simeq$}} \bigg\downarrow \mbox{$\scriptstyle\simeq$} & & \mbox{$\scriptstyle\simeq\hspace{1mm}$} \bigg\downarrow \mbox{$\scriptstyle J^*$}\\ {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)} (\mathcal{C}^{\vee},\mathcal{D}^{\vee})&& {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{D},\mathbb{P}_{\mathcal{O}}(\mathcal{C}))\\ \mbox{$\scriptstyle J_*$} \bigg\downarrow \phantom{\mbox{$\scriptstyle J_*$}} & & \mbox{$\scriptstyle\simeq$} \bigg\downarrow \phantom{\mbox{$\scriptstyle \simeq$}}\\ {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{C}^{\vee}, \mathbb{P}_{\mathcal{O}}(\mathcal{D}^{\vee}))& \stackrel{\simeq}{\longrightarrow}& {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{C}^{\vee}\times_{\mathcal{O}}\mathcal{D}, \mathcal{S}_{\mathcal{O}}).\\ \end{array}\] This completes the proof. \qed \fi \if0 \subsection{Construction of the covariant functor $\mathbb{P}_{\mathcal{O}!}$} \label{subsection:construction-functor-cat-wcat} In this subsection we will construct a functor $\mathbb{P}_{\mathcal{O}!}: {\rm Cat}_{\infty}\to {\rm Pr}^{\rm L}$, which assigns to $\mathcal{C}\in{\rm Cat}_{\infty}$ the $\infty$-category $\mathbb{P}_{\mathcal{O}}(\mathcal{C})$. Let $\mathcal{E}'$ be the full subcategory of the functor $\infty$-category ${\rm Fun}(\Delta^1,\wcat)$ spanned by those functors $F:\mathcal{C}\to \mathcal{X}$, where $\mathcal{C}$ is a small $\infty$-category and $\mathcal{X}$ is a presentable $\infty$-category such that the induced functor $\mathbb{P}_{\mathcal{O}}(\mathcal{C})\to\mathcal{X}$ is an equivalence. By restricting the evaluation functor at $1\in\Delta^1$, we obtain a functor $\mathcal{E}'\to\wcat$. We define a subcategory $\mathcal{E}$ of $\mathcal{E}'$ by the following pullback diagram \[ \begin{array}{ccc} \mathcal{E} & \longrightarrow & \mathcal{E}'\\[1mm] \bigg\downarrow & & \bigg\downarrow\\[4mm] {\rm Pr}^{\rm L} & \longrightarrow & \wcat. \\ \end{array}\] Note that we have a functor ${\rm ev}_1: \mathcal{E}\longrightarrow {\rm Pr}^{\rm L}$ by construction. The evaluation functor at $0\in\Delta^1$ induces a functor ${\rm ev}_0: \mathcal{E}\to\cat$. \begin{lemma}\label{lemma:ev0-E-to-cat-eq} The functor ${\rm ev}_0: \mathcal{E}\to\cat$ is an equivalence of $\infty$-categories. \end{lemma} \proof It is easy to see that the functor is essentially surjective. We will show that it is fully faithful. Let $(p: \mathcal{C}\to\mathcal{X}),(q: \mathcal{D}\to\mathcal{Y}) \in\mathcal{E}$. We have a commutative diagram \begin{align}\label{align:fun-delta-1-commutagive-diagram} \begin{array}{ccccc} {\rm Map}_{\mathcal{E}} (p,q) & \longrightarrow & {\rm Map}_{\mathcal{E}'} (p,q) & \longrightarrow & {\rm Map}_{\cat}(\mathcal{C},\mathcal{D})\\[1mm] \bigg\downarrow & & \bigg\downarrow & & \phantom{\mbox{$\scriptstyle q_*$}} \bigg\downarrow \mbox{$\scriptstyle q_*$} \\[2mm] {\rm Map}_{{\rm Pr}^{\rm L}}(\mathcal{X},\mathcal{Y}) & \longrightarrow & {\rm Map}_{\wcat}(\mathcal{X},\mathcal{Y}) & \stackrel{p^*}{\longrightarrow} & {\rm Map}_{\wcat}(\mathcal{C},\mathcal{Y}).\\ \end{array} \end{align} The left square is a pullback diagram by the definition of $\mathcal{E}$. We will show that the right square is also a pullback diagram. We have an adjunction \[ {\rm colim}: {\rm Fun}(\Delta^1,\widehat{\rm Cat}_{\infty}) \rightleftarrows \widehat{\rm Cat}_{\infty}:d,\] where ${\rm colim}$ is the colimit functor and $d$ is the diagonal functor. We can identify ${\rm colim}$ with the evaluation functor ${\rm ev}_1$ at $1\in \Delta^1$. By the adjunction $({\rm colim},d)$, we obtain an equivalence \begin{align}\label{align:equivalence-mapping-spaces} {\rm Map}_{{\rm Fun}(\Delta^1,\widehat{\rm Cat}_{\infty})} (p,{\rm id}_{\mathcal{Y}}) \simeq {\rm Map}_{\widehat{\rm Cat}_{\infty}}(\mathcal{X},\mathcal{Y}) \end{align} of mapping spaces. By \cite[Corollary~2.4.7.12]{Lurie1}, the evaluation functor ${\rm ev}_0: {\rm Fun}(\Delta^1,\widehat{\rm Cat}_{\infty}) \to \widehat{\rm Cat}_{\infty}$ is a Cartesian fibration. The commutative diagram \[ \begin{array}{ccc} \mathcal{D}& \stackrel{q}{\longrightarrow} & \mathcal{Y}\\ \mbox{$\scriptstyle q$} \bigg\downarrow \phantom{\mbox{$\scriptstyle q$}} & & \phantom{\mbox{$\scriptstyle\rm id$}} \bigg\downarrow \mbox{$\scriptstyle\rm id$} \\ \mathcal{Y} & \stackrel{\rm id}{\longrightarrow}& \mathcal{Y} \end{array}\] in $\widehat{\rm Cat}_{\infty}$ determines a morphism $(q: \mathcal{D}\to \mathcal{Y}) \to ({\rm id}_{\mathcal{Y}}: \mathcal{Y}\to\mathcal{Y})$ in ${\rm Fun}(\Delta^1,\widehat{\rm Cat}_{\infty})$, which is a Cartesian morphism by \cite[Corollary~2.4.7.12]{Lurie1}. By \cite[Proposition~2.4.4.3]{Lurie1} and equivalence~(\ref{align:equivalence-mapping-spaces}), we see that the right square in diagram~(\ref{align:fun-delta-1-commutagive-diagram}) is a pullback diagram. The composite of the bottom arrows in commutative diagram (\ref{align:fun-delta-1-commutagive-diagram}) is an equivalence since $\mathbb{P}_{\mathcal{O}}(\mathcal{C})\to \mathcal{X}$ is an equivalence. Hence the composite of the top arrows is also an equivalence. Therefore, the functor $\mathcal{E}\to\cat$ is fully faithful. This completes the proof. \qed \bigskip We have a diagram \[ \cat\stackrel{{\rm ev}_0}{\longleftarrow} \mathcal{E}\stackrel{{\rm ev}_1}{\longrightarrow} {\rm Pr}^{\rm L},\] where the left arrow is an equivalence by Lemma~\ref{lemma:ev0-E-to-cat-eq}. Hence we obtain a functor \[ \mathbb{P}_{\mathcal{O}!}: \cat\longrightarrow {\rm Pr}^{\rm L},\] which associates to a small $\infty$-category $\mathcal{C}$ the $\infty$-category $\mathbb{P}_{\mathcal{O}}(\mathcal{C})$ of presheaves on $\mathcal{C}$. For a functor $f: \mathcal{C}\to \mathcal{D}$ of $\infty$-categories, we obtain an induced functor \[ \mathbb{P}_{\mathcal{O}!}(f)=f_!: \mathbb{P}_{\mathcal{O}}(\mathcal{C})\longrightarrow \mathbb{P}_{\mathcal{O}}(\mathcal{D}),\] which is a left Kan extension of the composite $j\circ f: \mathcal{C}{\to}\mathcal{D} {\to} \mathbb{P}_{\mathcal{O}}(\mathcal{D})$ along $j:\mathcal{C}\to\mathbb{P}_{\mathcal{O}}(\mathcal{C})$. In summary we obtain the following proposition. \begin{proposition} \label{prop:construction-functor-cat-wcat} There is a functor \[ \mathbb{P}_{\mathcal{O}!}: \cat\longrightarrow {\rm Pr}^{\rm L},\] which associates to a small $\infty$-category $\mathcal{C}$ the $\infty$-category $\mathbb{P}_{\mathcal{O}}(\mathcal{C})$ of presheaves on $\mathcal{C}$, and to a functor $f: \mathcal{C}\to \mathcal{D}$ of $\infty$-categories the induced functor \[ \mathbb{P}_{\mathcal{O}!}(f)=f_!: \mathbb{P}_{\mathcal{O}}(\mathcal{C})\longrightarrow \mathbb{P}_{\mathcal{O}}(\mathcal{D}),\] which is a left Kan extension of the composite $j\circ f: \mathcal{C}{\to}\mathcal{D} {\to} \mathbb{P}_{\mathcal{O}}(\mathcal{D})$ along $j:\mathcal{C}\to\mathbb{P}_{\mathcal{O}}(\mathcal{C})$. \end{proposition} \fi \if0 Proposition~\ref{prop:P-star-monoidal} induces a map \[ {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op}} (\mathcal{C},\mathcal{D}) \longrightarrow {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}), \mathbb{P}_{\mathcal{O}}(\mathcal{D})) \] of mapping spaces for small $\mathcal{O}$-monoidal $\infty$-categories $\mathcal{C},\mathcal{D}$. \begin{lemma} Let $\mathcal{C}$ and $\mathcal{D}$ be small $\mathcal{O}$-monoidal $\infty$-categories. The functor $\mathbb{P}_{\mathcal{O}}^*: {\rm Fun}_{\mathcal{O}}^{\rm oplax,L}(\mathcal{D},\mathcal{C})^{\rm op} \to {\rm Fun}_{\mathcal{O}}^{\rm lax,cp} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}), \mathbb{P}_{\mathcal{O}}(\mathcal{D}))$ is equivalent to the composition of functors \[ \begin{array}{rcl} {\rm Fun}_{\mathcal{O}}^{\rm oplax,L} (\mathcal{D},\mathcal{C})^{\rm op} &\simeq& {\rm Fun}_{\mathcal{O}}^{\rm lax,R} (\mathcal{D}^{\vee},\mathcal{C}^{\vee})\\[2mm] &\longrightarrow& {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{D}^{\vee}, \mathbb{P}_{\mathcal{O}}(\mathcal{C}^{\vee}))\\[2mm] &\simeq& {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{D}^{\vee}\times_{\mathcal{O}}\mathcal{C}, \mathcal{S}_{\mathcal{O}})\\[2mm] &\simeq& {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{C},\mathbb{P}_{\mathcal{O}}(\mathcal{D}))\\[2mm] &\simeq& {\rm Fun}_{\mathcal{O}}^{\rm lax,cp} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}), \mathbb{P}_{\mathcal{O}}(\mathcal{D})).\\ \end{array}\] \end{lemma} \fi \subsection{Covariant functor $\mathbb{P}_{\mathcal{O}!}$} \if0 Let $\mathcal{O}$ be an $\infty$-operad. Recall that $\mathcal{S}$ is the large $\infty$-category of spaces. We regard $\mathcal{S}$ as an $\mathcal{O}$-monoidal large $\infty$-category by using the Cartesian monoidal structure. \fi There is a functor \[ \mathrm{P}_!: {\rm Cat}_{\infty} \longrightarrow {\rm Pr}^{\rm L},\] which associates to a small $\infty$-category $\mathcal{C}$ the $\infty$-category $\mathrm{P}(\mathcal{C})$ of presheaves on $\mathcal{C}$, and to a functor $f: \mathcal{C}\to \mathcal{D}$ the functor $f_!:\mathrm{P}(\mathcal{C})\to\mathrm{P}(\mathcal{D})$ that is obtained by left Kan extension. In this subsection we will construct a functor \[ \mathbb{P}_{\mathcal{O}!}: {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat) \longrightarrow {\rm Mon}_{\mathcal{O}}^{\rm lax} ({\rm Pr}^{\rm L}) \] which is a lifting of $\mathrm{P}_!$. \begin{remark}\rm The functor ${\rm P}_!$ has two definitions: One is as a free cocompletion and the other is as a left adjoint to ${\rm P}^*$. They are recently shown to be equivalent in \cite{HHLN2}. \end{remark} \if0 We consider a full subcategory $\mathcal{E}'$ of ${\rm Fun}(\Delta^1, {\rm Mon}^{\rm lax}_{\mathcal{O}}(\wcat))$ spanned by those morphisms $\mathcal{C}\to \mathcal{X}$, where $\mathcal{C}$ is a small $\mathcal{O}$-monoidal $\infty$-category, $\mathcal{X}$ is an $\mathcal{O}$-monoidal $\infty$-category in ${\rm Pr}^{\rm L}$, and the induced functor $\mathbb{P}_{\mathcal{O}}(\mathcal{C})\to\mathcal{X}$ by Proposition~\ref{prop:presheaf-monoidal-universality} is an equivalence. By evaluating at $1\in\Delta^1$, there is a functor $\mathcal{E}'\to {\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)$. We define a subcategory $\mathcal{E}$ by the following pullback diagram \[ \begin{array}{ccc} \mathcal{E} & \longrightarrow & \mathcal{E}'\\[1mm] \bigg\downarrow & & \bigg\downarrow \\[4mm] {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L}) & \longrightarrow & {\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat).\\ \end{array}\] We denote by ${\rm ev}_1: \mathcal{E}\longrightarrow {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})$ the left vertical arrow. The evaluation functor at $0\in\Delta^1$ induces a functor ${\rm ev}_0: \mathcal{E}\to {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)$. We obtain a diagram \[ {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat) \stackrel{{\rm ev}_0}{\longleftarrow} \mathcal{E}\stackrel{{\rm ev}_1}{\longrightarrow} {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})\] of $\infty$-categories. We will show that ${\rm ev}_0$ is an equivalence. \begin{lemma}\label{lemma:ev0-E-to-cat-eq} The functor ${\rm ev}_0: \mathcal{E}\to {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)$ is an equivalence of $\infty$-categories. \end{lemma} \proof It is easy to see that the functor is essentially surjective. We will show that it is fully faithful. Let $(p: \mathcal{C}\to\mathcal{X}),(q: \mathcal{D}\to\mathcal{Y}) \in\mathcal{E}$. We have a commutative diagram \begin{align}\label{align:fun-delta-1-commutagive-diagram} \begin{array}{ccccc} {\rm Map}_{\mathcal{E}} (p,q) & \longrightarrow & {\rm Map}_{\mathcal{E}'} (p,q) & \longrightarrow & {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)} (\mathcal{C},\mathcal{D})\\[1mm] \bigg\downarrow & & \bigg\downarrow & & \phantom{\mbox{$\scriptstyle q_*$}} \bigg\downarrow \mbox{$\scriptstyle q_*$} \\[2mm] {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})} (\mathcal{X},\mathcal{Y}) & \longrightarrow & {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{X},\mathcal{Y}) & \stackrel{p^*}{\longrightarrow} & {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{C},\mathcal{Y}).\\ \end{array} \end{align} The left square is a pullback diagram by the definition of $\mathcal{E}$. We will show that the right square is also a pullback diagram. We have an adjunction \[ {\rm colim}: {\rm Fun}(\Delta^1, {\rm Mon}_{\mathcal{O}}^{\rm lax}(\widehat{\rm Cat}_{\infty})) \rightleftarrows {\rm Mon}_{\mathcal{O}}^{\rm lax}(\widehat{\rm Cat}_{\infty}):d,\] where ${\rm colim}$ is the colimit functor and $d$ is the diagonal functor. We can identify ${\rm colim}$ with the evaluation functor ${\rm ev}_1$ at $1\in \Delta^1$. By the adjunction $({\rm colim},d)$, we obtain an equivalence \begin{align}\label{align:equivalence-mapping-spaces} {\rm Map}_{{\rm Fun} (\Delta^1, {\rm Mon}_{\mathcal{O}}^{\rm lax}(\widehat{\rm Cat}_{\infty}))} (p,{\rm id}_{\mathcal{Y}}) \simeq {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\widehat{\rm Cat}_{\infty})} (\mathcal{X},\mathcal{Y}) \end{align} of mapping spaces. By \cite[Corollary~2.4.7.12]{Lurie1}, the evaluation functor ${\rm ev}_0: {\rm Fun}(\Delta^1, {\rm Mon}_{\mathcal{O}}^{\rm lax}(\widehat{\rm Cat}_{\infty})) \to {\rm Mon}_{\mathcal{O}}^{\rm lax}(\widehat{\rm Cat}_{\infty})$ is a Cartesian fibration. The commutative diagram \[ \begin{array}{ccc} \mathcal{D}& \stackrel{q}{\longrightarrow} & \mathcal{Y}\\ \mbox{$\scriptstyle q$} \bigg\downarrow \phantom{\mbox{$\scriptstyle q$}} & & \phantom{\mbox{$\scriptstyle\rm id$}} \bigg\downarrow \mbox{$\scriptstyle\rm id$} \\ \mathcal{Y} & \stackrel{\rm id}{\longrightarrow}& \mathcal{Y} \end{array}\] in ${\rm Mon}_{\mathcal{O}}^{\rm lax}(\widehat{\rm Cat}_{\infty})$ determines a morphism $(q: \mathcal{D}\to \mathcal{Y}) \to ({\rm id}_{\mathcal{Y}}: \mathcal{Y}\to\mathcal{Y})$ in ${\rm Fun}(\Delta^1, {\rm Mon}_{\mathcal{O}}^{\rm lax}(\widehat{\rm Cat}_{\infty}))$, which is a Cartesian morphism by \cite[Corollary~2.4.7.12]{Lurie1}. By \cite[Proposition~2.4.4.3]{Lurie1} and equivalence~(\ref{align:equivalence-mapping-spaces}), we see that the right square in diagram~(\ref{align:fun-delta-1-commutagive-diagram}) is a pullback diagram. The composite of the bottom arrows in diagram~(\ref{align:fun-delta-1-commutagive-diagram}) is an equivalence since $\mathbb{P}_{\mathcal{O}}(\mathcal{C})\to \mathcal{X}$ is an equivalence by the assumption. Hence the composite of the top arrows in diagram~(\ref{align:fun-delta-1-commutagive-diagram}) is also an equivalence. Therefore, the functor $\mathcal{E}\to {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)$ is fully faithful. This completes the proof. \qed \fi \bigskip First, we consider a functor \[ F_{\mathcal{O}!}: {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)^{\rm op} \longrightarrow {\rm Fun}({\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L}), \widetilde{\mathcal{S}} ) \] whose adjoint ${\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)^{\rm op}\times {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})\to \widetilde{\mathcal{S}} $ is given by $(\mathcal{C},\mathcal{D})\mapsto {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{C},\mathcal{D})$. By Proposition~\ref{prop:presheaf-monoidal-universality}, the Yoneda embedding induces an equivalence $J^*: {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}),\mathcal{D}) \stackrel{\simeq}{\to} {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{C},\mathcal{D})$. This implies that the functor $F_{\mathcal{O}!}$ factors through the Yoneda embedding ${\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})^{\rm op} \to {\rm Fun}({\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L}), \widetilde{\mathcal{S}} )$. Hence we obtain the desired functor $\mathbb{P}_{\mathcal{O}!}$ For small $\mathcal{O}$-monoidal $\infty$-categories $\mathcal{C}$ and $\mathcal{D}$, the functor $\mathbb{P}_{\mathcal{O}!}$ induces a functor \[ {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)} (\mathcal{C},\mathcal{D}) \longrightarrow {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}), \mathbb{P}_{\mathcal{O}}(\mathcal{D})) \] of mapping spaces. We notice that it is equivalent to the functor obtained from $\mathbb{P}_{\mathcal{O}!,(\mathcal{C},\mathcal{D})}$ in Definition~\ref{def:P-O-shriek} by taking core. \if0 This follows from the following commutative diagram \[ \xymatrix{ {\rm Map}_{{\rm Mon}_\mathcal{O}^{\rm lax}(\cat)} (\mathcal{C},\mathcal{D}) \ar[rr]^{M_{\mathcal{O}!,(\mathcal{C},\mathcal{D})}} \ar[dr]_{J_*} && {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax} ({\rm Pr}^{\rm L})} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}), \mathbb{P}_{\mathbb{O}}(\mathcal{D})) \ar[dl]^{J^*}\\ & {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax} ({\rm Pr}^{\rm L})} (\mathcal{C}, \mathbb{P}_{\mathcal{O}}(\mathcal{D}))&\\ }\] in $\widetilde{\mathcal{S}}$, which is obtained by the definition of $\mathbb{P}_{\mathcal{O}!}$ and Yoneda's lemma. \fi Hence we obtain the following proposition. \begin{proposition}\label{prop:monoidal-shriek-map} There is a functor \[ \mathbb{P}_{\mathcal{O}!}: {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat) \longrightarrow {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L}),\] which associates to a small $\mathcal{O}$-monoidal $\infty$-category $\mathcal{C}$ the $\mathcal{O}$-monoidal $\infty$-category $\mathbb{P}_{\mathcal{O}}(\mathcal{C})$, and to a lax $\mathcal{O}$-monoidal functor $f: \mathcal{C}\to \mathcal{D}$ the lax $\mathcal{O}$-monoidal functor $f_!: \mathbb{P}_{\mathcal{O}}( \mathcal{C} )\to \mathbb{P}_{\mathcal{O}}( \mathcal{D} )$. \end{proposition} \if0 We need the following lemmas in the next section. \begin{lemma}\label{lemma-p-shriek-1-faithful} The functor $\mathbb{P}_{\mathcal{O}!}$ induces a fully faithful functor \[ \mathbb{P}_{\mathcal{O}!}: {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)} (\mathcal{C},\mathcal{D}) \longrightarrow {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}), \mathbb{P}_{\mathcal{O}}(\mathcal{D})) \] of mapping spaces for any small $\mathcal{O}$-monoidal $\infty$-categories $\mathcal{C}$ and $\mathcal{D}$. \end{lemma} \proof The lemma follows from Proposition~\ref{prop:presheaf-monoidal-universality} and Remark~\ref{remark:J-fully-faithful}. \qed \fi \if0 \begin{proposition} For small $\mathcal{O}$-monoidal $\infty$-categories $\mathcal{C}$ and $\mathcal{D}$, we have the following commutative diagram \[ \xymatrix{ {\rm Fun}_{\mathcal{O}}^{\rm oplax,L} (\mathcal{D},\mathcal{C}) \ar[rr]^{\simeq}\ar[dr]_{\mathbb{P}_{\mathcal{O}}^*} && {\rm Fun}_{\mathcal{O}}^{\rm lax,R} (\mathcal{C},\mathcal{D})\ar[dl]^{\mathbb{P}_{\mathcal{O}!}}\\ & {\rm Fun}_{\mathcal{O}}^{\rm lax,cp} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}), \mathbb{P}_{\mathcal{O}}(\mathcal{D})))& \\ }\] in $\wcat$, where the top horizontal arrow is an equivalence in Proposition~\ref{prop:lax-oplax-duality-two-objects}. \end{proposition} \proof By the definition of $\mathbb{P}_{\mathcal{O}!}$, the composition \[ {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)} (\mathcal{D},\mathcal{C}) \stackrel{\mathbb{P}_{\mathcal{O}!}}{\longrightarrow} {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})} (\mathbb{P}_{\mathcal{O}}(\mathcal{D}), \mathbb{P}_{\mathcal{O}}(\mathcal{C})) \stackrel{J^*}{\longrightarrow} {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{D},\mathbb{P}_{\mathcal{O}}(\mathcal{C})) \] is equivalent to the map induced by the Yoneda embedding $\mathcal{C}\to \mathbb{P}_{\mathcal{O}}(\mathcal{C})$. Using the equivalence \[ {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{D},\mathbb{P}_{\mathcal{O}}(\mathcal{C})) \stackrel{\simeq}{\longrightarrow} {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{D}\times_{\mathcal{O}}\mathcal{C}^{\vee}, \mathcal{S}_{\mathcal{O}}) \] given by Lemma~\ref{lemma:adjoint-characterization-lax-functor}, we can identify $J^*\circ\mathbb{P}_{\mathcal{O}!}$ with the composition \[ \begin{array}{rcl} {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)} (\mathcal{D},\mathcal{C}) &\stackrel{\simeq}{\longrightarrow}& {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax,BRep}(\wcat)} (\mathcal{D}\times_{\mathcal{O}}\mathcal{C}^{\vee}, \mathcal{S}_{\mathcal{O}})\\[2mm] &\longrightarrow& {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{D}\times_{\mathcal{O}}\mathcal{C}^{\vee}, \mathcal{S}_{\mathcal{O}}).\\ \end{array} \] On the other hand, the composition \[ \begin{array}{rcl} {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)} (\mathcal{C},\mathcal{D}) &\stackrel{\mathbb{P}_{\mathcal{O}}^*}{\longrightarrow}& {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})} (\mathbb{P}_{\mathcal{O}}(\mathcal{D}), \mathbb{P}_{\mathcal{O}}(\mathcal{C}))\\[2mm] &\stackrel{J^*}{\longrightarrow}& {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{D},\mathbb{P}_{\mathcal{O}}(\mathcal{C}))\\[2mm] &\stackrel{\simeq}{\longrightarrow}& {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{D}\times_{\mathcal{O}}\mathcal{C}^{\vee}, \mathcal{S}_{\mathcal{O}})\\ \end{array} \] is equivalent to the composition \[ \begin{array}{rcl} {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)} (\mathcal{C},\mathcal{D}) &\stackrel{\simeq}{\longrightarrow}& {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax,BRep}(\wcat)} (\mathcal{D}\times_{\mathcal{O}}\mathcal{C}^{\vee}, \mathcal{S}_{\mathcal{O}})\\[2mm] &\longrightarrow& {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{D}\times_{\mathcal{O}}\mathcal{C}^{\vee}, \mathcal{S}_{\mathcal{O}}).\\ \end{array} \] By the proof of Proposition~\ref{prop:lax-oplax-duality-two-objects}, there is a commutative diagram \[ \xymatrix{ {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)} (\mathcal{C},\mathcal{D}) \ar[rr]^{\simeq}\ar[dr]^{\simeq}&& {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)} (\mathcal{D},\mathcal{C})\ar[dl]_{\simeq}\\ &{\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax,BRep}(\wcat)} (\mathcal{D}\times_{\mathcal{O}}\mathcal{C}^{\vee}, \mathcal{S}_{\mathcal{O}}). &\\ }\] \qed \begin{corollary}\label{cor:star-R-shriek-R} For any $g\in {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)} (\mathcal{D},\mathcal{C})$, we have \[ g^*\simeq (g^R)_! \] in ${\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})} (\mathbb{P}_{\mathcal{O}}(\mathcal{D}), \mathbb{P}_{\mathcal{O}}(\mathcal{C}))$. \end{corollary} \fi \section{Perfect pairing for monoidal adjunctions} \label{section:lax-oplax-duality} In this section we will prove Theorem~\ref{thm:main-theorem} by constructing a perfect pairing between the $\infty$-category of $\mathcal{O}$-monoidal $\infty$-categories with left adjoint oplax monoidal functors and that with right adjoint lax monoidal functors (Theorem~\ref{thm:main-this-note}). We denote by \[ \widehat{\lambda}: \widehat{\mathcal{M}}_{\mathcal{O}}^{\rm lax} \longrightarrow {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L}) \times {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})^{\rm op} \] the perfect pairing associated to the mapping space functor ${\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})}(-,-): {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})^{\rm op} \times {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L}) \to\widehat{\mathcal{S}}$. We define \[ \lambda: \mathcal{M}_{\mathcal{O}}^{\rm lax}\longrightarrow {\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op}\times {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)^{\rm op} \] to be a right fibration obtained from $\widehat{\lambda}$ by pullback along the functor \[ \mathbb{P}_{\mathcal{O}}^*\times \mathbb{P}_{\mathcal{O}!}^{\,\rm op}: {\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op}\times {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)^{\rm op} \longrightarrow {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L}) \times {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})^{\rm op}. \] \if0 \[ \begin{array}{rcl} {\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)\times {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat) &\stackrel{}{\hbox to 10mm{\rightarrowfill}}& {\rm Mon}_{\mathcal{O}}^{\rm oplax}(\cat)\times {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)\\[2mm] &\stackrel{\mathbb{P}_{\mathcal{O}}^*\times \mathbb{P}_{\mathcal{O}!}} {\hbox to 10mm{\rightarrowfill}}& {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})^{\rm op} \times {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})\\[2mm] &\stackrel{} {\hbox to 10mm{\rightarrowfill}}& \widehat{\mathcal{S}}, \end{array}\] \fi An object of $\mathcal{M}^{\rm lax}_{\mathcal{O}}$ corresponds to a triple $(\mathcal{C},\mathcal{D},f)$, where $\mathcal{C}$ and $\mathcal{D}$ are small $\mathcal{O}$-monoidal $\infty$-categories and $f: \mathbb{P}_{\mathcal{O}}(\mathcal{C})\to \mathbb{P}_{\mathcal{O}}(\mathcal{D})$ is a morphism in ${\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})$. For small $\mathcal{O}$-monoidal $\infty$-categories $\mathcal{C}$ and $\mathcal{D}$, the functor $\mathbb{P}_{\mathcal{O}!}$ induces a fully faithful functor ${\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)} (\mathcal{C},\mathcal{D}) \to {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}), \mathbb{P}_{\mathcal{O}}(\mathcal{D}))$ of mapping spaces. \if0 Since the Yoneda embedding $J:\mathcal{D}\to \mathbb{P}_{\mathcal{O}}(\mathcal{D})$ is strong $\mathcal{O}$-monoidal by Lemma~\ref{lemma:Yoneda-embedding-strong-monoidal} and fully faithful by Remark~\ref{remark:J-fully-faithful}, we can regard ${\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)} (\mathcal{C},\mathcal{D})$ as a full subgroupoid of the mapping space ${\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{C},\mathbb{P}_{\mathcal{O}}(\mathcal{D}))$. \fi \if0 We set \[ \mathcal{M}_{\mathcal{O}}^{\rm lax} ={\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op} \times_{{\rm Mon}_{\mathcal{O}}^{\rm oplax}(\cat)^{\rm op}} \widehat{\mathcal{M}}_{\mathcal{O}}^{\rm lax} \times_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)^{\rm op}} {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)^{\rm op}\] } \fi We define \[ \mathcal{M}_{\mathcal{O}}^{\rm lax, R} \] to be the full subcategory of $\mathcal{M}_{\mathcal{O}}^{\rm lax}$ spanned by those objects $v$ corresponding to triples $(\mathcal{C},\mathcal{D},f)$ where $f\simeq g_!$ for some right adjoint lax $\mathcal{O}$-monoidal functor $g: \mathcal{C}\to\mathcal{D}$. We let \[ \lambda^{\rm R}: \mathcal{M}_{\mathcal{O}}^{\rm lax, R}\longrightarrow {\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op}\times {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)^{\rm op} \] be the restriction of $ \lambda $ to $\mathcal{M}_{\mathcal{O}}^{\rm lax, R}$. First, we show that $\lambda^{\rm R}$ is a paring of $\infty$-categories. \begin{lemma}\label{lemma:lambda-R-pairing} The functor $\lambda^{\rm R}: \mathcal{M}_{\mathcal{O}}^{\rm lax, R} \to {\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op} \times {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)^{\rm op}$ is a pairing of $\infty$-categories. \end{lemma} \proof We shall prove that $\lambda^{\rm R}$ is a right fibration. For this purpose, since $ \lambda $ is a right fibration, it suffices to show the following: For a morphism $m: v\to v'$ of $ \mathcal{M}_{\mathcal{O}}^{\rm lax} $, if $v'\in \mathcal{M}_{\mathcal{O}}^{\rm lax, R}$, then $v\in\mathcal{M}_{\mathcal{O}}^{\rm lax, R}$. We denote by $k: \mathbb{P}_{\mathcal{O}}(\mathcal{C})\to \mathbb{P}_{\mathcal{O}}(\mathcal{D})$ and $k': \mathbb{P}_{\mathcal{O}}(\mathcal{C}')\to \mathbb{P}_{\mathcal{O}}(\mathcal{D}')$ morphisms in ${\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})$ corresponding to $v$ and $v'$, respectively. Since $v'\in \mathcal{M}^{\rm lax, R}_{ \mathcal{O} }$, we can write $k'\simeq f_!$, where $f: \mathcal{C}'\to\mathcal{D}'$ is a right adjoint lax $\mathcal{O}$-monoidal functor. Let $ \lambda (m)\simeq (g,h)$. Then $k\simeq h_!\circ k'\circ g^*$. Since $g$ is a left adjoint oplax $\mathcal{O}$-monoidal functor, $g^*\simeq (g^R)_!$ by Lemma~\ref{lemma:star-R-shriek-R}. Thus, $k\simeq (h\circ f\circ g^R)_!$. Since $h\circ f\circ g^R$ is a right adjoint lax $\mathcal{O}$-monoidal functor, we see that $v\in\mathcal{M}^{\rm lax, R}_{ \mathcal{O} }$. \qed \if0 \begin{lemma}\label{lemma:M^R-left-representable} The pairing $\lambda^{\rm R}$ is left representable. \end{lemma} \proof For $\mathcal{C}\in {\rm Mon}_{\mathcal{O}}^{\rm oplax, L}(\cat)$, we let $\chi_{\mathcal{C}}: {\rm Mon}_{\mathcal{O}}^{\rm lax, R}(\cat)\to \mathcal{S}$ be a functor associated to the right fibration $\mathcal{M}\times_{{\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op}} \{\mathcal{C}\} \to {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)^{\rm op}$. It suffices to show that $\chi_{\mathcal{C}}$ is corepresentable for any $\mathcal{C}$. This follows from the fact that $\chi_{\mathcal{C}}(\mathcal{D})\simeq {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)} (\mathcal{C},\mathcal{D})$. \qed \fi \bigskip \if0 By Lemma~\ref{lemma:lambda-R-pairing}, we obtain a functor \[ \chi: {\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat) \times {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat) \longrightarrow \mathcal{S} \] which classifies the right fibration $\lambda^{\rm R}$. We note that there is an equivalence \[ \chi(\mathcal{C},\mathcal{D})\simeq {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)} (\mathcal{C},\mathcal{D}). \] \fi Next, we shall show that the pairing $\lambda^R$ is perfect. For this purpose, we need the following lemma. \begin{lemma}\label{lemma:representing-equivalence-conditions} Let $v$ be an object of $\mathcal{M}_{\mathcal{O}}^{\rm lax,R}$ which corresponds to a triple $(\mathcal{C},\mathcal{D},f)$. Then the following conditions are equivalent\,\mbox{\rm :} \begin{enumerate} \item[{\rm (1)}] The object $v$ is left universal. \item[{\rm (2)}] The object $v$ is right universal. \item[{\rm (3)}] $f\simeq g_!$, where $g: \mathcal{C}\to\mathcal{D}$ is an equivalence in ${\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)$. \end{enumerate} \end{lemma} \proof First, we shall prove the equivalence between (1) and (3). Let $\lambda^{\rm R}_{\mathcal{C}}$ be the right fibration obtained from $\lambda^{\rm R}$ by restriction to $\{\mathcal{C}\} \times{{\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)^{\rm op}}$. It is classified by the functor ${\rm Mon}_{\mathcal{O}}^{\rm lax, R}(\cat)\to \mathcal{S}$ given by $\mathcal{D}'\mapsto {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)} (\mathcal{C},\mathcal{D}')$. Hence $\lambda^{\rm R}_{\mathcal{C}}$ is equivalent to the map ${\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)^{\rm op}_{/\mathcal{C}} \to {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)^{\rm op}$ as right fibrations. Thus, we see that $v$ is left universal if and only if $f\simeq g_!$ for an equivalence $g$. Next, we shall prove the equivalence between (2) and (3). We consider the right fibration $\lambda^{\rm R}_{\mathcal{D}}: \mathcal{N}\to {\rm Mon}_{\mathcal{O}}^{\rm oplax, L}(\cat)^{\rm op}$ obtained from $\lambda^{\rm R}$ by restriction to ${\rm Mon}_{\mathcal{O}}^{\rm oplax, L}(\cat)^{\rm op} \times\{\mathcal{D}\}$, where $\mathcal{N}=\mathcal{M}^{\rm lax, R}_{ \mathcal{O} } \times_{{\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)^{\rm op}}\{\mathcal{D}\}$. We have a commutative diagram of right fibrations \[ \begin{array}{ccc} \mathcal{N}_{/ v } & \longrightarrow & \mathcal{N}\\[1mm] \bigg\downarrow & & \bigg\downarrow\\[4mm] {\rm Mon}_{\mathcal{O}}^{\rm oplax, L}(\cat)^{\rm op} {}_{/ \mathcal{C} }& \longrightarrow & {\rm Mon}_{\mathcal{O}}^{\rm oplax, L}(\cat)^{\rm op}.\\ \end{array}\] We notice that the left vertical arrow is an equivalence since it is induced on overcategories by a right fibration. We would like to show that the map $\mathcal{N}_{/v}\to\mathcal{N}$ is an equivalence if and only if $f$ is an equivalence. For any $\mathcal{C}'\in {\rm Mon}_{\mathcal{O}}^{\rm oplax, L}(\cat)$, we have a pullback diagram \[ \begin{array}{ccc} \mathcal{N}_{/v}\times_{{\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op}} \{\mathcal{C}'\} &{\hbox to 15mm{\rightarrowfill}}& {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)} (\mathcal{C}',\mathcal{D})\\[2mm] \bigg\downarrow & & \phantom{\mbox{$\scriptstyle \mathbb{P}_{\mathcal{O}!}$}} \bigg\downarrow \mbox{$\scriptstyle \mathbb{P}_{\mathcal{O}!}$}\\%[2mm] {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op}} (\mathcal{C}',\mathcal{C}) & \stackrel{f\circ\mathbb{P}_{\mathcal{O}}^*} {\hbox to 15mm{\rightarrowfill}}& {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}'), \mathbb{P}_{\mathcal{O}}(\mathcal{D})) \\ \end{array} \] in spaces, where the left vertical arrow is an equivalence. \if0 We have a commutative diagram \[ \xymatrix{ {\rm Fun}_{\mathcal{O}}^{\rm oplax,L}(\mathcal{D},\mathcal{E})^{\rm op} \ar[rr]^{\simeq}\ar[dr]_{\mathbb{P}_{\mathcal{O}}^*}&& {\rm Fun}_{\mathcal{O}}^{\rm lax,R}(\mathcal{E},\mathcal{D}) \ar[dl]^{\mathbb{P}_{\mathcal{O}!}}\\ &{\rm Fun}_{\mathcal{O}}^{\rm lax,cp} (\mathbb{P}_{\mathcal{O}}(\mathcal{E}), \mathbb{P}_{\mathcal{O}}(\mathcal{D})),&\\ }\] where $\mathbb{P}_{\mathcal{O}}^*$ and $\mathbb{P}_{\mathcal{O}!}$ are fully faithful, and the top horizontal arrow is an equivalence by Proposition~\ref{prop:lax-oplax-duality-two-objects}. \fi Suppose that $f\simeq g_!$ with $g:\mathcal{C}\to \mathcal{D}$ a right adjoint lax $\mathcal{O}$-monoidal functor. By Lemma~\ref{lemma:star-R-shriek-R} and Proposition~\ref{prop:lax-oplax-duality-two-objects}, we see that the map \[ \mathcal{N}_{/v}\times_{{\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op}} \{\mathcal{C}'\} \longrightarrow \mathcal{N}\times_{{\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op}} \{\mathcal{C}'\} \] is equivalent to the composite \[ {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm oplax, L}(\cat)} (\mathcal{C}, \mathcal{C}' ) \stackrel{\simeq}{\to} {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax, R}(\cat)} ( \mathcal{C}', \mathcal{C}) \stackrel{g\circ(-)} {\hbox to 12mm{\rightarrowfill}} {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax, R}(\cat)} ( \mathcal{C}', \mathcal{D}), \] where the first arrow is an equivalence induced by Proposition~\ref{prop:lax-oplax-duality-two-objects} and the second arrow is the composition with $g$. Thus, each fiber of the map $\mathcal{N}_{/ v }\to\mathcal{N}$ is contractible if and only if $g$ is an equivalence. \if0 By \cite[Lemma~2.1.3.4]{Lurie1}, the map $\mathcal{N}_{/n}\to\mathcal{N}$ is a trivial Kan fibration. Hence $\lambda^{\rm R}_{\mathcal{D}}$ is equivalent to the map ${\rm Mon}_{\mathcal{O}}^{\rm oplax, L}(\cat)^{\rm op} {}_{/\mathcal{D}}\to {\rm Mon}_{\mathcal{O}}^{\rm oplax, L}(\cat)^{\rm op}$ as right fibrations. Under this equivalence, the object $v$ of $\mathcal{N}$ corresponds to a left adjoint oplax $\mathcal{O}$-monoidal functor $g: \mathcal{D}\to \mathcal{C}$ such that $g^R\simeq f$. \fi Therefore, (2) and (3) are equivalent. \qed \begin{proposition}\label{prop:M^R^perfect-pairing} The paring $\lambda^{\rm R}$ is perfect. \end{proposition} \proof The proposition follows from \cite[Corollary~5.2.1.22]{Lurie2} and Lemma~\ref{lemma:representing-equivalence-conditions}. \if0 By \cite[Corollary~5.2.1.22]{Lurie2}, it suffices to show that the pairing $\lambda^{\rm R}$ is both left and right representable, and that an object of $\mathcal{M}_{\mathcal{O}}^{\rm lax,R}$ is left universal if and only if it is right universal. This follows from Lemma~\ref{lemma:representing-equivalence-conditions}. \fi \qed \if0 \begin{proposition} \label{prop:monoidal-perfect-pairing} The pairing $\lambda^{\rm R}$ is perfect. \end{proposition} \proof We have to show that an object of $\mathcal{M}^{\rm lax, R}_{ \mathcal{O} }$ is left universal if and only if it is right universal. Let $v$ be an object of $\mathcal{M}^{\rm lax, R}_{ \mathcal{O} }$ with $\lambda^{\rm R}(v)\simeq (\mathcal{C},\mathcal{D})$. Let $f: \mathcal{C}\to \mathcal{D}$ be a right adjoint lax $\mathcal{O}$-monoidal functor corresponding to $v$ under the equivalence \[ \mathcal{M}^{\rm lax, R}_{ \mathcal{O} } \times_{{\rm Mon}_{\mathcal{O}}^{\rm oplax, L}(\cat)^{\rm op} \times {\rm Mon}_{\mathcal{O}}^{\rm lax, R}(\cat)^{\rm op}} \{(\mathcal{C},\mathcal{D})\}\simeq {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax, R}(\cat)} (\mathcal{C},\mathcal{D}). \] By the proof of Lemma~\ref{lemma:M^R-left-right-representable}, we see that $v$ is left universal if and only if $f$ is an equivalence of $\mathcal{O}$-monoidal $\infty$-categories. Also, by the proof of Lemma~\ref{lemma:M^R-left-right-representable}, $v$ is right universal if and only if $f$ is an equivalence. This completes the proof. \qed \fi \bigskip We obtain the main theorem of this paper. \begin{theorem}\label{thm:main-this-note} There is an equivalence \[ T: {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat) \stackrel{\simeq}{\longrightarrow} {\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op} \] of $\infty$-categories, which is identity on objects and assigns to right adjoint lax $\mathcal{O}$-monoidal functors their left adjoint oplax $\mathcal{O}$-monoidal functors. The equivalence $T$ fits into the following commutative diagram \[ \xymatrix{ {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat) \ar[rr]^T\ar[dr]_{\mathbb{P}_{\mathcal{O}!}} && {\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op} \ar[dl]^{\mathbb{P}_{\mathcal{O}}^*}\\ &{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L}).& }\] \if0 \[ \begin{array}{rcl} {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat) &\stackrel{T}{\longrightarrow}& {\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op}\\ \mbox{$\scriptstyle {\mathbb{P}_{\mathcal{O}!}}$} \searrow & & \swarrow \mbox{$\scriptstyle \mathbb{P}_{\mathcal{O}}^*$}\\ &{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L}).& \end{array}\] \fi \end{theorem} \proof The first part follows Proposition~\ref{prop:M^R^perfect-pairing}. We have a left (and right) representable morphism $\lambda^R\to \widehat{\lambda}$ of perfect pairings. The second part follows from \cite[Proposition~5.2.1.17]{Lurie2}. \qed \if0 \begin{theorem}\label{theorem:-monoidal-cat-L-R-duality} There is an equivalence \[ {\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op} \stackrel{\simeq}{\longrightarrow} {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)\] of $\infty$-categories, which is identity on objects. On morphisms, it associates to a left adjoint oplax $\mathcal{O}$-monoidal functor its right adjoint lax $\mathcal{O}$-monoidal functor. \end{theorem} \fi \fi \section{Monoidal preseaf functors} \label{section:monoidal-presheaf-functors} In \cite{Torii4} we studied monoidal presheaf functors $\mathbb{P}_{\mathcal{O}!}$ and $\mathbb{P}_{\mathcal{O}}^*$. In this section we review the properties of $\mathbb{P}_{\mathcal{O}!}$ and $\mathbb{P}_{\mathcal{O}}^*$ for reader's convenience. For a small $\infty$-category $\mathcal{C}$, we denote by ${\rm P}(\mathcal{C})$ the $\infty$-category ${\rm Fun}(\mathcal{C}^{\rm op},\mathcal{S})$ of presheaves on $\mathcal{C}$ with values in $\mathcal{S}$, and by $J_{\mathcal{C}}: \mathcal{C}\to {\rm P}(\mathcal{C})$ the Yoneda embedding. We have presheaf functors ${\rm P}_!: \cat\to {\rm Pr}^{\rm L}$ and ${\rm P}^*: \cat^{\rm op}\to {\rm Pr}^{\rm L}$, where ${\rm P}_!(\mathcal{C})= {\rm P}(\mathcal{C})={\rm P}^*(\mathcal{C})$. For a functor $f:\mathcal{C}\to\mathcal{D}$, we have ${\rm P}_!(f)=f_!: {\rm P}(\mathcal{C})\to {\rm P}(\mathcal{D})$ which is a left Kan extension of $J_{\mathcal{D}}\circ f$ along $J_{\mathcal{C}}$, and ${\rm P}^*(f)=f^*: {\rm P}(\mathcal{D})\to {\rm P}(\mathcal{C})$ which is given by the composition with $f^{\rm op}$. In \cite{Torii4} we extended ${\rm P}_!$ and ${\rm P}^*$ to monoidal presheaf functors. Let $\mathcal{O}$ be an $\infty$-operad. We denote by ${\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)$ the $\infty$-category of small $\mathcal{O}$-monoidal $\infty$-categories and right adjoint lax $\mathcal{O}$-monoidal functors. We also denote by ${\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)$ the $\infty$-category of small $\mathcal{O}$-monoidal $\infty$-categories and left adjoint lax $\mathcal{O}$-monoidal functors. We constructed functors \[ \begin{array}{llcl} \mathbb{P}_{\mathcal{O}!}:& {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat) & \longrightarrow & {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L}),\\ \mathbb{P}_{\mathcal{O}}^*:& {\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op} & \longrightarrow & {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L}),\\ \end{array}\] where ${\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})$ is the $\infty$-category of $\mathcal{O}$-monoidal $\infty$-categories in the symmetric monoidal $\infty$-category ${\rm Pr}^{\rm L}$ and lax $\mathcal{O}$-monoidal functors. For a small $\mathcal{O}$-monoidal $\infty$-category $\mathcal{C}$, we denote by $\mathbb{P}_{\mathcal{O}}(\mathcal{C})$ the $\mathcal{O}$-monoidal $\infty$-category ${\rm Fun}^{\mathcal{O}}(\mathcal{C},\mathcal{S})$ constructed by using Day convolution product (cf.~\cite[\S2.2.6]{Lurie2}). We have $\mathbb{P}_{\mathcal{O}!}(\mathcal{C}) =\mathbb{P}(\mathcal{C}) =\mathbb{P}_{\mathcal{O}}^*(\mathcal{C})$. Let $f: \mathcal{C}\to\mathcal{D}$ be a right adjoint lax $\mathcal{O}$-monoidal functor, and let $g: \mathcal{D}\to \mathcal{C}$ be a left adjoint oplax $\mathcal{O}$-monoidal functor. For simplicity, we write $f_!$ and $g^*$ for $\mathbb{P}_{\mathcal{O}!}(f)$ and $\mathbb{P}_{\mathcal{O}}^*(g)$, respectively. The induced functors on mapping spaces \[ \begin{array}{llcl} \mathbb{P}_{\mathcal{O}!,(\mathcal{C},\mathcal{D})}:& {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)} (\mathcal{C},\mathcal{D}) &\longrightarrow& {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}), \mathbb{P}_{\mathcal{O}}(\mathcal{D})),\\ \mathbb{P}_{\mathcal{O},(\mathcal{C},\mathcal{D})}^*:& {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)} (\mathcal{C},\mathcal{D}) &\longrightarrow& {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})} (\mathbb{P}_{\mathcal{O}}(\mathcal{D}), \mathbb{P}_{\mathcal{O}}(\mathcal{C}))\\ \end{array}\] are fully faithful for any small $\mathcal{O}$-monoidal $\infty$-categories $\mathcal{C}$ and $\mathcal{D}$ by \cite[Definitions~2.10 and 2.14]{Torii4}. For any right adjoint lax $\mathcal{O}$-monoidal functor $f: \mathcal{C}\to \mathcal{D}$, we have a left adjoint oplax $\mathcal{O}$-monoidal functor $f^L: \mathcal{D}\to \mathcal{C}$. Dually, for any left adjoint oplax $\mathcal{O}$-monoidal functor $g: \mathcal{D}\to \mathcal{C}$, we have a right adjoint lax $\mathcal{O}$-monoidal functor $g^R: \mathcal{C}\to \mathcal{D}$. By \cite[Lemma~2.16]{Torii4}, we have $(f^L)^*\simeq f_!$ and $(g^R)_!\simeq g^*$. \section{Uniqueness of equivalences} \label{section:uniqueness} In this section we will give a uniqueness result of equivalences between ${\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)$ and ${\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op}$ which are compatible with the monoidal presheaf functors $\mathbb{P}_{\mathcal{O}!}$ and $\mathbb{P}_{\mathcal{O}}^*$. Using this result, we will prove that the equivalence of \cite{Torii4} is equivalent to the restriction of the equivalence of \cite{HHLN1} in the next section. First, we consider the space ${\rm Map}_{\widehat{\rm Cat}_{\infty/{{\rm Mon}_{\mathcal{O}}^{\rm lax}} ({\rm Pr}^{\rm L})}} (\mathbb{P}_{\mathcal{O}!}, \mathbb{P}_{\mathcal{O}}^*)$ of functors from ${\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)$ to ${\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op}$ which are compatible with $\mathbb{P}_{\mathcal{O}!}$ and $\mathbb{P}_{\mathcal{O}}^*$. By Lemma~\ref{lemma:general-discrete-over-category} below, we see that it is discrete and equivalent to the space ${\rm Map}_{\widehat{\rm Cat}_{\infty/{h{\rm Mon}_{\mathcal{O}}^{\rm lax}}({\rm Pr}^{\rm L})}} (h\mathbb{P}_{\mathcal{O}!}, h\mathbb{P}_{\mathcal{O}}^*)$ of functors between the homotopy categories $h{\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)$ and $h{\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op}$ which are compatible with $h\mathbb{P}_{\mathcal{O}!}$ and $h\mathbb{P}_{\mathcal{O}}^*$. \if0 \begin{lemma}\label{lemma:cat-truncation-criterion} If $F: \mathcal{X}\to\mathcal{Y}$ is a functor of $\infty$-categories such that the map ${\rm Map}_{\mathcal{X}}(x,x')\to {\rm Map}_{\mathcal{Y}}(F(x),F(x'))$ is fully faithful for any $x,x'\in\mathcal{X}$, then $F$ is a $0$-truncated morphism in $\cat$. \end{lemma} \proof By \cite[Lemma~5.5.6.15]{Lurie1}, it suffices to show that the diagonal functor $\Delta: \mathcal{X}\to \mathcal{X} \times_{\mathcal{Y}}\mathcal{X}$ is $(-1)$-truncated in $\cat$. By the assumption, we see that the functor $\Delta$ is fully faithful. This implies that the map ${\rm Map}_{\cat}(\mathcal{E},\mathcal{X}) \to {\rm Map}_{\cat}(\mathcal{E},\mathcal{X} \times_{\mathcal{Y}}\mathcal{X})$ is fully faithful, which is $(-1)$-truncated in $\mathcal{S}$. \qed \fi \begin{lemma}\label{lemma:general-discrete-over-category} Let $P: \mathcal{X}\to \mathcal{Z}$ and $Q:\mathcal{Y}\to\mathcal{Z}$ be functors of $\infty$-categories. We assume that the induced functor ${\rm Map}_{\mathcal{Y}}(y,y')\to {\rm Map}_{\mathcal{Z}}(Q(y),Q(y'))$ on mapping spaces is $(-1)$-truncated for any objects $y,y'\in\mathcal{Y}$. Then the space ${\rm Map}_{{\rm Cat}_{\infty/\mathcal{Z}}} (P,Q)$ is discrete, and the map ${\rm Map}_{{\rm Cat}_{\infty/\mathcal{Z}}} (P,Q) \to {\rm Map}_{{\rm Cat}_{\infty/h\mathcal{Z}}} (hP,hQ)$ is an equivalence. \end{lemma} \proof First, we shall show that the space ${\rm Map}_{{\rm Cat}_{\infty/\mathcal{Z}}} (P,Q)$ is discrete. For this, it suffices to show that the functor $Q$ is a $0$-truncated morphism in $\cat$. We consider the diagonal functor $\Delta: \mathcal{Y}\to \mathcal{Y} \times_{\mathcal{Z}}\mathcal{Y}$. By \cite[Lemma~5.5.6.15]{Lurie1}, it suffices to show that $\Delta$ is $(-1)$-truncated in $\cat$, that is, the map $\Delta_*: {\rm Map}_{\cat}(\mathcal{E},\mathcal{Y}) \to {\rm Map}_{\cat}(\mathcal{E},\mathcal{Y} \times_{\mathcal{Z}}\mathcal{Y})$ is $(-1)$-truncated in $\mathcal{S}$ for any $\infty$-category $\mathcal{E}$. Note that a map between spaces is $(-1)$-truncated if and only if it is fully faithful. By the assumption, we see that the functor $\Delta$ is fully faithful. This implies that $\Delta_*$ is also fully faithful. Next, we shall show that the map ${\rm Map}_{{\rm Cat}_{\infty/\mathcal{Z}}} (P,Q) \to {\rm Map}_{{\rm Cat}_{\infty/h\mathcal{Z}}} (hP,hQ)$ is an equivalence. By the assumption, the following commutative diagram \[ \begin{array}{ccc} \mathcal{Y} & \stackrel{\pi_{\mathcal{Y}}}{\longrightarrow} & h\mathcal{Y} \\ \mbox{$\scriptstyle Q$} \bigg\downarrow \phantom{\mbox{$\scriptstyle Q$}} & & \phantom{\mbox{$\scriptstyle hQ$}} \bigg\downarrow \mbox{$\scriptstyle hQ$} \\ \mathcal{Z} & \stackrel{\pi_{\mathcal{Z}}}{\longrightarrow} & h\mathcal{Z} \\ \end{array}\] is pullback. This induces an equivalence ${\rm Map}_{{\rm Cat}_{\infty/\mathcal{Z}}}(P,Q) \stackrel{\simeq}{\to} {\rm Map}_{{\rm Cat}_{\infty/h\mathcal{Z}}} (\pi_{\mathcal{Z}}\circ P,hQ)$. The desired equivalence follows from the fact that the functor $\pi_{\mathcal{X}}: \mathcal{X}\to h\mathcal{X}$ induces an equivalence ${\rm Map}_{{\rm Cat}_{\infty}}(h\mathcal{X},\mathcal{C}) \stackrel{\simeq}{\to} {\rm Map}_{{\rm Cat}_{\infty}}(\mathcal{X},\mathcal{C})$ for any ordinary category $\mathcal{C}$ by \cite[Proposition~1.2.3.1]{Lurie1}. \qed \if0 \begin{remark}\rm We have a commutative diagram \[ \begin{array}{ccc} {\rm Map}_{\widehat{\rm Cat}_{\infty/ {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})}} (\mathbb{P}_{\mathcal{O}!},\mathbb{P}_{\mathcal{O}}^*) &\longrightarrow& {\rm Map}_{\widehat{\rm Cat}_{\infty/ {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})}} (\mathbb{P}_{\mathcal{O}_!}^{\simeq}, \mathbb{P}_{\mathcal{O}}^{*,\simeq})\\ \bigg\downarrow & & \bigg\downarrow\\ {\rm Map}_{\widehat{\rm Cat}_{\infty/ h{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})}} (h\mathbb{P}_{\mathcal{O}!},h\mathbb{P}_{\mathcal{O}}^*) &\longrightarrow& {\rm Map}_{\widehat{\rm Cat}_{\infty/ h{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})}} (h\mathbb{P}_{\mathcal{O}_!}^{\simeq}, h\mathbb{P}_{\mathcal{O}}^{*,\simeq}).\\ \end{array}\] By Lemma~\ref{lemma:general-discrete-over-category}, the vertical arrows are equivaelnces. We will show that the horizontal arrows are fully faithful. Suppose that $(F,\alpha)$ and $(G,\beta)$ are objects of the left bottom corner and $\tau$ is a natural equivalence between $(F^{\simeq},\alpha^{\simeq})$ and $(G^{\simeq},\beta^{\simeq})$. For any small $\mathcal{O}$-monoidal $\infty$-category $\mathcal{C}$, we have an equivalence $\tau_{\mathcal{C}}: F(\mathcal{C})\stackrel{\simeq}{\to}G(\mathcal{C})$ in $h{\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op, \simeq}$. We shall show that $\tau$ determines a natural transformation between $F$ and $G$ For any $f:\mathcal{C}\to\mathcal{D}$ in ${\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)$, we have a diagram \[ \begin{array}{ccc} F(\mathcal{C}) & \stackrel{\tau_{\mathcal{C}}}{\longrightarrow} & G(\mathcal{C})\\ \mbox{$\scriptstyle F(f)$} \bigg\uparrow \phantom{\mbox{$\scriptstyle F(f)$}} & & \phantom{\mbox{$\scriptstyle G(f)$}} \bigg\uparrow \mbox{$\scriptstyle G(f)$}\\ F(\mathcal{D}) & \stackrel{\tau_{\mathcal{D}}}{\longrightarrow} & G(\mathcal{D}).\\ \end{array}\] \end{remark} \fi \bigskip We shall define an object \[ \mathbf{eq}=({\rm eq},{\rm id})\in {\rm Map}_{\widehat{\rm Cat}_{\infty/{h{\rm Mon}_{\mathcal{O}}^{\rm lax}}({\rm Pr}^{\rm L})}} (h\mathbb{P}_{\mathcal{O}!}, h\mathbb{P}_{\mathcal{O}}^*). \] Let ${\rm eq}: h{\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat) \to h{\rm Mon}_{\mathcal{O}}^{\rm oplax, L}(\cat)^{\rm op}$ be a functor which is identity on objects and assigns to a connected component containing a right adjoint lax $\mathcal{O}$-monoidal functor $f$ the connected component containing its left adjoint oplax $\mathcal{O}$-monoidal functor $f^L$. Since $(f^L)^*\simeq f_!$, we have the identity natural equivalence ${\rm id}: h\mathbb{P}_{\mathcal{O}!} \stackrel{\simeq}{\to}h\mathbb{P}_{\mathcal{O}}^*\circ {\rm eq}$. Now, we will give a condition for an object of ${\rm Map}_{\widehat{\rm Cat}_{\infty/{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})}} (\mathbb{P}_{\mathcal{O}!},\mathbb{P}_{\mathcal{O}}^*)$ to determine an object of ${\rm Map}_{\widehat{\rm Cat}_{\infty/h{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})}} (h\mathbb{P}_{\mathcal{O}!},h\mathbb{P}_{\mathcal{O}}^*)$ which is equivalent to $\mathbf{eq}$. \begin{lemma}\label{lemma:characterizetion-eq} Let $\mathbf{F}=(F,\delta)$ be an object of ${\rm Map}_{\widehat{\rm Cat}_{\infty/{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})}} (\mathbb{P}_{\mathcal{O}!},\mathbb{P}_{\mathcal{O}}^*)$, where $F$ is a functor from ${\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)$ to ${\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op}$ and $\delta: \mathbb{P}_{\mathcal{O}!} \stackrel{\simeq}{\to} \mathbb{P}_{\mathcal{O}}^*\circ F$ is a natural equivalence. Then $\mathbf{F}$ determines an object of ${\rm Map}_{\widehat{\rm Cat}_{\infty/h{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})}} (h\mathbb{P}_{\mathcal{O}!},h\mathbb{P}_{\mathcal{O}}^*)$ which is equivalent to $\mathbf{eq}$ if and only if there is an equivalence $\zeta_{\mathcal{C}}: F(\mathcal{C})\to \mathcal{C}$ for each small $\mathcal{O}$-monoidal $\infty$-category $\mathcal{C}$ such that $\zeta_{\mathcal{C}}^*: \mathbb{P}_{\mathcal{O}}(\mathcal{C})\to \mathbb{P}_{\mathcal{O}}(F(\mathcal{C}))$ is equivalent to $\delta_{\mathcal{C}}$. \end{lemma} \proof First, we suppose that $h\mathbf{F}=(hF,h\delta)$ is equivalent to $\mathbf{eq}$. Then there is a natual equivalence $\tau: hF\stackrel{\simeq}{\to}{\rm eq}$ which makes the following diagram commute \begin{equation}\label{eq:id-h-delta-PO-tau-triangle} \xymatrix{ & h\mathbb{P}_{\mathcal{O}!} \ar[dl]_{{\rm id}} \ar[dr]^{h\delta} & \\ h\mathbb{P}_{\mathcal{O}}^*\circ {\rm eq} \ar[rr]^{h\mathbb{P}_{\mathcal{O}}^*\circ \tau} && h\mathbb{P}_{\mathcal{O}}^*\circ hF.\\ }\end{equation} For each $\mathcal{C}$, we obtain a desired equivalence $\zeta_{\mathcal{C}}$ by taking a representative of the component $\tau_{\mathcal{C}}$. Conversely, we suppose that we have an equivalence $\zeta_{\mathcal{C}}:F(\mathcal{C}) \stackrel{\simeq}{\to}\mathcal{C}$ such that $\zeta_{\mathcal{C}}^*\simeq\delta_{\mathcal{C}}$ for each $\mathcal{C}$. We will show that the collection $\{\zeta_{\mathcal{C}}\}$ of equivalences determines a natural equivalence $\tau: hF\stackrel{\simeq}{\to}{\rm eq}$. We consider a diagram $\sigma$: \[ \begin{array}{ccc} F(\mathcal{C}) & \stackrel{\zeta_{\mathcal{C}}}{\to} & \mathcal{C}\\ \mbox{$\scriptstyle F(f)$} \bigg\uparrow \phantom{\mbox{$\scriptstyle F(f)$}} & & \phantom{\mbox{$\scriptstyle f^L$}} \bigg\uparrow \mbox{$\scriptstyle f^L$} \\ F(\mathcal{D}) & \stackrel{\zeta_{\mathcal{D}}}{\to } & \mathcal{D} \\ \end{array} \] in ${\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)$ for any morphism $f:\mathcal{C}\to \mathcal{D}$ in ${\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)$. By the assumption that $\zeta_{\mathcal{C}}^*\simeq \delta_{\mathcal{C}}$ and the fact that $(f^L)^*\simeq f_!$, we see that the diagram $\mathbb{P}_{\mathcal{O}}^*(\sigma)$ is homotopy commutative. Since $\mathbb{P}_{\mathcal{O},(F(\mathcal{D}),\mathcal{C})}^*$ is fully faithful, we see that the diagram $\sigma$ is also homotopy commutative. Hence the collection $\{\zeta_{\mathcal{C}}\}$ determines a natural equivalence $\tau: hF\stackrel{\simeq}{\to} {\rm eq}$. By the construction, we obtain a commutative diagram~(\ref{eq:id-h-delta-PO-tau-triangle}). \if0 \[ \xymatrix{ & h\mathbb{P}_{\mathcal{O}!} \ar[dl]_{{\rm id}} \ar[dr]^{h\delta} & \\ h\mathbb{P}_{\mathcal{O}}^*\circ {\rm eq} \ar[rr]^{h\mathbb{P}_{\mathcal{O}}^*\circ \zeta} && h\mathbb{P}_{\mathcal{O}}^*\circ hF.\\ }\] \fi Therefore, $h\mathbf{F}=(hF,h\delta)$ is equivalent to $\mathbf{eq}=({\rm eq},{\rm id})$. \qed \bigskip By \cite[Theorem~4.4]{Torii4}, we have an object $(T,\theta)$ of ${\rm Map}_{\widehat{\rm Cat}_{\infty/{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})}} (\mathbb{P}_{\mathcal{O}!},\mathbb{P}_{\mathcal{O}}^*)$. We shall show that $(T,\theta)$ induces an object equivalent to $\mathbf{eq}$ in ${\rm Map}_{\widehat{\rm Cat}_{\infty/ {h\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})}} (h\mathbb{P}_{\mathcal{O}!},h\mathbb{P}_{\mathcal{O}}^*)$. \begin{proposition}\label{prop:T-determine-eq} The object $(T,\theta)$ determines an object of ${\rm Map}_{\widehat{\rm Cat}_{\infty/h{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})}} (h\mathbb{P}_{\mathcal{O}!},h\mathbb{P}_{\mathcal{O}}^*)$ which is equivalent to $\mathbf{eq}$. \end{proposition} \proof We use the notation in \cite[\S4]{Torii4}. For a small $\mathcal{O}$-monoidal $\infty$-category $\mathcal{D}$, we take a left and right universal object $(\mathcal{C},\mathcal{D},f)$ of $\mathcal{M}_{\mathcal{O}}^{\rm lax,R}$ with $f\simeq g_!$, where $g:\mathcal{C}\stackrel{\simeq}{\to} \mathcal{D}$ is an equivalence in ${\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)$. Then we have an equivalence $\mu: T(\mathcal{D})\stackrel{\simeq}{\to}\mathcal{C}$ in ${\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)$ which makes the following diagram commute \[ \xymatrix{ \mathbb{P}_{\mathcal{O}}(\mathcal{C}) \ar[rr]^{\mu^*}\ar[dr]_{f} && \mathbb{P}_{\mathcal{O}}(T(\mathcal{D})) \\ &\mathbb{P}_{\mathcal{O}}(\mathcal{D}). \ar[ur]_{\theta_{\mathcal{D}}}& \\ }\] We set $\zeta_{\mathcal{D}}=g\circ \mu: T(\mathcal{D})\to \mathcal{D}$. Then $\zeta_{\mathcal{D}}$ is an equivalence and $\zeta_{\mathcal{D}}^*\simeq \theta_{\mathcal{D}}$ since $g^*\simeq f^{-1}$. The desired result follows from Lemma~\ref{lemma:characterizetion-eq}. \qed \if0 We denote by ${\rm eq}$ the equivalence ${\rm h}{\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)\to {\rm h}{\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op}$ on homotopy categories which is identity on objects and assigns to right adjoint lax $\mathcal{O}$-monoidal functors their left adjoint oplax $\mathcal{O}$-monoidal functors. We regard $\mathbb{P}_{\mathcal{O}!}: {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)\to {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})$ and $\mathbb{P}_{\mathcal{O}}^*: {\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op}\to {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})$ as objects of $\widehat{\rm Cat}_{\infty/{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})}$. \fi \bigskip We define a space ${\mathcal Eq}$ by \[ {\mathcal Eq} = {\rm Map}_{\widehat{\rm Cat}_{\infty/ {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})}} (\mathbb{P}_{\mathcal{O}!},\mathbb{P}_{\mathcal{O}}^*) \times_{ {\rm Map}_{\widehat{\rm Cat}_{\infty/ h{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})}} (h\mathbb{P}_{\mathcal{O}!},h\mathbb{P}_{\mathcal{O}}^*)} \{ \mathbf{eq} \}. \] We can regard ${\mathcal Eq}$ as the space of equivalences between ${\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)$ and ${\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op}$ which are compatible with the monoidal presheaf functors $\mathbb{P}_{\mathcal{O}!}$ and $\mathbb{P}_{\mathcal{O}}^*$. By Lemma~\ref{lemma:general-discrete-over-category}, we obtain the following theorem. \if0 First, we shall prove a uniqueness of equivalences. \fi \begin{theorem}\label{thm:uniqueness-equivalences} The space ${\mathcal Eq}$ is contractible. \end{theorem} \if0 We sketch a strategy of the proof. \begin{enumerate} \item The functors ${\mathbb P}_{\mathcal{O}_!}: {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)\to {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})$ and ${\mathbb P}_{\mathcal{O}_!}: {\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)\to {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})$ are $0$-truncated morphisms in $\wcat$ by Propositions~\ref{} and \ref{}. \item (1) implies that the space of equivalences which make the above triangle commute is discrete. \item By the conditions that an equivalence is identify on objects and assigns to a right adjoint lax monoidal functor to its left adjoint oplax monoidal functor, any two such equivalences is canonical equivalent. \end{enumerate} \fi \if0 \proof It suffices to show that the space ${\rm Map}_{\widehat{\rm Cat}_{\infty/ {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})}} (\mathbb{P}_{\mathcal{O}!},\mathbb{P}_{\mathcal{O}}^*)$ is discrete. Since the functor $\mathbb{P}_{\mathcal{O}}^*$ induces fully faithful functors on mapping spaces, $\mathbb{P}_{\mathcal{O}}^*$ is a $0$-truncated morphism in $\wcat$. Hence ${\rm Map}_{\widehat{\rm Cat}_{\infty/ {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})}} (\mathbb{P}_{\mathcal{O}!},\mathbb{P}_{\mathcal{O}}^*)$ is discrete. \qed \fi \section{Canonical equivalence between $(T,\theta)$ and $(H,\gamma)$} \label{section:canonical-equivalence} In this sectiont we shall show that the equivalence $T$ in \cite{Torii4} is equivalent to the restriction $H$ of the equivalence in \cite{HHLN1}. The functor $T$ equipped with the commutative diagram in \cite[Theorem~4.4]{Torii4} gives rise to an object $(T,\theta)$ in ${\mathcal Eq}$ by Proposition~\ref{prop:T-determine-eq}. Hence it suffices to show that $H$ extends to an object $(H,\gamma)$ of ${\mathcal Eq}$ by Theorem~\ref{thm:uniqueness-equivalences}. First, we have to show that $H$ gives a morphism from $\mathbb{P}_{\mathcal{O}!}$ to $\mathbb{P}_{\mathcal{O}}^*$ in $\widehat{\rm Cat}_{\infty/{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})}$. In order to prove this, we will show that there are natural transformations $I\to \mathbb{P}_{\mathcal{O}!}$ and $I\to \mathbb{P}_{\mathcal{O}}^*\circ H$ of functors from ${\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)$ to ${\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)$ whose components are equivalent to Yoneda embeddings, where $I$ is the inclusion functor ${\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)\to {\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)$. After that, we will show that these natural transformations are canonically equivalent. We consider a pullback diagram \[ \begin{array}{ccc} \mathcal{F}& \longrightarrow & {\rm Fun}({\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat), {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L}))\\ \bigg\downarrow & & \bigg\downarrow \\ {\rm Fun}({\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat), {\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat) )_{I/} & \longrightarrow & {\rm Fun}({\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat), {\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat) ). \\ \end{array} \] We need the following lemma which characterizes initial objects of $\mathcal{F}$. \begin{lemma}\label{lemma:characterization-initial-F} An object $(\sigma: I\to F)$ of $\mathcal{F}$ is initial if the component $\sigma_{\mathcal{C}}: \mathcal{C}\to F(\mathcal{C})$ is equivalent to the Yoneda embedding $J_{\mathcal{C}}:\mathcal{C}\to\mathbb{P}_{\mathcal{O}}(\mathcal{C})$ for each $\mathcal{C}\in {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)$, that is, there is an equivalence $F(\mathcal{C})\stackrel{\simeq}{\to} \mathbb{P}_{\mathcal{O}}(\mathcal{C})$ which makes the following diagram commute \[ \xymatrix{ &\mathcal{C} \ar[dl]_{\sigma_{\mathcal{C}}}\ar[dr]^{J_{\mathcal{C}}} & \\ F(\mathcal{C})\ar[rr]&& \mathbb{P}_{\mathcal{O}}(\mathcal{C}). }\] \end{lemma} \proof For any object $(\tau: I\to G)$ of $\mathcal{F}$, we have the following pullback diagrams \[ \begin{array}{ccc} {\rm Map}_{\mathcal{F}}(\sigma,\tau) &\longrightarrow& {\rm Map}_{{\rm Fun}({\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat), {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L}))} (\sigma,\tau) \\[2mm] \bigg\downarrow & & \bigg\downarrow \\ {\rm Map}_{{\rm Fun}({\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat), {\rm Mon}_{\mathcal{O}}^{\rm lax}( \wcat ))_{I/}} (\sigma,\tau) & \longrightarrow & {\rm Map}_{{\rm Fun}({\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat), {\rm Mon}_{\mathcal{O}}^{\rm lax}( \wcat ))} (\sigma,\tau) \\ \bigg\downarrow & & \bigg\downarrow \\ * & \longrightarrow & {\rm Map}_{{\rm Fun}({\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat), {\rm Mon}_{\mathcal{O}}^{\rm lax}( \wcat ))} (I,\tau). \\ \end{array}\] In order to prove that the composite of the left vertical arrows is an equivalence, it suffices to show that the composite of the right vertical arrows is an equivalence. The composite of the right vertical arrows is identified with a map between ends \[ \int_{\mathcal{C}\in {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)} {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})} (F(\mathcal{C}),G(\mathcal{C})) \longrightarrow \int_{\mathcal{C}\in {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)} {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathcal{C},G(\mathcal{C})), \] which is an equivalence by the assumption and \cite[Proposition~2.7]{Torii4}. \qed \bigskip Next, we shall show that there is an object $(\alpha: I\to \mathbb{P}_{\mathcal{O}!})$ of $\mathcal{F}$ whose components are equivalent to Yoneda embeddings. \begin{lemma}\label{lemma:PO-extension-to-I} The functor $\mathbb{P}_{\mathcal{O}!}$ extends to an object $(\alpha: I\to \mathbb{P}_{\mathcal{O}_!})$ in $\mathcal{F}$ such that $\alpha_{\mathcal{C}}\simeq J_{\mathcal{C}}$ for each $\mathcal{C}\in {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)$. \end{lemma} \proof Let $i: {\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L}) \to {\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)$ be the inclusion functor. We have an adjunction \[ i_!: {\rm Fun} ({\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L}), \widetilde{S}) \leftrightarrows {\rm Fun} ({\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat), \widetilde{S}) : i^*,\] where $i^*$ is the restriction functor and $i_!$ is a left Kan extension along $i$. The counit of the adjunction $(i_!i^*\to {\rm id})$ gives a functor ${\rm Fun}({\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat),\widetilde{S}) \times [1] \to {\rm Fun}({\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat),\widetilde{S})$. Composing with ${\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)^{\rm op} \to {\rm Fun}({\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat),\widetilde{S})$ which assigns ${\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)}(\mathcal{C},-)$ to $\mathcal{C}$, we obtain a functor ${\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)^{\rm op}\times [1] \to {\rm Fun}({\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat),\widetilde{S})$. We will show that this functor factors through ${\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)^{\rm op}$. For this, it suffices to show that $i_!i^*M(\mathcal{C})$ is representable for any $\mathcal{C}\in {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)$, where $M(\mathcal{C})= {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)}(\mathcal{C},-)$. The functor $i^*M(\mathcal{C})$ is equivalent to ${\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}),-)$ by \cite[Proposition~2.7]{Torii4}. Hence $i_!i^*M(\mathcal{C})$ is represented by $\mathbb{P}_{\mathcal{O}}(\mathcal{C})$ since ${\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}),-)$ is a left Kan extension of ${\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}({\rm Pr}^{\rm L})} (\mathbb{P}_{\mathcal{O}}(\mathcal{C}),-)$ along $i$. Therefore, we obtain a functor ${\rm Mon}_{\mathcal{O}}^{\rm lax, R}(\cat)\times [1]\to {\rm Mon}_{\mathcal{O}}^{\rm lax}(\wcat)$, which is a natural transformation $\alpha: I \to \mathbb{P}_{\mathcal{O}!}$ such that $\alpha_{\mathcal{C}}\simeq J_{\mathcal{C}}$ for each $\mathcal{C}$. \qed \bigskip Next, we would like to show that there is an object $(\beta: I\to \mathbb{P}_{\mathcal{O}}^*\circ H)$ of $\mathcal{F}$ whose components are equivalent to Yoneda embeddings. For this purpose, we need some preliminary constructions. Let $p=(p_A,p_{\mathcal{O}}): Y\to A\times\mathcal{O}^{\otimes}$ be the curved orthofibration associated to a functor ${\rm St}(p): A^{\rm op}\to {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)$ (see \cite{HHLN1} for the definitions of curved orthofibrations and (op-)Gray fibrations). Although we will take $p$ as the identity map later, it is notationally convenient to introduce a placeholder. Note that $(p_{\mathcal{O}},p_A): Y\to \mathcal{O}^{\otimes}\times A$ is a Gray fibration. We denote by $p^{\wedge}: Y^{\wedge}\to \mathcal{O}^{\otimes,{\rm op}}\times A$ the op-Gray fibration obtained from $p$ by coCartesian straightening followed by Cartesian unstraightening with respect to $p_{\mathcal{O}}: Y\to \mathcal{O}^{\otimes}$. Then $p^{\wedge}$ is also a curved orthofibration associated to the functor $H\circ {\rm St}(p): A^{\rm op}\to {\rm Mon}_{\mathcal{O}}^{\rm oplax,L}(\cat)^{\rm op}$. By taking opposite categories, we obtain a curved orthofibration $p^{\vee}=(p^{\vee}_A,p^{\vee}_{\mathcal{O}})=(p^{\wedge})^{\rm op}: Y^{\vee}=(Y^{\wedge})^{\rm op}\to A^{\rm op}\times \mathcal{O}^{\otimes}$ which is associated to the functor $(-)^{\vee}\circ H\circ {\rm St}(p): A^{\rm op}\to {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)^{\rm op}$. Let ${\rm Tw}^l(A)$ be the twisted arrow $\infty$-category equipped with a left fibration ${\rm Tw}^l(A)\to A^{\rm op}\times A$. We consider the following pullback diagram \[ \begin{array}{ccc} E(Y/A) & \longrightarrow & Y^{\vee} \times_{\mathcal{O}^{\otimes}} Y \\ \mbox{$\scriptstyle q$}\bigg\downarrow \phantom{\mbox{$\scriptstyle q$}} & & \phantom{\mbox{$\scriptstyle p_A^{\vee}\times p_A$}} \bigg\downarrow \mbox{$\scriptstyle p_A^{\vee}\times p_A$} \\[3mm] {\rm Tw}^l(A) & \longrightarrow &A^{\rm op}\times A. \\ \end{array} \] Note that the vertical arrows are Cartesian fibrations, and that the fiber $E(Y/A)_{\phi}$ is an $\mathcal{O}$-monoidal $\infty$-category $Y^{\vee}_s\times_{\mathcal{O}^{\otimes}}Y_t$ for any $(\phi: s\to t)\in {\rm Tw}^l(A)$. Let ${\rm Nat}(I,\mathbb{P}_{\mathcal{O}}^*\circ H)_A$ be the space of natural transformations of functors from $I\circ {\rm St}(p)$ to $\mathbb{P}_{\mathcal{O}}^*\circ H\circ {\rm St}(p)$. We will show that there is a fully faithful functor ${\rm Nat}(I,\mathbb{P}_{\mathcal{O}}^*\circ H)_A \to {\rm Map}_{\wcat} (E(Y/A),\mathcal{S})$. \if0 whose essential image is spanned by those functors $F: E(Y/T)\to\widehat{S}$ which carry $q$-Cartesian morphisms to equivalences and whose restriction $F_{\phi}: E(Y/T)_{\phi}\to\widehat{S}$ is an $E(Y/T)_{\phi}$-monoid object for each $\phi\in {\rm Tw}^l(Y)$. \fi For this purpose, we will first show that the Cartesian symmetric monoidal structure on the $\infty$-category ${\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)$ is closed. By naturality of the construction of Day convolution product \cite[Construction~2.2.6.18]{Lurie2}, we have a functor \[ {\rm Fun}^{\mathcal{O}}(-,-): {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)^{\rm op} \times {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat) \longrightarrow {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat). \] \begin{lemma}\label{lemma:natural-eq-fun-O} There is a natural equivalence \[ {\rm Fun}^{\mathcal{O}}(\mathcal{A}, {\rm Fun}^{\mathcal{O}}(\mathcal{B},\mathcal{C})) \simeq {\rm Fun}^{\mathcal{O}}(\mathcal{A}\times_{\mathcal{O}}\mathcal{B}, \mathcal{C}) \] of $\mathcal{O}$-monoidal $\infty$-categories for any $\mathcal{A},\mathcal{B}, \mathcal{C}\in {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)$. This induces a natural equivalence \[ {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{A}, {\rm Fun}^{\mathcal{O}}(\mathcal{B},\mathcal{C})) \simeq {\rm Fun}_{\mathcal{O}}^{\rm lax} (\mathcal{A}\times_{\mathcal{O}}\mathcal{B}, \mathcal{C}) \] of $\infty$-categories. \end{lemma} \proof Since we have a natural equivalence ${\rm Fun}_{\mathcal{O}}^{\rm lax}(\mathcal{O}, {\rm Fun}^{\mathcal{O}}(\mathcal{X},\mathcal{Y})) \simeq {\rm Fun}_{\mathcal{O}}^{\rm lax}(\mathcal{X},\mathcal{Y})$ for any $\mathcal{O}$-monoidal $\infty$-categories $\mathcal{X}$ and $\mathcal{Y}$ by \cite[Example~2.2.6.3]{Lurie2}, the second part follows from the first part. Thus, it suffices to show the first part. Let $L: {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)^{\rm op} \times {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)^{\rm op} \times {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat) \to {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)$ be the functor given by $L(\mathcal{A},\mathcal{B},\mathcal{C}) ={\rm Fun}^{\mathcal{O}}(A\times_{\mathcal{O}}\mathcal{B}, \mathcal{C})$, and let $R: {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)^{\rm op} \times {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)^{\rm op} \times {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat) \to {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)$ be the functor given by $R(\mathcal{A},\mathcal{B},\mathcal{C}) ={\rm Fun}^{\mathcal{O}}(A, {\rm Fun}^{\mathcal{O}}(\mathcal{B},\mathcal{C}))$. We will compare $L$ and $R$ with a functor $G: {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)^{\rm op} \times {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)^{\rm op} \times {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat) \to {\rm Fun}({\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)^{\rm op}, \widehat{\mathcal{S}})$ given by $G(\mathcal{A},\mathcal{B},\mathcal{C}) = (\mathcal{Z}\mapsto {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)} (\mathcal{Z}\times_{\mathcal{O}}\mathcal{A} \times_{\mathcal{O}}\mathcal{B},\mathcal{C}))$. By the universal property of ${\rm Fun}^{\mathcal{O}}(-,-)$, we see that $j\circ L$ and $j\circ R$ are equivalent to $G$, where $j: {\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat) \to {\rm Fun}({\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)^{\rm op}, \widehat{S})$ is the Yoneda embedding. Since $j$ is fully faithful, we obtain that $L$ is equivalent to $R$. \qed \begin{proposition \label{prop:fully-faithful-Nat-Fun} There is a fully faithful functor ${\rm Nat}(I,\mathbb{P}_{\mathcal{O}}^*\circ H)_A\to {\rm Map}_{\wcat} (E(Y/A),\mathcal{S})$ whose essential image is spanned by those functors $F: E(Y/A)\to \mathcal{S}$ which carry $q$-Cartesian morphisms to equivalences and whose restriction $F_{\phi}: E(Y/A)_{\phi}\to \mathcal{S}$ is an $E(Y/A)_{\phi}$-monoid object for each $\phi\in {\rm Tw}^l(A)$. \end{proposition} \proof By \cite[Proposition~5.1]{GHN} (or \cite[Proposition~2.3]{Glasman}), the space ${\rm Nat}(I,\mathbb{P}_{\mathcal{O}}^*\circ H)_A$ is equivalent to the end $\int_{t\in A} {\rm Map}_{{\rm Mon}_{\mathcal{O}}^{\rm lax}(\cat)} (Y_t,\mathbb{P}_{\mathcal{O}}(Y_t))$. By using Lemma~\ref{lemma:natural-eq-fun-O}, we have natural equivalences ${\rm Fun}_{\mathcal{O}}^{\rm lax} (Y_t,\mathbb{P}_{\mathcal{O}}(Y_s))\simeq {\rm Fun}_{\mathcal{O}}^{\rm lax} (Y_s^{\vee}\times_{\mathcal{O}^{\otimes}}Y_t, \mathcal{S}_{\mathcal{O}}^{\otimes}) \simeq {\rm Fun}^{\times} (Y_s^{\vee}\times_{\mathcal{O}^{\otimes}}Y_t, \mathcal{S})$, where ${\rm Fun}^{\times}(Y_s^{\vee}\times_{\mathcal{O}^{\otimes}}Y_t, \mathcal{S})$ is a full subcategory of ${\rm Fun}(Y_s^{\vee}\times_{\mathcal{O}^{\otimes}}Y_t, \mathcal{S})$ spanned by $Y_s^{\vee}\times_{\mathcal{O}^{\otimes}}Y_t$-monoid objects in $\mathcal{S}$. Hence we obtain a fully faithful functor ${\rm Nat}(I,\mathbb{P}_{\mathcal{O}}^*\circ H)_A\to \int_{t\in A} {\rm Map}_{\wcat} (Y_t^{\vee}\times_{\mathcal{O}^{\otimes}}Y_t,\mathcal{S}) \simeq {\rm Map}_{\wcat} (\int^{t\in A}Y_t^{\vee}\times_{\mathcal{O}^{\otimes}}Y_t, \mathcal{S})$, where $\int^{t\in A}Y_t^{\vee}\times_{\mathcal{O}^{\otimes}}Y_t$ is a coend in $\cat$. The coend $\int^{t\in A}(Y^{\vee})_t\times_{\mathcal{O}^{\otimes}}Y_t$ is a colimit of the composite functor ${\rm Tw}^l(A)\to A^{\rm op}\times A \stackrel{\chi}{\longrightarrow} \cat$, where $\chi$ classifies the Cartesian fibration $p_A^{\vee}\times p_A: Y^{\vee}\times_{\mathcal{O}^{\otimes}}Y\to A^{\rm op}\times A$. Hence it is obtained from $E(Y/A)$ by inverting all $q$-Cartesian morphisms by \cite[Corollary~3.3.4.3]{Lurie1}. Therefore, there is a fully faithful functor $ {\rm Map}_{\wcat} (\int^{t\in A}Y_t^{\vee}\times_{\mathcal{O}^{\otimes}}Y_t, \mathcal{S})\to {\rm Map}_{\wcat} (E(Y/A),\mathcal{S})$ whose essential image is spanned by those functors which carry $q$-Cartesian morphisms to equivalences. By composing these two fully faithful functors, we obtain the desired functor. \if0 whose essential image is spanned by those functors $F: EY\to\widehat{S}$ which carry $q$-Cartesian morphisms to equivalences and the restriction $F_{\phi}: EY_{\phi}\to\widehat{S}$ is an $EY_{\phi}$-monoid object for each $\phi\in {\rm Tw}^l(Y)$. \fi \qed \bigskip Next, we will construct a functor $B: E(Y/A)\to \mathcal{S}$ which lies in the essential image of the functor ${\rm Nat}(I,\mathbb{P}_{\mathcal{O}}^*\circ H)_A \to {\rm Map}_{\wcat} (E(Y/A),\mathcal{S})$ in Proposition~\ref{prop:fully-faithful-Nat-Fun}. By \cite[\S5]{BGN}, we have a fiberwise mapping space functor ${\rm Map}_{Y/\mathcal{O}^{\otimes}}: Y^{\vee}\times_{\mathcal{O}^{\otimes}}Y \to \mathcal{S}$ and an associated left fibration $\widetilde{O}(Y/\mathcal{O}^{\otimes}) \to Y^{\vee}\times_{\mathcal{O}^{\otimes}}Y$. By the naturality of construction, we have a map $\widetilde{O}(Y/\mathcal{O}^{\otimes}) \to \widetilde{O}(A/*)\simeq {\rm Tw}^l(A)$ which makes the following diagram commute \[ \begin{array}{ccc} \widetilde{O}(Y/\mathcal{O}^{\otimes}) &\longrightarrow & Y^{\vee}\times_{\mathcal{O}^{\otimes}}Y\\[1mm] \bigg\downarrow & & \phantom{\mbox{$\scriptstyle p_A^{\vee}\times p_A$}} \bigg\downarrow \mbox{$\scriptstyle p_A^{\vee}\times p_A$} \\[3mm] {\rm Tw}^l(A) & \longrightarrow & A^{\rm op}\times A.\\ \end{array}\] Hence we obtain a functor $\widetilde{O}(Y/\mathcal{O}^{\otimes}) \to E(Y/A)$. We will show that $\widetilde{O}(Y/\mathcal{O}^{\otimes}) \to E(Y/A)$ is a left fibration. The functor $E(Y/A)\to Y^{\vee}\times_{\mathcal{O}^{\otimes}}Y$ is a left fibration since it is obtained by pullback from the left fibration ${\rm Tw}^l(A)\to A^{\rm op}\times A$. Since the composite $\widetilde{O}(Y/\mathcal{O}^{\otimes}) \to E(Y/A)\to Y^{\vee}\times_{\mathcal{O}^{\otimes}}Y$ is a left fibration, the functor $\widetilde{O}(Y/\mathcal{O}^{\otimes}) \to E(Y/A)$ is also a left fibration. Hence we obtain an associated functor $B: E(Y/A)\to \mathcal{S}$ which assigns to $((y,y'),\phi)$ with $(y,y')\in Y^{\vee}\times_{\mathcal{O}^{\otimes}} Y$ and $\phi: p_A^{\vee}(y)\to p_A(y')$ the mapping space \[ {\rm Map}_{Y_o}^{\phi}(y,y')= {\rm Map}_{Y_o}(y,y')\times_{{\rm Map}_{A}(p_A^{\vee}(y),p_A(y'))} \{\phi\} ,\] where $o=p_{\mathcal{O}}^{\vee}(y)=p_{\mathcal{O}}(y')\in \mathcal{O}^{\otimes}$. \if0 Note that objects of $\widetilde{O}(Y/T)$ are tuples $((y,y'),\phi,f)$ with $(y,y')\in Y^{\vee}\times_{\mathcal{O}^{\otimes}}Y$, $\phi\in {\rm Tw}^l(T)\times_{T^{\rm op}\times T} \{(p_T^{\vee}(y),p_T(y'))\}$, and $f\in {\rm Map}_{Y/T}(y,y')$. We let $\widetilde{E}Y$ to be the full subcategory of $EY\times_{Y^{\vee}\times_{\mathcal{O}^{\otimes}}Y}\widetilde{O}(Y/T)$ spanned by those objects $((y,y'), \phi, f)$ such that $p_T(f)=\phi$. We can see that the induced map $\widehat{E}Y\to EY$ is a left fibration and hence we obtain a functor $EY\to\widehat{S}$ given by \[ (y,y',\phi)\mapsto {\rm Map}_{Y/T}(y,y')\times_{{\rm Map}_T(p_T^{\vee}(y),p_T(y'))} \{\phi\}.\] \fi We will show that the functor $B: E(Y/A)\to \mathcal{S}$ lies in the essential image of the fully faithful functor ${\rm Nat}(I,\mathbb{P}_{\mathcal{O}}^*\circ H)_A \to {\rm Map}_{\wcat} (E(Y/A),\mathcal{S})$ in Proposition~\ref{prop:fully-faithful-Nat-Fun}. \begin{lemma}\label{lemma:PO-star-extesion} The functor $B: E(Y/A)\to \mathcal{S}$ carries $q$-Cartesian morphisms to equivalences. \end{lemma} \proof We take a $q$-Cartesian morphism $\Phi: ((y,y'),\phi)\to ((\widetilde{y},\widetilde{y}'),\widetilde{\phi})$ of $E(Y/A)$. We may assume that $o=p_{\mathcal{O}}^{\vee}(y)=p_{\mathcal{O}}(y') =p_{\mathcal{O}}^{\vee}(\widetilde{y})=p_{\mathcal{O}}(\widetilde{y}') \in\mathcal{O}^{\otimes}$. We will show that $\Phi$ induces an equivalence between ${\rm Map}_{Y_o}^{\phi}(y,y')$ and ${\rm Map}_{Y_o}^{\widetilde{\phi}}(\widetilde{y},\widetilde{y}')$. We denote by $p_o :Y_o\to A$ the restriction of $p$ at $o\in\mathcal{O}^{\otimes}$ which is a Cartesian and coCartesian fibration. The morphism $\Phi$ consists of a $p_o$-coCartesian morphism $f: \widetilde{y}\to y$, a $p_o$-Cartesian morphism $g: y'\to \widetilde{y}'$, and a commutative diagram \[ \begin{array}{ccc} p_A(y)& \stackrel{\phi}{\longrightarrow} & p_A(y') \\[2mm] \mbox{$\scriptstyle p_A(f)$} \bigg \uparrow \phantom{\mbox{$\scriptstyle p_A(f)$}} & & \phantom{\mbox{$\scriptstyle p_A(g)$}} \bigg \downarrow \mbox{$\scriptstyle p_A(g)$} \\ p_A(\widetilde{y})& \stackrel{\widetilde{\phi}}{\longrightarrow} & p_A(\widetilde{y}'). \\ \end{array}\] \if0 the following data: \[ \begin{array}{ccccccc} y &\quad &y' &\qquad & p_A(y)& \stackrel{\phi}{\longrightarrow} & p_A(y') \\[2mm] \mbox{$\scriptstyle f$}\bigg\uparrow \phantom{\mbox{$\scriptstyle f$}} & & \mbox{$\scriptstyle g$}\bigg\downarrow \phantom{\mbox{$\scriptstyle g$}} & & \mbox{$\scriptstyle p_A(f)$} \bigg\uparrow \phantom{\mbox{$\scriptstyle p_A(f)$}} & & \phantom{\mbox{$\scriptstyle p_A(g)$}} \bigg\downarrow \mbox{$\scriptstyle p_A(g)$} \\ \widetilde{y} & &\widetilde{y}' & & p_A(\widetilde{y})& \stackrel{\widetilde{\phi}}{\longrightarrow} & p_A(\widetilde{y}'), \\ \end{array}\] where $f$ is a $p_o$-coCartesian morphism, $g$ is a $p_o$-Cartesian morphism, and the right square is commutative in $A$. \fi By using $p_A(f)_!(\widetilde{y})\simeq y$, $p_A(g)^*(\widetilde{y}')\simeq y'$, and fiberwise adjointness, we have an equivalence \[ {\rm Map}_{Y_{(a,o)}}(y, \phi^*(y')) \simeq {\rm Map}_{Y_{(\widetilde{a},o)}}(\widetilde{y}, \widetilde{\phi}^*(\widetilde{y}')),\] where $a=p_A(y)$ and $\widetilde{a}=p_A(\widetilde{y})$. Combining equivalences ${\rm Map}_{Y_o}^{\phi}(y,y')\simeq {\rm Map}_{Y_{(a,o)}}(y,\phi^*(y'))$ and ${\rm Map}_{Y_o}^{\widetilde{\phi}}(\widetilde{y},\widetilde{y}') \simeq {\rm Map}_{Y_{(\widetilde{a},o)}}(\widetilde{y}, \widetilde{\phi}^*(\widetilde{y}'))$, we obtain the desired equivalence. \if0 ${\rm Map}_{Y_o}^{\widetilde{\phi}}(\widetilde{y},\widetilde{y}') \simeq {\rm Map}_{Y_o}^{\phi}(y,y')$. \if0 Hence we obtain equivalences \[ \begin{array}{rcl} {\rm Map}_{Y_o}^{\widetilde{\phi}}(\widetilde{y},\widetilde{y}') &\simeq& {\rm Map}_{Y_{(\widetilde{a},o)}}(\widetilde{y}, \widetilde{\phi}^*(\widetilde{y}'))\\ &\simeq& {\rm Map}_{Y_{(a,o)}}(y,\phi^*(y')) \\ &\simeq&{\rm Map}_{Y_o}^{\phi}(y,y'). \end{array} \] \fi Therefore, we see that $B$ carries $q$-Cartesian morphisms to equivalences. \fi \qed \begin{lemma}\label{lemma:EYA-phi-monoid} The restriction $B_{\phi}: E(Y/A)_{\phi}\to\mathcal{S}$ is an $E(Y/A)_{\phi}$-monoid object for any $\phi\in {\rm Tw}^l(A)$. \end{lemma} \proof Suppose that $\phi: s\to t$ in $A$. If $o\simeq o_1\oplus\cdots\oplus o_n$, where $o_i\in\mathcal{O}$ for $1\le i\le n$, then $Y_o\simeq Y_{o_1}\times_A\cdots\times_AY_{o_n}$. We take $y\in Y_s$ and $y'\in Y_t$ which correspond to $(y_1,\ldots,y_n)$ and $(y_1',\ldots,y_n')$ under this equivalence, respectively. We have to show that $B_{\phi}$ induces an equivalence ${\rm Map}_{Y_o}^{\phi}(y,y')\simeq {\rm Map}_{Y_{o_1}}^{\phi}(y_1,y_1') \times\cdots\times {\rm Map}_{Y_{o_n}}^{\phi}(y_n,y_n')$. This follows from the naturality of fiberwise mapping spaces and an equivalence ${\rm Map}_{Y_o}(y,y')\simeq {\rm Map}_{Y_{o_1}}(y_1,y_1') \times_{{\rm Map}_A(s,t)}\cdots\times_{{\rm Map}_A(s,t)} {\rm Map}_{Y_{o_n}}(y_n,y_n')$. \qed \bigskip By Lemmas~\ref{lemma:PO-star-extesion} and \ref{lemma:EYA-phi-monoid}, the functor $B$ lies in the essential image of the fully faithful functor ${\rm Nat}(I,\mathbb{P}_{\mathcal{O}}^*\circ H)_A \to {\rm Map}_{\wcat} (E(Y/A),\mathcal{S})$ in Proposition~\ref{prop:fully-faithful-Nat-Fun}, and hence we obtain a natural transformation $\beta^A: I\circ {\rm St}(p)\to \mathbb{P}_{\mathcal{O}}^*\circ H\circ {\rm St}(p)$. In particular, by taking ${\rm St}(p)$ as the identity functor $A^{\rm op}={\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)\to {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)$, we obtain a natural transformation $\beta: I\to \mathbb{P}_{\mathcal{O}}^*\circ H$. We recall that $H(\mathcal{C})=\mathcal{C}$ for each $\mathcal{C}\in {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)$. By construction, we see that $\beta_{\mathcal{C}}\simeq J_{\mathcal{C}}$. Therefore, we obtain the following corollary. \begin{corollary} The functor $\mathbb{P}_{\mathcal{O}}^*\circ H$ extends to an object $(\beta: I\to \mathbb{P}_{\mathcal{O}}^*\circ H)$ of $\mathcal{F}$ such that $\beta_{\mathcal{C}}\simeq J_{\mathcal{C}}$ for each $\mathcal{C}\in {\rm Mon}_{\mathcal{O}}^{\rm lax,R}(\cat)$. \end{corollary} By Lemma~\ref{lemma:characterization-initial-F}, we have a canonical equivalence between the natural transformations $(\alpha: I\to \mathbb{P}_{\mathcal{O}!})$ and $(\beta: I\to \mathbb{P}_{\mathcal{O}}^*\circ H)$. Hence, we obtain an equivalence $\gamma: \mathbb{P}_{\mathcal{O}!} \stackrel{\simeq}{\to}\mathbb{P}_{\mathcal{O}}^*\circ H$ such that $\gamma\circ \alpha\simeq \beta$. Since $\alpha_{\mathcal{C}}\simeq J_{\mathcal{C}}$ and $\beta_{\mathcal{C}}\simeq J_{\mathcal{C}}$, we obtain that $\gamma_{\mathcal{C}}\simeq {\rm id}_{\mathcal{C}}^*$. Therefore, by Lemma~\ref{lemma:characterizetion-eq}, we can regard the pair $(H,\gamma)$ as an object of ${\mathcal Eq}$ and we obtain the following theorem by Theorem~\ref{thm:uniqueness-equivalences}. \begin{theorem}\label{thm:T-eq-H} The pair $(T,\theta)$ is canonically equivalent to $(H,\gamma)$. \end{theorem} This theorem implies the following corollary. \begin{corollary}\label{cor:main-claim} The equivalence $T$ in \cite{Torii4} is equivalent to the restriction $H$ of the equivalence in \cite{HHLN1}. \end{corollary}
\section{Introduction} We humans effortlessly perform a plethora of manipulation tasks in our everyday lives, for example opening cabinets, cutting vegetables, pouring coffee, turning knobs, etc. A common goal in the rapidly growing area of (data-driven) robot learning is to develop agents that can similarly perform diverse tasks in unstructured settings. Deep reinforcement learning based methods~\cite{mtopt} provide a framework that allows robots to continually improve at performing generic tasks by optimizing a corresponding reward. However, the sample (in)efficiency, the need for online interactions, and the difficulty in designing rewards and environment resets typically narrows their application to specific tasks in structured environments. An alternate approach is to directly learn action policies from robot demonstrations with experts~\cite{Pomerleau1989,visual_imitation1}. While demonstrations across varied settings and tasks can in principle allow learning the desired diverse behaviors, these are typically collected either through tele-operation or kinesthetic teaching and are thus difficult to scale. Moreover, both the online interactions and the robot demonstrations used in these approaches apriori require task definitions, and are restricted to lab settings with little variation, thus being a far cry from the diverse data required to train generalist robots effective in unknown unstructured environments. Is there an alternate source of data that can enable learning for robot manipulation? In this work, we show that videos of humans interacting with objects as they accomplish everyday tasks serve as a readily available source of such large-scale data. Specifically, we show that modeling the observed motion of the human hands across human-object interaction videos allows \emph{zero-shot} prediction of the actions a robot should take to achieve goals in its environment. We develop a framework where given an initial image, the model learns to predict the sequence of motions of a human hand acting in the scene in subsequent frames. In particular, the predictions involve predicting a 6D pose of a point on the center of the palm of the human hand, over a 2 second future horizon from the initial image. Since there are several different plausible actions possible in scene, we make the model stochastic, and train it with diverse egocentric videos from existing datasets like Epic-Kitchens~\cite{epic}. Due to the scale and diversity of the human videos, the prediction model allows us to perform zero-shot action prediction in different physical environments with novel objects. We call such human videos \textit{passive} as they haven't been actively collected for the purpose of robot learning with any task-level segregation, and our framework \textit{zero-shot} because there are no in-lab demonstrations or fine-tuning. Fig.~\ref{fig:teaser} shows an overview of our framework for zero-Shot robot manipulation from passive Human videos \begin{figure} \centering \includegraphics[width=\textwidth]{hand_teaser.PNG} \caption{\footnotesize Overview of the proposed framework for zero-shot robot manipulation from passive human videos. Our approach is based on hand trajectory prediction given an image of a scene, from human videos on the web, and transforming the predictions for zero-shot robot manipulation given an unseen scene in the lab.} \label{fig:teaser} \end{figure} We develop two versions of the framework: un-conditioned, and goal-conditioned. The un-conditioned model predicts plausible trajectories given a scene, and corresponds to realizing the different affordances of objects in a scene that can be helpful for downstream exploration. The goal-conditioned model is further prompted with a goal image to predict trajectories that reach the specified goal, and is helpful in achieving targeted behavior. To manipulate a robot with the predictions, we transform them to the end-effector space of the robot, and use a simple IK controller to execute the motion of the trajectory. We show that this simple approach works reliably well with around 40-60\% success rate for unconditionally manipulating objects like toasters, drawers, bowls etc. (see Fig.~\ref{fig:scene_objects}) and with around 30-40\% success rate for goal-conditioned manipulation. Finally, we note that incorporating some kind of fine-tuning with environment-specific data would definitely lead to better performance, for fine-grained manipulation tasks, but our current framework is a surprisingly strong baseline of what can be done zero-shot from robot-agnostic human data. \section{Related Works} We discuss prior works that attempt understanding of human activities in videos through detection of hand-poses, semantic tasks, visual feature extraction, and activity forecasting. We follow this with a discussion of papers that learn robot manipulation skills from videos of humans and robots performing different activities. \\ \noindent\textbf{Scaling Human-Object Interaction Understanding.} Understanding human activities has recently received a lot of interest with development of large-scale datasets~\cite{smthsmth,youcook,cmudata,ego4d} that involve recording videos of humans doing cooking related activities in their kitchen~\cite{epic,egtea}, short clips involving manipulating objects~\cite{smthsmth}, and more diverse and long clips of activities both inside and outside homes~\cite{ego4d,Shan20}. Based on these large datasets of human videos, several prior works have focused on understanding human-object interactions~\cite{Shan20,ye2022s}. Specifically, prior work has investigated object pose estimation~\cite{Kehl2017SSD6DMR,Rad2017BB8AS,Xiang2018PoseCNNAC,Hu2019SegmentationDriven6O,He2020PVN3DAD}, hand pose estimation~\cite{zimmermann2017learning,iqbal2018hand,spurr2018cvpr,ge20193d,baek2019pushing,boukhayma20193d,hasson2019learning,dkulon2020cvpr,liu2021semi}, full body pose estimation~\cite{rong2020frankmocap}, and hand-object joint pose estimation~\cite{ye2022s,GarciaHernando2018FirstPersonHA,hampali2020honnotate,liu2021semi,chao2021dexycb}. These efforts have been aptly complemented by datasets of 3D scans of real objects -- like YCB~\cite{calli2015benchmarking}, and Google Obbject Scans~\cite{downs2022google} that humans typically interact with. Another line of work has investigated learning interaction hotspots~\cite{nagarajan2019grounded,liu2022joint,goyal2022human} from videos, and predicting plausible grasps~\cite{mo2021where2act,brahmbhatt2019contactgrasp}. Building upon these developments, which focused primarily on visual understanding, our work focuses on \textit{closing the vision-robotics loop} by using large passive datasets of human videos. We learn plausible hand trajectories for interaction with objects, and deploy them for real robot manipulation. In the next sub-section we outline how our framework differs from robot learning approaches that learn manipulation skills from videos.\\ \noindent\textbf{Robot Manipulation from Videos} Recent developments in robotics has extensively focused on using increasingly unstructured data. Visual imitation learning approaches aim to learn control policies from datasets of visual observations and robot actions~\cite{visual_imitation1,visual_imitation2,visual_imitation3}. Behavior cloning~\cite{Pomerleau1989,Bain1995,ross2010efficient,Bojarski2016,Torabi2018b} and inverse reinforcement learning ~\cite{Russell1998,Ng2000,Abbeel2004,Ho2016,Fu2017,Aytar2018,Torabi2018g,Liu2020} are two popular approaches in this regime, but are difficult to scale to unseen scenes as they require high quality in-domain expert robot trajectories (typically) with a human controlling the robot. To alleviate the need for collecting high quality robot data, some approaches have used videos of humans doing things~\cite{schmeckpeper2019learning,chang2020semantic,schmeckpeper2020reinforcement,shawvideodex,shao2020concept,song2020grasping,young2020visual} for learning control policies either through imitation of reinforcement learning. However, for imitation, data needs to be collected through special hardware interfaces by humans in different scenes for visual imitation~\cite{young2020visual,song2020grasping} which is hard to scale. For the RL based approaches, the frameworks require simulation environments for online interactions with resets and rewards to provide feedback during learning~\cite{shao2020concept,schmeckpeper2020reinforcement}. Compared to these approaches, we do not require any specially collected data, or simulators for learning, thereby generalizing zero-shot to unknown tasks. Other works have investigated learning robot motions through a direct imitation of a corresponding human video in the scene~\cite{Peng2018s,Pathak2018,Sharma2018,sieb2020graph,sivakumar2022robotic,garcia2020physics,xiong2021learning,Sermanet2018,sharma19thirdperson,smith2019avid,peng2020learning,bahl2022human,qin2021dexmv}. Some of these approaches~\cite{smith2019avid,xiong2021learning} although do not require large-scale datasets, requre near-perfect alignment in the poses of the robot and human arms. Recent works~\cite{bahl2022human} have alleviated the need for this perfect alignment, through in-painting of humans from the scene to construct a reward function, but they still require per-task online fine-tuning through RL, which is expensive in the real-world. DexMV~\cite{qin2021dexmv} combines a vision and simulation pipeline to effectively translate human videos to dextrous hand motions, but requires several in-lab human videos for training and cannot utilize existing human videos on the web. Compared to these prior works, we extract agent-agnostic representations in the form of hand-trajectories from human videos on the internet. Instead of having a video stream to mimic directly, we learn a scene-conditioned trajectory prediction model that relies on a single image observation as input and can be directly used for robot manipulation zero-shot. This enables generalization of manipulation capabilities to unseen scenes, without apriori notions of task specification. \section{Approach} Motivated by the intuitive understanding humans have about how a scene can be manipulated in interesting ways, we develop a computational framework that can endow robots with similar manipulation skills, by only observing videos of humans interacting with objects in diverse unstructured settings. Specifically, given an initial image of a scene $o_1$ from a single viewpoint, we learn a model $p(a_{1:T}|o_1)$ that predicts future actions $ a_{1:T}$ taken by humans while interacting in the scene. We focus on table-top manipulation setting where $a_{1:T}$ corresponds to plausible 6D poses of a right human hand. In order to make the framework generally applicable for a robot arm with a simple end-effector like a two-finger gripper, we do not model the hand articulation (i.e. how each joint is oriented with respect to the wrist), and focus on predicting only the position and orientation of the palm of the hand. After training this prediction model across diverse internet videos, we apply it to an in-lab setting with no additional fine-tuning on lab data, for manipulating objects like drawers, cabinets, and doors on a table top setting with a fixed camera. \subsection{Learning to Predict Future Hand Trajectories} Given an image of a scene, there could be several plausible trajectories that modify objects in the scene. To capture this multi-modality, we develop a stochastic model for $p(a_{1:T}|o_1)$ such that different samples from the model yield different trajectories. Instead of predicting absolute hand poses at each time-step $h_t$, we predict delta actions $a_t = h_{t} \ominus h_{t-1}$, where $\ominus$ is an appropriate ``difference operator." This minimizes error in predictions by reducing the absolute magnitude of model predictions. In addition, to enforce temporal correlation, the model is auto-regressive such that it takes in previous actions within a trajectory as input while predicting the next action. In the next sub-sections, we describe the prediction model architecture, and the pre-processing of data for training the model. \subsubsection{Model Architecture} \label{sec:model} \begin{wrapfigure}[11]{R}{0.7\textwidth} \centering \vspace{-2em} \includegraphics[width=0.7\textwidth]{hand_architecture.PNG} \vspace{-1.5em} \caption{\footnotesize Architecture of the hand trajectory prediction model showing the unconditioned trajectory prediction model given features of the initial scene. On the right we show the process of inference from the model. Details are mentioned in section~\ref{sec:model}} \label{fig:architecture} \end{wrapfigure} The hand prediction model is an Image Transformer~\cite{bertasius2021space,chen2020generative}, with an Encoder-Decoder architecture, and a final C-VAE hand trajectory prediction head conditioned on the decoder feature outputs. We show an overview of the architecture in Fig.~\ref{fig:architecture}. Similar to prior works~\cite{rulstm,wang2016temporal}, we first extract features offline from the initial image $o_1$, and denote it as $f_1$. The feature $f_1$ is encoded by the transformer encoder $\mathcal{E}$ into a latent code $z^e_1$. The transformer decoder $\mathcal{D}$ conditions on the latent code $z^e_1$ and the previous actions $a_{1:t-1}$ to output the feature for action prediction at time-step $t$, $z^d_t$ . During training, a CVAE takes as input the action $a_t$ and conditional context $z^d_t$, and outputs reconstruction $\hat{a_t}$. During inference, we simply sample from the prior of this CVAE, concatenated with the predicted context $z^d_t$, and obtain the sampled delta action $\hat{a_t}$. After obtaining the delta actions we can recover the predicted actions as $\hat{a_t} = \hat{a_{t-1}} \oplus \hat{a_t}$ $\forall t>1$, \VK{11/26:Check this. Should it be $\hat{h_{t-1}} \oplus \hat{a_t}$?} where $\oplus$ is an appropriate ``addition operator." For the goal-conditioned model, the Transformer encoder also takes in a goal image embedding $f_g$ with appropriate positional embedding, and outputs $z_g^e$. We mention specific details of the models in the Appendix. \shubham{Notation suggestion: I don't like $a_t$ (which should be an 'action' as the variable for hand pose, and $\delta a_t$ then being called `delta action'. Can't we use $h_t$ and $a_t$ instead?)}\HB{done. I will double check for consistency throughout} \noindent\textbf{Transformer.} The transformer encoder and decoder consist of several stacked blocks of operations that involve attention and MLP with LayerNorm. The decoder blocks have cross-attention with the query and value tokens being the encoded code $z^e_1$. Whereas, in the encoder the attention blocks are all self-attention. \noindent\textbf{CVAE.} The CVAE prediction head at each time-step consists of an encoder $e_{\text{cvae}}(\cdot)$ and a decoder $d_{\text{cvae}}(\cdot)$ neural networks. Conditioned on the predicted feature from the transformer decoder $z^d_t$, and the current delta action $a_t$ as input, the CVAE encoder outputs the mean $\mu_t$ and S.D. $\sigma_t$ of a Gaussian distribution. The CVAE decoder samples from this Gaussian and outputs a predicted delta action $\hat{ a_t}$. Formally, $ \mu_t,\sigma_t = e_{\text{cvae}}(a_t; z^d_t) \;\;\;\;\;\; z\sim\mathcal{N}(\mu_t,\sigma_t)\;\;\;\;\;\; \hat{a_t} = d_{\text{cvae}}(z) $ \noindent\textbf{Training loss.} The overall training loss is defined in terms of the output of the CVAE per-timestep aggregated over all time-steps $T$ in the prediction horizon. \begin{align*} \mathcal{L} = \sum_{t=2}^T\left[|| a_t - \hat{ a_t}||^2 - D_{\text{KL}}\left(\mathcal{N}(\mu_t,\sigma_t) ||\mathcal{N}(0,1)\right)\right] \end{align*} This overall loss is backpropagated through the entire prediction model that involves both the Transformer and the CVAE (through re-parameterization), and there is no intermediate supervision for any of the stages. This makes the approach generally applicable to in-the-wild human videos and reduces pre-processing overhead for training data, as described in the next section. In addition, the learned model is task-agnostic since there is no task-specific distinction in the human video clips, and given unseen scenes, it allows performing \textit{plausible} tasks zero-shot. \subsubsection{Training Data Generation} We consider 2 second clips of egocentric videos from Epic-Kitchens that involve people doing everyday household activities, especially in the kitchen, like cooking food, opening cabinets, moving objects from one location to another etc. For the goal-conditioned model, the last image of the clip corresponds to the goal that is input to the model. To obtain ground-truth poses of the hand in the frames within prediction window, we run hand-tracking with an off-the-shelf FrankMocap model~\cite{rong2020frankmocap}. FrankMocap outputs a weak-perspective camera $(t_x,t_y,s)$ and $(x,y,z)$ locations of all the hand joints, and orientation of the hand $(\alpha,\beta,\gamma)$ relative to a canonical hand. We only consider the center of the palm, and record its 6D pose relative to the predicted camera in the beginning of the 2 second window. In summary, the training data consists of pairs $\{(o_1,h_{1:T})\}$ where $o_1$ is the first image of a video clip and $h_t=(x_t,y_t,s_t,t_x,t_y,\alpha,\beta,\gamma)$ is the hand pose and camera parameters at future time $t$. \begin{figure}[t] \centering \includegraphics[width=\textwidth]{objects.PNG} \caption{\footnotesize Figure showing a few configurations of the objects we place in the scene for our experiments, with green arrows denoting plausible motions; from left to right in the top row: a door with a vertical hinge, a bowl of fruits, a chopping board with veggies; in the bottom row: a toaster oven with horizontal hinge, a stack of two drawers, and a vegetable strainer. \VK{11/19: placement of object isn't something that will impress. What this figure needs to communicate is the diversity of tasks we can handle. Think how to communicate that instead. See task and dataset figure here -- https://sites.google.com/view/real-orl for motivation}\HB{Did you mean showing tasks through arrows?} \VK{11/26: Yes either through arrows or layered images with transparency that shows the tasks.}\HB{done}} \label{fig:scene_objects} \end{figure} \subsection{Mapping Trajectories to the Robot's Frame} After training the overall hand pose prediction model, $p_\psi( a_{1:T}|o_1)$ with diverse internet videos, we deploy it directly for robot manipulation tasks in the lab. The robot sees an image of the scene through a fixed camera, and optionally receives a goal-image which is input to the prediction model. In order to use the actions predicted by the model $a_{1:T}$ for moving the robot, we need to transform them to the world coordinate frame of the robot, and considering each action $a_t$ as an end-effector target pose, use a low-level controller for executing the respective motions. The camera in the scene is calibrated, so the intrinsic matrix $I$ and the extrinsic matrix $[R,T]$ are known. The world coordinates are located at the base of the robot (robot base is at same height as the table top) and the height of the table top from the camera is known and approximately constant. Given scene from the camera $o_1$, the model predicts delta actions $a_{1:T}$ which we convert to absolute actions (described in section~\ref{sec:model}), and transform the actions from the camera frame to the world frame of the robot through inverse projection transformation. The prediction horizon is $T=7$ for our experiments. After obtaining the world coordinates of the action sequence $\{(X_t,Y_t,Z_t,\alpha_t,\beta_t,\gamma_t)\}_{t=1}^T$, we use an IK controller to execute the corresponding motion for bringing the end-effector to the desired position and orientation and each time-step. We describe additional details in the Appendix. \section{Experiment Design} \begin{wrapfigure}[14]{R}{0.3\textwidth} \centering \vspace{-2em} \includegraphics[width=0.3\textwidth]{workspace_labeled.PNG} \vspace{-1em} \caption{\footnotesize Robot workspace showing the camera, an object in the scene, the Franka arm, and it's end-effector. \VK{11/26: The labels are blocking a lot of the image. Lets iterate on this figure. Also, improve caption}\HB{done}} \label{fig:workspace} \end{wrapfigure} Through experiments, we aim to understand the following research questions: \begin{itemize} \item In unknown tasks, how good is our unconditional model in generating diverse but plausible task outcomes? \item In known tasks, how good is our goal-conditional model and action mapping to solve tasks? \end{itemize} Qualitatively, we visualize the diversity and plausibility of trajectories executed for different scenes with the unconditioned model. For quantitative evaluations, we compare success rates of the both the unconditioned model predictions when the robot is placed in different scenes, and the goal-conditioned model when prompted in addition with a desired goal configuration of objects. We compare against a 3D scene flow~\cite{sceneflow,raft3d} baseline that uses RAFT3D~\cite{raft3d} for predicting scene flow field between the initial and goal images, and uses the dominant flow direction to guide the motion of the robot. To test the importance of training across diverse data, we compare against a version of our method that is trained on only 30\% of the total training data. We mention additional details of the setup, objects, tools, and comparisons for the experiments in the Appendix\footnote{\url{https://sites.google.com/view/human-0shot-robot}}. \textbf{Experimental setup}: The workspace shown in Fig.~\ref{fig:workspace} is a white table with a camera in one of the corners, and the robot base on it's opposite edge. In Fig.~\ref{fig:scene_objects}, we show the different objects we place in the scene for our experiments. Note that all of the objects \VK{11/19: Lets talk in terms of tasks/activities, not objects}\HB{I'll take a stab at harmonizing, but am inclined to still talk largely in terms of objects placed in the scene, because we are pitching the framework as task-agnostic throughout} are unseen by definition because the egocentric videos used for training our models are from existing datasets on the web and do not involve any in-lab data. \section{Results} In this section, we discuss results for the un-conditional, and goal-conditional models followed by an analysis of failures. We show both qualitative results for visualization, and quantitative evaluations over several trials. \subsection{Un-conditional generation results} \begin{wrapfigure}[13]{R}{0.5\textwidth} \centering \vspace{-1em} \includegraphics[width=0.5\textwidth]{histogram.PNG}% \vspace{-0.8em} \caption{\footnotesize Fine-grained analysis of the door opening task. Histogram shows number of trials (out of 15) that open the door to a certain angle.} \label{fig:doorfine} \end{wrapfigure} For the un-conditional generations, given a scene, the model predicts a sequence of actions, which are executed by the robot. We evaluate the model in terms of whether the trajectories executed by the robot correspond to \textit{plausible} interactions in the scene that a human is likely to do. For example, a closed door can be opened, and a bowl of fruits can be moved around on the table i.e. given a scene, there is a distribution of plausible object state changes. Fig.~\ref{fig:unconditional_qual} shows visualizations of of predicted trajectories executed by the robot in different initial scenes. In Table~\ref{tb:unconditional} we analyze the unconditioned model generations quantitatively, for different objects in the scene with definitions of success criteria different for different objects. For a door, drawer, and toaster, success is when the robot changes objects' state - from open to close or vice versa. For the bowl, success is when the bowl is moved from an initial position to a different position without toppling. From the table we see that success rates vary between 45\% and 55\% indicating that the model is able to predict trajectories that perform plausible interactions in a scene. Fig.~\ref{fig:doorfine}, we perform a finer analysis of the model predictions when a closed door is placed in the scene, and observe that over 70\% of the trials open the door to non-zero angle, indicating plausible state change of the object. \begin{table}[t] \centering \caption{\footnotesize Quantitative evaluation results for the unconditioned model, with 20 trials for each object. For each object, we measure success differently. For a door, drawer, and toaster, success is when the robot opens the respective object from a closed initial position, or closes the respective object from an open initial position. For the bowl, success is when the bowl is moved from an initial position to a different position without toppling. For the moving of veggies task, success is when at least half the pieces on the table are moved.} \begin{tabular}{@{}ccccccc@{}} \toprule & \textbf{Drawer} & \textbf{Door} & \textbf{Toaster} & \textbf{Bowl} & \textbf{Veggies} & \textbf{Average} \\ \midrule \textbf{Our method} & 50\% & 45\% & 50\% & 55\% & 50\% & 50\% \\ \textbf{Our method (less data)} & 10\% & 10\% & 15\% & 20\% & 15\% & 14\% \\ \bottomrule \end{tabular} \label{tb:unconditional} \end{table} \begin{figure}[h!] \centering \includegraphics[width=\textwidth]{unconditioned_qual_finalposes.PNG} \caption{\footnotesize Figure showing final configurations corresponding to different executed trajectories (trial ids 1,2,3) by the unconditional model in the scenes, showing the diversity of plausible behaviors predicted by our model.} \label{fig:unconditional_qual} \vspace*{-0.5cm} \end{figure} \subsection{Goal-conditioned generation results} In addition to executing plausible trajectories in a given scene, we want to understand how effective is the goal-conditioned model in generating trajectories that reach a specified goal from an initial scene. Fig.~\ref{fig:goalconditioned_qual} shows results for trajectories corresponding to different goal images. In Table~\ref{tb:goalconditional} we show quantitative results for different types of goal images. For each setting, we randomize the initial pose of the object, for example for a `open door' goal image, the initial position of the door is either closed, or is half-open. We see that the goal-conditioned model succeeds in predicting trajectories that succeed on an average around 37\% of the times, which is lower than that of the unconditioned model because the task of reaching a particular goal is more difficult than bringing unconditional changes to a scene. We observe better performance compared to the baselines trained on less data, and the scene flow baseline. In Table~\ref{tb:ungoal} we do a finer analysis of our model for a certain scene with stacked drawers and observe that when conditioned on a goal, the goal-conditioned model reaches the final configuration specified by the goal more number of times than the unconditional model reaches the same. This demonstrates that goal-conditioning actually leads to predicted trajectories consistent with the specified goal. \begin{table}[h!] \vspace*{-0.5cm} \centering \caption{\footnotesize Quantitative evaluation results for the goal-conditioned model, with 20 trials for each goal category. Each column denotes the type of goal image specified. In the drawer object, we aggregate results for the top and bottom drawers in the opening and closing tasks, respectively.} \begin{tabular}{@{}cccccccc@{}} \toprule & \textbf{\begin{tabular}[c]{@{}c@{}}Open \\ Drawer\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Open \\ Door\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Close \\ Drawer\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Close \\ Door\end{tabular}} & \textbf{\begin{tabular}[c]{@{}c@{}}Move \\ Bowl\end{tabular}}& \textbf{\begin{tabular}[c]{@{}c@{}}Move \\ Veggies\end{tabular}} & \textbf{Average}\\ \midrule \textbf{\begin{tabular}[c]{@{}c@{}}Our method\end{tabular}} & 35\% & 30\% & 35\% & 40\% & 45\% & 35\% & 37\% \\ \textbf{\begin{tabular}[c]{@{}c@{}}Our (less data)\end{tabular}} & 10\% & 5\% & 10\% & 15\% & 15\% & 10\% & 11\% \\ \textbf{\begin{tabular}[c]{@{}c@{}}3D Scene Flow\end{tabular}} & 15\% & 15\% & 5\% & 10\% & 15\% & 10\% & 12\% \\\bottomrule \end{tabular} \label{tb:goalconditional} \end{table} \setlength{\tabcolsep}{4pt} \begin{table}[h!] \vspace*{-0.3cm} \centering \caption{\footnotesize Given a scene with bottom drawer half open, and top drawer closed, we evaluate 10 trials of the unconditioned model, and count trials (out of 10) that reach a certain final configurations . We compare this to the goal-conditioned model that gets conditioned on a goal corresponding to a final configuration (10 trials per goal).} \begin{tabular}{@{}cccc@{}} \toprule \textbf{Final Config Reached./ Goal} & \textbf{Top Open} & \textbf{Bottom Open} & \textbf{Bottom Close} \\ \midrule \textbf{Unconditioned (10 trials overall)} & 1/10 & 3/10 & 2/10 \\ \midrule \textbf{Goal-conditioned (10 trials each)} & 3/10 & 4/10 & 4/10 \\ \bottomrule \end{tabular} \label{tb:ungoal} \vspace*{-0.3cm} \end{table} \begin{figure}[t] \centering \includegraphics[width=\textwidth]{goal_cond_qual.PNG} \caption{\footnotesize Figure showing different goal-conditioned robot evaluations for goals corresponding to the one shown on the left. Each row corresponds to a sub-sampled trajectory, respectively showing top and bottom drawers being opened, door being opened and closed, and veggies being moved on a table.} \label{fig:goalconditioned_qual} \vspace*{-0.7cm} \end{figure} \subsection{Analysis of failures} For the unconditioned model, we observe two primary failure modes: when the robot fails to make contact with the object in the initial time-step (about 40\% of all failures) and when it does make contact, but the resulting motion is not feasible and the robot gets stuck (about 60\% of all failures). The second failure mode corresponds to a predicted trajectory that doesn't align with the affordances of the respective object, for example trying to pull a door outwards, or pressing against the side of a bowl resulting in the bowl toppling on the table. In addition to the above failures, for the goal conditioned model we observe a third failure mode, where the executed trajectory is plausible (for example a closer drawer is opened) but doesn't correspond to the specified goal (for example the goal shows the top drawer opened, whereas the executed trajectory opens the bottom drawer). This corresponds to about 40\% failures of the model. \section{Discussion and Conclusion} In this paper we developed an approach for predicting plausible action trajectories from passive human videos, for zero-shot robot interaction given a scene with objects. After learning a model to predict agent-agnostic action trajectories from human videos on the web, we transformed the predictions to the robot's embodiment, and executed the motions zero-shot in a robot workspace without fine-tuning on any in-lab data. For everyday objects like drawers, toaster ovens, doors, and fruit bowls we observed that the predicted trajectories performed plausible interactions with a success rate of around 50\%, for example opening a drawer that is closed, and moving a bowl on the table. We further developed a goal-conditioned version of the model that conditions on an initial image of a scene, and a goal image, trained again from egocentric human videos on the internet where the goal image is a final image of a video clip. When the goal-conditioned model is deployed in the robot workspace, we observed around 40\% success rate in reaching a specified goal, for example a door fully open, from an initial scene, for example a door half open. We believe our approach for scene-conditioned action trajectory generation would help understand the limits of extracting action representations from passive human videos alone, such that they are useful for robot manipulation zero-shot without any fine-tuning. \newpage \clearpage
\section{Introduction} \label{sec:intro} Traditional image compression standards such as JPEG~\cite{wallace1991jpeg} and JPEG2000~\cite{rabbani2002overview} were developed mostly with natural images in mind. However, with the rise of remote work and collaboration, transmission of screen content images (SCI) has become important. Recognizing this, a screen content coding extension~\cite{HEVC-SCC} was developed for High Efficiency Video Coding (HEVC). More recently, low-level coding techniques tailored to screen content were introduced into the Versatile Video Coding (VVC) standard~\cite{peng2016overview,bross2021overview,xu2021overview}. Due to the unique signal characteristics of SCIs, such as sharp edges, repetitive patterns, and the absence of noise, many encoding techniques that are effective for natural images are either ineffective or less efficient for SCIs~\cite{nguyen2021overview}. As an example, Fig.~\ref{fig:img-sample} shows one natural and one screen content image along with their luminance histograms. It is easy to see that the histograms are very different. Also the effect of coding artifacts in the two types of images can be different~\cite{SCI_Quality_wavelet}. For instance, quality loss near the edges is a common side effect of compressing natural images; yet, if done right, it may be imperceptible. However, in synthetic images, blurring of sharp edges (e.g., in SCIs showing text) can be quite noticeable and annoying, and may affect the ability of the viewer to understand the text.   \begin{figure}[t] \centering \includegraphics[width=0.49\textwidth]{img1.png} \caption{Top: a natural image from the CLIC dataset~\cite{CLIC2020} and its luma histogram. Bottom: a SCI from the SCID dataset~\cite{ni2017esim} and its luma histogram.} \label{fig:img-sample} \end{figure} In the meantime, steady progress has been made in learning-based image compression~\cite{balle2016end,balle2016end2, balle2018variational,balle2018autoregressive,minnen2020channel,cheng2020learned,endtoend_img_comp}, however, the focus has been mostly on natural images. When used on SCIs, coding models trained on natural images tend to be less effective, as will be seen in our results. Therefore, in this paper, we develop a learning-based coding model targeted at SCI. Note that SCIs can contain both synthetic and natural content. In fact, one of the key challenges in SCI compression is to adapt coding to the nature of the content (synthetic vs. natural), because these have different statistics and therefore may require different coding tools. We leverage the fact that a learning-based model can be trained to distinguish natural from synthetic content, as well as perform compression, in order to boost the coding performance on SCI. The paper is structured as follows. In Section~\ref{sec:r-work}, we provide a brief overview of SCI compression and learning-based image compression, and outline our contribution. The proposed SCI coding model is presented in Section~\ref{sec:proposed}. Experiments are described in Section~\ref{sec:exp-resu} followed by conclusions in Section~\ref{sec:concl}. \section{Related work and our contribution} \label{sec:r-work} \subsection{Traditional screen content image compression} \label{ssec:r-work-sc} High-Efficiency Video Coding (HEVC) standard contains specialized tools for screen content compression, which have been wrapped into its screen content coding extension (HEVC-SCC)~\cite{HEVC-SCC,peng2016overview}. These include pallete mode~\cite{pu2016palette}, sample-based predictio ~\cite{kang2016efficient}, and DPCM-based edge predictio ~\cite{sanchez2016dpcm}. Line-by-line template matching, which is more flexible than HEVC's native intra-block-copy mode, has been proposed in~\cite{peng2016hash}. In \cite{mitrica2019very}, a layer-based method is presented for extracting the synthetic data from the screen content image. While the remaining natural video is compressed using HEVC-SCC, detected text and graphical structures are encoded using a customized compression strategy. In~\cite{wang2016utility}, a pre-processing step is suggested to alter parts of the original image data based on the utility of the related image region in order to decrease the bitrate. Additionally,~\cite{yang2015perceptual} and~\cite{gu2016saliency} have examined the quality of screen content images when using lossy compression. Versatile Video Coding (VVC) standard~\cite{nguyen2021overview} also includes low-level coding tools that are suitable for screen content coding. \subsection{Learning-based image compression} \label{ssec:r-work-dl} Learning-based image compression has made rapid progress in recent years. Early works~\cite{toderici-variable, Minnen_ICIP2017,Johnston_CVPR2018} employed Recurrent Neural Networks (RNNs) to model spatial relationships in an image. More recent models are based Convolutional Neural Networks (CNNs) and have a structure shown in the top part of Fig.~\ref{fig:learning-based-codecs}. An image $X$ is subject to a nonlinear analysis transform~\cite{balle2016end,balle2016end2}, composed of convolutional layers, nonlinear activations, and normalizations, among which generalized divisive normalization (GDN)~\cite{balle2015density} is a popular choice. The latent representation $Y$ is then quantized to $\widehat{Y}$ and entropy-coded to produce the compressed bit stream. An important part of the learning process is estimating the rate $R$, i.e., modeling the entropy of $\widehat{Y}$. Entropy models have become more sophisticated in recent years, involving factorized priors and hyperpriors~\cite{balle2018variational}, autoregressive and hierarchical priors~\cite{balle2018autoregressive}, channel-wise autoregressive models~\cite{minnen2020channel}, and Gaussian mixtures~\cite{cheng2020learned}. Most recent work has explored advanced learned transforms such as normalizing flows~\cite{ANFIC} and transformers~\cite{VR_Transformer}. Common to all end-to-end learning-based codecs is that differentiable estimates of rate $R$ and distortion $D$ are use to optimize the whole system~\cite{endtoend_img_comp}. Learning-based image compression has largely focused on natural images so far. However, recently,~\cite{transform_skip_ICIP22} presented a learned image codec that incorporates the concept of transform skip into the end-to-end pipeline to improve SCI compression. The authors also showed that retraining an end-to-end learned pipeline on SCI would improve SCI compression performance, indicating the effect of ``domain shift'' between natural and screen content images. Our paper provides further quantification of the effects of this domain shift, and proposes an alternative training strategy to improve SCI coding performance. \subsection{Our contribution} Our contributions can be summarized as follows: \begin{itemize} \item We quantify the performance gap of two learning-based codecs~\cite{balle2018variational,minnen2020channel} due to ``domain shift'' from natural to synthetic and mixed natural-synthetic content. \item We develop a multi-task SCI coding approach that is able to distinguish natural from synthetic content in SCI, to help boost coding performance. \item We demonstrate the strong coding performance of the proposed approach by comparing it against relevant benchmarks, both handcrafted and learned. \end{itemize} \begin{figure}[t] \centering \includegraphics[width=0.48\textwidth]{learning-based_codecs.png} \caption{Top: high-level structure of a learning-based image codec. Bottom: proposed approach.} \label{fig:learning-based-codecs} \end{figure} \begin{figure}[t] \centering \includegraphics[width=0.45\textwidth,height=0.17\textheight]{SC_N.png} \caption{An example of a SCI used in our experiments (left), with its ground-truth synthetic/natural (S/N) segmentation map (right).} \label{fig:SC-N} \end{figure} \section{Proposed methods } \label{sec:proposed} \subsection{Multi-task coding model} The main idea behind the proposed SCI codec is that we want to create a latent representation that is both compressible and has sufficient information about synthetic and natural parts of the input image, to help the codec adjust to different statistics of these regions. To accomplish this, we propose a multi-task architecture shown in the bottom of Fig.~\ref{fig:learning-based-codecs}. Image $X$ is input to learnable analysis transform $T_a$ to produce the latent representation $Y$ which is then quantized into $\widehat{Y}$: \begin{equation} Y = T_a(X), \qquad \widehat{Y} = Q(Y). \end{equation} The quantized representation $\widehat{Y}$ is entropy coded to produce the compressed bit stream. At the decoder, the bit stream is entropy decoded to recover $\widehat{Y}$, which is then passed to two synthesis transforms, \begin{equation} \widehat{X} = T_s^{(1)}(\widehat{Y}), \qquad \widehat{S} = T_s^{(2)}(\widehat{Y}), \end{equation} to generate the reconstructed input image $\widehat{X}$ and the synthetic/natural (S/N) segmentation map $\widehat{S}$, which is supposed to separate synthetic from natural parts of the SCI image $X$. An example of such a segmentation map is shown in Fig.~\ref{fig:SC-N} next to its corresponding input image. We describe later in this section how we generate input data (both SCIs and S/N segmentation maps) for training the proposed system. Following~\cite{balle2018variational}, the rate is estimated as \begin{equation} R=\mathbb{E}\left [ -\textup{log}_{2}p_{\widehat{Y}}(\widehat{Y}) \right ] + \mathbb{E}\left [ -\textup{log}_{2}p_{\widehat{Z}}(\widehat{Z}) \right ], \label{eq:rate_term} \end{equation} where $\widehat{Z}$ is the quantized hyperprior used in entropy modeling, $p_{\widehat{Y}}$ and $p_{\widehat{Z}}$ are the probability distributions of $\widehat{Y}$ and $\widehat{Z}$, respectively, and the expectation is taken over input data. The loss function used in the training is \begin{equation} \mathcal{L} = R + \lambda \cdot D_X + \varphi \cdot D_S, \label{eq:loss} \end{equation} where $D_X$ and $D_S$ are distortion measures for input reconstruction and S/N segmentation, respectively. We used $D_X = \text{MSE}(X,\widehat{X})$ and $D_S = \text{MSE}(S,\widehat{S})$ in the experiments, but other choices are possible, such as SSIM~\cite{wang2004image} for reconstruction or Intersection-over-Union for segmentation. Once the model is trained, the segmentation output need not be used; it's purpose was to make the system aware of synthetic/natural parts of the input. Note that any transforms, quantizers, and entropy models from learning-based coding pipelines can be used to construct the proposed multi-task codec. To illustrate this, we conducted our experiments with components from two pipelines, namely~\cite{balle2018variational} and~\cite{minnen2020channel}, and show that in both cases, the proposed multi-task approach improves SCI coding performance compared to the default pipeline. \vspace{-3pt} \subsection{Dataset} \label{sec:train-p} The proposed multi-task model requires ground-truth S/N segmentation masks for training, to be able to compute $D_S$. Hence, we constructed such a dataset\footnote{\texttt{https://github.com/SFU-Multimedia-Lab/MLSCIC}} from synthetic and natural images. For this purpose, we used synthetic SCIs from~\cite{ni2017esim} and~\cite{cheng2020screen}, and natural images from~\cite{CLIC2020}. The dataset is constructed as follows. First, a pair of synthetic and natural images is randomly chosen. Then, a random patch (with randomly chosen size, such that width and height are between 128 and 192 pixels) is extracted from the natural image and inserted into a randomly chosen location in the synthetic image. At the same time, the size and location of the natural patch within the synthetic image are used to construct the binary S/N segmentation map, as shown in Fig.~\ref{fig:SC-N}. This way, a dataset of 3,100 images and their corresponding S/N segmentation masks is constructed, both with size 512 $\times$ 512. Of these, 100 randomly chosen images are used for testing and the remaining 3,000 images are used for training. \section{Experiments} \label{sec:exp-resu} \vspace{-7pt} \subsection{Setup} We construct the multi-task codec using two learning-based image compression pipelines --~\cite{balle2018variational} and~\cite{minnen2020channel} -- referred to as ``bmshj2018'' and ``ms2020'', respectively. In each case, another synthesis transform block, architecturally the exact copy of the existing synthesis block, is added to the decoder to provide the S/N segmentation output. The only difference is that the output layer of the added synthesis block is changed to produce a 1-channel (binary) image as the segmentation map, instead of the 3-channel RGB image. Both default pipelines are trained on the CLIC dataset~\cite{CLIC2020} for 1,000 epochs using the Adam optimizer~\cite{kingma2014adam} with an initial learning rate of $10^{-4}$, to provide a baseline trained on natural images. These are called X-1-Decoder-Natural, where X $\in$ \{``bmshj2018'', ``ms2020''\}. Further, the same pipelines are trained in the same way on synthetic images from~\cite{ni2017esim} and~\cite{cheng2020screen} to provide codecs called X-1-Decoder-Synthetic, and on our synthetic/natural dataset for 300 epochs to provide codecs called X-1-Decoder-S/N. Finally, our multi-task codecs are trained on our dataset for 300 epochs, and are called X-2-Decoder. The following $(\lambda,\varphi)$ pairs were used in~(\ref{eq:loss}) to train five \, multi-task \, codecs: \, $(\lambda,\varphi) \, \in \, \{(1, 10^{-5}), \, (10^{-1}, 10^{-5}), \\ (10^{-2}, 10^{-6}), (10^{-3}, 10^{-7}), (10^{-4}, 10^{-7})\}$. The single-task codecs used only the $\lambda$ values from this list, without the last term in the loss function~(\ref{eq:loss}). Two image quality metrics are used in the experiments: Peak Signal to Noise Ratio (PSNR), and Gradient Magnitude Similarity Deviation (GMSD)~\cite{xue2013gradient}, which is considered suitable for SCIs. \begin{table}[tb] \centering \caption{BD-Rates (\%) for PSNR and GMSD metrics relative to bmshj2018-1-Decoder-Natural for bmshj2018-based codecs and ms2020-1-Decoder-Natural for ms2020-based codecs} \label{tab:BD-Rate-bmshj-ms} \begin{tabular}{|c|r|r|} \hline Codec & PSNR & GMSD \\ \hline \hline \hline bmshj2018-1-Decoder-Synthetic & --20.45& --20.83 \\ \hline bmshj2018-1-Decoder-S/N & --25.87 & --31.08 \\ \hline bmshj2018-2-Decoder & \textbf{--36.14} & \textbf{--34.48} \\ \hline \hline ms2020-1-Decoder-Synthetic & --17.39 & 0.15 \\ \hline ms2020-1-Decoder-S/N & --39.97 & --43.68\\ \hline ms2020-2-Decoder & \textbf{--61.57} & \textbf{--70.95} \\ \hline \end{tabular} \vspace{-10pt} \end{table} \vspace{-3pt} \subsection{Quantifying the domain shift} Table~\ref{tab:BD-Rate-bmshj-ms} quantifies various domain shifts for the two coding pipelines in terms of the BR-Rate~\cite{bjontegaard2001calculation}, for both PSNR and GMSD. For each pipeline, X-1-Decoder-Natural, where X $\in$ \{``bmshj2018'', ``ms2020''\}, is used as the anchor, and best results for each pipeline are indicated in bold. The results show that merely retraining a coding model on synthetic images will reduce the BD-Rate by 17-20\% when the quality metric is PSNR. This provides additional support to the results from~\cite{transform_skip_ICIP22}, which showed similar trend. Moreover, our results show that retraining the pipeline on combined synthetic/natural images provides 20-40\% BD-Rate gain for PSNR. Finally, the multi-task system provides 36-62\% BD-Rate gain for PSNR. The comparison between X-1-Decoder-S/N and X-2-Decoder is particularly interesting. Both these types of codecs are trained our synthetic/natural dataset, and the only difference is that X-2-Decoder is performing two tasks instead of one. Hence, this comparison shows the effect of multi-tasking. We see from Table~\ref{tab:BD-Rate-bmshj-ms} that adding the second task (S/N segmentation) improves BD-Rate by 10-20\% for PSNR, and 3-35\% for GMSD, depending on the pipeline X. We hypothesize that this is because the encoder in a X-2-Decoder system is more aware of where natural vs. synthetic parts of the input are, so it is able to adjust its entropy model parameters more quickly to the different statistics of these regions. \subsection{Screen content image coding performance} Next we test the SCI image coding performance on our test set. Since the ``ms2020'' pipeline showed better performance in the experiments described above, here we use ms2020-1-Decoder-Natural as the anchor, and examine the coding performance of other versions of this pipeline. Further, we also test HEVC Intra (HM 16.26rc1), HEVC-SCC Intra, and VVC Intra (VTM 18.2) with screen content coding options turned on. Table~\ref{tab:BD-Rate-ms} shows the BD-Rate relative to the ms2020-1-Decoder-Natural anchor. As seen in the table, among the conventional codecs, VVC is the best with about 46\% BD rate gain over the anchor for both PSNR and GMSD. Both HEVC-SCC and ms2020-1-Decoder-S/N are close behind it for GMSD, with a slightly larger gap for PSNR. However, our ms2020-2-Decoder provides the best performance, with over 60\% (resp. 70\%) BD-Rate gain for PSNR (resp. GMSD). \begin{table}[tb] \centering \caption{BD-Rates (\%) for PSNR and GMSD metrics relative to ms2020-1-Decoder-Natural} \label{tab:BD-Rate-ms} \begin{tabular}{|c|r|r|} \hline Codec & PSNR & GMSD \\ \hline \hline \hline HEVC (HM 16.26rc1) & --10.37 & --28.31 \\ \hline HEVC-SCC & --37.61 & --43.92 \\ \hline VVC (VTM 18.2) & --46.31 & --46.02 \\ \hline ms2020-1-Decoder-Synthetic & --17.39 & 0.15 \\ \hline ms2020-1-Decoder-S/N & --39.97 & --43.68 \\ \hline ms2020-2-Decoder & \textbf{--61.57} & \textbf{--70.95} \\ \hline \end{tabular} \end{table} \begin{figure}[tb] \centering \includegraphics[width=0.49\columnwidth, trim={0 4cm 0 0},clip]{HEVC.png} \includegraphics[width=0.49\columnwidth, trim={0 4cm 0 0},clip]{HEVC-SCC.png} \includegraphics[width=0.49\columnwidth, trim={0 4cm 0 0},clip]{VTM.png} \includegraphics[width=0.49\columnwidth, trim={0 4cm 0 0},clip]{2-decoder-ms2020.png} \caption{Visual example of SCI coding. Top-left: HEVC (0.0604 bpp, PSNR = 25.81 dB, GMSD = 0.1593). Top-right: HEVC-SCC (0.0581 bpp, PSNR = 27.84 dB, GMSD = 0.1344). Bottom-left: VVC (0.0569 bpp, PSNR = 28.13 dB, GMSD = 0.1192). Bottom-right: proposed ms2020-2-Decoder (0.0380 bpp, PSNR = 29.12 dB, GMSD = 0.1019). With GMSD, the lower the better.} \label{fig:visual_examples_coding} \end{figure} Fig.~\ref{fig:visual_examples_coding} shows an example of a SCI coded with HEVC, HEVC-SCC, VVC, and the proposed codec. From HEVC (shown in the top-right) to the proposed (bottom-left), the bitrate decreases but quality increases. All codecs handle large text reasonably well. However, details of both the small text and the natural part of the SCI are preserved much better with the proposed codec compared to the other codecs. In order to further explain the effectiveness of the proposed multi-task approach, we measure its coding performance on the natural and synthetic parts of the test SCI images. Specifically, we measure the bit rate and PSNR separately on these two portions of the input image, and then compute BD-Rate with respect to the anchor ms2020-1-Decoder-Natural. The results are shown in Table \ref{tab:BD-Rate-ms-N-SC}. Recall that ms2020-1-Decoder-Synthetic is trained on the pure synthetic training set, and ms2020-2-Decoder is trained on our synthetic/natural training set. The results show that ms2020-1-Decoder-Synthetic has lost about 118\% BD-Rate on the natural portion compared to the anchor, but has gained slightly (about 17\% BD-Rate) on the synthetic portion compared to the anchor. Hence, improved coding of synthetic portion has been paid for by the lower efficiency on the natural portion of the SCI. However, the proposed multi-task system loses only about 26\% BD-Rate compared to the anchor on the natural portion while gaining about 69\% on the synthetic portion. Hence, in the case of the multi-task codec, the large coding gain on the synthetic portion is paid for by a much smaller loss on the natural portion, because the codec is better able to recognize the two regions and adjust its coding accordingly. Although segmentation is not the main goal of the proposed codec, it is interesting to see how the system performs on this task as well. Fig.~\ref{fig:segmentation_example} shows a SCI that was not in our dataset, and has multiple circular natural inserts. Our multi-task system is still able to identify these natural portions reasonably well. \begin{table}[tb] \centering \caption{BD-Rates (\%) for PSNR in natural and synthetic parts of SCI relative to ms2020-1-Decoder-Natural} \label{tab:BD-Rate-ms-N-SC} \begin{tabular}{|c|r|r|} \hline Codec & Natural & Synthetic \\ \hline \hline ms2020-1-Decoder-Synthetic & 117.63 & --16.66 \\ \hline ms2020-2-Decoder & 25.61 & --68.67 \\ \hline \end{tabular} \end{table} \begin{figure} \centering \includegraphics[width=0.49\columnwidth]{SCI_3.png} \includegraphics[width=0.49\columnwidth]{SCI_3.png_Seg.png} \caption{Example of segmentation for a SCI with multiple circular natural components.} \label{fig:segmentation_example} \vspace{-5pt} \end{figure} \section{Conclusion} \label{sec:concl} We presented a learning-based multi-task codec for screen content images (SCI). Besides coding and reconstructing the input image, the multi-task codec was trained to perform an additional task: segment synthetic vs. natural portions of the input image. This helps it adjust its coding to the two regions, which have different statistics. The performance of the proposed codec was compared against relevant benchmarks, both handcrafted and learning-based, and its superior SCI coding performance was demonstrated through extensive experiments. \bibliographystyle{IEEEbib}
\section{Introduction} Augmented reality (AR) adds layers of content onto our perceptual field that can meaningfully alter the way we see and interpret the world around us. It can help us examine physical spaces by adding location-specific context and imagine how the world could be different. AR allows us to experience the impossible, forging new ways of interacting with our surroundings through an exciting emerging medium. These capabilities become especially powerful when applied to contested public spaces, which are often the sites of competing worldviews and visions for the future. Physical symbols of the legacy of slavery in the US\textemdash such as Confederate and antebellum period monuments\textemdash have become the subject of increased scrutiny and debate over the past several years. In the wake of the mass shooting in Charleston in 2015, and in the years following the white supremacist rally in Charlottesville in 2017, calls to investigate the legacy of monuments intensified, and extended beyond Confederate monuments to other contested public spaces as well. We were a team of students based at Stanford and Columbia interested in how carefully designed AR experiences could help interrogate structures and power dynamics in public space. We believed we could add layers of storytelling that brought relevant voices to the space in ways that would be impossible without the assistance of technology. We received a Magic Grant from the \href{https://brown.columbia.edu/}{Brown Institute for Media Innovation} for \textit{Charleston Reconstructed}, a project intervening on Charleston, South Carolina's most infamous monument using AR. A local prototype for \textit{Charleston Reconstructed} became its own project at Stanford called \textit{Dear Visitor}. In our first project, \textit{Dear Visitor}, a monument's conspicuous \textit{absence} was an opportunity to not only instantiate the monument as it should have been, but also to digitally add layers of institutional memory that are impossible through purely traditional media. In a fitting twist, the AR project eventually led to a permanent physical change to the space. In our second project, \textit{Charleston Reconstructed}, a monument's conspicuous \textit{presence} highlighted the legacy of slavery in Charleston, South Carolina's most prominent park, Marion Square, for decades. We used AR to enact three interventions and surface historical perspectives in the square. We completed and beta-tested the project, but the project lagged physical changes in the world when the original monument was taken down in June 2020 in the wake of the George Floyd protests. In this piece, we describe the designs of the projects, lessons learned from their deployment, and open challenges we still see for future work of this kind. \subsection{Technological motivation} Ronald Azuma has asserted that the fundamental value of AR comes from the unique combination of digital content and physical reality such that ``virtual content is connected to reality in compelling and meaningful ways." \cite{azuma} AR has seen myriad technological advances in recent decades and several surges in popularity in the commercial sphere. However, AR has yet to live up to its potential as a vehicle for facilitating meaningful experiences situated in the physical world. Though modern AR systems are adept at detecting basic properties such as position and shape, they generally lack the ability to infer physical properties like material, or semantic properties like identity and cultural significance. In other words, modern AR systems can understand \textit{where} things are, but seldom \textit{what} they are, and rarely \textit{why} they matter. As a result, Pokémon Go, the most well-known AR application in popular use, features content which is overlaid on reality, but which lacks meaningful connection to it. Other platforms, such as Google Lens, are capable of basic semantic understanding of an object or site, but are currently primarily reference tools that lack interactivity and content. While the technology required for generalized semantic understanding using commercially available AR does not yet exist, many necessary elements for creating location-based AR experiences do. We used visual markers to trigger the location-based experiences we designed, thus deploying a temporary solution to the problem of semantic understanding of the space. This allowed us to explore the promises and challenges of creating meaningful location-based AR before it is achievable at scale. With both technological and social goals in mind, we created \textit{Charleston Reconstructed} and \textit{\href{https://www.dearvisitor.app/}{Dear Visitor}}, two location-based AR experiences. Lessons from these case studies will be useful in planning for future projects as the technology develops. \subsection{Related work} Several other projects have meaningfully engaged with site-specific AR, such as \textit{110 Stories}, which used AR to visualize an outline of the Twin Towers against the New York skyline, showing the towers' outline before the 9/11 attacks. The experience demonstrates an intentional usage of AR which combines content with context, elevating both the physical space and the digital augmentation. Another project, \textit{Stonewall Forever}, incorporated archival materials related to the Stonewall riots into an AR smartphone app which projected a large, dynamic rainbow into the physical site of the riots in New York City, and invited users to leave comments on the virtual monument. Another project currently in development called ``If These Streets Could Talk" will show elements of Jewish archival history overlaid on sites in the Jewish quarter of Budapest, with planned deployments in other European cities as well. \section{Case Studies} \subsection{Dear Visitor} \subsubsection{Motivation for the project} In 2015, Chanel Miller was sexually assaulted behind a dumpster on Stanford campus. Her \href{https://www.buzzfeednews.com/article/katiejmbaker/heres-the-powerful-letter-the-stanford-victim-read-to-her-ra}{victim impact statement} was published on BuzzFeed and went viral during the \#MeToo movement. As part of its handling of the sexual assault case, Stanford agreed to build a contemplative garden at the site of the assault per Chanel Miller's request, which would include a plaque with a quote from her victim impact statement. Miller's initial proposed quote was rejected by Stanford on the premise that it might be triggering to survivors, \cite{drell_2018} prompting outrage and activism on campus. \cite{knowles_2018} Stanford rejected additional quotes that Miller proposed, and Miller withdrew from the negotiation process. The otherwise completed contemplative garden, located in a remote part of Stanford campus between two undergraduate residences, was therefore left unmarked for several years. Our team learned about these events in fall 2018, and we realized that AR provided a way to bring Chanel Miller's words to the garden and create engagement with the physical space in a way that proved difficult otherwise. \subsubsection{Stakeholder interviews} Starting this project in a thoughtful way required identifying and communicating with many stakeholders. We had conversations with students who had lived near the garden, activists who had rallied for a plaque, administrators at Stanford and its Title IX office, and student leaders past and present. Interviewees recommended follow-up interviews with additional subjects. We performed semi-structured interviews with past and present Stanford students, discussing their knowledge of and relationship to the garden, their opinions about the plaque, and what they wished to impart on the garden's future visitors. We also collected stories from students who lived near the space, one of whom described overhearing a pair of male students talking about their sexual exploits in the unmarked garden, illustrating the need for a marker at the site. These anecdotes from interviews were edited into clips which formed the audio content of the AR experience. \subsubsection{Design} We received design feedback from students, activists, and university stakeholders on an ongoing basis. The final version of the experience began with a brief textual introduction to Chanel Miller, the context behind the garden, and our intentions for the project. The user then began the AR portion of the experience by pointing the tablet viewfinder at an image marker placed next to the garden. When the tablet successfully anchored, two plaques and seven letters materialized on-screen in and around the garden. The plaques were digital renditions of two different physical plaque designs displaying two different quote suggestions from Chanel Miller. Tapping on the plaques played audio recordings of Miller reading the quotes. The plaque at the entrance of the garden, where the original plaque was proposed for installation, featured the first quote that was rejected by Stanford. The second plaque, placed in front of the fountain on the ground, featured another quote Miller suggested but that was also not approved. AR letter envelopes, with attached audio from student interviewees discussing the space, floated near eye level in the garden during the experience. Tapping a letter opened an audio player which played the corresponding clip. The letters played interviews of various students and student activists, all of whom were asked what they would want future visitors to the garden to know (hence the title, \textit{Dear Visitor}). A counter in the corner of the screen kept track of how many clips the user had heard. See accompanying supplemental materials for a video of an abbreviated walk-through of the experience. \subsubsection{Tech \& Implementation} The experience was created in Unity with an Apple ARKit SDK and 3D models created in Blender, and was deployed to iPad Pro tablets. We decided to use tablets instead of headsets to maximize visual fidelity and viewport size while minimizing cost. At the time of the project's deployment, headsets like the Magic Leap were both prohibitively expensive and used optical see-through designs, which meant they had small viewports and struggled in outdoor environments. We found smartphone viewports to be too small for a high-quality experience. The constraints of the project guided our choice of AR anchoring mechanism. We used image markers, which match an image file in the app to the image's printed counterpart. Marker-based anchoring is common and fairly easy to use, but most importantly, we found this method to be the most reliable in the face of lighting changes and other outdoor environmental factors. We used a printed image, 0.2m by 0.2m, placed next to the garden, which was scanned by each experience participant. While we extensively considered other anchoring mechanisms such as 3D object recognition (e.g., of inset stones around the fountain), we found them unreliable outdoors. In particular, they had difficulty adapting to changes in lighting even within a single day. Anchoring to a 3D stone pattern during the day might work at first, but if the stone pattern were obscured by shadows from nearby trees a few minutes later, anchoring would fail. If 3D object or scene recognition were to one day become more reliable, it would be the preferred method of anchoring, since it would be able to anchor on features native to the physical scene. \subsubsection{Launch} The Dear Visitor experience was painstakingly created and reviewed with stakeholders, a process which took almost an entire academic year. As the experience neared completion, we conducted a beta test, followed by a full launch, which fortuitously coincided with Chanel Miller's book launch and identity reveal (she had previously been known as Emily Doe). We organized a day-long launch event in September 2019. More than 100 people participated in the experience, which had ``ticketed" time slots to control crowding in the space. We had on-site volunteers start users with the tablet and headphones and remain nearby in case of technical difficulties. Because of the charged nature of the subject matter, we designed a voluntary, non-digital offboarding experience to help participants process the app experience. All visitors were invited to participate in the offboarding experience, and most did. Participants were invited to hand write their own physical ``Dear Visitor" letters to others who visit the space. Figure~\ref{fig:offboard} shows an example of a letter. More than 50 such letters were written on the day of the event. To conclude the event, the remaining visitors gathered in a circle to read powerful quotes from Chanel Miller's victim impact statement in solidarity. \begin{figure}[h] \centering \includegraphics[width=3.5in]{offboard.png} \caption{An example anonymous letter written in the offboarding experience of \textit{Dear Visitor}} \Description{Scanned image of a white sheet of paper with curly black handwritten script at the top reading ``Dear Visitor." A hand-written letter is scribbled on the paper detailing a participant's experience.} \label{fig:offboard} \end{figure} \subsubsection{Impact} Many publications wrote about the \textit{Dear Visitor} launch event given the high-profile nature of Chanel Miller's identity reveal and book release, including \textit{BBC News}, \textit{The Guardian}, and \textit{The LA Times}. This press allowed us, and the many other activists dedicated to this issue, to direct further attention to the issue of the plaque. Following the launch event and Miller's book release, calls for action to install the real plaque at the garden proliferated. A petition to install the plaque gained more than 2,200 signatures and was sent to the Stanford administration, and the Stanford Faculty Senate unanimously voted to install it. \cite{le_2018} Several unofficial physical plaques were put up at the site by activists during this period. \cite{shao_2019} In February of 2020, the official plaque was installed. \cite{sd_2020} Figure~\ref{fig:dv_sbs} shows a side-by-side image of the digital plaque on the left, designed by us for the \textit{Dear Visitor} experience, and the plaque that was eventually installed onsite on the right. The similarity is noteworthy because neither the digital model nor its placement were part of the original design for the plaque, which featured a longer quote and had a taller form that was slated for the entrance to the garden. We thus have reason to believe the final design of the plaque installed in 2020 took direct inspiration from our digital design, an unexpected outcome of the project. \begin{figure}[h] \centering \includegraphics[width=\linewidth]{dv_sidebyside.png} \caption{Left: digital plaque from \textit{Dear Visitor} in 2019 overlaid at the garden. Right: installed plaque in 2020, whose design and placement took inspiration from \textit{Dear Visitor}.} \Description{On the left is a screenshot of the digital plaque in \textit{Dear Visitor} in 2019 overlaid on the monument site in AR. The plaque reads "You took away my worth, my privacy, my energy, my time, my safety, my intimacy, my confidence, my own voice, until today." On the right is a photograph of the installed physical plaque in 2020, whose design and placement is nearly identical to the overlaid AR plaque on the left.} \label{fig:dv_sbs} \end{figure} \subsection{Charleston Reconstructed} \subsubsection{Context} In June 2015, a young white supremacist named Dylann Roof entered Charleston’s oldest historically African American church (Mother Emanuel), joined the congregation in prayer, and then murdered nine of its members in an effort to start a race war. South Carolina’s state legislature agreed that it was time to remove the Confederate flag from its state house, but less than a mile from Mother Emanuel, a 115-foot statue of former Vice President John C. Calhoun, a prominent defender of slavery, still stood in Marion Square. It was emblematic of a problem common to many public spaces in the United States: an outdated monument codifying and celebrating an outdated understanding of the country's history. Historians Ethan J. Kytle and Blain Roberts claim that ``No place in America has spent as much time and energy selling memories\textemdash most whitewashed, others unvarnished \textemdash of its past" as Charleston, the port city through which 40\% of enslaved Africans passed in the Transatlantic slave trade. \cite{kytle2018denmark, 40} In the charged physical and historical landscape of the city's central square, we saw an opportunity to contextualize and re-imagine monuments both present and absent. From a technological perspective, we saw an opportunity to bring a physical space into dialogue with its history through AR. \subsubsection{Final design} The design of the app took the form of three themed "chapters," meant to be experienced in situ in Marion Square. Users were prompted to explore several sites in the square using a tablet. Tapping on the digital objects that had been digitally overlaid on the physical space triggered interview audio from historians and key community stakeholders. From a content perspective, our goal was first for users to consider the white-supremacist narrative represented by the existing state of the park's monuments; then to consider a counter-narrative centering the contributions of Black Charlestonians; and finally, to consider more broadly how and whether design choices in public spaces can be made to represent a community's shared values and history-- perhaps in a different form than traditional monuments that take the form of a person. Each of the three chapters used a different affordance of AR, allowing for three different ways to re-imagine public spaces more equitably. A map of the user journey from chapters 1 to 3 through Marion Square can be seen in Figure~\ref{fig:square}. \begin{figure}[h] \centering \includegraphics[width=\linewidth]{MarionSquare.png} \caption{User journey from chapters 1 to 3 in Marion Square} \Description{Satellite image of Marion Square from above, which forms a large white "X" across a grassy field with three labeled points (1 to 3) indicating the sites of the three chapters of the experience.} \label{fig:square} \end{figure} In the first chapter, we used AR to digitally alter and contextualize Marion Square's prominent monument to Calhoun. The app directed users to stand in front of the Calhoun statue. Users then saw a digital plaque appear in the space. This plaque, shown in Figure~\ref{fig:calhoun}, displayed language the city considered adding to the statue's base but ultimately tabled due to internal disagreements over the language used to describe Calhoun's role in slavery. Tapping on the plaque triggered the voice of Charleston Mayor John Tecklenburg, who expressed his regret at not being able to have the plaque added to the statue. Simultaneously, we overlaid a reproduction of graffiti that was sprayed onto the monument after the 2015 shooting at Mother Emanuel AME Church. Tapping on the recreation of the spray-painted word, "racist," at the base of the statue triggered the voice of Daron Lee Calhoun II, a Black Charlestonian who noted that Calhoun had once "owned" his family. This chapter was designed to use AR to instantiate small interventions to the existing monument and interrogate its lack of context\textemdash through plaques or other methods\textemdash in the physical world. \begin{figure}[h] \centering \includegraphics[width=\linewidth]{Calhoun_1.png} \caption{Screenshot from Chapter 1 of \textit{Charleston Reconstructed}. Digitally rendered graffiti, a proposed plaque, a silhouette of a young girl, and a candle glow are shown atop the monument. When tapped, each element triggers audio context on the space.} \Description{The base of the stone statue of Calhoun. Under Calhoun's name in red spray paint reads the word ``racist". Under the words "truth, justice, and the constitution" read the words "and slavery" written in red spray paint. At the base of the statue is a digitally overlaid plaque. On the left of it is the digital silhouette of a child looking up at the statue. On the right is a digitally rendered candle object.} \label{fig:calhoun} \end{figure} For the second chapter, we instantiated in the square a statue of Denmark Vesey, a native Charlestonian who was executed for plotting what would have been the largest slave insurrection in American history in the early 1800s. This was a digital reconstruction of an existing monument, located elsewhere in Charleston. A committee of historians and activists originally proposed that the Vesey statue be installed in Marion Square in 1996, but many Charlestonians objected, and the Vesey statue was eventually constructed in a park two miles away\textemdash well outside the area commonly visited by tourists. This motivated another novel intervention with AR: using photogrammetry to generate a 3D model of the Vesey statue, then instantiate it at the center of Marion Square. This would allow users to visualize what the square would look like if the statue had been there rather than two miles away. When users tapped on the Vesey statue in the app, we resized the digital model of the statue so it appeared to ``grow" as tall as the real-life Calhoun statue, as seen in Figure~\ref{fig:vesey}. Simultaneously, we included audio of community members discussing the need for better representation in Charleston’s statuary and the many African American figures from Charleston’s past who deserve their own monuments. For the third chapter, we designed and instantiated a digital monument from scratch and overlaid it on the space. Conceptually, this was intended to provide an alternative model of what statues in public space could commemorate. Statues are usually built in dedication to a particular person who embodies community values or aspirations. As shown in recent years, historical figures make for complicated subjects for monuments given the complex nature of any one person's legacy. We took this opportunity to imagine what a monument to a shared set of stories, hopes, and values could look like. From an HCI standpoint, we also designed and instantiated this virtual monument that had features that are impossible in the physical world, like interactive audio combined with physics-defying visual features. We commissioned College of Charleston architectural student T'Leya Walker to design a virtual monument representing sentiments gathered in our interviews. Walker's final design incorporated symbolic elements including wrought ironwork in honor of local African American blacksmiths, palmetto trees symbolizing strength and flexibility in the face of hurricane winds and the resilience of Black Charlestonians, and fingerprints in reference to the hands that built Charleston. The monument took the form of a brick archway, representing the Door of No Return, through which many West Africans left their home continent on a forced voyage to the United States. Users could tap chains strung across the archway's entry to hear about issues of ongoing inequality in Charleston. After the audio associated with each chain played, it was animated to break and disappear. After breaking each chain, users were instructed to walk towards the archway, at which point the tablet screen faded to black. Users were then left with the onscreen prompt to look back at the park as it stands and consider how it could be different. \subsubsection{Stakeholders} We took a community-oriented journalistic approach, conducting interviews with historians, locals and activists, and using their expertise and lived experiences to determine the design and narrative elements that became part of the experience. After contacting key experts who had written about the topic of monuments and historical memory locally, we asked each interviewee with whom else it was essential for us to speak, and we ultimately recorded more than 25 interviews. As non-Black reporters and designers, we felt it was important to build trust and welcome as much feedback as possible, so we emphasized transparency about our goals and a willingness to maintain ongoing communication with stakeholders. The community members included as voices in the \textit{Charleston Reconstructed} experience included professors from the College of Charleston and local military college The Citadel; the poet laureates of both Charleston and South Carolina; a representative of the Charleston chapter of the NAACP; multiple local tour guides and public historians who focused on Black history; a distant relative of John C. Calhoun; several community members who were affected by the shooting at Mother Emanuel; and multiple local activists and advocates working toward the removal of the Calhoun statue from Marion Square. We also maintained contact with representatives from organizations including the \href{https://independentmediainstitute.org/make-it-right/}{Make It Right Project} and the Charleston Activist Network, and presented iterations of our work at several local advocacy events during the design process. We used the interviews and information gathered at these events to inform an informal participatory design process, whereby insight and feedback from our interviewees directly informed the interim and final designs of the app. A direct example of this feedback system played out in the first interview conducted for the project. We initially considered digitally "replacing" the Calhoun statue with a statue of a Black Charlestonian, and intended to ask interviewees who they would like to see replace Calhoun. But Christine King-Mitchell, a historic interpreter at Charleston's Old Slave Mart Museum, changed our thinking\textemdash she told us she did not think public monuments should be about putting "one man or woman on a pedestal." Rather, she noted that when she walks around Charleston, she thinks about all the enslaved people who made the bricks that built the city. For her, the fingerprints found in those bricks today serve as a monument to "a people that were always in the shadows, but look at the works they left behind." This insight prompted us to consider how we could expand our vision for the application to allow for something broader, more inclusive, and more narratively complex than simply replacing one historic figure with another, and it directly informed the decision to build the the third chapter of the experience in a different way. Her insight led to us to conceptualize the monument in the third chapter as a non-human form made of digital bricks, where tapping a hand-print on the bricks let users hear the perspective King-Mitchell shared with us in that first interview. A screenshot of this final design is seen in Figure~\ref{fig:christine}. \begin{figure}[h] \centering \includegraphics[width=2.8in]{King_Mitchell_2.png} \caption{Screenshot of Christine King-Mitchell's narrative in the third chapter of \textit{Charleston Reconstructed.}} \Description{A digital brick archway with three chains strung across is overlaid on Marion Square. In the bottom left is a photo of a Black woman, Christine King-Mitchell, a historic interpreter at the Old Slave Mart Museum, and her titles appear under her name to the right of her face. A closed caption from her interview appears under her title, and reads "You know, when I walk the streets of Charleston today, I look around, and for me it's a testament of a people that were always in the shadows, but look at the works they left behind."} \label{fig:christine} \end{figure} This interplay between community insight and design decisions carried on throughout the project. Given the sensitivity of the issues at hand and the fact that the AR component was difficult for many participants to understand, we also invited stakeholders to serve as beta testers and to provide feedback prior to any public release of the app. This is a highly unusual practice from a journalistic perspective, but we felt it was essential to collaborate in designing the experience with the communities to whom it was most relevant, especially given the sensitive nature of the topic and our own limited understanding of the Black experience. As we identified stakeholder voices for the design process, we were also aware that many people in Charleston wished to preserve the status quo in the park. After interviewing some people with this view, we decided that since the existing treatment of the monument already aligned with their values, there was no need to use AR to represent their vision for the space. For this reason, we did not prioritize the Calhoun monument's defenders as key stakeholders in our design process. In both \textit{Dear Visitor} and \textit{Charleston Reconstructed}, we found that consulting as many stakeholders as possible\textemdash and prioritizing those whose voices may be hard to find or actively pushed aside\textemdash was critical to creating the experience we intended. \subsubsection{Implementation} The setup for \textit{Charleston Reconstructed} was similar to that of \textit{Dear Visitor} (built in Unity with ARKit and deployed to iPad tablets), but the scale of the experience was much larger and complexity of included content was much higher. Designing an AR experience at the scale of a whole public park made it difficult for people to go through the experience on their own, so we implemented guided facilitation to make sure users did not miss visual cues. Some visual cues were built into the experience itself, but tablet displays, while large compared to smartphones, still were too small to consistently facilitate wayfinding for a user without help. In the first chapter, \textit{John C. Calhoun}, we were able to use marker-based anchoring on an existing marker on the monument: a sign reading "Climbing Is Prohibited," (see Figure~\ref{fig:climbing}) which alleviated the need for additional markers like those needed for \textit{Dear Visitor}. \begin{figure}[h] \centering \includegraphics[width=2.2in]{Climbing.png} \caption{Screenshot of the app, where the prompt was to align an image (bottom) of the ``Climbing is Prohibited" sign at the base of the existing statue with the sign itself (top). } \Description{Screenshot of the \textit{Charleston Reconstructed} app, where the prompt was to align an image of the ``Climbing is Prohibited" sign at the base of the existing statue with the sign itself. Blue dots show how the app is searching for the alignment between the ``Climbing is Prohibited" image it has with the sign in real life.} \label{fig:climbing} \end{figure} For the second chapter, we scanned the existing Denmark Vesey statue, located 2 miles away from Marion Square, using drones. We reconstructed the statue digitally using the photogrammetry software RealityCapture, which rendered a 3D model. The statue can be seen as it appeared in the app in Figure~\ref{fig:vesey}. \begin{figure}[h] \centering \includegraphics[width=3.0in]{Vesey_1.PNG} \caption{Digitally reconstructed Denmark Vesey statue placed in Marion Square, resized to match the size of the Calhoun statue, seen in the background.} \Description{A screenshot of digitally reconstructed statue of Denmark Vesey overlaid in Marion Square, resized to appear as large as the Calhoun statue, which is visible in the background of the image.} \label{fig:vesey} \end{figure} For the third chapter, T'Leya Walker created a 3D model of a virtual monument in SketchUp. We added interactive elements to this model in order to trigger audio elements in the app and give the chains the appearance of movement. \subsubsection{Beta test} In September 2019, we organized a day-long beta test of the experience with about 20 people, most of whom had been interviewed for the project. We scheduled walk-throughs in groups of 2-3 people every hour so that at least one of our team members could personally facilitate for each experience participant. This allowed us to help with any technical difficulties participants encountered, observe how they navigated the application, and note any editorial concerns that arose in real time. In keeping with the collaborative process we established during the early phases of the project, we solicited ongoing feedback from these participants throughout and after the experience, with the goal of using their notes and our observations to make improvements. This provided crucial insight both technically and editorially about how people respond to and interpret AR in outdoor settings, on which we elaborate in a later section, "\nameref{open_challenges}." Most notably, we observed that to complete all three chapters and hear all of the included audio clips, which totaled about 43 minutes, each person took approximately an hour and 15 minutes during the beta test. We reduced the number of audio clips and AR elements by nearly half as a result of participant feedback. Following this beta test and edit process, we held several smaller walk-throughs with a few key stakeholders who had emerged as informal advisors due to their interest in the project, all of whom found the changes we made to be effective. We felt at this point that we were ready for a wider public release, and in February 2020 we held our final demo of the experience with a representative for Spoleto Festival USA, who expressed intent to tie our public launch event in with the festival's programming in June 2020. \subsubsection{Aftermath} In February 2020, news of a global pandemic halted travel plans. Our planned deployment partner, Spoleto Festival USA, cancelled its in-person festival in Charleston, which was slated for June 2020. In May 2020, George Floyd was killed by police in Minneapolis, Minnesota, launching a nation-wide reckoning with ongoing racism, anti-Black police violence in the US, and the legacy of racism in the US. In response to a newly re-energized advocacy and protest campaign that followed in Charleston, Mayor John Tecklenburg took a corrective action that months earlier he said he did not have the power to do: he ordered the John C. Calhoun statue's removal from Marion Square, and it was removed on June 23, 2020. Overnight, the landmark our experience was built around had disappeared from the park, and with it, the most tangible impetus for the \textit{Charleston Reconstructed} project. It was a celebratory outcome and a previously unthinkable step in the right direction for a city that has historically resisted such changes. And for our team, it meant that doing a full, longer-term, and public launch of the project would have required a near-total rethinking of what we had already built. As such, the project was not launched in full. \section{Discussion} \subsection{Practical learnings} Designing, developing, and deploying these two projects yielded deep insight into the unique logistical challenges of location-based AR, particularly when dealing with social justice issues. We present practical learnings based on technological and spatial constraints to provide guidance for future designs. \subsubsection{Connecting content and place} A key editorial decision we made early on was to have the content maintain focus on the physical space as much as possible. This was in an effort to spatially connect the content with the context, justifying the use of AR at a particular site as opposed to a non-spatial medium. In \textit{Dear Visitor}, we specifically asked each student interviewee to impart thoughts for future visitors to the garden. Some of the most impactful moments of the \textit{Dear Visitor} experience, according to feedback we collected, were in response to this framing, such as when one interviewee made a reference to a building "to your right," and the user could look to the right and see the building. Another audio letter shared the story of a student looking down at the site from her dormitory, a building which was in view for users participating in the \textit{Dear Visitor} experience. The technical and logistical complexities involved in working with AR as a medium are only worthwhile if the experience's content could not be experienced or understood another way. As such, we cut content that did not need to be experienced in the space, and instead hosted it on our project websites for additional contextual reading. This allowed us to make editorial choices about the experiences without totally sacrificing the voices and stories we believed were important but less critical to hear in the space itself. We could have had a heavier hand in doing this for the Charleston project, which was still quite long. We found a location-centered framing to be especially effective in showcasing the value of AR, by not only making the content more relevant, but by changing the relationship a user has with the space around them. Even for a user without existing personal connections to the content being shared, the content is made relevant to them by virtue of the fact they are physically standing in the space being referenced. \subsubsection{Length} The ideal length of an AR experience is much shorter than we had anticipated. This was especially an issue for \textit{Charleston Reconstructed}, where the initial version contained 43 minutes of content, and took each person approximately an hour and 15 minutes to complete during the beta test. Holding up a device even in the heat and glaring sun (which reflected off the tablet screen) takes physical effort, even for a few minutes at a time outdoors. Many users found it difficult to stay engaged for the duration of the experience, despite finding the chosen interviews and the AR components powerful and engaging. We ultimately cut the length and number of audio clips down significantly based on feedback, with \textit{Dear Visitor} and \textit{Charleston Reconstructed} ending up at 13 and 16.5 minutes of content respectively. This was still likely longer than ideal, but ultimately we had to balance the total length with a thorough and nuanced treatment of the subject matter. We also added a counter showing how many voices users had heard so far and how many were left in each chapter so that users could make informed decisions about whether they wanted to move on or keep listening. We recommend that future creators strive to keep AR experiences short, ideally not exceeding 5 minutes, or to break up experiences in ways that can be understood in shorter chunks over time. This can be difficult for social justice-related projects that are inherently complex since it can feel reductive to edit down the content. This challenge must be weighed against the risk of losing AR users entirely given natural focus limits, especially in challenging outdoor environments. \subsubsection{Onboarding and orienting users} We found that users needed clear, simple instructions at the beginning of the experience about how to use the application and what they should expect. During the beta test for \textit{Charleston Reconstructed}, we often needed to provide verbal instructions or borrow the tablet from users briefly to demonstrate what to do in order for them to begin the first chapter successfully. We fixed this after the beta test by building in a prologue that prompted users to perform all of the basic actions that would be required of them throughout the remainder of the experience before getting to the first chapter. Subsequent walk-throughs with smaller groups confirmed that priming users more directly at the beginning allowed them to navigate the app more quickly and successfully. For \textit{Charleston Reconstructed}, users needed clear instructions to orient themselves within the park before launching each chapter given the large size of the site. The beta version directed users via onscreen text and included a button to press when they had walked to the correct location. However, many users failed to interpret the button, which read “I am here,” as intended. We fixed this by adding a map of the park displaying where to go, a photo of what the viewer should be seeing when they were in the right place, and we changed the button’s text to say “Tap here when your view matches the photo below.” \subsubsection{Human facilitation} Despite implementing better onboarding for \textit{Charleston Reconstructed} after our first beta tests, we still found that human facilitation was critical to the success of the user experience, especially for less tech-savvy users. Even in a small garden like the one at Stanford in \textit{Dear Visitor}, a human facilitator often helped users get back on course in the event of a technical difficulty or a question from a participant. This was true both in our beta tests as well as our final launch. Having ready facilitators meant that technical challenges or discomfort were less of a barrier to the participant meaningfully engaging with the content of the experience. In a space as large as Marion Square in Charleston, and with the generally less tech-savvy users we worked with there, human facilitation in order to create a smooth experience of the content was even more important. The level of human facilitation we found to be crucial to the successful delivery of these experiences came at the expense of their scalability. This finding is revisited as an open challenge for this kind of work. \subsubsection{Closed captioning} In initial iterations of \textit{Charleston Reconstructed}, closed captioning was persistently onscreen, accompanying each new piece of audio that was triggered. We found closed captions discouraged participants from keeping their eyes on the main AR components after tapping on them to trigger audio elements, because users would instinctively read along with the captions. We fixed this by making closed captioning optional in the final version for those who needed it. For \textit{Charleston Reconstructed}, we observed that the sounds of a heavily-trafficked park could be a distraction to some users, and found that adding music and ambient sounds actually helped users immerse themselves in the app better than operating it in silence. The general applicability of this finding may depend on the nature of the site of future work. \subsubsection{Content placement} The beta version of \textit{Charleston Reconstructed} included a series of symbols running up the column of the John C. Calhoun statue, but it was difficult to keep them anchored properly so high above the ground. It was also not intuitive for users to point the tablet up high at the sky to see these elements. It was not ergonomic to hold the tablet up high for so long, and sunlight was often a source of irritation. We eventually removed most of these skyward visual elements and kept the AR content closer to eye-level so it was easier for users to see and interact with. As such, we learned that the content's placement deeply affected users' interest in interacting, a finding we hope can inform future AR design. \subsection{Open challenges} \label{open_challenges} The fact that these two projects were tied to volatile social issues introduced unique opportunities and conceptual challenges for designing a successful AR experience at each site. \subsubsection{Timing} The timeline for creating and launching these projects ultimately decided each project's fate. For both projects, editorial choices were very difficult, and the projects' content passed through many rounds of validation with key members of each community before being included in the AR experience. For \textit{Charleston Reconstructed} in particular, we did not sacrifice careful judgment for speed in these decisions. This carefulness, along with the added constraint that we had to travel in order to deploy and receive feedback on it, meant the project took nearly two years to develop. In unforeseeable strokes of fate, by the time the project was ready to launch, the pandemic had come, and the main statue around which it centered came down soon after. Because major world events outpaced our development process, the project missed its moment. On the other hand, the site of \textit{Dear Visitor} was in the town where some of us lived, and some of us were still in the community of the university. This made prototyping onsite and meeting spontaneously with stakeholders to receive feedback much easier. Feedback from the varied stakeholders in the project, including Chanel Miller herself (through a representative), still took a great deal of time, even with the project's much more concise scope than \textit{Charleston Reconstructed}'s. \textit{Dear Visitor} took just under a year from conceptualization to final launch. Being able to launch the same week as Chanel Miller's book allowed us to synergize with existing momentum on the issue of the plaque, and the real plaque was installed a few months after our project launched. In both projects, technical and social challenges related to the work contributed to a long time horizon. It took time to understand the problem, consult with experts, and design content to further the goal of creating a truly meaningful AR experience, rather than something that merely engaged with the issue at a shallow level. We urge future creators of AR projects with storytelling on social issues to plan for an extended timeline. If the social issue is ``current" or volatile, the timeline of the project may change in unexpected ways and affect the project's ability to launch. It is worth considering how the project can live on despite potential changes to the space that might be inherent to working on volatile social issues. \subsubsection{Persistence} Several major challenges for this kind of work deal with persistence. Creating location-based AR activations on contested public space means that designers should expect that the physical space could change suddenly and dramatically. As we saw in the case of the Calhoun monument being taken down almost overnight after many considered it a lost cause, these changes can be extreme, and can instantly change the context for any AR interventions on top of them. The issue of AR persistence as a project site itself changes will continue to be a challenge for location-specific AR. As previously discussed, we used visual markers to make up for AR systems' lack of semantic understanding of space. If AR one day achieves more generalized location-based semantic understanding, it will need to be resilient to or account for change in a location's appearance in order to persistently host this kind of experience. The question of persistence of the technology itself presents its own set of challenges, and the technology's lack of persistence can affect the longevity and impact of the work. AR is changing quickly, and the best technology today will likely be obsolete sooner than we wish. Maintaining our projects as technology changed was difficult even in the short time span during which we worked. Projects working to facilitate long-term collective memory should actively future-proof as much as possible, but as of now, there is limited ability to effectively do so given lack of general standards across which to port AR experiences across platforms. The challenge of rapidly changing technology also relates to the platforms that host AR experiences. Though any one AR experience-hosting platform has not yet emerged as dominant as of this writing, the private, commercial nature of app platforms to this point introduces future challenges of ownership and profit over the stories hosted in AR. Given Charleston's massive tourism industry and the prevalence of walking tours, we made plans to pass the finished experience off to local Black tour guides, who could facilitate for users post-launch. We made the decision that any profit gained in the future from \textit{Charleston Reconstructed} would go back to the Black community in Charleston. Protecting stories like the ones shared in these experiences from exploitation is made challenging by the inextricable involvement of corporations in AR development to this point. \subsubsection{Accessibility} The persistence of AR technology itself can also affect another area we consider an open challenge: the accessibility and scalability of this kind of experience. Hosting in-person launch events showed us how powerful going through the experience with others could be. Processing difficult historical events in community is a different experience from using an app alone. We opted for human facilitation of \textit{Dear Visitor} and \textit{Charleston Reconstructed} due to the technical challenges inherent to the medium that could be better navigated by dedicated onsite help. Secondly, we found there was immense power in going through the experience and offboarding in community, findings supported by work that shows virtual experiences can significantly affect social connectedness. \cite{miller2019social} The decision we made to keep these experiences facilitator-led and on large iPad screens meant keeping them off app stores, as we did not feel the unfacilitated experience, particularly on a small smartphone, could be consistently high-quality. Requiring human facilitation had the unfortunate consequence that the voices we worked hard to curate specifically for the space can rarely be experienced in situ. \textit{Dear Visitor} had a successful launch, but is not currently accessible for viewing at the site except upon request. Most material is available on the project \hyperref[https://www.dearvisitor.app/]{website}, a digital format that is easier to maintain than AR and for which we can guarantee a consistently high-quality experience. Wider accessibility and greater longevity of complex AR experiences could come through facilitation partnerships with museums or local organizations, a model which would require strong coordination and more resources. The charged and complex nature of the content we were committed to presenting in the projects guided our distribution decisions, but accessibility trade-offs may have been different if we had designed simpler experiences with content of a different nature. Without adding in permanent physical markers to a site that refer to the AR experience, there is also limited opportunity for a person walking through a space to ``discover" the additional knowledge that might be gained by doing the AR experience, decreasing the experience's reach. On the other hand, AR applications can facilitate an interesting design feature: people can opt in to content that all people may not wish to (or be able) to see. The issue of sensitive content in \textit{Dear Visitor} was minimized with an explicit content alert at the beginning of the experience, which addressed concerns for the university and sexual assault experts about how the content could affect survivors, students, and casual viewers. Given ongoing societal conversations about content warnings and how to present sensitive content in a responsible way, site-specific AR applications provide an interesting opportunity to build in consent features before viewing certain kinds of content. AR's current accessibility and discoverability challenges thus give it unique affordances that differ from purely physical changes to challenging sites: while site-specific AR does not currently lend itself to an easily discoverable, accessible shared experience, the technology can allow people to opt in to layers of additional content as they see fit. \subsubsection{Anchoring to the space} For \textit{Dear Visitor}, we decided to anchor AR content through a printed image marker since it was the most resilient tracking method. We prioritized reliability first and foremost, knowing that technical difficulties would easily distract from the content. Although we were fortunate enough to be able to use a pre-existing marker on a statue base for \textit{Charleston Reconstructed}, in the future, all location-based AR experiences would ideally be accessible onsite and without additional markers. In the future, AR systems could incorporate location and surface information with world knowledge, aligning an AR experience on the physical landscape despite surface changes in the space without the use of image markers. \subsubsection{Content curation} We initially considered creating an open comment platform allowing responses from the public in reaction to our projects, but we eventually decided to heavily curate the content due to the sensitive nature of the topics at hand. Currently, social reactions to digital interventions in public space are not typically captured. Balancing a desire to seek and reflect community input with the realities of difficult, time-intensive content moderation is an open challenge for collaborative digital projects, including those which may use AR as a technology and involve social justice challenges where many community members have opinions and stories. Related to the challenge of potentially curating comments about the project lies another conceptual challenge: who has the right to tell stories in public space? Narrative control over public space has usually been dominated by those in power, and these projects sought to add digital layers that surfaced stories at risk of being forgotten or suppressed. It remains to be seen how adding digital stories to physical space would play out at scale. Will digital memories in public space compete for attention by volume? Who will curate them over time? What control will the platforms that host them have in their curation and monetization? In parallel, the sudden ubiquity of text-to-3D models like Google's DreamFusion, \cite{poole2022dreamfusion} which creates 3D models using a text prompt, makes creating and distributing digital objects easier than ever. As we saw in \textit{Dear Visitor}, digital objects can easily be made manifest in real life, pointing to an additional set of potential implications for the real world as digital designs proliferate. These are conceptual open challenges with which designers of AR experiences must engage as the technology becomes more accessible. \section{Conclusion} We believe that AR is best used to connect digital content with the context in which it is presented. In our projects, we did this by linking digital layers of AR objects and stories to a contested physical monument in public space. A generalized technical solution for this kind of project is not yet available, but our two location-based prototypes \textit{Dear Visitor} and \textit{Charleston Reconstructed} explored the potential of AR to meaningfully engage with contested public spaces, highlighting underheard stories and proposing visual changes using digital objects along the way. We found that what we build in AR has real stakes, because virtual content facilitates real experiences, and because it can influence tangible changes to the physical world that expand impact beyond those who witnessed the AR experience. We intended for our projects to add value and meaning to the world on their own terms, in addition to any changes they might spur in physical space at their respective sites. To go beyond the affordances of the physical world, we added interventions in AR that are not accessible or possible in physical space alone at a monument site. Examples of the interventions specific to AR in \textit{Charleston Reconstructed} included "moving" a monument from another part of the city, recreating an AR representation of graffiti that was long ago removed from Marion Square, and adding a new, physics-defying digital AR monument. As such, the virtual experiences we designed created layers of meaning on top of what the physical space on its own could present. David Chalmers argues that virtual objects are real objects, \cite{chalmers2017virtual} and it follows that interacting with virtual objects gives rise to real, compelling experiences\textemdash not just simulations of experiences that then necessarily translate into the physical world. We can attest to the power of AR experiences that add dimension to our non-digital lives based on the reactions we received to the launch of \textit{Dear Visitor} and the soft launch of \textit{Charleston Reconstructed}. Though we imbued the projects with meaning regardless of changes they might inspire to physical space, by chance, we found strong evidence that what is designed and shown in the digital AR world can, in fact, manifest in the physical world. This occurred when our design and placement of the digital plaque in \textit{Dear Visitor} was used for the physical plaque installation at the garden site at Stanford. AR's potential to inspire a jump from a virtual design to a real physical change is exciting. In a context as high-stakes as the conflict over public monuments, it also comes with great responsibility, and with implications that should be taken seriously by those who design these kinds of digital objects and experiences. Severe political polarization in the US and beyond is often fueled by increasingly siloed digital echo chambers, but public space is something we still have in common and will continue to share. Enduring links between the digital and physical worlds are possible, and AR is uniquely positioned to facilitate new kinds of connections and experiences in shared space that bring people together if done thoughtfully, and if the technology can consistently support them. How the HCI community engages with the connection between the design of AR and public space will have major consequences for society on social justice issues and beyond. \begin{acks} We extend our thanks for the funding and support from the Brown Institute for Media Innovation. We thank Mark Hansen, Maneesh Agrawala, Ann Grimes, Michael Krisch, Juan Francisco Saldarriaga, and Amy Menes. We also thank Jeremy Bailenson, Geri Migielicz, Shelley Correll, and Alison Dahl Crossley at Stanford. We thank Michele Dauber and Chanel Miller. We thank Matt Shimura, Chanel Kim, Angela He, and Barna Szász for their work, feedback, and support of this project. We thank the many scholars, artists, community members and activists whose time and insights were shared in Charleston. We thank T'leya Walker for her contributions to this project. We thank Gail Mazzara and Kent Coit. We thank Kali Holloway and the Make It Right Project. \end{acks} \bibliographystyle{ACM-Reference-Format}
\section{Introduction}\label{introduction}} It has been argued that the development of computational capability was a significant force in human history. One can start with ancient Egypt, where mathematics and engineering were reserved to priests, through geographic discoveries, when accessible astronomy and precise computation allowed for daily course corrections, til now, when the availability of personal computing allows nearly all scientists tackle much greater challenges through bioinformatics, galaxy simulations, or mass analysis of social networks (Himelboim 2017). In the current philosophy of science, it is argued that the mass of empirical data allow us quicker to falsify less useful scientific theories, and thus that overall quality of our base theories has risen exponentially. However, at the same time, it is argued that despite more advanced methodologies, basic facts published by scientific journals have a higher and higher probability of being false (Ioannidis 2005; Economist 2013; Colquhoun 2017). Indeed it seems that philosophers of science have up to now failed to reconcile our feeling of growth of scientific knowledge, with the statistical measures proposed to quantify it. \hypertarget{definitions}{% \section{Definitions}\label{definitions}} \emph{Empiricism} is a philosophical view that all concepts originate from experience, and \emph{empirical science} is thus science is thus knowledge based on experimental confirmation and falsification. Thus scientific theories are those that may be subject to continued revision based on experiments. \emph{Falsificationism} claims that most statements cannot be logically deduced but only disproved by contrary evidence. Thus scientific knowledge develops by \emph{falsification} of theories by experience. Knowledge may be scientific only if it is falsifiable. Failed attempts at falsification increase our confidence in theories, whereas successful falsifications drive us to develop new theories(Popper 1934). \emph{Bayesianism} claims that all knowledge is subject to varying degrees of probability, and thus updating our beliefs should be subject to Bayes' rule(Laplace 1902; Hoang 2020). \emph{Predictivism} introduced in this work claims that we need to go further than just the requirement of empirical validation and a probabilistic view of knowledge. All scientific knowledge is just a way to provide probabilistic predictions and is subject to constraints of our computational abilities. Thus theories that have been falsified, but are computationally inexpensive, should be still considered valid scientific knowledge since they still provide predictions at lower costs than more complex theories. \hypertarget{research-questions}{% \section{Research questions}\label{research-questions}} We would like to discuss the following research questions: \begin{description} \tightlist \item[RQ1] What are traits of science as opposed to other human endeavours? \item[RQ2] Can we define science in such a way that it encompasses all current activities? \item[RQ3] How do the philosophies of science differ in their applicability to different domains and scientific activities? \end{description} \hypertarget{proposal}{% \section{Proposal}\label{proposal}} We propose to generalize the naive principle of simplification and computation, that says that theories allowing us for simpler explanations are indeed better scientific theories. And given the logical development of the theory of falsification, we want to eliminate absurdity of negative criterion for theoretical validity. After all, scientists willingly use falsified theories as tools when no better theories have been created. It is rare to argue that these falsified theories are a step back when they have some prediction. Indeed we claim that a series of empirical theories may be all somewhat false due to overgeneralization, and they still could represent the growth of scientific knowledge, if each consecutive theory provides more accurate predictions. Thus we claim that the \emph{predictive power} should be the most important quality of science. That makes science a practical tool that allows us to simplify and predict a universe of facts and explains the popularity of already falsified theories. Simpler theory may have simpler computational requirements and thus make predictions \emph{more accessible} for the scientists. Thus falsified theories become usual stepping stones in the hierarchy of theories, and an essential part of the holistic view of science as a predictive tool. One could be even tempted to draw theories in such a hierarchy and conclude that for a plot where the X-axis would be computational complexity of prediction, and Y-axis would be the accuracy of the prediction, useful scientific theories would go all the way along the waterfront of preference function. \hypertarget{scientific-theories-and-methodologies-considered}{% \section{Scientific theories and methodologies considered}\label{scientific-theories-and-methodologies-considered}} Here we give a few examples of how the framework of predictivism may explain the evolution of science. \hypertarget{newtonian-dynamics-vs-relativity-theory}{% \subsection{Newtonian dynamics vs relativity theory}\label{newtonian-dynamics-vs-relativity-theory}} Newtonian dynamics(Newton 1687) is a body of theories derived from Newton's three laws of motion. Its mathematical formulations are the basis for a significant body of state-of-art physical descriptions in physics, engineering, and architecture. However, it has since been falsified by experiments confirming the speed light limit and replaced by general relativity theory(Einstein 1905) and postnewtonian approximations(Chandrasekhar 1969). The discovery of quantum mechanics also forced a revision of the Newton equation(Meter 2011). Why is the theory still used long after its falsification? Would it not be prudent to stop teaching an obviously false theory and convert all mathematical descriptions to general relativity? While it seems possible for macroscopic interactions, it would also significantly increase the complexity of these descriptions. Indeed, practitioners in this field have long argued that sound research is characterized by the interaction of falsifiable theories, experimental measurements, and effective approximations(Hartmann 2001). Also, such replacement is not known in generality for quantum mechanics. \hypertarget{quantum-mechanics-vs-general-relativity}{% \subsection{Quantum mechanics vs general relativity}\label{quantum-mechanics-vs-general-relativity}} World description by quantum mechanics(Feynman 1950; Schweber 1986) is considered inconsistent with that of general relativity. Whereas general relativity correctly describes phenomena at the macroscale, quantum mechanics correctly describes sub-nanometer scale processes. Thus we see that both theories were falsified when tried in full generality! \hypertarget{biomolecular-structure-prediction}{% \subsection{Biomolecular structure prediction}\label{biomolecular-structure-prediction}} Having developed theories of protein structure(Pauling, Corey, and Branson 1951), scientists attempted to describe the mechanics of small and large molecules by means of molecular mechanics(Allinger 1959). This theory uses Newtonian laws of motion, together with a simplified view of chemical potentials, to describe forces acting on different atoms and thus model their interaction. This approach was so successful that nowadays, experimentalists turn to molecular mechanics to solve complex experimental data(Joosten et al. 2011). This is an example of a theory that is used despite its inaccuracy as compared with quantum chemistry (Warshel and Levitt 1976). Indeed its success has led to further simplifications: approximating covalent bonds by the stiff connections of fixed length, and recomputing all forces in angle space has given birth to torsion angle mechanics(Bae and Haug 1987; Kumar, Hosur, and Govil 1991). This method has sped up protein structure determination from days and hours to minutes for computing the simple model(Winn et al. 2002). Even further is the Rosetta method(Rohl et al. 2004), which uses molecular mechanics for the last stage of structure polishing but starts by simply trying to copy and paste fragments of existing protein structures from Protein Databank(H. M. Berman 2003, 2007; Consortium 2019) database and checking for geometrical compatibility\footnote{Called ``steric clashes''.}. This is an excellent example of a modern scientific domain that has developed by going towards computationally more straightforward and faster methods, in order to achieve overall improvements in the number and accuracy of predictions. This also shows how great progress in science is achieved by going from complex to simpler explanations, even though the simpler explanations are less accurate and indeed more easily falsified(Rauscher et al. 2015) \hypertarget{dna-barcoding-vs-computational-phylogeny}{% \subsection{DNA barcoding vs computational phylogeny}\label{dna-barcoding-vs-computational-phylogeny}} Add DNA barcoding as a recently proposed approximation method that tries to reduce the computational load of getting the right answer. DNA barcoding(Woese, Kandler, and Wheelis 1990; Hebert et al. 2003) is a recent method of species identification that attempts to decrease the computational complexity of the process. It is based on a comparison of gene regions with a less interspecific variation. Alternative ``golden standard of truth'' for species differentiation nowadays is computational phylogeny analysis, but his method requires extensive sequencing of the genome and computational analysis that requires computational resources as well as expertise. That is why DNA barcoding was proposed as a method that can be used by the wider society of scientists. DNA barcoding is also faster than traditional morphological comparison methods and can be used when fruits and pollens are unavailable. \hypertarget{history}{% \subsection{History}\label{history}} Science of history can also be described as following from the known \emph{historical records} to infer likely \emph{historical facts}\footnote{The historical events may not have been exactly correspond to the events in records, and this is an important part of the process} in order to describe processes that shaped human history. This seems hard to describe in either a classical framework of seeking the truth (since we know that a significant percentage of the facts will be untrue), within the framework of empiricism (since we can hardly \emph{repeat the experiment}) and within the framework of falsificationism (since strict falsification of most historical facts would require time travel). However, it is easy to describe within a framework of predictivism: we say that inferred historical events are most likely, and the simplest explanation of the existing historical records. In the same manner, we discuss historical forces and processes: they are more general, shorter, and thus more predictive explanations of the historical facts than enumerating the facts themselves. This shows how the framework of predictivism can describe science outside of the empirical domain. \hypertarget{philosophy}{% \subsection{Philosophy}\label{philosophy}} In our proposal, some fields of philosophical endeavour can be rephrased into fields of predictive science: \begin{itemize} \tightlist \item ontology as a way of predicting mutual relations of abstract terms and classifications \item axiology as a way of predicting consistency of value judgements \end{itemize} In this sense, we can straightforwardly state that philosophy is indeed \emph{empirical} science since we have clear metrics of success for each theory. \hypertarget{engineering-as-the-science-of-achieving-goals}{% \subsection{Engineering as the science of achieving goals}\label{engineering-as-the-science-of-achieving-goals}} Similarly, many engineering and applied mechanics domains are obviously scientific: for example, software engineering is the art of predicting what software systems will satisfy design (or business) goals while optimizing the work effort. We can also argue that such a definition of science makes it easy to explain improved fitness achieved by individuals and organizations using scientific methods to compete. Even if these methods are based on falsifiable theories, predictive power allows these entities to improve their fitness by either reducing computational effort needed for situational awareness or providing increased situational awareness. \hypertarget{what-is-the-value-of-the-theory}{% \section{What is the value of the theory?}\label{what-is-the-value-of-the-theory}} What differentiates science from epistemic decisions of the individual are that scientific theories are transmitted within the community, and verifiable by community members. The first factor allows us to build scientific theories across the chasm of time and to make steady progress in our understanding of the world. But the second factor is also important: it allows us to ``discard spam'': theories contributing less than the others, by the merit of providing less truthy or more computationally expensive predictions. This allows us to avoid an explosion of untruths that would otherwise accumulate in unfiltered culture. We still have a ``valuation'' of scientific theories. One such valuation is truth-untruth; however, Laplace posited that we could only assess the probability of the truth, so bayesian interpretation by the probability of truth is in order. Additional gradation may be that of Kolmogorov complexity of the explanation since simpler explanations are preferred. The philosophy described here points out that besides the probability of truthiness, we also have a computational complexity of using the theory in practice. Epistemological preference would thus only choose theories that either enjoy a higher probability of truthiness OR lower computational complexity. This is important both for humans (who can use multiple methods but see only a few moves ahead in games like chess) and for computers. One can, of course, argue that epistemological computational cost is different for humans and for computers. They have different computational models: humans have massively parallel neural networks of only limited depth and a limited number of layers that can be used during the time for computation; computers have highly sequential CPUs that allow for billions of operations per second but only limited parallelism. One can also consider the cost of human training or implementation of prediction software on the computing platform, but the resolution will be similar: the overall computational complexity of both implementing and running the predictive theory will dictate its value much more than its truthiness. Because most of the time, we only predict as much as our computational power predicts, not only saving energy this way but providing a timely world-view to our decision making. \hypertarget{family-of-optimal-theories}{% \section{Family of optimal theories}\label{family-of-optimal-theories}} It also allows us to talk about ultrafinitist logic, calculus of constructions, intuitionist logic, and classical logic on equal footing by considering them some possible \emph{optimal} points on the scale between the accessibility of logic and the desire for the elimination of all paradoxes. Thus one could argue that the recent development of multimodal and other variant logics is not experimentation, but a natural exploration of \emph{all possible optimal theories} within this space. \hypertarget{discussion}{% \section{Discussion}\label{discussion}} We see how predictivism provides an accessible basis for defining various domains of science, and explains the continued development of readily falsified theories. We also propose a metric that allows us to compare theories on a non-bibliometric basis, and thus judge whether they are optimal in the sense of providing the best prediction for a given computational complexity or not. We thus proposed a re-evaluation of the philosophy of science through the lens of computational complexity. This suggests that computational complexity may be indeed a fundamental concept for the understanding of science in general, just like the theory of probability is. \hypertarget{bibliography}{% \section{Bibliography}\label{bibliography}} \hypertarget{refs}{} \begin{CSLReferences}{1}{0} \leavevmode\vadjust pre{\hypertarget{ref-molecular-mechanics}{}}% Allinger, Norman. 1959. {``Conformational Analysis. III. Applications to Some Medium Ring Compounds1,2.''} \emph{Journal of the American Chemical Society} 81 (November). \url{https://doi.org/10.1021/ja01530a049}. \leavevmode\vadjust pre{\hypertarget{ref-sep-phil-cs}{}}% Angius, Nicola, Giuseppe Primiero, and Raymond Turner. 2021. {``{The Philosophy of Computer Science}.''} In \emph{The {Stanford} Encyclopedia of Philosophy}, edited by Edward N. Zalta, Spring 2021. \url{https://plato.stanford.edu/archives/spr2021/entries/computer-science/}; Metaphysics Research Lab, Stanford University. \leavevmode\vadjust pre{\hypertarget{ref-torsion-angle-dynamics-mechanical}{}}% Bae, Dae-Sung, and Edward J. Haug. 1987. {``A Recursive Formulation for Constrained Mechanical System Dynamics: Part i. Open Loop Systems.''} \emph{Mechanics of Structures and Machines} 15 (3): 359--82. \url{https://doi.org/10.1080/08905458708905124}. \leavevmode\vadjust pre{\hypertarget{ref-postnewtonianApproximations}{}}% Chandrasekhar, S. 1969. {``{Conservation Laws in General Relativity and in the Post-Newtonian Approximations}''} 158 (October): 45. \url{https://doi.org/10.1086/150170}. \leavevmode\vadjust pre{\hypertarget{ref-p-values}{}}% Colquhoun, David. 2017. {``The Reproducibility of Research and the Misinterpretation of p-Values.''} \emph{Royal Society Open Science} 4 (12): 171085--85. \url{https://doi.org/10.1098/rsos.171085}. \leavevmode\vadjust pre{\hypertarget{ref-PDB3}{}}% Consortium, wwPDB. 2019. {``Protein Data Bank: The Single Global Archive for 3d Macromolecular Structure Data.''} \emph{Nucleic Acids Research} 47 (12): 520--28. \url{https://doi.org/10.1093/nar/gky949}. \leavevmode\vadjust pre{\hypertarget{ref-trouble-in-the-lab}{}}% Economist. 2013. 2013. \url{https://www.economist.com/briefing/2013/10/18/trouble-at-the-lab}. \leavevmode\vadjust pre{\hypertarget{ref-relativity-theory}{}}% Einstein, A. 1905. {``Zur Elektrodynamik Bewegter Körper.''} \emph{Annalen Der Physik} 322 (10): 891--921. https://doi.org/\url{https://doi.org/10.1002/andp.19053221004}. \leavevmode\vadjust pre{\hypertarget{ref-quantumDynamics}{}}% Feynman, R. P. 1950. {``Mathematical Formulation of the Quantum Theory of Electromagnetic Interaction.''} \emph{Phys. Rev.} 80 (November): 440--57. \url{https://doi.org/10.1103/PhysRev.80.440}. \leavevmode\vadjust pre{\hypertarget{ref-PDB1}{}}% H. M. Berman, H. Nakamura, K. Henrick. 2003. {``Announcing the Worldwide Protein Data Bank.''} \emph{Nature Structural Biology} 10 (12): 980. \leavevmode\vadjust pre{\hypertarget{ref-PDB2}{}}% ---------. 2007. {``(2007) the Worldwide Protein Data Bank (wwPDB): Ensuring a Single, Uniform Archive of PDB Data Nucleic Acids Res. 35 (Database Issue): D301-3.''} \emph{Nucleic Acids Research} 35 (Database issue) (3): 301. \leavevmode\vadjust pre{\hypertarget{ref-effectiveFieldTheories}{}}% Hartmann, Stephan. 2001. {``Effective Field Theories, Reductionism and Scientific Explanation.''} \emph{Studies in History and Philosophy of Science Part B: Studies in History and Philosophy of Modern Physics} 32 (2): 267--304. https://doi.org/\url{https://doi.org/10.1016/S1355-2198(01)00005-3}. \leavevmode\vadjust pre{\hypertarget{ref-dna-barcoding-paper}{}}% Hebert, Paul D. N., Alina Cywinska, Shelley L. Ball, and Jeremy R. deWaard. 2003. {``Biological Identifications Through DNA Barcodes.''} \emph{Proceedings of the Royal Society of London. Series B: Biological Sciences} 270 (1512): 313--21. \url{https://doi.org/10.1098/rspb.2002.2218}. \leavevmode\vadjust pre{\hypertarget{ref-social-networks}{}}% Himelboim, Itai. 2017. {``Social Network Analysis (Social Media).''} In. \url{https://doi.org/10.1002/9781118901731.iecrm0236}. \leavevmode\vadjust pre{\hypertarget{ref-hoang}{}}% Hoang, Lê Nguyên. 2020. \emph{{The Equation of Knowledge: From Bayes' Rule to a Unified Philosophy of Science}}. 1st ed. Chapman; Hall/CRC. \url{https://doi.org/10.1201/9780367855307}. \leavevmode\vadjust pre{\hypertarget{ref-ioannidis}{}}% Ioannidis, John P. A. 2005. {``Why Most Published Research Findings Are False.''} \emph{PLOS Medicine} 2 (8). \url{https://doi.org/10.1371/journal.pmed.0020124}. \leavevmode\vadjust pre{\hypertarget{ref-pdb-remodeling}{}}% Joosten, Robbie P., Krista Joosten, Serge X. Cohen, Gert Vriend, and Anastassis Perrakis. 2011. {``{Automatic rebuilding and optimization of crystallographic structures in the Protein Data Bank}.''} \emph{Bioinformatics} 27 (24): 3392--98. \url{https://doi.org/10.1093/bioinformatics/btr590}. \leavevmode\vadjust pre{\hypertarget{ref-Kuhn}{}}% Kuhn, Thomas S. 1970. \emph{The Structure of Scientific Revolutions}. Chicago: University of Chicago Press. \leavevmode\vadjust pre{\hypertarget{ref-torsion-angle-dynamics}{}}% Kumar, R. Ajay, R. V. Hosur, and G. Govil. 1991. {``Torsion Angle Approach to Nucleic Acid Distance Geometry: TANDY.''} \emph{Journal of Biomolecular NMR} 1 (4): 363--78. \url{https://doi.org/10.1007/BF02192860}. \leavevmode\vadjust pre{\hypertarget{ref-laplace}{}}% Laplace, Pierre Simon. 1902. \emph{A Philosophical Essay on Probabilities}. New York: J. Wiley \& Sons. \leavevmode\vadjust pre{\hypertarget{ref-newton-schroedinger}{}}% Meter, J R van. 2011. {``Schrödinger--Newton {`Collapse'} of the Wavefunction.''} \emph{Classical and Quantum Gravity} 28 (21): 215013. \url{https://doi.org/10.1088/0264-9381/28/21/215013}. \leavevmode\vadjust pre{\hypertarget{ref-newton}{}}% Newton, Isaac. 1687. \emph{Philosophiae Naturalis Principia Mathematica}. William Dawson \& Sons Ltd., London. \leavevmode\vadjust pre{\hypertarget{ref-protein-structure}{}}% Pauling, Linus, Robert Corey, and H. Branson. 1951. {``The Structure of Proteins: Two Hydrogen-Bonded Helical Configurations of the Polypeptide Chain.''} \emph{Proceedings of The National Academy of Sciences - PNAS} 37 (April). \url{https://doi.org/10.1073/pnas.37.4.205}. \leavevmode\vadjust pre{\hypertarget{ref-popper}{}}% Popper, K. R. 1934. \emph{The Logic of Scientific Discovery}. London: Hutchinson. \leavevmode\vadjust pre{\hypertarget{ref-sarah-disordered-proteins}{}}% Rauscher, Sarah, Vytautas Gapsys, Michal J. Gajda, Markus Zweckstetter, Bert L. de Groot, and Helmut Grubmüller. 2015. {``Structural Ensembles of Intrinsically Disordered Proteins Depend Strongly on Force Field: A Comparison to Experiment.''} \emph{Journal of Chemical Theory and Computation} 11 (11): 5513--24. \url{https://doi.org/10.1021/acs.jctc.5b00736}. \leavevmode\vadjust pre{\hypertarget{ref-Wittgenstein}{}}% Rodych, Victor. 2018. {``{Wittgenstein's Philosophy of Mathematics}.''} In \emph{The {Stanford} Encyclopedia of Philosophy}, edited by Edward N. Zalta, Spring 2018. \url{https://plato.stanford.edu/archives/spr2018/entries/wittgenstein-mathematics/}; Metaphysics Research Lab, Stanford University. \url{https://plato.stanford.edu/archives/spr2018/entries/wittgenstein-mathematics/}. \leavevmode\vadjust pre{\hypertarget{ref-rosetta}{}}% Rohl, Carol A., Charlie E. M. Strauss, Kira M. S. Misura, and David Baker. 2004. {``Protein Structure Prediction Using Rosetta.''} In \emph{Numerical Computer Methods, Part d}, 383:66--93. Methods in Enzymology. Academic Press. https://doi.org/\url{https://doi.org/10.1016/S0076-6879(04)83004-0}. \leavevmode\vadjust pre{\hypertarget{ref-feynmannHistory}{}}% Schweber, Silvan S. 1986. {``Feynman and the Visualization of Space-Time Processes.''} \emph{Rev. Mod. Phys.} 58 (April): 449--508. \url{https://doi.org/10.1103/RevModPhys.58.449}. \leavevmode\vadjust pre{\hypertarget{ref-quantum-molecular-mechanics}{}}% Warshel, A., and M. Levitt. 1976. {``Theoretical Studies of Enzymic Reactions: Dielectric, Electrostatic and Steric Stabilization of the Carbonium Ion in the Reaction of Lysozyme.''} \emph{Journal of Molecular Biology} 103 (2): 227--49. https://doi.org/\url{https://doi.org/10.1016/0022-2836(76)90311-9}. \leavevmode\vadjust pre{\hypertarget{ref-computational-protein-structure-determination}{}}% Winn, M. D., A. W. Ashton, P. J. Briggs, C. C. Ballard, and P. Patel. 2002. {``{Ongoing developments in {\emph{CCP}}4 for high-throughput structure determination}.''} \emph{Acta Crystallographica Section D} 58 (11): 1929--36. \url{https://doi.org/10.1107/S0907444902016116}. \leavevmode\vadjust pre{\hypertarget{ref-dna-barcoding-proposal}{}}% Woese, C R, O Kandler, and M L Wheelis. 1990. {``Towards a Natural System of Organisms: Proposal for the Domains Archaea, Bacteria, and Eucarya.''} \emph{Proceedings of the National Academy of Sciences} 87 (12): 4576--79. \url{https://doi.org/10.1073/pnas.87.12.4576}. \leavevmode\vadjust pre{\hypertarget{ref-wolfram-new-kind-of-science}{}}% Wolfram, Stephen. 2002. \emph{{A new kind of science}}. 1st ed. Wolfram Media. \url{https://www.wolframscience.com/nks/}. \end{CSLReferences} \end{document}
\section{Summary and conclusion} \label{sec:conclusion} For the case of disk galaxies, as provided by the SPARC data-set (see section \ref{sec:data}), we have studied the galactic rotation curves and different galaxy scaling relations --- such as the Radial Acceleration Relation, MDAR and DM surface density relation (SDR) --- from an alternative perspective in which the halos are formed through a MEP. Within this paradigm we considered the DM halo as a self-gravitating system of neutral fermions at finite temperature while the baryonic mass components were provided from the SPARC data-set. For comparison, we have taken into account empirical DM fitting models motivated from DM-only simulations like NFW (within CDM) and Burkert (within WDM); the DC14 (or generalized NFW) model which contains different physics such as the influence of baryonic feedback in the morphology of CDM halos; and the Einasto model as recently studied in \citet{2019MNRAS.483.4086B} accounting for baryonic effects (through hydrodynamical zoom-in simulations) in either cosmology. Finally, their best-fits to the acceleration relations and SPARC RCs were compared with the fermionic model (see sections \ref{sec:result:ac} and \ref{sec:result:gof} respectively). For all competing DM models, we fitted the DM contribution to the RC as inferred from the given total rotation curve and the baryonic component (see section \ref{LM-fitting}). An alternative fitting approach is minimizing the least square errors of the total rotation curve (e.g. $V_i = V_{i, \rm tot}$) where the predictions are a composition of a theoretical DM halo model and the baryonic component inferred from observation. On theoretical ground, such an approach is not identical to the approach explained in section \ref{sec:fitting} since the propagation of uncertainty produces a somewhat different weighting. However, we have repeated the same analysis on both approaches and obtained consistent results despite few minor numerical variations, and without changing any qualitative conclusion obtained in this work. The main results of this work can be summarized as follows, according to three different issues. \subsection{Acceleration relations} The Radial Acceleration Relation as well as MDAR analyzed here are based on an averaging of many spiral galaxies and hold for different Hubble types. Our analysis shows that all competing DM models are able to reproduce those relations, although without a clear favourite because all are similarly good (see \cref{fig:acceleration:grid}). For instance, for all DM models, we obtain nearly identical values for $\mathfrak{a}_0$ as required in \cref{eq:mcgaugh-fit}. This result is in line with a recent analysis done in \citet{2020JCAP...06..027K}. \subsection{Individual rotation curve fittings} A deeper understanding of the Radial Acceleration Relation and MDAR is backed by a goodness of model analysis for $120$ filtered and individual galaxies of the SPARC data set covering different Hubble types. The DM contribution to the RCs reflects some diversity in galaxies which, in general, are better fitted by cored DM halo models instead of cuspy (e.g. NFW, see \cref{fig:goodness:all}). This is not only in agreement with a similar analysis done by \citet{2020ApJS..247...31L}, but totally in line with the results of \citet{2020JCAP...06..027K}. That is, it has been shown here that the DM halo models suitable to explain the acceleration relations do not necessary explain well the SPARC RCs. Comparing the fitting goodness of the superior DC14 with the inferior (and statistically disfavoured) NFW implies that baryonic feedback mechanism is important in galaxy formation. On the other hand, we found that the fermionic model, compared to DC14 or Einasto, is equally good in fitting galaxies which require a significant escape of particles (i.e. $W_p < 10$, see section \ref{sec:result:gof} and \cref{fig:goodness:with-cutoff}). Those galaxies are characterized by a flat inner halo, justified by very different physical principles in the most favored DM profiles: DC14 and Einasto models rely on complex baryonic feedback processes, while the MEP scenario involves a quasi-thermodynamic equilibrium of the DM particles. This may imply that for those galaxies baryonic feedback is less relevant, thus hinting on the importance of a quasi-thermodynamic equilibrium that may be reached in those DM halos. \subsection{Fermionic halos} We found that for SPARC galaxies the \textit{constancy} of SDR, originally based on the Burkert model \citep{2009MNRAS.397.1169D}, is also achievable within the fermionic DM model. From the Carnegie-Irvine Galaxy Survey \citep{2011ApJS..197...21H} we have further extracted the absolute magnitude for nine overlapping SPARC galaxies. The surface density predictions of that sub-sample are well in agreement with observations. Additionally we demonstrated that particular solutions from the rich morphology of fermionic DM on halo scales can be associated with different empirical DM models, depending on the strength of particle evaporation (described by $W_p$). Fermionic DM halos are polytropic-like (with $n = 5/2$) for strong evaporation ($W_p \ll 1)$, transition into profiles similar to Burkert for values of $W_p$ close to the point of marginal thermodynamical stability (given at $W_p^{(c)} = 7.45$) and finally develop isothermal tails for negligible evaporation ($W_p \gg 10$). Interestingly, the mean $\kappa$ value obtained here for the Einasto model is roughly $0.4$, implying a pronounced inner-halo density drop (i.e leading to an almost flat inner-slope, see \cref{fig:profile-illustration-mep}), such that the halos look more like the fermionic profiles. Indeed, following the work done in \cite{2021MNRAS.502.4227A} for such fermionic profiles, it can be found that typical galaxies belonging to this sub-group (with $W_p \ll 1$) are thermodynamically and dynamically stable, with an outer-halo morphology of polytropic nature (see \cref{fig:halo-profiles}). This may be evidencing a fundamental and deep link between thermodynamics of self-gravitating fermions and galaxy formation and morphology. \subsection{Baryonic feedback} \label{sec:baryonic-effect} The DM in galaxies evolves together with baryons, thus it is expected some degree of baryonic feedback on scales where baryons dominate. This also seems to be the case within the SPARC galaxies here considered, where almost half of the points in upper-left panel of Fig. \ref{fig:acceleration:grid} roughly fulfill $a_\mathrm{tot} < 2 a_\mathrm{bar}$. One of the main baryonic effects onto the total gravitational potential is thought to happen due to a sustained process of stellar bursts, which drives baryonic material from inner-halo regions while ending in a reduction of DM densities at those halo scales (see e.g. \citealp{2012MNRAS.422.1231G,2016MNRAS.459.2573R}). However, the quantification of such baryonic effects have always been calibrated and applied to cuspy CDM halos. Only recently it was shown that baryonic feedback is DM-model dependent. That is, in WDM cosmologies such effects are typically diminished with respect to CDM \citep{2019MNRAS.483.4086B}. The main reasons behind this attenuation are that in WDM cosmologies DM halos form later, are less centrally dense on inner-halo scales, and therefore contain galaxies that are less massive with less baryon content than the CDM counterparts. Since the halos of the Burkert, Einasto and fermionic DM model correspond to WDM cosmologies, it is expected that baryonic effects are milder in those cases. However, a thorough quantification of this feedback has only been worked out for Einasto profiles \citep{2019MNRAS.483.4086B} and still remains to be solved in the case of fermionic halos before taking any conclusion, though out of the scope of this work. In any case, and regardless of a potential feedback of the baryons onto the fermionic DM profile, it is important to emphasize a key result of this work: the flatness in the inner-halo slope of MEP profiles is due to a (quasi) thermodynamic equilibrium reached by the DM particles, thus involving a different physical principle than the one explained above for the baryons. Finally, two DM model considered here --- DC14 \citep{2014MNRAS.441.2986D} and Einasto \citep{2019MNRAS.483.4086B} --- (effectively) account for baryonic feedback. That is, any baryonic feedback expected to arise for SPARC galaxies should be reflected in the best-fit parameters of the DM profiles with its consequent universal shape reflecting such effects. In section \ref{sec:result:gof} we compare our statistical results regarding baryonic effects in the DM model free-parameters with the ones reported in the literature. \subsection{Fermionic DM halos from MEP} \label{sec:model:rar} It has been proposed by several authors (see, e.g. \citealp{2020EPJP..135..290C} for an exhaustive list of references) that DM halos could be made of fermions (e.g. sterile neutrinos) in gravitational interaction. It is usually assumed that the fermions are in a statistical equilibrium state described by the Fermi-Dirac distribution function. However, the notion of statistical equilibrium for systems with long-range interactions is subtle. If the fermions are non-interacting, apart from gravitational forces, the relaxation time towards statistical equilibrium due to gravitational encounters scales as $(N/\ln N)t_D$ \citep[see e.g.][]{Binney2008} and exceeds the age of the Universe by many orders of magnitude. For example, assuming a fermion mass $m c^2 \sim \SI{50}{\kilo\eV}$, a DM halo of mass $M\sim \SI{E11}{\Msun}$ and radius $R \sim \SI{30}{\kilo\parsec}$ contains $N\sim \num{E72}$ fermions for a dynamical time $t_D\sim 1/\sqrt{R^3/G M}\sim 100\, {\rm Myrs}$. Therefore, on the Hubble time, the gas of fermions is essentially collisionless, being described by the Vlasov-Poisson equations. Yet, it can achieve a form of statistical equilibrium on a coarse-grained scale through a process of violent relaxation. This concept was introduced by \cite{1967MNRAS.136..101L} in the case of collisionless stellar systems and has been exported to DM by \citet{1996ApJ...466L...1K} and \citet{2015PhRvD..92l3527C}. Assuming ergodicity (efficient mixing), \citet{1967MNRAS.136..101L} used a MEP and looked for the {\it most probable} equilibrium state consistent with the constraints of the collisionless dynamics. The maximization of the Lynden-Bell entropy $S$ under suitable constraints leads to a coarse-grained distribution function $\bar{f}({\vec r},{\vec v})$ similar to the Fermi-Dirac distribution function. Therefore, the process of violent relaxation may provide a justification of the Fermi-Dirac distribution function for DM halos without the need of efficient gravitational encounters. However, when coupled to gravity, this distribution function has an infinite mass (i.e., there is no maximum entropy state), implying that either violent relaxation is incomplete or that tidal effects have to be taken into account (if the system is not isolated). The problem therefore becomes an out-of-equilibrium problem and it is necessary to develop a kinetic theory of collisionless relaxation (see e.g. \citealp{2021arXiv211213664C} for a review). One approach is to use a Maximum Entropy Production Principle (MEPP) and argue that the most probable evolution of the system on the coarse-grained scale is the one that maximizes the rate of Lynden-Bell entropy $\dot S$ under the constraints of the collisionless dynamics \citep{1996ApJ...471..385C}. This leads to a generalized Fokker-Planck equation having the form of a fermionic Kramers equation \begin{equation} \label{kramers} \frac{\partial \bar f}{\partial t} + \vec v \cdot \frac{\partial \bar f}{\partial \vec r} - \nabla\Phi \cdot \frac{\partial \bar f}{\partial \vec v} = \frac{\partial \vec J}{\partial \vec v}, \end{equation} where $\vec J=D[\partial \bar f/\partial \vec v + (mc^2/kT) \bar f (1-f/\eta_0) \vec v]$ is a diffusion current pushing the system towards statistical equilibrium, $D$ the diffusion coefficient, $T \equiv T(t)$ is the temperature evolving in time so as to conserve the total energy \citep{1998MNRAS.300..981C}, $k$ is the Boltzmann constant, $c$ is the speed of light, and $m$ is the DM fermion mass. However, this approach is heuristic and does not determine the expression of the diffusion coefficient. An alternative, more systematic, approach is to develop a quasilinear theory of ``gentle'' collisionless relaxation \citep{1970PhRvL..25.1155K,1980Ap&SS..72..293S,1998MNRAS.300..981C,2004PhyA..332...89C} leading to a fermionic Landau equation of the form \begin{multline} \label{landau} \frac{\partial \bar f}{\partial t} + \vec v \cdot \frac{\partial \bar f}{\partial \vec r} - \nabla\Phi \cdot \frac{\partial \bar f}{\partial \vec v} = \frac{8\pi G^2m^8\epsilon_r^3\epsilon_v^3\ln\Lambda}{h^6}\frac{\partial}{\partial v_i} \int {\rm d}\vec v'\\ \times \frac{u^2\delta_{ij} - u_i u_j}{u^3}\left\lbrace \bar f' \left (1 - \bar f'\right ) \frac{\partial \bar f }{\partial v_j} - \bar f \left(1-\bar f\right) \frac{\partial \bar f'}{\partial v'_j}\right\rbrace, \end{multline} where $\bar{f}' \equiv \bar{f}({\vec r},{\vec v}', t)$, $\ln\Lambda=\ln(R/\epsilon_r)$ is the Coulomb logarithm, $R$ is the typical size of the system, $\vec u = \vec v' - \vec v$ is the relative velocity between the ``macro-particles'' of mass $m_{\rm eff}\sim 2m^4 \epsilon_r^3\epsilon_v^3/h^3 \gg m$ (see also below), and $\epsilon_r$, $\epsilon_v$ are the correlation lengths in position and velocity respectively. One can make a connection between the above two kinetic equations by using a form of thermal bath approximation, i.e., by replacing $\bar f'$ in \cref{landau} by its equilibrium (Fermi-Dirac) expression. This substitution transforms an integro-differential (Landau) equation into a differential (Kramers) equation. In this manner one can compute the diffusion coefficient explicitly \citep{1998MNRAS.300..981C}. The timescale of violent relaxation is a few $10-100$ dynamical times ($t_D$), which is shorter than the Hubble time $t_H$. This is confirmed by the kinetic theory of violent relaxation that predicts a collisionless relaxation time $t_R^{\rm non-coll.}\sim (M/m_{\rm eff})t_D$ which is much shorter than the collisional relaxation time $t_R^{\rm coll.}\sim (M/m)t_D$ because $m_{\rm eff}\gg m$ (see formula in the above paragraph). Indeed, the relaxation of the coarse-grained DF $\bar{f}({\vec r},{\vec v},t)$ towards the Lynden-Bell distribution (of Fermi-Dirac type, see Eq. \ref{fcDF} below) on a few dynamical times can be interpreted in terms of ``collisions'' between ``macro-particles'' or ``clumps'' (i.e. correlated regions) with a large effective mass $m_{\rm eff}$ \citep{1970PhRvL..25.1155K}. These macro-particles considerably accelerate the relaxation of the system (as compared to ordinary gravitational encounters between particles of mass $m$) by increasing the diffusion coefficient $D$ in \cref{kramers}. Processes of incomplete relaxation could be taken into account by generalizing the kinetic approach so that the diffusion coefficient rapidly falls off to zero in space and time, thereby leading to a sort of kinetic blocking. Alternatively, if the system is submitted to tidal interactions from neighboring systems one can look for a stationary solution of \cref{kramers} which accounts for the depletion of the distribution function above an escape energy. For classical systems evolving through two-body gravitational encounters like globular clusters, this procedure leads to the King model \citep{1962AJ.....67..471K}. For fermionic DM halos, one obtains the fermionic King model \citep{1983A&A...119...35R,1998MNRAS.300..981C} \begin{equation} \bar{f}(r,\epsilon\leq\epsilon_c) = \frac{1-e^{[\epsilon-\epsilon_c(r)]/kT(r)}}{e^{[\epsilon-\mu(r)]/kT(r)}+1}, \qquad \bar{f}(r,\epsilon>\epsilon_c)=0\, , \label{fcDF} \end{equation} which has been written in the case of general relativistic fermionic systems for the sake of generality \citep{2018PDU....21...82A,2022IJMPD..3130002A}. Here, $\epsilon=\sqrt{p^2c^2 + m^2 c^4} - mc^2$ is the particle kinetic energy, $\mu(r)$ is the chemical potential (with the particle rest-energy subtracted off), $\epsilon_c(r)$ is the escape energy (with the particle rest-energy subtracted off), and $T(r)$ is the effective temperature. The corresponding set of three dimensionless parameters (for fixed $m$) are defined by the temperature, degeneracy and cutoff parameters, $\beta(r)=k T(r)/(m c^2)$, $\theta(r)=\mu(r)/[k T(r)]$ and $W(r)=\epsilon_c(r)/[k T(r)]$, respectively (a subscript $0$ is used when the parameters are evaluated at the center of the configuration). This distribution function takes into account the Pauli exclusion principle as well as tidal effects, and can lead to a relevant model of fermionic DM halos usually referred as the RAR model, which has been successfully contrasted against galaxy observables \citep{2018PDU....21...82A,2019PDU....24..278A,2020A&A...641A..34B,2021MNRAS.505L..64B,2022MNRAS.511L..35A}. The full family of density $\rho(r)$ and pressure $P(r)$ profiles within this model can be directly obtained as the corresponding integrals of $\bar{f}(p)$ over momentum space (bounded from above by $\epsilon \leq \epsilon_c(r)$) as detailed in \citet{2018PDU....21...82A}. This leads to a four-parametric fermionic equation of state depending on ($\beta_0,\theta_0,W_0,m$) according to the parameters in \cref{fcDF}. Once with the fermionic distribution function at equilibrium as obtained from the MEP explained above, we make use of the fact that a relaxed system of fermions under self-gravity does admit a perfect fluid approximation \citep{1969PhRv..187.1767R}. Thus, we use the stress-energy tensor of a perfect fluid in a spherically symmetric metric, $g_{\mu\nu}=\diag(\e^{2\nu(r)},-\e^{2\lambda(r)},-r^2,-r^2\sin^2\vartheta)$ with $\nu(r)$, $\lambda(r)$ being the temporal and spatial metric functions and $\vartheta$ the azimutal angle. Such configuration leads to hydrostatic equilibrium equations of self-gravitating fermions. The local $T(r)$, $\mu(r)$ and $W(r)$ fulfill the Tolman, Klein and particle's energy conservation relations, respectively (see \citealp{2018PDU....21...82A} for details). Further, $\nu_0$ is here constrained by the Schwarzschild condition $g_{00}g_{11} = -1$ at the surface where the halo pressure (and density) falls to zero. An illustration of a core-halo ($\theta_0 > 10$) and a corresponding halo-only ($\theta_0 \ll -1$) solution are shown in \cref{fig:profile-illustration-mep} (we refer to section \ref{sec:morph} and to the cited works above to get a better understanding of the rich morphology of the fermionic DM model). \loadfigure{figure/ProfileIllustrationsAll} Mass distributions of that fermionic model are well characterized by the cutoff difference $W(r_p) - W(r_s)$. Since $W(r)$ is defined to be zero at the surface, i.e. $W(r_s) = 0$ with $r_s$ being the surface radius where the density drops to zero, we need to focus only on the plateau cutoff $W_p = W(r_p)$ with $r_p$ being the plateau radius defined at the first minimum in the rotation curve. Other important quantities of the \textit{core-halo} family of fermionic DM mass solutions are the core mass $M_c = M(r_c)$ with $r_c$ being the core radius defined at the first maximum in the rotation curve, the halo mass $M_h = M(r_h)$ with $r_h$ being the halo radius defined at the second maximum in the rotation curve, and the total mass $M_s = M(r_s)$ given at the surface radius $r_s$. The density profiles in the fermionic model can develop a rich morphological behaviour: while the halo region is King-like (i.e. from polytropic-like with $W_p \ll 1$ to power law-like with $W_p \gtrsim 10$, see \ref{sec:morph}), the inner region can either develop a \textit{dense core} at the center of such a halo (i.e. for large central degeneracy $\theta_0 > 10$), or not (i.e. $\theta_0 \ll -1$ in the dilute regime). Both kind of family profiles are thermodynamically and dynamically stable as well as long lived in a cosmological framework, as recently demonstrated in \citet{2021MNRAS.502.4227A} for typical galaxies with total masses of the order $\sim \SI{5E10}{\Msun}$. Remarkably, for \textit{core} - \textit{halo} RAR solutions with fermion masses of $m c^2\approx \SI{50}{\kilo\eV}$, the degenerate and compact DM cores may work as an alternative to the BH paradigm at the center of non-active galaxies \citep{2018PDU....21...82A,2019PDU....24..278A,2020A&A...641A..34B,2021MNRAS.505L..64B,2022MNRAS.511L..35A}. Furthermore, their eventual gravitational core-collapse in larger galaxies may offer a novel supermassive BH formation mechanism from DM \citep{2021MNRAS.502.4227A}. \subsection{Fitting priors and Monte-Carlo approach} \label{boundaryC} For the fermionic DM model we fix the particle mass $m$ and therefore reduce the number of free parameters by one, e.g. $\vec p = (\beta_0, \theta_0, W_0)$. A particle mass of $mc^2 = \SI{50}{\kilo\eV}$ is well motivated by the promising results obtained in \citet{2018PDU....21...82A,2020A&A...641A..34B,2021MNRAS.505L..64B,2022MNRAS.511L..35A}, where the fermionic core-halo DM profile was able to explain both the S-stars orbits around SgrA*, and the Milky Way rotation curve. In \citet{2019PDU....24..278A,2021MNRAS.502.4227A}, in particular, and for the same particle mass, the fermionic core-halo profiles were successfully applied to other galaxy types from dwarf to larger galaxy types, providing a possible explanation for the nature of the intermediate mass BHs, as well as a possible mechanism for SMBH formation in active galaxies. Moreover, as demonstrated in \citet{2018PDU....21...82A} there exists a particle mass range between $\sim$ 50 and $\sim$ 350 keV where the compacity of the central core can increase (all the way to its critical value of collapse) while maintaining the same DM halo-shape. Therefore, regarding the SPARC RC fitting, as well as all the scaling relations on halos-scales, our conclusions are not biased by the choice of the particle mass in the above range. For the fermionic model we consider solutions which are either in the dilute regime ($\theta_0 \ll -1$, i.e. are King-like), or which have developed a degenerate core (i.e. $\theta_0 > 10$) at the center of such a halo. Fermionic solutions within only these two families have been shown to be thermodynamically and dynamically stable when applied to galaxies \citep{2021MNRAS.502.4227A}. The NFW and the Burkert models are described by two free scaling parameters, e.g. $\vec p = (R_{\rm N},\rho_{\rm N})$. The DC14 model with e.g. $\vec p = (X, R_{\rm N}, \rho_{\rm N})$ and the Einasto model with e.g. $\vec p = (\kappa, R_{\rm N}, \rho_{\rm N})$ are described by three free parameters. Compared to NFW and Burkert, both (Einasto and DC14) have an additional parameter which affects the sharpness of the transition from the inner to the outer halo. In order to find the best-fits we use the LM algorithm (see section \ref{LM-fitting}) with well chosen initial values (i.e. priors) reflecting astrophysical (realistic) scenarios. Because the LM algorithm finds only local minima, we choose the parameter sets randomly within a range and follow a Monte-Carlo approach. For the fermionic \textit{core}-\textit{halo} solutions, we choose $\beta_0 \in [10^{-8},10^{-5}]$, $\theta_0\in [25,45]$ and $W_0\in[40,200]$ which correspond to a conservatively wide range of parameters according to \citet{2019PDU....24..278A}. For the fermionic \textit{diluted} solutions, we cover the same range for $\beta_0$ and $W_0$, but with $\theta_0\equiv\theta_p \in [-40,-20]$. For the other DM models, the initial scaling factors are chosen from $R_{\rm N}\in[10^{1}, 10^{4}]\si{\parsec}$ and $\rho_{\rm N} \in [10^{-4}, 10^{-1}]\si{\Msun\per\parsec^3}$. According to \citet{2017MNRAS.466.1648K} the additional parameter of the DC14 model is chosen from $X\in[-3.75,-1.3]$. For the Einasto model, the exponent is chosen from $\kappa\in[0.1, 10]$. This relatively large window has been chosen in order (i) to account for the broad diversity of rotation curves covered by the SPARC data, and (ii) not to be limited by any fixed value (e.g. as typically obtained by CDM-only simulations) since this is an independent analysis to that of N-body simulations, and may also account for other effects such as baryonic feedback (see also the discussion in next subsection). \subsection{Other DM halo models} \label{sec:model:dc14-nfw} From a phenomenological viewpoint, a DM halo density profile is described by three characteristics: the inner halo, the outer halo and the transition in between. Such density profiles are usually described by the ($\alpha, \beta, \gamma$)-model \citep{1990ApJ...356..359H} \begin{equation} \label{eqn:hernquist} \frac{\rho(r)}{\rho_\mathrm{N}} = \qbracket{\frac{r}{R_\mathrm{N}}}^{-\gamma}\qbracket{1 + \qbracket{\frac{r}{R_\mathrm{N}}}^\alpha}^{-\frac{\beta - \gamma}{\alpha}}, \end{equation} where $\alpha$ describes the transition, $\beta$ the outer slope and $\gamma$ the inner slope. Following Newtonian dynamics --- that is fully sufficient on halo scales --- then the velocity is given by \begin{equation} \label{eqn:circular-velocity} \frac{v^2(r)}{\sigma_\mathrm{N}^2} = \frac{R_{\rm N}}{r}\frac{M(r)}{M_{\rm N}} \end{equation} and the enclosed mass by \begin{equation} \label{eqn:enclosed-mass} \frac{M(r)}{M_{\rm N}} = \int \limits_0^r \qbracket{\frac{r}{R_{\rm N}}}^2 \frac{\rho(r)}{\rho_\mathrm{N}} \frac{\d r}{R_{\rm N}}, \end{equation} For the following DM halo models we will use $R_\mathrm{N}$, $\rho_\mathrm{N}$, $\sigma_\mathrm{N}^2 = G M_\mathrm{N}/R_\mathrm{N}$ and $M_\mathrm{N} = 4\pi \rho_\mathrm{N} R_\mathrm{N}^3$ as scaling factors for length, density, velocity and mass, respectively. In \cref{fig:profile-illustration-mep} we illustrate the typical morphology of common DM halo models used here for the SPARC galaxies. For a better comparison the plots are normalized with respect to the halo located at the velocity maximum on halo scales. Based on the general ($\alpha, \beta, \gamma$)-model, \citet{2014MNRAS.441.2986D} modelled CDM halos including baryonic feedback mechanisms in galaxy formation. They found that the three parameters ($\alpha, \beta, \gamma$) are related through \begin{align} \label{eqn:dc14:alpha} \alpha &= 2.94 - \log_{10}\qbracket{(10^{X + 2.33})^{-1.08} + (10^{X+2.33})^{2.29}},\\ \label{eqn:dc14:beta} \beta &= 4.23 + 1.34 X + 0.26 X^2,\\ \label{eqn:dc14:gamma} \gamma &= -0.06 + \log_{10}\qbracket{(10^{X + 2.56})^{-0.68} + 10^{X+2.56}}, \end{align} where $X = \log_{10}(M_*/M_\mathrm{halo})$ describes the stellar-to-dark matter ratio. For the circular velocity \cref{eqn:circular-velocity} the enclosed mass \cref{eqn:enclosed-mass} is given by a hypergeometric function \begin{equation} \frac{M(r)}{M_\mathrm{N}} = \frac{1}{3-\gamma} \qbracket{\frac{r}{R_\mathrm{N}}}^{3-\gamma} \pFq{2}{1}(p_1,p_2;\,q_1;\,-[r/R_\mathrm{N}]^\alpha), \end{equation} with $p_1 = (3-\gamma)/\alpha$, $p_2 = (\beta-\gamma)/\alpha$ and $q_1 = 1 + (3 - \gamma)/\alpha$. In the following, we refer this model as DC14. Alternatively, for $\alpha = 1$, $\beta = 3$ and $\gamma = 1$ the ($\alpha, \beta, \gamma$)-model reduces to the NFW model \citep{1996ApJ...462..563N,1997ApJ...490..493N} as obtained from early DM-only N-body simulations. This DM model develops cuspy halos of the following type \begin{equation} \frac{\rho(r)}{\rho_\mathrm{N}} = \qbracket{\frac{r}{R_\mathrm{N}}}^{-1}\qbracket{1 + \frac{r}{R_\mathrm{N}}}^{-2}, \end{equation} with the circular velocity \begin{equation} \frac{v^2(r)}{\sigma_\mathrm{N}^2} = \frac{\ln(1 + r/R_\mathrm{N})}{r/R_\mathrm{N}} - \frac{1}{1 + r/R_\mathrm{N}}. \end{equation} In contrast to NFW, \citet{1995ApJ...447L..25B} proposed a DM density profile with a cored halo of the following type \begin{equation} \frac{\rho(r)}{\rho_\mathrm{N}} = \qbracket{1 + \frac{r}{R_\mathrm{N}}}^{-1}\qbracket{1 + \bracket{\frac{r}{R_\mathrm{N}}}^{2}}^{-1}. \end{equation} For the circular velocity \cref{eqn:circular-velocity} the enclosed mass \cref{eqn:enclosed-mass} is given by \begin{multline} \frac{M(r)}{M_{\rm N}} = \frac14 \ln(1 + [r/R_{\rm N}]^2) + \frac12 \ln(1 + r/R_{\rm N})\\ - \frac12 \arctan(r/R_{\rm N}). \end{multline} With $M_0 \approx M(R_N)$ being the mass scale originally interpreted as the core mass of the halo \citep[e.g.][]{2000ApJ...537L...9S} we obtain the relation $M_N = 8 M_0$. Further, the density scale $\rho_N$ describes the central density $\rho_0$ and the length scale $R_{\rm N}$ can be identified with the Burkert radius $r_{\rm B}$ fulfilling the condition $\rho(r_{\rm B}) = \rho_0/4$. Another interesting and successful candidate is the Einasto model \citep{1989A&A...223...89E}, a purely empirical fitting function with no commonly recognized physical basis \citep{2006AJ....132.2685M}. The DM halo density profiles of that model are of the following type, given in a normalized form, \begin{equation} \frac{\rho(r)}{\rho_\mathrm{N}} = \e^{-[r/R_{\rm N}]^{\kappa}}. \end{equation} The exponent $\kappa$ describes the shape of the density profile. The circular velocity and the enclosed mass are given by \cref{eqn:circular-velocity,eqn:enclosed-mass}. This model develops mass distributions with a finite mass $M_{\rm tot}/M_{\rm N} = \Gamma(3/\kappa)/\kappa$ for $r\to\infty$ (see also \citealp{2012A&A...540A..70R}). The typical $\kappa$ values obtained in this work for the SPARC data-set, as well as the comparison with the same values coming from N-body simulations (either with or without baryonic effects), are given in subsections \ref{boundaryC}, \ref{sec:baryonic-effect} and \ref{sec:result:gof}, and Fig. \ref{fig:parameter-distribution:einasto}. \section{Dark matter models} \label{sec:dark-matter-models} Most of the DM halo models in the literature are phenomenological, i.e. motivated by the phenomenology of rotation curves either from observations or from numerical N-body simulations. In contrast, we consider a fermionic DM model based on first physical principles including statistical-mechanics and thermodynamics. \input{content/dark_matter_models.fermionic.tex} \input{content/dark_matter_models.other.tex} \input{content/dark_matter_models.monte_carlo_appraoch.tex} \input{content/dark_matter_models.baryonic_feedback} \subsection[Best-fit analysis]{Diversity of SPARC rotation curves} \label{sec:fermionic-halos:diversity} We show in this section a detailed $\chi^2$ analysis of the RC fits for three selected galaxies, each representing some characteristics of given observational data. We divide the SPARC galaxies in three groups by the inferred DM component as explained next. This analysis is based on the fermionic model where such a grouping seems to be appropriate to select galaxies with valuable predictions about the inner halo. The first group, represented by UGC05986, shows only a single maximum in its DM RC, i.e. a rising trend in the inner halo followed by a clear turning point, as can be seen by the data points in the left plot of \cref{fig:benchmark:total-rotation-curves}. In the same plot for UGC05986 we show the best-fits of the competing DM models as thick curves, i.e. the fermionic (blue), DC14 (yellow) and NFW (red). Regarding the fermionic model, this kind of RC is better fitted by the solutions with a significant escape of particles ($W_p \lesssim 10$), as can be explicitly seen through the $\chi^2$ valleys in top panels of \cref{fig:chi-analysis}. However, due to the lack of information in the inner halo structures there is some uncertainty in the strength of particle escape. The uncertainty is physically better reflected in the core mass $M_c$ which covers about two orders of magnitude (see middle panel of first row in \cref{fig:chi-analysis}). \loadfigure{figure/Chi2Analysis} This result goes totally in line with an analogous phenomenological analysis \citep{2019PDU....24..278A}, developed for typical dwarf, spiral and elliptical galaxies within the RAR model. According to that analysis (done for $mc^2\approx \SI{50}{\kilo\eV}$), the maximal core mass of larger galaxies is limited by the critical configuration where the quantum core becomes unstable and collapses to a BH of mass $M_c^{cr} \approx \SI{2E8}{\Msun}$. Among the cases, which are disfavored, are the ones with very large total DM masses $M_s$ corresponding to isothermal-like halos and implying negligible escape of particles ($W_p \gtrsim 10$). These solutions provide a minimal core mass $M_c$ with a huge uncertainty in the total mass. The second group, represented by DDO161, shows a rising part in the RC towards a maximum without a clear turning point compared to the first group, see central plots in \cref{fig:benchmark:total-rotation-curves}. Fitting those galaxies for different $W_p$ values does not favor solutions with or without escaping particles effects. The variation in the $\chi^2$ value remains rather small, see middle panels of \cref{fig:chi-analysis}. Finally, the third group, represented by NGC6015, shows some oscillations in the RC, mainly in the outer halo, see right plots in \cref{fig:benchmark:total-rotation-curves}. There are various and speculative reasons for the oscillation, e.g., ongoing merging process, deviation from equilibrium, etc. In any case, those galaxies are clearly better fitted by extended isothermal-like halos ($W_p \gtrsim 10$) --- although being far from good --- see bottom panels of \cref{fig:chi-analysis}. Such solutions provide a wide halo maximum followed by a flat RC. In contrast, the non-isothermal solutions with a cutoff provide only a narrow maximum in the halo, followed by a Keplerian decreasing tail. It is worth to recall that different DM models such as the fermionic model, NFW, DC14 and others are not appropriate to fit the oscillations, characterized through multiple maxima in the RC. All solutions with a wide halo are suitable to fit the oscillations well on average, although the best-fits remain rather poor, leaving almost no insight into the physical properties of DM on halo scales for those galaxies. \subsection{DM surface density relation} \label{sec:dark-matter-surface-density} The constant surface density \citep{2009MNRAS.397.1169D} \begin{equation} \label{eqn:Donato} \Sigma_{0D} = \rho_{\rm 0D} r_0 \approx 140_{-50}^{+80} \si{\Msun\per\parsec^2}. \end{equation} is valid for about 14 orders of magnitude in absolute magnitude ($M_B$) where $\rho_0$ is the \textit{central} DM halo density and $r_0$ the one-halo-scale-length --- both of the Burkert model. At $r_0$ the density falls to one-forth of the central density, i.e. $\rho(r_0) = \rho_{\rm 0D}/4$. Note that the \textit{center} in the Burkert model corresponds to the plateau in the fermionic DM model, i.e. $\rho_{\rm 0D} \approx \rho_{\rm p}$ where the plateau density $\rho_{\rm p}$ is defined at the first minimum in the RC. Following the definition of the Burkert radius $r_0$, we identify the one-halo-scale-length $r_B$ of the fermionic model such that $\rho(r_B) = \rho_p/4$. We thus calculate the product $\rho_p r_B$ for each galaxy. The absolute magnitude $M_B$ was taken from the Carnegie-Irvine Galaxy Survey \citep{2011ApJS..197...21H}, providing nine overlapping galaxies with the SPARC sample. These candidates are well in agreement with the DM surface density observations, see \cref{fig:SPARC:Donato}. The shown candidates include isothermal-like (blue outlined points) and non-isothermal (green circles) solutions. For comparison, the results are amended by the MW solution following the fermionic RAR model \citep{2018PDU....21...82A}. \loadfigure{figure/Donato} Although absolute magnitude information is incomplete, all of the predicted DM surface densities are within the range of the $3\sigma$ area as well. This is visualised by a histogram for the full sample (dark grey bars, 120 galaxies) with comparison to the sub-sample (green bars, 44 galaxies) including non-isothermal solutions (i.e. $W_p < 10$). Considering the sub-sample only, we obtain a mean surface density of about $\SI{148.5}{\Msun/\parsec^2}$, fully inside the 1-$\sigma$ uncertainty in \cref{eqn:Donato}. The SDR given by \cref{eqn:Donato} is qualitatively consistent with the scaling relation $M_h \sim r_h^2$ as given by \cref{eqn:rel:Mh-rh}. Due to the different halo profiles of the fermionic model, ranging from polytropes of $n=5/2$ to isothermal (see section \ref{sec:morph}), there is a non-linear relation between the halo radius $r_h$ and the one-halo-scale-length $r_B$. Nevertheless, considering that the halo is nearly homogeneous up to approximately the halo radius $r_h$ (i.e. $M_h \sim \rho_p r_h^3$), and that $r_h \sim r_B$ we obtain $\rho_p r_B \approx \const$. (see also \citealp{2019PDU....24..278A}). \subsection{Morphology of fermionic halos} \label{sec:morph} We are interested in providing approximate analytic (and semi-analytic) expressions for the halo morphology associated with the corresponding fermionic solutions. On halo scales, i.e. for $r \sim r_h$ with $r_h$ being the halo radius, the fermionic DM model resembles the King model \citep{1966AJ.....71...64K}. These DM profiles are characterized by a cored inner halo (i.e. a flat inner slope) followed by a transition towards a finite mass. When applied to galactic halos, such a transition can show different behaviours leading to a rich morphology of density profiles, from polytropic-like to power law-like, mainly depending on the value of $W_p$. Consequently, this cutoff (or particle escape) parameter controls the sharpness of the inner-outer halo transition as well. Very similar characteristics are also produced by the Einasto model, although with a wider spectrum for the sharpness of the transition described by the parameter $\kappa$. In the fermionic model, the sharpness of the transition can be quantified as follows: for $W_p\ll 1$, the fermionic density profiles are polytropes of index $n=5/2$ as clearly shown in \cref{fig:halo-profiles} for bluish solutions (see \citealp{2015PhRvD..92l3527C} for a derivation of the polytropic $n=5/2$ equation and its link with the fermionic solutions, further justifying our results). In contrast, for negligible escape of particles (e.g. $W_p \gtrsim 10$), the fermionic halos become isothermal-like, with $\rho(r) \propto r^{-2}$ down to the virial radius as evidenced through the reddish solutions in the same figure. Finally, for $W_p$ values in between the above limiting cases, the fermionic DM halo profiles start to develop a power-law trend almost matching the Burkert profile for $W_p\approx 7$ (see \cref{fig:halo-profiles}). These results agree with those obtained in Sec. VII of \citet{2015PhRvD..91f3531C} for the classical King model, which correspond to our fermionic model in the dilute regime (see also paragraph below). There it is shown that the Burkert profile gives a good fit of such King distribution for a value of $W_p$ close to the point of marginal thermodynamical stability, the latter given at $W_p^{(c)} = 7.45$. In \citet{2015PhRvD..91f3531C} this marginal solution is labelled through the equivalent parameter $k$. Statistically, we identified $W_p \approx 10$ as a discriminator between two groups and further detailed in Appendix \ref{sec:appendix:parameter-distribution}. Even if the precise value might be biased by the data, there is an interesting underlying physical explanation for it: fermionic DM profiles as obtained from a MEP are thermodynamically and dynamically stable for $W_p \leq 7.45$ if they are in the dilute regime ($\theta_0 \ll -1$ where $W_0 \equiv W_p$), while in the core-halo regime ($\theta_0 > 10$) the same stability conditions hold for a bounded $W_p \in [W_p^{\rm min}, W_p^{\rm max}]$. For typical SPARC galaxies with a halo mass of $\sim \SI{5E10}{\Msun}$, we find $W_p^{\rm max}\sim \num{E-2}$. \loadfigure{figure/HaloProfilesComparison} The point of stability-change for the classical King model was first obtained in \cite{2015PhRvD..91f3531C}, and further re-derived here for fermionic DM profiles but this time for realistic average halo-mass galaxies, as obtained from the SPARC data-set, following the thermodynamic analysis of \cite{2021MNRAS.502.4227A}. That is, typical galaxies with halo masses of about $\sim \SI{5E10}{\Msun}$ and with appreciable escape of particles (i.e. $W_p \ll 1$) are thermodynamically and dynamically stable, suggesting a deep link between thermodynamics of self-gravitating systems and galaxy formation. A case-by-case stability analysis in relation to observed galaxies (e.g. SPARC data-set) is out of the scope of the present paper and will be the subject of a future work. \section{Fermionic halos} \label{sec:fermionic-halos} This section is mainly devoted to fermionic halos where we include the analysis of the DM surface density relation (SDR), originally based on the Burkert model. Further, we highlight the rich morphology of fermionic DM halos and show that particular solutions can be associated with different DM models. As typical examples, we present detailed rotation curve fits and their corresponding analysis for three selected galaxies indicating the limitations of the observational data and/or the case where data supports for one clear maximum in the rotation curve of each DM model. \input{content/fermionic_halos.donato} \input{content/fermionic_halos.morphology} \input{content/fermionic_halos.diversity} \subsection{Data selection} \label{sec:data} The SPARC data-set includes \SI{3.6}{\micro\meter} near-infrared and \SI{21}{\centi\meter} observations. The former traces the stellar mass distribution (bulge and disk) while the latter traces the atomic gas distribution and provides velocity fields from which the RCs are derived. See \citet{2016AJ....152..157L} for a complete description of the SPARC data. The data is distributed in separated files such as \href{http://astroweb.cwru.edu/SPARC/SPARC_Lelli2016c.mrt}{Table1.mrt} (i.e. Hubble type, inclination etc.) and \href{http://astroweb.cwru.edu/SPARC/MassModels_Lelli2016c.mrt}{Table2.mrt} (i.e. RC data) and can be found at \url{http://astroweb.cwru.edu/SPARC/}. We extract the observed circular velocity $V_\mathrm{tot}$ and the baryonic contribution $V_\mathrm{bar}$, composed of a bulge ($V_\mathrm{b}$), disk ($V_\mathrm{d}$) and gas component ($V_\mathrm{g}$). The bulge and disk components are inferred from surface brightness observations for a given mass-to-light ratio. The baryonic component is then given by \begin{equation} \label{eqn:baryonic-sum} V_\mathrm{bar}^2 = \Upsilon_\mathrm{b}^{\phantom{2}} V_\mathrm{b}^2 + \Upsilon_\mathrm{d}^{\phantom{2}} V_\mathrm{d}^2 + V_\mathrm{g}^2. \end{equation} For convenience, the given velocities $V_\mathrm{b}$ and $V_\mathrm{d}$ in the SPARC data are normalized for a mass-to-light ratio of $1\,M_\odot/L_\odot$. In this work we follow the same data selection criteria as done in \citet{2016PhRvL.117t1101M}. We choose averaged mass-to-light ratios $\Upsilon_\mathrm{b} = 0.7$ for all bulges and $\Upsilon_\mathrm{d} = 0.5$ for all disks as convenient average representatives. We exclude all galaxies with a bad quality flag ($Q=3$) and face-on galaxies with an inclination $i < \SI{30}{\ensuremath{^\circ}}$. The latter is to minimize the $\sin(i)$ corrections to the observed velocities. For all measurements we require a minimum precision of \SI{10}{\percent} in velocity. Additionally we reject all points where the baryonic velocity is greater than \SI{95}{\percent} of the observed velocity. This condition is required to avoid negative velocities for the inferred DM components. It affects mainly data points in the inner region which is dominated by baryonic matter and strongly depends on the chosen mass-to-light factors. Therefore, those inner points are less reliable. Finally, we exclude all remaining galaxies with less than 6 data points to be statistically significant. We obtain $120$ galaxies (out of $174$) with $2396$ points (of $3355$) in total. Galaxies not fulfilling the quality criteria have such poor data that they do not allow to gain any insights. In the worst case (e.g. too few points, points on a nearly straight line, etc.) it is not possible to fit the rotation curves. \subsection{Data fitting} \label{LM-fitting} We infer the circular velocity of the DM component directly from observations via \begin{equation} \label{eqn:baryonic-diff} \SYMvdark^2 = V_\mathrm{tot}^2 - V_\mathrm{bar}^2, \end{equation} where the uncertainty in $V_{\rm DM}$ is calculated from the uncertainties in the other velocity components within linear error propagation theory. Note that only the uncertainties in the total RCs ($\Delta V_{\rm tot}$) are provided within the SPARC data-set. The uncertainty is therefore given by \begin{equation}\label{eqn:VDM-error} \Delta V_{\rm DM} = \abs{\diffpart{V_{\rm DM}}{V_{\rm tot}}} \Delta V_{\rm tot}. \end{equation} The inferred DM contribution of each galaxy then will be fitted by the competing DM models which are described in section \ref{sec:dark-matter-models}. With this information, we use the Levenberg–Marquardt (LM) algorithm of least-square error minimization for each dark matter component calculated by \begin{equation} \label{eqn:method:chi-square} \chi^2(\vec p) = \sum \limits_{i=1}^N \qbracket{\frac{V_i - v(r_i,\vec p)}{\Delta V_{i}}}^2. \end{equation} Here, $N$ is the number of data points for a given galaxy, $V_i$ is the set of inferred DM circular velocities from the data at each corresponding measured radius $r_i$, while $v(r_i,\vec p)$ accounts for the circular velocity at $r_i$ for each model parameter vector $\vec p$ (described below), and $\Delta V_{i}$ is the uncertainty in $V_i$ as given in \cref{eqn:VDM-error}. \section{Methodology} \label{sec:fitting} The data used in this work is obtained from the Spitzer Photometry and Accurate Rotation Curves (\href{http://astroweb.cwru.edu/SPARC/}{SPARC}) data-set. It contains independent observations of the total velocity ($V_{\rm tot}$) and luminous mass distributions which allows to infer the bulge ($V_{\rm b}$), disk ($V_{\rm d}$), and gas ($V_{\rm g}$) velocity contributions. We extract the tangential velocities of the DM component from the data (for each galaxy of the sample) by subtracting the inferred baryonic components (as provided in the SPARC data-set) from the total velocity $V_{\rm tot}$, and statistically compare with the corresponding velocities predicted by each DM model as detailed in next. \input{content/fitting.data.tex} \input{content/fitting.method.tex} \section{Introduction} How the total gravitating mass distributes with respect to the luminous mass on galaxy scales is an open question which has regained much attention in the last decade thanks to the vast data-sets covering broader radial extents across different Hubble types \citep{2008AJ....136.2648D,2011MNRAS.413..813C,2016AJ....152..157L}. Several universal relations exist between different pairs of structural galaxy parameters, which refer either \begin{inparaenum}[(i)] \item to the outer regions of galaxies such as the baryonic Tully-Fisher relation (BTFR) \citep{2000ApJ...533L..99M}, the DM Surface Density Relation (SDR) \citep{2009MNRAS.397.1169D}, the Radial Acceleration Relation \citep{2016PhRvL.117t1101M}, and the Mass Discrepancy Acceleration Relation (MDAR) \citep{2004ApJ...609..652M}, which are indeed all closely related \citep{2004ApJ...609..652M,2016arXiv161208857S,2018FoPh...48.1517S}; \item to their central regions such as the $M$-$\sigma$ relation between the bulge's dispersion velocity and the central object mass \citep{2000ApJ...539L...9F}; or \item to a combination of both regimes such as the Ferrarese relation \citep{2002ApJ...578...90F,2011Natur.469..377K,2015ApJ...800..124B} between the total halo mass and its supermassive central object mass. \end{inparaenum} Actual attempts for a unified understanding of many of the above scaling relations are typically given in terms of phenomenological halos obtained from N-body simulations within $\Lambda$CDM (see e.g. \citealp{2017MNRAS.471.1841N,2017PhRvL.118p1103L,2017MNRAS.464.2419S,2018FoPh...48.1517S}). However, when DM halos are formed through a MEP for collisionless systems of self-gravitating fermions \citep{1998MNRAS.300..981C,2015PhRvD..92l3527C,2020EPJP..135..290C,2021MNRAS.502.4227A}, it leaves place to novel theoretical predictions in the phenomenology of real galaxies \citep{2018PDU....21...82A,2019PDU....24..278A,2020A&A...641A..34B,2021MNRAS.505L..64B,2021MNRAS.502.4227A,2022MNRAS.511L..35A} such as: \begin{asparaenum}[(1)] \item DM fermions with a finite-temperature can be in a diluted (Boltzmannian-like) regime or become semi-degenerate. The corresponding DM halos can be, respectively, King-like or may develop a dense and degenerate compact core at the center of such a halo \citep{2015PhRvD..92l3527C,2021MNRAS.502.4227A}. A fully relativistic model in which this more general \textit{core}--\textit{halo} profiles arise, is usually referred in the literature as the Ruffini-Argüelles-Rueda (RAR) model \citep{2015MNRAS.451..622R,2018PDU....21...82A,2019PDU....24..278A,2020A&A...641A..34B,2021MNRAS.505L..64B,2021MNRAS.502.4227A,2022IJMPD..3130002A,2022MNRAS.511L..35A}. In either case, these fermionic DM profiles are cored (i.e. develop an extended plateau on halo scales similar to the Burkert DM profile as shown in \cref{fig:profile-illustration-mep}), thereby not suffering from the core-cusp problem associated with the standard $\Lambda$CDM cosmology \citep{2017ARA&A..55..343B}. This cored feature seems to be a general conclusion reached for any DM profile which has reached a (quasi) thermodynamic equilibrium in cosmology \citep{2021MNRAS.504.2832S}. \item The relevance of the fermionic solutions with a degenerate DM core surrounded by a diluted halo (named from now on as \textit{core}--\textit{halo} profiles) imply different consequences: (a) the core might become so densely packed that above a threshold --- the critical mass --- the quantum pressure can not support it any longer against its own weight, leading to the gravitational core-collapse into a supermassive black hole (SMBH; \citealp{2020EPJB...93..208A,2021MNRAS.502.4227A}). For DM particle masses of $\mathcal{O}(10)$ keV, this result provides, for large enough galaxies, a novel SMBH formation mechanism in the early Universe as proposed in \citet{2021MNRAS.502.4227A}; and (b) for core masses below its critical value, it exist a set of free parameters in the fermionic model, such that the quantum cores correlate with their outer halos \citep{2019PDU....24..278A} explaining the relation between the total mass $M_{\rm tot}$ of large enough galaxies with the (presumably) embedded BH mass $M_{\rm BH}$, i.e. the Ferrarese relation (see point (iii) above). \item For small enough galaxies, as in the case of typical dwarfs, the degenerate core cannot collapse towards a BH (i.e. the total mass of the galaxy is below the critical mass of collapse) and thus it remains in a \textit{core}--\textit{halo} state where the central nucleus still mimics the effects of a singularity --- with core masses in the range of Intermediate mass BHs --- while the outer halo explains the rotation curves (RCs) \citep{2019PDU....24..278A,2021MNRAS.502.4227A,2022IJMPD..3130002A}. \item In the more extreme case where the fermions are fully-degenerate (i.e. when they are treated under the $T \to 0$ approximation), the corresponding halos are polytropic and may be only applicable to dwarfs \citep{2015JCAP...01..002D}. \end{asparaenum} Moreover, it was recently demonstrated that fermionic halos obtained via this MEP mechanism can arise in a cosmological framework, and remain thermodynamically and dynamically stable during the life of the Universe \citep{2021MNRAS.502.4227A}. Indeed, it was there shown the self-consistency of the approach in the sense that the nature and mass of the DM particles involved in the linear matter power spectrum --- calculated in \citet{2021MNRAS.502.4227A} within a CLASS code for $\mathcal{O}(10)$ keV fermions --- are the very same building blocks at the basis of the virialized DM configurations with its inherent effects in the DM profiles. Even if the MEP has been applied in \citet{2021MNRAS.502.4227A} within a warm DM (WDM) cosmology --- and is used here for finite temperature fermions (see \ref{sec:model:rar}) --- this is not univocal in general. Other MEP such as the one used in \citet{2021MNRAS.504.2832S} has been also applied for classical (self-gravitating) particles within cold DM (CDM) cosmologies. Thus, the main purpose of this work is to analyze most of the galaxy relations, as discussed above in (i)-(iii), together with a large set of observed RCs provided by the SPARC data. In a forthcoming work we will reconsider this data-set together with observations coming from the central regions of galaxies (e.g. supermassive BHs), to include the $M_{\rm BH} - M_{\rm tot}$ relation in the study. We assume that DM halos are formed through a MEP in which the fermionic (quantum) nature of the DM particles is dully accounted for. This takes special interest since it is the first time a predictive model of this kind, i.e. based on first physical principles such as (quantum) statistical-mechanics and thermodynamics, is tested against a large set of galaxy observables while leading to a good agreement with observations. To see how well this fermionic model can reproduce the given observables, it will be compared with most of the commonly used DM models used in the literature. Further, we check which set of observed data can (or cannot) discriminate the goodness of the competing models. For this task, we will first focus on the Radial Acceleration Relation --- a non-linear correlation between the radial acceleration caused by the total matter and the one generated by its baryonic component only (see section \ref{sec:result:ac}) --- and on the directly related MDAR. The main motivation to start studying these acceleration relations is due to the intense debate they have generated in the past few years about their underlying physical origin. For instance, \citet{2016PhRvL.117t1101M} argues that the Radial Acceleration Relation can be explained by a fundamental acceleration constant $\mathfrak{a}_0$ in combination with a modification of Newtonian gravity and without the necessity of any DM. One potential explanation for {such a fundamental constant} comes from Modified Newtonian Dynamics (MOND) \citep{2015CaJPh..93..169K,2016arXiv160906642M,2016PhRvL.117t1101M,2018A&A...615A...3L}, which has been used to interpret it as evidence against the $\Lambda$CDM paradigm and in favor to the MOND theory. However, more recent studies dedicated to analyze this universal relation within the (Bayesian) posterior distributions on the acceleration scales of individual galaxies (across a large sample), have provided evidence against the existence of such a fundamental constant and in favour of $\mathfrak{a}_0$ to be an emergent magnitude (see e.g. \citealp{2020MNRAS.494.2875M} and references therein). On the other hand, it has been extensively shown that the Radial Acceleration Relation is consistent with the $\Lambda$CDM paradigm, as found either in hydrodynamical N-body simulations \citep{2016MNRAS.456L.127D,2017MNRAS.471.1841N,2017PhRvL.118p1103L,2019MNRAS.485.1886D}, or from other more phenomenological (independent) study based on Universal Rotation Curves \citep{2018FoPh...48.1517S}. Thus, in the first part of this work we will use the MEP approach for fermions to evaluate how competitive it is to reproduce the above relations with respect to other phenomenological DM halos. The galactic observables are taken from a filtered SPARC sample of $2369$ data points (corresponding to a total of $120$ galaxies) and then apply a non-linear least square statistical analysis in order to check the goodness of fit of: \begin{inparaenum}[(a)] \item the above fermionic DM halos --- either in the \textit{core}--\textit{halo} regime \citep{2019PDU....24..278A,2021MNRAS.502.4227A} or in the purely King-like one \citep{2021MNRAS.502.4227A}; \item a baryonic feedback motivated halo model within $\Lambda$CDM according to \citet{2014MNRAS.441.2986D}, named here as DC14; \item the classical NFW model based on early numerical simulations \citep{1997ApJ...490..493N}; \item the Einasto profile \citep{1989A&A...223...89E,2006AJ....132.2685M}, and \item the Burkert model \citep{1995ApJ...447L..25B}. \end{inparaenum} Outlining the structure of this paper, in section \ref{sec:fitting} we give a brief overview about the SPARC data set, data selection and fitting procedure. In section \ref{sec:dark-matter-models}, we describe the competing DM halo models considered above. In section \ref{sec:results}, we present our results on the Radial Acceleration Relation by performing a goodness of the fit for each DM model based on a filtered SPARC sample. In section \ref{sec:fermionic-halos}, we focus on fermionic halos and compare their morphology with the other DM models. Finally, in section \ref{sec:conclusion}, we give a brief summary and draw the conclusions. We refer to the appendix for further details. In Appendix \ref{sec:parameter-correlations}, we focus on the above mentioned fermionic model and analyze the relation between halo mass and halo radius which is qualitatively consistent with DM-SDR. In Appendix \ref{sec:appendix:parameter-distribution}, we provide model parameter distributions of the competing DM models. \section{Parameter correlations of fermionic halos} \label{sec:parameter-correlations} We analyzed different pairs of structural galaxy parameters, obtained from core-halo best-fit solutions of the fermionic model for a particle mass of $\SI{50}{\kilo\eV}$. Of interest here are values at the halo such as the halo radius $r_h$ and halo mass $M_h = M(r_h)$. The halo radius $r_h$ is defined at the second maximum in the rotation curve $v(r)$. For mass and radius we obtain values located mainly in the intervals $r_h \in [10^3,10^5]\si{\parsec}$ and $M_h \in [10^8,10^{12}] \si{\Msun}$. As shown in \cref{fig:parameter-correlction:core-halo} the halo radius and mass follow a clear relation described by \begin{equation} \label{eqn:rel:Mh-rh} \ln \qbracket{\frac{M_h}{M_\odot}} \approx 2\ln \qbracket{\frac{r_h}{\mathrm{pc}}} + 5.8 \pm 1.7 \end{equation} Interestingly, this relation is independent of particle escape, i.e it holds for solutions with an isothermal-like halo developing a flat tail as well as for polytropic non-isothermal halos implying a large escape of particles. \loadfigure{figure/ParameterCorrelations} \section{Parameter distributions} \label{sec:appendix:parameter-distribution} \loadfigure{figure/ParameterDistribution_MEPP} \loadfigure{figure/ParameterDistribution_DC14} \loadfigure{figure/ParameterDistribution_Einasto} We analysed the distribution of configuration parameters which affect the shape of the DM RC for each DM model. On this basis, we are interested only in fermionic, DC14 and Einasto models, which are the only ones where the halo slopes (usually characterized by $\gamma$) depend on one configuration parameter. Starting with the core-halo solutions, see upper plots in \cref{fig:parameter-distribution:mepp}, we find that the majority of central temperature values falls in the range $\beta_0 \in [\num{E-8}, \num{E-6}]$ corresponding to solutions in which the central DM cores are far from reaching the core-collapse towards a SMBH \citep{2019PDU....24..278A,2021MNRAS.502.4227A}. The distribution of the central degeneracy values looks like a Gaussian with the mean value at about 36, far in the degenerate regime $\theta_0 \gtrsim 10$. The majority is in the range $\theta_0 \in [30, 40]$. A similar distribution pattern is given for $W_0$. However, for core-halo solutions (i.e. $\theta_0 \gtrsim 10$) it is better to look at the plateau cutoff $W_p$ which can be identified with $W_0$ of a corresponding halo-only solution. The plateau of a core-halo solution acts as a connection between the halo and the embedded core. Therefore, every core-halo solution of the fermionic model has a corresponding halo-only solution describing the diluted halo without the embedded, degenerate core. The corresponding values for such halo-only solutions are given at the plateau which resemble the inner halo, see lower plots in \cref{fig:parameter-distribution:mepp}. The plateau temperature shows a very similar distribution due to the tiny temperature changes when in the low temperature regime ($\beta_0 \ll \num{E-4}$) where pressure effects are negligible leading to $\beta_p \approx \beta_0$. The plateau degeneracy distribution looks also similar to the central degeneracy but being mirrored and shifted to the negative (diluted) regime. We find the relation $\theta_p \approx -0.7 \theta_0 - 1.2$. Of great interest is the plateau cutoff $W_p$ which is a proxy for the central cutoff $W_0$ parameter and provides better insights about the halo shape. The plateau cutoff describes the particle escape intensity on halo scales and is defined as $W_p = W(r_p)$ with the plateau radius $r_p$ located at the first minimum in the DM RC. The lower $W_p$ the more truncated is the halo due to evaporation. See also section \ref{sec:morph} for a discussion about the halo morphology and comparison with other DM models. Within the fermionic model we identify two groups in the $W_p$ distribution of core-halo solutions and $W_0$ distribution of halo-only solution, respectively: (1) an isothermal (non-truncated) group with 76 galaxies and (2) a non-isothermal (truncated) group with 44 galaxies. Both groups are divided at about $W_p \approx 10$ (core-halo) and $W_0 \approx 10$ (halo-only), respectively. For the first group the outer halo seems to be isothermal (i.e. characterized by a flat tail and $\rho(r) \propto r^{-2}$ for large enough $r$). However, for those galaxies the exact value of $W_0$ cannot be determined due to insufficient and/or too limited information in the outer halo data, and thus they are not shown in \cref{fig:parameter-distribution:mepp}. In contrast, the second group seems to have a broader data coverage and/or admitting for a cleaner description of the outer RC, allowing for a better constrain of the outer halo of the fermionic DM profiles (i.e. with finite $W_p \lesssim 10$ and consequent non-isothermal halo tails). See \cref{fig:halo-profiles} for a comparison between typical solution of both groups. For halo-only solutions (i.e. $\theta_0 \lesssim -5)$ there is an interesting accumulation of galaxies around the particular value of $W_0 \approx 7.45$, see dashed line in \cref{fig:parameter-distribution:mepp}. This particular value reflects the point of stability change where the diluted solutions become unstable, i.e. for $W_0 \gtrsim 7.45$ \citep{2015PhRvD..91f3531C}, and may indicate physical insights into galaxy formation. Interestingly, for this value of $W_0$ the density profile of the classical King model resembles the Burkert profile (see section \ref{sec:morph}). In the case of the DC14 model the majority of best-fitted $X$ values is in the range $[-5, 0]$ with a peak at the median of $X \approx -2.4$ as indicated by the boxplot in \cref{fig:parameter-distribution:dc14}. The crosses may be outliers. When we calculate the parameters $\alpha$, $\beta$ and $\gamma$ with \cref{eqn:dc14:alpha,eqn:dc14:beta,eqn:dc14:gamma}, there seems to be a grouping in the distribution of $\alpha$ with a separation at $\alpha = 0$, see \cref{fig:parameter-distribution:dc14}. However, \cref{eqn:hernquist} is not defined for $\alpha = 0$. Phenomenologically, $\alpha$ describes the transition from the inner to the outer halo. The larger $\abs{\alpha}$ the more extended is the transition, characterized by a long wide maximum. $\beta$ describes the slope in the outer halo while $\gamma$ describes the slope in the inner halo. For $\gamma = 0$ the DM profiles become cored. The Einasto model has only a single configuration parameter $\kappa$ describing the transition from the cored inner halo to the outer halo. The larger $\kappa$ the less extended is the RC maximum. As shown in \cref{fig:parameter-distribution:einasto} the majority has $\kappa < 1$ that corresponds to a rather extended RC maximum. This distribution represents well the majority of SPARC galaxies showing an extended outer halo trend without a clear maximum in the outer RC. \subsection{Acceleration relations} \label{sec:result:ac} The rotation curve of each component (e.g. bulge, disk, gas) traces its centripetal acceleration $a = v^2/r$, giving access to independent acceleration measurements. The Radial Acceleration Relation compares the radial acceleration due to the total mass ($a_\mathrm{tot}$) with that due to the baryonic mass ($a_\mathrm{bar}$). It is empirically described by \cite{2016PhRvL.117t1101M} \begin{equation} \label{eq:mcgaugh-fit} a_\mathrm{tot} = \frac{a_\mathrm{bar}}{1 - \e^{-\sqrt{a_\mathrm{bar}/{\mathfrak{a}_0}}}}, \end{equation} where $\mathfrak{a}_0$ is the only adjustable parameter. In the low acceleration regime ($a_\mathrm{bar} \ll \mathfrak{a}_0$), where DM dominates, it clearly shows a deviation from a linear correlation (see top panels of \cref{fig:acceleration:grid}). While in the high acceleration regime ($a_\mathrm{bar} \gg \mathfrak{a}_0$), dominated by baryonic matter, the linear relation is recovered. This relation is not limited to disk galaxies but also holds for other galaxy types (e.g. ellipticals, lenticulars, dwarfs spheroidals and even low-surface-brightness galaxies), what makes it a true universal law among morphology classification \citep{2016PhRvL.117t1101M,2017ApJ...836..152L,2019ApJ...873..106D}. For the SPARC galaxies the different accelerations $a_\mathrm{bar} = V_{\rm bar}^2/r$ and $a_\mathrm{tot} = V_{\rm tot}^2/r$ are inferred from the SPARC data. See section \ref{sec:data} for details how the circular velocities and radii are obtained. For the competing DM models $a_\mathrm{bar} = V_{\rm bar}^2/r$ is equally inferred from the SPARC data while $a_\mathrm{tot} = [V_{\rm bar}^2 + v_{\rm DM}(r)^2]/r$ is inferred from the total mass distribution, composed of the observed baryonic component (taken from SPARC data) and the best-fitted circular velocities of the dark matter component $v_{\rm DM}(r)$ for each DM model. See sections \ref{sec:fitting} and \ref{boundaryC} for details how best-fits are obtained. For the SPARC data as well as for each DM model, we applied then a least-square fitting to obtain $\mathfrak{a}_0$. The result obtained here from the SPARC data only (i.e. without assuming any specific DM model) is fully consistent (within errors) with $\mathfrak{a}_0 \approx \SI{1.2E-10}{\metre\per\second^2}$ as obtained originally in \citet{2016PhRvL.117t1101M}, validating our procedure. Each DM model is then characterized by a specific best-fit $\mathfrak{a}_0$. The corresponding curves are plotted as solid lines in \cref{fig:acceleration:grid}. In all cases, we obtain values close to the one obtained in \citet{2016PhRvL.117t1101M}. This allows to conclude that all competing DM models are able to reproduce the Radial Acceleration Relation. Moreover, they reproduce it equally good without a clear statistically preferred model. A closely related relation is the MDAR relation between the baryonic and total mass components, defined by $D = M_{\rm tot}/M_{\rm bar}$ with $M_{\rm bar}$ being the total baryonic mass and $M_{\rm tot}$ the total galaxy mass accounting for baryonic and dark matter. For $a = \diff{\Phi}{r}$ and $\Phi(r)$ being the gravitational potential of a spherically symmetry mass distribution the mass discrepancy can be equivalently written as $D = a_\mathrm{tot}/a_\mathrm{bar}$. The results are illustrated in the bottom panels of \cref{fig:acceleration:grid}. According to some authors, the above two acceleration relations do not imply the need of any new physics and may be explained within the $\Lambda$CDM framework \citep{2016MNRAS.456L.127D,2017MNRAS.466.1648K,2016arXiv161208857S,2018FoPh...48.1517S}. For smaller disk and LSB galaxies (extending the original SPARC sample), \citet{2019ApJ...873..106D} found that \cref{eq:mcgaugh-fit} is a limiting case of a more complex relation with the need of adding one extra galaxy parameter. In addition, based on modern cosmological simulations, \citet{2017ApJ...835L..17K} predict even a redshift dependency of the acceleration parameter $\mathfrak{a}_0$, emphasizing that the correlation is universal only regarding the morphological classification. Additionally to the acceleration relations mentioned above (which account for the entire accelerations distributions among all galaxies and at different radii), the next strategy is to focus on the DM components of each galaxy and gather best-fits of the inferred rotation curves allowing for another (related) quantitative comparison of the DM models. \subsection{Goodness of model} \label{sec:result:gof} The SPARC galaxies show different characteristics in their rotation curve such as a nearly flat curve through the entire galaxy data; a rising trend in the inner halo followed by a single maximum; or multiple extrema in the form of oscillations. See \cref{fig:benchmark:total-rotation-curves} for three typical examples within the SPARC data-set. Some galaxies show just a rising trend implying that the rotation curves are incomplete, likely due to the faintness and/or lack of data for outermost halo stars. Of interest is therefore a quantitative description about the goodness of a DM halo model fitting the entire galaxy sample (120 galaxies). The goodness of a fit for a single galaxy is well described by the $\chi^2$ value, see \cref{eqn:method:chi-square}. When competing models with different number of parameters are compared it is appropriate to consider the reduced $\chi^2$ defined as $\chi_r^2 = \chi^2/d$ with the degree of freedom $d = N-p$, $N$ being the number of observables (for a single galaxy) and $p$ the number of parameters (of the considered model). The question now arises how to compare the competing models for a population of galaxies. In order to find the goodness of a model which is robust against outliers, we ask \textit{how many} fitted galaxies have a (reduced) $\chi^2$ \textit{lower} than a given one. It turns out that the population curve resembling a cumulative distribution function (CDF) follows nearly a log-normal distribution. We use the mean value, labelled as $\hat \chi^2_r$, as the criteria to described the goodness of a model for fitting a population of galaxies within the SPARC data-set. A parameter analysis of the best-fit solutions for each DM halo model is detailed in appendix \ref{sec:appendix:parameter-distribution}. \loadfigure{figure/GoodnessAll} \loadfigure{figure/GoodnessWithCutoff} The goodness analysis for the entire SPARC sample (120 galaxies) is shown in \cref{fig:goodness:all} and can be summarized as: The NFW model ($p=2$) is statistically disfavoured with respect to the other DM halo models; the Einasto model ($p=3$) and the DC14 model ($p=3$), on the other hand, are statistically favoured with similarly good results; the Burkert model ($p=2$) and the fermionic model ($p=3$) produce comparable results but are somewhat statistically less favoured. We recall that the DM models are suited for DM halo rotation curves with only one maximum. Therefore, we restrict further the SPARC sample to galaxies (44) showing one clear maximum in their rotation curve (see also section \ref{sec:fermionic-halos:diversity} for details about the diversity of SPARC galaxies). This conditions is equivalently reflected in the fermionic scenario where data supports for a significant escape of DM particles, that is for energy-cutoff values at plateau of $W_p < 10$ (see appendix \ref{sec:appendix:parameter-distribution} for further details). For that sub-sample the picture changes considerably, see \cref{fig:goodness:with-cutoff}, and can be summarized as: The NFW model is statistically even more disfavoured while all other models (including fermionic DM) become more comparable --- with a little tendency for Einasto and against Burkert. We remind that the DC14 model is based on the analysis of hydro-dynamically simulated galaxies including complex baryonic feedback processes \citep{2014MNRAS.441.2986D}. The good performance of DC14 may indicate the importance of baryonic feedback in galaxy formation. Indeed, our results regarding DC14 are in line with the literature as well since, as can be seen from \cref{fig:parameter-distribution:dc14} (bottom panel), the bulk of our ($\alpha,\beta,\gamma$) parameters for the SPARC data-set lies within the windows (0,2.6); (2.3,4); (0,2) in rough agreement with \citet{2014MNRAS.441.2986D}. Interestingly, we obtain a mean for the stellar to DM mass ratio $X = \log_{10}(M_*/M_\mathrm{halo})$ of $-2.4$, which is within the $X$ values ($-2.5,-2.3$) where DM cusps are most effectively flattened due to baryonic effects as reported in \citet{2014MNRAS.441.2986D}. Besides, our results are in good agreement with those reported in \citet{2013ApJ...770...57B} from abundance matching, since they obtain X values between (-2.7, -1.7) for halo masses in the range between $10^{10} M_\odot$ and $10^{12} M_\odot$, with $X=-2.4$ for $M_h=10^{11} M_\odot$, the latter coinciding with the mean $X$ value in this work. In the case of Einasto profiles, the comparison with the literature is more difficult since the effects of baryonic feedback are not explicitly reported through its free parameters. For example in \cite{2019MNRAS.483.4086B} they obtain, within (zoom-in) hydro-dynamical simulations and for $\sim \SI{E10}{\Msun}$ halos, a reduction on inner-halo densities (i.e. at the convergence radius $r=\SI{0.26}{\kilo\parsec}$) of up to $\SI{45}{\percent}$ in WDM cosmologies with respect to the analogous WDM-only simulations. A reduction which is about $15 \%$ more pronounced than comparing WDM to CDM only simulations \citep{2019MNRAS.483.4086B}. Even if all the resulting DM halos are there fitted with the Einasto profile, these density reductions are only expressed through its concentration parameter (which is a function of the scale radius and the virial radius). They found indeed that Einasto profiles in WDM cosmologies have smaller concentration parameters than the CDM counterparts. This concentration parameter correlates inversely proportional to the Einasto shape parameter (denoted here as $\kappa$) as originally shown through Figs. 13 and 14 in \citet{2014MNRAS.441.3359D}. Thus, considering that $\kappa\approx 0.2$ correspond to CDM-only cosmologies \citep{2014MNRAS.441.3359D,2017MNRAS.471.3547F}, then larger $\kappa$ values are expected for Einasto profiles having flatter inner-halo slopes \citep{2014MNRAS.441.3359D}. Indeed, our results are qualitatively in line with those reported in \cite{2019MNRAS.483.4086B} since we find a mean value of $\kappa \approx 0.4$ (see \cref{fig:parameter-distribution:einasto}), thus implying smaller concentration parameters than for CDM profiles. However more work from hydro-dynamical simulations using Einasto fitting profiles is needed in order to make a proper quantitative comparison with our statistical results. We would like also to point out that many galaxies in the SPARC data set are missing significant information in the outer halo (e.g. due to faint stars) or show a complex behavior (oscillatory-pattern) in their rotation curves (see e.g. right box in \cref{fig:benchmark:total-rotation-curves}). In any case, it does not allow to univocally determine the cutoff parameter (i.e. $W_p$) for the fermionic DM model since any sufficiently large $W_p$ would not change the $\chi^2$ value (see e.g. bottom left panel of \cref{fig:chi-analysis}). Nevertheless, there are some other individual galaxies where the escaping particles effects are clearly preferred. Interestingly, all of those galaxies are of magellanic type: NGC0055 (Sm), UGC05986 (Sm), UGC05750 (Sdm), UGC05005 (Im), F565-V2, (Im), UGC06399 (Sm), UGC10310 (Sm), UGC07559 (Im), UGC07690 (Im), UGC05918 (Im) and UGC05414 (Im). Moreover, many galaxies, which are poorly fitted by any of the considered models, show \textit{short range} oscillations in their rotation curves with more than one maximum. None of the models can provide a clear explanation of that phenomena, found usually in non-magellanic galaxy types: e.g. NGC2403 (Scd), UGC02953 (Sab), NGC6015 (Scd), UGC09133 (Sab), UGC06787 (Sab), UGC11914 (Sab), NGC1003 (Scd), NGC0247 (Sd), UGC08699 (Sab) and UGC03205 (Sab). On phenomenological grounds, in the fermionic DM model it is possible to vary the width of the maximum bump in the RC through the cutoff parameter in the strong or moderate cutoff regime ($W_p \lesssim 10$). Whether with weak ($W_p \gtrsim 10$) or even without cutoff-effects, the RC solutions of the model show long range oscillations, similar to the isothermal model. In any case, these RC oscillations have a too long wavelength and therefore do not offer a convenient explanation. On the other hand, in the case of strong cutoff, we obtain a narrow maximum bump necessary for many RCs, especially for galaxies of magellanic type (see above for examples), which usually do not show those oscillations, but also for some non-magellanic galaxy types, e.g. NGC5585 (Sd), NGC7793 (Sd), UGC06614 (Sa), ESO079-G014 (Sbc), F571-8 (Sc), NGC0891 (Sb), UGC06614 (Sa), UGC09037 (Scd), NGC4217 (Sb), UGC04278 (Sd). NFW and Burkert models cannot explain variations of the inner and outer rotation curve because the parameters ($\beta$ and $\gamma$) responsible for such a behaviour (see \cref{eqn:hernquist}) are fixed. Additionally a transition from the inner to the outer halo is generally characterized by $\alpha$ (or $\kappa$). In contrast to NFW and Burkert, the DC14 and Einasto models have a free parameter which affects the inner/outer rotation curve steepness and the sharpness of the halo transition, simultaneously. Such a flexibility is reflected in generally better $\chi^2$ values. Nevertheless, the goodness for oscillating RCs remains rather poor. \section{Results} \label{sec:results} After an insightful analysis of the parameter distribution of each DM model which best fits the SPARC RCs (given in appendix \ref{sec:appendix:parameter-distribution}), we compare between them following two complementary approaches. First, we consider the entire galaxy sample and extract the radial acceleration information for the total and baryonic components at each galactocentric radii, and put them all together as in \cref{fig:acceleration:grid} (SPARC-window). In this way, we reduce any characteristics of individual galaxies into an overall (\textit{global}) picture, i.e. the Radial Acceleration Relation \citep{2016PhRvL.117t1101M} and Mass Discrepancy Acceleration Relation \citep{2004ApJ...609..652M,2014Galax...2..601M}, respectively. In the second approach, we consider each \textit{individual} galaxy and perform a goodness of DM-model analysis, showing how well the inferred DM RCs are fitted by these models. \input{content/result.accelerationRelation} \input{content/result.goodness}
\section*{}} \usepackage{array} \def\begingroup\textstyle \int\endgroup{\begingroup\textstyle \int\endgroup} \usepackage{cancel,ifthen} \newcommand{\cmnt}[2][NoInPuT]{\ifthenelse{\equal{#1}{NoInPuT}}{}{{\color{red}\sout{#1}}} {\color{blue} #2}} \usepackage{bm} \renewcommand{\vec}[1]{\bm{#1}} \newcommand{\mw}[1]{{\color{blue}{#1}}} \LTcapwidth=\textwidth \begin{document} \normalem \title{Calculating spin-lattice interactions in ferro- and antiferromagnets: the role of symmetry, dimension and frustration} \author{Hannah Lange} \affiliation{Department of Chemistry/Phys. Chemistry, LMU Munich, Butenandtstrasse 11, D-81377 Munich, Germany} \author{Sergiy Mankovsky} \affiliation{Department of Chemistry/Phys. Chemistry, LMU Munich, Butenandtstrasse 11, D-81377 Munich, Germany} \author{Svitlana Polesya} \affiliation{Department of Chemistry/Phys. Chemistry, LMU Munich, Butenandtstrasse 11, D-81377 Munich, Germany} \author{Markus Weißenhofer} \affiliation{Department of Physics, University of Konstanz, DE-78457 Konstanz, Germany} \author{Ulrich Nowak} \affiliation{Department of Physics, University of Konstanz, DE-78457 Konstanz, Germany} \author{Hubert Ebert} \affiliation{Department of Chemistry/Phys. Chemistry, LMU Munich, Butenandtstrasse 11, D-81377 Munich, Germany} \pacs{} \date{\today} \begin{abstract} Recently, the interplay between spin and lattice degrees of freedom has gained a lot of attention due to its importance for various fundamental phenomena as well as for spintronic and magnonic applications. Examples are ultrafast angular momentum transfer between the spin and lattice subsystems during ultrafast demagnetization, frustration driven by structural distortions in transition metal oxides, or in acoustically driven spin-wave resonances. In this work, we provide a systematic analysis of spin-lattice interactions for ferro- and antiferromagnetic materials and focus on the role of lattice symmetries and dimensions, magnetic order, and the relevance of spin-lattice interactions for angular momentum transfer as well as magnetic frustration. For this purpose, we use a recently developed scheme which allows an efficient calculation of spin-lattice interaction tensors from first principles. In addition to that, we provide a more accurate and self consistent scheme to calculate ab initio spin lattice interactions by using embedded clusters which allows to benchmark the performance of the scheme introduced previously. \end{abstract} \maketitle \section{Introduction} The interplay of the magnetic and lattice degrees of freedom is crucial for a number of phenomena observed for magnetic materials. Consequently, the investigation of spin-lattice interactions is of great importance as it gives access to the understanding of a variety of phenomena observed in magnetic materials, as for instance frustration driven structural distortions in different transition metal oxides \cite{KG01, CPA+02, YRH+06} and dichalcogenides \cite{Rasch2009,CRY+11}, or mutual modifications of the magnon and phonon spectra in the magnetically ordered state \cite{POL+16,OLN+16,KPLP19,VDF+20}. Furthermore, recent experimental and theoretical works show that spin-lattice interactions play a crucial role for the angular momentum transfer during ultrafast demagnetization \cite{Dornes, Tauchert2022}. Apart from that, spin-lattice coupling has attracted increasingly attention during last decade in view of its potential exploitation in spintronics and magnonics, seen as a way to control magnetic properties. This can be done for example by means of acoustic wave excitations, or via the application of external mechanical forces. In particular, spin-lattice interactions can be used for the control of the domain wall motion by optically generated magnetoelastic waves \cite{OKB+15}, for spin current generation by surface acoustic waves in ferromagnetic layers via magnon-phonon coupling (inverse Edelstein effect \cite{XPA+18}), or for the control of the spin wave resonance frequency by means of surface acoustic waves \cite{LLSL17}. In this context the need for reliable schemes to investigate spin-lattice interactions as well as their dependence on the material under consideration emerges \cite{Garanin2015, Streib2019, Rueckriegel2020,Mentnik2019}. This field of research is only at its beginning and to our knowledge no systematic investigation of the role of spin-lattice coupling for a series of materials has been done yet. A promising way to gain insight in spin-lattice phenomena are atomistic simulations that model both spin and lattice degrees of freedom \cite{Assmann2019, Ma2008, Perera2016,Strungaru2021}. In order to perform such simulations, besides spin-spin exchange coupling (SSC) tensors also spin-lattice exchange coupling (SLC) tensors are needed as an input. Recent works have provided first schemes to calculate these tensors based on supercell and perturbative SLC approaches \cite{Hellsvik2019, Sadhukhan2022, Mankovsky2022}. In this work, an accurate and efficient method based on embedded cluster calculations is presented and compared to the existing schemes. Furthermore, we calculate the SLC tensors for ferro- and antiferromagnetic materials with different magnetic order, lattice structure and dimensionality using the Korringa-Kohn-Rostoker (KKR) Green function method \cite{KKR} and systematically investigate the symmetry of the SLC tensors w.r.t. the crystal symmetry as well as the physical relevance of SLC to angular momentum transfer and magnetoelastic transitions in frustrated antiferromagnets like metal-dichalcogenides and -oxides. To describe the coupling of spin and spatial degrees of freedom we adopt the atomistic spin-lattice Hamiltonian as proposed by Hellsvik et al. \cite{Hellsvik2019} and Mankovsky et al. \cite{Mankovsky2022}, i.e. \begin{eqnarray} {\mathcal{ H}}_{sl} &=& - \sum_{i,j,\alpha,\beta} J_{ij}^{\alpha \beta}e_i^{\alpha}e_j^{\beta} - \sum_{i,j,\alpha,\beta} \sum_{k,\mu} {\mathcal{ J}}_{ij,k}^{\alpha \beta,\mu} e_i^{\alpha}e_j^{\beta} u^{\mu}_k +\dots\,, \label{eq:Hamilt_extended_magneto-elastic} \end{eqnarray} with the spin-orientation vectors $\vec{e}_i$, atomic displacement vectors $\vec{u}_k$, spin-spin coupling (SSC) tensor elements $J_{ij}^{\alpha \beta}$ and spin-lattice coupling (SLC) tensor elements ${J}_{ij,k}^{\alpha \beta,\mu}=\frac{\partial J_{ij}^{\alpha \beta}}{\partial u_k^{\mu}}$. Eq. \eqref{eq:Hamilt_extended_magneto-elastic} can be extended further to spin-lattice interactions of any order. Note that we focus on magnetic interactions and hence omit pure lattice terms in Eq. \eqref{eq:Hamilt_extended_magneto-elastic} that involve real space force constants.\\ \begin{figure} \centering \includegraphics[width=0.38\textwidth]{Figures/SLC_derivation2.png} \caption{Geometry for the calculation of the spin-lattice exchange coupling using the embedded cluster method (here for $i=k$).} \label{fig:SLC} \end{figure} The so-called Lichtenstein formula \cite{Liechtenstein1987} is a well established approach for ab initio calculations of the isotropic spin-spin coupling parameters, with extensions to account for the full tensorial form of the interaction parameters \cite{Udvardi2003, Ebert2009} and a multi-site expansion \cite{Mankovsky2021}. In contrast, the calculation of spin-lattice interaction parameters has received interest only recently. Refs. \cite{Hellsvik2019, Sadhukhan2022} have suggested to calculate the corresponding spin-lattice exchange coupling parameters from first principles by using supercells and calculating the SLC as the modification of the SSC when displacing an atom in each supercell. This method becomes accurate for sufficiently large supercells but is restricted to a small number of interacting atoms and relatively small supercells due to its high computational costs. Recently, Mankovsky et al. \cite{Mankovsky2022} have derived closed expressions to calculate the spin-lattice coupling tensors in a fully-relativistic way by treating the modifications in spin and lattice configurations on the same, perturbative level. It was shown that this method enables the calculation of fully relativistic SLC tensors which are in satisfying agreement with SLC tensors obtained by the supercell method.\\ The present paper is organized as follows: In the first two sections, we briefly review the spin-lattice coupling methods presented in Ref. \cite{Mankovsky2022}, i.e. the supercell and perturbative method, and compare the results for bcc Fe to a new method based on embedded clusters, which enables a more efficient and accurate calculation of the SLC than the supercell method. Consequently we consider it as a more appropriate method to benchmark the perturbative SLC method presented in Ref. \cite{Mankovsky2022}, enabling a robust way of calculating spin-lattice interactions up to any order of displacements and spin tiltings. Comparing these results for all methods we find good agreement, which allows us to use the perturbative SLC method to systematically investigate spin-lattice coupling. In a first step, we consider the symmetry of the SLC tensors w.r.t. the crystal structure of the considered material and find that the symmetry of the lattice (in combination with spin-orbit coupling) gives rise to specific non-vanishing SLC contributions, e.g. Dzyaloshinskii–Moriya like interactions. In a second step, we calculate the SLC tensors for various materials with different lattice configurations and magnetic structures and consider the role of the dimensionality by calculating the SLC for free standing monolayers and 2D deposited magnetic films. Lastly, we investigate the SLC contribution to magnetoelastic transitions in frustrated antiferromagnets. While the present work is focused on the three-site exchange-like contributions to Eq. \eqref{eq:Hamilt_extended_magneto-elastic}, a complementary work \cite{Mankovsky2022_2} will deal with the anisotropy-like contributions as well as the role of higher order terms. \section{Theoretical background} The field of spin-lattice coupling is still at its beginning. The first ones to calculate \textit{ab initio } spin-lattice interaction parameters for the non-relativistic case were Hellsvik et al.\ \cite{Hellsvik2019}, who suggested to calculate the elements of the corresponding spin-lattice exchange coupling tensor from the modification of the spin-spin exchange coupling $J_{ij}^{\alpha \beta}(\vec{u}_k)$ due to a displacement $u_k^\mu$. Focusing here on the spin-lattice interaction term in the Hamiltonian, $\frac{\partial }{\partial u_k^\mu} J_{ij}^{\alpha \beta}(\vec{u}_k)\, u_k^\mu$, linear with respect to displacement $u_k^\mu$, the corresponding coupling parameters $J_{ij,k}^{\alpha\beta,\mu}$ can be delivered by calculating the derivative of $J_{ij}^{\alpha \beta}(\vec{u}_k)$ numerically as follows \begin{align} J_{ij,k}^{\alpha\beta,\mu} = \frac{\partial }{\partial u_k^\mu} J_{ij}^{\alpha \beta}(\vec{u}_k) \approx \frac{J_{ij}^{\alpha \beta}(u_k^\mu)-J_{ij}^{\alpha \beta}(0)}{u_k^\mu} \label{eq:Cluster_SLC} \end{align} considering the displacement $u_k^\mu$ in the limit of $u_k^\mu \to 0$. As suggested by Hellsvik et al.\ \cite{Hellsvik2019}, the ordinary exchange coupling parameters $ J_{ij}^{\alpha \beta}(\vec{u}_k) $ can be calculated by making use of a scheme introduced by Liechtenstein and coworkers leading to the so-called Liechtenstein or LKAG formula \cite{Liechtenstein1987}. This approach that makes use of the magnetic force theorem implies the evaluation of the free energy change due to a perturbation of the system, which can be written within the multiple-scattering formalism \cite{KKR} as follows \begin{eqnarray} \Delta {\cal F} &=& -\frac{1}{\pi} \mbox{Im\, Tr\,} \int^{E_F}dE\, \left(\mbox{ln}\, \underline{\underline{\tau}}(E) - \mbox{ln}\, \underline{\underline{\tau}}^{0}(E)\right) \; , \label{eq:Free_energy-2} \end{eqnarray} with the scattering path operator of the unperturbed reference system \begin{eqnarray} \underline{\underline{\tau}}^{(0)}(E) &=& \Big[\underline{\underline{m}}^{(0)}(E) - \underline{\underline{G}}(E)\Big]^{-1} \; , \label{eq:tau0} \end{eqnarray} and of the perturbed system \begin{eqnarray} \underline{\underline{\tau}}(E) &=& \Big[\underline{\underline{m}}(E) - \underline{\underline{G}}(E)\Big]^{-1} \; , \label{eq:tau} \end{eqnarray} with $\underline{\underline{G}}(E)$ the structural Green function and $\underline{\underline{m}}^{(0)}(E) = [ \underline{\underline{t}}^{(0)}(E) ]^{-1}$ the inverse of the site-diagonal single-site scattering matrix $\underline{\underline{t}}^{(0)}(E)$, and double underlines indicating matrices with respect to site and spin-angular momentum indices. According to the LKAG scheme, the expression for the exchange coupling parameter $J_{ij}$ is derived accounting for the perturbations due to a spin tilting $\delta \hat{e}_{i(j)}^\alpha$ on sites $i$ and $j$. As this perturbation leads to a corresponding change of the inversed single-site scattering matrix $\Delta^s_{\alpha} \underline{m}_i = \underline{m}_i(\delta \hat{e}_i^\alpha) - \underline{m}^0_i $, the change of the free energy in Eq.\ \eqref{eq:Free_energy-2} can be evaluated using the expression \begin{eqnarray} \mbox{ln} \,\underline{\underline{\tau}} - \mbox{ln} \,\underline{\underline{\tau}}^0 &=& - \ln \Big(1 + \underline{\underline{\tau}}\,[\Delta^s_{\alpha} {\underline{m}}_i + \Delta^s_{\beta} {\underline{m}}_j + ... ] \Big) \; . \label{eq:tau2} \end{eqnarray} With the change of the inversed single-site scattering matrix represented in terms of so-called torque operator $\underline{T}^{\mu}_i$ by the expression \begin{eqnarray} \Delta^s_{\mu} {\underline{m}}_i & = & \delta \hat{e}^\alpha_i\, \underline{T}^{\alpha}_i \,, \label{eq:linear_distor_spin} \end{eqnarray} linear with respect to spin tilting, one obtains a direct access to the exchange coupling parameters determined as the free energy derivative $\frac{\partial^2 {\cal F}}{\partial e^\alpha_i \,\partial e^\beta_j}$\cite{EM09a}: \begin{eqnarray} J_{ij}^{\alpha \beta} &=& -\frac{1}{\pi} \, \Im \, \mathrm{Tr} \,\int dE \, \underline{T}^{\alpha}_i \, \underline{\tau}^{ij}\, \underline{T}^{\beta}_i \, \underline{\tau}^{ji} \; . \label{eq:LKAG} \end{eqnarray} To get access to the full exchange coupling tensor Eq.\ (\ref{eq:LKAG}) has to be evaluated within a fully relativistic framework \cite{Udvardi2003,Ebert2009} with the multiple-scattering representation for the electronic Green function $G(\vec{r},\vec{r}\,',E)$ in real space, given by the expression \cite{EBKM16} \begin{eqnarray} G(\vec{r},\vec{r}\,',E) & = & \sum_{\Lambda_1\Lambda_2} Z^{i}_{\Lambda_1}(\vec{r},E) {\tau}^{i j}_{\Lambda_1\Lambda_2}(E) Z^{j \times}_{\Lambda_2}(\vec{r}\,',E) \nonumber \\ & & - \sum_{\Lambda_1} \Big[ Z^{i}_{\Lambda_1}(\vec{r},E) J^{i \times}_{\Lambda_1}(\vec{r}\,',E) \Theta(r'-r) \nonumber \\ & & \quad J^{i}_{\Lambda_1}(\vec{r},E) Z^{i \times}_{\Lambda_1}(\vec{r}\,',E) \Theta(r-r') \Big] \delta_{ij} \, , \label{Eq_KKR-GF} \end{eqnarray} with the four-component wave functions $Z^{n}_{\Lambda}(\vec r,E)$ ($J^{n}_{\Lambda}(\vec r,E)$) are regular (irregular) solutions to the single-site Dirac equation \cite{MV79,ED11}. The elements of the matrix $\underline{T}^{\mu}_i$ in Eq.\ \eqref{eq:linear_distor_spin} are given by the expression \begin{eqnarray} T^{\alpha}_{i,\Lambda\Lambda'} & = & \int_{\Omega_i} d^3r \, Z^{i \times}_{\Lambda}(\vec{r},E)\, \Big[\beta \sigma_{\alpha} B_{xc}^i(\vec{r})\Big] \, Z^{ i}_{\Lambda'}(\vec{r},E)\,, \label{Eq:ME-T-2} \end{eqnarray} with $B_{xc}^i(\vec{r})$ being the spin-dependent part of the exchange-correlation potential, $\sigma_{\alpha}$ the Pauli matrix and $\beta$ the standard Dirac matrix \cite{Ros61}. \subsection{Super cell approach} As demonstrated by Hellsvik et al.\ \cite{Hellsvik2019} and Mankovsky et al.\ \cite{Mankovsky2022}, Eq.\ (\ref{eq:LKAG}) can be used straightforwardly to calculate the exchange coupling parameter $ J_{ij}^{\alpha \beta}(\vec{u}_k)$ in the presence of an atomic displacement on site $k$. For this the scattering path operator $\underline{\underline{\tau}}(\vec{u}_k)$ is determined selfconsistently for a supercell, big enough to minimize an impact on the exchange coupling tensor $J_{ij}$ of the displacement periodically repeated in the neighboring cells. Note that selfconsistent calculations have a crucial impact on the accuracy of the results, as in this case a relaxation of the charge density around a displaced atom is taken into account. On the other hand, an important disadvantage of supercell calculations is their computational cost in the case of larger cells, or the other way around, they lead to the increasing inaccuracy when the supercell size is too small. \subsection{Embedded cluster approach \label{sec:EC}} The disadvantages of the super cell approach -- high numerical costs and a possible influence of neighboring super cells -- can be avoided by making use of the Dyson equation for the Green function \begin{eqnarray} {\cal G} = {\cal G}_0 + {\cal G}_0 \, \Delta {\cal V} \, {\cal G} \; \label{Dyson-Eq} \end{eqnarray} where ${\cal G}_0$ is the Green function of a suitable reference system, while ${\cal G}$ accounts for the perturbation $ \Delta {\cal V}$. To get access to the exchange parameter $ J_{ij}^{\alpha \beta}(\vec{u}_k)$ between site $i$ and $j$ for site $k$ displaced by $\vec{u}_k$ one considers an atomic cluster centered on site $k$ and big enough to include all sites $i$ and $j$ of interest. In a first step the Green function ${\cal G}$ for this embedded cluster is calculated self-consistently using Eq.\ (\ref{Dyson-Eq}) with $\Delta {\cal V}$ accounting for the displacement of site $k$ and its range given by the size of the embedded cluster. Using the real space representation $G(\vec{r},\vec{r}\,',E)$ of the electronic Green function given by Eq.\ (\ref{Eq_KKR-GF}) allows to replace the Dyson equation (\ref{Dyson-Eq}) by the corresponding equivalent matrix equation for the scattering path operators \cite{KKR}: \begin{equation} \underline{\underline{\tau}}_{k}(E) = [ (\underline{\underline{t}}_{k}(E))^{-1} - (\underline{\underline{t }}_{0}(E))^{-1} - (\underline{\underline{\tau}}_{0}(E)) ^{-1} ]^{-1} \;. \end{equation} Here the second underline indicates matrices w.r.t.\ to the site indices numbering the sites within the cluster. Accordingly, the scattering path operator matrices $\underline{\underline{\tau}}_{0}(E)$ and $\underline{\underline{\tau}}_{k}(E)$ represent the unperturbed system in the regime of the cluster and the embedded cluster with atom $k$ displaced by $\vec u_k$, respectively. Finally, the single site matrices $\underline{\underline{t}}_{0}(E)$ and $\underline{\underline{t}}_{k}(E)$ are site diagonal and represent the cluster atoms in case of the unperturbed system and the embedded cluster, respectively. Having solved the embedding problem charge self-consistently the exchange coupling parameter $ J_{ij}^{\alpha \beta}(\vec{u}_k)$ can be obtained from Eq.\ (\ref{eq:LKAG}) using the corresponding blocks $ \underline{\tau}^{ij}(E)$ and $\underline{\tau}^{ji}(E)$ of the super matrix $\underline{\underline{\tau}}_{k}(E)$. \subsection{Perturbative approach} Mankovsky et al. \cite{Mankovsky2022} suggested a perturbative scheme to get direct acces to the SLC parameter $ J_{ij,k}^{\alpha\beta,\mu}$ without the numerical differentiation indicated by Eq.\ (\ref{eq:Cluster_SLC}) and to avoid this way high numerical effort and any spurious inter-cell effects. The central idea is to extend the scheme underlying the Lichtenstein formula by accounting simultaneously for the impact of a distorted spin configuration $\{\delta \hat{e}_i\}$ and of atomic displacements $\{\vec u_k\}$. As a result, the change in the free energy w.r.t.\ an unperturbed reference state is given in terms of the scattering path operator the expression \begin{eqnarray} \mbox{ln} \,\underline{\underline{\tau}} - \mbox{ln} \,\underline{\underline{\tau}}^0 &=& - \ln \Big(1 + \underline{\underline{\tau}}\,[\Delta^s_{\alpha} {\underline{m}}_i + \Delta^s_{\beta} {\underline{m}}_j + \Delta_{\mu}^u {\underline{m}}_k + ... ] \Big) \; , \end{eqnarray} where $\Delta^u_{\mu} \underline{m}_k = \underline{m}_k(u_k^\mu) - \underline{m}^0_k $ is a change of the inverse single-site scattering matrix due to atomic displacement on site $k$. A linear approximation applied to $\Delta_{\mu}^u \underline{m}_k$ representing it in terms of the so-called displacement operator ${\cal U}_{k}^{\mu}$ \cite{Stefanou87, Papanikolaou97} by the expression \begin{eqnarray} \Delta^{u}_{\mu} \underline{m}_k & = & u^\mu_k \underline{\cal U}_{k}^{\mu} \, \label{eq:linear_distor-disp} \end{eqnarray} allows us to work out explicit expression for the SLC parameters $J^{\alpha\beta,\mu}_{ij,k}$ as \begin{eqnarray} J^{\alpha\beta,\mu}_{ij,k} &= -\frac{\partial^3 {\cal F}}{\partial e^\alpha_i \,\partial e^\beta_j \, \partial u^{\mu}_k} = -\frac{1}{2\pi} \mbox{Im\, Tr\,} \int^{E_F}dE \,\, \nonumber \\ \times & \Big[ \underline{T}^{\alpha}_i \,\underline{\tau}_{ij} \underline{T}^{\beta}_j \, \underline{\tau}_{jk} \underline{\cal U}^{\mu}_k \,\underline{\tau}_{ki} + \underline{T}^{\alpha}_i \,\underline{\tau}_{ik} \underline{\cal U}^{\mu}_k \,\underline{\tau}_{kj} \underline{T}^{\beta}_j \, \underline{\tau}_{ji}\Big] \;. \label{eq:Parametes_linear} \end{eqnarray} The displacement operator in Eq.\ \eqref{eq:linear_distor-disp} is given by the expression\cite{Mankovsky2022} \begin{eqnarray} \underline{\cal U}_{k}^{\mu} & = & \bar{\underline{U}}(\hat{u}^{\,\mu}_k)\,\underline{m}_k+ \underline{m}_k\,\bar{\underline{U}}(-\hat{u}^{\,\mu}_k)\,, \end{eqnarray} where \begin{eqnarray*} \bar{U}_{LL'}(\hat{u}_k)& = & \kappa \frac{4\pi}{3}i^{l+1-l'} \sum_{m=-1}^1 C_{LL'1m} \, Y_{1m}(\hat{u}_k) \end{eqnarray*} and $\kappa = \sqrt{2mE/\hbar^2}$. The prefactor $1/2$ occurs to avoid double counting of the identical terms upon summations in Eq.\eqref{eq:Hamilt_extended_magneto-elastic} over indices $i$ and $j$. In a similar way, higher order terms can be expressed. The Fourier transforms of these parameters give access to the investigations of the impact of spin-lattice interactions on magnon and phonon modes (see Appendix \ref{appendix:FT}). Note however, that the SLC parameters given by Eq. \eqref{eq:Parametes_linear} do not account for the impact of screening of the atomic displacement due to the charge redistribution. To make sure that this contribution can be neglected with a reasonable accuracy of the results, additional calculations discussed in Section \ref{sec:EC} have been performed to calculate the $J_{ij}$ parameters for the distorted lattice. \section{Results for the Embedded Cluster Approach} \begin{figure}[t] \centering \includegraphics[width=0.46\textwidth]{Figures/Fe_xy_SLCvsclusters_J_x_d=0.866_1.pdf} \caption{Comparison of the off-diagonal exchange coupling modification of nearest neighbors for embedded clusters (EC) with 27 atoms $\Delta J_{ij}^{xy}(u_i^x)=J_{ij}^{xy}(u_i^x)-J_{ij}^{xy}(0)$ (dotted lines) and the perturbative approach (PA) $J_{ij,i}^{xy, x}\cdot u_i^x$ (solid lines), for a displacement of atom $i$ in $x$ direction for nearest neighbors $ij$ in bcc Fe. The color code for the atoms $j$ is visualized in the inset figure: Dark red circles denote neighbors with $\vec{r}_{ij}=a(-0.5, -0.5, \pm 0.5)$, light red squares $\vec{r}_{ij}=a(0.5, -0.5, \pm 0.5)$, dark blue diamonds $\vec{r}_{ij}=a(-0.5, 0.5, \pm 0.5)$ and light blue crosses $\vec{r}_{ij}=a(0.5, 0.5, \pm 0.5)$.} \label{fig:ClusterVsSLC_Plot2} \end{figure} In this section the properties of the SLC parameters obtained via the perturbative SLC method of Mankovsky et al. \cite{Mankovsky2022} and via the new method based on embedded cluster (EC) calculations are presented for bcc Fe. As for the supercell method the SLC $J_{ij,k}^{\alpha\beta,\mu}$ are obtained by the modification of the SSC $J_{ij}^{\alpha\beta}$ in the presence of a vanishingly small displacement $u_k^\mu$ \cite{Hellsvik2019} (see Fig. \ref{fig:SLC} and Eq. \eqref{eq:Cluster_SLC}) after a self-consistent (SCF) calculation of the potential for this distorted geometry has been done. As mentioned above the cluster method has the advantage that it is accurate for finite cluster sizes, as long as the cluster is large enough to take into account the relaxation effects. This is already the case for relatively small system sizes, as can be seen in Tab. \ref{tab:SLC_1}, which shows that the results for diagonal and off-diagonal SLC parameters obtained from clusters consisting of $16$ and $51$ atoms are in very good agreement. In contrast, the top of table \ref{tab:SLC_1} shows that this is not the case for supercells consisting of $16$ and $54$ atoms. The supercell approach is in principle only accurate for infinite supercells since for finite sizes not only a single displaced atom is considered, but a periodic displacement for one atom in each supercell. \begin{figure} \centering \includegraphics[width=0.46\textwidth]{Figures/Fe_xx_SLCvsclusters_J_x_d=0.866_1.pdf} \caption{Comparison of the diagonal exchange coupling modification of nearest neighbors for embedded clusters (EC) with 27 atoms $\Delta J_{ij}^{xx}(u_i^x)=J_{ij}^{xx}(u_i^x)-J_{ij}^{xx}(0)$ (dotted lines) and the perturbative approach (PA) $J_{ij,i}^{xx, x}\cdot u_i^x$ (solid lines), for a displacement of atom $i$ in $x$ direction for nearest neighbors $ij$ in bcc Fe. The color code of the atoms $j$ is visualized in the inset figure: Red circles correspond to neighbors with $\vec{r}_{ij}=a(-0.5, \pm(\mp)0.5, \pm 0.5)$ and blue diamonds to $\vec{r}_{ij}=a(0.5, \pm(\mp)0.5, \pm 0.5)$.} \label{fig:ClusterVsSLC_Plot1} \end{figure} Figures \ref{fig:ClusterVsSLC_Plot2} and \ref{fig:ClusterVsSLC_Plot1} as well as table \ref{tab:SLC_1} compare the results for nearest neighbors and $i=k$ obtained from supercell, cluster and perturbative SLC methods. More results for next-nearest neighbors and other SLC components are presented in Appendix \ref{appendix:NNN_EC}. In Fig. \ref{fig:ClusterVsSLC_Plot1} the modification of the cluster SSC occurring in Eq. \eqref{eq:Cluster_SLC}, i.e. $\Delta J_{ij}^{\alpha \beta}(u_k^\mu)=J_{ij}^{\alpha \beta}(u_k^\mu)-J_{ij}^{\alpha \beta}(0)$ is compared to the perturbative SLC result $J_{ij,k}^{\alpha \beta,\mu}\cdot u_k^\mu$ for $\alpha =\beta=\mu=x$. For small displacements, both results are in good agreement. The average value of the diagonal components $J_{ij,i}^{\mathrm{diag-s},x}=\frac{1}{2}\left(J_{ij,i}^{xx,x}+J_{ij,i}^{yy,x} \right)$ is presented in Tab. \ref{tab:SLC_1}. Again, we find a good agreement between cluster and perturbative SLC results: The average absolute value for the large (small) cluster and nearest neighbors is $8.30\pm 0.22\,\mathrm{meV}/\mathrm{a.u.}$ ($8.28\pm 0.22\,\mathrm{meV}/\mathrm{a.u.}$), compared to $9.80\,\mathrm{meV}/\mathrm{a.u.}$ from the perturbative SLC method. The supercell results for the diagonal SLC are smaller with $7.02\pm 0.42\,\mathrm{meV}/\mathrm{a.u.}$ ($6.91\pm 0.23\,\mathrm{meV}/\mathrm{a.u.}$) for large (small) supercells. Similarly, the off-diagonal elements are in good agreement for all methods. The different values for different neighbors $j$ for both diagonal and off-diagonal components result primarily from higher order contributions taken into account by modifications of the electronic structure due to the displacements in clusters and supercells, but not in the perturbative approach. The results for the second neighbor shell are given in the Appendix \ref{appendix:NNN_EC}. One can see a larger discrepancy between the cluster and PA results, that can be associated with the important role of the screening effects in the exchange interactions at bigger distances indicating a long-range charge density redistribution around displaced atom. \\ To conclude, the embedded cluster method enables a very accurate calculation of the SLC parameters that can be used to benchmark the perturbative approach. We have shown that the results for bcc Fe agree well for both approaches. \begin{table} \centering \begin{tabular}{c|cc|cc|c} $J_{ij,i}^{\mathrm{diag},x}$& \multicolumn{2}{c|}{supercells} & \multicolumn{2}{c|}{clusters}& \multicolumn{1}{c}{PA}\\ & $16$ atoms & $54$ atoms &$27$ atoms & $51$ atoms& \\\hline $(-\frac{1}{2}, -\frac{1}{2}, \pm\frac{1}{2})$& 6.432&6.37 &7.80 &7.83 &9.80\\ $(-\frac{1}{2}, \frac{1}{2}, \pm\frac{1}{2})$& 6.432& 6.37& 7.82& 7.84&9.80\\ $(\frac{1}{2}, -\frac{1}{2}, \pm\frac{1}{2})$& -7.397&-7.67 &-8.76 &-8.77 &-9.80\\ $(\frac{1}{2}, \frac{1}{2}, \pm \frac{1}{2})$& -7.397& -7.67& -8.74 &-8.76 &-9.80\\ \end{tabular} \vspace{0.5cm}\\ \begin{tabular}{c|cc|cc|c} $J_{ij,i}^{\mathrm{off},x}$ & \multicolumn{2}{c|}{supercells} & \multicolumn{2}{c|}{clusters}& \multicolumn{1}{c}{PA}\\ & $16$ atoms & $54$ atoms &$27$ atoms & $51$ atoms& \\\hline $(-\frac{1}{2}, -\frac{1}{2}, \pm\frac{1}{2})$& 0.23&0.21 &0.26 &0.25 &0.20\\ $(-\frac{1}{2}, \frac{1}{2}, \pm\frac{1}{2})$& -0.23& -0.21& -0.22&-0.22&-0.20\\ $(\frac{1}{2}, -\frac{1}{2}, \pm \frac{1}{2})$& 0.21&0.19 &0.21 &0.21 &0.20\\ $(\frac{1}{2}, \frac{1}{2}, \pm\frac{1}{2})$& -0.21& -0.19& -0.24 &-0.24 &-0.20\\ \end{tabular} \caption{Average absolute value of the diagonal SLC parameters $J_{ij,i}^{\mathrm{diag},x}=\frac{1}{2}\left(J_{ij,i}^{xx,x}+J_{ij,i}^{yy,x} \right)$ (top) and $J_{ij,i}^{\mathrm{off},x}=\frac{1}{2}\left(J_{ij,i}^{xy,x}+J_{ij,i}^{yx,x} \right)$ (bottom) in meV/a.u. for nearest neighbors, $i=k$ and a displacement in $x$ direction in bcc Fe obtained by the supercell method for supercells with $16$ and $54$ atoms, by the embedded cluster (EC) method for clusters with $27$ and $51$ atoms and for the closed SLC expressions. For the EC calculations $u_i^x = 0.005\,a_{\mathrm{lat}}$ was used. } \label{tab:SLC_1} \end{table} \section{Analysis of Relativistic Spin-Lattice Exchange Coupling Tensors} In this section, we will evaluate the connection of the spin-lattice exchange coupling tensors w.r.t. the crystal symmetry and dipole-dipole contributions based on analytical arguments, before discussing the numerical results in the next section. \subsection{Symmetry of the SLC Parameters} The qualitative features of the SLC parameters are determined by the symmetry of the system under investigation. Accordingly, we start our analysis of the spin-lattice exchange coupling tensors by linking their symmetry to the space group of the considered material. \\ The SLC tensor elements are connected by the relation \begin{align} J_{ij,k}^{\alpha\beta, \mu} = \sum_{\alpha^{\prime}\beta^{\prime}, \mu^{\prime}} J_{i^{\prime}j^{\prime},k^{\prime}}^{\alpha^{\prime}\beta^{\prime},\mu^{\prime}}D(R)_{\alpha^{\prime}\alpha}D(R)_{\beta^{\prime}\beta}D(R)_{\mu^{\prime}\mu} \label{eq:Symmetry_Relation_Jijk} \end{align} for unitary and antiunitary symmetry transformations of the crystal, $u=\{R,\vec{p}\}$ and $a=T\{R,\vec{p}\}$ respectively, with $R$ denoting a rotation operation, $\vec{p}$ a primitive translation operation, $T$ the time inversion operation and $\underline{D}(R)$ the $3\times3$ matrix representation of $R$. The original and transformed site positions $\vec{r}_i$ and $\vec{r}_{i^{\prime}}$ are related by $\vec{r}_{i^{\prime}}=R\vec{r}_i + \vec{p}$. Eq. \eqref{eq:Symmetry_Relation_Jijk} can explain many of the SLC properties observed in the previous section. As an example, we focus on next-nearest neighbors in bcc Fe, with the SLC presented in Appendix \ref{appendix:NNN_EC} since they lie in $x,\,y,\,z$ directions in space and not in the diagonal directions like the nearest neighbors. For example, for $R$ being a 4-fold rotation around the $z$ axis the matrix representation is given by \begin{align*} \underline{D}(R) = \begin{pmatrix} 0 & -1 & 0\\ 1 & 0 & 0\\ 0 & 0 & 1 \end{pmatrix}. \end{align*} Eq. \eqref{eq:Symmetry_Relation_Jijk} yields for $r_{ij}=(1,0,0)^T$ and $i=k$ \begin{align*} J_{ij,k}^{xy,x} = J_{i^{\prime}j^{\prime},k^{\prime}}^{yx,y}\cdot 1\cdot (-1)\cdot 1 = -J_{i^{\prime}j^{\prime},k^{\prime}}^{yx,y} \end{align*} with $r_{i^{\prime}j^{\prime}}=(0,1,0)^T$. A similar argument holds for $J_{ij,k}^{yx,x}$ and $J_{ij,k}^{yx,y}$, as well as for the off-diagonal components $J_{ij,i}^{\mathrm{off},x}$ and $J_{ij,i}^{\mathrm{off},y}$. This is in agreement with table \ref{tab:SLC_4}. Furthermore, the relation can explain vanishing components in tables \ref{tab:SLC_4} in Appendix \ref{appendix:NNN_EC}, e.g. for $r_{ij}=(1,0,0)^T$ and $i=k$, for which a 2-fold rotation around the $z$ axis yields $J_{ij,k}^{xx,z}=J_{i^{\prime}j^{\prime},k^{\prime}}^{xx,z}$, but an inversion implies $J_{ij,k}^{xx,z}=-J_{i^{\prime}j^{\prime},k^{\prime}}^{xx,z}$ for $r_{i^{\prime}j^{\prime}}=(-1,0,0)^T$. Consequently, $J_{ij,k}^{xx,z}=J_{i^{\prime}j^{\prime},k^{\prime}}^{xx,z}=0$. In the following, we proof the symmetry relation \eqref{eq:Symmetry_Relation_Jijk}, starting with the expression for the SLC tensor as given in \eqref{eq:Parametes_linear}: \begin{align} J_{ij,k}^{\alpha\beta, \mu} = \frac{1}{2\pi}\mathrm{Im}\,\int^{E_\mathrm{F}}\mathrm{d}E\big[j_{ijk}^{\alpha\beta\mu,1}+j_{ijk}^{\alpha\beta\mu,2}\big] \end{align} with \begin{align} j_{ijk}^{\alpha\beta\mu,1}=\mathrm{Tr}\,\mathcal{T}_i^{\alpha}\tau_{ij}\mathcal{T}_j^{\beta}\tau_{jk}\mathcal{U}_k^{\mu}\tau_{ki} \end{align} and \begin{align} j_{ijk}^{\alpha\beta\mu,2}=\mathrm{Tr}\,\mathcal{T}_i^{\alpha}\tau_{ik}\mathcal{U}_k^{\mu}\tau_{kj}\mathcal{T}_j^{\beta}\tau_{ji}. \label{eq:jijk_1&2} \end{align} For an arbitary (unitary or antiunitary) symmetry operation $s$ the first part becomes \begin{align*} j_{ijk}^{\alpha\beta\mu,1}=\mathrm{Tr}\,\mathcal{\tilde{T}}_i^{\alpha}\tilde{\tau}_{ij}\mathcal{\tilde{T}}_j^{\beta}\tilde{\tau}_{jk}\mathcal{\tilde{U}}_k^{\mu}\tilde{\tau}_{ki} \end{align*} with $\tilde{\mathcal{O}}_i^{\alpha}=s \mathcal{O}_i^{\alpha}s^{-1}$. The scattering path operators $\tau$, torque operators $\mathcal{T}$ and displacement operators $\mathcal{U}$ behave under the different types of symmetry operations as follows: For an unitary symmetry operation $u$ that transforms site $i(j)$ to $i^{\prime}(j^{\prime})$ the scattering path operator $\tau$ transformations as $u\tau_{ij}u^{-1}=\tau_{i^{\prime}j^{\prime}}$ while for an antiunitary symmetry one has \cite{Huhne2002} $a\tau_{ij}a^{-1}=\tau_{j^{\prime}i^{\prime}}^{\dagger}$. As pointed out in Ref. \cite{Seemann2015}, an arbitrary pseudovector transforms under a symmetry operation $s=\{R,\vec{p}\}$ or $s=T\{R,\vec{p}\}$ as \begin{align*} s \vec{v}(\vec{r}) = \pm \mathrm{det}\left(\underline{D}(R) \right)\underline{D}(R)\vec{v}(s^{-1}\vec{r}) \end{align*} while a vector transforms like \begin{align*} s \vec{v}(\vec{r}) = \pm \underline{D}(R)\vec{v}(s^{-1}\vec{r})\,. \end{align*} In these expressions the sign $\pm$ is determined by the behavior of $\vec{v}$ under time reversal: the positive sign applies for (polar) vectors and the negative sign for (axial) pseudovectors \cite{Seemann2015}. As the torque operator $\mathcal{\tilde{T}}$ behaves as a pseudovector the sign $\pm$ and $\mathrm{det}\left(\underline{D}(R) \right)=\pm 1$ from the first expression occur twice in Eq. \eqref{eq:jijk_1&2}, and hence cancel each other. Consequently, one finds \begin{align} \mathcal{\tilde{T}}_i^{\alpha}\dots \mathcal{\tilde{T}}_j^{\beta}=\sum_{\alpha^{\prime}\beta^{\prime}}\mathcal{T}_{i^{\prime}}^{\alpha}\dots\mathcal{T}_{j^{\prime}}^{\beta}D(R)_{\alpha^{\prime}\alpha}D(R)_{\beta^{\prime}\beta}. \end{align} For the displacement operator, which is not affected by time reversal, we have a positive sign and hence \begin{align} \mathcal{\tilde{U}}_k^{\mu}=\sum_{\mu^{\prime}}\mathcal{U}_{k^{\prime}}^{\mu^{\prime}}D(R)_{\mu^{\prime}\mu}. \end{align} For unitary operations this yields \begin{align*} j_{ijk}^{\alpha\beta\mu,1}= \sum_{\alpha^{\prime}\beta^{\prime}, \mu^{\prime}} j_{i^{\prime}j^{\prime}k^{\prime}}^{\alpha^{\prime}\beta^{\prime}\mu^{\prime},1}D(R)_{\alpha^{\prime}\alpha}D(R)_{\beta^{\prime}\beta}D(R)_{\mu^{\prime}\mu}. \end{align*} For antiunitary operations we find \begin{align*} j_{ijk}^{\alpha\beta\mu,1} = \sum_{\alpha^{\prime}\beta^{\prime}, \mu^{\prime}} j_{i^{\prime}j^{\prime}k^{\prime}}^{\alpha^{\prime}\beta^{\prime}\mu^{\prime},2}D(R)_{\alpha^{\prime}\alpha}D(R)_{\beta^{\prime}\beta}D(R)_{\mu^{\prime}\mu} \end{align*} and \begin{align*} j_{ijk}^{\alpha\beta\mu,2}= \sum_{\alpha^{\prime}\beta^{\prime}, \mu^{\prime}} j_{i^{\prime}j^{\prime}k^{\prime}}^{\alpha^{\prime}\beta^{\prime}\mu^{\prime},1}D(R)_{\alpha^{\prime}\alpha}D(R)_{\beta^{\prime}\beta}D(R)_{\mu^{\prime}\mu}\,. \end{align*} Hence, the same relation for unitary as well as antiunitary symmetry operations holds. \subsection{Dipole-Dipole Contribution to SLC} \begin{table} \centering \begin{tabular}{c|c|cccc} & & Fe ($r_{ij}=0.87$) &Fe ($r_{ij}=1$) & MnGe &Au on Fe \\\hline \multirow{8}{*}{SSC} & $J_{ij}^{\mathrm{diag-s}}$&18.051& 10.090& 18.187&21.414\\ &$J_{ij}^{\mathrm{diag-a}}$&0.0&0.015&0.009&0.0091\\ &$J_{ij}^{\mathrm{off-s},x}$&0.013&0.0&0.012&0.079\\ &$\vert \vec{D}_{ij}^{x}\vert$& 0.0&0.0&0.151&0.272\\\cline{2-6} &$J_{ij,\mathrm{dip}}^{\mathrm{diag-s}}$&0.0&0.013&0.004&0.006\\ & $J_{ij,\mathrm{dip}}^{\mathrm{diag-a}}$&0.00&0.039&0.006&0.008\\ &$J_{ij,\mathrm{dip}}^{\mathrm{off-s},x}$& 0.040&0.0&0.008&0.015 \\ &$\vert \vec{D}_{ij,\mathrm{dip}}^{x}\vert$&0.0&0.0&0.0&0.0\\\hline \multirow{8}{*}{SLC} & $J_{ij,i}^{\mathrm{diag-s}}$&9.792& 1.858& 9.792&7.693\\ &$J_{ij,i}^{\mathrm{diag-a}}$&0.012&0.010&0.010&0.020\\ &$J_{ij,i}^{\mathrm{off-s},x}$&0.019&0.007&0.009&0.013\\ &$\vert \vec{D}_{ij}^{x}\vert$& 0.197&0.380&0.618&2.941\\\cline{2-6} &$J_{ij,i,\mathrm{dip}}^{\mathrm{diag-s}}$&0.023&0.034&0.007&0.011\\ & $J_{ij,i,\mathrm{dip}}^{\mathrm{diag-a}}$&0.070&0.102&0.015&0.033\\ &$J_{ij,i,\mathrm{dip}}^{\mathrm{off-s},x}$& 0.046&0.068&0.013&0.005 \\ &$\vert \vec{D}_{ij,i,\mathrm{dip}}^{x}\vert$&0.0&0.0&0.0&0.0\\\hline \end{tabular} \caption{Maximal dipole-dipole contributions for SSC (top) and SLC (bottom) exchange couplings of different materials: bulk Fe, MnGe for Mn atoms at sites $i$ and $j$ ($r_{ij}=0.61$) and three layers of gold on iron (Au on Fe) for Fe atoms at sites $i$ and $j$ ($r_{ij}=0.71$). For the dipole-dipole interactions we use for the anti-symmetric off-diagonal elements the same notation as for DMI-like parameters, i.e. $\vec{D}_{ij(i),\mathrm{dip}}$. From Eq. \eqref{eq:H_dip1} it directly follows that the anti-symmetric off-diagonal elements of both tensors (and hence the DMI and SLC-DMI) vanish for all materials.} \label{tab:J_iji_dip} \end{table} In order to have a complete picture of the spin-lattice interactions in magnetic materials the contribution to the SSC and SLC tensors from the dipole-dipole interaction is considered. Although the dipole-dipole interaction is treated on a classical level, represented by the Hamiltonian \begin{align} H_{\mathrm{dip}}&=-\frac{\mu_0}{4\pi \vert \vec{r}_{ij} \vert^3 } \left[3\,(\vec{m}_i\cdot \hat{\vec{r}}_{ij})(\vec{m}_j\cdot \hat{\vec{r}}_{ij}) - \vec{m}_i \cdot \vec{m}_j\right], \label{eq:H_dip1} \end{align} for two magnetic moments $\vec{m}_i$ and $\vec{m}_j$ at sites $i$ and $j$ separated by a distance vector $\vec{r}_{ij}$, its contribution arises from the (quantum-electro-dynamical) Breit interaction \cite{Breit1932}. Consequently, it can be considered as a consistent addition to the exchange coupling tensors presented in the previous sections. For a ferromagnetic reference system with $\vec{m}_i\parallel \vec{e}_z$ the SSC contribution is given by \begin{align*} J_{ij, \mathrm{dip}}^{xx}&=-\frac{\mu_0}{4\pi \vert \vec{r}_{ij} \vert^3 }m_i^{z,0} m_j^{z,0} \big[3\, (\hat{r}_{ij}^x)^2 -1 \big]\\ J_{ij, \mathrm{dip}}^{yy}&=-\frac{\mu_0}{4\pi \vert \vec{r}_{ij} \vert^3 }m_i^{z,0} m_j^{z,0} \big[3\, (\hat{r}_{ij}^y)^2 -1 \big]\\ J_{ij, \mathrm{dip}}^{xy}&=J_{ij, \mathrm{dip}}^{yx} = -\frac{\mu_0}{4\pi \vert \vec{r}_{ij} \vert^3 }m_i^{z,0} m_j^{z,0} \, 3\, \hat{r}_{ij}^x\hat{r}_{ij}^y \end{align*} and the SLC contribution, here for a displacement in $\mu=x$ direction, is \begin{align*} J_{ij,i,\mathrm{dip}}^{xxx}&=-\frac{3\mu_0}{4\pi }m_i^{z,0} m_j^{z,0} \frac{3r_{ij}^x((r_{ij}^y)^2+(r_{ij}^z)^2)-2(r_{ij}^x)^3}{\vert r_{ij}\vert ^7}\\ J_{ij,i,\mathrm{dip}}^{yyx}&=-\frac{3\mu_0}{4\pi }m_i^{z,0} m_j^{z,0} \frac{r_{ij}^x\left((r_{ij}^x)^2-4(r_{ij}^y)^2+(r_{ij}^z)^2\right)}{\vert r_{ij}\vert ^7}\\ J_{ij,i,\mathrm{dip}}^{xyx}&=J_{ij,i,\mathrm{dip}}^{yxx}\\ &=\frac{3\mu_0}{4\pi }m_i^{z,0} m_j^{z,0} \frac{r_{ij}^y\left( 4(r_{ij}^x)^2- (r_{ij}^y)^2-(r_{ij}^z)^2\right)}{\vert r_{ij}\vert ^7}. \end{align*} The dipole-dipole contribution is normally considered to be very small and negligible. Exemplary values are shown in Tab. \ref{tab:J_iji_dip}. It can be seen that the dipole-dipole contribution is even larger than the values obtained from the perturbative method for some SSC as well as SLC components for some of the materials considered.\\ To conclude, we have shown that dipole-dipole interactions can make -- depending on the material under consideration -- a significant contribution to the SLC parameters. This is particularly interesting for the simulation of these materials, e.g. via combined spin-lattice molecular dynamics (MD) simulations: When modeling the combined spin and lattice dynamics, the largest SLC contributions should be taken into account preferentially. Our results show that one has to carefully consider the various contributions for each material. In particular, we have shown that for some materials the dipole-dipole interaction may even play a leading role, as it has already been assumed in spin-lattice MD simulations, e.g. by Aßmann et al. \cite{Assmann2019} or Strungaru et al. \cite{Strungaru2021}. \section{Numerical Results} \subsection{SLC Tensors for collinear ferro- and antiferromagnets} Here, we will analyze the SLC parameters systematically for various materials with different magnetic structures, investigate the role of spin-orbit coupling, and compare the SLC contributions for bulk geometries and free standing monolayers as well as different substrate materials for deposited magnetic films. Furthermore, we will shine light on the role of different elements on the strength of spin-lattice interactions. Finally, we show that the resulting SLC contributions can be connected to modifications of the phonon dispersion due to spin-lattice coupling as proposed by Ref. \cite{Mankovsky2022}. If not stated differently calculations are performed using LDA-DFT with a k-mesh of $2000$ points and $l_{\mathrm{max}}=3$. \subsubsection{Dependence on Magnetic Structure: FePt vs. CrPt} \begin{figure}[t] \centering \hspace{-0.2cm} \includegraphics[width=0.46\textwidth]{Figures/FePt_CrPt_SSC.pdf} \caption{SSC contributions in FePt (circles) and CrPt (diamonds) for atoms $i$ and $j$ being Fe / Cr atoms, compared to the values for bcc Fe (crosses). FePt is ferromagnetic and hence the isotropic part $J_{ij}^{\mathrm{diag-s}}=\frac{1}{2}\left( J_{ij}^{xx}+J_{ij}^{zz}\right)$ is positive. FePt is anisotropic in $z$ directon, i.e. the diagonal anti-symmetric part $J_{ij}^{\mathrm{diag-a}}=\frac{1}{2}\left( J_{ij}^{xx}-J_{ij}^{zz}\right)$ is relatively large. The off-diagonal symmetric part is given by $J_{ij}^{\mathrm{off-s}}=\frac{1}{2}\left( J_{ij}^{xy}+J_{ij}^{yx}\right)$.} \label{fig:FePt_CrPt_SSC} \end{figure} \begin{figure}[b] \centering \begin{minipage}[t]{0.48\textwidth} \includegraphics[width=1\textwidth]{Figures/FePt_CrPt_SLC_xdisplacement.pdf} \end{minipage} \caption{Maximal SLC contributions for each distance $r_{ij}$ in FePt (empty circles) and CrPt (filled diamonds) for atoms $i$ and $j$ being Fe / Cr atoms, compared to the values for bcc Fe presented in Ref. \cite{Mankovsky2020} (crosses). FePt as well as CrPt has a large anisotropy in $z$ direction, i.e. the anti-symmetric part of the diagonal components $J_{ij,k}^{\mathrm{diag-a},\mu}=\frac{1}{2}\left(J_{ij,k}^{xx,\mu}-J_{ij,k}^{zz,\mu} \right)$ is relatively large.} \label{fig:FePt_vs_CrPt_SLC} \end{figure} FePt and CrPt have a very similar lattice structure, both being ordered in the $L1_0$ phase. The lattice constants are $a^{\mathrm{FePt}}_{\mathrm{lat}}=2.72$ \AA \mbox{} and $a^{\mathrm{CrPt}}_{\mathrm{lat}}=2.67$ \AA. However, the magnetic properties of both materials are very different. This can be observed in Fig. \ref{fig:FePt_CrPt_SSC}: Whereas FePt is ferromagnetic with strong FM nearest neighbor Fe-Fe interactions, with $J_{ij}^{\mathrm{diag-s}}=8.5\,\mathrm{meV}$ for in-plane neighbors, CrPt is strongly antiferromagnetic with negative nearest Cr neighbor coupling $J_{ij}^{\mathrm{diag-s}}=-4.4\,\mathrm{meV}$ for in-plane neighbors \cite{Schmidt2020}. The induced magnetic moment of Pt is rather small and hence also the respective SSC with Pt at sites $i$ or $j$ are small \cite{Mryasov2005}. Both materials are anisotropic in $z$ direction with a diagonal anti-symmetric part up to $\vert J_{ij}^{\mathrm{diag-a}}\vert=\frac{1}{2}\vert J_{ij}^{xx}-J_{ij}^{zz}\vert=0.32\,\mathrm{meV}$ in FePt and $\vert J_{ij}^{\mathrm{diag-a}}\vert =0.026\,\mathrm{meV}$ in CrPt for out-of-plane neighbors, which is relatively large compared to the DMI and symmetric off-diagonal contributions. \begin{figure} \centering \begin{minipage}{0.3\textwidth} \includegraphics[width=1\textwidth]{Figures/FePt_DMIijk_SOC.pdf} \end{minipage} \hspace{-1em}\vspace*{-5em} \begin{minipage}{0.18\textwidth} \includegraphics[width=1\textwidth]{Figures/FePt_sites.png} \end{minipage} \vspace{5em} \caption{Dependence of SLC-DMI $D_{ij,k}^{z,\mu=x}$ in FePt for all nearest neighbors on the strength of SOC, scaled at the Fe (left) or Pt (right) sites, for iron atoms at sites $i$ and $j$. The displaced atom is a Pt atom with $r_{ik}=(0.5, 0.5, 0.5)\,a_{\mathrm{lat}}$. } \label{fig:FePt_SOC} \end{figure} In Fig. \ref{fig:FePt_vs_CrPt_SLC} the SLC parameters for FePt and CrPt are presented. In the case of FePt the isotropic SLC part decays exponentially, starting from $\vert J_{ij,j}^{\mathrm{diag-s},x}\vert=\frac{1}{3}\vert J_{ij,j}^{xx}+J_{ij,jls}^{zz}\vert=12.8\,\mathrm{meV/a.u.}$ for neighboring Fe atoms. The same behavior is observed for CrPt with slightly smaller isotropic parts up to $\vert J_{ij,j}^{\mathrm{diag-s},x}\vert =8.6\,\mathrm{meV/a.u.}$ for neighboring Cr atoms. Note that $J_{ij,j}^{\mathrm{diag-s},x}$ can be positive and negative for ferromagnetic as well as antiferromagnetic materials, depending on the position of atom $j$ w.r.t. the displaced atom $i$. The second-largest SLC contributions are the on-site anti-symmetric diagonal parts and the DMI contribution (both around $4\,\%$ of the isotropic part) for nearest Fe sites in FePt and the DMI contribution (around $0.6\,\%$ of the isotropic part) in CrPt for nearest Cr neighbors. However, there is a relatively large SLC-DMI contribution for neighbors with $r_{ij}=(0, 1.0, 1.4)\,a_{\mathrm{lat}}$, e.g. with $\vert \vec{D}_{ij,j}^{x}\vert = \frac{1}{2}\vert J_{ij,j}^{yz}-J_{ij,j}^{zy}\vert = 0.58\,\mathrm{meV/a.u.}$ ($\vert \vec{D}_{ij,j}^{x}\vert = 0.28\,\mathrm{meV/a.u.}$) compared to $\vert J_{ij,j}^{\mathrm{diag-s},x}\vert = 0\,\mathrm{meV/a.u.}$ for the same neighbors or $\vert J_{ij,j}^{\mathrm{diag-s},x}\vert = 0.65\,\mathrm{meV/a.u.}$ ($\vert J_{ij,j}^{\mathrm{diag-s},x}\vert = 0.29\,\mathrm{meV/a.u.}$) for other neighbors with the same distance from atom $i$ for FePt (CrPt). Compared to Fe, the SLC-DMI values are in the same order of magnitude, whereas the anisotropic parts of bcc Fe $J_{ij}^{\mathrm{diag-a}}$ and $J_{ij,j}^{\mathrm{diag-a}}$ are much smaller. Note that here we consider the asymmetry of the diagonal parameters between $x$ and $z$ directions, instead of $x$ and $y$ considered in Ref. \cite{Mankovsky2022}. Hence, it seems that a material with strong magnetic anisotropy (i.e. large $J_{ij}^{\mathrm{diag-a}}$) has an anti-symmetric diagonal part which is more affected by the displacement than for materials with small anisotropy parts.\\ Since the SPRKKR program \cite{SPRKKR} used for the present investigations allows to scale the strength of the relativistic spin-orbit correction, it is possible to investigate the role of the SOC on the atoms which mediate the SLC interaction. This is shown in Fig. \ref{fig:FePt_SOC}. It presents the effect of the SOC on the SLC for nearest Fe neighbors (left) and on pairs of Fe atoms $i$ and $j$ up to $r_{ij}\leq 2\,\,a_{\mathrm{lat}}$ for a lattice distortion at a Pt site $k$ with $r_{ik}=(0.50, 0.50, 1.41)\,a_{\mathrm{lat}}$ (right). It can be seen that the SLC-DMI exhibits only a weak dependence on the strength of the SOC at the Fe sites, but a strong dependence on the SOC of the Pt atoms: The $z$-component of the SLC-DMI decreases by almost one order of magnitude when the SOC on the mediating Pt atom is scaled to zero. This indicates that the mediating atoms play a key role for the influence of the spin-lattice coupling. \subsubsection{Dependence on Dimensionality: Bulk Iron, Free Standing Iron Monolayer and Substrates} \begin{table} \centering \begin{tabular}{c|c|c|c|c} SSC &bulk Fe& Fe(001)&Fe(111)&Fe on Ir \\\hline $J_{ij}^{\mathrm{diag-s}}$ &11.39 &25.29&24.02&7.35 \\ $J_{ij}^{\mathrm{diag-a}}$ &0.00 &0.05&0.03&0.07 \\ $J_{ij}^{\mathrm{off-s}}$ & 0.01&0.00&0.03&0.08 \\ $D_{ij}^z$ &0.00 &0.00&0.00&1.84 \\ \end{tabular} \caption{Maximal absolute SSC contributions in meV in bulk Fe, free standing monolayers with their surface perpendicular to the [001] and [111] directions and a deposited Fe film on Ir with its surface perpendicular to the [111] direction. Note that the contributions come from different neighbors with different distances, not necessarily nearest neighbors.} \label{tab:Fe_bulk_monolayers_SSC} \end{table} \begin{table}[t] \centering \begin{tabular}{c|c|c|c|c|c} SLC &$\mu$&bulk Fe& Fe(001) &Fe(111) &Fe on Ir \\\hline \multirow{2}{*}{$J_{ij,j}^{\mathrm{diag-s},\mu}$}&x &9.79 & 18.90&32.09&10.80\\ &y & 9.79& 18.90 & 27.79&10.54\\ &z & 9.79& 0.09&0.29&9.61\\\hline \multirow{2}{*}{$J_{ij,j}^{\mathrm{diag-a},\mu}$}&x &0.01 & 0.22&0.03&0.15\\ &y &0.01 &0.27 &0.03&0.17\\ &z &0.01 &0.03 &0.0&0.15\\\hline \multirow{2}{*}{$J_{ij,j}^{\mathrm{off-s},\mu}$}&x & 0.02& 0.05&0.03 &0.14\\ &y &0.02 &0.05&0.04&0.12 \\ &z &0.02 & 0.00&0.0&0.15\\\hline \multirow{2}{*}{$ D_{ij,j}^{z,\mu}$}&x &0.38 & 0.47&0.28&2.62\\ &y & 0.38& 0.47&0.33&2.28\\ &z &0.04 & 0.00&0.30&0.31 \\\hline \end{tabular} \caption{ Maximal absolute SLC contributions for $j=k$ and displacement in $x$ direction in meV/a.u. in bulk Fe, free standing monolayers with their surface perpendicular to the [001] and [111] directions and a deposited Fe film on Ir with its surface perpendicular to the [111] direction.} \label{tab:Fe_bulk_monolayers_SLC} \end{table} Here, we compare the SSC and SLC parameters for materials with different dimensionality. We will compare the exchange interactions for bulk Fe, free standing monolayers with their surface perpendicular to the [001] and [111] directions and substrate materials with a Fe layer deposited on a metal $M(111)$ surface and $M = $ Ir. From tables \ref{tab:Fe_bulk_monolayers_SSC} and \ref{tab:Fe_bulk_monolayers_SLC} it can be seen that the dimensionality of the considered material affects both SSC and SLC significantly: For the SSC, the isotropic exchange of the two dimensional free-standing film is more than twice as large as for the bulk material. Apart from that, all other contributions vanish or are much smaller than the isotropic part in both materials. In contrast, the SLC have other significant contributions to the SLC tensor apart from the isotropic exchange. In both materials the SLC-DMI $\vec{D}_{ij,j}^\mu$ is the second largest contribution to the SLC tensor, as reported for bulk Fe by Ref. \cite{Mankovsky2022}. Even when comparing to the SSC contributions, $\vec{D}_{ij,j}^\mu\cdot u_j^\mu$ gives the second largest energy contribution for a realistic displacement of e.g. around $2\%$ of the lattice constant. This term hence can significantly contribute to angular momentum transfer between the spin system and the lattice. An exception is the SLC-DMI contribution for an out-of plane displacement $\vec{D}_{ij,j}^z$ for Fe(001). Furthermore, there is a relatively large SLC anisotropic part $J_{ij,j}^{\mathrm{diag-a},x}$ and $J_{ij,j}^{\mathrm{diag-a},y}$ in the monolayer, but not in the bulk material, which can also be related to spin-lattice angular momentum transfer. Note that the contributions in tables \ref{tab:Fe_bulk_monolayers_SSC} and \ref{tab:Fe_bulk_monolayers_SLC} come from different neighbors with different distances, not necessarily nearest neighbors.\\ For bulk Fe, displacements in $x$, $y$ and $z$ directions have the same maximal absolute contributions. Note, however, that this symmetry is actually broken since the magnetization direction (here: $z$ direction) is taken into account. This becomes clear when considering the individual tensor elements, with e.g. $J_{ij,j}^{xy,x}=0.22\,\frac{\mathrm{meV}}{\mathrm{a.u.}} \neq J_{ij,j}^{xy,z}=0.02\,\frac{\mathrm{meV}}{\mathrm{a.u.}}$. In the monolayer, where the magnetization is aligned in the out-of-plane direction, the asymmetry of $x$ / $y$ directions compared to the $z$ direction is much larger and can also be observed in the maximal SLC tensor contributions in Tab. \ref{tab:Fe_bulk_monolayers_SLC}.\\ \begin{figure}[t] \centering \hspace{-0.5cm} \includegraphics[width=0.23\textwidth]{Figures/Substrates_DMIij.pdf} \hspace{-0.3cm} \vspace{-0.1cm} \includegraphics[width=0.252\textwidth]{Figures/Substrates_DMIijj_xdisplacement.pdf} \caption{Comparison of SLC contributions for a surface layer system consisting of a Fe monolayer on Ir$(111)$ and a free standing Fe(111) monolayer. Sites $i$ and $j$ are occupied by a Fe atom.} \label{fig:Substrates} \end{figure} The effect of the dimensionality of the considered system on the SSC and SLC contributions can also be observed when investigating the transition between 2D monolayers to substrate system consisting of a Fe monolayer with its surface perpendicular to (111) on three layers of a metal (here Ir). The respective spin-spin and spin-lattice exchange coupling contributions for $i$ being a Fe atom and $i=k$ are shown in tables \ref{tab:Fe_bulk_monolayers_SSC} and \ref{tab:Fe_bulk_monolayers_SLC} as well as in Fig. \ref{fig:Substrates}. Further details on the calculations can be found in the next section. It can be seen that the results for the free standing monolayer and the substrate materials strongly differ in the spin-spin and spin-lattice case. For the SSC and SLC isotropic parts, the monolayer has stronger exchange contributions for most configurations of $i$ and $j$ for the SSC and SLC. In contrast, other contributions related to anisotropy and angular momentum transfer \cite{Mankovsky2022}, are dominated by the substrate material for SSC and SLC and all distances between atoms $i$ and $j$. In particular, there is a finite $z$ component of the SSC-DMI which is related to the lack of inversion symmetry in the substrate. For the monolayer, $D_{ij}^z=0$ as already presented in Tab. \ref{tab:Fe_bulk_monolayers_SSC}. Also in the SLC-DMI case the contributions of the substrate dominate. \subsubsection{Dependence on Element Types: Substrates} So far we focused on the properties of the SLC parameters $J_{ij,k}$ assuming $k=j$, characterizing the modification of the exchange interactions between the atoms on sites $i$ and $j$, when one of the atoms is displaced. This however does not imply that an impact of displacements of the atoms on sites $i\neq k \neq j$ can be neglected, although the role of these displacements depends on the material, in particular on the origin of the exchange interaction. To discuss this contribution we consider 2D materials consisting of a Fe monolayer (ML) deposited on a $M(111)$ surface and investigate the role of the type of substrate $M=\mathrm{Ir},\, \mathrm{Pt},\, \mathrm{Au}$. The elements Ir, Pt and Au belong to the sixth period of the periodic table and to neighboring groups $9$, $10$ and $11$. Their electronic configurations are $\left[\mathrm{Xe}\right]4\mathrm{f}^{14} 5\mathrm{d}^{7} 6\mathrm{s}^2$ (Ir), $\left[\mathrm{Xe}\right]4\mathrm{f}^{14} 5\mathrm{d}^{9} 6\mathrm{s}^1$ (Pt) and $\left[\mathrm{Xe}\right]4\mathrm{f}^{14} 5\mathrm{d}^{10} 6\mathrm{s}^1$ (Au). We model the system by a 3ML slab, i.e. calculations were performed for a supercell consisting of two vacuum layers, one Fe surface layer and three $M$ layers representing the substrate. Hence, the considered system actually consists of an infinite stack of substrate layers, separated by two vacuum layers. The number of separating vacuum layers between the surface layers is sufficiently large and the interlayer interactions sufficiently small to consider the system as an isolated surface layer-substrate system. \begin{table} \centering \begin{tabular}{c|c|cccc|} displ. $\mu$&$M$& $D_{ij,i}^{x,\mu}$& $D_{ij,i}^{y,\mu}$& $D_{ij,i}^{z,\mu}$&$\vert \vec{D}_{ij,i}^{\mu}\vert$\\\hline \multirow{3}{*}{x}&Ir &0.49 &0.36 &2.62&2.69 \\ &Pt & 1.23&0.05 &0.55 &1.35 \\ &Au &0.99 &0.44 &2.76 &2.97\\\hline \multirow{3}{*}{y}&Ir &0.31 &0.68 & 2.25& 2.37\\ &Pt & 0.60 &1.15 &0.69 &1.46 \\ &Au &1.21 &0.22 &3.07 &3.30\\ \hline \multirow{3}{*}{z}&Ir &1.77& 4.03&0.31 &4.41\\ &Pt &0.11 &0.98 &0.38 &1.06 \\ &Au &0.62 &3.56 &0.04 &3.61 \end{tabular} \caption[SLC-DMI in three layers of $M=\mathrm{Ir},\, \mathrm{Pt},\, \mathrm{Au}$ on Fe]{Absolute values of SLC-DMI in three layers of $M=\mathrm{Ir},\, \mathrm{Pt},\, \mathrm{Au}$ on Fe for displacements $\mu$ and a Fe atom at sites $i$ and $j$.} \label{tab:J_iji_Substrates} \end{table} The maximal nearest-neighbor SLC-DMI values for other substrate materials with substrates $M=$ Ir, Pt and Au are shown in Tab. \ref{tab:J_iji_Substrates}. It can be seen that the substrates $M=\mathrm{Ir}$ and $M= \mathrm{Au}$ have a SLC-DMI with similar absolute values and the same largest components for all displacements. For Pt, the results are in general much smaller, with different largest SLC-DMI components. \begin{figure}[t] \centering \includegraphics[width=0.34\textwidth]{Figures/Substrates_ijk.pdf} \caption{SLC contributions for a surface layer system consisting of a Fe monolayer on Ir$(111)$. Fe atoms are represented by blue dots with the central atom being atom $i$ and atoms 1 (2) being $j$.The red dot and grey dots represent the displaced and the other Ir atoms in the first substrate layer. } \label{fig:Substrates_SLC_ijk} \end{figure} The contribution of SSC and SLC with Ir atoms as one of the interacting atoms (e.g. atom $j$ in Fig. \ref{fig:Substrates}) are zero due to the vanishing magnetic moment of Ir atoms. However, the configuration of the Ir atoms can strongly affect the spin-lattice exchange strength. This is visualized in Fig. \ref{fig:Substrates_SLC_ijk} for a specific configuration with an Ir atom (red) located in the first Ir layer on the Fe layer and displaced in $x$ direction. Here, the diagonal SLC contributions are not negligible, i.e. $J_{ij,k}^{\mathrm{diag-s}}(\vec{r}_1)=3.30 \,\frac{\mathrm{meV}}{\mathrm{a.u.}}$ and $J_{ij,k}^{\mathrm{diag-s}}(\vec{r}_2)=-0.40 \,\frac{\mathrm{meV}}{\mathrm{a.u.}}$. For the $z$ component of the SLC-DMI we find $D^z_{ij,k}(\vec{r}_1)=0.16\, \frac{\mathrm{meV}}{\mathrm{a.u.}}$ and $D^z_{ij,k}(\vec{r}_2)=0.39\, \frac{\mathrm{meV}}{\mathrm{a.u.}}$.\\ \FloatBarrier \subsection{Spin-Lattice Effects in Frustrated Antiferromagnets \label{sec:AFM}} As seen in the previous section, the magnetic properties determined by the spin-spin exchange interaction tensor $J_{ij}$ can change significantly when displacing atoms $i$ and $j$, or a third atom $k\neq i,j$. This becomes particularly interesting in frustrated antiferromagnets where the magnetic configuration depends extremely sensitively on changes of $J_{ij}$ for neighbors $j$ in different directions. To discuss this issue, we consider in this section the spin-lattice interactions for CuCrO$_2$ \cite{POL+16,POL+16} which belongs to a family of triangular lattice antiferromagnets (TLA) $A$CrO$_2$, exhibiting interesting magnetic and magnetoelectric and magnetoelastic properties determined by geometrical spin frustration \cite{Engelsman1973, Rasch2009, Carlsson2011, Kimura2003, Singh2009}. This compound is characterized by a leading AFM nearest-neighbor (nn) Cr-Cr interaction and weak interactions for an increasing distance between the interacting Cr atoms. As is discussed in the literature, the nn Cr-Cr interactions in these materials may be treated in terms of two competing contributions \cite{Angelov1991, Delmas1978, Hewston1987, Mazin2007, Rasch2009, Ushakov2013}: (a) direct antiferromagnetic interactions of neighboring Cr atoms and (b) indirect ferromagnetic superexchange interactions mediated by O atoms (since $\mathrm{Cr}_1-\mathrm{O}- \mathrm{Cr}_2$ form an angle of $\approx 90^\circ$), indicating that the leading contribution is the direct Cr-Cr interaction. As a consequence, different SLC parameters can be contributed by different types of exchange interactions (see Appendix \ref{sec:spit-SLC}). Considering the diagonal symmetric SLC parameters $J^{\mathrm{diag-s},\mu}_{ij,k} = \frac{1}{2}(J^{xx,\mu}_{ij,k} + J^{yy,\mu}_{ij,k})$, the parameters with $k$ characterizing the position of an atom O can be associated mainly with the superexchange mechanism since a displacement of atom O does not change the Cr-Cr distance. On the other hand, the $J^{\mathrm{diag-s},\mu}_{ij,j}$ parameters are connected first of all with the direct exchange. \begin{figure} \centering \includegraphics[width=0.49\textwidth,angle=0,clip]{Figures/ACrS2/CuCrO2_SLC_Crlayer_longi_trans.pdf}\, \caption{Longitudinal $J_{ij,j}^{\mathrm{diag-s},lng}$ (left) and transverse $J_{ij,j}^{\mathrm{diag-s},trans}$ (right) SLC parameters for$\mathrm{CuCrO}_2$, defined in Eqs.\ \eqref{eq:Proj_long} and \eqref{eq:Proj_trans} in meV/a.u. } \label{fig:CuCrS2-SLC-Cr_longi_trans} \end{figure} First we will discuss the properties of the SLC parameters $J^{\mathrm{diag-s},\mu}_{ij,j} = \frac{1}{2}(J^{xx,\mu}_{ij,j} + J^{yy,\mu}_{ij,j})$ corresponding to $k = j$. They characterize the change of the Cr-Cr exchange interaction due to displacement of one of the interacting Cr atoms, or alternatively, they may be seen as the parameters characterizing the force $\vec{f}_{ij,j}$ acting on atom $j$, induced by spin tiltings on sites $i$ and $j$, having the components $f^\mu_{ij,j} \sim J^{\mathrm{diag-s},\mu}_{ij,j}$. It is instructive to represent the SLC parameters in terms of \enquote{longitudinal} and \enquote{transverse} displacements, or \enquote{longitudinal} and \enquote{transverse} induced forces. The \enquote{longitudinal} force on atom $j$ relative to atom $i$ is oriented along the $\hat{e}_{ij} = \vec{r}_{ij} / \vert \vec{r}_{ij}\vert$ direction, that gives \begin{eqnarray} {J}^{\mathrm{diag-s},lng}_{ij,j} &=& {J}^{\mathrm{diag-s},x}_{ij,j}(\hat{x} \cdot \hat{e}_{ij}) + {J}^{\mathrm{diag-s},y}_{ij,j} (\hat{y} \cdot \hat{e}_{ij}). \label{eq:Proj_long} \end{eqnarray} The \enquote{transverse} forces perpendicular to this direction are characterized by corresponding SLC parameters given by \begin{eqnarray} {J}^{\mathrm{diag-s},trans}_{ij,j} &=& {J}^{\mathrm{diag-s},x}_{ij,j} (\hat{x} \cdot [\hat{e}_{ij} \times \hat{z}]) \notag \\ & & \quad + {J}^{\mathrm{diag-s},y}_{ij,j}(\hat{y} \cdot [\hat{e}_{ij} \times \hat{z}] ) \nonumber \\ &=& {J}^{\mathrm{diag-s},x}_{ij,j} (\hat{y} \cdot \hat{e}_{ij}) - {J}^{\mathrm{diag-s},y}_{ij,j}(\hat{x} \cdot \hat{e}_{ij}). \label{eq:Proj_trans} \end{eqnarray} These nearest-neighbor \enquote{longitudinal} (left) and \enquote{transverse} (right) SLC parameters for $\mathrm{CuCrO}_2$ are shown in Fig. \ref{fig:CuCrS2-SLC-Cr_longi_trans}. As one can see, the \enquote{longitudinal} SLC are finite and the same for all nearest neighbors, while the \enquote{transverse} SLC parameters are equal to zero. This is a consequence of the symmetry of the system including a 3-fold rotation axis as well as $\sigma_{xz}$ and $\sigma_{yz}$ mirror planes. This implies that the forces on atoms $j$ in $\mathrm{CuCrO}_2$, induced by spin tiltings on nearest-neighbor Cr sites via ${\cal J}^{\mathrm{diag-s},\mu}_{ij,j}$ interactions are oriented along the lines connecting these two atoms. \begin{figure}[t] \includegraphics[width=0.46\textwidth,angle=0,clip]{Figures/ACrS2/CuCrO2_SLC_other_layer_x_y_displ.pdf} \caption{ Symmetric SLC $J_{ij,k}^{\mathrm{diag-s},\mu}$ in $\mathrm{CuCrO}_2$ for Cr sites at $i$ and $j$ and for a displacement in $\mu=x,\,y,\,z$ directions (first, second, third row) at a O site $k$ in the layer below (solid dots, left column) and above (empty dots, right column) the Cr layer (in meV/a.u.). } \label{fig:CuCrO2-SLC-O} \end{figure} As a next step, we discuss the three-site SLC parameters ${\cal J}^{\mathrm{diag-s},\mu}_{ij,k}$ corresponding to nearest-neighboring Cr atoms in the positions $i$ and $j$ and the O atom on site $k$, which originate from the superexchange mechanism (Appendix \ref{sec:spit-SLC}). These parameters are presented in figure \ref{fig:CuCrO2-SLC-O} for $\mu = \{x,y,z\}$. Filled gray circles in the left column correspond to the O layer below and empty circles in the right column correspond to the O layer above the Cr layer in $\mathrm{CuCrO}_2$. These parameters have the same order of magnitude as the SLC related to the displacement of one of the Cr atoms at $k=j$. Again, one can observe the impact of the crystal symmetry on the SLC parameters, which yields different values for atoms $k$ located above and below the Cr layer. In summary, we can see comparable values of the SLC parameters ${\cal J}^{\mathrm{diag-s},\mu}_{ij,k}$ in the cases of $k = j$ and $k \neq j$, indicating in general the same significance of both of them for a possible lattice distortion or phonon modes modification concomitant to magnetic ordering in the system. To complete the discussion, we represent also the properties of the DMI-like SLC parameters for CuCrO$_2$. The ${\cal D}^{\alpha,\mu}_{ij,k}$ components are presented in Tab. \ref{tab:table_CuCrO2_overview} for three different directions of displacement $x, y, z$, respectively for the case $k=j$ (i.e. $k$ site occupied by Cr (top)) and $k \neq j$ (i.e. $k$ site occupied by O (bottom)). For convenience, for every pair of nearest neighbor Cr atoms $i$ and $j$, one can consider displacements of the O atom within the corresponding planes, either along the $\vec{R}_{ij}$ vector or perpendicular to it. Therefore, in both cases, top and bottom, it is sufficient to see the properties of the DMI-like parameters between the Cr atoms connected by vector $\vec{R}_{ij} = (0,a,0)$ (i.e. $\hat{r}_{ij} = \hat{y}$ ). \begin{table}[t] \begin{center} \begin{tabular}{|p{2cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|} \hline {$\mu$} & {$x$ } & {$y$ } & {$z$ } \\ \hline & Cr & Cr & Cr \\ \hline ${D}^{x,\mu}_{ij,j}$ & -0.35 & 0 & -0.15 \\ ${D}^{y,\mu}_{ij,j}$ & 0.0 & -0.04 & 0.0 \\ ${D}^{z,\mu}_{ij,j}$ & -0.08 & 0.0 & -0.79 \\ \hline \end{tabular} \begin{tabular}{|l|c|c|c|c|c|c|} \hline {$\mu$} & \multicolumn{2}{c|} {$x$ (a)} & \multicolumn{2}{c|} {$y$ (b)} & \multicolumn{2}{c|}{$z$ (c)} \\ \hline & O$_{top}$(l) & O$_{bot}$ (r) & O$_{top}$ (l) & O$_{bot}$ (r)& O$_{top}$ (l) & O$_{bot}$ (r) \\ \hline ${D}^{x,\mu}_{ij,k} $ & -0.26 &-0.26 & 0 & 0 & -0.21 & -0.21 \\ ${D}^{y,\mu}_{ij,k} $ & 0 & 0 & 0.012 & 0.012 & 0 & 0 \\ ${D}^{z,\mu}_{ij,k} $ & -0.06 & -0.06 & 0 & 0 & 0.64 & 0.64 \\ \hline \end{tabular} \vspace{0.5cm}\\ \caption{\label{tab:table_CuCrO2_overview} The DMI-like SLC parameters for CuCrO$_2$ ${D}^{\alpha,\mu}_{ij,k}$: with the site $k=j$, i.e. occupied by Cr (top) and $k \neq j$, i.e. occupied by O (bottom), for three different directions of displacement of the nearest neighbor Cr and O atoms, i.e. $x, y, z$ (see Fig. \ref{fig:CuCrO2-SLC-O}). } \end{center} \end{table} Again, these parameters can be seen as a measure for the forces on atoms $j$ (top) and $k$ (bottom), induced by spin tiltings via different components of DMI-like SLC. As in the case of diagonal symmetric SLC parameters, one can see that ${D}^{\alpha,\mu}_{ij,k}$ are comparable in the cases of $k=j$ and $k\neq j,i$ (where the $k$ site occupied by the O atom), while the DMI-like parameters are smaller by about two orders of magnitude. \section{Summary} To conclude, we have provided a systematic analysis of spin-lattice interactions in collinear ferromagnets and antiferromagnets as well as frustrated AFMs. It was demonstrated that the crystal structure, the magnetic configuration and the dimensionality of the material under consideration determine the strength of the coupling between the spins and the lattice. Furthermore, relativistic effects give rise to non-vanishing components of the spin-lattice coupling tensor that can be connected to a two-site spin-lattice anisotropy and a spin-lattice Dzyaloshinskii–Moriya interaction. Our results are particularly interesting for modeling magnetic materials via combined spin-lattice molecular dynamics simulations since we show that different contributions to the SLC tensor can be relevant depending on the material under consideration. For some materials, even dipole-dipole interactions may have a significant impact on the SLC parameters. By calculating the respective spin-lattice interactions for CuCrO$_2$ compounds, it was demonstrated that the modification of the spin-spin counterparts is significantly large during the structural transition in these systems and hence might give insights into the magnetic transition that happens simultaneously. The results are benchmarked against calculations performed with embedded clusters, which is so far the most accurate scheme to calculate spin-lattice interactions from first principles.\\ \emph{Acknowledgements.--} The work in Konstanz was supported by the DFG via project 290/5-2.
\section{Introduction} \noindent In recent years, considerable progress has been made in the determination modulo a prime $p$ of sums of the form \begin{equation} \label{eq:SkulaSumDefinition} s(k, N) := \sum_{j=\lfloor\frac{kp}{N}\rfloor + 1}^{\lfloor\frac{(k + 1)p}{N}\rfloor} \frac{1}{j}, \end{equation} \noindent for integers $N$ and $k$ with $1 \le N < p$ and $0 \le k \le N-1$; the provision $j \neq p$ is necessary when $k=N-1$. In fact we need only consider cases with $k < N/2$ because by symmetry $s(k, N) \equiv -s(N-1-k, N)$ mod $p$. These sums, probably first introduced by Lerch \cite{Lerch}, owe much of their interest to the 1995 result of Dilcher and Skula \cite{DilcherSkula1995} that for an exponent $p$ to be an exception to the first case of Fermat's Last Theorem (FLT), $p$ must divide every such sum $s(k, N)$ with $N \le 46$, and this interest has endured despite the publication of Wiles's complete proof of FLT the same year. In the case $N=0$, these sums can be conveniently written as a special kind of Harmonic number, $s(0, N) := H_{\lfloor p/N \rfloor}$. The general problem of characterizing the sums in (\ref{eq:SkulaSumDefinition}) modulo $p$ was solved in two papers by the brothers Zhi-Hong Sun and Zhi-Wei Sun of 1992 and 2002 respectively (\cite{ZHSun1992}, \cite{ZWSun2002}), and an elementary exposition of their method in the case $k = 0$ has been given by the present writer \cite{DobsonRamus}. This approach does not explicitly reveal all the distinguishable components in the representations, as we propose to do here in the cases $N=9$ and $N=18$. Nonetheless, the 1992 paper (\cite{ZHSun1992}, pt. 2, Theorem 2.7) makes a crucial beginning in this direction with its evaluation of $s(1, 18)$, expressed in an alternate form. As this result has rarely if ever been cited, it is considered in some detail in the next section. From there we progress to the introduction of a companion result for $H_{\lfloor p/9 \rfloor}$, and finally to a complete set of calculations of $s(k, 9)$ and $s(k, 18)$ modulo $p$ for all values of $k$. These final calculations are routine, and depend only on the well-known linear relations established either by Lerch \cite{Lerch} or by Dilcher and Skula \cite{DilcherSkula2011}, in which $q_p(b) := (b^{p-1} - 1)/p$ represents the Fermat quotient of $p$ in the base $b$: \begin{equation} \label{eq:LerchDilcherSkula} \begin{split} s(0, 18) + s(2, 18) + s(4, 18) + s(6, 18) + s(8, 18) & \equiv -10 \cdot q_p(2) \pmod{p} \\ s(1, 18) + s(3, 18) + s(5, 18) + s(7, 18) & \equiv 8 \cdot q_p(2) \pmod{p} \\ s(0, 18) + 2 \cdot s(1, 18) + s(8, 18) & \equiv 0 \pmod{p}. \end{split} \end{equation} \noindent These are complemented by three relations drawn from the work of Emma Lehmer \cite{Lehmer1938}: \begin{equation} \label{eq:Lehmer} \begin{split} s(0, 18) + s(1, 18) + s(2, 18) & = s(0, 6) \equiv -2 \cdot q_p(2) - \frac{3}{2} \cdot q_p(3) \pmod{p} \\ s(3, 18) + s(4, 18) + s(5, 18) & = s(1, 6) \equiv \phantom{-}2 \cdot q_p(2) \pmod{p} \\ s(6, 18) + s(7, 18) + s(8, 18) & = s(2, 6) \equiv -2 \cdot q_p(2) + \frac{3}{2} \cdot q_p(3) \pmod{p}. \end{split} \end{equation} \noindent Hendel \cite{Hendel} showed that $q_p(2)$ is an essential component of all $s(k, N)$ of even $N$, with the pattern observable in (\ref{eq:Lehmer}) persisting throughout. \section{Toward the development of $H_{\lfloor p/18 \rfloor}$} \noindent Sun (\cite{ZHSun1992}, pt. 2, Theorem 2.7) begins with the development of a quotient which we shall designate $Z(p)$, such that, in effect, \begin{equation} \label{eq:18Sun} Z(p) := f(p)/p \equiv s(1, 18) - 2q_p(2) \pmod{p}, \end{equation} \noindent where $f(\cdot)$ is a sequence developed below. Where we write $s(1, 18)$, Sun (\cite{ZHSun1992}, pt. 2, Theorem 2.7) actually writes \begin{equation*} \sum_{k=1}^{\lfloor p/9 \rfloor} \frac{(-1)^{k-1}}{k}, \end{equation*} \noindent which is $-s^{\ast}(0, 9)$ in the notation of \cite{DobsonRamus}. Now if $T(N, m)$ represents the lacunary sum of binomial coefficients \begin{equation*} \sum_{\substack{j=0 \\ j \equiv 0 \bmod{N}}}^{m} \binom{m}{j}, \end{equation*} \noindent then the general result of Sun's three-part paper of 1992--1995 \cite{ZHSun1992}, with $f(\cdot)$ as defined in (\ref{eq:18Sun}), gives \begin{equation} \label{eq:18formula} f(p) \equiv 9 \cdot T(9, p) - 2 \cdot T(2, p) - 7 \pmod{p^2}. \end{equation} \noindent This implies that $f(\cdot)$ satisfies the ninth-order linear recurrence (not actually written out by Sun), \begin{equation} \label{eq:Z0} \begin{split} f(n) = & 8f(n - 1) - 29f(n - 2) + 62f(n - 3) - 86f(n - 4) + 80(n - 5) \\ & - 50f(n - 6) + 20f(n - 7) - 5f(n - 8) + f(n - 9). \end{split} \end{equation} \noindent The first 36 terms of this sequence are listed in the table below. \begin{table} [H] \begin{center} \begin{tabular}{ r | r || r | r || r | r } $n$ & $f(n)$ & $n$ & $f(n)$ & $n$ & $f(n)$ \\ \hline 1 & 0 & 13 & $-1755$ & 25 & $-10841355$ \\ 2 & $-2$ & 14 & 1636 & 26 & $-24927437$ \\ 3 & $-6$ & 15 & 12279 & 27 & $-49854867$ \\ 4 & $-14$ & 16 & 37426 & 28 & $-88165112$ \\ 5 & $-30$ & 17 & 87720 & 29 & $-135356601$ \\ 6 & $-62$ & 18 & 175447 & 30 & $-166501907$ \\ 7 & $-126$ & 19 & 307287 & 31 & $-109482111$ \\ 8 & $-254$ & 20 & 464776 & 32 & 202204690 \\ 9 & $-501$ & 21 & 560190 & 33 & 1101562302 \\ 10 & $-932$ & 22 & 348313 & 34 & 3176261536 \\ 11 & $-1551$ & 23 & $-731055$ & 35 & 7325660004 \\ 12 & $-2114$ & 24 & $-3798314$ & 36 & 14651320015 \\ \end{tabular} \caption{Values of $f(n)$ for $n \le 36$} \label{Table_1} \end{center} \end{table} \noindent Sun establishes that this sequence satisfies $f(p) \equiv 0$ mod $p$, so that $f(p) \equiv f(1) \equiv 0$ and $f(\cdot)$ is both a Fermat sequence \cite{Gillespie} and a prime-divisible sequence \cite{Minton}. Now if $f(\cdot)$ were subjected to multisection in the usual manner, being split according to the residue class of $n$ modulo $9$, the multisections would be characterized by the fifth-order recurrence \begin{equation} f(n) = -246f(n-1) + 13606f(n-2) + 245f(n-3) - 13605f(n-4) + f(n-5). \end{equation} \noindent But Sun does not take this standard approach. Rather, he first notices that the even terms of $f(\cdot)$ can be increased by 2 and the terms with $n \equiv 3 \bmod{6}$ increased by 6 without affecting the terms where $n$ is a prime $> 3$, yielding a new sequence that can be divided throughout by 3, finally giving \begin{equation} \label{eq:g} g(n) = 0, 0, 0, -4, -10, -20, -42, -84, -165, -310, -517, -704, \dots, \end{equation} \noindent which is represented by the ninth-order recurrence \begin{equation} \label{eq:Z2} \begin{split} g(n) = & 6g(n - 1) - 15g(n - 2) + 20g(n - 3) - 18g(n - 4) + 18(n - 5) \\ & - 20g(n - 6) + 12g(n - 7) - 3g(n - 8) + g(n - 9). \end{split} \end{equation} \noindent It may seem counterproductive to transform $f(\cdot)$ into another sequence of the same order, but $g(\cdot)$ possesses a very interesting property. The sequence is amenable to an unusual kind of multisection, in which the selected terms in each subsequence come not from a single residue class of $n$ modulo $p$, but rather from two complementary residue classes of $n$: \begin{equation*} \label{eq:ZCasesStartingValues} \begin{dcases} 0, -84, -310, 29240, 102429, -8309145, -29388370, \dots & \text{for $n \equiv \pm 1 \pmod{9}$} \\ 0, -42, -517, 12476, 154926, -3613785, -45118867, \dots & \text{for $n \equiv \pm 2 \pmod{9}$} \\ 0, -20, -704, 4095, 186732, -1266104, -55500635, \dots & \text{for $n \equiv \pm 3 \pmod{9}$} \\ -4, -10, -585, 546, 116105, -243685, -36494037, \dots & \text{for $n \equiv \pm 4 \pmod{9}$}.\\ \end{dcases} \end{equation*} \noindent (Although the case of $n \equiv \pm 3 \bmod{9}$ obviously includes no prime $> 3$, we include it for the sake of completeness; however the simpler sequence formed by the terms with $n$ divisible by 9 is not important for our purposes.) With the above sets of seven starting values, the four subsequences all satisfy the same seventh-order linear recurrence \begin{equation} \label{eq:Z} \begin{split} h(m) = & h(m - 1) - 246h(m - 2) + 246h(m - 3) + 13605h(m - 4) \\ & - 13605h(m - 5) - h(m - 6) + h(m - 7), \end{split} \end{equation} \noindent where \begin{equation*} \label{eq:ZCasesSeed} m = \begin{dcases} 2 \left\lfloor \frac{n}{9} \right\rfloor + 1 & \text{if $n \equiv 1, 2, 4 \pmod{9}$} \\ 2 \left\lfloor \frac{n}{9} \right\rfloor + 2 & \text{if $n \equiv -1, -2, -4 \pmod{9}$}. \\ \end{dcases} \end{equation*} \noindent Sun next devises a decomposition of $g(\cdot)$ such that \begin{equation} \label{eq:SunCases} g(n) = \begin{dcases} 2j(n) - 1 & \text{if $n \equiv \phantom{\pm} 0 \pmod{9}$} \\ j(n + 1) - 2 & \text{if $n \equiv \pm 1 \pmod{9}$} \\ j(n) - j(n - 1) - 2 & \text{if $n \equiv \pm 2 \pmod{9}$} \\ -j(n) - 1 & \text{if $n \equiv \pm 3 \pmod{9}$} \\ -j(n + 1) - j(n) + j(n - 1) - 2 & \text{if $n \equiv \pm 4 \pmod{9}$}, \\ \end{dcases} \end{equation} \noindent and finds that $j(\cdot)$ satisfies a lacunary recurrence of the third order, \begin{equation} \label{eq:SunSeries} \begin{split} j(1) & = 0, j(2) = 2, j (3) = -1 \\ j(n) & = 3j(n-2) - j(n-3) \quad (n \ge 3). \end{split} \end{equation} \noindent The sequence $j(\cdot)$ retains the original property of being a Fermat sequence and a prime-divisible, since $j(p) \equiv j(1) \equiv 0$ mod $p$. So finally, considering only the cases pertinent to primes $p > 9$, we have \begin{equation} \label{eq:SunFinalDefinition} Z(p) := 3 \cdot \frac{g(p)}{p} \equiv \begin{dcases} 3 \cdot \frac{j(p+1) - 2}{p} & \text{if $p \equiv \pm 1 \pmod{9}$} \\ 3 \cdot \frac{j(p) - j(p-1) - 2}{p} & \text{if $p \equiv \pm 2 \pmod{9}$} \\ 3 \cdot \frac{-j(p+1) - j(p) + j(p-1) - 2}{p} & \text{if $p \equiv \pm 4 \pmod{9}$}. \\ \end{dcases} \end{equation} \section{The development of $H_{\lfloor p/9 \rfloor}$} \noindent Prompted by the work of Hendel \cite{Hendel}, we now introduce a companion sequence to Sun's $Z(p)$. The applicability of this sequence to the present problem will be justified in detail in the next section, but first we prefer to dispose of the technical details of its construction. We begin with the quotient \begin{equation} \label{eq:9standard} X(p) := k(p)/p \equiv s(0, 9) - s(0, 3) \pmod{p}. \end{equation} \noindent Following the method of the Sun brothers, this satisfies \begin{equation} \label{eq:9formula} k(p) \equiv 3 \left\{-6 \cdot T(18, p) + 3 \cdot T(9, p) + 2 \cdot T(6, p) - T(3, p) + 2 \right\} \pmod{p^2}, \end{equation} \noindent where $T(N, m)$ is again the lacunary sum of binomial coefficients \begin{equation*} \sum_{\substack{j=0 \\ j \equiv 0 \bmod{N}}}^{m} \binom{m}{j}. \end{equation*} \noindent The divisibility of $k(p)$ by $p$ follows from the work of Sun, and since $k(p) \equiv k(1) \equiv 0 \bmod{p}$, $k(\cdot)$ is both a Fermat sequence and a prime-divisible sequence. If we consider $k(n)/3$ for all natural $n$, we have a sequence of which the first 36 terms are listed in the table below. \begin{table} [H] \begin{center} \begin{tabular}{ r | r || r | r || r | r } $n$ & $k(n)/3$ & $n$ & $k(n)/3$ & $n$ & $k(n)/3$ \\ \hline 1 & 0 & 13 & 2873 & 25 & 5218265 \\ 2 & 0 & 14 & 6734 & 26 & 5218265 \\ 3 & $-1$ & 15 & 15014 & 27 & 2 \\ 4 & $-4$ & 16 & 32132 & 28 & $-20242870$ \\ 5 & $-10$ & 17 & 66368 & 29 & $-78528607$ \\ 6 & $-19$ & 18 & 132734 & 30 & $-226111984$ \\ 7 & $-28$ & 19 & 257393 & 31 & $-572533513$ \\ 8 & $-28$ & 20 & 483626 & 32 & $-1343905180$ \\ 9 & 2 & 21 & 877799 & 33 & $-2992450957$ \\ 10 & 110 & 22 & 1529363 & 34 & $-6395344954$ \\ 11 & 407 & 23 & 2527769 & 35 & $-13201132948$ \\ 12 & 1145 & 24 & 3873017 & 36 & $-26402265898$ \\ \end{tabular} \caption{Values of $k(n)/3$ for $n \le 36$} \label{Table_2} \end{center} \end{table} \noindent The oscillating sequence $k(n)$ returns to 2, the value of the constant term in (\ref{eq:9formula}), whenever $n$ is an odd multiple of 9; and apart from the first two terms, the $n$th term is positive when the residue of $n \bmod{36}$ lies between 9 and 27, and negative when the residue lies between 0 and 8 or between 28 and 35. The sequence is defined by the seven initial values stated in the table above and a linear recurrence of the seventh order, \begin{equation} \label{eq:9recurrence} \begin{split} k(n) = & 7k(n - 1) - 21k(n - 2) + 36k(n - 3) - 39k(n - 4) \\ & + 27k(n - 5) - 12k(n - 6) + 3k(n - 7). \end{split} \end{equation} \noindent A multisection $r(n)$ of $k(n)$ based on any residue class of $n$ modulo 18 satisfies the fourth-order recurrence \begin{equation} \label{eq:9recurrenceMultisectioned} r(n) = -199097r(n-1) - 18108279r(n-2) + 18287694r(n-3) - 19683r(n-4), \end{equation} \noindent which implies that (\ref{eq:9recurrence}) can be reformulated as the lacunary recurrence \begin{equation} \label{eq:9recurrenceLacunary} \begin{split} k(n) = & -199097k(n - 18) - 18108279k(n - 36) \\ & + 18287694k(n - 54) + 19683k(n - 72). \end{split} \end{equation} \section{Expressions for $s(k, 9)$ and $s(k, 18)$} \noindent From the definition (\ref{eq:9standard}) and the classic result of Glaisher (\cite{Glaisher}, p.\ 50) that $s(0, 3) \equiv -\frac{3}{2}q_p(3) \bmod{p}$, we have \begin{equation} \label{eq:9definition} s(0, 9) \equiv X(p) - \frac{3}{2}q_p(3) \pmod{p}. \end{equation} \noindent Comparing this with Sun's evaluation of $s(1, 18)$, we immediately infer that $s(0, 18) \equiv -2q_p(2) - \frac{3}{2}q_p(3) + X(p) - Z(p)$. This and the remaining results below satisfy the linear relations gathered in the Introduction. In view of the relations (\ref{eq:18Sun}) and (\ref{eq:9definition}), as an added check all representations were verified numerically for known $p$ for which $q_p(2)$ vanishes modulo $p$ (the Wieferich primes, OEIS A001220), for which $q_p(3)$ vanishes modulo $p$ (the Mirimanoff primes, OEIS A014127), and for which $X(p)$ or Z(p) vanishes modulo $p$. This establishes that the components are truly independent, and that any other valid definitions of $X(p)$ and $Z(p)$ could differ from ours only by a scaling factor. The full sets of values follow: \begin{table} [H] \begin{center} \begin{tabular}{@{}r | rrrr@{}} $k$ & $q_p(3)$ & $X(p)$ & $Z(p)$ \\ \hline 0 & $-\frac{3}{2}$ & 1 & 0 \\ 1 & $-3$ & $-3$ & $-1$ \\ 2 & 3 & 2 & 1 \\ 3 & 0 & 1 & 1 \\ 4 & 0 & 0 & 0 \\ \end{tabular} \caption{Coefficients of the components of $s(k, 9)$} \label{Table_3} \end{center} \end{table} \begin{table} [H] \begin{center} \begin{tabular}{@{}r | rrrr@{}} $k$ & $q_p(2)$ & $q_p(3)$ & $X(p)$ & $Z(p)$ \\ \hline 0 & $-2$ & $-\frac{3}{2}$ & 1 & $-1$ \\ 1 & 2 & 0 & 0 & 1 \\ 2 & $-2$ & 0 & $-1$ & 0 \\ 3 & 2 & $-3$ & $-2$ & $-1$ \\ 4 & $-2$ & 6 & 6 & 4 \\ 5 & 2 & $-3$ & $-4$ & $-3$ \\ 6 & $-2$ & $-6$ & $-5$ & $-2$ \\ 7 & 2 & 6 & 6 & 3 \\ 8 & $-2$ & $\frac{3}{2}$ & $-1$ & $-1$ \\ \end{tabular} \caption{Coefficients of the components of $s(k, 18)$} \label{Table_4} \end{center} \end{table} \noindent In light of the proof by Dilcher and Skula \cite{DilcherSkula1995} that a prime $p$ failing the first case of FLT must vanish simultaneously for $s(k, 9)$ and $s(k, 18)$ with all values of $k$, the results of a search for vanishing values of these sums may be of interest: \begin{table} [H] \begin{center} \begin{tabular}{ r | l } $k$ & $p$ \\ \hline 0 & 677, 6691, 532199813 \\ 1 & 151, 457, 971, 1439, 12613 \\ 2 & 241, 739, 37799, 3112456729 \\ 3 & 97, 58193 \\ \end{tabular} \caption{Values of $p < 5,330,000,000,000$ for which $s(k, 9)$ vanishes modulo $p$} \label{Table_5} \end{center} \end{table} \begin{table} [H] \begin{center} \begin{tabular}{ r | l } $k$ & $p$ \\ \hline 0 & 5235774727037 \\ 1 & 47, 1777, 217337 \\ 2 & 167 \\ 3 & 1171, 37783, 28525219 \\ 4 & 137, 251, 1087, 1301, 2111, 5749, 428687393 \\ 5 & 4177, 1581479 \\ 6 & 108541, 48303223 \\ 7 & 149, 35267 \\ 8 & --- \\ \end{tabular} \caption{Values of $p < 5,330,000,000,000$ for which $s(k, 18)$ vanishes modulo $p$} \label{Table_6} \end{center} \end{table} \noindent These calculations were performed in PARI/GP using standard matrix-powerng methods to evaluate the various sequences modulo $p$, and $s(8, 18)$ is the only remaining case for which no result has been found. It will be noted that no value of $p$ appears in more than one position. \section{Connection with the first case of Fermat's Last Theorem} \noindent For a prime $p$ to fail the first case of Fermat's Last Theorem (FLT), Wieferich proved that $q_p(2)$ must vanish modulo $p$, while Mirimanoff proved that $q_p(3)$ must vanish modulo $p$. Thus, the relations (\ref{eq:18Sun}) and (\ref{eq:9definition}) and the 1995 result of Dilcher and Skula \cite{DilcherSkula1995} mentioned in the Introduction imply the vanishing of both $Z(p)$ and $X(p)$ modulo $p$ as necessary conditions for the failure of the first case of FLT. A computer search to $p < 5,330,000,000,000$ found only the following cases where the expressions vanish modulo $p$: For $Z(p)$: $179$, $1949$, $28885849$. For $X(p)$: $2$, $13$, $19$, $2423$. \noindent Within the range of $p$ tested, there is no $p$ for which $s(k, 18)$ vanishes simultaneously for distinct values of $k$, nor any value of $k$ for which any two of the three quantities $s(k, 18)$, $Z(p)$, and $X(p)$ vanish simultaneously. \section{Conclusion} \noindent The 1995 paper of Dilcher and Skula \cite{DilcherSkula1995} considers $s(k, N)$ with $N$ ranging from $2$ through $46$. Computational studies of these numbers have focused mainly on the case $k=0$, or $H_{\lfloor p/N \rfloor}$. Although Dilcher and Skula state (pp.\ 389--390) that $s(0, N)$ vanishes modulo $p$ for some value of $p < 2000$ for every $N$ in this range except $N = 5$, in fully $22$ of these cases ($N = 7, 11, 12, 13, 14, 15, 16, 17, 18, 20, 22, 28, 29, 30, 31, 35, 38, 39, 43, 44, 45, 46$) this statement is true only if the sums are permitted to be vacuous, which surely cannot have been the authors' intention. Both in previous work \cite{DobsonSpecialHarmonicNumbers} and in the present paper we have disregarded vacuous sums and extended the search in those cases to higher $p$. For $N$ between $2$ and $46$, at least one solution $p$ is now known for all but the cases $N = 5, 12, 20, 29, 31, 43$. \clearpage
\section{Introduction} Pretraining text encoders to learn from bidirectional contexts has achieved enormous success in various natural language processing (NLP) tasks~\cite{clark2020electra,devlin2019bert,liu2019roberta}. Masked Language Modeling (MLM)~\cite{devlin2019bert} is among one of the most prominent pretraining approaches due to its conceptual simplicity and empirical effectiveness: By randomly masking a portion of input tokens and training a Transformer encoder to predict the original content based on the remaining bidirectional contexts, the model learns robust representations that generalize well to diverse downstream tasks. Besides its broad impact in NLP, MLM has also been widely adopted for pretraining in other domains, such as images~\cite{Bao2021BEiTBP,Xie2022SimMIMAS}, videos~\cite{Tong2022VideoMAEMA,Wang2022BEVTBP} and graphs~\cite{Hou2022GraphMAESM}. Despite its remarkable success, the effectiveness of MLM may be hindered by a discrepancy between pretraining and fine-tuning: The special \texttt{[MASK]}\xspace token occurs only in pretraining but not in downstream tasks. While a few previous studies~\cite{clark2020electra,yang2019xlnet} have attempted to address this issue, they end up proposing new training objectives instead of systematically investigating why and how such a discrepancy impacts the generalization of MLM-pretrained models. In this work, we study the consequence of including \texttt{[MASK]}\xspace tokens in MLM pretraining by examining the learned token representation space. We empirically and theoretically show that \texttt{[MASK]}\xspace token representations exclusively occupy some model dimensions, thereby reducing the model capacity for representing real tokens. Such a representation deficiency issue may not be simply addressed by fine-tuning on downstream tasks: Those dimensions exclusively used for \texttt{[MASK]}\xspace tokens have not been pretrained to represent real tokens, and will have to be either trained from scratch on downstream data, raising the risk of overfitting~\cite{Hendrycks2019UsingPC,Kumar2022FineTuningCD}, or become unused, resulting in a waste of model capacity. To address the representation deficiency issue, we propose a simple text encoder pretraining method, MAE-LM\xspace, which conducts MLM pretraining based on the Masked Autoencoder architecture~\cite{He2022MaskedAA}. Notably, \texttt{[MASK]}\xspace tokens are omitted from the encoder's input so that the real token representations can utilize the entire model dimensions theoretically. An auxiliary decoder, which is used only in pretraining and not in fine-tuning, takes the encoder's output representations and \texttt{[MASK]}\xspace positions to predict the original tokens. We demonstrate empirically that by excluding \texttt{[MASK]}\xspace tokens from the encoder, MAE-LM\xspace improves the utilization of model dimensions in pretraining and downstream tasks. Under various standard pretraining settings and model sizes, MAE-LM\xspace achieves consistent and notable improvements over previous models pretrained by MLM and its variants on the GLUE and SQuAD benchmarks. Our main contributions are as follows: (1) We investigate the token representation space trained by MLM, and identify a previously unknown representation deficiency issue when the pretrained model is applied to real data without \texttt{[MASK]}\xspace tokens. (2) Based on empirical and theoretical analyses, we explain why the representation deficiency issue occurs in the conventional MLM pretraining setup. (3) We propose a simple pretraining method MAE-LM\xspace that addresses the identified issue and improves the fine-tuning performance of previous MLM-pretrained models under different pretraining settings and model sizes. Our analyses and results also provide new perspectives to understand why certain pretraining methods (\textit{e.g.}, ELECTRA~\cite{clark2020electra}) and adaptation methods (\textit{e.g.}, prompt-based fine-tuning~\cite{gao2021making,Schick2021ExploitingCF}) are advantageous, and may shed light on future research of MLM-style pretraining methods. \section{Analysis of Token Representations in MLM} \label{sec:analysis} \subsection{Preliminaries} \textbf{Transformer Encoder.} Transformer encoders contain multiple Transformer layers, where each layer consists of two submodules, multi-head self-attention (MHSA) and feed-forward network (FFN). The self-attention mechanism uses queries $\bs{Q}$ and keys $\bs{K}$ to compute attention weights, and outputs a weighted sum of the values $\bs{V}$. MHSA performs self-attention in parallel over $N$ heads as follows: \begin{align*} \text{Attn}(\bs{Q}, \bs{K}, \bs{V}) &= \text{Softmax}\left( \frac{\bs{Q} \bs{K}^\top }{\sqrt{d_h}}\right) \bs{V},\\ \text{head}_h &= \text{Attn}(\bs{XW}^Q_h, \bs{XW}^K_h, \bs{XW}^V_h),\\ \text{MHSA}(\bs{X}) &= \text{Concat}(\text{head}_1, \dots, \text{head}_N) \bs{W}^O, \end{align*} where $\bs{X} \in \mathbb{R}^{n\times d}$ is the input representations to MHSA, $n$ is the sequence length and $d$ is the model dimension. $d_h$ is the dimension of head $h$ and is usually set to $d/N$. $\bs{W}^Q_h, \bs{W}^K_h, \bs{W}^V_h \in \mathbb{R}^{d\times d_h}$ and $\bs{W}^O \in \mathbb{R}^{d\times d}$ are learnable weight matrices. The outputs of MHSA are further passed to FFN which learns nonlinear transformations to derive the final outputs of the Transformer layer. \textbf{Masked Language Modeling (MLM).} Given a text sequence $\bs{x} = [x_1, \dots, x_i, \dots, x_n]$, MLM randomly selects a set of token positions $\mathcal{M}$ and replaces them with a special \texttt{[MASK]}\xspace symbol. The resulting partially masked sequence $\hat{\bs{x}} = [x_1, \dots, \texttt{[MASK]}\xspace_i, \dots, x_n]$ is then fed to the Transformer encoder $\bs{\theta}$ which outputs the token representations $\bs{H} = [\bs{h}_1, \dots, \bs{h}_i, \dots, \bs{h}_n]$. Finally, the encoder $\bs{\theta}$ is trained to predict the original token out of the vocabulary $\mathcal{V}$ at each masked position by minimizing the cross-entropy loss $\mathcal{L}_\text{MLM}$: \begin{align} \begin{split} \label{eq:softmax} p_{\bs{\theta}} (x_i | \hat{\bs{x}}) &= \frac{\exp(\bs{e}_{x_i}^\top \bs{h}_i)}{\sum_{x' \in \mathcal{V}} \exp(\bs{e}_{x'}^\top \bs{h}_i)},\\ \mathcal{L}_\text{MLM} &= \mathbb{E} \left( - \sum_{i\in \mathcal{M}} \log p_{\bs{\theta}} \left( x_i \big| \hat{\bs{x}} \right) \right), \end{split} \end{align} where $\bs{e}_x$ refers to the embedding of token $x$. \input{Figures/eff_dim.tex} \subsection{Rank-Deficient Real Token Representations} MLM pretraining introduces a special \texttt{[MASK]}\xspace token to replace the token positions to be predicted, but such \texttt{[MASK]}\xspace tokens are usually absent from downstream task data. Therefore, to study the PLM's capacity for downstream data representation, we examine the \emph{real token} representation space trained with MLM. We are interested in the rank of the real token representation matrix $\bs{H}_{\mathcal{R}} \in \mathbb{R}^{n \times d}$ ($n \gg d$) where each row corresponds to the representation of a real token. Ideally, one would hope $\bs{H}_{\mathcal{R}}$ to have high column rank (\emph{i.e.}, $\text{rank}\xspace(\bs{H}_{\mathcal{R}}) \approx d$) so that more model dimensions are effective for modeling real tokens. However, as we will show next, a portion of the model dimensions will be exclusively used for \texttt{[MASK]}\xspace token representations in MLM pretraining, so that $\bs{H}_{\mathcal{R}}$ is necessarily rank-deficient (\emph{i.e.}, not all model dimensions are leveraged to represent real tokens). \textbf{Empirical Evidence.} We evaluate the representation space of a pretrained $12$-layer RoBERTa$_\text{base}$ model~\cite{liu2019roberta} on the validation set of the pretraining corpus. We first apply $15\%$ random masks to these input sequences (same as the pretraining setting), and obtain the token representation matrix $\bs{H}^l \in \mathbb{R}^{n \times d}$ ($n \approx 5\times10^6$, $d = 768$), which contains both real token and mask token representations, for each layer $l$ in the pretrained RoBERTa model. We then feed the same input sequences in their original form (\emph{i.e.}, without \texttt{[MASK]}\xspace) to the pretrained RoBERTa model and obtain the token representation matrix $\widetilde{\bs{H}}^l \in \mathbb{R}^{n \times d}$ which consists of real token representations only. Comparing the rank of $\widetilde{\bs{H}}^l$ with $\bs{H}^l$ gives insights about the change in representation capacity when adapting a pretrained MLM model to input sequences without \texttt{[MASK]}\xspace. Since numerical errors and small perturbations practically render any large matrix full-rank regardless of its actual rank, we compute the \emph{effective rank}~\cite{cai2020isotropy} of a matrix $\bs{H}$: We only consider $\bs{H}$'s most significant components that account for the majority of the variance reflected by singular values. Given a threshold value $\tau$, we define the $\tau$-effective rank of $\bs{H}$ as $$ \text{rank}\xspace_\tau(\bs{H}) = \argmin_k \left( \frac{\sum_{i=1}^k \sigma_i^2}{\sum_{i=1}^d \sigma_i^2} \ge \tau \right), $$ where $\sigma_i$ is the $i$th largest singular value of $\bs{H}$. For example, $\text{rank}\xspace_{0.9}(\bs{H}) = 10$ means that $90\%$ of $\bs{H}$'s variance can be captured with $10$ dimensions. Figure~\ref{fig:pretrain_finetune_dim} shows $\text{rank}\xspace_{0.9}(\bs{H}^l)$ (Input w. \texttt{[MASK]}\xspace) and $\text{rank}\xspace_{0.9}(\widetilde{\bs{H}}^l)$ (Input w/o. \texttt{[MASK]}\xspace). It generally holds that $\text{rank}\xspace_{0.9}(\widetilde{\bs{H}}^l) < \text{rank}\xspace_{0.9}(\bs{H}^l)$, and the gap is more prominent in deeper layers. This demonstrates that some model dimensions are reserved for \texttt{[MASK]}\xspace token representations in almost all encoder layers, and these dimensions are not active when the input sequences consist of real tokens entirely. Such representation deficiencies for modeling real tokens become more severe in deeper layers where \texttt{[MASK]}\xspace token representations occupy more dimensions, as shown in Figure~\ref{fig:mask_real_dim}. \textbf{Theoretical Analysis.} We theoretically validate the empirical observation above that MLM necessarily allocates a subspace for \texttt{[MASK]}\xspace token representations which is not contained by the real token representation subspace, so that the real token representations are rank-deficient. \begin{lemma}[Rank increase of \texttt{[MASK]}\xspace token representations in Transformer encoder] \label{lem:rank} The rank of \texttt{[MASK]}\xspace token representations will increase from the input layer to the output layer of an $L$-layer Transformer encoder trained with MLM (i.e., $\text{rank}\xspace(\bs{H}_{\mathcal{M}}^L) \gg \text{rank}\xspace(\bs{H}_{\mathcal{M}}^0)$). \end{lemma} \begin{proof} We first show that $\bs{H}_{\mathcal{M}}^L$ will be high-rank in a well-trained MLM model and then show that $\bs{H}_{\mathcal{M}}^0$ is necessarily low-rank, and thus the statement holds. As shown in Eq.~\eqref{eq:softmax}, the output token probability distributions at masked positions are computed from the encoder's output representations $\bs{H}_{\mathcal{M}}^L \in \mathbb{R}^{m \times d}$ and token embeddings $\bs{E} \in \mathbb{R}^{|\mathcal{V}| \times d}$. Denote the true log probability distributions of the masked token prediction task as $\bs{T} \in \mathbb{R}^{m \times |\mathcal{V}|}$: \setlength\arraycolsep{3pt} $$ \small \bs{T} = \begin{bmatrix} \log p\left(x_1|\hat{\bs{x}}_1\right) & \log p\left(x_2|\hat{\bs{x}}_1\right) & \cdots & \log p\left(x_{|\mathcal{V}|}|\hat{\bs{x}}_1 \right) \\ \log p\left(x_1|\hat{\bs{x}}_2\right) & \log p\left(x_2|\hat{\bs{x}}_2\right) & \cdots & \log p\left(x_{|\mathcal{V}|}|\hat{\bs{x}}_2 \right) \\ \vdots & \vdots & \ddots & \vdots \\ \log p\left(x_1|\hat{\bs{x}}_m\right) & \log p\left(x_2|\hat{\bs{x}}_m\right) & \cdots & \log p\left(x_{|\mathcal{V}|}|\hat{\bs{x}}_m \right) \end{bmatrix}, $$ then $\bs{H}_{\mathcal{M}}^L$ and $\bs{E}$ are trained to approximate $\bs{T}$ with a row shift (due to the softmax normalization)~\cite{Yang2018BreakingTS}: \begin{equation} \label{eq:mlm_matrix} \bs{H}_{\mathcal{M}}^L \bs{E}^\top \approx \bs{T} + \bs{c}\bs{1}^\top, \end{equation} where $\bs{c} \in \mathbb{R}^m$ contains the shifting constant added to each row, and $\bs{1} \in \mathbb{R}^{|\mathcal{V}|}$ is a vector of all ones. It is shown in \cite{Yang2018BreakingTS} that the true probability distribution $\bs{T}$ is high-rank (as high as $|\mathcal{V}|$) due to the complexity of natural language. Since $\text{rank}\xspace(\bs{H}_{\mathcal{M}}^L \bs{E}^\top) \le \min \{ \text{rank}\xspace(\bs{H}_{\mathcal{M}}^L), \text{rank}\xspace(\bs{E}) \}$, both $\bs{H}_{\mathcal{M}}^L$ and $\bs{E}$ need to be high-rank to achieve a good approximation of $\bs{T} + \bs{c}\bs{1}^\top$. Next, we show $\bs{H}_{\mathcal{M}}^0$ is low-rank. $\bs{H}_{\mathcal{M}}^0$ is the sum of token embeddings and position embeddings at masked positions: $$ \bs{H}_{\mathcal{M}}^0 = \bs{1} \bs{e}_{\texttt{[MASK]}\xspace}^\top + \bs{P}, $$ where $\bs{e}_{\texttt{[MASK]}\xspace} \in \mathbb{R}^d$ is the \texttt{[MASK]}\xspace token embedding, and $\bs{P} \in \mathbb{R}^{m \times d}$ is the position embeddings. Since we have $\text{rank}\xspace(\bs{1} \bs{e}_{\texttt{[MASK]}\xspace}^\top + \bs{P}) \le \text{rank}\xspace(\bs{1} \bs{e}_{\texttt{[MASK]}\xspace}^\top) + \text{rank}\xspace(\bs{P}) = \text{rank}\xspace(\bs{P}) + 1$, we only need to show $\bs{P}$ is low-rank. Previous studies~\cite{he2020deberta,Ke2021RethinkingPE} have identified that position embeddings $\bs{P}$ and token embeddings $\bs{E}$ encode disjoint information, and are learned in separate subspaces of $\mathbb{R}^{d}$. Therefore, $\text{rank}\xspace(\bs{P}) \le d - \text{rank}\xspace(\bs{E})$. We also showed that $\bs{E}$ must be high-rank to satisfy Eq.~\eqref{eq:mlm_matrix}, and thus $\bs{P}$ is necessarily low-rank. Finally, $\bs{H}_{\mathcal{M}}^0$ is also low-rank as $\text{rank}\xspace(\bs{H}_{\mathcal{M}}^0) \le \text{rank}\xspace(\bs{P}) + 1$. \end{proof} \begin{remark} Lemma~\ref{lem:rank} corresponds to the empirical observation in Figure~\ref{fig:mask_real_dim}, and can be intuitively interpreted as a necessary consequence of the \texttt{[MASK]}\xspace token contextualization process in Transformers: The \texttt{[MASK]}\xspace representations at the input layer are context-free, and they need to aggregate contextual information from other tokens in the sequence for predicting the original word, resulting in an increase in the information content of \texttt{[MASK]}\xspace token representations. We also note that the rank increase statement does not necessarily apply to real token representations. This is because MLM does not directly train the real token representations (\textit{e.g.}, the training objective in Eq.~\eqref{eq:mlm_matrix} does not apply to real token positions\footnote{Some MLM training settings adopt a trick that keeps $10\%$ of \texttt{[MASK]}\xspace as original tokens and randomly replaces another $10\%$ of \texttt{[MASK]}\xspace with other tokens. Even with this trick, the training signals on real token representations are scarce. Furthermore, later studies~\cite{Wettig2022ShouldYM} report that this trick is not necessary---training exclusively on \texttt{[MASK]}\xspace positions performs well.}). \end{remark} Based on Lemma~\ref{lem:rank}, we proceed to prove that $\bs{H}_{\mathcal{M}}^l$ occupies a different subspace that is not contained by the subspace of $\bs{H}_{\mathcal{R}}^l$, resulting in deficient representations for real tokens. \begin{restatable}[Rank deficiency of real token representations]{theorem}{deficient} \label{thm:deficient} There exists some layer $l$ in the Transformer encoder where the real token representation $\bs{H}_{\mathcal{R}}^l$ is rank-deficient. In particular, the row space of $\bs{H}_{\mathcal{R}}^l$ does not contain the row space of \texttt{[MASK]}\xspace token representation $\bs{H}_{\mathcal{M}}^l$. \end{restatable} \vspace{-1em} \begin{proof} We provide a proof sketch below. Detailed proofs can be found in Appendix~\ref{app:proof}. We prove the statement by contradiction: Suppose that the row space of $\bs{H}_{\mathcal{R}}^l \in \mathbb{R}^{n \times d}$ contains the row space of $\bs{H}_{\mathcal{M}}^l \in \mathbb{R}^{m \times d}$, then we have \begin{equation} \label{eq:linear} \bs{H}_{\mathcal{M}}^{l} = \bs{U} \bs{H}_{\mathcal{R}}^{l}, \quad \bs{U} \in \mathbb{R}^{m \times n}. \end{equation} We show that under this assumption, $\bs{H}_{\mathcal{M}}^l$ will converge exponentially (with $l$) to a rank-$1$ matrix, which contradicts with Lemma~\ref{lem:rank}. We adopt a similar approach as \cite{Dong2021AttentionIN} to study the following residual $\bs{R}^{l}$ which measures the difference between $\bs{H}_{\mathcal{R}}^l$ and a rank-$1$ matrix: $$ \bs{R}^{l} = \bs{H}_{\mathcal{R}}^{l} - \bs{1} \bs{h}^\top, \quad \bs{h} = \argmin_{\bs{x}} \left\| \bs{H}_{\mathcal{R}}^{l} - \bs{1} \bs{x}^\top \right\|. $$ Based on the self-attention formula and the assumption in Eq.~\eqref{eq:linear}, we can derive a bound for the norm of $\bs{R}^{l}$ as a function of $\bs{R}^{l-1}$: \begin{align*} \left\| \bs{R}^{l} \right\|_{1,\infty} \le 4 \epsilon \left\| \bs{R}^{l-1} \right\|_{1,\infty}^3, \end{align*} where $\left\|\cdot \right\|_{1,\infty}$ denotes the geometric mean of $\ell_1$ and $\ell_\infty$ norm, and $$ \epsilon = \left\| \frac{\bs{W}^Q \tp{\bs{W}^K}}{\sqrt{d}} \right\|_1 \left\| \bs{W}^V \bs{W}^O \right\|_{1,\infty} \left\| \bs{U} \right\|_{\infty} \left( 1 + \left\| \bs{U} \right\|_{\infty} \right). $$ This shows that $\left\| \bs{R}^{l} \right\|_{1,\infty}$ converges exponentially with $l$ to zero, and thus $\bs{H}_{\mathcal{R}}^l$ converges exponentially with $l$ to a rank-$1$ matrix. We also have $\text{rank}\xspace(\bs{H}^l_{\mathcal{M}}) \le \text{rank}\xspace(\bs{H}^l_{\mathcal{R}})$ as the row space of $\bs{H}_{\mathcal{M}}^l$ is contained by the row space of $\bs{H}_{\mathcal{R}}^l$. Hence, $\bs{H}^l_{\mathcal{M}}$ will also converge exponentially to a rank-$1$ matrix, which contradicts with Lemma~\ref{lem:rank}. Therefore, the statement holds. \end{proof} \begin{remark} Theorem~\ref{thm:deficient} demonstrates that at least some \texttt{[MASK]}\xspace token representations and real token representations need to be linearly independent so that the rank of $\bs{H}_{\mathcal{M}}^l$ may increase through encoder layers. As a result, the real token representation $\bs{H}_{\mathcal{R}}^l$ cannot utilize the entire model dimensions and is prone to rank deficiency. \end{remark} \section{MAE-LM\xspace: Masked Autoencoders for MLM} \input{Figures/mae-lm.tex} To address the representation deficiency issue in MLM, we propose a simple framework MAE-LM\xspace, which pretrains bidirectional Transformer encoders using the MLM objective, but based on the Masked Autoencoder~\cite{He2022MaskedAA} structure. An overview of MAE-LM\xspace is shown in Figure~\ref{fig:mae_lm}. \textbf{Excluding} \texttt{[MASK]}\xspace{} \textbf{from the Encoder.} An important design in MAE-LM\xspace is that \texttt{[MASK]}\xspace tokens are excluded from the encoder inputs so that no model dimensions will be used to represent \texttt{[MASK]}\xspace tokens. Hence, the representations of real tokens $\bs{H}_{\mathcal{R}}$ can theoretically utilize the entire space $\mathbb{R}^{d}$, which addresses the representation bottleneck in conventional MLM pretraining. Specifically, given a masked sequence $\hat{\bs{x}} = [x_1, \dots, \texttt{[MASK]}\xspace_i, \dots, x_n]$ and let $\mathcal{M}$ denote the set of masked positions, the encoder's input sequence $\bs{H}^0$ consists of the sum of token embeddings $\bs{e}_{x_i}$ and position embeddings $\bs{p}_{i}$ at real token positions $i \notin \mathcal{M}$: $$ \bs{H}^0 = \left\{ \bs{h}_i^0 \right\}_{i \notin \mathcal{M}}, \quad \bs{h}_i^0 = \bs{e}_{x_i} + \bs{p}_{i}. $$ \textbf{Decoder Configuration.} In order to predict the original tokens at masked positions, the encoder's output token representations $\bs{H}^L$ are further passed to an auxiliary bidirectional decoder. While standard Transformer decoders perform unidirectional self-attention (and cross-attention to encoder outputs) for autoregressive decoding, our decoder performs bidirectional self-attention (same as the encoder). It is called a decoder as it takes encoded representations as input and outputs tokens. The decoder's input sequence $\widehat{\bs{H}}^0$ needs to include the \texttt{[MASK]}\xspace token embedding $\bs{e}_{\texttt{[MASK]}\xspace}$ and position embeddings $\bs{p}_{i}$ so that the decoder is aware of the positions to be predicted: $$ \widehat{\bs{H}}^0 = \left\{ \widehat{\bs{h}}_i^0 \right\}_{1 \le i \le n}, \quad \widehat{\bs{h}}_i^0 = \begin{cases} \bs{e}_{\texttt{[MASK]}\xspace} + \bs{p}_{i} & i \in \mathcal{M} \\ \bs{h}_{i}^L + \bs{p}_{i} & i \notin \mathcal{M} \end{cases}. $$ The decoder's output representations will be trained with the MLM objective shown in Eq.~\eqref{eq:softmax}. Since the decoder includes \texttt{[MASK]}\xspace tokens, it is subject to the representation deficiency for modeling real tokens as analyzed in Section~\ref{sec:analysis}. Therefore, the decoder is \emph{not} used in fine-tuning on downstream tasks. The decoder is made to be shallow (the decoder depth is $1/6-1/3$ of the encoder in our experiments) not only for pretraining efficiency, but also to push the encoder to learn robust token representations---if the decoder is too strong, it alone may learn the MLM task well without requiring good encoder representations $\bs{H}^L$. Despite using an additional decoder in pretraining, MAE-LM\xspace's pretraining time cost is roughly equal to that of conventional MLM pretraining (\textit{e.g.}, RoBERTa). This is because the exclusion of \texttt{[MASK]}\xspace tokens from the encoder practically reduces its input sequence length (\textit{e.g.}, $15\%$ random masks shorten the encoder's input length by $15\%$), bringing down the encoder's computation cost. \section{Experiments} \label{sec:exp} \subsection{Pretraining and Evaluation Setup} \textbf{Pretraining Settings.} We evaluate MAE-LM\xspace under three standard pretraining settings: \textit{base}, \textit{base++}, and \textit{large++}. All settings use the MLM objective for pretraining and we do not use any sequence-level tasks. The \textit{base} setting follows BERT$_\text{base}$~\cite{devlin2019bert} pretraining which uses Wikipedia and BookCorpus~\cite{zhu2015aligning} ($16$GB of texts) as the pretraining corpora. The encoder architecture is a $12$-layer Transformer, and the model dimension is $768$. We train both absolute and relative position embeddings~\cite{raffel2019t5} in the encoder. The decoder is a $4$-layer Transformer with the same model dimensions as the encoder. Since the decoder is not used in downstream tasks, MAE-LM\xspace's encoder can be fairly compared with previous $12$-layer base-sized models. The model is trained for $125$K steps with $2,048$ sequences per batch, which amounts to $256$M samples in total. The maximum input sequence length is $512$ tokens. The vocabulary is constructed with Byte Pair Encoding (BPE)~\cite{sennrich2015neural} and consists of $32,768$ \emph{uncased} subword units. The \textit{base++} setting follows RoBERTa~\cite{liu2019roberta} pretraining which extends the \textit{base} setting by incorporating larger pretraining corpora and training the same model architecture for longer. Specifically, the following corpora are used along with Wikipedia and BookCorpus: OpenWebText~\cite{Gokaslan2019OpenWeb}, CC-News~\cite{liu2019roberta}, and STORIES~\cite{trinh2018simple}. This expands the pretraining corpora to contain $160$GB texts. The model is trained for $2$M steps with $2,048$ sequences per batch, which amounts to $4$B samples in total. The \textit{base++} setting also upgrades the vocabulary by using \emph{cased} subword units and expanding the vocabulary size to $64,000$~\cite{unilmv2}. The \textit{large++} setting extends the \textit{base++} setting by scaling up the encoder architecture to $24$ layers and $1,024$ model dimensions. The decoder is still a $4$-layer Transformer with the same model dimensions as the encoder. Due to the high cost of training large models, we train for $1$M steps (half of the \textit{base++} setting) with $2,048$ sequences per batch, which amounts to $2$B samples in total. Note that this is also half of the pretraining data used in RoBERTa~\cite{liu2019roberta} and BART~\cite{Lewis2020BARTDS}. \textbf{Downstream Tasks and Fine-Tuning.} We evaluate the pretrained models on the GLUE~\cite{wang2018glue} and SQuAD 2.0~\cite{rajpurkar2016squad} benchmarks. The details about GLUE tasks can be found in Appendix~\ref{app:glue}. We adopt standard fine-tuning as in BERT~\cite{devlin2019bert} and RoBERTa~\cite{liu2019roberta}. The hyperparameter search space for fine-tuning can be found in Appendix~\ref{app:hyper}. All reported fine-tuning results are the medians of five random seeds on GLUE and SQuAD, following previous studies~\cite{liu2019roberta}. \textbf{Baselines.} We compare with various baselines pretrained by MLM (and variants of MLM) under each setting. The baseline results, unless marked by ``(Ours)'', are taken from the original papers except the result of BERT$_\text{base}$ which is reported by \cite{unilmv2}. To eliminate the performance difference due to implementation details and computation environment, we also pretrain and fine-tune RoBERTa (the most important baseline) under exactly the same \textit{base} pretraining setting with MAE-LM\xspace, which is denoted with ``RoBERTa (Ours)''. \textbf{Implementation Details.} Our implementation is built on the fairseq~\cite{ott2019fairseq} open-source library. More implementation details are mentioned in Appendix~\ref{app:implementation}. \subsection{Overall Results} \input{Tables/main-res.tex} Table~\ref{tab:main_res} shows the results under the three pretraining settings on the GLUE and SQuAD 2.0 benchmarks. Overall, MAE-LM\xspace outperforms previous models pretrained by MLM and its variants. Notably, the gains of MAE-LM\xspace over RoBERTa (the standard MLM pretrained model) are quite consistent across tasks and pretraining settings. Under the \textit{large++} setting, MAE-LM\xspace is pretrained on half of RoBERTa's data, and still performs comparably or better than RoBERTa. \input{Figures/efficiency.tex} \textbf{Pretraining Efficiency.} In Figure~\ref{fig:efficiency}, we illustrate MAE-LM\xspace{}$_{\text{base}}$'s fine-tuning performance when pretrained for different amounts of time. MAE-LM\xspace takes slightly more time than RoBERTa when trained on the same amount of data, but to reach RoBERTa's MNLI accuracy, MAE-LM\xspace only needs about $40\%$ of its pretraining time. \subsection{Ablation Studies} \label{sec:ablation} \input{Tables/ablation.tex} We create several groups of ablations to study the important components in MAE-LM\xspace. The results are shown in Table~\ref{tab:ablation}. \textbf{Handling} \texttt{[MASK]}\xspace{}\textbf{.} MAE-LM\xspace excludes \texttt{[MASK]}\xspace tokens from encoder's inputs. We compare with other ways of handling \texttt{[MASK]}\xspace tokens in the encoder: (1) including \texttt{[MASK]}\xspace in encoder's inputs without using the decoder, which is the standard MLM (enc. w. \texttt{[MASK]}\xspace, no dec.); (2) including \texttt{[MASK]}\xspace in encoder's inputs and using the same decoder (enc. w. \texttt{[MASK]}\xspace); (3) including \texttt{[MASK]}\xspace in encoder's inputs but resetting \texttt{[MASK]}\xspace token positions to the \texttt{[MASK]}\xspace token embedding $\bs{e}_{\texttt{[MASK]}\xspace}$ in decoder's inputs (enc. w. \texttt{[MASK]}\xspace, dec. resets \texttt{[MASK]}\xspace); and (4) randomly replacing \texttt{[MASK]}\xspace tokens in encoder's inputs with other real tokens sampled from the vocabulary (random replace w. real token). Comparing (2) with (1), we validate that using the additional decoder is not the main reason for the performance gain. Comparing (3) with (2), one can see that when \texttt{[MASK]}\xspace is present in the encoder, resetting the \texttt{[MASK]}\xspace token embeddings in the decoder helps. This validates our analysis in Theorem~\ref{thm:deficient} that the rank increase of \texttt{[MASK]}\xspace token representations is the main cause of representation deficiency, and preventing \texttt{[MASK]}\xspace token representations in the encoder from being explicitly trained is one way to mitigate the issue, though it is slightly worse than not including \texttt{[MASK]}\xspace in the encoder at all. Comparing (4) with (2), we demonstrate that replacing \texttt{[MASK]}\xspace tokens with random real tokens, though avoiding the representation deficiency problem, worsens the context quality in pretraining. On balance, it does not yield better results than MLM. \input{Figures/transition.tex} \textbf{Position Encoding.} MAE-LM\xspace aligns the position encoding based on each token's position in the original sequence so that the position indices of masked positions are skipped. MAE-LM\xspace also uses relative position encoding~\cite{raffel2019t5}. We create two ablations regarding choices of position encoding: (1) apply consecutive position encoding that does not reflect the masked positions (misaligned position encoding); and (2) remove the relative position encoding from MAE-LM\xspace (no relative position encoding). Overall, the variations in position encoding do not result in notable performance differences. \textbf{Decoder Attention.} MAE-LM\xspace uses bidirectional self-attention in the decoder. We compare with other decoder attention configurations: (1) additionally use cross-attention to encoder's output representations (bi. self-attention $+$ cross-attention); (2) use unidirectional self-attention and cross-attention for autoregressive decoding of the entire sequence, similar to BART~\cite{Lewis2020BARTDS} (uni. self-attention $+$ cross-attention); and (3) only use cross-attention (cross-attention). Only using bidirectional self-attention in the decoder is simple and performs better than other settings. \textbf{Decoder Size.} MAE-LM\xspace uses a $4$-layer decoder with the same dimensionality ($768$) as the encoder. We experiment with other decoder sizes (when the decoder's dimension is different from the encoder, we add a linear projection between the encoder's output and the decoder's input): (1) $2$-layer, $768$ dimension; (2) $6$-layer, $768$ dimension; (3) $4$-layer, $512$ dimension; and (4) $4$-layer, $1024$ dimension. Overall, using a relatively small decoder yields good results. \textbf{Gradual Transition from MAE-LM\xspace to Standard MLM.} To further examine the empirical benefits of excluding \texttt{[MASK]}\xspace tokens from MAE-LM\xspace's encoder, we create a set of ``stepping stones'' between MAE-LM\xspace and standard MLM as follows: Out of all \texttt{[MASK]}\xspace tokens in the sequence $\hat{\bs{x}}$, we include a fraction ($\delta$) of them in the encoder's input sequence. The rest ($1-\delta$) of \texttt{[MASK]}\xspace tokens are excluded from the encoder's input and added to the decoder's input. Then $\delta=0$ represents MAE-LM\xspace, and $\delta=1$ refers to the standard MLM\footnote{Although standard MLM does not have the decoder, the fine-tuning results of $\delta=1$ are very similar to RoBERTa (Ours).}. Figure~\ref{fig:transition} illustrates the fine-tuning performance changes on GLUE and SQuAD as we transition from MAE-LM\xspace to standard MLM. There is a clear trend that including a higher portion of \texttt{[MASK]}\xspace tokens in the encoder degrades its performance. \subsection{MAE-LM\xspace Improves Model Dimension Utilization} \input{Tables/model-dim.tex} To further validate the effectiveness of MAE-LM\xspace in improving the utilization of model dimensions for representing real tokens, we compute the $0.9$-effective rank of the encoder's token representations $\text{rank}\xspace_{0.9}(\bs{H}^L)$ after pretraining (evaluated on the validation set of the pretraining corpus) and after further fine-tuning on MNLI and SQuAD 2.0 (evaluated on their validation sets). The comparison between RoBERTa and MAE-LM\xspace is shown in Table~\ref{tab:model_dim}. Notably, MAE-LM\xspace results in a higher effective rank of real token representations than RoBERTa after pretraining, and such an advantage holds in downstream tasks after fine-tuning. This highlights the importance of addressing the representation deficiency issue in pretraining: The model dimensions used for representing \texttt{[MASK]}\xspace tokens in MLM pretraining may not be easily leveraged to model real tokens in fine-tuning as they have not been pretrained for such purposes. \section{Related Work} \textbf{Language Model Pretraining.} There have been various pretraining methods proposed for different purposes: Standard autoregressive language modeling~\cite{Brown2020LanguageMA,radford2018improving,radford2019language} is commonly used to pretrain generative models that excels in text generation; MLM~\cite{devlin2019bert,liu2019roberta} is prominently used to pretrain bidirectional text encoders to achieve superior performance for language understanding; Other language modeling objectives~\cite{Lewis2020BARTDS,raffel2019t5} are designed to build sequence-to-sequence models that serve as both text generators and text encoders. As one of the most prominent pretraining approaches, MLM has stimulated many follow-up developments for pretraining bidirectional encoders~\cite{unilmv2,clark2020electra,he2020deberta,Joshi2019SpanBERTIP,lan2019albert,meng2021coco,Meng2022PretrainingTE,Sanh2019DistilBERTAD,yang2019xlnet}. Remarkably, the idea of MLM has also proven to be highly generalizable to different domains~\cite{Bao2021BEiTBP,Dosovitskiy2020AnII,Hou2022GraphMAESM,Tong2022VideoMAEMA,Wang2022BEVTBP,Xie2022SimMIMAS} and led to developments of unified pretraining frameworks for different modalities~\cite{Baevski2022data2vecAG}. Given the broad impact of MLM, our analyses of representation deficiency in MLM may provide insights for future developments of pretraining algorithms in various fields. \textbf{Study of Pretrained Models' Representations.} The powerful language representations learned by pretrained models have driven a series of studies to understand how linguistic knowledge is captured by the Transformer encoder through pretraining. Previous work studying the token representations in pretrained encoders has found that deeper layers tend to generate more contextualized token representations~\cite{Ethayarajh2019HowCA}, and these representations encode syntax structures~\cite{Goldberg2019AssessingBS,Hewitt2019ASP} and fine-grained word senses~\cite{Coenen2019VisualizingAM}, offering supporting evidence for the effectiveness of pretrained models in downstream tasks. The success of learning such linguistic patterns is usually attributed to the multi-head self-attention mechanism which can automatically learn to extract useful features through pretraining~\cite{clark2019does}. Furthermore, different types of linguistic information are shown to be represented in a hierarchical way from shallower to deeper layers, reflecting the traditional NLP pipeline~\cite{Tenney2019BERTRT,Tenney2019WhatDY}. There have also been prior efforts that investigate the limitations of pretrained models' representations. It has been revealed that the contextualized embedding space learned by pretrained models is generally anisotropic~\cite{cai2020isotropy,Li2020OnTS} and is subject to a degeneration problem that token representations tend to be distributed into a narrow cone~\cite{Gao2019RepresentationDP}. In this work, we investigate a previously unknown issue regarding MLM-pretrained models' representations which hinders the model's expressiveness on real sequences without \texttt{[MASK]}\xspace tokens. Our findings contribute a new perspective to understanding the limitations of representations in pretrained models. \section{Discussions and Conclusion} \textbf{Discussions.} Since the advent of BERT~\cite{devlin2019bert}, there have been numerous developments in new pretraining and fine-tuning methods aiming to improve the effectiveness of pretrained models in downstream tasks. The advantages of these proposed methods, however, are mostly demonstrated via empirical evidence alone, and our understanding of why certain methods are better than the others remains limited. Our analyses in this work may advance the understanding of the benefits of some prominent methods: ELECTRA~\cite{clark2020electra} fills \texttt{[MASK]}\xspace positions with real tokens; therefore, the encoder does not suffer from the representation deficiency issue. Different from the ablation in Section~\ref{sec:ablation} where we randomly sample real tokens to fill \texttt{[MASK]}\xspace, ELECTRA employs an MLM model to sample replaced tokens which are generally plausible alternatives to the original tokens, thus better preserving the contexts in pretraining. These designs may help partially explain the effectiveness of ELECTRA. Prompt-based methods~\cite{gao2021making,Schick2021ExploitingCF} adapt pretrained MLM models to downstream tasks by creating prompt templates that convert the target task into a masked token prediction problem. This helps mitigate the representation deficiency issue that occurs in standard fine-tuning of MLM models as \texttt{[MASK]}\xspace tokens are also introduced into downstream data, resulting in more model dimensions being utilized. \textbf{Limitations and Ethical Considerations.} The focus of our work is on MLM and our analyses do not apply to other pretraining settings not using \texttt{[MASK]}\xspace tokens (\textit{e.g.}, autoregressive pretraining). Empirically, we mainly compare with models pretrained by MLM and its simple variants, while state-of-the-art models usually need to combine multiple pretraining strategies~\cite{He2021DeBERTaV3ID}. Despite their remarkable performance, pretrained models have been shown to come with risks such as exacerbating harmful biases~\cite{Bender2021OnTD,bommasani2021opportunities}. In our experiments, we follow the standard pretraining settings (\textit{e.g.}, data preparation, collection and preprocessing), and we expect more well-documented and filtered text corpora~\cite{Dodge2021DocumentingLW}, as well as future developments of harm reduction techniques~\cite{Liang2021TowardsUA} may help mitigate the ethical concerns about pretrained models. \textbf{Conclusion and Future Work.} In this work, we investigate the discrepancy caused by \texttt{[MASK]}\xspace tokens in MLM pretraining and demonstrate for the first time that this will necessarily result in real token representations being rank-deficient, thus limiting the model's expressiveness on real data without \texttt{[MASK]}\xspace. We propose a simple method MAE-LM\xspace that excludes \texttt{[MASK]}\xspace tokens from the encoder in pretraining to address the representation deficiency issue. We empirically show that MAE-LM\xspace improves the utilization of model dimensions for representing real tokens in pretraining and downstream tasks. MAE-LM\xspace consistently outperforms MLM-pretrained models on the GLUE and SQuAD benchmarks across multiple pretraining settings and model sizes. Our proposed MAE-LM\xspace method is certainly not the only solution to address the identified issue. Promising future directions may include: designing regularization methods in pretraining that prevent \texttt{[MASK]}\xspace tokens from occupying a separate representation subspace from real tokens; exploring new self-supervised objectives that do not require using artificial tokens like \texttt{[MASK]}\xspace; and removing/reducing the need for an auxiliary decoder in pretraining which does not get used in downstream tasks. \section{Detailed Proofs} \label{app:proof} \deficient* \begin{proof} We prove the statement by contradiction: We suppose that the row space of $\bs{H}_{\mathcal{R}}^l$ always contains the row space of $\bs{H}_{\mathcal{M}}^l$ in all layers $1 \le l \le L$, and we will show that under this assumption, $\bs{H}_{\mathcal{M}}^l$ will converge exponentially (with $l$) to a rank-$1$ matrix, which contradicts with Lemma~\ref{lem:rank}. We mainly analyze the rank change induced by the \emph{self-attention} mechanism since it is the source of contextualization of \texttt{[MASK]}\xspace tokens (\emph{i.e.}, the information exchange between \texttt{[MASK]}\xspace tokens and real tokens is achieved through self-attention). In the following, we assume \emph{single-head} self-attention is used, and the analysis can be easily generalized to the multi-head case. The self-attention module in the $l$th layer takes the previous layer representations $\bs{H}$ (the superscript $l-1$ is omitted for convenience) as input and derives the output representations $\bs{H}'$: $$ \bs{H}' = \text{Attn}\left(\bs{H}\bs{W}^Q, \bs{H}\bs{W}^K, \bs{H}\bs{W}^V\right) \bs{W}^O = \text{Softmax}\left( \frac{\bs{H}\bs{W}^Q \tp{\bs{W}^K}\tp{\bs{H}} }{\sqrt{d}}\right) \bs{H}\bs{W}^V \bs{W}^O = \bs{A} \bs{H}\bs{W}^{VO}, $$ where we denote the attention matrix computed from softmax as $\bs{A}$, and $\bs{W}^{VO} = \bs{W}^V \bs{W}^O$. We study how the real token representations change (\emph{i.e.}, comparing $\bs{H}_{\mathcal{R}}'$ with $\bs{H}_{\mathcal{R}}$) through the self-attention module. To facilitate easy analyses, we partition the input token representation matrix $\bs{H} \in \mathbb{R}^{(n+m) \times d}$ into blocks consisting of real token representations $\bs{H}_{\mathcal{R}} \in \mathbb{R}^{n \times d}$ and \texttt{[MASK]}\xspace token representations $\bs{H}_{\mathcal{M}} \in \mathbb{R}^{m \times d}$, and partition the attention matrix $\bs{A}_{\mathcal{R}}$ into blocks consisting of attention weights from real tokens to real tokens $\bs{A}_{\mathcal{R}:\mathcal{R}} \in \mathbb{R}^{n \times n}$ and from real tokens to \texttt{[MASK]}\xspace tokens $\bs{A}_{\mathcal{R}:\mathcal{M}} \in \mathbb{R}^{n \times m}$: $$ \bs{H} = \begin{bmatrix} \bs{H}_{\mathcal{R}} \\ \bs{H}_{\mathcal{M}} \end{bmatrix}, \quad \bs{A}_{\mathcal{R}} = \begin{bmatrix} \bs{A}_{\mathcal{R}:\mathcal{R}} & \bs{A}_{\mathcal{R}:\mathcal{M}} \end{bmatrix}. $$ We further denote $$ \bs{S}_{\mathcal{R}:\mathcal{R}} = \exp \left[ \bs{H}_{\mathcal{R}} \bs{W}^{QK} \bs{H}_{\mathcal{R}}^\top \right], \quad \bs{S}_{\mathcal{R}:\mathcal{M}} = \exp \left[ \bs{H}_{\mathcal{R}} \bs{W}^{QK} \bs{H}_{\mathcal{M}}^\top \right], \quad \bs{Z} = \text{diag}(\bs{S}_{\mathcal{R}:\mathcal{R}}\bs{1} + \bs{S}_{\mathcal{R}:\mathcal{M}}\bs{1}), $$ where $\exp [\cdot]$ denotes the element-wise exponential function, $\text{diag}(\cdot)$ constructs a diagnal matrix from a vector, $\bs{W}^{QK} = \bs{W}^Q \tp{\bs{W}^K}/\sqrt{d}$, and $\bs{1}$ is a vector of all ones. Then $$ \bs{A}_{\mathcal{R}:\mathcal{R}} = \bs{Z}^{-1} \bs{S}_{\mathcal{R}:\mathcal{R}}, \quad \bs{A}_{\mathcal{R}:\mathcal{M}} = \bs{Z}^{-1} \bs{S}_{\mathcal{R}:\mathcal{M}}. $$ Based on the above notations, the output representations at real token positions $\bs{H}'_{\mathcal{R}}$ can be written as: \begin{equation} \label{eq:self_attn} \bs{H}'_{\mathcal{R}} = \bs{A}_{\mathcal{R}} \bs{H} \bs{W}^{VO} = \begin{bmatrix} \bs{A}_{\mathcal{R}:\mathcal{R}} & \bs{A}_{\mathcal{R}:\mathcal{M}} \end{bmatrix} \begin{bmatrix} \bs{H}_{\mathcal{R}} \\ \bs{H}_{\mathcal{M}} \end{bmatrix} \bs{W}^{VO} = \bs{Z}^{-1} \left( \bs{S}_{\mathcal{R}:\mathcal{R}} \bs{H}_{\mathcal{R}} + \bs{S}_{\mathcal{R}:\mathcal{M}} \bs{H}_{\mathcal{M}} \right) \bs{W}^{VO}. \end{equation} If the row space of $\bs{H}_{\mathcal{R}}$ contains the row space of $\bs{H}_{\mathcal{M}}$, each row of $\bs{H}_{\mathcal{M}}$ can be represented as a linear combination of the rows in $\bs{H}_{\mathcal{R}}$: $$ \bs{H}_{\mathcal{M}} = \bs{U} \bs{H}_{\mathcal{R}}, $$ where $\bs{U} \in \mathbb{R}^{m \times n}$ is the linear combination weight matrix. We can rescale the vector norm of each row in $\bs{H}_{\mathcal{M}}$ so that $\bs{U}$ has a row sum of one (\emph{i.e.}, $\bs{U} \bs{1} = \bs{1}$). To examine the rank of real token representations, we adopt a similar procedure as \cite{Dong2021AttentionIN}. We define the following residual $\bs{R}$ which measures the difference between $\bs{H}_{\mathcal{R}}$ and a rank-$1$ matrix: $$ \bs{R} = \bs{H}_{\mathcal{R}} - \bs{1} \bs{h}^\top, \quad \bs{h} = \argmin_{\bs{x}} \left\| \bs{H}_{\mathcal{R}} - \bs{1} \bs{x}^\top \right\|. $$ We aim to show that the norm of $\bs{R}$ converges exponentially (with layer depth) to zero, meaning that $\bs{H}_{\mathcal{R}}$ converges (with layer depth) to a rank-$1$ matrix. By plugging $\bs{H}_{\mathcal{R}} = \bs{R} + \bs{1} \bs{h}^\top$ and $\bs{H}_{\mathcal{M}} = \bs{U} \bs{H}_{\mathcal{R}} = \bs{U} \bs{R} + \bs{U}\bs{1} \bs{h}^\top = \bs{U} \bs{R} + \bs{1} \bs{h}^\top$ into Eq.~\eqref{eq:self_attn}, we obtain \begin{align} \label{eq:H_R} \bs{H}'_{\mathcal{R}} &= \bs{Z}^{-1} \left( \bs{S}_{\mathcal{R}:\mathcal{R}} \left(\bs{R} + \bs{1} \bs{h}^\top \right) + \bs{S}_{\mathcal{R}:\mathcal{M}} \left(\bs{U}\bs{R} + \bs{1} \bs{h}^\top \right) \right) \bs{W}^{VO} \nonumber \\ &= \left( \bs{Z}^{-1} \left( \bs{S}_{\mathcal{R}:\mathcal{R}} + \bs{S}_{\mathcal{R}:\mathcal{M}} \bs{U} \right) \bs{R} + \underbrace{\bs{Z}^{-1} \left( \bs{S}_{\mathcal{R}:\mathcal{R}}\bs{1} + \bs{S}_{\mathcal{R}:\mathcal{M}}\bs{1} \right)}_{=\bs{1}} \bs{h}^\top \right) \bs{W}^{VO} \nonumber \\ &= \bs{Z}^{-1} \left( \bs{S}_{\mathcal{R}:\mathcal{R}} + \bs{S}_{\mathcal{R}:\mathcal{M}} \bs{U} \right) \bs{R} \bs{W}^{VO} + \bs{1} \bs{h}^\top \bs{W}^{VO}. \end{align} Next we write out $\bs{S}_{\mathcal{R}:\mathcal{R}}$ and $\bs{S}_{\mathcal{R}:\mathcal{M}}$: \begin{align*} \bs{S}_{\mathcal{R}:\mathcal{R}} &= \exp \left[ \bs{H}_{\mathcal{R}} \bs{W}^{QK} \bs{H}_{\mathcal{R}}^\top \right] \\ &= \exp \left[ (\bs{R} + \bs{1} \bs{h}^\top) \bs{W}^{QK} (\bs{R} + \bs{1} \bs{h}^\top)^\top \right] \\ &= \exp \left[ \bs{R} \bs{W}^{QK} \bs{R}^\top + \bs{1}\bs{h}^\top\bs{W}^{QK}\bs{R}^\top + \left(\bs{R} \bs{W}^{QK} \bs{h} + \bs{1} \bs{h}^\top \bs{W}^{QK} \bs{h} \right) \bs{1}^\top \right] \\ &= \exp \left[ \underbrace{\bs{R} \bs{W}^{QK} \bs{R}^\top}_{=\bs{F}} \right] \odot \exp \left[ \bs{1}\underbrace{\bs{h}^\top\bs{W}^{QK}\bs{R}^\top}_{=\bs{g}^\top} \right] \odot \exp \left[ \underbrace{\left(\bs{R} \bs{W}^{QK} \bs{h} + \bs{1} \bs{h}^\top \bs{W}^{QK} \bs{h} \right)}_{=\bs{c}} \bs{1}^\top \right], \end{align*} and \begin{align*} \bs{S}_{\mathcal{R}:\mathcal{M}} &= \exp \left[ \bs{H}_{\mathcal{R}} \bs{W}^{QK} \bs{H}_{\mathcal{M}}^\top \right] \\ &= \exp \left[ (\bs{R} + \bs{1} \bs{h}^\top) \bs{W}^{QK} (\bs{U} \bs{R} + \bs{1} \bs{h}^\top)^\top \right] \\ &= \exp \left[ \bs{R} \bs{W}^{QK} \bs{R}^\top \bs{U}^\top + \bs{1}\bs{h}^\top\bs{W}^{QK}\bs{R}^\top \bs{U}^\top + \left(\bs{R} \bs{W}^{QK} \bs{h} + \bs{1} \bs{h}^\top \bs{W}^{QK} \bs{h} \right) \bs{1}^\top \right] \\ &= \exp \left[ \underbrace{\bs{R} \bs{W}^{QK} \bs{R}^\top \bs{U}^\top}_{=\bs{F}'} \right] \odot \exp \left[ \bs{1} \underbrace{\bs{h}^\top\bs{W}^{QK}\bs{R}^\top \bs{U}^\top}_{=\bs{g}'^\top} \right] \odot \exp \left[ \underbrace{\left(\bs{R} \bs{W}^{QK} \bs{h} + \bs{1} \bs{h}^\top \bs{W}^{QK} \bs{h} \right)}_{=\bs{c}} \bs{1}^\top \right], \end{align*} where $\odot$ denotes the element-wise product. Let $\bs{F} = \bs{R} \bs{W}^{QK} \bs{R}^\top$, $\bs{F}' = \bs{R} \bs{W}^{QK} \bs{R}^\top \bs{U}^\top$, $\bs{g}^\top = \bs{h}^\top\bs{W}^{QK}\bs{R}^\top$, $\bs{g}'^\top = \bs{h}^\top\bs{W}^{QK}\bs{R}^\top \bs{U}^\top$, and $\bs{c} = \bs{R} \bs{W}^{QK} \bs{h} + \bs{1} \bs{h}^\top \bs{W}^{QK} \bs{h}$, we can further write out $\bs{Z}$: $$ \bs{Z} = \text{diag}\left( \bs{S}_{\mathcal{R}:\mathcal{R}}\bs{1} + \bs{S}_{\mathcal{R}:\mathcal{M}}\bs{1} \right) = \text{diag}\left( \left( \left( \exp \left[ \bs{F} \right] \odot \exp \left[ \bs{1} \bs{g}^\top \right] \right)\bs{1} + \left(\exp \left[ \bs{F}' \right] \odot \exp \left[ \bs{1} \bs{g}'^\top \right] \right)\bs{1}\right) \odot \exp \left[ \bs{c} \right]\right). $$ Let $ \widetilde{\bs{F}} = \begin{bmatrix} \bs{F} & \bs{F}' \end{bmatrix} $ be the augmented matrix by combining the columns of $\bs{F}$ and $\bs{F}'$, and let $\overline{\bs{f}}$ and $\underline{\bs{f}}$ denote the maximum and minimum element across each row of $\widetilde{\bs{F}}$, respectively: $$ \overline{f}_i = \max_j \widetilde{F}_{ij}, \quad \underline{f}_i = \min_j \widetilde{F}_{ij}. $$ Then we can derive a lower bound of each element in $\bs{Z}^{-1} \bs{S}_{\mathcal{R}:\mathcal{R}}$: \begin{align*} \left[ \bs{Z}^{-1} \bs{S}_{\mathcal{R}:\mathcal{R}} \right]_{ij} &= \frac{\exp(F_{ij}) \exp(g_{j}) \exp(c_i)}{\left(\sum_{j'} \exp(F_{ij'}) \exp(g_{j'}) + \sum_{j'} \exp(F'_{ij'}) \exp(g'_{j'})\right) \exp(c_i)}\\ &\ge \frac{\exp(F_{ij}) \exp(g_{j})}{\exp \left(\overline{f}_i\right) \left( \sum_{j'} \exp(g_{j'}) + \sum_{j'} \exp(g'_{j'}) \right)}\\ &= \exp \left(F_{ij}-\overline{f}_i \right) \frac{\exp(g_{j})}{\sum_{j'} \exp(g_{j'}) + \sum_{j'} \exp(g'_{j'})}. \end{align*} Similarly, we can derive an upper bound: $$ \left[ \bs{Z}^{-1} \bs{S}_{\mathcal{R}:\mathcal{R}} \right]_{ij} \le \exp \left(F_{ij}-\underline{f}_i \right) \frac{\exp(g_{j})}{\sum_{j'} \exp(g_{j'}) + \sum_{j'} \exp(g'_{j'})}. $$ Using the the Taylor expansion of $\exp$, we have $$ \exp \left(F_{ij}-\overline{f}_i \right) \ge 1 + F_{ij}-\overline{f}_i \ge 1 + \underline{f}_i - \overline{f}_i, \quad \exp \left(F_{ij} - \underline{f}_i \right) \le 1 + 2 \left( F_{ij} - \underline{f}_i\right) \le 1 + 2 \left( \overline{f}_i -\underline{f}_i\right). $$ Therefore, $$ (1 + \underline{f}_i - \overline{f}_i) \frac{\exp(g_{j})}{\sum_{j'} \exp(g_{j'}) + \sum_{j'} \exp(g'_{j'})} \le \left[ \bs{Z}^{-1} \bs{S}_{\mathcal{R}:\mathcal{R}} \right]_{ij} \le (1 + 2\overline{f}_i - 2\underline{f}_i) \frac{\exp(g_{j})}{\sum_{j'} \exp(g_{j'}) + \sum_{j'} \exp(g'_{j'})}. $$ Denote $\bs{D} = \text{diag}\left(\overline{\bs{f}} - \underline{\bs{f}}\right)$ and $g_{+} = \exp \left[ \bs{g}^\top \right]\bs{1} + \exp \left[ \bs{g}'^\top \right] \bs{1}$, then the above bound can be expressed in matrix form as follows (the inequality between matrices holds element-wise): \begin{equation} \label{eq:S_RR} \frac{1}{g_{+}}(\bs{I} - \bs{D}) \bs{1} \exp \left[\bs{g}^\top\right] \le \bs{Z}^{-1} \bs{S}_{\mathcal{R}:\mathcal{R}} \le \frac{1}{g_{+}} (\bs{I} + 2\bs{D}) \bs{1} \exp \left[\bs{g}^\top\right]. \end{equation} An analogous derivation gives the bound of $\bs{Z}^{-1} \bs{S}_{\mathcal{R}:\mathcal{M}}$: \begin{equation} \label{eq:S_RM} \frac{1}{g_{+}}(\bs{I} - \bs{D}) \bs{1} \exp \left[\bs{g}'^\top\right] \le \bs{Z}^{-1} \bs{S}_{\mathcal{R}:\mathcal{M}} \le \frac{1}{g_{+}} (\bs{I} + 2\bs{D}) \bs{1} \exp \left[\bs{g}'^\top\right]. \end{equation} Since the upper and lower bounds are in very similar forms, we will only focus on the upper bound in the derivations below. Combining Eq.~\eqref{eq:S_RR} with Eq.~\eqref{eq:S_RM}, we have \begin{align} \label{eq:ineq} \bs{Z}^{-1} \left( \bs{S}_{\mathcal{R}:\mathcal{R}} + \bs{S}_{\mathcal{R}:\mathcal{M}} \bs{U} \right) &\le \bs{1} \left(\underbrace{ \frac{\exp \left[\bs{g}^\top\right] + \exp \left[\bs{g}'^\top\right]\bs{U}}{g_{+}}}_{=\bs{r}^\top} \right) + 2\bs{D} \bs{1} \left(\underbrace{ \frac{\exp \left[\bs{g}^\top\right] + \exp \left[\bs{g}'^\top\right] \bs{U}}{g_{+}}}_{=\bs{r}^\top} \right) \nonumber \\ &= \bs{1} \bs{r}^\top + 2\bs{D} \bs{1} \bs{r}^\top \end{align} Plugging Eq.~\eqref{eq:ineq} into Eq.~\eqref{eq:H_R}, we have $$ \bs{H}'_{\mathcal{R}} \le \left(\bs{1} \bs{r}^\top + 2\bs{D} \bs{1} \bs{r}^\top \right) \bs{R} \bs{W}^{VO} + \bs{1} \bs{h}^\top \bs{W}^{VO} = \bs{1} \left( \underbrace{\bs{r}^\top\bs{R} \bs{W}^{VO} + \bs{h}^\top \bs{W}^{VO}}_{=\bs{h}'^\top} \right) + 2\bs{D} \bs{1} \bs{r}^\top \bs{R} \bs{W}^{VO}. $$ Therefore, $$ \bs{H}'_{\mathcal{R}} - \bs{1}\bs{h}'^\top \le 2\bs{D} \bs{1} \bs{r}^\top \bs{R} \bs{W}^{VO}. $$ With a similar derivation, we have the following lower bound: $$ \bs{H}'_{\mathcal{R}} - \bs{1}\bs{h}'^\top \ge -\bs{D} \bs{1} \bs{r}^\top \bs{R} \bs{W}^{VO}. $$ Overall, we can bound the element-wise absolute values of $\bs{R}' = \bs{H}'_{\mathcal{R}} - \bs{1}\bs{h}'^\top$, which measure the distance between $\bs{H}'_{\mathcal{R}}$ and a rank-$1$ matrix: $$ \left| R'_{ij} \right| = \left|\left[ \bs{H}'_{\mathcal{R}} - \bs{1}\bs{h}'^\top \right]_{ij} \right| \le \left| \left[2\bs{D} \bs{1} \bs{r}^\top \bs{R} \bs{W}^{VO}\right]_{ij} \right|. $$ This allows us to further bound the norm of $\bs{R}'$. For $\ell_1$ norm, we have \begin{align*} \left\| \bs{R}' \right\|_{1} &\le \left\| 2\bs{D} \bs{1} \bs{r}^\top \bs{R} \bs{W}^{VO} \right\|_{1} \\ &\le 2 \left\| \bs{D} \bs{1} \right\|_{\infty} \left\| \bs{r}^\top \bs{R} \bs{W}^{VO} \right\|_1 & \text{Based on H\"older's inequality} \\ &\le 2 \left\| \bs{D} \bs{1} \right\|_{\infty} \left\| \bs{r}^\top \right\|_{1} \left\| \bs{R} \right\|_1 \left\| \bs{W}^{VO} \right\|_1, & \text{Submultiplicativity of matrix norms} \\ \end{align*} where \begin{align*} \left\| \bs{D} \bs{1} \right\|_{\infty} &= \max_{i} \left| \overline{f}_i - \underline{f}_i \right| \\ &\le 2 \left\| \widetilde{\bs{F}} \right\|_{1} \\ &\le 2 \max \left\{ \left\| \bs{R} \bs{W}^{QK} \bs{R}^\top \right\|_{1}, \left\| \bs{R} \bs{W}^{QK} \bs{R}^\top \bs{U}^\top \right\|_{1} \right\} \\ &\le 2 \left\| \bs{R} \right\|_1 \left\| \bs{W}^{QK} \right\|_1 \left\| \bs{R} \right\|_{\infty} \max \left\{ 1, \left\| \bs{U} \right\|_{\infty} \right\} \\ &\le 2 \left\| \bs{R} \right\|_1 \left\| \bs{W}^{QK} \right\|_1 \left\| \bs{R} \right\|_{\infty} \left\| \bs{U} \right\|_{\infty}, & \text{$\left\| \bs{U} \right\|_{\infty} \ge 1$ since $\bs{U} \bs{1} = \bs{1}$} \end{align*} and \begin{align*} \left\| \bs{r}^\top \right\|_{1} &\le \left\| \bs{r}^\top \right\|_{\infty} \\ &= \left\| \frac{\exp \left[\bs{g}^\top\right] + \exp \left[\bs{g}'^\top\right] \bs{U}}{g_{+}} \right\|_{\infty} \\ &\le \left\| \frac{\exp \left[\bs{g}^\top\right]}{g_{+}} \right\|_{\infty} + \left\| \frac{\exp \left[\bs{g}'^\top\right] \bs{U}}{g_{+}}\right\|_{\infty}\\ &\le 1 + \left\| \bs{U} \right\|_{\infty}. \end{align*} Therefore, we can bound the $\ell_1$ norm of $\left\| \bs{R}' \right\|_{1}$ as follows: \begin{equation} \label{eq:l1_bound} \left\| \bs{R}' \right\|_{1} \le 4 \left\| \bs{W}^{QK} \right\|_1 \left\| \bs{W}^{VO} \right\|_1 \left\| \bs{U} \right\|_{\infty} \left( 1 + \left\| \bs{U} \right\|_{\infty} \right) \left\| \bs{R} \right\|_1^2 \left\| \bs{R} \right\|_{\infty}. \end{equation} Similarly, we can obtain the bound for the $\ell_{\infty}$ norm of $\left\| \bs{R}' \right\|_{1}$: \begin{equation} \label{eq:linf_bound} \left\| \bs{R}' \right\|_{\infty} \le 4 \left\| \bs{W}^{QK} \right\|_1 \left\| \bs{W}^{VO} \right\|_{\infty} \left\| \bs{U} \right\|_{\infty} \left( 1 + \left\| \bs{U} \right\|_{\infty} \right) \left\| \bs{R} \right\|_1 \left\| \bs{R} \right\|_{\infty}^2. \end{equation} Denote the geometric mean of $\left\| \bs{R} \right\|_{1}$ and $\left\| \bs{R} \right\|_{\infty}$ as $\left\| \bs{R} \right\|_{1,\infty} = \sqrt{\left\| \bs{R} \right\|_{1}\left\| \bs{R} \right\|_{\infty}}$, then from Eq.~\eqref{eq:l1_bound} and Eq.~\eqref{eq:linf_bound}, we have \begin{align*} \left\| \bs{R}' \right\|_{1,\infty} &\le 4 \underbrace{\left\| \bs{W}^{QK} \right\|_1 \left\| \bs{W}^{VO} \right\|_{1,\infty} \left\| \bs{U} \right\|_{\infty} \left( 1 + \left\| \bs{U} \right\|_{\infty} \right)}_{=\epsilon} \left\| \bs{R} \right\|_{1,\infty}^3 \\ &= 4 \epsilon \left\| \bs{R} \right\|_{1,\infty}^3. \end{align*} The above inequality reflects how the residual changes within one self-attention layer. Applying it recursively throughout all layers in an $L$-layer encoder, we have: $$ \left\| \bs{R}^L \right\|_{1,\infty} \le \left(4 \overline{\epsilon} \right)^{\frac{3^L-1}{2}} \left\| \bs{R}^0 \right\|_{1,\infty}^{3^L}, \quad \overline{\epsilon} = \max_{l} \epsilon^{l}, $$ where $\bs{R}^L$ and $\bs{R}^0$ denote the residuals corresponding to the encoder's output real token representations $\bs{H}_{\mathcal{R}}^L$ and input real token representations $\bs{H}_{\mathcal{R}}^0$, respectively. This demonstrates that the residual norms of real token representations converge exponentially (with layer depth) to zero. Hence, the real token representation matrix $\bs{H}_{\mathcal{R}}^l$ converges exponentially (with layer depth) to a rank-$1$ matrix. Since the row space of \texttt{[MASK]}\xspace token representations $\bs{H}_{\mathcal{M}}^l$ is contained by the row space of $\bs{H}_{\mathcal{R}}^l$, we have $\text{rank}\xspace(\bs{H}^l_{\mathcal{M}}) \le \text{rank}\xspace(\bs{H}^l_{\mathcal{R}})$, and $\bs{H}^l_{\mathcal{M}}$ will also converge exponentially (with layer depth) to a rank-$1$ matrix, which contradicts with Lemma~\ref{lem:rank}. Finally, we conclude that the row space of $\bs{H}_{\mathcal{R}}^l$ must not contain the row space of $\bs{H}_{\mathcal{M}}^l$, which necessarily implies that $\bs{H}_{\mathcal{R}}^l$ is rank-deficient. \end{proof} \section{Details about GLUE Tasks} \label{app:glue} More details of all the GLUE tasks can be found as follows. \textbf{MNLI:} The Multi-genre Natural Language Inference~\cite{MNLI} task includes $393$K training examples from crowdsourcing. The goal is to predict if a premise sentence entails, contradicts, or is neutral with respect to a given hypothesis sentence. \textbf{QQP:} Question Pairs~\cite{QQP} includes $364$K training examples from the Quora question-answering website. The task is to determine if two given questions are semantically equivalent. \textbf{QNLI:} Question Natural Language Inference includes $108$K training examples derived from the Stanford Question Answering Dataset (SQuAD)~\cite{rajpurkar2016squad}. The task is to predict if a sentence contains the answer to a given question. \textbf{SST-2:} Stanford Sentiment Treebank~\cite{SST-2} includes $67$K training examples on movie reviews with human annotations. The task is to determine if a given sentence has positive or negative sentiment. \textbf{CoLA:} Corpus of Linguistic Acceptability~\cite{COLA} includes $8.5$K training examples from books and journal articles on linguistic theory. The task is to determine if a given sentence is linguistically acceptable. \textbf{RTE:} Recognizing Textual Entailment~\cite{RTE-5,RTE-1,RTE-2,RTE-3} includes $2.5$K training examples from textual entailment challenges. The task is to predict if a premise sentence entails a given hypothesis sentence. \textbf{MRPC:} Microsoft Research Paraphrase Corpus~\cite{MRPC} includes $3.7$K training examples collected from news sources. The task is to predict if two given sentences are semantically equivalent. \textbf{STS-B:} Semantic Textual Similarity~\cite{STS-B} includes $5.8$K training examples collected from multiple sources on sentence pair semantic similarity annotated by humans. The task is to predict the semantic similarity of two sentences (based on a $1$ to $5$ scoring scale). \section{Implementation Details} \label{app:implementation} \textbf{Computation Environment.} The experiments in this paper are conducted on $64$ A100 GPUs. \textbf{Masking.} For all pretraining settings, we apply $15\%$ random masks to input sequeces. We do not use the trick in conventional MLM~\cite{devlin2019bert,liu2019roberta} that replaces $10\%$ of \texttt{[MASK]}\xspace tokens with the original ones and another $10\%$ with random tokens. We also experiment with higher masking rates (\textit{e.g.}, $40\%$) which are shown to be beneficial in \cite{Wettig2022ShouldYM} for training large models, but they do not yield better results than the default $15\%$ masking rate in our experiments. This is probably because \cite{Wettig2022ShouldYM} use an efficient pretraining recipe that is different from the standard pretraining setup, with a larger learning rate, a larger batch size, a shorter sequence length, and fewer training steps. \textbf{Position Embedding.} We learn both absolute and relative position embeddings~\cite{raffel2019t5} in the encoder, and only learn absolute position embeddings in the decoder. \textbf{Dropout.} During the pretraining of MAE-LM\xspace, dropout is applied to the encoder but not the decoder, which we find to slightly improve stability. \section{Hyperparameter Settings} \label{app:hyper} We report the detailed hyperparameters used for pretraining in Table~\ref{tab:hp_pretrain}. The hyperparameter search ranges of fine-tuning are shown in Tables~\ref{tab:hp_finetune_glue} and \ref{tab:hp_finetune_squad} for GLUE and SQuAD 2.0, respectively. For fair comparisons, the same set of hyperparameters (in both pretraining and fine-tuning) is used for MAE-LM\xspace, RoBERTa (Ours) and ablations. We follow previous pretraining studies~\cite{liu2019roberta} to report the medians of downstream task fine-tuning results under the same set of five different random seeds. \include{Tables/hyper} \subsection{Theorems and such} \balance
\section{Introduction}\label{intro} Deep Neural Networks (DNNs) have obtained great progress in the field of natural language processing (NLP) but are vulnerable to adversarial attacks, leading to security and safety concerns, and research on defense algorithms against such attacks is urgently needed. Specifically, the most common attack for NLP is word-level attack \citep{wang2019towards,garg2020bae,zang2020word,li2021contextualized}, which is usually implemented by adding, deleting or substituting words within a sentence. Such an attack often brings catastrophic performance degradation to DNN-based models. Therefore, we choose to study defending against word-level attacks\footnote{Through the rest of the paper, text attack specifically refers to word-level text attacks.} in this paper. Although a number of defense methods can be found in the literature of NLP \citep{jia2019certified,ko2019popqorn,jones2020robust,wang2020infobert,zhou2020defense,dong2021towards,bao2021defending}, there are remaining several unsolved research problems. One problem lies in the ineffective application of the existing detection-based defense paradigm to the adversarial defense scenario, which consists of two steps: adversarial detection that detects whether an input sentence is adversarial or not, and a model prediction that predicts a label for the input. Notice that the model prediction is usually specific for a practical application, e.g., different text classification tasks used in this paper. However, the detection-based defense paradigm only focuses on adversarial detection and does not make efforts to adversarial sentence prediction. That is, even if adversarial detection can successfully detect adversarial sentences, correctly predicting such adversaries remains incapable. Considering that an adversarial sentence is usually generated through adding an imperceptible perturbation into a benign sentence, we believe a practical defense paradigm should have another operation, a correction that transforms the adversarial sentence into the benign sentence as much as possible, and then use the corrected adversarial sentence for the model prediction. Therefore, considering the paradigm problem, we propose a detection-correction defense method in this paper. Another problem is that most existing defense methods rely either on word frequency or on prediction logits to detect adversarial sentences \citep{mozes2021frequency,mosca2022suspicious}. One may wonder whether any other information can be leveraged for adversarial detection. In this paper, we discover that the mechanism of text attack is related to saliency, a measure used in the explainability of DNNs \citep{simonyan2013deep}. Based on such discovery, we propose the saliency-based detector to enhance adversarial detection. Overall, to address the two issues, in this paper, we build our TextShield, a defense method consisting of a detector and a corrector. Motivated by the link between adversarial sentence and saliency, we define a metric called adaptive word importance (AWI) based on saliency computation \citep{simonyan2013deep}, and then design the detector and corrector based on AWI. Specifically, the detector combines four saliency-based sub-detectors to inform whether an input sentence is adversarial, where the four sub-detector utilize four saliency computation methods \citep{simonyan2013deep, springenberg2015striving,bach2015pixel,sundararajan2017axiomatic} to calculate AWI, respectively. Then, if the detector recognizes the input as adversarial, the corrector rectifies the words with high adversarial probabilities in the sentence by their high-frequency synonyms, where the adversarial probability is determined by AWI. Finally, the corrected sentence is used for model prediction. Our extensive experiments demonstrate that TextShield can effectively defend against adversarial attacks on several text classification benchmarks. Our main contribution are listed as follows: \begin{itemize} \item We design a defense method, TextShield, which extends the existing detection-based defense paradigm to the detection-correction paradigm. The incorporation of a corrector in TextShield can resolve the model prediction incapability problem in detection-based defense. \item We discover another word-level information for detecting adversarial sentences, saliency, and then design a detector based on adaptive word importance (AWI), a novel metric based on saliency computation. Furthermore, AWI is also used to design the corrector. \item Comprehensive experiments demonstrate that our TextShield performs comparably or better than SoTA defense methods under various victim classifiers on several text classification benchmarks. \end{itemize} \section{Related Work}\label{sec:sec2} In recent years, many adversarial attack methods have been proposed for NLP, different from backdoor attacks \cite{chen2017targeted,liu2017neural,wang2019neural,li2020backdoor,shen2022rethink}, adversarial attacks try to modify the text data while making them less perceptible by humans. Coarsely, these attacks modifies the text data at character level \citep{belinkov2018synthetic,eger2019text,he2021model}, word level \citep{alzantot2018generating,zhang2021crafting,wang2022semattack} or sentence level \citep{jia2017adversarial,ribeiro2018semantically,zhang2019paws,lin2021using}. Since word-level text attack is the most common and effective attack for text classification, in this paper, we focus on defense methods against word-level text attacks, which can be categorized into three paradigms: (1) model-enhancement-based, (2) certified-robustness-based, and (3) detection-based. Model enhancement is a common way to improve model's robustness against text attacks, and one popular way is adversarial training which re-trains a victim model with extra adversarial examples to obtain an enhanced model. \citet{alzantot2018generating,ren2019generating} generated adversarial examples by an attack method and re-trained models more robust against the attack. More successful defense based on model enhancement can be regarded as synonym encoding \citep{le2021sweet,dong2021towards,wang2021natural}, a series of methods defend text attacks through setting the same embedding for different synonyms. Unfortunately, the robustness of re-trained models is often determined by the diversity of adversarial examples used in re-training \citep{shen2022katg}. As a result, adversarial training is vulnerable to unknown attacks. Besides, a stream of recent popular defense methods \citep{huang2019achieving,jia2019certified} concentrates on certified robustness, which ensures models are robust to all potential word perturbations within the constraints. However, because of the extreme time cost in the training stage, certified robustness is {more} difficult to be applied to complex models {compared to other paradigms of defenses}. For example, IBP \citep{jia2019certified} performed catastrophically on large pre-trained language models. Recently, some excellent works have designed detection-based defense methods. For example, \citet{mozes2021frequency} used the word frequency difference to design detectors; \citet{le2021sweet} designed a detector specific for the `Universal trigger'; \citet{mosca2022suspicious} proposed a detection method by leveraging prediction logits. Despite their success, such detection-based defense methods own a key issue: the incapability of correctly classifying adversarial sentences. An intuitive and straightforward idea is to design a corrector to convert adversarial sentences to their original benign ones, which has proved effective in the the field of computer vision (CV) \citep{liu2019detection,qin2019detecting,li2020connecting,deng2021libre}. However, the different essence between languages and pixels makes correctors used in CV not transferable in NLP. In this paper, based on the generation mechanism of adversarial sentences, we design a proper detector and corrector for text attacks. \section{Background} In this section, we present basic definitions used in adversarial text attack and saliency computation. \paragraph{Adversarial text attack} In a text classification scenario, $X =\{w_{1}, \dots, w_{d}\}$ is a sentence with $d$ words, and $\mathbf{w}_{1}, \dots, \mathbf{w}_{d}$ are the corresponding embeddings. Given a text classifier $F$, $F(X)$ denotes the probability distribution over the class set $\mathcal{Y}$ for input sentence $X$. Then, class $y_j$ with the largest probability in $F(X)$ is selected as the prediction of $X$. Furthermore, in a word-level text attack for a text classification scenario, there is a \emph{victim classifier} $F$ and a \emph{text attack} $G$. \begin{itemize} \item Victim Classifier: Given a set of benign sentences in a text classification benchmark, the victim classifier $F$ can be trained with the benign sentences, where the sentence encoder is usually selected as TextCNN \citep{kim2014convolutional}, LSTM \citep{hochreiter1997long} or BERT \citep{devlin2019bert}. \item Text Attack: For a benign sentence $X$ with true label $y_j$, the text attack $G$ generates an adversarial sentence ${X}^{*}=G\left({X}\right)$ by substituting words $w_{i}$ in $X$ with $w_{i}^{*}$, satisfying: (1) $F({X}^{*})$ and $F({X})$ output different predicted labels; (2) ${Dist}\left(\mathbf{w}_{i}, \mathbf{w}_{i}^{*}\right)<\delta$, where ${Dist}(\cdot, \cdot)$ is a distance metric and $\delta$ is a threshold to limit the distance. \end{itemize} \paragraph{\textbf{Saliency computation}} In the field of explainability of DNNs, \emph{saliency map} is a common technique to identify input features that are most salient. In other words, these input features cause a maximum influence on the model's output. Specifically, \emph{saliency} is a measure that quantifies the sensitivity of an output class for an input feature in a DNN-based model, and a saliency map is a transparent colored heatmap overlaid on the input features. Furthermore, back-propagation-based methods, which have been widely used to compute saliency in the explainability of DNNs, treat saliency as the gradient of a DNN-based model. There are different ways to calculate gradients based on gradient signals passed from output to input during model training, which leads to different saliency computation methods. For example, in the vanilla gradient (VG) method \citep{simonyan2013deep}, saliency is directly defined as the partial derivative of the network output concerning each input feature scaled by its value. Formally, given a classifier $F$ and a sentence $X$ containing words $w_{i}$, the saliency of $w_{i}$ to prediction $y_{j}$ is defined as follows: \begin{equation}\label{1} {r}_{ij}=\frac{\partial F_{y_{j}}(X)}{\partial w_{i}} \end{equation} where $F_{y_{j}}(X)$ is the prediction confidence for $y_{j}$ when applying $F$ on $X$. \section{Motivation and Intuition} This section illustrates intuitions that motivate us to design TextShield. Firstly, we present our basic derivations to show a cross-cutting connection between adversarial robustness and saliency. Then, we define adaptive word importance (AWI), a metric that helps us to detect adversarial sentences. \subsection{The connection between adversarial robustness and saliency} \label{sec:sec21} In this part, we explain why saliency is highly related to adversarial robustness, indicating there is a connection between adversarial robustness and saliency. Given a victim classifier $F$ and a benign sentence $X$ with label $y_j$ predicted by $F$, the objective of a text attack that generates an adversarial sentence ${X}^{*}$ with a wrong predicted label (namely $y_k$) is defined as follows: \begin{equation}\label{eq2} {\arg \min } \mathcal{L}\left(F_{y_{j}}\left({X}^{*}\right), y_k\right) \end{equation} where $\mathcal{L}$ is a loss function (e.g., cross-entropy loss). In a vanilla gradient-based attack \citep{goodfellow2014explaining}, Eq~\ref{eq2} is optimized by a gradient descent method. Specifically, in each iteration of the attack, word $w_{i}$ is substituted with a word whose embedding is closest to $\mathbf{w_{i}}$. In other words, word embedding $\mathbf{w_{i}}$ is perturbed with a step rate $r_{1}$ by the attack, which is defined as follows: \begin{equation} w_{i}^{'}=w_{i}-r_{1} \frac{\partial \mathcal{L}(F_{y_{j}}({X}), y_k)}{\partial w_{i}} \end{equation} In ease of clarification, we regard the word embeddings as continuous variables. Then, based on Eq~\ref{1}, we can further derive the term $w_{i}-r_{1} \frac{\partial \mathcal{L}(F_{y_{j}}({X}), y_k)}{\partial w_{i}}$ , and rewrite it as follows: \begin{equation}\label{4} w_{i}-r_{1} \frac{\partial \mathcal{L}(F_{y_{j}}(X), y_k)}{\partial F_{y_{j}}(X)} \cdot |r_{ij}| \end{equation} As shown in Eq~\ref{4}, words with larger $|r_{ij}|$ are perturbed more severely by the attack, indicating that saliency $|r_{ij}|$ may serve as a key for adversary detection. \subsection{Adaptive word importance} \label{1214} Inspired from previous analysis and finding, we design a novel metric called adaptive word importance (AWI) based on saliency. \begin{definition} Given sentence $X$ with label $y_{j}$ predicted by text classifier $F$, the adaptive word importance (AWI) of word $w_{i}$ in the sentence, $R_{ij}$, is defined as follows: \begin{equation} R_{ij} = |\Delta (F,w_{i},y_{j})| \end{equation} $\Delta$ is a saliency computation method, e.g., VG. \end{definition} Given sentence $X$, the $(i, j)$-th element $R_{ij}$ reflects the importance of word $w_{i}$ towards prediction $y_{j}$ in victim classifier $F$. Thus, AWI can reflect the importance of a word, and a larger AWI value indicates higher importance. \section{TextShield} \subsection{Overview}\label{sec:sec32} Based on previous analysis, we present TextShield, \emph{which is like a shield in front of the victim classifier}, as shown in Figure~\ref{fig1}. Generally, TextShield has two principal components: a detector and a corrector. The detector is a learning-based binary classifier that takes a sentence as input and outputs whether the input is adversarial or not. The corrector continues to correct adversarial sentences to benign ones, which makes up the blank of previous detection-based defense methods. \begin{figure}[h] \centering \includegraphics[scale=0.15]{qq1.png} \caption{The overview of TextShield. During inference, a sentence $X$ is firstly fed to the classifier $F$. Then the detector judges whether $X$ is adversarial. If not, $F(X)$ will be the final prediction. On the contrary, $X$ will be transformed to $X'$ by a corrector, and the final prediction for $X$ is $F(X')$.} \label{fig1} \end{figure} Specifically, given an input sentence $X$, $X$ is fed to the victim classifier $F$ to get prediction $y_{j}$. Then the detector is used to judge whether $X$ is adversarial based on prediction $y_{j}$. If $X$ is benign, the final prediction for $X$ will be $y_{j}$ (i.e., $F(X)$). Otherwise, a corrector is used to transform $X$ to $X'$, and the final prediction for $X$ will be $F(X')$. \begin{figure*}[t] \centering \includegraphics[scale=0.17]{qq.png} \caption{The overview of the detector. The detection can be summarized into three stages: (\uppercase\expandafter{\romannumeral1}): AWI matrices are generated by specific saliency computation methods based on $F(X)$ and the classifier $F$. (\uppercase\expandafter{\romannumeral2}): AWI matrices are fed to LSTMs to obtain predictions, e.g., $z^{(V G)}$, $z^{(G B P)}$, $z^{(L R P)}$ and $z^{(I G)}$. (\uppercase\expandafter{\romannumeral3}): The predictions are fed to a combiner (a linear layer) to produce a final prediction $z$.} \label{fig2} \end{figure*} \subsection{Detector}\label{sec:sec3} As shown in Figure~\ref{fig2}, the detector consists of four sub-detectors and one combiner. A sub-detector is a binary classifier that utilizes a saliency computation method and a LSTM layer to predict whether input sentence $X$ is adversarial or not. In this paper, four saliency computation methods, vanilla gradient (VG), guided backpropagation (GBP), layerwise relevance propagation (LRP), and integration gradient (IG), are chosen, which correspond to the four sub-detectors, respectively. Then, the combiner uses a linear layer to combine four predictions from the four sub-detectors, respectively. Specifically, for a sub-detector based on a saliency computation method $\mathcal{I}$, given an input sentence $X$, one AWI matrix is calculated for $X$ using $\mathcal{I}$, and then the AWI matrix is fed to an LSTM to obtain a prediction. Takings VG as an example, the VG-based sub-detector is calculated as follows. \begin{equation} z^{(V G)}=\mathrm{LSTM}_{1}\left(\mathcal{R}_{\cdot j}^{(V G)}\right) \end{equation} where $\mathcal{R}_{\cdot j}$ is a column of AWI matrix $\mathcal{R}$, and $z^{(V G)}$ is a binary prediction from VG-based sub-detector. Similarly, $z^{(G B P)}$, $z^{(L R P)}$ and $z^{(I G)}$ are predictions from GBP-based, LRP-based, and IG-based sub-detectors, respectively. Finally, through a linear combiner, the four binary predictions are combined to give the prediction $z$: \begin{equation}\footnotesize z = argmax(\operatorname{L}([z^{(V G)},z^{(G B P)},z^{(L R P)},z^{(I G)}])) \nonumber \end{equation} where $\operatorname{L}$ is the linear layer and $z$ is the label reflecting whether $X$ is adversarial. In the following section, we will present the four saliency computation methods and then give the details of the detector's training. \paragraph{Vanilla Gradient (VG)} For text classifier $F$, the AWI value of word $w_{i}$ in sentence $X$ to prediction $y_{j}$ is calculated by the vanilla gradient method \citep{simonyan2013deep} as follows: \begin{equation} {\mathcal{R}}_{ij}^{(V G)}=\frac{\partial F_{y_{j}}(X)}{\partial \mathbf{w_{i}} } \end{equation} where ${\mathcal{R}}_{ij}^{(V G)}$, the $(i, j)$-th element of AWI matrix ${\mathcal{R}}^{(V G)}$, is the AWI value of word $w_{i}$ to prediction $y_{j}$, $F_{y_{j}}$ is the prediction confidence for $y_{j}$ from $F$, and $\mathbf{w_{i}}$ is the word embedding for word $w_{i}$. In fact, when calculating ${\mathcal{R}}_{ij}^{(V G)}$, $F_{y_{j}}$ is a scalar and $\mathbf{w_{i}} \in \mathbb{R}^{1 \times k }$ is a vector, where $k$ is the dimension of the word embedding. Thus, ${\frac{\partial F_{y_{j}}(X)}{\partial \mathbf{w_{i}}}}$ is a vector with the form $\mathbb{R}^{1 \times k }$, and an average operation is made to obtain ${\mathcal{R}}_{ij}^{(V G)}$. For brevity, we omit the operation in the paper. \paragraph{Guided Backpropagation (GBP)} Following the idea of the vanilla gradient, GBP \citep{springenberg2015striving} chooses only `positive' $(>0)$ gradients and discards `negative' $(<0)$ gradients. Positive gradients indicate supporting the prediction, while negative ones mean the opposite. Such a choice enables us to capture what text classifier $F$ learns and yet discard anything that $F$ does not learn. We take the final outputs of GBP as AWI matrix $\mathcal{R}^{GBP}$. \paragraph{Layerwise Relevance Propagation (LRP)} GBP owns an obvious drawback called gradient saturation \citep{bach2015pixel,binder2016layer} that gradients computed by GBP are always zeros under some cases. Therefore, Layerwise Relevance Propagation (LRP) \citep{bach2015pixel} is proposed, which tackles the problem using a reference input besides the target input to calculate gradients. The LRP method calculates a weight for each connection in the gradient chain and uses a reference input instead of roughly setting the weights as $0$ or $1$ like GBP. The reference input is a `neutral' input and will be different in different tasks (e.g., blank images in the CV field or zero embeddings in the NLP field). Finally, such gradients compose AWI matrix $\mathcal{R}^{LRP}$. \paragraph{Integrated Gradient (IG)} LRP is calculating discrete gradients. However, the chain rule does not hold for discrete gradients so that LRP has essential drawbacks. Thus, the integrated gradient (IG) \citep{sundararajan2017axiomatic} is proposed, which calculates the influence of word $w_{i}$ to prediction $y_{j}$ by integrating vanilla gradient, which is defined as follows: \begin{equation}\tiny \mathcal{R}_{ij}^{(I G)}=\left(\mathbf{w_{i}}-\mathbf{w_{i}}^{\prime}\right) \times \int_{0}^{1} \frac{\partial F_{y_{j}}\left(X,\mathbf{w_{i}}^{\prime}+\alpha\left(\mathbf{w_{i}}-\mathbf{w_{i}}^{\prime}\right)\right)}{\partial \mathbf{w_{i}}} \mathrm{~d} \alpha \end{equation} where $\mathbf{w_{i}^{\prime}}$ is a zero embedding and $F_{y_{j}}(X,\mathbf{w_{i}}^{\prime}+\alpha(\mathbf{w_{i}}-\mathbf{w_{i}}^{\prime})$ means that the embedding of word $w_{i}$, $\mathbf{w_{i}}$, is replaced with $\mathbf{w_{i}}^{\prime}+\alpha(\mathbf{w_{i}}-\mathbf{w_{i}}^{\prime})$. The final outputs of IG is AWI matrix $\mathcal{R}^{IG}$. \paragraph{Training of detector} Generally, training the detector consists of the following three steps, where both the adversarial data setup and the balanced data setup prepare data for the model's training. More training details are deferred to Appendix~\ref{app0}. \begin{itemize} \item \textbf{Adversarial data setup}: Given benign data, the victim classifier $F$ is fine-tuned by the data. Then the adversarial attacks are used to generate adversarial sentences and 2,000 adversarial sentences per class that successfully attacks are selected. Moreover, the adversarial sentences are equally generated by attacks.\footnote{\textbf{We do not train detector with the attack for evaluation. For example, if we evaluate the defense capacity against GA, then it is trained with IGA, PWWS, and TextFooler.}} \item \textbf{Balanced data setup}: The adversarial data and the same-size benign data are mixed as balanced data. Then, the balanced data is split into train-dev-test sets with a 7:2:1 proportion. \item \textbf{Model training}: The training data set is fed to train the detector, and the best-performance checkpoint is selected according to performance on the dev data set. \end{itemize} \subsection{Corrector}\label{sec:sec36} As mentioned in Sec~\ref{sec:sec32}, if the detector recognizes the input sentence $X$ as an adversarial one, then the prediction $y_{j}$ for $X$ is possibly inaccurate. Furthermore, as discussed in Sec~\ref{sec:sec21}, given an AWI matrix $\mathcal{R}$, larger $\mathcal{R}_{ij}$ means word $w_{i}$ is more important for classifying the sentence as $y_{j}$. In other words, words with large AWI values are more likely to be perturbed by attacks to fool the victim classifier. Therefore, the corrector corrects the words with large AWI values in the adversarial sentence. In addition, the corrector chooses $\mathcal{R}_{ij}^{VG}$ as $\mathcal{R}_{ij}$. Specifically, for an adversarial sentence $X^{*}$ with prediction $y_{j}$, the corrector regards a word $w_{i}$ as a suspect when its $\mathcal{R}_{ij}$ exceeds a threshold, which is defined as follows: \begin{equation} \mathcal{R}_{i j}>\beta \cdot\left(\mathcal{R}_{\max }-\mathcal{R}_{\min }\right)+\mathcal{R}_{\min } \end{equation} where $\mathcal{R}_{\max }$ and $\mathcal{R}_{\min }$ are the largest and smallest values in $\mathcal{R}$, and $\beta$ is a hyper-parameter to control the ratio of suspects. For a suspect $w_{i}$, the corrector substitutes $w_{i}$ with the most frequent word $w^{\prime} \in \mathcal{S}(w_{i})$, where $\mathcal{S}(w_{i})$ is $w_{i}$'s synonyms, extracted by NLTK \citep{loper2002nltk}. \section{Experiments on adversarial defense}\label{sec:sec4} In this section, we conduct comprehensive experiments to compare TextShield to baselines. \subsection{Experimental settings} Firstly, we use \textbf{TextCNN} \citep{kim2014convolutional}, \textbf{LSTM} \citep{hochreiter1997long} and \textbf{BERT} \citep{devlin2019bert} as victim classifiers, and select four widely-used text attacks in the NLP field: \textbf{TL} (TextFooler, \citep{kuleshov2018adversarial}), \textbf{PWWS} (Probability Weighted Word Saliency, \citealp{ren2019generating}) , \textbf{GA} (Genetic Algorithm, \citealp{alzantot2018generating}) and \textbf{IGA} (Improved Genetic Algorithm, \citealp{wang2019natural}). Moreover, we choose three popular benchmarks in text classification: \textbf{IMDB} \citep{potts2010negativity}, \textbf{AG’s News} \citep{zhang2015character} and \textbf{Yahoo! Answers} \citep{zhang2015character}. Then, given a victim classifier, an attack and a benchmark, we generate test data consisting of a benign dataset and an adversarial dataset, which are used to evaluate the generalization and robustness of defense methods. Specifically, the benign dataset includes 1,000 benign sentences sampled from the benchmark, and the adversarial dataset includes 1,000 adversarial sentences generated by the attack based on the benchmark. Please note that \textit{there is no overlap between the test data and the training data used for the detector's training.} Finally, we evaluate the performance of the victim models with or without defense methods. Moreover, we compare TextShield with four state-of-the-art defense methods: (1) \textbf{IBP} \citep{jia2019certified}: the most representative method in the certified robustness paradigm. (2) \textbf{Adversarial Sparse Convex Combination (ASCC)} \citep{dong2021towards}: a model-enhancement-based defense method which leverages convex hull to defend against adversarial word substitutions. (3) \textbf{Synonym Encoding Method (SEM)} \citep{wang2021natural}: a model-enhancement-based defense method based on synonym encoding. (4) \textbf{Frequency-based Word Substitution (FGWS)} \citep{mozes2021frequency}: a detection-based method which leverages word frequency. (5) \textbf{Word-level Differential Reaction (WDR)} \citep{mosca2022suspicious}: a detection-based method which utilizes prediction logits. \textbf{Specifically, considering that \textbf{FGWS} and \textbf{WDR} are detection-only methods and cannot correctly classify adversarial sentences, we combine our corrector to them.} The baselines' settings are kept the same with corresponding papers. \begin{table*}[!h] \resizebox{\textwidth}{!}{ \begin{tabular}{@{}cc|ccccc|ccccc|ccccc@{}} \toprule[2pt] \multirow{2}{*}{Victim} & \multirow{2}{*}{Defense} & \multicolumn{5}{c}{IMDB} & \multicolumn{5}{c}{AGNews} & \multicolumn{5}{c}{Yahoo} \\ \cmidrule(l){3-17} & & No & IGA & PWWS & GA &TL & No & IGA & PWWS & GA &TL & No & IGA & PWWS & GA &TL \\ \midrule[2pt] \multirow{7}{*}{\begin{tabular}[c]{@{}c@{}}Text\\ CNN\end{tabular}} & NT & \color[HTML]{3166FF}88.7 & 13.3 & 4.4 & 7.1 & 2.3 & \color[HTML]{3166FF}92.3 & 45.5 & 37.5 & 36.0 & 30.0 & \color[HTML]{3166FF}68.4 & 19.6 & 10.3 & 13.7 & 8.5 \\ & IBP & 78.6 & 72.5 & 72.5 & 71.5 & 65.0 & 89.4 & 80.0 & 80.5 & 80.5 & 80.0 & 64.2 & 49.4 & 52.6 & 59.2 & 61.0 \\ & FGWS & 84.7 & 70.4 & 68.0 & 70.2 & 64.0 & 84.7 & 82.0 & 83.5 & 82.2 & 83.4 & 65.0 & 57.0 & 58.0 & 57.5 & 60.8 \\ & WDR & 85.4 & 72.5 & 70.5 & 71.0 & 66.5 & 85.5 & 84.2 & 84.4 & 83.4 & 83.5 & 66.0 & 60.0 & 60.0 & 61.5 & 61.5 \\ & ASCC & 87.8 & 68.4 & 69.1 & 70.5 & 69.4 & 86.7 & 85.0 & 83.0 & 84.0 & 83.0 & 64.8 & 60.7 & 60.3 & 62.2 & 62.4 \\ & SEM & 86.8 & 66.4 & 71.1 & 72.5 & 72.4 & 89.7 & 86.0 & 86.0 & 85.0 & 86.0 & 65.8 & 61.0 &\color[HTML]{3166FF} 60.5 & 63.0 &\color[HTML]{3166FF} 63.0 \\ & TS{(Ours)} & 87.0 & \color[HTML]{3166FF}74.0 &\color[HTML]{3166FF} 74.2 &\color[HTML]{3166FF} 75.0 &\color[HTML]{3166FF} 74.0 & 90.8 &\color[HTML]{3166FF} 87.4 &\color[HTML]{3166FF} 87.8 &\color[HTML]{3166FF} 86.8 &\color[HTML]{3166FF} 86.8 & 67.7 &\color[HTML]{3166FF} 62.0 & 59.0 & \color[HTML]{3166FF}63.0 & 62.0 \\\midrule[2pt] \multirow{6}{*}{LSTM} & NT & \color[HTML]{3166FF}87.3 & 8.3 & 2.2 & 5.0 & 3.0 & \color[HTML]{3166FF}92.6 & 35.0 & 30.0 & 29.0 & 26.5 & \color[HTML]{3166FF}71.6 & 27.6 & 21.1 & 15.8 & 5.5 \\ & IBP & 79.5 & 70.0 & 70.0 & 69.0 & 64.5 & 86.3 & 79.5 & 79.5 & 76.5 & 79.5 & 60.2 & 35.0 & 33.5 & 30.0 & 31.5 \\ & FGWS & 80.9 & 70.4 & 71.1 & 72.9 & 70.0 & 87.5 & 82.5 & 82.0 & 82.0 & 82.0 & 68.0 & 58.0 & 58.2 & 58.5 & 58.5 \\ & WDR & 80.3 & 70.5 & 75.0 & 75.0 & 71.0 & 88.0 & 83.5 & 84.0 & 82.0 & 83.4 & 66.5 & 60.0 & 58.0 & 60.0 & 59.5 \\ & ASCC & 82.8 & 70.2 & 75.0 & 74.0 & 70.8 & 88.9 & 84.6 & 85.0 & 82.7 & 84.0 & 68.0 & 58.6 & 57.9 & 58.2 & 55.5 \\ & SEM & 86.8 & 72.2 & 77.0 & 77.0 & 73.8 & 90.9 & 85.5 & 86.5 & 85.0 & 85.5 & 69.0 & 60.6 & 59.9 & 60.2 & 62.5 \\ & TS{(Ours)} & 86.0 &\color[HTML]{3166FF} 74.0 &\color[HTML]{3166FF} 79.4 &\color[HTML]{3166FF} 78.6 &\color[HTML]{3166FF} 76.4 & 91.4 &\color[HTML]{3166FF} 86.6 &\color[HTML]{3166FF} 87.2 &\color[HTML]{3166FF} 87.6 &\color[HTML]{3166FF} 87.0 & 69.6 &\color[HTML]{3166FF} 62.0 &\color[HTML]{3166FF} 62.6 &\color[HTML]{3166FF} 65.2 &\color[HTML]{3166FF} 65.0 \\\midrule[2pt] \multirow{6}{*}{BERT} & NT & \color[HTML]{3166FF}92.3 & 24.5 & 40.7 & 40.0 & 28.0 & \color[HTML]{3166FF}94.6 & 66.5 & 68.0 & 58.5 & 45.5 & \color[HTML]{3166FF}77.7 & 31.3 & 34.3 & 15.7 & 10.0 \\ & IBP & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - \\ & FGWS & 88.7 & 79.2 & 80.9 & 78.0 & 79.0 & 93.5 & 80.2 & 79.3 & 85.0 & 80.0 & 75.8 & 58.5 & 57.6 & 59.5 & 58.0 \\ & WDR & 88.5 & 82.0 & 82.0 & 82.5 & 81.5 & 93.0 & 82.5 & 84.0 & 86.5 & 83.5 & 76.5 & 61.8 & 60.8 & 62.4 & 60.6 \\ & ASCC & 88.2 & 84.3 & 84.2 & 84.2 & 82.0 & 90.1 & 83.5 & 83.5 & 87.7 & 87.6 & 74.5 & 60.7 & 62.5 & 63.5 & 61.1 \\ & SEM & 89.5 & 87.5 & 88.4 & 87.3 & 85.5 & 94.1 & 88.5 & 88.5 & 88.5 & 88.5 & 76.2 & 66.8 & 66.8 & 66.4 & 62.0 \\ & TS{(Ours)} & 88.3 &\color[HTML]{3166FF} 88.4 &\color[HTML]{3166FF} 88.6 &\color[HTML]{3166FF} 90.5 &\color[HTML]{3166FF} 86.5 & 94.0 &\color[HTML]{3166FF} 90.2 &\color[HTML]{3166FF} 90.0 &\color[HTML]{3166FF} 90.0 &\color[HTML]{3166FF} 89.5 & 76.0 &\color[HTML]{3166FF} 70.5 &\color[HTML]{3166FF} 69.0 &\color[HTML]{3166FF} 70.0 &\color[HTML]{3166FF} 64.5 \\ \bottomrule[2pt] \end{tabular}} \caption{The accuracy (\%) of various defense methods on benign and adversarial sentences. Rows (e.g., NT) represent the defense methods; Columns (e.g., No) represent the attacks that generate adversarial test sentences; No: no attack, NT: Normal Training, TS: TextShield, TL: TextFooler; {\color[HTML]{3166FF} BLUE} is the best performance. Moreover, for a fair comparison, as the previous work \citep{shi2019robustness} reported that BERT is too difficult to be tightly verified by IBP, we do not use IBP on BERT.} \label{tab:11} \end{table*} \subsection{Performance}\label{sec:sec45} Table~\ref{tab:11} lists the performances of various defense models under different scenarios, which demonstrates both the generalization and the robustness of these defense models. \paragraph{\textbf{Effect on generalization}} When evaluated on benign sentences (see Column 'No' in Table~\ref{tab:11}), normal training (NT) achieves the best results, and our proposed method, TextShield, achieves accuracy performance close to normal training (NT), indicating a good trade-off between robustness and generalization. By the way, such a trade-off is common for attack/defense, which has been theoretically investigated in the CV field \citep{zhang2019theoretically}. In addition, generalization can be seen as a proper upper bound for accuracy performance on adversarial sentences. Moreover, among baselines, ASCC performs best, and IBP has lowest accuracy due to its relatively loose bounds. Besides, combined with our corrector, PGWS and WDR obtain comparable performances towards ASCC, which indicates that our corrector is effective across different detectors concerning model's generalization. \paragraph{\textbf{Effect on robustness}} When evaluated on adversarial sentences, TextShield performs best in most cases, demonstrating that TextShield can effectively improve the model's robustness. Furthermore, the enhancement of model's robustness is derived from the leveraging a cross-cutting link between adversarial robustness and saliency, which is complementary to the conventional opinion \citep{zhang2020adversarial,goyal2022survey} that text attacks should be better defended using discrete information instead of continuous information. Moreover, among the baselines, SEM, the state-of-the-art defense method against word-level attacks, achieves the best performance. IBP, which was first proposed in the CV domain, is more suitable for TextCNN and does not perform excellently on other victim classifiers. FGWS focuses only on word frequencies, so it is not sufficient to detect adversarial sentences when word frequency is not distinct. Moreover, after combining with our corrector, WDR can yield a comparable performance towards ASCC, a competitive baseline using the model-enhancement-based paradigm, which indicates our corrector can combine well with existing detectors concerning model's robustness. \begin{table*}[h]\small \centering \resizebox{\textwidth}{!}{ \begin{tabular}{@{}cccccccc@{}} \toprule[2pt] \multirow{2}{*}{Dataset} & \multirow{2}{*}{Attack} & \multicolumn{2}{c}{Saliency} & \multicolumn{2}{c}{WDR} & \multicolumn{2}{c}{FGWS} \\ \cmidrule(l){3-8} & & F1-score & Recall & F1-score & Recall & F1-score & Recall \\ \midrule[2pt] \multirow{4}{*}{AGNews} & PWWS &\color[HTML]{3166FF} 92.2 ± 1.1 &\color[HTML]{3166FF} 93.4 ± 0.4 & 90.1 ± 1.1 & 89.1 ± 1.4 & 88.4 & 80.1 \\ & IGA &\color[HTML]{3166FF} 89.9 ± 1.2 &\color[HTML]{3166FF} 90.4 ± 0.9 & 85.7 ± 1.3 & 86.6 ± 1.8 & 68.6 & 58.3 \\ & GA &\color[HTML]{3166FF} 92.9 ± 1.0 &\color[HTML]{3166FF} 91.4 ± 1.3 & 88.4 ± 0.9 & 87.2 ± 1.1 & 70.3 & 60.1 \\ & TextFooler &\color[HTML]{3166FF} 95.1 ± 0.4 & 96.6 ± 0.7 & 94.0 ± 0.8 &\color[HTML]{3166FF} 97.0 ± 0.9 & 86.0 & 77.6 \\ \midrule[2pt] \multirow{4}{*}{IMDB} & PWWS &\color[HTML]{3166FF} 92.7 ± 0.8 &\color[HTML]{3166FF} 90.8 ± 1.0 & 89.2 ± 0.7 & 87.5 ± 1.8 & 80.8 & 76.7 \\ & IGA &\color[HTML]{3166FF} 92.0 ± 1.2 &\color[HTML]{3166FF} 93.2 ± 1.1 & 87.5 ± 0.9 & 90.5 ± 1.3 & 79.5 & 70.1 \\ & GA &\color[HTML]{3166FF} 91.8 ± 0.9 &\color[HTML]{3166FF} 92.1 ± 1.5 & 88.0 ± 1.1 & 89.6 ± 1.1 & 79.0 & 74.2 \\ & TextFooler &\color[HTML]{3166FF} 96.6 ± 0.4 &\color[HTML]{3166FF} 98.0 ± 0.6 & 95.0 ± 0.8 & 96.0 ± 0.9 & 86.0 & 77.6 \\ \midrule[2pt] \multirow{4}{*}{YELP} & PWWS &\color[HTML]{3166FF} 91.8 ± 1.5 &\color[HTML]{3166FF} 90.1 ± 1.6 & 89.2 ± 1.4 & 86.2 ± 3.1 & 91.2 & 85.6 \\ & IGA &\color[HTML]{3166FF} 91.0 ± 0.8 &\color[HTML]{3166FF} 90.7 ± 1.0 & 87.1 ± 0.5 & 88.1 ± 1.9 & 85.4 & 82.8 \\ & GA &\color[HTML]{3166FF} 91.2 ± 0.8 &\color[HTML]{3166FF} 90.0 ± 0.8 & 87.2 ± 0.4 & 88.7 ± 1.4 & 85.9 & 83.3 \\ & TextFooler & \color[HTML]{3166FF}97.5 ± 0.3 & \color[HTML]{3166FF}98.3 ± 0.5 & 95.9 ± 0.3 & 97.5 ± 0.9 & 90.5 & 84.2 \\ \bottomrule[2pt] \end{tabular}} \caption{The performances of adversarial detection under various attacks on BERT-based victim classifier. The performances of WDR and FGWS are from the corresponding paper; {\color[HTML]{3166FF} BLUE} is the best performance. `Saliency' represents our saliency-based detector.} \label{detect} \end{table*} \section{Experiments on adversarial detection}\label{det} This section compares our saliency-based detector to current SoTA adversarial detectors in several configurations involving datasets and attacks. \subsection{Experimental settings} In the experiments, only \textbf{BERT} \citep{devlin2019bert} is used as victim classifier. Then, four widely used adversarial attacks are selected: \textbf{GA} \citep{alzantot2018generating}, \textbf{PWWS} \citep{ren2019generating}, \textbf{IGA} \citep{wang2019natural} and \textbf{TextFooler} \citep{jin2020bert}. Next, three popular benchmarks in text classification are selected: \textbf{IMDB} \citep{potts2010negativity}, \textbf{AG’s News} \citep{zhang2015character} and \textbf{Yelp} \citep{zhang2015character}. Similar to the experiments on adversarial defense, given a victim classifier, an attack, and a benchmark, we generate test data which include 1,000 adversarial sentences generated by the attack based on the benchmark. Finally, we evaluate the performance of the victim models on the test data. Following previous works \citep{mosca2022suspicious}, the performance of adversarial detection is evaluated by F1-score and recall. Moreover, in order to examine the performance of our detector, two state-of-the-art detectors are chosen as baselines, \textbf{FGWS} \citep{mozes2021frequency} and \textbf{WDR} \citep{mosca2022suspicious}, where FGWS leverages word frequency to detect adversarial sentences, and WDR uses prediction logit information for adversarial detection. \subsection{Performance} Table~\ref{detect} shows the performance of the detectors in various configurations. In Table~\ref{detect}, our proposed detector consistently shows better results in terms of F1-score and recall. Specifically, our detector outperforms the best baseline in 11 configurations out of 12, and on average achieves 3.74\% gain on F1-score. Such results show that the saliency-based detector reacts well to all selected attacks. Moreover, we can also observe that TextFooler is easier to be detected than other attacks. Considering that TextFooler is much stronger than the attacks like GA and IGA, we can claim that there is no positive relation between attack's attack power and detection difficulty. \section{Further results} We also illustrate the details or discussion towards critical designs of TextShield with additional experiments. We defer them to Appendix due to limited space. The outline is as follows: The analyses of hyper-parameters are shown in Appendix~\ref{aaaa}. Performance against extra word-level attacks is shown in Appendix~\ref{ba}. Also, human evaluation towards attack quality is shown in Appendix~\ref{human}. Besides, computational cost and corrector design discussions are shown in Appendix~\ref{cost} and \ref{designs}. Adversarial detection performance of TextShield against other levels of attacks (e.g., sentence-level attack) is shown in Appendix~\ref{app2}. \section{Conclusion} This paper proposes TextShield, a detect-correct pipelined defense method against word-level text attacks. Based on basic derivations, we find a cross-cutting connection between adversarial robustness and saliency, and then we propose the adaptive word importance (AWI) metric based on saliency computation. Based on AWI, we design a saliency-based detector, which achieves better performance than previous detectors. Then, we design a saliency-based corrector, which corrects adversarial sentences to benign ones using AWI. Comprehensive experiments demonstrate that TextShield is superior to previous defense methods for generalization and robustness. \section{Acknowledgement} The research was financially supported by National Precision Agriculture Application Project (Grant/Contract number: JZNYYY001), and Beijing Municipal Science and Technology Project (Grant/Contract number: Z201100008020008).
\section{Introduction} \label{sec:intro} Person Re-Identification (ReID) aims to retrieve a person of interest across multiple non-overlapping cameras. Given a single image of an identity, the goal of the ReID model is to learn the pedestrian characteristics, so that the distance of intra-identity features is smaller than that of inter-identity. However, the task of ReID is very challenging, since various complex conditions, such as human pose variations, different backgrounds, or varying illuminations, usually appear on different images of the same identity. \begin{figure}[t] \centering \scalebox{0.7} { \includegraphics[width=\linewidth]{Fig/intro.pdf} } \caption{The images on different sides are the same identity. (a) \emph{Instance-Level} methods can be classified into: (b) Global-Level methods, (c) Part-Level methods and (d) Patch-Level methods. As illustrated in (e), our proposed method exploits \emph{Identity-Level} features shared across different images of the same identity.} \label{fig:intro} \end{figure} Several previous studies\cite{ye2021deep,luo2019bag,chen2019abd,sun2018beyond,zhu2020identity,he2021transreid} present promising results on supervised ReID. Since these works extract features from only a single image, rather than from a combination of multiple images of the same identity, we refer to them as \emph{Instance-Level} methods. According to the different processing methods for individual images, Instance-Level methods can be roughly classified into the following categories. (1) Global-Level methods\cite{luo2019bag,chen2020salience,chen2019abd,zhang2020relation,fang2019bilinear,si2018dual,zheng2019re,chen2018group,luo2019spectral}, which directly learn the global representation by optimizing Instance-Level features of each single complete image, as shown in Figure~\ref{fig:intro}.b. (2) Part-Level methods\cite{sun2018beyond,wang2018learning,li2021diverse,zhu2020identity,he2020guided,zhang2019densely,jin2020semantics,zhu2021aaformer, zhu2022dual}, as shown in Figure~\ref{fig:intro}.c, which learn local aggregated features from different parts. (3) Patch-Level methods such as TransReID\cite{he2021transreid}, which rearranges and re-groups the patch embeddings of each single image (see Figure~\ref{fig:intro}.d). Each group forms an incomplete global representation. Due to various factors such as human pose and camera variations, the appearance of the same identity varies greatly in different images. Instance-Level methods focus on features only from a single image, so the features of different images of the same identity are prone to large differences. For example, Figure~\ref{fig:intro}.a shows the front and back of the same identity captured by different cameras. As the backpack in the back image is more salient than that in the front image, features independently learned by Instance-Level methods will vary greatly. Consequently, it may lead to intra-identity variation being larger than inter-identity variation, which further limits the performance in inference. We argue the reason is that Instance-Level methods are unable to learn discriminative features shared across different images of the same identity. To resolve this problem, we propose a novel \emph{Identity-Level} method to fuse different Instance-Level features of the same identity, as shown in Figure~\ref{fig:intro}.e. In this way, more unified and robust pedestrian information can be learned. With our method, for the discriminative information of the ``backpack'' in the back image, the front can gain knowledge from the back to strengthen its representation, thereby reducing intra-identity variation, enlarging inter-identity variation and obtaining a more robust features. Our proposed method is based on the pure Transformer structure\cite{dosovitskiy2020image}. The Multi-Head Attention module can exploit long-range dependencies between patches divided from the input image, which can get fine-grained features with rich structural patterns. However, previous works\cite{he2021transreid,zhu2021aaformer} only use the Instance-Level Transformer and thus can not jointly encode multiple images to extract Identity-Level features. In this paper, we introduce cross-attention to the encoder, which has not been fully explored in vision task, especially in ReID. Cross-attention can incorporate information from different instances, which mitigates the impact of the variable appearance of the same identity. Based on the attention mechanism, we introduce a novel training framework, CrossReID termed as X-ReID, which performs attention across different instances of the same identity to extract Identity-Level features. Firstly, we propose a Cross Intra-Identity Instances module (IntraX). Cross-attention is applied among different intra-identity instances to get more unified features. Then, we transfer Identity-Level knowledge to Instance-Level features, which makes features more compact. Second, We further propose a Cross Inter-Identity Instances module (InterX). Hard positive and negative instances are utilized in cross-attention. The fused features, which contain hard negative instance, are less discriminative. The fused features are optimized by our proposed X-Triplet loss to improve the attention response to the same identity rather than different identity, so that intra-identity variation is minimized and inter-identity variation is maximized. Our modules consider both Intra- and Inter-Identity instances to improve the Identity-Level ability of Instance-Level features. Only the improved Instance-Level features are used for inference, which brings no additional cost compared with Transformer-based state-of-the-art methods. Our major contributions can be summarized as follows: \begin{itemize} \item We propose to exploit Identity-Level features shared across different images of each identity to build a more unified, discriminative and robust representation. \item We introduce a novel training framework, termed as X-ReID, which contains IntraX for Intra-Identity instances and InterX for Inter-Identity instances to improve the Identity-Level ability of Instance-Level features. \item The overall method is evaluated on benchmark datasets, MSMT17\cite{wei2018person} and Market1501\cite{zheng2015scalable}. Extensive experimental results validate the effectiveness of Identity-Level and X-ReID achieves state-of-the-art performance. \end{itemize} \section{Related Work} \subsection{Supervised ReID} Existing works extract instance representations from a single image, so we refer to them as Instance-Level methods, which can be roughly categorized into three classes: (1) Global-Level methods\cite{zheng2017person,luo2019bag}, which learn the global representation of each single complete image. The misalignment problem is handled in attention-based methods\cite{chen2020salience,chen2019abd,zhang2020relation,fang2019bilinear,si2018dual,zheng2019re,chen2018group,luo2019spectral}. (2) Part-Level methods\cite{sun2018beyond,wang2018learning,li2021diverse,zhu2020identity,he2020guided,zhang2019densely,jin2020semantics,zhu2021aaformer}, which learn local aggregated features from different parts. (3) Patch-Level methods such as TransReID\cite{he2021transreid}, which shuffles patches into several incomplete representations. There are a few CNN-based works that leverage the cross-image information. These works mine the relationships between multiple Instance-Level feature maps. DuATM\cite{si2018dual} performs dually attentive comparison for pair-wise feature alignment and refinement. CASN\cite{zheng2019re} designs a Siamese network with attention consistency. Group similarity is proposed in GCSL\cite{chen2018group} for learning robust multi-scale local similarities. SFT\cite{luo2019spectral} optimizes group-wise similarities to capture potential relational structure. \begin{figure*}[t] \centering \scalebox{0.8} { \includegraphics[width=\linewidth]{Fig/xreid.pdf} } \caption{Framework of our proposed X-ReID, based on $L$ layers Instance-Level Transformer. It is composed of a Cross Intra-Identity Instances module (IntraX) and a Cross Inter-Identity Instances (InterX). We build $M$ X-Layers for IntraX, $N$ X-Layers for InterX, and set $M=N=L$. The details of X-Layer are shown in Figure~\ref{fig:xlayer}.} \label{fig:X-ReID} \end{figure*} \subsection{Transformer in Vision} Inspired by the success of Transformers\cite{vaswani2017attention} in natural language tasks, many studies\cite{khan2021transformers,han2020survey,gao2021ts,carion2020end,xie2021segformer,zhao2021point,chen2021pre} have shown the superiority of Transformer in vision tasks. ViT\cite{dosovitskiy2020image} first introduces a pure Transformer to image classification. In the field of ReID, PAT\cite{li2021diverse} utilizes Transformer to improve CNN backbone\cite{he2016deep}. NFormer\cite{wang2022nformer} proposes a parametric post-processing method by modeling the relations among all the input images. TransReID\cite{he2021transreid} investigates a pure Transformer encoder framework, and AAformer\cite{zhu2021aaformer} integrates the part alignment into the self-attention. DCAL\cite{zhu2022dual} introduces cross-attention mechanisms to learn subtle feature embeddings. Instead, we exploit cross-attention to fuse Instance-Level features. As for image classification, cross-attention in Cross-ViT\cite{chen2021crossvit} is used to learn multi-scale features. In Trear\cite{li2021trear}, features from different modalities are fused to obtain the conjoint cross-modal representation. Unlike these approaches, our proposed cross-attention extracts Identity-Level features for more unified and discriminative pedestrian information. \section{Method} Our method is built on top of pure Transformer architecture, so we first present a brief overview of Instance-Level Transformer in Sec~\ref{sec:instance}. Then, we introduce the proposed Identity-Level framework (X-ReID) in Sec~\ref{sec:xreid}, which contains a Cross Intra-Identity Instances module (IntraX) and a Cross Inter-Identity Instances (InterX). \subsection{Instance-Level Transformer for ReID} \label{sec:instance} Instance-Level Transformer for ReID is a Transformer-based strong baseline and we follow the baseline in TransReID\cite{he2021transreid}. As shown in Figure~\ref{fig:instance}, given a single input image, we reshape it into a sequence of flattened patches $N \times (P^{2} \times C)$, where C is the number of channels. $P$ is the resolution of each patch, and $N$ is the length of fixed-sized patches according to image size. We flatten the patches and map to vectors with a trainable linear projection. An extra learnable embedding CLS is added to the sequence of embedded patches. Learnable position embeddings are used for retaining spatial information. The output embeddings can be expressed as: $\mathcal{Z}_{0}=[{z}_{cls}^{0};{z}_{1}^{0};...;{z}_{N}^{0}]$, where $\mathcal{Z}_{0}$ represents the input fed into backbone, ${z}_{cls}$ is CLS token and ${z}_{patch}=\left \{ {z}_{i} | i=1,...,N \right \}$ are patch tokens. The backbone is composed of a stack of $L$ identical Transformer layers. Because the input is a single image and the layers encode the Instance-Level information, the Transformer layer is named as Instance-Layer in this paper. And each layer can encode the embeddings: $\mathcal{Z}_{i}=f(\mathcal{Z}_{i-1} | {\theta}_{Ins}^{i})$, where $\mathcal{Z}_{i}$ is the output of the $i$-th Instance-Layer and ${\theta}_{Ins}^{i}$ is the weight of this layer. After LayerNorm\cite{ba2016layer}, the last layer’s output of CLS token ${z}_{cls}^{l}$ gets Instance-Level features ${f}_{Ins}$, to extract global representation, which is used to calculate ID loss\cite{zheng2017discriminatively} $\mathcal{L}_{ID}$ and Triplet loss\cite{liu2017end} $\mathcal{L}_{Tri}$ that constitute the ReID Head\cite{luo2019bag}: \begin{equation} \mathcal{L}_{Ins} = \mathcal{L}_{ID}(f_{Ins}) + \mathcal{L}_{Tri}(f_{Ins}) \label{formula:ReID_Head} \end{equation} \begin{figure} \centering \includegraphics[width=\linewidth]{Fig/instance.pdf} \caption{Framework of Instance-Level Transformer. $\ast$ refers to CLS token.} \label{fig:instance} \end{figure} \subsection{X-ReID} \label{sec:xreid} Our proposed Identity-Level framework is illustrated in Figure~\ref{fig:X-ReID} based on Instance-Level Transformer, which contains IntraX and InterX. For a single image $I_A^1$ of person $A$, the tokens obtained from Instance-Level Transformer are $\mathcal{Z}^{I_A^1}=\left \{ \mathcal{Z}^{I_A^1}_{i} | i=0,1,...,L \right \}$. On the left side of Figure~\ref{fig:X-ReID}, as for other images of the same person $A$, we get $\left \{\mathcal{Z}^{I_A^i} | i=2,...,K\right \}$. IntraX are performed among Intra-Identity instances. $\left \{\mathcal{Z}^{I_A^i}\right \}$ as Key and $\mathcal{Z}^{I_A^1}$ as Query are fed to X-Layers to extract Identity-Level features $f_{IntraX}$ of person $A$. Rather than all positive instances as IntraX does, InterX utilizes both positive instance $I_A^{pos}$ and negative instance $I_A^{neg}$. As shown on the right side of Figure~\ref{fig:X-ReID}, $\mathcal{Z}^{I_A^{pos}}$ and $\mathcal{Z}^{I_A^{neg}}$ are used as Key and we get features $f_{InterX}$. Our X-ReID explores both Intra- and Inter-Identity instances to enhance Instance-Level features. \begin{figure} \centering \scalebox{0.80} { \includegraphics[width=\linewidth]{Fig/xlayer.pdf} } \caption{Illustration of X-Layer. In both IntraX and InterX, $Q_X$ are the same. In IntraX, $K_X$ are all positive instances in the mini-batch. As for InterX, $K_X$ are hard positive and hard negative. $I_X$ are usually the output of the previous Layer.} \label{fig:xlayer} \end{figure} \subsubsection{X-Layer.} Instance-Layer, which consists of alternating layers of \textbf{M}ulti-\textbf{H}ead \textbf{A}ttention and FFN blocks, only has Self Attention. The output of MHA is formulated as: \begin{equation} {\rm MHA}(Q,K,V) = {\rm softmax}(\frac{QK^{T}}{\sqrt{d_k}})V \label{formula:MHA} \end{equation} \noindent where ${d}_{k}$ is the scaling factor. Figure~\ref{fig:xlayer} shows the detailed structure of our proposed X-Layer. Cross Attention is added to Instance-Layer to become X-Layer. With Cross Attention, X-Layer can obtain features across multiple inputs: \begin{equation} \begin{split} {\rm Attention}_X(I_X,Q_X,K_X) & = {\rm MHA}(I_X, I_X, I_X) \\ & + {\rm MHA}(Q_X, K_X, K_X) \end{split} \end{equation} \noindent where ${\rm MHA}(I_X, I_X, I_X)$ is Self Attention and ${\rm MHA}(Q_X, K_X, K_X)$ is Cross Attention. It is worth noting that Self Attention and Cross Attention share parameters, so the parameters of X-Layer are the same as those of Instance-Layer. \subsubsection{Cross Intra-Identity Instances.} \label{sec:intraX} We propose a Cross Intra-Identity Instances module to transfer Identity-Level knowledge to Instance-Level features. All positive instances of the input $I_A^1$ are fused in X-Layer to extract Identity-Level features. To enhance the Identity-Level capability, IntraX trains Instance-Level features to predict Identity-Level representation of the same identity by knowledge distillation. $M$ layers of X-Layer in IntraX uses the \textbf{E}xponential \textbf{M}oving \textbf{A}verage (EMA) on Instance-Layers, which is proposed to maintain consistency. Specifically, the parameters of $i$-th X-Layer can be calculated as: \begin{equation} {\theta}_{IntraX}^{i} \gets \lambda \times {\theta}_{IntraX}^{i} + (1-\lambda) \times {\theta}_{Ins}^{i} \end{equation} \noindent where $\lambda$ follows a cosine schedule from 0.999 to 1 during training. Knowledge about the different appearances of person $A$ is mixed in X-Layer. $I_X$, $Q_X$ and $K_X$ of $i$-th X-Layer in IntraX are: \begin{equation} \begin{split} I_X^i & = {\rm Attention_X}(I_X^{i-1}, Q_X^{i-1}, K_X^{i-1}) \\ Q_X^i & = \mathcal{Z}_i^{I_A^1}, K_X^i = [\mathcal{Z}_i^{I_A^2}||...||\mathcal{Z}_i^{I_A^K}] \end{split} \label{formula:intrax} \end{equation} \noindent where $I_X^{i-1}$ are the outputs of the previous X-Layer, except that $I_X$ of the first layer are the same as $Q_x=\mathcal{Z}_0^{I_A^1}$. We concatenates all features of positive instances of $I_A^1$ in the mini-batch to get $K_X \in \mathbb{R}^{(K-1)C}$. On account of X-Layer, IntraX incorporates different appearances of the same identity into Identity-Level features $f_{IntraX}$. Then, we transfer the knowledge from ${f}_{IntraX}$ to ${f}_{Ins}$: \begin{equation} \begin{split} P(f)^{(i)} & = \frac{{\rm exp}(f^{(i)}/\tau)}{\sum\limits_{d=1}^{C} {\rm exp}(f^{(d)}/\tau)} \\{\mathcal{L}}_{IntraX} & = -{\sum\limits_{d=1}^{C} P({{f}_{IntraX}})^{(d)}{\rm log}P({{f}_{Ins}})^{(d)}} \end{split} \end{equation} \noindent where $C=768$ are the dimensions of features and $\tau=0.05$ is a temperature parameter. The output of a softmax of the dot products of $f$ is the probability distribution $P$, which provides information on how the features represent knowledge. Matching distributions of $f_{Ins}$ and $f_{IntraX}$ by minimizing $\mathcal{L}_{IntraX}$ is used to improve Instance-Level features by Identity-Level features. Therefore, Instance-Level features are more compact. \subsubsection{Cross Inter-Identity Instances.} \label{sec:interX} Our proposed Cross Inter-Identity Instances module deals with inter-identity instances of $I_A^1$, instead of all positive instances in IntraX. InterX uses both hard positive and hard negative as $K_X$ of X-Layer, where the negative instance $I_A^{neg}$ has not the same identity as the anchor $I_A^1$. X-Layers in InterX may incorrectly notice the negative, whose interfering information affects the final fused features of InterX. We optimize the fused features to suppress the attention response of the anchor to negative instance and improve the attention response to positive instance, so that intra-identity variation is minimized and inter-identity variation is maximized. Particularly, InterX contains $N$ layers of X-Layer that are learnable. $I_X$ and $Q_X$ are the same as in Equation~\ref{formula:intrax}. $K_X$ of $i$-th X-Layer in interX is: \begin{equation} K_X^i = [\mathcal{Z}_i^{I_A^{pos}}||\mathcal{Z}_i^{I_A^{neg}}] \label{formula:interx} \end{equation} \noindent where $K_X^i$ is the result of concatenating $\mathcal{Z}_i^{I_A^{pos}}$ of hard positive $I_A^{pos}$ and $\mathcal{Z}_i^{I_A^{neg}}$ of hard negative $I_A^{neg}$. We conduct hard-mining\cite{hermans2017defense} in $\mathcal{L}_{Tri}$ to get hard positive and negative instance. As illustrated in Figure~\ref{fig:xtriplet}.a, $\mathcal{L}_{Tri}$ in the ReID Head is calculated as follows: \begin{equation} \mathcal{L}_{Tri}(a,p,n) = {\rm log} [1+{\rm exp}(|| f_{a}-f_{p}) ||_2^2-|| f_{a}-f_{n}) ||_2^2] \label{formula:triplet} \end{equation} \noindent where a, p and n is the anchor, hard positive and hard negative. The anchor may be closer to hard negative compared to hard positive. Therefore in Figure~\ref{fig:xtriplet}.b, the anchor as $Q_X$ is difficult to distinguish which one is positive in InterX. The fused features will be heavily influenced by hard negative. Red represents hard negative and green represents hard positive. In the fused features $f_{InterX}$, red occupies most of the space. Then, we propose X-Triplet loss: \begin{figure} \centering \scalebox{0.75} { \includegraphics[width=\linewidth]{Fig/xtriplet.pdf} } \caption{(a) Hard-mining in Triplet loss selects the hardest positive and the hardest negative instances within the batch. (b) X-Triplet loss optimize the fused features from hard positive and negative. Hard positive will have more attention responses than hard negative in X-Layer.} \label{fig:xtriplet} \end{figure} \begin{equation} \mathcal{L}_{XTri}(f_{InterX}) = {L}_{Tri}(f_{InterX},p,n) \label{formula:Xtriplet} \end{equation} \noindent Therefore, $f_{InterX}$ is pulled into hard positive and pushed away by hard negative. Then, the InterX Head composed of $\mathcal{L}_{ID}$ and $\mathcal{L}_{XTri}$ are shown as follows: \begin{equation} \mathcal{L}_{InterX} = {L}_{ID}(f_{InterX}) + {L}_{XTri}(f_{InterX}) \label{formula:InterXhead} \end{equation} \noindent By $\mathcal{L}_{InterX}$, the anchor are encouraged to pay more attention to hard positive than hard negative in X-Layer. $f_{InterX}$ will be optimized to represent the person of the anchor and hard positive. At this stage, green occupies most of the space. Accordingly, InterX simultaneously reduces the distance of intra-identity and enlarges the distance of inter-identity. \subsubsection{Loss Function.} In the training phase, the overall objective function is: \begin{equation} \mathcal{L}_{X\raisebox{0mm}{-}ReID} = \mathcal{L}_{Ins} + \lambda_1 \mathcal{L}_{IntraX} + \lambda_2 \mathcal{L}_{InterX} \label{formula:total} \end{equation} \noindent where $\lambda_1$ and $\lambda_2$ are hyper-parameters to balance the entire loss. Notably, only the boosted Instance-Level features ${f}_{Ins}$ is used for inference. In this way, the final model has the same structure as Instance-Level Transformer whose input is a single image. \section{Experiments} \subsection{Evaluation Setting and Metrics} Our proposed method are evaluated on the popular benchmark datasets: MSMT-17\cite{wei2018person} which contains 126441 person images of 4101 identities, Market1501\cite{zheng2015scalable} which contains 32668 person images of 1501 identities. Following the common setting, the cumulative matching characteristics (CMC) at Rank-1 and the mean average precision (mAP) are adopted to evaluate the performance of all methods. \subsection{Implementation Details} We use the ImageNet\cite{deng2009imagenet}-pretrained model of ViT-Base, which contains $L=12$ Instance-Layers and the patch size is 16$\times$16. We build $M=N=12$ X-Layers in both IntraX and InterX. X-Layers in IntraX use an exponential moving average on Instance-Layer. X-layers are learnable in InterX. In Equation~\ref{formula:total}, we set $\lambda_1=5.0, \lambda_2=0.4$ and $\lambda_1=20.0, \lambda_2=0.4$ for Market1501 and MSMT17, respectively. The input images are resized to 256$\times$128. Following common practices, random horizontal flipping, padding, random cropping and random erasing\cite{zhong2020random} are used as augmentation for training. We randomly sample $K=4$ instances for each identity in a mini-batch with batch size 64. SGD optimizer with a momentum of 0.9 and the weight decay of 1e-4 is applied with a learning rate of 0.008 with cosine learning rate decay. We train 120 epochs in total. All the experiments are performed with one NVIDIA Geforce RTX 3090. \subsection{Comparisons with State-of-the-art Methods} In Table~\ref{table:sota}, we compare our proposed X-ReID with state-of-the-art methods on MSMT17 and Market1501. On Market1501, our method achieves comparable performance with the recent Transformer-based methods, especially on mAP. On the challenging MSMT17, Transformer-based methods outperform CNN-based methods significantly. X-ReID reaches state-of-the-art performance, which gains 1.1$\%$ mAP improvements when compared to the second place. Our Baseline follows the setup in \cite{he2021transreid}. The Baselines of X-ReID and TransReID have the same implementation. In order to compare the experiments better, we reproduce Baseline and TransReID, whose performance is slightly different from that in the original paper due to different hardware environments. Our X-ReID is the Baseline with proposed IntraX and InterX. Based on the same Baseline, X-ReID outperforms TransReID by 1.6$\%$ mAP on MSMT17 and 0.6$\%$ mAP on Market1501. \begin{table*}[t] \caption{Comparison with state-of-the-art training methods. $\ast$ means we re-implement the experiments based on the official code. $\rm Baseline^{\ast}$ is Instance-Level Transformer described in Sec~\ref{sec:instance}, which follows the setup in \cite{he2021transreid}. $\rm TransReID^{\ast}$ is the result without side information for fair comparison.} \begin{center} \begin{tabular}{c|c|c|cccc} \hline \multirow{2}{*}{Backbone} & \multirow{2}{*}{Methods} & \multirow{2}{*}{Ref} & \multicolumn{2}{c|}{MSMT17} & \multicolumn{2}{c}{Market1501} \\ \cline{4-7} & & & mAP & \multicolumn{1}{c|}{Rank-1} & mAP & Rank-1 \\ \hline \multirow{9}{*}{CNN} & DuATM\cite{si2018dual} & CVPR2018 & - & \multicolumn{1}{c|}{-} & 76.6 & 91.4 \\ & GCSL\cite{chen2018group} & CVPR2018 & - & \multicolumn{1}{c|}{-} & 81.6 & 93.5 \\ & CASN\cite{zheng2019re} & CVPR2019 & - & \multicolumn{1}{c|}{-} & 82.8 & 94.4 \\ & SFT\cite{luo2019spectral} & ICCV2019 & 47.6 & \multicolumn{1}{c|}{73.6} & 82.7 & 93.4 \\ \cline{2-7} & PAT\cite{li2021diverse} & CVPR2021 & - & \multicolumn{1}{c|}{-} & 88.0 & 95.4 \\ & ISP\cite{zhu2020identity} & ECCV2020 & - & \multicolumn{1}{c|}{-} & \textbf{88.6} & 95.3 \\ & PCB\cite{sun2018beyond} & ECCV2018 & 40.4 & \multicolumn{1}{c|}{68.2} & 81.6 & 93.8 \\ & SCSN\cite{chen2020salience} & CVPR2020 & 58.5 & \multicolumn{1}{c|}{\textbf{83.8}} & 88.5 & {\textbf{95.7}} \\ & ABDNet\cite{chen2019abd} & ICCV2019 & \textbf{60.8} & \multicolumn{1}{c|}{82.3} & 88.3 & 95.6 \\ \hline \hline \multirow{5}{*}{Transformer} & $\rm Baseline^{\ast}$\cite{he2021transreid} & ICCV2021 & 62.3 & \multicolumn{1}{c|}{82.2} & 87.1 & 94.6 \\ & AAformer\cite{zhu2021aaformer} & Arxiv2021 & 63.2 & \multicolumn{1}{c|}{83.6} & 87.7 & {\textbf{95.2}} \\ & $\rm TransReID^{\ast}$\cite{he2021transreid} & ICCV2021 & 63.5 & \multicolumn{1}{c|}{83.0} & 87.4 & 94.2 \\ & DCAL\cite{zhu2022dual} & CVPR2022 & 64.0 & \multicolumn{1}{c|}{83.1} & 87.5 & 94.7 \\ & X-ReID & Ours & \textbf{65.1} & \multicolumn{1}{c|}{\textbf{84.0}} & \textbf{88.0} & 94.9 \\ \hline \end{tabular} \end{center} \label{table:sota} \end{table*} CNN-based methods in the 1st group leverage the cross-image information, which mine the relations among Instance-Level features. Transformer-based DCAL\cite{zhu2022dual} proposes cross-attention to learn local features better, which is classified as a Part-Level method. However, our proposed Identity-Level method are introduced to extract more unified features among all intra-identity instances and push inter-identity instances far away. X-ReID surpasses the CNN-based cross-image methods by a large margin, at least 5.3$\%$ mAP on Market1501. X-ReID outperforms the cross-attention related method DCAL by 1.1$\%$ mAP on MSMT17 and 0.5$\%$ mAP on Market1501. \subsection{Effectiveness of X-ReID} We propose to improve Instance-Level features with our Identity-Level framework. Compared to Instance-Level features generated from a single image, Identity-Level features, generated across different images of each identity, have more unified pedestrian information. So that in X-ReID, different Instance-Level features of each identity are very compact and features from different identities are easy to distinguish, which facilitates the model to learn more discriminative and unified features. \subsubsection{Compactness Analysis.} \label{sec:compact} We evaluate intra-identity variation as follows: \begin{equation} \begin{split} \omega_i=\frac{1}{|\Omega_i|}\sum_{x_j\in\Omega_i}x_j,CP_i & =\frac{1}{|\Omega_i|}\sum_{x_j\in\Omega_i}\left\| x_j - \omega_i \right\| \\ CP & =\frac{1}{N}\sum_{k=1}^{N}CP_k \end{split} \end{equation} \begin{figure} \begin{subfigure}{.49\linewidth} \centering \includegraphics[width=1.0\linewidth]{Fig/cp_msmt.pdf} \caption{MSMT17} \end{subfigure} \begin{subfigure}{.49\linewidth} \centering \includegraphics[width=1.0\linewidth]{Fig/cp_market.pdf} \caption{Market1501} \end{subfigure} \caption{Compactness analysis in the test set on MSMT17 and Market1501. The order of the person ID axis is in ascending order of the compactness of Baseline. The overall compactness is shown in the parentheses.} \label{fig:cp} \end{figure} \noindent where $\Omega_i$ denotes the set containing all the feature vectors of the $i$-th person and $\omega_i$ represents the feature center of the $i$-th person. $CP_i$ calculates the average distance from each instance to the center in the $i$-th person. $N$ is the number of persons and the overall compactness $CP$ is the mean compactness of all persons. The lower the value of $CP$, the more compact the features of each identity. Figure~\ref{fig:cp} shows the compactness of different persons in the test set on MSMT17 and Market1501. Although TransReID outperforms Baseline, the compactness is almost the same. With Identity-Level, the compactness is much lower than Baseline and TransReID. Such results prove the Identity-Level knowledge can reduce intra-identity variation. \subsubsection{The Calinski-Harabasz Score Analysis.} The \textbf{C}alinski-\textbf{H}arabasz score~\cite{calinski1974dendrite} is defined as ratio of the sum of between-cluster dispersion and of within-cluster dispersion, which can be used to evaluate intra- and inter-identity variations. CH is higher when identities are both dense and well separated. Fig.\ref{fig:ch} shows CH metric during the training epochs. We can find that the curves of TransReID and Baseline rise slowly and the curve of X-ReID rises rapidly. The curve of X-ReID is significantly higher than that of TransReID and Baseline. By our proposed method, intra-identity instances are more compact and inter-identity instances are well separated. \begin{figure} \begin{subfigure}{.49\linewidth} \centering \includegraphics[width=1.0\linewidth]{Fig/ch_msmt.pdf} \caption{MSMT17} \end{subfigure} \begin{subfigure}{.49\linewidth} \centering \includegraphics[width=1.0\linewidth]{Fig/ch_market.pdf} \caption{Market1501} \end{subfigure} \caption{The \textbf{C}alinski-\textbf{H}arabasz score analysis in the test set on MSMT17 and Market1501. CH is calculated every 5 training epochs. The value in the parentheses is CH of the final model.} \label{fig:ch} \end{figure} \begin{figure}[t] \centering \scalebox{0.85} { \includegraphics[height=\linewidth, angle=-90]{Fig/attention.pdf} } \caption{Visualization analysis of attention maps. (a) Input images, (b) Baseline, (c) TransReID, (d) X-ReID. The images in each column are the same identity.} \label{fig:vis} \end{figure} \subsubsection{Visualization Analysis.} In Figure~\ref{fig:vis}, we further conduct visualization experiments\cite{chefer2021transformer} to show the effectiveness of X-ReID. We compare our method with Baseline and TransReID. Our model focuses on more comprehensive areas, while high attention regions are relatively scattered instead of focusing on a small area, which indicates that our model can obtain more unified pedestrian information. In the second column, the ``handbag'' is only a small part of the middle image. Our model learns the Identity-Level information from multiple images to improve the discriminative ability to recognize the ``handbag''. \subsection{Ablation Studies of X-ReID} \subsubsection{The effectiveness of individual components.} There are two important components in our proposed X-ReID: a Cross Intra-Identity Instances module (IntraX) and a Cross Inter-Identity Instances module (InterX). We evaluate the contribution of each component in Table~\ref{table:ablation}. EMA means the \textbf{E}xponential \textbf{M}oving \textbf{A}verage operation in IntraX. The improvement of Baseline+IntraX is more impressive than that of Baseline+EMA, which validates the effectiveness of Identity-Level rather than EMA. Through fusing intra-identity instances, IntraX transfer the Identity-Level knowledge to Instance-Level features to gain promising performance. InterX deals with inter-identity instances to minimize intra-identity variation and maximize inter-identity variation. Compared with Baseline, our full X-ReID significantly boosts the performance by 2.8$\%$ mAP and 0.9$\%$ mAP on MSMT17 and Market1501, respectively. \begin{table}[t] \centering \caption{The ablation study on individual components of X-ReID. EMA is IntraX without $\mathcal{L}_{IntraX}$.} \begin{tabular}{c|cc|cc} \hline \multirow{2}{*}{Methods} & \multicolumn{2}{c|}{MSMT17} & \multicolumn{2}{c}{Market1501} \\ \cline{2-5} & mAP & Rank-1 & mAP & Rank-1 \\ \hline Baseline & 62.3 & 82.2 & 87.1 & 94.6 \\ Baseline+EMA & 62.4 & 82.3 & 87.1 & 94.7 \\ Baseline+IntraX & 64.7 & 83.4 & 87.8 & 94.7 \\ Baseline+InterX & 63.7 & 83.2 & 87.4 & 94.7 \\ X-ReID & 65.1 & 84.0 & 88.0 & 94.9 \\ \hline \end{tabular} \label{table:ablation} \end{table} \begin{figure}[t] \begin{subfigure}{.49\linewidth} \centering \includegraphics[width=1.0\linewidth]{Fig/msmt_1.pdf} \caption{MSMT17} \end{subfigure} \begin{subfigure}{.49\linewidth} \centering \includegraphics[width=1.0\linewidth]{Fig/market_1.pdf} \caption{Market1501} \end{subfigure} \begin{subfigure}{.49\linewidth} \centering \includegraphics[width=1.0\linewidth]{Fig/msmt_2.pdf} \caption{MSMT17} \end{subfigure} \begin{subfigure}{.49\linewidth} \centering \includegraphics[width=1.0\linewidth]{Fig/market_2.pdf} \caption{Market1501} \end{subfigure} \caption{Hyper-parameters analysis of weight $\lambda_1$ and $\lambda_2$ of the entire loss on MSMT17 and Market1501.} \label{fig:lambda} \end{figure} \subsubsection{Hyper-parameters Analysis} We evaluate the impact of weight $\lambda_1$ and $\lambda_2$ of the entire loss (Equation~\ref{formula:total}) in Figure~\ref{fig:lambda}. $\lambda_1$ balances the weight of IntraX and $\lambda_2$ balances the weight of InterX. The first row shows the impact of $\lambda_1$ when $\lambda_2$ is fixed at 0.4. Although the final selected $\lambda_1$ is not the same on the two datasets, the performance fluctuates very little with the change of $\lambda_1$ and mAP is at least above 64.6$\%$ on MSMT17. The second row shows the impact of $\lambda_2$ when $\lambda_1$ is fixed at 20.0 on MSMT17 and 5.0 on Market1501. The performance obtains a further improvement when the value of $\lambda_2$ is around 0.4. \section{Conclusion and Future Work} In this paper, we propose a novel training framework named X-ReID, which contains a Cross Intra-Identity Instances module and a Cross Inter-Identity Instances module. Our proposed methods extract Identity-Level features for more unified and discriminative pedestrian information. Extensive experiments on benchmark datasets show the superiority of our methods over state-of-the-art methods. In the future, more sophisticated solutions for improving the Identity-Level capability can be exploited. \clearpage
\section{Introduction} \label{sec:intro} Transients are celestial objects whose brightness varies on timescales from seconds to years, for example due to explosions of their progenitors. These objects help astronomers to investigate physics under extreme conditions, and there are currently a large number of surveys being carried out to search for extra-galactic transients by regularly monitoring the night sky. Detected objects include classical transients, such as supernovae (SNe) that are luminous optical transients from either a thermonuclear explosion of a white dwarf, or the core-collapse (CC) of a massive star, as well as new and exotic transients. e.g. the kilonova AT2017gfo \citep{GW170817MMA,sss17a,dlt17ck,vista,master,decam,lcogtkn, grawita, Smartt2017}. To correctly classify them, spectroscopy is required, however spectroscopic follow-up resources are scarce, and only a fraction of the currently discovered SNe can be classified in this way \citep{Kulkarni2018}. Investigating the multi-band light curves (LCs) of the transients can also provide information about the mechanism that drives the explosions, such as shock cooling, circumstellar matter (CSM) interaction, radioactive decay or a central engine such as a magnetar. The information is encoded in the LCs in different aspects, e.g. their timescales, shapes and absolute luminosities, both for individual objects and for curated samples of specific types. Much progress has been made by linking multi-wavelength light curves to models, both numerical hydrodynamical models and simpler semi-analytical estimates. For instance, for both SNe Ia and stripped envelope CC SNe, whose emission during the photospheric phase is normally powered by the radioactive decay of synthesized \Ni, \citet{arnett1982} made a semi-analytic model that can reconstruct the bolometric LCs for physical parameters of the explosion and the progenitors, such as the amount of ejected nickel mass, the ejecta mass and the kinetic energy. Therefore, exploring a large sample of SNe provides the opportunity to unveil their underlying physical origins. Such analysis has been performed in a number of studies, e.g. \cite{barbarino, taddia2018csp, prentice2019, lyman16}, but the different studies often use different approaches and codes which makes the direct comparisons less straightforward. A generic code-package to handle light curve fitting for transients of different types, from different surveys, observed with varying cadences, is therefore useful to provide comparable results. For this purpose, we present {\tt HAFFET}\xspace, a data-driven model fitter for transients. Often some spectroscopic information is also available for the SNe and needed to perform parts of the analysis, and {\tt HAFFET}\xspace also includes procedures for example for measuring ejecta velocities from spectra. This paper aims to serve as a description of {\tt HAFFET}\xspace and its capabilities at the time of its first release. This is complemented with a web-based users guide, which the reader should always consult for more up-to-date information\footnote{\href{https://haffet.readthedocs.io/en/latest/}{https://haffet.readthedocs.io/en/latest/}}. This online documentation also contains more technical information and the code itself, whereas this paper aims to describe some of the possibilities in the code-package. Furthermore, as a scientific proof-of-concept of {\tt HAFFET}\xspace, we are in a companion paper exploring a large sample of Type Ib and Ic SNe, observed by the Zwicky Transient Facility \citep[ZTF;][]{Bellm2019, Graham2019}, and spectroscopically classified as part of the Bright Transient Survey (BTS) \citep{fremling2020,perley2020}. That paper (Yang et al. in preparation) contains the analysis of the objects that are used here to demonstrate the capabilities of {\tt HAFFET}\xspace, and is hereafter referred to as Paper I. We have also estimated the luminosities for ZTF SNe Ic-BL using HAFFET in \cite{Corsi2022} and in Anand et al. (in preparation). This paper is organized as follows. In Section~\ref{sec:haffet} we present the code design of {\tt HAFFET}\xspace. In Section~\ref{sec:data}, we describe how {\tt HAFFET}\xspace handle meta and observational data, and in Section~\ref{sec:fitting} we discuss in detail the different available models designed for different types of observational data. In Section~\ref{sec:application} we further explore the sample of ZTF SNe Ib and Ic with {\tt HAFFET}\xspace, complementary to Paper I. Finally, Section~\ref{sec:conclusion} presents our conclusions and provides a short discussion where we put our results in context. \section{HAFFET} \label{sec:haffet} In this section, we introduce the code structure as well as the key components of {\tt HAFFET}\xspace. \subsection{Code Design} \label{sec:cd} In Figure~\ref{fig:flowchart}, we illustrate the main steps as they were generally performed using {\tt HAFFET}\xspace for stripped envelope SNe in Paper I: \begin{enumerate} \item {\tt HAFFET}\xspace started a Python class named {\tt snelist} with a meta table\footnote{In {\tt HAFFET}\xspace, we use pandas dataframes for table construction: \url{https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html}} that includes a list of objects. \item For each object in the meta table, the meta information, e.g. coordinates, redshifts, etc, are standardized, serving as the basis for a new class named {\tt snobject}. \item For {\tt snobject}, a number of built-in functions are available to parse both photometric and spectroscopic data from local or remote sources. \item To anticipate the photometric features, e.g. the peak phase and magnitude, a continuous approach is provided as an optional choice, employing either the gaussian process (GP) regression or analytical SN LC model fittings. \item Once the epochs from various bands have been matched (via binning or interpolations), the spectral energy distribution (SED) and the (pseudo)-bolometric LCs can be estimated. The host galaxy extinction can also be estimated via color comparison to templates. \item Depending on the type of transient, the bolometric LCs can be fitted with a variety of analytical models: we have included the classical Arnett model, and also provide routines for users to import external models from, e.g. MOSFIT \citep{mosfit} and redback\footnote{\href{https://redback.readthedocs.io/en/latest/}{https://redback.readthedocs.io/en/latest/}}. \item Each spectrum was smoothed, normalized, and the continuum removed in order to show the emission and absorption features. For a certain selected line, the absorption components are automatically identified and are then fitted with various models for measuring spectral properties, in particular the minimum of the absorption features to estimate the ejecta velocities. \item All of the photometric and spectral properties from {\tt snobject} may be called by {\tt snelist} and dispersed into parameter space for sample exploration. \end{enumerate} \begin{figure*} \centering \includegraphics[width=0.6\textwidth]{sdapy.pdf} \caption{Flowchart of the main steps in the {\tt HAFFET}\xspace process, performed on the stripped envelop SNe in Paper I. As shown, after getting observational data for a single SN, {\tt snobject} is called to fit on multi-band LCs, which could be used to estimate photometric properties, as well as provide interpolated magnitudes for estimating color and bolometric LC. A further step is to fit bolometric LC with, e.g. the Arnett model, and spectral lines can be also fitted for photospheric velocities, which are often used to help break the degeneracy of the Arnett model. Finally, all the fitted parameters from model fittings are collected by the {\tt snelist} for a sample study.} \label{fig:flowchart} \end{figure*} The functions and their usages of {\tt snobject} and {\tt snelist} can be found in the online documentation\footnote{For example, \url{https://haffet.readthedocs.io/en/latest/snobject.html} for {\tt snobject}.}. In this paper, we give a theoretical overview of {\tt HAFFET}\xspace, and users should consult the corresponding functions for each section on the documentation page for more information and application examples. \subsection{Data Cache and fitting options} \label{sec:cache} {\tt HAFFET}\xspace handles data and fits for various SNe on a case-by-case basis, and below we describe in detail how it operates. First, a global variable called {\tt ZTFDATA}\footnote{{\tt HAFFET}\xspace access to ZTF data via ztfquery \citep{ztfquery}, that follows the IRSA data structure for data storage. In order to be consistent, {\tt HAFFET}\xspace adopted the same global variable and data structure not only for ZTF data but also other resources such as the ATLAS forced photometry.} has to be defined (often in the shell profiles; if not, it will use the current folder). This is the directory for {\tt HAFFET}\xspace to manage cached data, e.g. the photometric data downloaded from online resources. In order to increase code efficiency, it is important to properly cache the samplings as model fitting may take a long time, especially when using the Monte Carlo method. We store and load the cached fitting samplings in {\tt hdf5} format with the joblib\footnote{\href{https://joblib.readthedocs.io/en/latest/index.html}{https://joblib.readthedocs.io/en/latest/index.html}} package, and all these cached files are stored following a dedicated data structure. Then, according to the intrinsic properties and data qualities, different SN data may be fitted to models with different options, e.g. whether there is a tail in the SN LCs, or what is the range of photospheric phases for the Arnett model fitting, or if the automatic identification of absorption features is correct. {\tt HAFFET}\xspace provides default settings in a file for general usage, as well as a possibility for the users to specify parameters for individual SNe\footnote{The parameter files can be found in the defined {\tt ZTFDATA} directory, with {\tt default\_par.txt} for the general options, and {\tt individual\_par.txt} for specific SNe.}. An alternative option to adjust fitting options for particular SNe is to use {\tt HAFFET}\xspace with a Graphical User Interface (GUI), see Figure~\ref{fig:gui}. All the data, fitting parameters, and fitting samplings can be stored and loaded, which is universal to different modes. \begin{figure*} \centering \includegraphics[width=0.8\textwidth]{gui1.png} \includegraphics[width=0.45\textwidth]{gui2.png} \includegraphics[width=0.45\textwidth]{gui3.png} \caption{A view of the {\tt HAFFET}\xspace GUI showing the model fittings on multi-band LCs, spectral lines and the constructed bolometric LC. In the upper panel we show the control window of the GUI.} \label{fig:gui} \end{figure*} \section{Data Input} \label{sec:data} Two different kinds of data, i.e. meta and observational data, might be employed in the fitting procedure. \subsection{Meta data} \label{sec:meta} Users may want to supply additional information for the SNe in addition to the observational data, for example spatial coordinates for forced photometry services or the redshifts to correct observing data to the rest frame. In {\tt HAFFET}\xspace, both the Bright Transient Survey explorer\footnote{\url{https://sites.astro.caltech.edu/ztf/bts/explorer.php}} (BTS) catalog and the Open Astronomy Catalog\footnote{\url{https://github.com/astrocatalogs/OACAPI}} (OAC) tables are available, providing meta data for the SNe. Users can also create their own tables specifically for their needs, with proper column names following this specific scheme\footnote{More keywords of the scheme can be found at the {\tt snelist} part of \href{https://github.com/saberyoung/HAFFET/blob/master/sdapy/data/default_par.txt}{https://github.com/saberyoung/HAFFET/blob/master/sdapy/data/default\_par.txt}.}: \begin{verbatim} ... ... idkey : objid # str # meta key as index idkey1 : alias # str # meta key as alias rakey : ra # str # meta key for ra deckey : dec # str # meta key for dec zkey : z # str # meta key for redshift distkey: dist # str # meta key for distance ... ... \end{verbatim} Below is an illustration showing how only columns with certain names can be appropriately identified and processed to the {\tt HAFFET}\xspace meta table. Here, the object ID and coordinates would be read correctly, but the redshifts would be incorrect because of the erroneous column name (redshift instead of $z$). \begin{verbatim} objid,ra,dec,redshift ZTF18aajpjdi,13:18:06.62,+27:52:24.2,0.0746 ZTF18aahtkze,11:14:19.24,+34:28:43.7,0.0693 ZTF18aapictz,11:59:37.00,+27:31:50.0,0.084 ... ... \end{verbatim} The Object ID is the only item required as the identifier of an object. In most cases, an object would have multiple names, e.g. the survey name and the IAU name. In order to compile all of these names that may be used to search for a certain object, an alias ID column is established as an option. Coordinates are essential mainly when using forced photometry services, and for getting Milky Way extinctions. There are built-in functions that can handle coordinates with different formats via astropy\footnote{\url{https://docs.astropy.org/en/stable/index.html}}, as well as the healpix\footnote{\url{https://healpy.readthedocs.io/en/latest/index.html}} indices for mollweide plots. The redshift for each object should be well determined; otherwise all the analysis will be done in the observer frame. Unless distances are specified, redshifts were converted to distances using a flat cosmology with H$_0=70$~km~s$^{-1}$~Mpc$^{-1}$ and $\Omega_{\rm{m}} = 0.3$. This was done using the redshifts in the CMB frame where the dipole parameters were obtained from \cite{Fixsen}. We also included corrections for peculiar velocities using the formalism of \cite{2015MNRAS.450..317C}. For each individual SN we include an uncertainty on the peak magnitude corresponding to a 150~km~s$^{-1}$ uncertainty included in the peculiar velocity correction and a systematic $\pm3$~km~s$^{-1}$~Mpc$^{-1}$ error on the adopted Hubble constant. For the most nearby objects, with the largest peculiar motion corrections, the relative errors on the absolute magnitudes are the largest. Comparing the estimates for peculiar velocity corrections for our SNe (Paper I) within $z < 0.015$ with values estimated using \cite{2015ApJ...807...35M} and the corrections provided by NED for the Virgo, Great attractor and Shapley cluster \citep{Mould2000ApJ...529..786M} we find a rms of 0.19 mag, so for these low-z SNe we add another 0.15 mag to the peak luminosity uncertainty in our error budget. The transient type matters for some of the analysis, for example which spectral line should be used to determine the photospheric velocity, or which intrinsic colour template should be compared with to estimate the host galaxy reddening. {\tt HAFFET}\xspace is able to supply this from the BTS or OAC catalogs. There is also a straightforward photometric categorization procedure within {\tt HAFFET}\xspace as implemented from astrorapid\footnote{\url{https://astrorapid.readthedocs.io/en/latest/index.html}}. Moreover, since {\tt HAFFET}\xspace provides spectral line identification, this is aiding in a more secure classification of the transient types. Within {\tt HAFFET}\xspace we correct all photometry for Galactic extinction, using the Milky Way (MW) color excess $E(B-V)_{\mathrm{MW}}$ toward the position of the SNe. These are all obtained from \cite{2011ApJ...737..103S}\footnote{By default, {\tt HAFFET}\xspace use Milky Way extinction in the meta table. If it is not available, and the coordinates are properly parsed, {\tt HAFFET}\xspace turn to get extinctions from \cite{2011ApJ...737..103S} map via dustmaps \citep{dustmaps}, i.e. \url{https://dustmaps.readthedocs.io/en/latest/}}. All reddening corrections are applied using the \cite{1989ApJ...345..245C} extinction law with $R_V=3.1$. Host galaxy extinction is more uncertain. One method to estimate host-galaxy extinction is to make use of the fact that SNe often have similar intrinsic colors after peak \citep[e.g.,][]{Drout2011}. This was developed by \cite{stritzingercolors} and \cite{taddia2018csp} for stripped envelope SNe and Type II SNe. For super-luminous SNe (SLSNe), \citet[][their table A4]{zhihao} investigated the $g-r$ colours at peak for a large sample of ZTF objects, which is used by {\tt HAFFET}\xspace as templates for SLSNe once the object has both $g$- and $r$-band data. To estimate the values for the host-galaxy extinction, we use these intrinsic SN color-curve templates and attribute the difference between the observed and the intrinsic color to the host galaxy reddening. \subsection{Observational data} \label{sec:obsdata} Once a list of objects is constructed using an appropriate meta table, each object's observational data must be assigned. Besides the image (see Fig. \ref{fig:finder}), {\tt HAFFET}\xspace can be utilized to work with photometric and spectroscopic data, and in this section we describe how to input these data to {\tt HAFFET}\xspace. \begin{figure*} \centering \includegraphics[width=0.6\textwidth]{finder.png} \caption{The image of the field of SN 2020bcq as a finder that was automatically made by {\tt HAFFET}\xspace. The images are queried with the PS1 Image Cutout Service\tablenotemark{a}, while the SDSS field stars (the green open circles) are downloaded via astroquery\tablenotemark{b}. The position of SN 2020bcq is marked as the red source in the middle of the inset.} \label{fig:finder} \tablenotetext{a}{\url{https://outerspace.stsci.edu/display/PANSTARRS/PS1+Image+Cutout+Service}} \tablenotetext{b}{\url{https://astroquery.readthedocs.io/en/latest/}} \end{figure*} \subsubsection{Using private data and arbitrary input formats} \label{sec:private} Different datasets may have significantly different data formats, depending on how the data was reduced and presented. For example, certain codes favor the \texttt{json} format, while others make use of the \texttt{csv} format. Many sources may also use various keywords to describe the data, e.g. different notations of magnitudes or fluxes with distinct units. By asking for particular previously determined keywords, {\tt HAFFET}\xspace uses a pandas dataframe to cope with pure text forms and streamline the procedure. In the example shown below, the photometric data file should use the same keywords in order for them to be properly read\footnote{More keywords of the scheme can be found at the {\tt snobject} part of \href{https://github.com/saberyoung/HAFFET/blob/master/sdapy/data/default_par.txt}{https://github.com/saberyoung/HAFFET/blob/master/sdapy/data/default\_par.txt}.}: \begin{verbatim} ... ... jdkey : jdobs # str # julian date magkey : mag # str # AB magnitude emagkey : emag # str # magnitude error limmagkey: limmag# str # limiting magnitude fluxkey : flux # str # flux (micro Jy) efluxkey : eflux # str # flux error filterkey: filter# str # filters ... ... \end{verbatim} It is important to note that \texttt{jdkey} and \texttt{filterkey} are strictly required, and either mag/emag or flux/eflux should be provided after that. Then, to convert between magnitudes and fluxes, built-in functions can be utilized. {\tt HAFFET}\xspace uses a default zeropoint of 23.9, which is appropriate for converting fluxes measured in micro Janskys. It frequently happens that LCs from different sources do not match up. This can be due to a variety of factors, such as the methodology used to estimate the photometry, the way standard stars were chosen, or not correcting for the different filter functions. Therefore, {\tt HAFFET}\xspace makes a \texttt{source} column whenever a LC is appropriately included in order to display the data origins. Similar plain text files with either 2 or 3 columns are required for input of spectra, as well as an observation time that might be used later to estimate the line velocity evolution. The three columns present the wavelengths, fluxes, and their errors. When making spectral fits, {\tt HAFFET}\xspace has built-in methods to mimic flux errors depending on the spectral quality if errors are not provided. The flux units for spectra could be arbitrary, and {\tt HAFFET}\xspace is able to absolute calibrate them with interpolated photometric magnitudes. \subsubsection{Using data from public online sources} \label{sec:gm} Since open web servers offer data in a consistent data format, {\tt HAFFET}\xspace contains built-in functions for obtaining data from them, i.e. the ZTF and ATLAS Forced Photometry Services, the Open Astronomy Catalog API, and the Growth marshal/fritz broker for the internal ZTF groups\footnote{Users can easily add sources from their own API in the {\tt HAFFET}\xspace package following a consistent data format, and feel free to contact us for adding them into the GUI.}. A valid set of authorizations is required by {\tt HAFFET}\xspace to access these services if a user wants to utilize them. As shown in Fig. \ref{fig:ztfbase}, for the ZTF Forced Photometry Services the user can use {\tt HAFFET}\xspace to check if the object is covered by multiple fields, and if so, correct the baseline of different fields in the same filter. More details can be found in \citet[][see their Fig. 4]{yuhan2019}. \begin{figure*} \centering \includegraphics[width=0.6\textwidth]{baseline.png} \caption{Baseline correction for ZTF forced photometry LCs exemplified by SN 2020bcq. This target was observed in three filters (g, r and i band), and two fields (field 674 and 171). Observations associated with different fcqf ID (using Eq. 1 of \citealp{yuhan2019}) and counts are shown in distinctive colors. The two red vertical dashed lines are set based on the user option for the selection of baseline range. The observations within the range are used to set the baseline flux levels, which are aligned by {\tt HAFFET}\xspace so that observations from different fields for the same filter are mutually consistent.} \label{fig:ztfbase} \end{figure*} \section{Model Fittings} \label{sec:fitting} {\tt HAFFET}\xspace is built to fit functions to a variety of datasets, including spectral absorption features and many kinds of LCs. Despite having very different data, these can be fitted using the same techniques. In {\tt HAFFET}\xspace we therefore specify a number of "models" that provide the objectives for the data to approach as well as so-called "engines" that are used to prepare the dataset for certain fits. There are currently nine engines available in {\tt HAFFET}\xspace, and these are shown in Table~\ref{tab:engines}, along with a variety of built-in models for each of them, see Table~\ref{tab:models}. In this section, we describe all built-in engines and models, show how to tune their hyperparameters, and explain how the user can define their own engines and models. \begin{table*} \caption{Table of built-in engines defined in {\tt HAFFET}\xspace.} \begin{center} \begin{tabular}{cc} \hline\hline Engine name & Description \\ \hline multiband\_early & multi-band LCs at early phases \\ multiband\_main & multi-band LCs at around the peak epoch \\ bol\_early & bolometric LCs at early phases \\ bol\_main & bolometric LCs at around the peak epoch \\ bol\_tail & bolometric LCs at the tail phases \\ bol\_full & bolometric LCs for the full range \\ sed & spectral energy distribution data, \\ & i.e. multi-band photometry or spectra \\ specline & spectral line absorption feature \\ specv\_evolution & spectral/photospheric line velocities \\ \hline \end{tabular} \label{tab:engines} \end{center} \end{table*} \begin{table*} \caption{Table of built-in models defined in {\tt HAFFET}\xspace. Here we list only the basic models, and in {\tt HAFFET}\xspace there are also models with multiple components, e.g. the Arnett model at the main peak plus the tail model, and a boundary of time between them is set as a free parameter as well. For such a case, we use a bol\_full engine to prepare bolometric LCs for model fitting.} \begin{center} \begin{tabular}{cccc} \hline\hline Model Name & Engine & Description & Reference(s) \\ \hline bazin & multiband\_main & parametric model suited for SNe Ia LCs & \cite{bazin} \\ villar & multiband\_main & parametric model for a broad range of LC & \cite{villar} \\ & & morphologies, e.g. with bumps or plateau & \\ risepl & multiband\_early & power law model for the early rise of SNe & \cite{Miller_2020} \\ salt2 & multiband\_main & empirical model for SNe Ia LCs & \cite{salt2} \\ arnett & bol\_main & radioactive model for bolometric LCs & \cite{arnett1982} \\ & & of SNe Ia or CC at around the peak epochs & \\ tail & bol\_tail & radioactive model for bolometric LCs & \cite{Wygoda2019} \\ & & of SNe Ia or CC at the tail phases & \\ sbo & bol\_early & shock cooling tail model for SNe IIb/Ib & \cite{piro2021} \\ magnetar & bol\_main & magnetar model for SLSNe & \cite{Nicholl_2017} \\ gauss & specline & Gaussian model for spectral line profile & \cite{gauss} \\ voigt & specline & Voigt model for spectral line profile & \cite{voigt} \\ exponential & specv\_evolution & exponential model for velocity evolution & \cite{Fremling2018} \\ \hline \end{tabular} \label{tab:models} \end{center} \end{table*} \begin{figure*} \centering \includegraphics[width=0.6\textwidth]{model_fitter.pdf} \caption{Flowchart illustrating model fitting procedures of {\tt HAFFET}\xspace. As shown, {\tt HAFFET}\xspace first obtain model function and priors, as well as data to be fitted that were prepared by the engines. Then a minimizing process is performed to constrain model parameters. The output could be used as prior for MCMC routines. Finally the fitted samplings can be called by {\tt HAFFET}\xspace to, e.g. produce parameter contours, and reproduce observational data.} \label{fig:modelfit} \end{figure*} \subsection{Defining models} \label{sec:model} A \texttt{python} file that contains analytical functions and a \texttt{json} file that specifies the engine and parameters are used to define each model in {\tt HAFFET}\xspace. Below is an example using the \texttt{json} file of the power-law fits (which is further discussed in section~\ref{sec:multiearly}): \begin{verbatim} modelmeta = { ... 'powerlaw_multiple': { 'engine': 'multiband_early', 'alias': [ 'pl', 'powerlaw', 'Powerlaw', ], 'description': 'Power law fits', 'func': 'functions.powerlaw_full', 'parname' : [ r'$t_\mathrm{fl}$', r"$A$", r"$\alpha$", r"$C$", ], 'par' : [ 'texp', 'a', 'alpha', 'c', ], 'bestv': { 'texp' : -18, 'a' : 100, 'alpha' : 2, 'c' : 60, }, 'bounds': { 'texp' : [-100, 0], 'a' : [0, 10000], 'alpha' : [0, 10], 'c' : [0, 10000], }, 'same_parameter': ['texp'], 'fit_error' : True, }, ... } \end{verbatim} As shown, the \texttt{powerlaw\_multiple} model would be called to fit data prepared by the \texttt{multiband\_early} engine with the \texttt{powerlaw\_full} functions having four free parameters. As discussed in Section~\ref{sec:optimize}, there are two different likelihoods available in {\tt HAFFET}\xspace. By default, {\tt HAFFET}\xspace uses a Gaussian likelihood, while if we set \texttt{fit\_error} = True, it will include one more term to the likelihood as additional model uncertainties. The \texttt{same\_parameter} item decides whether to fit multiple band LCs simultaneously or independently. If the \texttt{same\_parameter} is left blank, {\tt HAFFET}\xspace will fit the LCs in different bands one at a time. If some other parameters are specified, such as \texttt{t\_exp} for example, {\tt HAFFET}\xspace fit all bands at once with the same \texttt{t\_exp}, which is the epoch of first light for such a case. \subsection{Built-in models} \label{sec:builtin} In the sections that follow we outline the fundamental concepts of the built-in models while highlighting the possibility of experimenting with various fitting choices, such as different free parameters, likelihoods, or fitting patterns. \subsubsection{multiband\_early models} \label{sec:multiearly} Power-law fits are working with multiple-band photometric data prepared by the 'multiband\_early' engine. These fits can for example be used to estimate explosion epochs and rise times, but the precision by which we can constrain the first light is also of importance for many other investigations (for example for coincidence studies with neutrino signals or gravitational wave detections). \cite{Miller_2020} developed a Bayesian framework to model the early rise of LCs as a power law in time in their Eq. 1: \begin{equation} f_b(t) = C + H[t_\mathrm{fl}] A_b (t - t_\mathrm{fl})^{\alpha_b}, \label{eqn:flux_model} \end{equation} where C is the baseline flux present in the reference image prior to SN discovery, $t_\mathrm{fl}$ is the time of first light, $H[t_\mathrm{fl}]$ is the Heaviside function equal to 0 for t $< t_\mathrm{fl}$ and 1 for t $\geq t_\mathrm{fl}$, $A_\mathrm{b}$ is a constant of proportionality in filter b, and $\alpha_\mathrm{b}$ is the power-law index in filter b. \cite{Miller_2020} applied this framework to a subset of normal SNe Ia from ZTF to simultaneoulsy model the evolution in both the ZTF $g$ and $r$ filters. This assumes that the epoch of first light is the same in the two ZTF bands, which is a fair assumption given the ZTF cadence and the similarity of the SN ejecta opacity at these wavelengths. In {\tt HAFFET}\xspace we follow the same methodology to characterize the early emission in the \texttt{powerlaw\_multiple} model (see section \ref{sec:model}), but also provide the possibility to fit the different band LCs independently by removing \texttt{same\_parameter} in the \texttt{power\_single} model. As in \cite{Olling2015}, \cite{Miller_2020} only include observations up to 40\% of the peak amplitude of the SN LC, and note that this particular choice, instead of 30\% or 50\%, does slightly affect the final inference for the model parameters. For comparison we adopt the same settings as default in the \texttt{multiband\_early} engine, where the peak amplitude in each band should be previously estimated via the gaussian process or other \texttt{multiband\_main} models. The explosion epoch can also be fitted to bolometric models as a free parameter, or estimated as the middle of the last non-detection and the first detection epochs. In {\tt HAFFET}\xspace, we provide users the option to choose their method of estimation. \subsubsection{multiband\_main models and Gaussian process} \label{sec:multimain} There are various spline techniques available to interpolate the multiple band photometric data around the main peak, i.e. Gaussian Process (GP) regression and the analytic model fittings. In {\tt HAFFET}\xspace, we provide a non-parametric data-driven interpolation technique (i.e. GP) to serialize the LCs. In order to include color effects, we perform time-series forecasting on the joint multi-band (e.g. $g$ and $r$) fluxes convolved with the wavelengths. We use a flat mean function\footnote{Other mean functions are also available in {\tt HAFFET}\xspace, such as the Bazin or Villar models.} for the flux form, and establish two kernels, i.e. a constant kernel for the wavelengths, and a stationary Matern32 kernel for the fluxes, with the {\tt GEORGE}\footnote{\href{https://george.readthedocs.io}{https://george.readthedocs.io}} package. The GP interpolation becomes less informative with larger uncertainties and when the data are sparser. For estimating physical parameters for normal SNe, an alternative approach is then to fit the data using analytic functions, such as those used by \cite{bazin, Karpenka, kessler1, kessler2, villar}. For this purpose we included the \cite{bazin} and \cite{villar} models in {\tt HAFFET}\xspace. The 'Bazin' model is appropriate for SN LCs without fluctuations, whereas the 'Villar' model is also useful to fit plateaus and bumps. For the Bazin model, the flux form is determined by 5 parameters: \begin{equation} \label{eqn:bazin} F(t) = \mathrm{A} \frac{e^{-(t-t_0)/\tau_\mathrm{fall}}}{1+e^{-(t-t_0)/\tau_\mathrm{rise}}} + \mathrm{B} \end{equation} where \citet[][their fig.~8]{taddia2015sdss} illustrate the different parameters and how they contribute to the light curve properties. We can obtain the date of maximum from the derivative of this function as $t_\mathrm{max} = t_0 + \tau_\mathrm{rise} \mathrm{log} \frac{-\tau_\mathrm{rise}}{\tau_\mathrm{rise}+\tau_\mathrm{fall}}$ \citep{bazin}. The functional form of the Villar model is similar to the Bazin model, but incorporates a plateau component by adding two additional free parameters: \begin{equation} \label{eqn:villar} F(t) = \begin{cases} \frac{A+\beta(t-t_0)}{1+e^{-(t-t_0)/\tau_\mathrm{rise}}} & t<t_1 \\ \frac{\left(A+\beta\left(t_1-t_0\right)\right)e^{-(t-t_1)/\tau_\mathrm{fall}}}{1+e^{-(t-t_0)/\tau_\mathrm{rise}}} & t\ge t_1 \end{cases} \end{equation} The comparison of the Villar model with the Bazin model and the \cite{Karpenka} model are shown in \citet[][their fig.~3]{villar}. \subsubsection{sed models and the luminosity} \label{sec:lum} Three approaches are adopted in {\tt HAFFET}\xspace to estimate the bolometric luminosity based on the extinction-corrected brightness and the distance. First, we use the bolometric correction (BC) coefficients of \cite{Lyman14, lyman16}. These color-dependent coefficients were measured by fitting the spectral energy distributions of a sample of stripped-envelope (SE) SNe that have good observational coverage at ultra-violet, optical, and infrared wavelengths, and can be utilized as long as the light curves for a SN of interest are available in at least two bands. The bolometric magnitude is expressed as \begin{equation} M_{bol} = M_{\odot,bol}-2.5\log_{10}\left(\frac{L_{bol}}{L_{\odot,bol}}\right), \label{eq:bolo} \end{equation} where $L_{bol}$ is the bolometric luminosity, $L_{\odot,bol}$ and $M_{\odot,bol}$ are the luminosity and bolometric magnitude of the Sun. A BC to filter $x$ is defined as: \begin{equation} \text{BC}_{x} = M_{bol} - M_{x}, \label{eq:bc} \end{equation} where $M_{x}$ is the absolute magnitude of the SN in filter \emph{x}. For example, if a SE SN is monitored in the $g$ and $r$ filters, then according to \citet[][their table 2]{Lyman14}, this SE SN during the photospheric phases ($-0.3~{\rm mag} < g-r < 1.0~{\rm mag}$) will have \begin{equation} \text{BC}_{g} = 0.054 - 0.195 \times (g-r) - 0.719 \times (g-r)^{2} \label{eq:bc_se_sl} \end{equation} In this way, the bolometric LCs of the SNe can be estimated by matching up the $g$ and $r$-band magnitudes. Three approaches in {\tt HAFFET}\xspace are utilized for the color epoch match-up, i.e. binning, GP, and fitting. {\tt HAFFET}\xspace projects $g$- and $r$-band detections onto a grid (with a user-defined binning, such as 1 day) that may be readily matched. The binning method is taking all epochs with both bands available, and convert them to bolometric magnitudes and hence luminosities. For epochs with only one band, {\tt HAFFET}\xspace can estimate magnitudes for the missing band from either GP interpolation or from analytic fittings. The above match-ups can also be applied to multiple filters. In {\tt HAFFET}\xspace, we can construct SEDs as a diluted blackbody (BB) distribution for those epochs with multiple-band data, and the luminosity can then be calculated by integrating the fitted BB from 2000 \,\AA~ to 20000 \,\AA~\footnote{These are the defaults, but can easily be revised in the configuration file.}. We fit a diluted BB function with multiple bands using the following formula\footnote{The filter information, e.g. the central wavelengths and widths, are taken from the superbol \citep{superbol} package.}: \begin{equation} F_{\lambda}=(R/d)^2 \cdot \epsilon^2 \cdot \pi \cdot B(\lambda, T) \times 10^{-0.4 \cdot A_{\lambda}}, \end{equation} where $F_{\lambda}$ is the flux at wavelength $\lambda$, $B$ is the Planck function, $A_{\lambda}$ is the extinction in magnitudes, $T$ is the temperature, $R$ is the radius, $d$ is the distance, and $\epsilon$ is the dilution factor \citep{E96, Hamuy01, D05} that represents a general correction between the fitted BB distribution to the observed fluxes. We use the values from \citet{D05} in {\tt HAFFET}\xspace for SNe II. For other types of SNe, the default is to ignore the dilution factor but users can also use their own functions. Finally, the derived magnitudes (from section \ref{sec:multiearly} and \ref{sec:multimain}) can also be used to absolute calibrate the input spectra, which could then be used to fit the SED models (e.g. the blackbody function) or integrated for bolometric luminosities. For this approach, we have included the transmission information for ZTF $g$, $r$ and $i$ filters in {\tt HAFFET}\xspace. After obtaining the bolometric LCs, there are a variety of models available in {\tt HAFFET}\xspace that can fit them. \subsubsection{bol\_early models} \label{sec:sbo} Following shock breakout, the emission from an astrophysical explosion can be dominated by the radiation of shock-heated material as it expands and cools, known as shock cooling emission. This is often seen for a subgroup of supernovae, SNe IIb, that exhibits double-peaked light curves, but there is also evidence for this kind of early emission from other transients, presumably with extended atmospheres. In {\tt HAFFET}\xspace, we implement the shock cooling emission model from \cite{piro2021}, that fits LCs prepared by the 'bol\_early' engine, and here the luminosity can be expressed as \citep[][their functions 17 and 20]{piro2021}: \begin{equation} \label{eqn:sbo} L(t) = \begin{cases} {\rm P}~(\frac{t_d}{t})^{4/(n-2)} & t<t_d \\ {\rm P}~exp\left[ (-0.5~(\frac{t}{t_d})^2-1) \right] & t\ge t_d \end{cases} \end{equation} where the prefactor $P = \frac{\pi(n-1)}{3(n-5)} \frac{c~R_e~v_t^2}{\kappa}$, $t_d = \left[ \frac{3~\kappa~K~M_e}{(n-1)v_tc} \right]^{1/2}$, and $v_t = \left[ \frac{(n-5)(5-\delta)}{(n-3)(3-\delta)} \right]^{1/2}~(\frac{2E_e}{M_e})^{1/2}$. Here, $n=10$, $\delta=1.1$, $K=0.119$, and $t$ is the time relative to the explosion epoch. Due to the hot temperatures during shock cooling emission, the function can be simplified by assuming a constant electron scattering opacity $\kappa$. \cite{piro2021} use $\kappa=0.2~{\rm cm^2g^{-1}}$ for their helium-rich SNe. In {\tt HAFFET}\xspace, we could either fit the opacity as a free parameter, or use a constant opacity following \citet[][their table 6]{Nagy2018}: $\kappa=0.21~{\rm cm^2g^{-1}}$ for SNe IIP, $0.20~{\rm cm^2g^{-1}}$ for IIb, $0.18~{\rm cm^2g^{-1}}$ for Type Ib, and $0.10~{\rm cm^2g^{-1}}$ for Type Ic SNe, or use constant opacity from user input, e.g. for the ZTF Ibc sample study in Paper I, we use a constant opacity $\kappa=0.07~{\rm cm^2g^{-1}}$ for both SNe Ib and Ic following \citet{Chugai2000,leo2021,barbarino} \footnote{Examining potential variations between the SN Ib and Ic progenitors is one of the objectives of Paper I. Therefore, it is critical to make be able to track if the outcome is dependent of the assumptions, e.g., in assuming the same opacity for both SNe Ib and Ic, but also if the proceedures for host extinction corrections or velocity estimates differ.}. \subsubsection{bol\_main models} \label{sec:arnett} In {\tt HAFFET}\xspace, we provide built-in functions to compare the constructed bolometric LCs with the semi-analytic models from \cite{arnett1982} for normal core-collapse SNe for epochs around the main peak. For a normal SN after the explosion, as the ejecta expand, the decay of \Ni~ to $\rm ^{56}Co$~ and afterward to $\rm ^{56}Fe$~ releases energy into the ejecta which powers the optical LC, including the luminous peak and the later epochs\footnote{We refer to it as the tail phases in this work. When the SN LC reaches a later phase of linear magnitude fall with time, it is said to have reached its LC tail.}. Thus, exploring the bolometric LCs during the peak and tail phases can reveal the properties of the explosion and the progenitor. With several simplifying assumptions, e.g. the ejecta are expanding homologously, the radiation pressure dominates over the gas pressure, and with a constant opacity and small initial radius, \citet[][their Eq. 36]{arnett1982} provides an expression for all Type I SN LCs, that can be used to estimate the bolometric luminosity with the radioactive inputs, see also \cite{Valenti2008}. We assume full $\gamma$-ray trapping since the Arnett formalism is constructed for the LCs around the peak, and get \citep[see][]{chatzo2012, leo2021}: \begin{eqnarray} \label{eq:boloArnett} L_{ph}(t)=M_{\rm{Ni}}\biggl[(\epsilon_{\rm{Ni}}-\omega\epsilon_{\rm{Co}})\,\Lambda(x,y)+\omega\epsilon_{\rm{Co}}\,\Lambda(x,s)\biggr] \end{eqnarray} where $x\equiv t/\tau_m$, $y\equiv 0.5\tau_m/\tau_{\rm{Ni}}$, $s\equiv 0.5\tau_m/\tau_{\rm{Co}}$, $\omega\equiv \tau_m/(\tau_{\rm{Co}}-\tau_{\rm{Ni}})$. Here, $\epsilon_{\rm Ni}= 3.9 \times10^{10}$~erg~g$^{-1}$~s$^{-1}$ and $\epsilon_{\rm Co}=6.8 \times 10^9$~erg~g$^{-1}$~s$^{-1}$ are the specific heating rates of Ni and Co decay, respectively, and $\tau_{\rm{Ni}}=8.8$~days and $\tau_{\rm{Co}}=111.3$~days are their corresponding decay (e-folding) timescales. Using \citet[][his Eq. 31]{arnett1982}: \begin{eqnarray} \label{eq:boloArnett_lambda} \Lambda(x,y)=e^{-x^2}\mathop{{\int}}^x_0e^{-2\rm{z}\rm{y}+\rm{z}^2} 2\rm{z} dz \end{eqnarray} $\tau_m$ is the characteristic time scale, and by assuming a uniform density within the ejecta: \begin{eqnarray} \label{eq:taum} \tau_m^2 = \frac{\kappa_{opt}}{\beta c} \sqrt{\Lambda\frac{M_{ej}^3}{E_{kin}}} \end{eqnarray} where $\beta=13.8$ \citep{Valenti2008}, $\Lambda=6/5$ \citep{lyman16}, and the opacity $\kappa_{opt}$ is discussed at the end of Section 4.2.4. In {\tt HAFFET}\xspace, users have the option to select the free parameters that fit the Arnett model. For instance, the bolometric LCs can be fitted with $M_{\rm Ni}$ + $\tau_m$, or $M_{\rm Ni}$ + $M_{ej}$ + $E_{kin}$, and it is possible to vary the explosion epoch and opacity as free parameters as well. The default {\tt HAFFET}\xspace model is the $M_{\rm Ni}$ + $\tau_m$, and by doing this, an additional function is needed to break the degeneracy between the ejecta mass ($M_{ej}$) and the kinetic energy ($E_{kin}$) in Eq. \ref{eq:taum}, and for this an estimate for the velocity is employed. As discussed in \citet[][their section 5.3]{Dessart2016}, a 'representative' expansion rate, $V_m$ is defined as, \begin{eqnarray} \label{eq:vm} V_m\equiv \sqrt{2E_{kin}/M_{ej}} \end{eqnarray} that can be used to break the degeneracy between $M_{ej}$ and $E_{kin}$ in Eq. \ref{eq:taum}. With a large grid of 1D radiative-transfer simulations for SE SNe, they derived analytic expressions between $V_m$ and $V_{ph}$ at the peak epoch as follows: \begin{eqnarray} V_{\rm{ph}}(\rm{He~I~\lambda 5876}) = 2.64 + 0.765~\rm{V_m}, \label{eq:vm1} \\ V_{\rm{ph}}(\rm{O~I~\lambda7772}) = 2.99 + 0.443~\rm{V_m} \label{eq:vm2} \end{eqnarray} and suggest to measure $V_{\rm{ph}}$ from ${\rm He~I}~\lambda5876$~ in SNe IIb/Ib and from ${\rm O~I}~\lambda7772$~ in SNe Ic. We derive spectral line velocities ($V_{\rm{ph}}$) in section~\ref{sec:vel}, and follow their methodology to convert $V_{\rm{ph}}$ into $V_{\rm{m}}$ with Eqs.~\ref{eq:vm1} and \ref{eq:vm2}. Finally with Eqs. \ref{eq:taum} and \ref{eq:vm}, we can estimate $M_{ej}$ and $E_{kin}$ separately with $V_m$ and the Arnett fitted $\tau_{m}$, as: \begin{eqnarray} M_{\rm{ej}} = \frac{V_m~\tau_m^2~\beta~c}{\kappa_{opt}~\sqrt{2~\Lambda}}, \label{eq:mej} \\ E_{\rm{kin}} = \frac{V_m^3~\tau_m^2~\beta~c}{\kappa_{opt}~\sqrt{8~\Lambda}}. \label{eq:ek} \end{eqnarray} We explore the relationship of $\tau_m$ on $M_{ej}$ and $E_{kin}$ in the left panel of Fig. \ref{fig:ekmej}. As shown, the $M_{ej}$ and $E_{kin}$ can be decided with $\tau_m$ together with a velocity measurement. As example with SN 2020bcq, the fitted $\tau_m$ is $\sim$ 10 days (see Fig. \ref{fig:arnettcompare}) and the peak velocity is $\sim$ 10,000 $\rm km~s^{-1}$ (see Fig. \ref{fig:velexp}), therefore according to Fig. \ref{fig:ekmej}, $M_{ej}$ and $E_{kin}$ should be around 1 {\ensuremath{\mathrm{M}_{\odot}}}~ and $1\times 10^{51}$ erg, respectively. \begin{figure*} \centering \includegraphics[width=0.45\textwidth]{ek_on_mej_taum.png} \includegraphics[width=0.45\textwidth]{ek_on_mej_t0.png} \caption{In the left panel, we visualize Eq. \ref{eq:taum} and Eq. \ref{eq:vm}, showing how both $M_{ej}$ and $E_{kin}$ can be estimated with $\tau_m$ together with a velocity measurement. In the right panel, we instead show $T_0$ of the bolometric tail in Eq. \ref{eq:t0}. Here we assume constant opacities, i.e. $\kappa=0.2~{\rm cm^2g^{-1}}$ and $\rm \kappa_\gamma=0.027~cm^2g^{-1}$} \label{fig:ekmej} \end{figure*} \subsubsection{bol\_tail models} \label{sec:tail} An alternative way to estimate the \Ni~ mass is using the luminosity at the tail, see for example the work by \cite{Afsariardchi2021}. In {\tt HAFFET}\xspace, by default the 'tail' of the LC is defined as the epochs after 60 rest-frame days post-peak. We fit the tail bolometric LCs with the model from \citet[][their Eqs. 10, 11 and 12]{Wygoda2019}: \begin{eqnarray} \label{eq:lni} && L \simeq L_\gamma \big(1-e^{-(T_0/t)^2} \big) + L_ {\rm pos}, \end{eqnarray} where t is the time since the explosion in the rest frame, $L_\gamma$ and $L_{\rm pos}$ are the total energy release rate of gamma rays and positron kinetic energy respectively. The term in parenthesis is a deposition factor, which represents the incomplete trapping of gamma rays with $T_0$ as the partial trapping timescale. $T_0$ can be translated to ejecta mass and kinetic energy in a similar way as $\tau_m$ \citep{Clocchiatti1997}: \begin{eqnarray} \label{eq:t0} T_0^2 = \frac{c~\kappa_\gamma~M_{ej}^2}{E_{kin}} \end{eqnarray} where $\rm \kappa_\gamma=0.027~cm^2g^{-1}$ is the gamma ray opacity. The luminosity terms can be expressed as: \begin{eqnarray} \label{eq:lpos} && L_\gamma = M_{\rm Ni} \Big( (\epsilon_{\rm Ni}-\epsilon_{\rm Co})~e^{-t/t_{\rm Ni}}+ \epsilon_{\rm Co}~e^{-t/t_{\rm Co}}\Big), \\ && L_{\rm pos} = 0.034~M_{\rm Ni}~\epsilon_{\rm Co} \Big( -e^{-t/t_{\rm Ni}} + e^{-t/t_{\rm Co}}\Big) \end{eqnarray} In the right panel of Fig.~\ref{fig:ekmej}, we show that the $M_{ej}$ and $E_{kin}$ can be decided with $T_0$ together with a velocity measurement. \subsubsection{specline and specv\_evolution models} \label{sec:vel} As discussed in section~\ref{sec:arnett}, the expansion velocity $V_m$ is needed to break the degeneracy in both the Arnett and the tail models. In this section, we describe how we measure the expansion velocities from the input spectra. The specline engine in {\tt HAFFET}\xspace offers spectral data within a range for model fits. A line's intrinsic wavelength and the permitted velocity ranges can be used by {\tt HAFFET}\xspace in addition to a manual input to infer the fitting range. Such an automated spectral fitting process is shown in the lower left panel of Fig.~\ref{fig:gui}. After correcting for extinction and time dilation, we fit the continuum of a spectrum with a polynomial, which is afterwards subtracted. We smooth the residual spectrum around the relevant absorption feature with a Savitzky–Golay filter\footnote{Smoothed spectrum is only used for peak search.}, and obtain a number of peak (valley) points via {\tt scipy.signal.find\_peaks}\footnote{\href{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.find_peaks.html}{https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.find\_peaks.html}}. The spectra after continuum removal and their local smoothings are shown as the grey and brown lines correspondingly in Fig.~\ref{fig:gui}. The vertical dashed line denotes the intrinsic location of a spectral line (Here ${\rm He~I}~\lambda5876$~ for a SN Ib), and the detected peaks and valleys in the spectral region are shown as orange upper and cyan lower arrows. The peak closest to the intrinsic line location is selected as the red endpoint of the absorption feature. The peak with a slightly lower wavelength is assumed to be the blue boundary of the spectral line. The selected fitting range is afterward applied to cut the spectra. After fitting the spectral data within the wavelength range with analytic models, e.g. Gaussian or Voigt, the output is compared to the intrinsic wavelength of the line to estimate the velocities. To these velocities, a specv\_evolution engine could be used to collect them for fitting with, e.g. an exponential function, for the average velocities against phase after peak, as done by \citet[][their fig. 4]{Fremling2018}, see Fig. \ref{fig:velexp}\footnote{This automatic approach works well for good signal-to-noise spectra with decent resolution, but visual inspection is frequently required to confirm the fitting for other data.}. \begin{figure*} \centering \includegraphics[width=0.6\textwidth]{velocity_exp.png} \caption{An exponential fit of the fitted velocities on the phases for SN 2020bcq. The red dashed lines are the random samplings of the MCMC, and the red open circle is the estimated velocity at the peak phase from the exponential fit.} \label{fig:velexp} \end{figure*} \subsection{Import external models} \label{sec:addmodels} Observers often search for intriguing transients with peculiar photometric or spectroscopic behavior that are not necessarily consistent with traditional explanations. For example, superluminous supernovae (SLSNe) show luminosities significantly greater than for conventional SNe. Other models for the powering mechanism are then needed to explain them rather than the classical radioactive models, e.g. a magnetar model \citep{Ostriker1971,Kasen2010,chatzo2012,Inserra2013,Nicholl_2017,liu2022}. Instead of upgrading the built-in models in {\tt HAFFET}\xspace, we choose to provide users the ability to create their own models (see section~\ref{sec:model}) or import models from other modeling-specific software packages, such as MOSFIT and redback. We show an example that fits the redback magnetar model\footnote{Developed based on MOSFIT package. We use the redback one because its code structure is similar to {\tt HAFFET}\xspace.} on the famous SN 2015bn in section~\ref{sec:magon15bn}. \subsection{Hyperparameter optimization routine} \label{sec:optimize} By assuming the observed deviations between the objective function and the observed data are the result of Gaussian scatter, the log-likelihood is: \begin{equation} \ln {\cal L} = - \frac{1}{2}\sum_{i=1}^{n} \frac{\left(O_i-M_i\right)^2}{{\beta\sigma_i}^2} - \sum\ln(\beta\sigma_i), \end{equation} where $O_i$, $\sigma_i$, and $M_i$ are the $i$-th of $n$ observed magnitudes, errors, and model magnitudes, respectively. The term $\beta$ is used to account for the fact that the data uncertainties are over- or underestimated. In {\tt HAFFET}\xspace, users can decide whether to include $\beta$ into likelihood functions with the \texttt{fit\_error} parameter (see section \ref{sec:model}). To optimize the parameters that are used in the fits to the analytic models there are two routines available in {\tt HAFFET}\xspace, i.e. optimization via {\tt scipy.optimize} and Monte Carlo (MC) methods via {\tt emcee}. In order to alleviate the computational cost as well as to speed up the MC burn-in process, we first fit the model with minimizing objective functions via {\tt scipy.optimize}. The resulting parameters as well as the predefined boundaries are afterwards used to set the initial guesses for a number of MC chains (walkers). For each chain, the set of parameters is randomly sampled, a likelihood is calculated between the observed data and the resulting models, and MC would enforce random sampling to follow the direction to minimize the likelihood. The parameter distributions are afterwards built after the sampler burn-in to a specific parameter region. To estimate the parameter error bars, by default we use 1 sigma for {\tt scipy} estimations and a correspondence of 16 and 84 percentiles for all burn-in samples as lower and upper limits. A comprehensive comparison from multiple angles, e.g. posterior parameter distributions with {\tt scipy} and {\tt emcee}, are presented in section~\ref{sec:emceevsmin}. \section{Examples of utilizing HAFFET} \label{sec:application} We have presented how {\tt HAFFET}\xspace might be used to analyze SN Ibc data in Paper I, e.g. figure 2 of Paper I illustrate the fittings with an example of SN 2020bcq; in this section, we provide some more technical descriptions as a supplement to that {\tt HAFFET}\xspace usage. \subsection{Blackbody vs bolometric correction inferred luminosity} In {\tt HAFFET}\xspace, we often construct bolometric LCs for SE SNe and SNe II with two bands (e.g. their $g$ and $r$ magnitudes) using the analytic bolometric corrections derived in \cite{Lyman14}. For objects observed in more than two bands, e.g. in the ZTF $gri$ bands, we could also use the multi-band photometry to construct SEDs. Alternatively, we can estimate the bolometric luminosity by integrating the absolute-calibrated spectra. We compare the luminosities estimated from these different approaches in Fig.~\ref{fig:Lpcomp}. As shown, the bolometric correction approach using only two bands provides quite similar bolometric luminosities to those from the blackbody or spectra integration. We estimated the luminosities for ZTF SNe Ic-BL in \cite{Corsi2022} and in Anand et al. (in preparation), and for comparison we test the methods also on a few famous SNe, e.g. SN 1998bw, and found consistent results between the different methods. Therefore, we set the Lyman bolometric correction method as the default approach for SE SNe and SNe II in {\tt HAFFET}\xspace, and provide functions to convert $BVR$ to $gr$ in case an object is observed in Johnson filters. \begin{figure*} \centering \includegraphics[width=0.45\textwidth]{bb_vs_bc.png} \includegraphics[width=0.4\textwidth]{Lpcomp.png} \caption{Luminosity comparison between different approaches. In the left panel, the circles represent the luminosity estimated with the analytic bolometric correction from \cite{Lyman14}, while the red circles are bolometric luminosities estimated from blackbody fits on the $gri$ photometry and the orange down pointing arrows are estimates based on integrating the spectra. In the right panel, we show the peak luminosity comparison between the blackbody fitted and the Lyman inferred values for 34 SNe Ib and 35 SNe Ic at peak epoch. The blue dashed line is the one-to-one relation. As shown, the luminosities from the two approaches are consistent, although the $gri$-constructed blackbody provides luminosity estimates with large(r) uncertainties.} \label{fig:Lpcomp} \end{figure*} \subsection{Explosion properties from the Arnett model vs the radioactive decay tail} As discussed in section~\ref{sec:arnett}, the constructed bolometric LC at epochs around the main peak can be fitted to the classical Arnett model for an estimation on the explosion properties, e.g. $M_{\rm Ni}$, $M_{\rm Ej}$~ and $E_{\rm Kin}$. In section~\ref{sec:tail} the fits on the bolometric tail were introduced which can provide alternative estimates of the same properties. In Fig.~\ref{fig:arnettcompare} we compare the nickel masses from the two approaches with SN 2020bcq as example. As shown, the inferred $M_{\rm Ni}$~ from the Arnett model is 0.09 solar masses, which is $\sim 2$ times larger than the estimate from the tail that is 0.04 solar masses. We conducted such a comparison to a sample of ZTF SNe Ibc (the black dots) in Fig.~\ref{fig:arnettvstail} and conclude similarly to \cite{Afsariardchi2021} (the red dots, see also their Fig. 4) that the Arnett method yields $M_{\rm Ni}$~ values which are systematically a factor of around 2 larger than those estimated from the tail. \begin{figure*} \centering \includegraphics[width=0.3\textwidth]{ZTF20aajcdad_arnett_corner1.png} \includegraphics[width=0.3\textwidth]{ZTF20aajcdad_arnett_corner2.png} \includegraphics[width=0.3\textwidth]{ZTF20aajcdad_tail_corner.png} \caption{As shown in the lower left panel of Fig.~\ref{fig:gui}, we fit the Arnett and tail functions to the Lyman-inferred bolometric luminosity LC of SN 2020bcq (ZTF20aajcdad) as an example. The marginalized parameter distributions are shown as corner plots in this figure. In the left panel, we fit the Arnett model by using the explosion epoch from our earlier power-law fits, while in the middle plot we treat the explosion epoch as a free parameter in the Arnett model. The predicted rise time from the Arnett model, i.e. the time between the estimated explosion epoch to peak, is 13.93 days, which is comparable to the estimate from the power-law fits (13.14 days). The slight difference in the explosion epoch does not change the nickel mass estimate but modifies $\tau_m$ from 9.6 to 10.6 days. The marginalized parameter distributions of the tail fitting are shown as corner plots to the right. The best-fit nickel mass is 0.04 solar masses, which is roughly half of that inferred from the Arnett model.} \label{fig:arnettcompare} \end{figure*} \begin{figure*} \centering \includegraphics[width=0.6\textwidth]{nickeltailarnett.png} \caption{Comparison of $M_{\rm Ni}$~ between Arnett fits and fits to the radioactive decay tail. The ZTF SNe Ibc (the subset of SNe in Paper I that clearly shows a tail) are shown in black dots, while the sample from \cite{Afsariardchi2021} (that is a selection from the literature, including 27 SE SNe) is shown in red dots. The blue dashed line is the one-to-one relation. As shown, the Arnett inferred $M_{\rm Ni}$~ is systematically higher than those from the tails.} \label{fig:arnettvstail} \end{figure*} The restrictions of the Arnett model may be to blame for this discrepancy, e.g. \cite{KK19} claimed that the self-similarity condition breaks down when the SN ejecta have a centralized \Ni~ deposition, thus proposed a new analytical model for SE SNe that introduced a dimensionless parameter $\beta$ to the Arnett model. A robust $\beta$ for each SE SN sub-type is still under investigation, e.g. \cite{Meza2020} adopted $\beta$ values that were derived from the simulated SE SN LCs of \cite{Dessart2016}, and \cite{Afsariardchi2021} instead derived $\beta$ from a sample of literature SE SNe. As the largest untargeted Type Ibc survey to date, the ZTF BTS offers a large amount of SE SNe for calibrating $\beta$. In Fig.~\ref{fig:arnetttail}, we explore whether explosion parameters from the radioactive tail could be consistent with the peak Arnett fit. Models 1 and 2 are the best-fit models for the Arnett peak and bolometric tail, respectively, as estimated using {\tt HAFFET}\xspace with constant opacities, i.e. $\kappa=0.2~{\rm cm^2g^{-1}}$ and $\rm \kappa_\gamma=0.027~cm^2g^{-1}$. Assuming the Arnett model is accurate, the bolometric tail could be predicted (model 3) using its inferred explosion parameters. As shown, the radioactive decay model, i.e. model 3, is underestimated compared to the Arnett model. It is possible to argue that the adopted velocity (that was estimated via the Dessart relation, see equations \ref{eq:mej} and \ref{eq:ek}) or the opacities are incorrect. We then explore how the tail brightness and slope depend on the velocity and opacities in models 4 and 5. We can translate the Arnett model's estimates of $\tau_m$ into $M_{\rm Ej}$~ and $E_{\rm Kin}$~ (along with a velocity measurement), and then $T_0$ for the tail. In model 4, we fix the $M_{\rm Ni}$, $\tau_m$, and fit the bolometric tail with $\gamma$-trapping opacity as a free parameter, whereas in model 5 we fit the velocity instead\footnote{For hyperparameter optimization, we use the MCMC routine in {\tt HAFFET}\xspace with the likelihood containing term $\beta$, see section \ref{sec:optimize}.}. As shown, the best fits of models 4 and 5 have steeper slopes than model 2. \begin{figure*} \centering \includegraphics[width=0.6\textwidth]{arnett_tail.png} \caption{Various models fit to the bolometric LC of SN 2020bcq (the open circles). The realization with the best-fit Arnett and tail models are shown by models 1 and 2 (the solid cyan and red lines; see also the lower right panel of Fig. \ref{fig:gui}). From model 1, we obtain the posterior distributions of $M_{\rm Ni}$~ and $\tau_m$, which can be translated into $M_{\rm Ej}$~ and $E_{\rm Kin}$~ together with a velocity measurement ($\sim$ 10,000 $\rm km~s^{-1}$). We use the parameters obtained from model 1 to reproduce a tail bolometric, model 3 (the brown line). We adapted its $\gamma$ trapping opacity (model 4, $\rm \kappa_\gamma$ from 0.027 to 0.05 $\rm cm^2g^{-1}$) or photospheric velocity (model 5, $V_{\rm{ph}}$ from 10,000 to 5,000 $\rm km~s^{-1}$) so that the tail can be brighter to match the observed data.} \label{fig:arnetttail} \end{figure*} \subsection{Optimize fitting with minimize routine vs monte carlo} \label{sec:emceevsmin} As discussed in section \ref{sec:optimize}, there are two routines available in {\tt HAFFET}\xspace for hyperparameter optimization, and in this section we compare them for the fitting results on the $r$-band LC of SN 2020bcq with the analytic model of \cite{bazin}. The parameter contours from the MCMC and the fitted region from the {\tt scipy} minimization are shown in Fig.~\ref{fig:fitcompare}. Once fit with the {\tt scipy} package, the optimal values for the parameters as well as their estimated covariances could be estimated. In {\tt HAFFET}\xspace, the diagonals of the covariance matrix are used as the errors for the parameters, therefore hyperparameters could be optimized into the green and blue dashed regions (for 1 and 3 sigma correspondingly) as shown in Fig.~\ref{fig:fitcompare}. In {\tt HAFFET}\xspace, we mimic the MCMC contours for the {\tt scipy} minimization routine by randomly selecting parameters within the permitted regions. Also, the resulting parameter ranges from {\tt scipy} minimize, i.e. the blue and green dashed regions, can afterwards be used as prior for MC samplers. After burn-in, a more degenerate version of the contours could be generated from the MCMC process. To decide the parameter error bars, in {\tt HAFFET}\xspace we use 1 sigma for the {\tt scipy} estimations, and corresponding 16 and 84 percentiles of all burn-in samples as lower and upper limits. As shown in Fig.~\ref{fig:fitcompare}, the {\tt scipy} minimize routine can estimate a similar set of parameters as MCMC, with much less computational cost and time. However, the {\tt scipy} method might not be suitable for complicated models with many free parameters, and for such cases MCMC is the better option. \begin{figure*} \centering \includegraphics[width=0.6\textwidth]{ZTF20aajcdad_bazin_r_corner.png} \caption{As shown in the upper panel of Fig. \ref{fig:gui}, we fit the multi-band LCs following analytic models of \cite{bazin} with SN 2020bcq (ZTF20aajcdad) as an example. Such fits can be done in different routines, and in this plot we compare the fitting results between them. The parameter distributions from MCMC on $r$-band LC are shown as corner plots. The vertical dashed lines in the marginalized parameter histograms represent the 16 and 84 percentile of all burn-in samples, which are corresponding to the 1 sigma posterior parameter distributions from the {\tt scipy} minimize routine (the green box).} \label{fig:fitcompare} \end{figure*} \subsection{Beyond the Arnett model, a magnetar fit to SN 2015bn} \label{sec:magon15bn} As discussed in section \ref{sec:addmodels}, {\tt HAFFET}\xspace can be used to fit the constructed bolometric LC to models from external packages. In this section, we show an example with a magnetar model (import from MOSFIT) fitting on data of SN 2015bn \citep{2015bn}. The photometric data were obtained from the Open SN Catalog \citep{oac}. We use the analytic bolometric correction for SE SNe derived in \cite{Lyman14} to estimate its bolometric LC. As shown in the left panel of Fig. \ref{fig:2015bn}, the bolometric LCs for SN 2015bn from \cite{2015bn} and {\tt HAFFET}\xspace are similar, however the {\tt HAFFET}\xspace LC lack a few early phase observations since they were not available in the Open SN Catalog. The absence of early phase constraints gave more freedom to our fittings, see the early stage of the cyan dashed lines that are the modeled magnetar LCs fitting on the {\tt HAFFET}\xspace bolometric LC. For the magnetar fitting, we set the same host extinction and opacities for SN 2015bn as in \cite{2015bn} and fit the explosion epoch as a free parameter. The resulting contours are presented in the right panel, which is consistent with those from \cite{2015bn}. \begin{figure*} \centering \includegraphics[width=0.45\textwidth]{2015bn_lc.png} \includegraphics[width=0.4\textwidth]{2015bn_corner.png} \caption{Magnetar model fitting on SN 2015bn via {\tt HAFFET}\xspace. We construct the bolometric LC of SN 2015bn with $g$ and $r$ magnitudes with the analytic bolometric correction for SE SNe derived in \cite{Lyman14}. They are shown in black and blue open circles. As shown, they are quite similar to the one from \cite{2015bn}, i.e. the red circles. The cyan dashed lines are reproduced with the fitted magnetar model samplings. The parameter contours are shown to the right, which is similar to the estimates of \citet[][their Fig. 4]{2015bn}.} \label{fig:2015bn} \end{figure*} \section{Summary and Future prospects} \label{sec:conclusion} In this work we have introduced a new open-source SN fitting code {\tt HAFFET}\xspace. We explain the driving forces behind the {\tt HAFFET}\xspace code's creation, and how {\tt HAFFET}\xspace could be utilized to analyze SN data for sample investigation. We tested {\tt HAFFET}\xspace by applying it to the SNe Ibc that were observed by ZTF and classified with BTS in Paper I. In this paper we show more examples and demonstrate that {\tt HAFFET}\xspace is functional and clearly not strictly adhering to SNe Ibc. To broaden its applicability, we have plans for future upgrades of {\tt HAFFET}\xspace. This includes: \begin{enumerate} \item Including routines to query data from more open online resources, e.g. alert brokers such as Lasair\footnote{\url{https://lasair-ztf.lsst.ac.uk/}} and Alerce\footnote{\url{https://alerce.science/}}. \item K-corrections for high-redshift SNe, which would be important in the LSST era. \item Spectroscopic classifications via, e.g. \cite{NGSF}. \item Besides analytic models, we intend to provide possibilities for users to include hydrodynamic models as well. This could be done by comparing data to a grid of hydrodynamic model realizations. \item Comprehensively improving the radioactive models, e.g. by including nickel mixing \citep{Dessart:2012aa, Dessart2016, Yoon2019}, asymmetry, etc. These can be explored after a grid of numerical models are available, which are not possible in the analytic Arnett model. \item Adding machine learning components to {\tt snelist} for sample exploration. For instance a dataset of SN LCs, {\tt HAFFET}\xspace can be used to obtain a list of features such as their peak magnitudes, slopes, and colors. A Principal Component Analysis could be then adopted to asses which properties are significantly related to the SN types. \end{enumerate} \section*{Data availability} The codes and data underlying this article are available in \url{https://github.com/saberyoung/HAFFET} \software{numpy \citep{harris20a}, matplotlib \citep{hunter07a}, scipy \citep{virtanen20a}, pandas \citep{mckinney10a}, emcee \citep{emcee}, astropy \citep{astropy:2013, astropy:2018, astropy:2022}, george \citep{george}. } \begin{acknowledgements} We thank Gokul Prem Srinivasaragavan, Kaustav Kashyap Das, Xiaofei Dong, Songyu Shen, Ping Chen for their help testing {\tt HAFFET}\xspace codes in their devices, and Matt Nicholl, Enrico Cappellaro, Conor Michael Bruce Omand, Nikhil Sarin, Liangduan Liu for helpful comments. Based on observations obtained with the Samuel Oschin Telescope 48-inch and the 60-inch Telescope at the Palomar Observatory as part of the Zwicky Transient Facility project. ZTF is supported by the National Science Foundation under Grant No. AST-1440341 and a collaboration including Caltech, IPAC, the Weizmann Institute for Science, the Oskar Klein Center at Stockholm University, the University of Maryland, the University of Washington, Deutsches Elektronen- Synchrotron and Humboldt University, Los Alamos National Laboratories, the TANGO Consortium of Taiwan, the University of Wisconsin at Milwaukee, and Lawrence Berkeley National Laboratories. Operations are conducted by COO, IPAC, and UW. This work was supported by the GROWTH project \citep{Kasliwal2019} funded by the National Science Foundation under PIRE Grant No 1545949. The Oskar Klein Centre was funded by the Swedish Research Council. Gravitational Radiation and Electromagnetic Astrophysical Transients (GREAT) is funded by the Swedish Research council (VR) under Dnr 2016-06012. Partially based on observations made with the Nordic Optical Telescope, operated by the Nordic Optical Telescope Scientific Association at the Observatorio del Roque de los Muchachos, La Palma, Spain, of the Instituto de Astrofisica de Canarias. Some of the data presented here were obtained with ALFOSC. The SED Machine is based upon work supported by the National Science Foundation under Grant No. 1106171. The ZTF forced-photometry service was funded under the Heising-Simons Foundation grant \#12540303 (PI: Graham). This work has been supported by the research project grant “Understanding the Dynamic Universe” funded by the Knut and Alice Wallenberg Foundation under Dnr KAW 2018.0067. {Authors contribution: JS supervised the project, helped write the manuscript, but SY wrote all the code and developed the WWW site.} \end{acknowledgements}
\section{Introduction} In this paper we will investigate a certain notion of tubings on rooted trees and how this notion of tubings on the one hand relates to rooted connected chord diagrams, and on the other hand lets us give series solutions to a wide class of Dyson--Schwinger equations in quantum field theory. A third leg of the triangle relating this notion is the connection between rooted connected chord diagrams and Dyson--Schwinger equations which has been developed over the last decade in order to give a theory of chord diagram expansions of Dyson--Schwinger equations \cite{Nchord, MYchord, HYchord, CYchord, CYZchord, CYnnl}. Our tubings are \emph{binary tubings}, as will be defined in \cref{def tubing}, because each tube of size at least 2 will be partitioned into exactly two smaller tubes. This is different from, but related to, the notion of tubings of trees and graphs that are used to define graph associahedra, see \cite{carr_coxeter_2006}. We will discuss the connection between these different notions of tubings further in \cref{sec associahedra}. Outside of those discussions, we will only be working with binary tubings, so we will simply refer to tubings meaning binary tubings. Using these tubings we will be able to both clarify and surpass the previous theory of chord diagram expansions of Dyson--Schwinger equations. However, the connection between tubings and rooted connected chord diagrams remains interesting as we will discuss in \cref{sec chord}. This connection is purely combinatorial. The most general single Dyson--Schwinger equation (DSE) that we give series solutions for has the form \begin{align}\label{dse_differential_general} G(x,L) = 1 + \sum_{k\geq 1}x^kG\left(x, \frac{\partial}{\partial\rho}\right)^{1+sk}(e^{L\rho}-1)F_k(\rho)\bigg|_{\rho=0}. \end{align} We also solve certain systems of Dyson--Schwinger equations of a similar form; see \cref{sec systems}. Note that conventions with regard to signs vary in the literature. The physical motivation for this equation along with the meaning of the arguments and parameters is explained in \cref{sec mellin transform}. Unlike in previous work on chord diagram expansions, here $s\in \mathbb{R}$ is no longer restricted to certain integers (the sign of $s$ is also reversed compared to this previous work). The bulk of this paper is devoted to proving that this equation has a series solution given by tubings of trees, as stated in \cref{thm main thm}. In \cref{sec definitions}, we review the necessary background, both physical and algebraic. We look at a few special cases of tubings in \cref{sec examples}. Then \cref{sec tubing feynman rules} proves how the structure of Feynman rules implies what the contribution of each tubing must be, and brings this together to prove the main theorem solving the Dyson--Schwinger equation by a tubing expansion An extremely nice feature of this solution, and one of the original motivations for this project, is that it is not just an alternate expansion for the Green functions which contrasts with the Feynman graph expansion in the simple contributions of each object, but, moreover, each Feynman graph maps to a particular set of tubings which gives the same contribution, as explained in \cref{rem graph by graph}. In \cref{sec chord} we return to the chord diagrams and prove a bijection between tubed rooted plane trees and rooted connected chord diagrams and verify that under this bijection our tubing expansions of solutions to Dyson--Schwinger equations include the previously known chord diagram expansions of \cite{MYchord, HYchord}. We also look at a few combinatorially interesting special cases. A different notion of tubings, related to associahedra, has existed in the literature, its relation to our own definition is discussed in \cref{sec associahedra}. We conclude in \cref{sec conclusion}. \section{Definitions and notation}\label{sec definitions} \subsection{Rooted trees and binary tubings}\label{sec rooted trees and binary tubings} We will have cause to work with both rooted trees and plane rooted trees. \begin{definition}\label{def rooted tree} Recursively, a \emph{rooted tree} is a vertex $r$, called the root, and a possibly empty multiset of rooted trees whose roots are the children of $r$. A \emph{plane rooted tree} is a vertex $r$, also called the root, and a possibly empty ordered list of plane rooted trees whose roots are the children of $r$. \end{definition} By forgetting the order structure at each vertex, every plane rooted tree has an underlying rooted tree structure. For the tubing expansions of Dyson--Schwinger equations it suffices to work without a plane structure, though that part can all be done at the plane level, but for the connection to chord diagrams it will be more convenient to work with plane rooted trees. Write $\operatorname{rt}(t)$ for the root vertex of a tree $t$. A vertex with no children in a rooted tree or a plane rooted tree is known as a \emph{leaf}. We will write $\od v$ for the number of children of the vertex $v$. An $n$-ary rooted tree is a tree where all vertices have at most $n$ children. We can view a rooted tree or a plane rooted tree as a graph with the extra information that the vertex set of the graph is the same as the vertex set of the tree and the edge relation is given by the parent-child relation. We will use both graph language and parent-child language on rooted trees and plane rooted trees without further definition; for instance, we will speak of paths in trees and connectivity meaning the corresponding graph notions, and we will also speak of the descendants of a vertex as the set containing the vertex's children, its children's children, etc. An \emph{automorphism} of a rooted tree is an automorphism of it seen as a graph which also fixes the root; denote the group of automorphisms of the rooted tree $t$ by $\operatorname{Aut}(t)$. We will draw rooted trees with the root vertex at the top and the leaves on the bottom, see \cref{fig:tree_introduction}. The \emph{rooted subtree} at the vertex $v$ of a rooted tree or a rooted plane tree is the subtree consisting of $v$ and all its descendants. The rooted subtree inherits a rooted tree or rooted plane tree structure from the outer tree. Furthermore, if $t$ is a rooted tree or a rooted plane tree and $t'$ a rooted subtree, then $t\setminus t'$ is also connected and hence is itself a rooted tree or rooted plane tree, but not a rooted subtree in the sense above. \medskip We will also have cause to work with trees with decorated or weighted vertices. First, for a rooted tree or plane rooted tree, the \emph{size} of the tree is the number of vertices. A \emph{decorated rooted tree} or \emph{decorated plane rooted tree}, $t$, decorated from the set $D$ is a rooted tree or a plane rooted tree respectively with a function $d\colon V(t) \rightarrow D$. An \textit{automorphism} of a decorated rooted tree is an automorphism of the underlying rooted tree that preserves the decorations of all vertices; again the automorphism group of the rooted tree $t$ is denoted $\operatorname{Aut}(t)$. A \emph{weighted rooted tree} or \emph{weighted plane rooted tree} $t$ is a decorated rooted tree or a decorated plane rooted tree, respectively, where the set of decorations is $\mathbb{Z}_{\geq 1}$. In this case we use slightly different language, writing $w\colon V(t)\rightarrow \mathbb{Z}_{\geq 1}$ for the function and calling $w(v)$ the \emph{weight} of the vertex $v$. (Distinguishing decoration from weight will become essential when considering systems in \cref{sec systems} as the weight will then be only part of the decoration.) Whenever useful we will identify the unweighted rooted tree or plane rooted tree with the weighting of the same tree that gives weight 1 to each vertex. The \emph{weight} of a weighted rooted tree or weighted plane rooted tree is the sum of the weights of the vertices. For an unweighted tree the weight and size agree. \medskip \begin{definition}\label{def tube} Let $t$ be a rooted tree or a plane rooted tree. A \emph{tube} of $t$ is a set of vertices of $t$ that induces a connected subgraph of $t$. \end{definition} A connected subgraph of a tree $t$ is a tree, hence is a subtree in an unrooted sense, but we are reserving the term subtree for rooted subtree in the sense given above. We will draw tubes by drawing a curve around the relevant vertices, as in \cref{fig:tree_introduction}. \begin{definition}\label{def tubing} Let $t$ be a rooted tree or a plane rooted tree. A \emph{binary tubing} $\tau$ of $t$ is a set of tubes such that \begin{enumerate} \item $\tau$ contains the tube of all vertices of $t$, and \item each tube $b$ of $\tau$ either is a single vertex or there are two other tubes in $\tau$ which partition $b$. \end{enumerate} \end{definition} To improve readability, we will generally not draw the outermost tube, which encircles the full tree, nor the innermost tubes around each individual vertex, see \cref{fig:tubings}. \begin{figure}[htb] \centering \begin{subfigure}[b]{.3\linewidth} \centering \begin{tikzpicture} \input{figure_1a.tikz} \end{tikzpicture} \caption{} \label{fig:tree_introduction} \end{subfigure} \hfill \begin{subfigure}[b]{.6\linewidth} \centering \begin{tikzpicture} \input{figure_1b.tikz} \end{tikzpicture} \caption{} \label{fig:tubings} \end{subfigure} \caption{ \textbf{(a)} An unweighted rooted tree of size 9. Vertex $r$ is the root, vertices $v_2,v_4,v_6,v_7$, and $v_9$ are leaves. The out degrees are $\od{r}=2, \od{v_2}=0, \od{v_3}=3$ etc. One of the possible tubes is indicated in blue, consisting of $\{v_3,v_5,v_7,v_8\}$. \textbf{(b)} The two possible binary tubings of a ladder with three vertices according to \cref{def tubing}. Later, we only draw the non-trivial part and leave out the innermost and outermost tubes, as shown to the right in the equations.} \end{figure} Note that any two tubes in a binary tubing are either disjoint or one is contained within the other, so binary tubings have a nested structure. Already in the literature is a notion of tubings used in defining graph associahedra \cite{carr_coxeter_2006}. These tubings are also made up of nested families of tubes but with different conditions on them. Other than to compare our notions with theirs, see \cref{sec associahedra}, we will only work with binary tubings in this paper, and so we will just use the term \emph{tubing} for binary tubings. We can also treat our tubings recursively. Let $t$ be a rooted tree or a plane rooted tree. A (binary) tubing $\tau$ of $t$ can be obtained recursively as follows: \begin{enumerate} \item $\tau$ contains the outer tube consisting of all vertices of $t$. \item Let $e=uv \in E(t)$. Partition the vertices $V(t) = \{A|B\}$ such that $B$ is the vertices of the subtree rooted at $v$. Said another way, $B$ induces a connected rooted subtree with $v$ as the root and contains all of $v$'s descendants and $A$ induces a connected subgraph that contains the root of $t$. This subgraph is itself a rooted tree and has $u$ as a leaf. Set $A$ and $B$ to be tubes of $\tau$. \item Proceed likewise to construct tubings of the trees induced by $A$ and $B$. \end{enumerate} Every tubing of $t$ can be constructed as above. Expanding on this in another way, to find all the tubings of a tree, for every edge in $t$, we ``break'' the edge and put the lower vertex and all of its descendants into one tube and the rest of the tree in another tube. Then for each tube and each edge in the tube, do the same until all of the tubes contain only one vertex. In other words, a tubing defines a binary tree structure on the edges of the original tree based on which stage in the hierarchy of the tubes we ``break'' the edge. This relates to the notion of the linearized coproduct in the Connes--Kreimer Hopf algebra, see \cref{rem linearized coprod}. \begin{remark}\label{rem tubings binary tree} The containment structure of any binary tubing $\tau$ of a tree $t$ gives a binary rooted tree $B$ with left and right children distinguished. To turn a tubing $\tau$ into such a binary tree, associate a vertex to each tube of $\tau$ and let the children of a vertex corresponding to a tube of size $>1$ be the two smaller tubes which partition it, the one containing the root of the outer tube being the right child and the other the left child. Furthermore, $B$ is a \emph{full} binary rooted tree, that is, every vertex has either 2 or 0 children since each tube is either the tube of a single vertex or is partitioned into two nonempty subtubes. The number of leaves of $B$ is the number of tubes of $\tau$ consisting of a single vertex which is the number of vertices of $t$. The size of a tube is the number of vertices in the subtree of $B$ rooted at the vertex corresponding to the tube. A particular example will be discussed in \cref{rem ladders trees}. \end{remark} \begin{lemma}\label{lem recursive tubing} Let $t$ be a rooted tree or a plane rooted tree and $\tau$ a tubing of $t$. Then if $b$ is any tube of $\tau$, the tree induced by the vertices of $b$ has a tubing given by $b$ and those tubes of $\tau$ which are properly contained in $b$. \end{lemma} \begin{proof} Immediate from the definition. \end{proof} \begin{remark}\label{rem tau prime and tau double prime} \begin{enumerate} \item In view of the last lemma, a tubing is either \begin{enumerate} \item the unique tubing of $t = \bullet$, or \item determined by $(\tau', \tau'')$ where $\tau'$ is a tubing of some proper rooted subtree $t'$ and $\tau''$ is a tubing of $t''= t \setminus t'$. Note that $t''$ contains the root of $t$. \end{enumerate} \item Tubings of weighted rooted trees and weighted plane rooted trees are simply tubings of the underlying unweighted trees. The weights are carried along harmlessly. \end{enumerate} \end{remark} \medskip Generally given a tubing $\tau$ of the tree $t\neq \bullet$ we will write $t'$ and $t''$ for the two rooted trees induced by the tubes that partition the outermost tube of $\tau$ with the root of $t$ being in $t''$. The sub-tubings $\tau'$ and $\tau''$ denote the tubings of the subtrees $t'$ and $t''$, respectively, as in \cref{rem tau prime and tau double prime}. \begin{remark} By \cref{rem tau prime and tau double prime}, a tubing is a graphical representation of the sequence in which all edges of a given tree $t$ are cut, until only disconnected vertices remain. In our case, the tree will be the insertion tree of a Feynman graph, and cutting this tree edge by egde can be interpreted as the linearization of the (Connes--Kreimer) coproduct to be discussed in \cref{sec algebraic set up}. A tubing represents an iteration of the linearized coproduct, see \cref{rem graph by graph}. A similar procedure of iteratively splitting graphs into two components is familiar from the Britto--Cachazo--Feng--Witten (BCFW) recursion relation \cite{britto_new_2005,britto_direct_2005} of scattering amplitudes. Indeed, following \cite{arkani-hamed_cosmological_2017}, a graphical notation for splitting Feynman graphs has been used which seemingly coincides with the binary tubings in the present work. Despite the similarity in graphical appearance, we would like to stress the striking difference between the two concepts: In the amplitudes setting, the recursive splitting of a Feynman graph reflects particular analytic properties of the corresponding amplitude. Conversely, our binary tubings operate on the insertion trees, not on the Feynman graphs themselves, and ultimately arise from the combinatorics of renormalization, considering the scale dependence of the resulting amplitude. The physical interpretation will be outlined in \cref{sec physical set up}. \end{remark} There are a few statistics on tubings that we will need. Write $\mathrm{Tub}(t)$ for the set of tubings of $t$, and let $N(t) = |\mathrm{Tub}(t)|$ be the number of tubings of $t$. Following \cref{lem recursive tubing} and \cref{rem tau prime and tau double prime}, this number is determined recursively: \begin{lemma}\label{lem recursive tubing count} Let $t$ be a rooted tree with edge set $E(t)$. Removing any edge $e\in E(t)$ splits $t$ into two rooted trees $t' \cup t''$. The number of tubings of $t$ is \begin{align} N(t) = \sum_{e\in E(t)} N(t') N(t''). \end{align} Moreover, $N(t)$ is the same regardless which of the vertices of $t$ is the root. \end{lemma} \begin{proof} By \cref{lem recursive tubing}, the remainder of $\tau$, after removing the edge $e$ which defines the bipartition of the outermost tube, is exactly a tubing of two trees $t',t''$. Summing over all possible ways to split the outermost tube, that is, over all $e\in E(t)$, reproduces the total number of tubings. Independence of the position of the root follows inductively, or can also be seen from the fact that the original definition of binary tubings does not make reference to the root. \end{proof} \medskip \begin{definition}\label{def b statistic} Let $\tau$ be a tubing of a rooted tree or plane rooted tree $t$. Given a vertex $v$ of $t$, the \emph{b-statistic} $b(v, \tau)$ denotes the number of tubes of $\tau$ for which $v$ is the root of the tube. Let $b(\tau) = b(r,\tau)$ where $r$ is the root of $t$. \end{definition} For example, in \cref{fig:tubings} we have $b(\tau)=3$ for the ladder on the left and $b(\tau)=2$ for the same ladder on the right. For $v$ the middle vertex of the ladder we have $b(v,\tau)=1$ on the left but $b(v,\tau)=2$ on the right. For both trees the $b$-statistic of the leaf is 1. As we use the more condensed drawings with the outer and innermost tubes suppressed going forward, keep in mind that those tubes do still count for the $b$-statistic. \medskip Using the $b$-statistic we define the Mellin monomial of a tubing. \begin{definition}\label{def Mellin monomial} Given a tubing $\tau$ of a rooted tree or a plane rooted tree $t$ and a sequence $c_0, c_1,c_2, \ldots$ define the \emph{Mellin monomial} to be \[ c(\tau) = \prod_{\genfrac{}{}{0pt}{2}{v\in V(t)}{ v \ne \operatorname{rt}(t)}} c_{b(v,\tau)-1}. \] Given a tubing $\tau$ of a $D$-decorated rooted tree or a $D$-decorated plane rooted tree $t$ and a doubly index sequence $(c_{i,d})_{\genfrac{}{}{0pt}{2}{0\leq i}{d \in D}}$, define the \emph{Mellin monomial} to be \[ c(\tau) = \prod_{\genfrac{}{}{0pt}{2}{v\in V(t)}{ v \ne \operatorname{rt}(t)}} c_{b(v,\tau)-1,d(v)} \] \end{definition} In our application the sequence $c_0, c_1, \ldots$ will be the coefficient sequence of the series expansion of a Mellin transform of a regularized Feynman integral of a primitive Feynman graph, see \cref{mellin_transform}. In the weighted case, for each fixed $j$ the sequence $c_{i,j}$ will be the coefficient sequence of the series expansion of the Mellin transform of the $j$ loop primitive Feynman graph while the decoration will index different external leg structures or other relevant properties of the primitive graphs. From a mathematical perspective, we can view these series as simply given to us by physics; we will not use any properties of them and the $c_{i}$ and $c_{i,j}$ can be treated as indeterminates for the algebraic results. We are now ready to state our main theorem. Systems can be solved similarly but with more notation and bookkeeping required, see \cref{sec systems}. Write \begin{align} \label{def falling factorial} (x)_k = x(x-1)(x-2)\cdots (x-k+1) \end{align} for the falling factorial. \begin{theorem}\label{thm main thm} The Dyson--Schwinger equation \eqref{dse_differential_general} with $F_k(\rho) = \sum_{i\geq 0} c_{i,k}\rho^{i-1}$ can be solved by a sum over tubings of weighted rooted trees, where $w(v)$ denotes the weight of vertex $v$, as follows. \begin{itemize} \item The contribution of a tubing $\tau \in \mathrm{Tub}(t)$ to the solution is \[ \phi_L(\tau) = c(\tau)\sum_{i=1}^{b(\tau)}c_{b(\tau)-i, w(\operatorname{rt}(t))} \frac{L^i}{i!}. \] \item The solution to \eqref{dse_differential_general} is \[ G(x,L) = \sum_{t} \frac{x^{w(t)}}{|\operatorname{Aut}(t)|}\left(\prod_{v \in V(t)} (1+sw(v))_{\od{v}}\right) \sum_{\tau \in \mathrm{Tub}(t)}\phi_L(\tau), \] where the outer sum is over all weighted rooted trees. \item In particular, the anomalous dimension is \begin{align*} [L^1] G(x,L) = \gamma(x) = \sum_{t} \frac{x^{w(t)}}{|\operatorname{Aut}(t)|}\left(\prod_{v \in V(t)} (1+sw(v))_{\od{v}}\right) \sum_{\tau \in \mathrm{Tub}(t)}\prod_{ v\in V(t)} c_{b(v,\tau)-1, w(v)}. \end{align*} \end{itemize} \end{theorem} Note that as a consequence of \cref{thm multi primitive comb dse} the solution to \eqref{dse_differential_general} can also be rewritten as a sum over weighted plane rooted trees. This removes the need for dividing by the size of the automorphism group and replaces the falling factorial with binomials, specifically, \[ G(x,L) = \sum_{\genfrac{}{}{0pt}{2}{t \text{ weighted plane }}{\text{rooted tree}}} x^{w(t)}\left(\prod_{v \in V(t)} \binom{1+sw(v)}{\od{v}}\right) \sum_{\tau \in \mathrm{Tub}(t)}\phi_L(\tau). \] This form will be more convenient for relating to chord diagram expansions in \cref{sec chord}. Furthermore we have the additional property that the tubings not only give one way of indexing a solution to the Dyson--Schwinger equation, but they refine the solution as a sum over Feynman graphs, see \cref{rem graph by graph}. \begin{example} Since the core of our main theorem is the contribution of each tree, let us consider the contributions of some explicit trees (without weights). We will write $$ \phi_L(t) := \sum_{\tau \in \mathrm{Tub}(t)}\phi_L(\tau) $$ The single vertex tree has only a single tubing consisting of a single tube, so the $b$-statistic (\cref{def b statistic}) is 1 and the Mellin monomial (\cref{def Mellin monomial}) is $c_0$. By \cref{thm main thm}, \[ \phi_L( \rtLine 1 ) = c_0 L. \] The two vertex tree (ladder) also has only a single tubing, see \cref{fig:small_example} b), with Mellin monomial $c(\tau) = c_0$. The $b$-statistic for the root is $2$ and for the other vertex (the leaf) it is $1$, therefore, by \cref{thm main thm}, \[ \phi_L\left( \rtLine 2 \right) = c_0\left(\frac 12 c_0 L^2 + c_1 L\right). \] \begin{figure}[htb] \centering \begin{tikzpicture} \input{figure_2.tikz} \end{tikzpicture} \caption{Some small trees, and the $b$-statistic (\cref{def b statistic}) of the vertices for the indicated tubing. Observe that we do not draw the innermost tubes around the individual vertices, nor the outermost tube which contains the complete tree.} \label{fig:small_example} \end{figure} The two trees with three vertices have two tubings each. For $\rtV$ both tubings give the same contribution, see \cref{fig:small_example} c), leading to an overall factor 2 in the amplitude \[ \phi_L \left( \rtV \right) = 2\cdot c_0^2\left(\frac 16 c_0 L^3 + \frac 12 c_1 L^2 + c_2 L\right) = \frac 13 c_0^3 L^3 + c_0^2 c_1 L^2 +2 c_2 c_0^2 L. \] For the second tree on three vertices, the two tubings have different contributions since the $b$-statistics differ, see \cref{fig:small_example} d), \begin{align*} \phi_L \left( \rtLine 3 \right) &= c_1c_0\left(\frac 12 c_0 L^2 + c_1 L\right) +c_0^2\left(\frac 16 c_0 L^3 + \frac 12 c_1 L^2 + c_2 L\right) \\ & = \frac 16 c_0^3 L^3 + c_1 c_0^2 L^2 +\left( c_1^2 c_0 + c_2 c_0^2\right) L. \end{align*} All examples reproduce the known tree Feynman rules, see for example \cite{panzer_hopf_2012} or \cite{DFY}. \end{example} \subsection{Physical set-up}\label{sec physical set up} The results of this paper can be viewed purely from a combinatorial perspective, but the Dyson--Schwinger equation in \cref{dse_differential_general} is motivated by quantum field theory. In the remainder of \cref{sec definitions}, we review the physical set-up, introduce the necessary algebraic background and finally bring the two together to understand the Dyson--Schwinger equations which underpin our approach. A reader unfamiliar with the physics may read lightly: the precise notions needed are in the algebraic background \cref{sec algebraic set up}. The goal of perturbative quantum field theory is to compute Feynman amplitudes, which can be understood as $n$-point correlation functions of quantum fields. A $n$-point Feynman amplitude $G^{(n)}$ is a function of the masses of all particles involved and of $n-1$ momenta, each of which is a vector in Minkowski space. The last momentum is fixed by overall momentum conservation. We introduce an arbitrary, but fixed, reference momentum $\mu$. This momentum defines a scale. Namely, let $q$ be a non-vanishing linear combination of the arguments of $G^{(n)}$, then we define the logarithmic energy scale of the $G^{(n)}$ to be \begin{align}\label{def L} L= \ln \left(\frac{q^2}{\mu^2} \right). \end{align} All remaining arguments of $G^{(n)}$ can be expressed as scale-free \enquote{angles} by rescaling them to $\mu$; see \cite{brown_angles_2011,brown_decomposing_2012} for details. We want to stress that $L$ is not necessarily the naive \enquote{energy-dependence} of the amplitude: a change in $L$, with all angles fixed, amounts to a scaling of all momenta and all masses by the same factor, whereas \enquote{energy-dependence} typically means to scale the momenta but leave masses fixed. For the remainder of this paper, we restrict ourselves to one-particle irreducible propagator-type Green functions, which are denoted $G(x,L)$ where $x$ is the renormalized coupling and $L$ is the logarithmic scale (see \cref{def L}). The restriction to one-particle irreducible is standard and loses no generality by the invertiblity of log and the Legendre transform \cite{jackson_robust_2017}. The restriction to propagator-type insertions and one scale $L$ does decrease generality. In this setting, all angles come from masses. We restrict ourselves further by assuming that all angles are kept fixed and $L$ is the only kinematic variable. The order-$x^n$ contribution, $[x^n]G(x,L)$, is given by Feynman graphs with $n$ loops and exactly two external edges. We use kinematic renormalization conditions with renormalization point $\mu^2$. Each $n$-loop Feynman graph evaluates to a polynomial of degree at most $n$ in $L$ with no constant term. We project the Green function onto its treelevel tensor such that the leading term is scaled to unity. Therefore, the Green functions considered in this paper have an expansion in the scale variable $L$ \cref{def L} of the form \begin{align}\label{G_log_expansion} G(x,L) = 1 + \sum_{k=1}^\infty \gamma_k(x) L^k , \end{align} where the function $\gamma_1(x)$, often simply denoted $\gamma(x)$, is called \emph{anomalous dimension}. The Green function $G(x,L)$ is determined by a Dyson--Schwinger equation. Before we discuss the precise form of this equation in our physical application, we will first review some algebraic background and terminology which we will need later. For the results of this paper we will be working in the context of rooted trees, not Feynman graphs, so it is worth sketching the relation between them. The key structure here is that of divergent subgraphs inside one-particle irreducible Feynman graphs. These are the subgraphs whose Feynman integral is divergent before renormalization. If the divergent subgraphs sit inside their parent graph in a tree structure, this tree structure is the \emph{insertion tree} of the Feynman graph. \begin{definition}[\cite{kreimer_overlapping_1999}]\label{def insertion tree} An \emph{insertion tree} $t$ is a rooted tree with each vertex labelled with a primitive divergent Feynman graph and edges labelled to mark the insertion place. This is a decorated rooted tree where the decoration at each vertex is given by the graph labelling the vertex along with the insertion place labelling the edge above the vertex. \end{definition} For a particular example see \cref{eg yukawa insertion trees}. In the case of overlapping subdivergences, a single Feynman graph gives rise to multiple insertion trees, each of which gives a choice of how to build the parent graph by insertion. The labelled insertion trees are in bijection with the original Feynman graphs. Without labelling, the map is generally not bijective as different Feynman graphs can give rise to the same shape of insertion tree. \subsection{Algebraic set up} \label{sec algebraic set up} The algebraic underpinnings of our results are Hopf algebraic. We work over some commutative $\mathbb Q$-algebra $K$, though $\mathbb{R}$ is sufficient for the physical application. The \textit{Connes--Kreimer Hopf algebra} $\mathcal H$ is the free commutative $K$-algebra generated by rooted trees\footnote{As with all our trees so far, these are unlabelled trees.}. We equip this with a coproduct \cite{kreimer_overlapping_1999,connes_hopf_1998,connes_hopf_1999} defined on trees as \begin{equation} \label{eqn ck coproduct} \Delta t = \sum_f f \otimes (t \setminus f) \end{equation} where $f$ ranges over rooted subforests (disjoint unions of rooted subtrees) of $t$, and $t\setminus f$ is the remainder of $t$ where $f$ has been removed, with $1$ representing the empty forest. \begin{remark}\label{rem linearized coprod} Observe that in the case where $f$ has a single component, \cref{eqn ck coproduct} is the same kind of decomposition as in the definition of binary tubings (\cref{def tubing}). If we take the coproduct and then project onto the vector space inside $\mathcal H$ given by the span of single rooted trees, this is known as the \emph{linearized coproduct}. From the recursive characterization of tubings, we see that the tubings of a tree $t$ correspond to the ways to iterate the linearized coproduct until $\bullet\otimes \bullet\otimes \cdots \otimes \bullet$ is obtained. \end{remark} Let $B_+$ be the linear operator on $\mathcal H$ which sends a forest to the tree obtained by adding a root and attaching this new root to the root of each component, as in our original recursive definition of rooted trees (\cref{def rooted tree}). This operator satisfies \begin{equation}\label{coprod B+} \Delta B_+ = B_+ \otimes 1 + (\mathrm{id} \otimes B_+) \Delta. \end{equation} Any tree can be uniquely written as $B_+$ applied to a forest, so \cref{coprod B+} could also be taken as a recursive definition of the coproduct \eqref{eqn ck coproduct}. In general an operator on any bialgebra which satisfies this identity is a \textit{Hochschild 1-cocycle}. \begin{theorem}[Universal property {\cite[Sec.~3, Thm.~2]{connes_hopf_1999}}] \label{ck universal property} Let $A$ be a commutative algebra and $\Lambda$ be an operator on $A$. There exists a unique algebra morphism $\phi\colon \mathcal H \to A$ such that $\phi B_+ = \Lambda \phi$. Moreover, if $A$ is a bialgebra and $\Lambda$ is a Hochschild 1-cocycle then $\phi$ is a bialgebra morphism. \end{theorem} For any $s \in K$, we consider the \textit{combinatorial Dyson--Schwinger equation} (DSE) \begin{equation} \label{dse algebraic} T(x) = 1 + xB_+\big(T(x)^{1+s} \big). \end{equation} We will see in \cref{sec mellin transform} what these Dyson--Schwinger equations mean in quantum field theory. For now they are simply defining equations for certain special classes of simple trees. \begin{lemma}\label{lem cdse sols} The combinatorial Dyson--Schwinger equation $T(x) = 1 + xB_+(T(x)^{1+s})$ has a unique power series solution $T(x) \in \mathcal H[[x]]$. Explicitly, the solution is given as a sum over all rooted trees \begin{align} T(x) &= 1 + \sum_t \left(\prod_{v \in V(t)} (1 + s)_{\od v}\right) \frac{tx^{|t|}}{|\operatorname{Aut}(t)|} \label{rt solution 1} \\ &= 1 + \sum_t \operatorname{pe}(t)\left(\prod_{v \in V(t)} \binom{1+s}{\od v}\right) tx^{|t|}, \label{rt solution 2} \end{align} where $\operatorname{pe}(t)$ is the number of plane embeddings and $(1 + s)_{\od v}$ is the falling factorial (see \cref{def falling factorial}). \end{lemma} This lemma is a consequence of Proposition 2 of \cite{Fdse} along with elementary group theory relating the plane and non-plane cases. It can also be derived from the more general version we will later prove as \cref{thm cdse system sols}. Let us observe that while the sums are over all rooted trees, for some values of $s$ not all rooted trees have nonzero coefficients. If $s\geq -1$ is an integer, then for $\od v > s+1$ the falling factorial is 0. In that case, the solution to the combinatorial Dyson--Schwinger equation is a sum over $(s+1)$-ary rooted trees. For noninteger $s$, and for integer $s<-1$, the falling factorials will all be nonzero and all trees will appear in the sum. Note also that \cref{rt solution 2} can be interpreted as a sum over plane rooted trees upon removing $\operatorname{pe}(t)$. \begin{example} \label{ex dse trees trivial} A trivial example of \cref{dse algebraic} is the choice $s=-1$. In this case, the DSE is not recursive. The equation -- and at the same time its solution -- read \begin{align*} T(x) = 1+x B_+(1), \end{align*} where $B_+(1)=\rtLine 1$ is the unique rooted tree consisting of only a single vertex. \end{example} \begin{example} \label{ex dse trees ladder} The simplest non-trivial DSE is the choice $s=0$ in \cref{dse algebraic}, called \emph{linear DSE} because the argument of $B_+$ is a linear function of $T(x)$. In this case, the solution \cref{rt solution 1} is the sum over \emph{ladder} trees -- trees where each vertex has at most one child. Let $\ell_n$ denote the ladder on $n$ vertices. \[ \ell_0 = 1, \qquad \ell_1 = \rtLine 1, \qquad \ell_2 = \rtLine 2, \qquad \ell_3 = \rtLine 3, \;\;\ldots \] In this case $(1+s)_{\od v} =1$ and $|\operatorname{Aut}(t)| =1$ so we find \begin{align*} T(x) &= 1 + x \rtLine 1 + x^2 \rtLine 2 + x^3 \rtLine 3 + \cdots = \sum_{j\geq 0} x^j \ell_j. \end{align*} We will return to the ladders in \cref{sec ladders}. \end{example} \begin{example}\label{ex trees negative s} A particularly important example of \cref{dse algebraic} is the case when $s=-2$. The equation generates the class of plane rooted trees (or non-plane rooted trees with multiplicities giving the number of plane embeddings). The equation becomes \[ T(x) = 1+xB_+\left(\frac{1}{T(x)}\right). \] Observe that the series $T(x)$ starts with a constant 1, so the fraction is actually well-defined and can be expanded in a geometric series \[ T(x) =1+ xB_+\left(\sum_{k\geq 0} (-1)^k \left( T(x)-1\right) ^k\right). \] The latter equation has the intuitive interpretation that the subtrees at each vertex are a list of nonempty trees; $T(x)$ generates plane rooted trees. The sign is a minor irritant, keeping track of the parity of the number of children at each vertex. Avoiding this sign is one reason for different sign conventions appearing in the set up in some sources, but it causes nuisance signs in other places. Let us compare this to \cref{lem cdse sols}. Using \cref{rt solution 2} we see that the coefficient for a given plane tree when $s=-2$ should be $\prod_{v\in V(t)} \binom{-1}{\od v}$, but $\binom{-1}{k} = (-1)^k$, so the coefficient of the tree is $\prod_{v\in V(t)}(-1)^{\od v}$ as discussed above. A physical realization of the combinatorial DSE for $s=-2$ is the Yukawa propagator, introduced in \cref{eg yukawa 1}. \end{example} \begin{remark} Similarly to the above commutative Connes--Kreimer Hopf algebra $\mathcal H$, one can use plane rooted trees (\cref{def rooted tree}) to construct a noncommutative Connes--Kreimer Hopf algebra. To this end, one changes the commutative product of trees into a noncommutative product of plane trees and otherwise carries the plane information along in the obvious way \cite{Fi, Hhook}. In the present paper, we only use the commutative Hopf algebra $\mathcal H$, but we could reformulate to work on the noncommutative Connes--Kreimer Hopf algebra and so directly use the plane rooted trees from the beginning that we only pass to for the connection to chord diagrams in \cref{sec bijection tubings chord diagrams}. \end{remark} \medskip The Hopf algebra $\mathcal H$ introduced so far is not yet sufficiently general to capture a Dyson--Schwinger equation of type \cref{dse_differential_general}, because it contains only a single cocycle $B_+$. We generalize it to a family of Hopf algebras $\mathcal H(D)$, where the elements of $D$ are called \emph{decorations}. Concretely, let $\mathcal H(D)$ be the free commutative $K$-algebra generated by trees with vertices decorated by elements of $D$. We will chiefly be interested in the case $D = \mathbb Z_{\ge 1}$, which can be interpreted as weighted rooted trees. We equip $\mathcal H(D)$ with the same coproduct as that of $\mathcal H$ in the sense that we sum over the same subtrees and simply carry along the vertex decorations. Then for each $d \in D$ there is a corresponding 1-cocycle $B_+^{(d)}$ that adds a root with decoration $d$. \begin{theorem} \label{thm ck universal property dec} Let $A$ be a commutative algebra and $\{\Lambda^{(d)}\}_{d \in D}$ be a family of operators on $A$. There exists a unique algebra morphism $\phi\colon \mathcal H(D) \to A$ such that $\phi B_+^{(d)} = \Lambda^{(d)} \phi$. Moreover, if $A$ is a bialgebra and $\Lambda^{(d)}$ is a Hochschild 1-cocycle for each $d$ then $\phi$ is a bialgebra morphism. \end{theorem} \begin{proof} By a similar argument to \cref{ck universal property}. \end{proof} The generalization of \cref{dse algebraic} to the decorated Hopf algebra $\mathcal H(\mathbb Z_{\geq 1})$ is the \emph{multi-primitive combinatorial DSE} \begin{equation} \label{dse algebraic general} T(x) = 1 + \sum_{k \ge 1} x^k B_+^{(k)} \big(T(x)^{1 + sk} \big). \end{equation} \begin{lemma} \label{thm multi primitive comb dse} The multi-primitive combinatorial DSE \cref{dse algebraic general} has the unique solution \begin{equation*} T(x) = 1 + \sum_t \left(\prod_{v \in V(t)} (1 + sw(v))_{\od v}\right) \frac{tx^{w(t)}}{|\operatorname{Aut}(t)|}, \end{equation*} where $t$ now ranges over weighted rooted trees, the vertex weight $w(v)$ is defined before \cref{def tube}. \end{lemma} \begin{proof} Analogously to \cref{lem cdse sols} this is a special case of \cref{thm cdse system sols}. \end{proof} \begin{remark} While restricting to $D = \mathbb Z_{\ge 1}$ is sufficient for solving the single equation \cref{dse_differential_general}, we will make use of the more general setup when working with \textit{systems} of Dyson--Schwinger equations in \cref{sec systems}. \end{remark} So far, we have worked in the Hopf algebra of rooted trees. To solve equations of a similar form to \cref{dse algebraic} or \cref{dse algebraic general} in other algebras, we can apply the map $\phi$ from \cref{thm ck universal property dec} to $T(x)$. Most important for us is the algebra $K[L]$ of polynomials in the single variable $L$. (We will treat the $G(x, L)$ in \cref{dse_differential_general} as a series in $x$ with coefficients from $K[L]$.) This algebra is a Hopf algebra with coproduct given by \begin{equation} \label{eq polynomial coproduct} \Delta L = 1 \otimes L + L \otimes 1 \end{equation} extended uniquely as an algebra homomorphism. \begin{theorem}[{\cite[Theorem 2.6.4]{panzer_hopf_2012}}] \label{thm polynomial cocycles} Consider a power series $A(u) \in K[[u]]$ and let $\partial_u = \frac\partial {\partial u}$. The operator on $K[L]$ given by \begin{equation} \label{polynomial cocycle 1} f(L) \mapsto \int_0^L \textnormal{d}u\;A( \partial_u)f(u) \end{equation} is a Hochschild 1-cocycle. Moreover, all 1-cocycles on $K[L]$ are of this form. \end{theorem} \begin{remark} \label{rem polynomial cocycles} Let $\Lambda$ be the operator in \cref{thm polynomial cocycles} and write $a_k$ for the coefficient of $u^k$ in $A(u)$. We can explicitly calculate the action of $\Lambda$ on a basis of $K[L]$: \begin{align*} \Lambda\left(\frac{L^n}{n!}\right) &= \int_0^L \mathrm{d}u\; \sum_{k=0}^\infty a_k \partial_u^k \frac{u^n}{n!} \\ &= \int_0^L \mathrm{d}u\; \sum_{k=0}^n a_k \frac{u^{n-k}}{(n-k)!} \\ &= \sum_{k=0}^n a_k \frac{L^{n-k+1}}{(n-k+1)!}. \end{align*} This is equal to the coefficient of $\rho^n$ in the power series $(e^{L\rho} - 1) A(\rho)/\rho$. It follows by linearity that $\Lambda$ can also be written as \begin{equation}\label{polynomial cocycle 2} \Lambda f(L) = f(\partial_\rho) \left(e^{L\rho} - 1\right) \frac{A(\rho)}{\rho}\bigg|_{\rho=0} \end{equation} since in the case of $f(L) = L^n/n!$ this extracts the same coefficient. The form \cref{polynomial cocycle 2} is more physically natural (see \cref{sec mellin transform}) since it appears in the Dyson--Schwinger equation \cref{dse_differential_general}. Nonetheless, we will make use of the form \cref{polynomial cocycle 1} in the proof of our main theorem. \end{remark} One of our main goals will be to understand explicitly what the bialgebra morphism from \cref{ck universal property} looks like when $\Lambda$ is a 1-cocycle on $K[L]$. It will be useful to better understand what morphisms into $K[L]$ look like in general. Recall that a \textit{character} of a Hopf algebra $H$ is simply an algebra morphism $H \to K$; these form a group under the convolution product $*$ defined as \begin{equation}\label{convolution product} \alpha * \beta = (\alpha \otimes \beta) \Delta. \end{equation} An algebra morphism $H \to K[L]$ then defines a one-parameter family of characters; in the case of a bialgebra morphism this is a one-parameter subgroup. An \textit{infinitesimal character} is a map $\sigma\colon H \to K$ such that \begin{equation}\label{infinitesimal character} \sigma(ab) = \varepsilon(a)\sigma(b) + \sigma(a)\varepsilon(b) \end{equation} for all $a, b \in H$. Infinitesimal characters form a Lie algebra under convolution commutator. More details can be found in \cite{bogfjellmo_character_2016,bogfjellmo_geometry_2016} and references therein. An analogue in this setting of the exponential relationship between Lie algebras and groups is the following theorem. \begin{theorem} \label{thm character exponential} Suppose $H$ is a bialgebra and $\phi\colon H \to K[L]$ is an algebra morphism. Further suppose that the constant term of $\phi$ is given by the counit. Let $\sigma$ be the linear term of $\phi$. Then $\sigma$ is an infinitesimal character. Moreover, $\phi$ is a bialgebra morphism if and only if \begin{equation*} \phi = \exp_*(L\sigma) = \varepsilon + L\sigma + \frac 12 L^2 (\sigma * \sigma) + \cdots. \end{equation*} \end{theorem} \begin{proof} By assumption we have \[ \phi(a) = \varepsilon(a) + \sigma(a)L + \text{(higher-order terms)} \] for all $a \in H$. Then \[ \phi(ab) = \phi(a)\phi(b) = \varepsilon(a)\varepsilon(b) + (\varepsilon(a)\sigma(b) + \sigma(a)\varepsilon(b))L + \text{(higher-order terms)} \] and hence \[ \sigma(ab) = \varepsilon(a)\sigma(b) + \sigma(a)\varepsilon(b) \] so $\sigma$ is an infinitesimal character. For any element $u$ of a $K$-algebra $A$, let us write $\phi_u$ for the map $H \to A$ given by evaluating $\phi$ at $L = u$ (so $\phi_L = \phi$). Then by the definition \cref{eq polynomial coproduct} of the coproduct we have $\Delta \phi = \phi_{L \otimes 1 + 1 \otimes L}$. Since $\phi$ preserves the counit by hypothesis, $\phi$ is a bialgebra morphism if and only if $\Delta \phi = (\phi \otimes \phi)\Delta$. Now, we may identify $K[L] \otimes K[L]$ with the polynomial algebra $K[L_1, L_2]$ in two variables; the desired identity then becomes \begin{equation} \label{eq bialgebra morphism equivalent} \phi_{L_1 + L_2} = \phi_{L_1} * \phi_{L_2}. \end{equation} If $\phi = \exp_*(L\sigma)$ it clearly satisfies \cref{eq bialgebra morphism equivalent}; this is the defining property of the exponential function. Conversely suppose $\phi$ satisfies \cref{eq bialgebra morphism equivalent}. Then \begin{align*} \partial_L \phi &= [h^1] \phi_{L + h} \\ &= \phi_L * [h^1] \phi_h \\ &= \phi * \sigma \end{align*} and hence \begin{align*} [L^n] \phi &= \frac{1}{n!} \partial_L^n \phi\bigg|_{L = 0} \\ &= \frac{1}{n!} \phi * \sigma^{*n}\bigg|_{L = 0} \\ &= \frac{\sigma^{*n}}{n!} \end{align*} since $\phi_0 = \varepsilon$ by assumption. Of course this coefficient is the same as in $\exp_*(L\sigma)$, so the two are equal. \end{proof} \subsection{Physical Dyson--Schwinger equations and Mellin transforms}\label{sec mellin transform} Returning to the physical motivation, we will now make the connection between the Dyson--Schwinger equations as set up so far and their more physical form and meaning. A more detailled exposition can be found in \cite{linetude,etude,kreimer_renormalization_2013}. As introduced in \cref{sec physical set up}, the Green function in question, $G(x,L)$, represents the 2-point function, that is, the propagator including quantum corrections. Schematically, a Dyson--Schwinger equation in terms of Feynman integrals is a fixed point integral equation of the form \begin{align}\label{dse_integral} G(x,p^2) = 1 +(1-\mathcal R) \sum_{k \geq 1} x^k \int \textnormal{d}^{kD} q\; \Big( K_k (p^2,q^2) G(x,q_e^2)^{1+sk} \Big). \end{align} Here, $K_k$ denotes the sum of all $k$-loop kernel graphs. These are the Feynman graphs with two external edges, and without subdivergences. The integration $\textnormal{d}^{kD}$ is over the $k$ loop momenta of the kernel, each of which is a $D$-dimensional vector in Minkowski space. The variable $q_e$ denotes the momentum of the edge $e\in K_k$, it is a linear combination of the external momentum $p$ and the loop momenta $q$. Finally, $\mathcal R$ denotes the renormalization operator, which in our case is the subtraction at the fixed external momentum scale $\mu^2$. In general, the monomial $G(x,q_e^2)^{1+sk}$ is to be understood as a product of $G(x,q_e)$ where the individual $q_e$ belong to the different edges. The parameter $s\in \mathbb R$ indicates how many new edges arise per order $k$ of the coupling. For a theory with only $n$-valent interaction vertices, the physical choice would be $s=-n$, but we leave $s$ as a free parameter. Physically, $s\neq -n$ amounts to a sum of Feynman graphs with non-standard combinatorial prefactors. We simplify the DSE \cref{dse_integral} by the assumption that the propagator corrections are inserted into only a single edge of the kernel graphs. This is a loss of generality, but it implies that all factors in $G(x,q_e)^{1+sk}$ have the same argument $q_e$ -- no longer belonging to different edges $e$ -- and we can choose $q_e$ to be one of the integration momenta $q$. \begin{example}\label{eg yukawa 1} The most basic example is the fermion propagator in 4-dimensional Yukawa theory, restricted to a single kernel graph ($k=1$), the 1-loop multi-edge with one fermion and one meson edge shown in \cref{fig yukawa kernel}. The case $s=0$ in the DSE \cref{dse_integral} for the Yukawa fermion, \begin{align*} G(x,p^2) = 1 +(1-\mathcal R)\; x \int \textnormal{d}^{D} q\; \Big( K_1 (p^2,q^2) G(x,q^2) \Big), \end{align*} amounts to the \emph{rainbow approximation} shown in \cref{fig yukawa rainbows}. Inserting the kernel into itself iteratively in all possible ways corresponds to $s=-2$ in the DSEs \cref{dse_integral,dse algebraic}, discussed in \cref{ex trees negative s}. We obtain graphs like \cref{fig yukawa all}. These are the class of graphs for which Broadhurst and Kreimer solved the Dyson--Schwinger equation in \cite{bkerfc}, and in terms of which the original chord diagram expansion of one of us with Marie \cite{MYchord} was formulated. \end{example} \begin{figure}[htb] \centering \begin{subfigure}[b]{.3\linewidth} \centering \begin{tikzpicture} \input{figure_yukawa_kernel.tikz} \end{tikzpicture} \caption{} \label{fig yukawa kernel} \end{subfigure} \hfill \begin{subfigure}[b]{.65\linewidth} \centering \begin{tikzpicture} \input{figure_yukawa_rainbows.tikz} \end{tikzpicture} \caption{} \label{fig yukawa rainbows} \end{subfigure} \vspace{.5cm} \begin{subfigure}[b]{\linewidth} \centering \input{figure_yukawa_all.tikz} \caption{} \label{fig yukawa all} \end{subfigure} \caption{ In all three figures, bold edges represent fermions and dashed edges represent mesons. \textbf{(a)} 1-loop kernel graph $K_1 $ of the fermion propagator in Yukawa theory. Corrections are to be inserted recursively into the fermion edge. \textbf{(b)} The first two graphs of the \emph{rainbow approximation} to the fermion propagator. Their insertion trees are the ladder trees $\ell_2$ and $\ell_3$, respectively. \textbf{(c)} 4-loop graphs for the choice $s=-2$. The 4-loop rainbow is not shown.} \label{fig yukawa} \end{figure} The integral DSE \cref{dse_integral} is the counterpart of the combinatorial DSE \cref{dse algebraic general}; the Hochschild 1-cocycle $B^{(k)}_+$ corresponds to insertion into the $k$-th kernel graph $K_k$. To see this more explicitly, we rewrite the series expansion \cref{G_log_expansion} in terms of derivatives, using \cref{def L} and the shorthand $\partial_\rho = \frac \partial {\partial \rho}$: \begin{align}\label{G_log_expansion2} G(x,L) = 1 + \sum_{k=1}^\infty \gamma_k(x) L^k = 1+\sum_{k=1}^\infty \gamma_k(x) \partial_\rho^k \left( \frac{q^2}{\mu^2}\right)^{\rho} \Big|_{\rho=0} = G(x,\partial_\rho) \left( \frac{q^2}{\mu^2}\right)^{\rho} \Big|_{\rho=0}. \end{align} Inserting \cref{G_log_expansion2} into the Dyson--Schwinger equation \cref{dse_integral}, we obtain \begin{align}\label{dse_integral_mellin} G(x,p^2) = 1 +(1-\mathcal R) \sum_{k \geq 1} x^k G(x,\partial_\rho)^{1+sk} (\mu^{-2})^\rho \int \textnormal{d}^{kD} q\; \Big( K_k (p^2,q^2) (q^2)^\rho \Big)\Big|_{\rho=0}. \end{align} For a kernel $K_k$, the integral on the right hand side is the definition of the \emph{Mellin transform} $F_k(\rho)$, which in turn is expressed by its power series coefficients $c_{j,k}$: \begin{align}\label{mellin_transform} \int \text{d}^{kD} q \; \Big(K_k (p^2,q^2) \cdot \left( q^2 \right)^{\rho} \Big) &= (p^2)^{\rho} F_k(\rho)= e^{\rho \ln p^2}\sum_{j=0}^\infty c_{j,k} \rho^{j-1}. \end{align} In this definition, all powers of $4\pi$ and $\gamma_E$, which might arise in the loop integral, are absorbed by a redefinition of the coupling $x^k$. The simple pole $c_{0,k} \rho^{-1}$ in $F_k(\rho)$ indicates that $K_k$ is a primitively divergent Feynman graph. The kinematic renormalization operator $\mathcal R$ in \cref{dse_integral} amounts to subtraction at the renormalization point $q^2 =\mu^2$. This produces a prefactor $((p^2)^{\rho} - (\mu^2)^\rho)$ to the integral in \cref{dse_integral}. Rescaling all momenta by $\mu^2$, and using \cref{def L}, we finally arrive at \cref{dse_differential_general}, \begin{align}\label{analytic dse} G(x,L) &= 1 + \sum_{k \geq 1} x^k G(x,\partial_\rho)^{1+sk} \Big( (e^{L \rho}-1) F_k(\rho) \Big)\Big|_{\rho=0}. \end{align} In \cref{analytic dse}, the insertion into kernel $K_k$ takes exactly the form \cref{polynomial cocycle 2}, where the series $A(\rho)/\rho = F_k(\rho)$ is the Mellin transform \cref{mellin_transform}. By this identification, the integral DSE \cref{dse_integral} -- restricted to insertions into a single edge -- indeed corresponds to the combinatorial DSE \cref{dse algebraic general}. \begin{example}\label{eg yukawa mellin transform} For the Yukawa fermion propagator introduced in \cref{eg yukawa 1}, in $D=4$ dimensions, the Mellin transform \cref{mellin_transform} of the kernel is (remember that we rescaled $x$ to absorb $4\pi$) \begin{align*} \int \frac{\text{d}^4 q}{(2\pi)^4} \; \frac{1}{(p+q)^2}\frac{1}{q^2} (q^2)^\rho &\propto (p^2)^\rho \frac{\Gamma(-\rho) \Gamma(1+\rho)}{\Gamma(1-\rho) \Gamma(2+\rho)} = \frac{e^{\rho \ln p^2} }{(-\rho)(\rho+1)} \nonumber \\ \Rightarrow F(\rho) &= \frac 1 {(-\rho)(\rho+1)} = \sum_{j=0}^\infty - (-1)^j \cdot \rho^{j-1}, \qquad c_{j,1} =c_j = -(-1)^j. \end{align*} \end{example} The morphism $\phi$ from \cref{thm ck universal property dec} operates not on Feynman graphs, but on the Connes--Kreimer Hopf algebra of their insertion trees (\cref{def insertion tree}). Consequently, $\phi$ is sometimes called \emph{tree Feynman rules}: it assigns a polynomial in $L$ to each insertion tree, and turns the combinatorial Green function $T(x)$, which is a series in rooted trees, into the analytic Green function $G(x,L) = \phi (T(x))$. By \cref{thm character exponential}, the linear term of the Feynman rules is given by the infinitesimal character \cref{infinitesimal character}, and the order-$k$ term is given by $\sigma^{*k}$. In the (log) expansion \cref{G_log_expansion}, the coefficient of $L^k$ is the function $\gamma_k(x)$, therefore the infinitesimal character extracts the anomalous dimension: \begin{align} \gamma(x) &= \sigma(T(x)), \qquad \gamma_k(x) = \sigma^{\star k} (T(x)), \qquad G(x,L) = e^{\star \sigma L}(T(x)). \end{align} Conversely, the Feynman rules discussed in the present subsection are a map from Feynman graphs directly to polynomials in $L$, without the intermediate step of insertion trees. This map is a composition of the tree Feynman rules $\phi$ and the map that sends a Feynman graph to its decorated insertion trees. Likewise, the combinatorial Dyson--Schwinger equations \cref{dse algebraic,dse_differential_general} can equivalently be seen as equations for Feynman graphs, where $T(x)$ is a series of Feynman graphs and $B^{(k)}_+$ denotes insertion into the corresponding kernel graph. \begin{example}\label{eg yukawa insertion trees} The Yukawa propagator from \cref{eg yukawa 1} involves only a single kernel graph, hence the resulting insertion trees are undecorated. It can be generalized to multiple kernel graphs, see e.g.~\cite{bierenbaum_nexttoladder_2007}, in which case the insertion trees obtain non-trivial labelling. Let $Y$ be a Yukawa graph with $n$ meson lines, where the interaction vertices are numbered $\{1,\ldots, 2n\}$. We construct an explicit map $d :Y \mapsto t$ to its insertion tree $t$. Each meson line is expressible by its two end vertices, the outermost meson line is $c_0=(1,2n)$ and maps to the root $v_0 = d(c_0)$ of the plane rooted tree. For each meson line $(a_j,b_j)$ of $Y$, consider the mesons which are outermost inside $(a_j,b_j)$, calling them $\{a_{i_1},b_{i_1}\}, \{a_{i_2},b_{i_2}\}$, $\dots, \{a_{i_k},b_{i_k}\}$ such that $a_j < a_{i_1}<b_{i_1} < a_{i_2}<b_{i_2}< \dots < a_{i_k}<b_{i_k} < b_j$. Then the children of the vertex $v_j$ are $v_{i_1},v_{i_2},\dots, v_{i_k}$, where $v_j = d(a_j,b_j)$ is associated to the meson $(a_j,b_j)$ and $v_{i_l} = d(a_{i_l},b_{i_l})$ is associated with $(a_{i_l},b_{i_l})$. In other words, if there exist components $c_1,c_2, \dots, c_k$ nested within each meson $c_i$ of the Yukawa graph, then there is a vertex $v_i=d(c_i)$ in the plane rooted tree with children $d(c_1),d(c_2), \dots, d(c_k)$. The so-defined map $d$ is a bijection between the set of these Yukawa graphs and the set of plane rooted trees. Furthermore the number of meson lines corresponds to the number of vertices under $d$. To see this, proceed inductively. The result holds for one meson $c_0$ and one vertex $v_0$ immediately from the definition. Given $Y$ with more than one meson, applying the definition to the outermost meson $c_0$, we see that the children of the root $v_0$ are given by the subgraphs inserted under $c_0$. Inductively, $d$ is bijective on these subgraphs and subtrees, and so $d(Y)$ can be uniquely obtained from $Y$, and the number of mesons corresponds to the number of vertices. \cref{figure yukawa insertion trees} shows the insertion trees corresponding to the Yukawa Feynman graphs in \cref{fig yukawa}. The insertion tree of the $n$-loop rainbow graph is the ladder $\ell_n$ from \cref{ex dse trees ladder}. So far, $d$ has been a bijection between individual graphs and rooted trees. If we set $s=-2$ in the Dyson--Schwinger equation, we obtain precisely \emph{all} possible Yukawa graphs, and $d$ is a bijection to the set of \emph{all} plane rooted trees. Indeed, for $s=-2$, the structure of the combinatorial Dyson--Schwinger equation for the Feynman graphs is identical to that of the combinatorial Dyson--Schwinger equation for plane rooted trees as described in \cref{ex trees negative s}. As will be discussed in \cref{eg Yukawa chord}, the Yukawa propagator Feynman graphs can be viewed as indecomposable non-crossing chord diagrams, where the meson lines are the chords. Then, the above bijection $d$ is between indecomposable non-crossing chord diagrams and plane rooted trees. This bijection $d$ is different from the later $\theta$ (\cref{map tubed RTs to connected CDs}), which is between chord diagrams and \emph{tubed} rooted trees. Rather, $d$ gives us the tree of a Yukawa graph, and then that is the tree we tube. $\theta$ then translates each tubing to a chord diagram to give the contribution of the Yukawa graph to the original chord diagram expansions. Note further that this concrete form of $d$ is valid only for the Yukawa example, whereas the bijection $\theta$, and the tubings, operate on the insertion trees and are agnostic with respect to the physical theory in question. \end{example} \begin{figure}[htb] \centering \begin{tikzpicture} \coordinate (dy) at (0,-.7); \node[vertex] at (-.5,.8){}; \node at (-.5,-1){{\bfseries (a)}}; \node[vertex](v1) at (1.5,1){}; \node[vertex](v2) at ($(v1) + (dy)$){}; \draw[edge] (v1)--(v2); \node[vertex](v1) at (2.5, 1.2){}; \node[vertex](v2) at ($(v1) + (0,-.6)$){}; \node[vertex](v3) at ($(v2) + (0,-.6)$){}; \draw[edge] (v1) -- (v2) -- (v3); \node at (2,-1){{\bfseries (b)}}; \node[vertex] (v1) at (5, 1.2){}; \node[vertex] (v2) at ($(v1) + (230:.7)$){}; \node[vertex] (v3) at ($(v1) + (310:.7)$){}; \node[vertex] (v4) at ($(v2) + (270:.6)$){}; \draw[edge] (v4) -- (v2) -- (v1) -- (v3); \node[vertex] (v1) at (6.5, 1.2){}; \node[vertex] (v2) at ($(v1) + (270:.6)$){}; \node[vertex] (v3) at ($(v2) + (230:.7)$){}; \node[vertex] (v4) at ($(v2) + (310:.7)$){}; \draw[edge] (v1) -- (v2) -- (v3) -- (v2) --(v4); \node[vertex] (v1) at (8, 1.2){}; \node[vertex] (v2) at ($(v1) + (310:.7)$){}; \node[vertex] (v3) at ($(v1) + (230:.7)$){}; \node[vertex] (v4) at ($(v2) + (270:.6)$){}; \draw[edge] (v4) -- (v2) -- (v1) -- (v3); \node[vertex] (v1) at (9.8, 1){}; \node[vertex] (v2) at ($(v1) + (220:.8)$){}; \node[vertex] (v3) at ($(v1) + (270:.7)$){}; \node[vertex] (v4) at ($(v1) + (320:.8)$){}; \draw[edge] (v2) -- (v1) -- (v3) -- (v1) -- (v4); \node at (7.5, -1){{\bfseries (c)}}; \end{tikzpicture} \caption{Insertion trees corresponding to the Feynman graphs in \cref{fig yukawa}. {\bfseries (a)} the kernel itself is represented by a single vertex. {\bfseries (b)} Rainbow graphs correspond to ladder trees $\ell_n$ (\cref{sec ladders}). {\bfseries (c)} the choice $s=-2$ gives rise to all plane rooted trees, not just ladders. } \label{figure yukawa insertion trees} \end{figure} The Dyson--Schwinger equation implies the validity of the renormalization group equation, or Callan--Symanzik equation \cite{callan_broken_1970,symanzik_small_1970}. For the higher coefficients $\gamma_{k>1}(x)$ in the series expansion \cref{G_log_expansion}, the latter reads \cite{anatomy,bergbauer_hopf_2005,etude} \begin{align}\label{gammak_rge} \gamma_1(x) = \gamma(x), \qquad k \gamma_k(x) &= \gamma(x) \left( 1+sx \partial_x \right) \gamma_{k-1}(x) \qquad \forall k>1. \end{align} By virtue of \cref{gammak_rge}, the full solution \cref{G_log_expansion} of a DSE can be reconstructed entirely from the anomalous dimension $\gamma(x)$, that is, the linear coefficient $[L^1]G(x,L)$. The case of a linear Dyson--Schwinger equation, that is $s=0$, is particularly simple. From \cref{gammak_rge} we obtain \begin{align} \gamma_k(x) = \frac{1}{k!}\gamma(x)^k, \qquad G(x,L) = \exp \left( \gamma(x) \cdot L \right) = \left( \frac{q^2}{\mu^2}\right)^{\gamma(x)}. \end{align} In the case of only a single kernel graph and $s\neq 0$, one obtains the (pseudo) differential equation \begin{align}\label{anomalous_dimension_nonlinear} \frac{1}{\rho \cdot F(\rho)} \Big|_{\rho \rightarrow \gamma(x)(1+sx \partial_x)} \gamma(x) &= x \end{align} for the anomalous dimension $\gamma(x)$, by inserting the expansion \cref{G_log_expansion} into the DSE \cref{analytic dse} and using \cref{gammak_rge}. \begin{example}\label{eg yukawa ode} For the Yukawa example, the Mellin transform was computed in \cref{eg yukawa mellin transform}, and \cref{anomalous_dimension_nonlinear} becomes \begin{align*} -\left( 1+\gamma(x) (1+s x \partial_x) \right) \gamma(x) = x. \end{align*} This ODE, and its close cousin for $D=6$ dimensions, recently attracted interest for its non-perturbative solutions \cite{borinsky_nonperturbative_2020,borinsky_semiclassical_2021,borinsky_resonant_2022}. \end{example} For a linear DSE, where $s=0$, \cref{anomalous_dimension_nonlinear} is replaced by the algebraic equation \cite{linetude} \begin{align}\label{anomalous_dimension_linear} \frac 1 {F(\gamma(x))} = x \qquad \Leftrightarrow \qquad \gamma(x) = F^{-1} \left( \frac 1 x \right). \end{align} For the bijection to tubings examined later, it will be useful to express \cref{anomalous_dimension_linear} in terms of the individual series coefficients. This is done by the following lemma: \begin{lemma}\label{lem linear coefficients} Consider a linear DSE with a single kernel graph with Mellin transform \cref{mellin_transform} $F(\rho) = \sum_{j=0}^\infty c_j \rho^{j-1}$ . Then, the coefficients of the anomalous dimension are $ [x^1]\gamma(x) = c_0$ and \begin{align*} [x^n] \gamma(x) &= \sum_{j=1}^{n-1} \frac{c_0^{n-j}}{(n-j)!} B_{n-1,j} (1! c_1, 2! c_2, 3! c_3, \ldots),\qquad n>1, \end{align*} where $B_{n,k}(\ldots)$ is the partial Bell polynomial. \end{lemma} \begin{proof} The given formula is a series expansion of \cref{anomalous_dimension_linear}. We use the Lagrange inversion formula \cite{merlini_lagrange_2006}, starting from the following statement: If two power series $A(x)$ and $B(x)$ satisfy \begin{align}\label{lif} A(x) = x B(A(x)), \end{align} then the $n$-the coefficient of $A(x)$ can be computed from the series $B(x)$ according to \begin{align}\label{lif2} [x^n] A(x) = \frac 1 n [x^{n-1}] B(x)^n \end{align} for $n > 0$. In our case, we let $A(x) =\gamma(x)$ be the anomalous dimension and we choose $B(x) = x F(x)$. With this choice, \cref{lif} becomes $\gamma(x) = x \cdot \gamma(x) \cdot F(\gamma(x))$, which is \cref{anomalous_dimension_linear}. Now define $\bar F(\rho)$ by the equation \begin{align*} F(\rho) = \sum_{j=0}^\infty c_j \rho^{j-1} = \frac{c_0}\rho \left( 1+ \bar F(\rho)\right), \qquad \bar F (\rho) = \sum_{j=1}^\infty \frac{c_j}{c_0} \rho^j. \end{align*} From Faà di Bruno's formula and the binomial theorem, one has \begin{align*} \bar F(\rho)^j &= \sum_{k=j}^\infty \frac{j!}{k!}c_0^{-j} B_{k,j} \left( 1! c_1, 2! c_2, 3! c_3, \ldots \right) \rho^k\\ F(\rho)^n &= \frac{c_0^n}{\rho^n} \sum_{j=0}^n \binom{n}{j}\bar F(\rho)^j= \sum_{j=0}^n \sum_{k=j}^\infty \frac{n!}{(n-j)!k!}c_0^{n-j} B_{k,j} \left( 1! c_1, 2! c_2, 3! c_3, \ldots \right) \rho^{k-n}. \end{align*} By \cref{lif2}, we need to extract the coefficient $[\rho^{n-1}]$ of $(\rho F(\rho))^n$, which amounts to extracting $[\rho^{-1}]$ from $(F(\rho))^n$, \begin{align*} [x^n]\gamma(x) &= \frac{1}{n} [\rho^{-1}] \sum_{j=0}^n \sum_{k=j}^\infty \frac{n!}{(n-j)!k!}c_0^{n-j} B_{k,j} \left( 1! c_1, 2! c_2, 3! c_3, \ldots \right) \rho^{k-n}. \end{align*} Taking the coefficient with respect to $k=n-1$ from this sum produces the claimed result. Observe that $j=0$ and $j=n$ do not contribute since the Bell polynomial vanishes. \end{proof} \begin{example}\label{eg Yukawa ladders physically} The rainbow approximation to the Yukawa fermion, introduced in \cref{eg yukawa 1}, is a linear DSE. Using the Mellin transform from \cref{eg yukawa mellin transform} in \cref{anomalous_dimension_linear}, we obtain the well-known anomalous dimension \cite{delbourgo_dimensional_1996,linetude} \begin{align*} \gamma(x) = \frac{\sqrt{1-4x}-1}{2}, \qquad \text{(for $s=0$ in Yukawa theory)}. \end{align*} Observe that our choice $G=1+L+\cdots$ in \cref{G_log_expansion} flips the sign of $x$ compared to the literature. We'll return to this and the connection to Catalan numbers in \cref{sec ladders}. \end{example} \section{Special cases of tubings}\label{sec examples} Having introduced the algebraic formalism and the physical motivation of the Dyson--Schwinger equations in question, we now return to the main topic of the present paper: the solution of the DSE in terms of tubings, claimed in \cref{thm main thm}. Before we prove this theorem, we illustrate its consequences in some more detailed examples. \subsection{Ladders}\label{sec ladders} Recall the ladders, $\ell_n$ from \cref{ex dse trees ladder}, where we saw that ladders arise as the solution of a linear DSE. For concreteness, we assume that there is only one cocycle; otherwise the vertices of the ladders would be decorated. The Yukawa rainbows discussed in \cref{eg Yukawa ladders physically} give one such example, but we make no assumption on $F(\rho)$ at this point. Now we have $s=0$ (for being linear) and $k=1$ (for having only one cocycle) in the combinatorial DSE \cref{dse algebraic general}: \begin{align}\label{eq lin comb DSE} T(x) = 1+ x B_+ \big( T(x) \big). \end{align} The generating function of ladders, that is, the series $T(x) = \sum_{n\geq 0}x^n\ell_n$, is the unique power series solution of \cref{eq lin comb DSE}, as can be seen iteratively, starting from $B_+(1)=\rtLine 1$. In this way we say that \cref{eq lin comb DSE} generates the family of ladders. The physical DSE corresponding to \cref{eq lin comb DSE} is \[ G(x,L)=1+xG(x, \partial_\rho)(e^{L\rho}-1)F(\rho)\bigg|_{\rho=0} \] which are \cref{dse_differential_general,analytic dse} with $k=1$ and $s=0$. \medskip \begin{figure}[htb] \centering \begin{tikzpicture} \input{figure_3.tikz} \end{tikzpicture} \caption{The five different tubings of $\ell_4$. Note that we skipped the inner- and outermost tubes.} \label{figure ladders} \end{figure} Let us consider the content of the main theorem in this case. The tubings of ladders can be described very nicely. We saw in \cref{fig:small_example,figure ladders} that $\ell_3$ has two and $\ell_4$ has five tubings. \begin{lemma}\label{lem ladders tubings} For $n\geq0$, $N(\ell_{n+1})=C_n$, where $C_n = \frac{1}{n+1}\binom{2n}{n} $ are the Catalan numbers. \end{lemma} \begin{proof} We use induction. There is exactly one ladder tree $\ell_n$ for each $n\in \mathbb{N}$. Removing one edge $e$ amounts to splitting $\ell_n$ into two ladders, $\ell_n = \ell_{j} \cup e \cup \ell_{n-j}$, where $0< j <n$. As seen explicitly above, the claim of the lemma holds for $\ell_{n\leq 4}$. Assume, $N(\ell_n)= C_{n-1}$ holds up to some number $n$ of vertices. Then, by \cref{lem recursive tubing count}, \begin{align*} N(\ell_{n+1}) = \sum_{j=1}^{n} N(\ell_j)N(\ell_{n+1-j}) = \sum_{j=0}^{n-1} C_{j} C_{n-1-j} = C_n. \end{align*} The sum is the well-known recursive definition of the Catalan numbers \cite{stanley_catalan_2015}. \end{proof} \begin{example} In the special case of the Yukawa theory, \cref{eg Yukawa ladders physically}, the Mellin transform \cref{mellin_transform} assigns the value $c_i=-(-1)^i$ to all $i$. Any tubing of $\ell_n$ contains exactly $2n-1$ tubes, the Mellin monomial (\cref{def Mellin monomial}), $c(\tau) c_{b(\tau)-1}$, involves exactly $n$ factors. The sum of the indices of these factors is therefore $(2n-1)-n\cdot 1 = n-1$ and the product of the Mellin coefficients is $(-1)$ for every tubing of $\ell_n$. By \cref{thm main thm}, the contribution of any tubing $\tau$ of a ladder to the anomalous dimension is $[L^1] \phi_L(\tau) =-1$. Consequently, the contribution of $\ell_n$ to the $L^1$ coefficient of $G(x,L)$, that is to the anomalous dimension, is exactly the number of tubings of $\ell_n$, namely $-1\cdot C_{n-1}$. The constant $\ell_0=1$ does not contribute to the anomalous dimension. Summing over all orders $n\in [1,\infty)$, we obtain the generating function of the Catalan numbers, which reproduces \cref{eg Yukawa ladders physically}: \begin{align*} [L^1] G(x,L) = \gamma(x) = \sum_{n=1}^\infty (-1) C_{n-1} x^n = \frac{\sqrt{1-4x}-1}{2}. \end{align*} \end{example} \noindent For the ladder trees, it is possible to find an explicit formula for the sum of their tubings: \begin{proposition}\label{prop tubings ladder} Consider a single Mellin transform \cref{mellin_transform} $F(\rho)=\sum_{j\geq 0}c_j \rho^{j-1}$ and let $\ell_n$ be the ladder tree on $n$ vertices. Then, the contribution of $\ell_n$ to the anomalous dimension is \begin{align*} \sum_{\tau \in \mathrm{Tub}(\ell_n)} [L^1] \phi_L(\tau)= \sum_{j=1}^{n-1} \frac{c_0^{n-j}}{(n-j)!} B_{n-1,j} (1! c_1, 2! c_2, 3! c_3, \ldots). \end{align*} \end{proposition} \begin{proof} There is exactly one ladder tree $\ell_n$ for each $n\in \mathbb{N}$, and it has $w(\ell_n)=n$ vertices. Consequently, a sum over all trees $t$ amounts to a sum over $n\in \mathbb N$. Further, ladders are the (combinatorial) solution of the DSE for $s=0$. Every vertex has order $\od v=1$. Therefore, the anomalous dimension as given in \cref{thm main thm} reduces to \begin{align*} \gamma(x) = \sum_{n=1}^{\infty} x^n \cdot 1 \cdot \sum_{\tau \in \mathrm{Tub}(\ell_n)}\prod_{ v\in V(\ell_n)} c_{b(v,\tau)-1} = \sum_{n=1}^\infty x^n [L^1] \phi_L(\ell_n). \end{align*} On the other hand, the coefficients of the solution of a linear DSE are given by \cref{lem linear coefficients}. We conclude that the sum over all tubings of $\ell_n$ results in the claimed value. \end{proof} \begin{figure}[htb] \centering \begin{tikzpicture} \input{figure_5.tikz} \end{tikzpicture} \caption{Turning a tubing of $\ell_5$ into a non-crossing chord diagram $C$. Observe that, as usual, we skipped the innermost and outermost tubes in the figure on the left.} \label{fig:ladders_chords} \end{figure} \begin{remark}\label{rem ladders chord diagrams} The tubings $\tau$ of a ladder $\ell_n$ are in bijection to binary non-crossing chord diagrams $C$, that is, chord diagrams (\cref{rooted chord diagram}) where the chords do not intersect and below every chord, there are either exactly two or zero smaller chords. This bijection is constructed graphically by turning $\ell_n$ horizontally and removing the lower halves of all tubes of $\tau$. The remaining arcs form the chords of the chord diagram $C$, see \cref{fig:ladders_chords}. Later, in \cref{sec chord}, we construct a bijection $\theta$ (\cref{map tubed RTs to connected CDs}) between binary tubings and chord diagrams which is different from the \enquote{naive} mapping to $C$ shown in \cref{fig:ladders_chords}, compare \cref{figure bijection example ladders}. Namely, $C$ contains one chord for every tube, while the latter map gives one chord for every vertex. Restricting $\theta$ to only those chord diagrams obtained from tubings of ladders will define a different Catalan subclass of chord diagrams, see \cref{prop interesting chord classes}. \end{remark} \begin{remark}\label{rem ladders trees} As seen in \cref{rem tubings binary tree}, a binary tubing $\tau$ has the structure of a binary rooted tree $B$, where the tubes correspond to vertices. For a generic rooted tree $t$, the underlying rooted tree structure can not be recovered from the corresponding $B$ alone, only the information contained in the sizes of tubes. However, for $t=\ell_n$ this information is sufficient; the sizes of the tubes is the only information needed to reconstruct $t$. Given a tube containing $\ell_n$, there is one way to partition it into subtubes containing $\ell_i$ and $\ell_{n-i}$ as non-root and root part respectively. Thus every full binary tree on $n$ vertices appears through this construction from a tubing of $\ell_n$ and every tubing of $\ell_n$ gives a distinct full binary tree, see \cref{fig:ladders_trees}. The binary tree $B$ is related to the chord diagram $C$ constructed in \cref{rem ladders chord diagrams}: If $C$ were a Yukawa-type Feynman graph, then $B$ would be the corresponding insertion tree by the map $d$ constructed in \cref{eg yukawa insertion trees}. This correspondence is coincidence and comes from the fact that both $C$ and $B$ are equivalent ways of drawing a tree structure, it is \emph{not} related to Yukawa theory. In particular, the Feynman graphs corresponding to ladders $\ell_n$ are rainbows (\cref{eg yukawa 1}), which are generally not of the shape $C$. \end{remark} \begin{figure}[htb] \centering \begin{tikzpicture} \input{figure_4.tikz} \end{tikzpicture} \caption{Turning a tubing of $\ell_5$ into a binary tree. Every tube is identified with one vertex of the binary tree. Observe that we skipped the innermost and outermost tubes in the figure on the left.} \label{fig:ladders_trees} \end{figure} \FloatBarrier \subsection{Corollas or chains} \label{sec corollas} Corollas are trees where all non-root vertices are leaves. \[ s_0 = 1, \qquad s_1 =\rtLine 1, \qquad s_2 = \rtLine 2, \qquad s_3 = \rtV, \qquad s_4 = \rtW, \ldots \] The tubings of $s_n$ are easy to describe. The only way to partition a corolla into two pieces, both of which are connected, is to have one piece be the corolla of size one smaller and the other piece be a single leaf. A tubing then is a choice of leaf at this outermost level, a choice of one of the remaining leaves at the next level, and so on, see \cref{figure corollas}. That is, tubings of $s_n$ are in bijection with permutations of the leaves. Consequently, using \cref{lem recursive tubing count}, the number of tubings is $N(s_{n+1}) = n\cdot N(s_n)$. This proves the following lemma. \begin{lemma}\label{lem chains tubings} $s_{n+1}$ has $n!$ tubings, $N(s_{n+1})=n!$ \end{lemma} \begin{figure}[htb] \centering \input{figure_corollas.tikzpicture} \caption{The six different tubings of $s_4$.} \label{figure corollas} \end{figure} The analogue of \cref{prop tubings ladder} for the case of corollas follows directly from the above characterization of the tubings. The exact form for the contribution of the corollas to $G(x,L)$ in \cref{thm main thm} is \begin{align} \phi_L(s_n) = n!c_0^{n-1}\left(\sum_{i=1}^{n}c_{n-i} \frac{L^i}{i!}\right), \end{align} and in particular the contribution of $c_n$ to the anomalous dimension is $n!c_0^{n-1}c_{n-1}L$. As Feynman graphs, the corollas correspond to a chain of one loop bubbles inside one outer insertion. The sum of them amounts to the \emph{chain approximation}. Unlike the ladder approximation, the chain approximation does not arise from a Dyson--Schwinger equation and so does not have all the properties one would want, physically, see \cite{balduf_dysonschwinger_2022}. Nonetheless it can serve as an interesting mathematical example. Ladders (\cref{lem ladders tubings}) and corollas (chains) (\cref{lem chains tubings}) lead to the following bound. \begin{lemma}\label{tubings_bound} The number of tubings $N(t)$ of a rooted tree $t$ with $n$ vertices is bounded between the Catalan number $C_{n-1}$ and the factorial $(n-1)!$ \end{lemma} The idea here is that the ladders and corollas are the extreme cases for the number of tubings a rooted tree can have. \begin{proof} We use induction. The claim is correct for all trees which contain 3 or fewer vertices, by explicit enumeration as shown above. Let $t$ be a tree which contains $k<n$ vertices, and assume that $C_{k-1}\leq N(t) \leq (k-1)!$ holds. We want to show that the same holds for a tree which has $n$ vertices. Using \cref{lem recursive tubing count}, the number of tubings of a tree $t$ is $ N(t) = \sum_{e\in E(t)} N(t_1) N(t_2)$, where $t_1,t_2$ are the two trees that arise from removing edge $e$. The trees $t_1$ and $t_2$ contain $0\leq n_1 <n$ and $n-n_1$ vertices respectively. First, consider the upper bound. By assumption, $N(t_1) \leq (n_1-1)!$ and $N(t_2)\leq (n-n_1-1)!$. For a fixed $n$, the product $(|V(t_1)|-1)!(|V(t_2)|-1)!$ is a concave function, it reaches its maximum when either $n_1=1$ or $n_1=n-1$, and in both cases $\max\left((|V(t_1)|-1)!(|V(t_2)|-1)!\right) \leq 1\cdot (n-2)!$. The tree $t$ contains $(n-1)$ edges, hence, the sum in \cref{lem recursive tubing count} has $(n-1)$ terms. The maximum value it can attain is therefore \begin{align*} N(t) &= \sum_{e\in E(t)} N(t_1) N(t_2) \leq (n-1) \cdot 1\cdot (n-2)!=(n-1)! \end{align*} as claimed. The upper bound corresponds to the corollas (\cref{lem chains tubings}), they are \enquote{as dense as possible}, removing any of the edges splits off only a single vertex. \medskip For the lower bound, first recall that by \cref{lem recursive tubing count} the number of tubings is not affected by the choice of root of the tree, that is, two rooted trees with the same underlying unrooted tree have the same number of tubings. The next thing we need to consider is a vector recording how many ways a tree can be broken into pieces of particular sizes. Specifically, given a tree $t$ with $n$ vertices (which may be unrooted or may be rooted or plane rooted, but neither the root nor the plane structure are needed), let $(n_1, n_2, n_3, \ldots, n_{\lfloor n/2\rfloor})$ be defined so that $n_i$ is the number of edges $e$ of $t$ with the property that removing $e$ leaves a tree of size $i$ and a tree of size $n-i$. Let $t_1$ and $t_2$ be trees with $n$ vertices and $(n_1^{(1)}, n_2^{(1)}, \ldots, n_{\lfloor n/2 \rfloor}^{(1)})$ and $(n_1^{(2)}, n_2^{(2)}, \ldots, n_{\lfloor n/2 \rfloor}^{(2)})$ respectively the vectors defined above. Say a tree $t_1$ is \emph{more evenly broken} than $t_2$ if for each $1\leq i \leq \lfloor n/2\rfloor$, $n_1^{(1)} + \cdots + n_i^{(1)} \leq n_1^{(2)} + \cdots + n_i^{(2)}$ and at least one of the inequalities is strict. The claim is that no tree on $n$ vertices is more evenly broken than $\ell_n$. To prove this claim let $t$ be any tree on $n$ vertices which does not have the same underlying unrooted tree as $\ell_n$, that is $t$ is not a path in the graph theory sense. Suppose for a contradiction that $t$ is more evenly broken than $\ell_n$ and that the length of $t$'s longest path is longest among all trees on $n$ vertices which are more evenly broken than $\ell_n$. Let $P$ be a longest path in $t$. Since $t$ is not a path, there is at least one vertex on $P$ which has a neighbour not on $P$. Let $v$ be such a vertex that is as close a possible to an end of $P$. Now we will consider three important connected subgraphs of of $t$. Let $P_1$ be the part of $P$ from $v$ to this nearest end. $P_1$ has at least 2 vertices, is a path, and $v$ is the only vertex of $P_1$ with neighbours which are not in $P_1$. Let $t_2$ be the component of $t-E(P)$ which includes $v$. Note that $t_2$ contains at least two vertices and is a tree. Finally, let $t_1$ be the subgraph of $t$ given by removing the edges of $P_1$ and the edges of $t_2$ and removing all isolated vertices this creates. Note that $t_1$ is a tree and has at least as many vertices as $P_1$ by choice of $v$. Also, note that $P_1$, $t_1$ and $t_2$ all include $v$ and identifying their three copies of $v$ we reobtain $t$. An example of this decomposition is shown in \cref{figure proof N}. \begin{figure}[htb] \begin{center} \input{figure_proof_N.tikzpicture} \end{center} \caption{Decomposition of a tree into $t_1, t_2$ and $P_1$. The longest path $P$ is indicated in red.} \label{figure proof N} \end{figure} Now using $P_1$, $t_1$ and $t_2$ build another tree $t'$ by identifying the copies of $v$ in $P_1$ and $t_1$ and identifying the copy of $v$ in $t_2$ with the other end of $P_1$. Then $t'$ is more evenly broken than $t$. To see this, every edge that is not in $P_1$ breaks into components of the same size in $t$ and in $t'$. Consider then the edge which breaks $P_1$ into a path of size $i_1$ including $v$ and a path of size $i_2$ not including $v$. In $t$ cutting this edge gives a component of size $i_2$ and a component of size $|t_1| + i_1 + |t_2| -2$, while in $t'$ cutting this edge gives a component of size $|t_2|+i_2-1$ and a component of size $|t_1| + i_1-1$. Now, $i_2 < |P_1| \leq |t_1|$ and $i_1$, $i_2$ and $|t_2|$ are each at least 1, so the smallest of the four components whose sizes are listed above is the one of size $i_2$, so this cut is less even in $t$ than in $t'$. Putting all this together $t'$ is more evenly broken than $t$. Now by assumption $t$ is more evenly broken than $\ell_n$ and we just proved $t'$ is more evenly broken than $t$, so $t'$ is more evenly broken than $\ell_n$, but $t'$ has a longer longest path than $t$, contradicting the choice of $t$. Therefore no tree on $n$ vertices is more evenly broken than $\ell_n$. With this claim proven we can now prove that no tree on $n$ vertices has fewer tubings than $\ell_n$ by induction. The result holds for $n=1$, suppose it holds for all trees on $<n$ vertices and consider $t$ on $n$ vertices and let $(n_1, n_2, \ldots, n_{\lfloor n/2 \rfloor})$ be the vector counting how it breaks. $t$ is no more evenly broken than $\ell_n$ so $n_1+\cdots + n_i \geq 2i$ for $1\leq i < \lfloor n/2 \rfloor$ and $n_1+\cdots + n_{\lfloor n/2 \rfloor} = n$. By \cref{lem recursive tubing count} we can count tubings by counting tubings of the two connected subgraphs for each way of cutting one edge of $t$. Using the inductive bound for those subgraphs, which are themselves rooted trees, we see that the number of tubings of $t$ is at least \[ \sum_{i=1}^{\lfloor n/2\rfloor} n_i C_{i-1}C_{n-i-1} \] Now we need a final claim: we claim that for $i\leq n/2$, $C_{i-1}C_{n-i-1}\leq C_{i-2}C_{n-i}$. Let us notice why this claim will suffice to prove the lower bound and then we will prove the claim. If the claim holds then since $t$ is no more evenly broken than $\ell_n$ we have \[ |\mathrm{Tub}(t)| \geq \sum_{i=1}^{\lfloor n/2\rfloor} n_i C_{i-1}C_{n-i-1} \geq \sum_{i=1}^{\lfloor n/2\rfloor} n_i^{(\ell_n)} 2C_{i-1}C_{n-i-1} = |\mathrm{Tub}(\ell_n)| = C_{n-1} \] where $n_i^{(\ell_n)} = 2$ for $i<n/2$ and for $n$ even $n_{n/2}=1$, proving the lower bound. It remains now to prove the final claim. This is a small algebraic exercise in binomial coefficients: \[ \frac{C_{i-1}C_{n-i-1}}{C_{i-2}C_{n-i}} = \frac{(2i-3)(n-i+1)}{i(2n-2i-1)} \] We wish to prove this rational function is $\leq 1$ for $1\leq i\leq n/2$. The denominator is nonzero in this range so it suffices to show that the numerator minus the denominator is less than 0. The numerator minus the denominator is $(2i-3)(n-i+1) - i(2n-2i-1) = 6i-3n-3$ which is less than $0$ provided $i\leq n/2 + 1/2$ and proving the claim. \end{proof} Note that this bound is very weak for high numbers of vertices since $C_n \sim \frac{4^n}{(n+1)\sqrt n}$ grows slower than factorially. \begin{example}\label{ex yukawa bound} For the Yukawa theory in $D=4$ dimensions, the bound on the number of tubings, \cref{tubings_bound}, allows us to deduce a bound on the coefficients of the anomalous dimension itself. This is because the Mellin transform, computed in \cref{eg yukawa mellin transform}, has the particularly simple form $c_j = (-1)^{j+1}$. A tubing $\tau$ of a tree on $n$ vertices consists of $2n-1$ tubes. The $b$-statistic (\cref{def b statistic}) is the number of tubes of which a given vertex is root. Consequently, the $n$ vertices are, together, root of $2n-1$ tubes, and the Mellin monomials evaluate to an overall prefactor \begin{align*} \prod_{v \in V(t)} c_{b(v,\tau)-1} = \prod_{v\in V(t)} (-1)^{b(v,\tau)} = (-1)^{2n-1} = -1. \end{align*} By \cref{thm main thm}, the anomalous dimension is \begin{align*} \gamma(x) = (-1) \cdot \sum_t \frac{x^{w(t)}}{|\operatorname{Aut}(t)|} \left( \prod_{v\in V(t)} (1+sw(v))_{\od v} \right) \sum_{\tau \in \mathrm{Tub}(t)} 1 . \end{align*} For a tree $t$ with $n$ vertices, the sum on the right is bounded by \cref{tubings_bound}: $C_{n-1} \leq \sum_{\tau \in \mathrm{Tub}(t)}1 \leq (n-1)!$. \end{example} \subsection{Splitting off single leaves} \label{sec splitting off leaves} Another interesting example comes from looking at special tubings rather than special trees. Define a \emph{leaf tubing} to be a tubing where every bipartition of a tube divides the tube into a single leaf and the rest of the tube. A \emph{decreasing labelling} of a rooted tree $t$ with $n$ vertices is a labelling of the vertices by $1, \ldots, n$ such that every child has a smaller label than its parent. This is a classical and well-studied notion, particularly in the equivalent form of \emph{increasing labellings} \cite{BFSincrease}. \begin{lemma} \label{leaf_label_lemma} Let $t$ be a rooted tree with $n$ vertices. The number of leaf tubings of $t$ is the number of decreasing labellings of $t$. \end{lemma} Note that when a tube is divided into a single leaf and the rest, that leaf is a leaf in the induced subgraph of the vertices of the tube, and may or may not be a leaf in the full tree. \begin{proof} Label the root by the number of tubes it is contained in and label every other vertex by one less than the number of tubes it is contained in. The claim is that this gives a decreasing labelling. The leaf partitioned off at the first step is in exactly 2 tubes, the outermost tube and its own tube. The single leaf partitioned of the remaining part at the next step (which may or may not be a leaf of the full tree), is in exactly 3 tubes, the outermost tube, the root tube from the first partitioning and its own tube. Inductively, the leaf partitioned off at the $i$th step is in exactly $i+1$ tubes. At the last step, which is the $n-1$st step, both the root and the leaf partitioned off are in $n$ tubes. Therefore the labelling given above does label the vertices by $1,\ldots, n$ with no repetition. It remains to check that every child's label is smaller than its parent's label. This is true of the root and the vertex partitioned off from the root at the last step since each are in $n$ tubes, but only the non-root has this number decreased to get its label. For every other pair of parent and child, the two vertices must be in a different number of tubes so it suffices to check that the child is in no more tubes than the parent. To see this, note that by the choice of kind of tubing we are considering, every tube of size $>1$ includes the root and this means that a child can be in as most as many tubes of size $>1$ as its parent, then that the fact that every vertex is in exactly one tube of size 1 gives the result. \end{proof} Under the bijection with rooted connected chord diagrams we will define in \cref{sec chord}, the special tubings considered in this example correspond to a particularly interesting class of chord diagrams; see \cref{prop interesting chord classes}. \FloatBarrier \section{Tubing Feynman rules}\label{sec tubing feynman rules} In the present section, we show that tubings solve Dyson--Schwinger equations as stated in \cref{thm main thm}. We work in the algebraic setting introduced in \cref{sec algebraic set up}. \subsection{Algebraic results and single-equation case} Let $D$ be a set of decorations and suppose for each $d \in D$ we are given a formal Laurent series \begin{equation} F_d(\rho) = \sum_{n \ge 0} c_{n,d} \rho^{n-1}. \end{equation} We then define a family of Hochschild 1-cocycles $\{\Lambda^{(d)}\}_{d \in D}$ on $K[L]$ by \begin{equation}\label{eq Lambda d} \Lambda^{(d)} p(L) = p(\partial_\rho) (e^{L\rho} - 1) F_d(\rho)|_{\rho=0}. \end{equation} (That these are indeed 1-cocycles follows from \cref{rem polynomial cocycles} or by a tedious but straightforward computation.) By \cref{thm ck universal property dec} there is a unique map $\phi\colon \mathcal H(D) \to K[L]$ satisfying $\phi B_+^{(d)} = \Lambda^{(d)}\phi$. We aim to give a formula for this map in terms of tubings. \begin{remark} \label{rem dse with cocycles} In the case of $D = \mathbb Z_{\ge 1}$, the operators we have defined are exactly those that appear in \cref{dse_differential_general}, which can be written as \begin{equation} G(x, L) = 1 + \sum_{k \ge 1} x^k \Lambda^{(k)}(G(x, L)^{1 + sk}). \end{equation} Having written it in this form, it is clear that applying the map $\phi$ to the solution of the \textit{combinatorial} DSE \cref{dse algebraic general} gives the solution to \cref{dse_differential_general}. Physically $\phi$ is a tree version of the \textit{renormalized Feynman rules} as discussed in \cref{sec mellin transform}. \end{remark} \begin{theorem} \label{phi formula dec} The map in question is given on trees by \begin{equation} \label{eq phi formula dec} \phi(t) = \sum_{\tau \in \mathrm{Tub}(t)} c(\tau) \sum_{i=1}^{b(\tau)} c_{b(\tau) - i, d(\operatorname{rt}(t))} \frac{L^i}{i!} \end{equation} where $c(\tau)$ is the Mellin monomial (\cref{def Mellin monomial}) and $d(\operatorname{rt}(t))$ is the decoration of the root of $t$. \end{theorem} For the moment, let $\psi$ denote the algebra map defined by the right side of \cref{eq phi formula dec}. Let $\sigma$ be the linear term of $\psi$. Explicitly we have \begin{equation} \label{eq sigma dec} \sigma(t) = [L^1]\psi(t)=\sum_{\tau \in \mathrm{Tub}(t)} c_{b(\tau) - 1, d(\operatorname{rt}(t))}c(\tau) \end{equation} and $\sigma$ vanishes on disconnected forests (including the empty forest) since $\psi$ is multiplicative by definition and has zero constant term on individual trees. By \cref{thm character exponential}, $\sigma$ is an infinitesimal character \cref{infinitesimal character}. \begin{lemma} For any tree $t$ and $k \ge 1$, \[ \sigma^{*k}(t) = \sum_{\genfrac{}{}{0pt}{2}{\tau \in \mathrm{Tub}(t)} { b(\tau) \ge k }} c_{b(\tau) - k, d(\operatorname{rt}(t))}c(\tau). \] \end{lemma} Note that for $k > 1$, $\sigma^{*k}$ is \textit{not} an infinitesimal character and does not vanish on all disconnected forests, though it trivially must vanish on the empty forest. However it will be sufficient for our purposes to understand its value on trees. \begin{proof} By induction on $k$. Since the $b$-statistic (\cref{def b statistic}) of every tubing $\tau$ satisfies $b(\tau) \ge 1$, the base case is exactly \cref{eq sigma dec}. Then by \cref{eqn ck coproduct} we have \[ \sigma^{*k+1}(t) = (\sigma * \sigma^{*k})(t) = \sum_f \sigma(f) \sigma^{*k}(t \setminus f) \] as $f$ ranges over subforests. However, since $\sigma$ vanishes on disconnected forests only terms where $f$ is a tree contribute, and since $\sigma^{*k}$ vanishes on the empty forest we may further restrict to \textit{proper} subtrees $t'\subset t$. Thus, using the induction hypothesis we have \begin{align*} \sigma^{*k+1}(t) &= \sum_{t'} \sigma(t') \sigma^{*k}(t \setminus t') \\ &= \sum_{t'} \sum_{\tau' \in \mathrm{Tub}(t')} \sum_{\genfrac{}{}{0pt}{2}{\tau'' \in \mathrm{Tub}(t \setminus t') }{ b(\tau'') \ge k}} c_{b(\tau') - 1, d(\operatorname{rt}(t'))} c(\tau') c_{b(\tau'') - k, d(\operatorname{rt}(t))} c(\tau''). \end{align*} Now by the recursive construction of tubings (\cref{rem tau prime and tau double prime}), the pair $(\tau', \tau'')$ uniquely determines a tubing $\tau$ of $t$. In this tubing $\tau$, the root has one more tube than it has in $\tau''$, so \[ b(\tau) = b(\tau'') + 1. \] The Mellin monomials (\cref{def Mellin monomial}) satisfy \[ c(\tau) = c_{b(\tau') - 1, d(\operatorname{rt}(t'))} c(\tau') c(\tau'') \] as we get a factor for each non-root vertex of $t'$ and $t''$ as well as for the root of $t'$ which does not contribute to $c(\tau')$. Hence we can rewrite the above triple sum as \[ \sigma^{*k+1}(t) = \sum_{\genfrac{}{}{0pt}{2}{\tau \in \mathrm{Tub}(t) }{b(\tau) \ge k+1}} c_{b(\tau) - k - 1, d(\operatorname{rt}(t))} c(\tau) \] as wanted. \end{proof} \begin{lemma} \label{lem convolution exponential dec} $\psi = \exp_*(L\sigma)$. \end{lemma} By \cref{thm character exponential}, this is equivalent to $\psi$ being a Hopf algebra morphism. \begin{proof} Both sides are algebra morphisms, so we only need to show they agree on trees. We compute \begin{align*} \psi(t) &= \sum_{\tau \in \mathrm{Tub}(t)} c(\tau) \sum_{k=1}^{b(\tau)} c_{b(\tau)-k, d(\operatorname{rt}(t))} \frac{L^k}{k!} \\ &= \sum_{k \ge 1} \frac{L^k}{k!} \sum_{\genfrac{}{}{0pt}{2}{\tau \in \mathrm{Tub}(t) }{ b(\tau) \ge k}} c_{b(\tau) - k, d(\operatorname{rt}(t))} c(\tau) \\ &= \sum_{k \ge 1} \frac{L^k}{k!} \sigma^{*k}(t) \\ &= \exp_*(L\sigma)(t). \qedhere \end{align*} \end{proof} The following elementary fact about 1-cocycles will be useful to us. \begin{lemma} \label{lem cocycle convolution} Let $H$ be a bialgebra, $\Lambda$ be a 1-cocycle on $H$, and $a, b\colon H \to A$ for some commutative algebra $A$. Then \[ (a * b)\Lambda = b(1) a \Lambda + a * b\Lambda. \] \end{lemma} \begin{proof} A simple computation: \begin{align*} (a * b)\Lambda &= m_A (a \otimes b) \Delta_H \Lambda \\ &= m_A (a \otimes b) (\Lambda \otimes 1 + (\mathrm{id} \otimes \Lambda)\Delta_H) \\ &= m_A (a\Lambda \otimes b(1) + (a \otimes b\Lambda)\Delta_H) \\ &= b(1) a \Lambda + a * b\Lambda. \qedhere \end{align*} \end{proof} In particular, if $b(1) = 0$ (such as when $b$ is an infinitesimal character), \cref{lem cocycle convolution} simply becomes $(a * b)\Lambda = a * b\Lambda$. \begin{lemma} \label{lem sigma bplus dec} For each $d \in D$, \[ \sigma B_+^{(d)} = \sum_{i \ge 0} c_{i,d} \sigma^{*i}. \] \end{lemma} \begin{proof} For $i \ge 1$ and $d \in D$ define an infinitesimal character $\sigma_{i, d}$ by \[ \sigma_{i, d}(t) = \sum_{\genfrac{}{}{0pt}{2}{\tau \in \mathrm{Tub}(t) }{ b(\tau) = i}} c(\tau) \] when $t$ is a tree with root decorated by $d$ and otherwise zero. Clearly we then have \[ \sigma = \sum_{i \ge 1} \sum_{d \in D} c_{i-1, d} \sigma_{i, d}. \] By construction we have $\sigma_{i, d'} B_+^{(d)} = 0$ for $d \ne d'$. Thus the result follows if we can show that $\sigma_{i, d} B_+^{(d)} = \sigma^{*i-1}$. We do this by induction on $i$. For the base case, note that the only tubing $\tau$ satisfying $b(\tau) = 1$ is the unique tubing of the one-vertex tree, which also has $c(\tau) = 1$. Thus $\sigma_{1,d}$ sends the one-vertex tree with decoration $d$ to 1 and all other trees to 0, so $\sigma_{1,d} B_+^{(d)}$ sends the empty forest to 1 and all other forests to 0, i.e. $\sigma_{1,d}B_+^{(d)} = \varepsilon = \sigma^{*0}$. Now consider $\sigma_{i+1, d}$. This vanishes on one-vertex trees. For $t$ a tree with more than one vertex and root decorated by $d$ we have \begin{align*} \sigma_{i+1, d}(t) &= \sum_{\genfrac{}{}{0pt}{2}{\tau \in \mathrm{Tub}(t) }{ b(\tau) = i+1}} c(\tau) \\ &= \sum_{t'} \left(\sum_{\tau' \in \mathrm{Tub}(t')} c_{b(\tau') - 1} c(\tau')\right) \left(\sum_{\genfrac{}{}{0pt}{2}{\tau'' \in \mathrm{Tub}(t \setminus t') }{ b(\tau'') = i}} c(\tau'')\right) \\ &= \sum_{t'} \sigma(t') \sigma_{i, d}(t \setminus t') \\ &= (\sigma * \sigma_{i, d})(t). \end{align*} and thus while $\sigma_{i+1, d} \ne \sigma * \sigma_{i, d}$ the two do agree on the image of $B_+^{(d)}$. Thus \begin{align*} \sigma_{i+1, d} B_+^{(d)} &= (\sigma * \sigma_{i, d}) B_+^{(d)} \\ &= \sigma * \sigma_{i, d} B_+^{(d)} && \text{by \cref{lem cocycle convolution}} \\ &= \sigma * \sigma^{*i-1} && \text{by the induction hypothesis} \\ &= \sigma^{*i} \end{align*} as wanted. \end{proof} Finally we are ready to prove our formula. \begin{proof}[Proof of \cref{phi formula dec}] To show $\phi = \psi$, by uniqueness we need only show that $\psi$ satisfies the required formula $\psi B_+^{(d)} = \Lambda^{(d)} \psi$. Note that both of these have zero constant term, so it is sufficient to show that they agree after differentiating with respect to $L$. By \cref{rem polynomial cocycles}, we can rewrite $\Lambda^{(d)}$ in the integral form \[ \Lambda^{(d)} f(L) = \int_0^L \mathrm{d}u\, \sum_{n \ge 0} c_{i, d} \partial_u^i f(u) \] and thus \[ \partial_L \Lambda^{(d)} = \sum_{i \ge 0} c_{i, d} \partial_L^i. \] Now using our lemmas we can compute \begin{align*} \partial_L \psi B_+^{(d)} &= (\psi * \sigma) B_+^{(d)} && \text{by \cref{lem convolution exponential dec}} \\ &= \psi * \sigma B_+^{(d)} && \text{by \cref{lem cocycle convolution}} \\ &= \sum_{i \ge 0} c_{i, d} \psi * \sigma^{*i} && \text{by \cref{lem sigma bplus dec}} \\ &= \sum_{i \ge 0} c_{i, d} \partial_L^i \psi && \text{by \cref{lem convolution exponential dec}} \\ &= \partial_L \Lambda^{(d)} \psi. \end{align*} The result follows. \end{proof} We are now able to prove our main result for the single-equation case. \begin{proof}[Proof of \cref{thm main thm}] As suggested in \cref{rem dse with cocycles}, we apply $\phi$ to the series from \cref{thm multi primitive comb dse} that solves the combinatorial DSE. The result follows immediately. \end{proof} \subsection{Systems}\label{sec systems} \Cref{phi formula dec} can also be applied to \textit{systems} of Dyson--Schwinger equations \cite{foissy_classification_2010,kissler_systems_2019}. Let $A$ be a finite set which indexes the equations in our system. Our set of decorations will be $A \times \mathbb Z_{\ge 1}$. Given parameters $\mathbf s = (s_a)_{a \in A}$ we have the combinatorial system \begin{equation} \label{eq combinatorial system} \begin{aligned} T_a(x) &= 1 + \sum_{k \ge 1} x^k B_+^{(a, k)}\big(T_a(x)Q(x)^k \big) \\ Q(x) &= \prod_{a \in A} T_a(x)^{s_a} \end{aligned} \end{equation} in the algebra $\mathcal H(A \times \mathbb Z_{\ge 1})$. Our first goal will be to prove an analogue of \cref{thm multi primitive comb dse} for systems. For a vertex $v$ of an $(A \times \mathbb Z_{\ge 1})$-decorated tree $t$, write $\alpha(v)$ for the $A$ component of its decoration (which we will call the \textit{type}) and $w(v)$ for the $\mathbb Z_{\ge 1}$ (which we continue to call the \textit{weight}). Write $\od[a]v$ for the number of children of type $a$. Then define \begin{equation} \xi(v, \mathbf s) = (1 + s_{\alpha(v)} w(v))_{\od[\alpha(v)]{v}} \prod_{a \ne \alpha(v)} (s_a w(v))_{\od[a]{v}}. \end{equation} Note that in the case of a single equation (only one type) this simplifies to $\xi(v, s) = (1 + sw(v))_{\od v}$, the same factor contributed by the vertex to the solution given in \cref{thm multi primitive comb dse}. \begin{theorem} \label{thm cdse system sols} The solution to the combinatorial system \cref{eq combinatorial system} is given by \begin{equation} \label{eq cdse system formula} T_a(x) = 1 + \sum_{\alpha(\operatorname{rt}(t)) = a} \left(\prod_{v \in V(t)} \xi(v, \mathbf s) \right) \frac{t x^{w(t)}}{|\operatorname{Aut}(t)|}. \end{equation} \end{theorem} \begin{proof} For each $a \in A$ let $\mathcal T_a$ denote the set of $(A \times \mathbb Z_{\ge 1})$-decorated trees $t$ such that $\alpha(\operatorname{rt}(t)) = a$, and let $\mathcal F_a$ denote the set of forests such that all components lie in $\mathcal T_a$. For a forest $f$, write $\kappa(f)$ for the number of components and \[ \xi(f, \mathbf s) = \prod_{v \in V(f)} \xi(v, \mathbf s). \] Let $T_a(x)$ be given by \cref{eq cdse system formula} and let $T_a^+(x) = T_a(x) - 1$. In terms of the notation just defined we have \[ T_a^+(x) = \sum_{t \in \mathcal T_a} \xi(t, \mathbf s) \frac{t x^{w(t)}}{|\operatorname{Aut}(t)|}. \] Now a forest $f$ with $r$ components can be represented as a product $t_1 \cdots t_r$ of trees. These trees can be permuted arbitrarily, so the total number of distinct ways to represent it this way is $r!$ divided by the number of permutations that rearrange isomorphic trees. This quantity is equivalently the number of orbits of $\operatorname{Aut}(f)$ on the set of orderings of the components. By elementary group theory (or the compositional formula for exponential generating functions) we get \[ \frac{T_a^+(x)^r}{r!} = \sum_{\genfrac{}{}{0pt}{2}{f \in \mathcal F_a }{ ~ \kappa(f) = r}} \xi(f, \mathbf s) \frac{fx^{w(f)}}{|\operatorname{Aut}(f)|}. \] It follows that for any scalar $p$, \begin{align*} T_a(x)^p &= \sum_{r \ge 0} \binom{p}{r} T_a^+(x)^r \\ &= \sum_{r \ge 0} (p)_r \sum_{\genfrac{}{}{0pt}{2}{f \in \mathcal F_a }{ ~ \kappa(f) = r}} \xi(f, \mathbf s) \frac{fx^{w(f)}}{|\operatorname{Aut}(f)|} \\ &= \sum_{f \in \mathcal F_a} (p)_{\kappa(f)} \xi(f, \mathbf s) \frac{f x^{w(f)}}{|\operatorname{Aut}(f)|}. \end{align*} For a general $(A \times \mathbb Z_{\ge 1})$-decorated forest, write $\kappa_a(f)$ for the number of components that are in $\mathcal T_a$. Then for any exponents $(p_a)_{a \in A}$ we can take the product to get \[ \prod_{a \in A} T_a(x)^{p_a} = \sum_f \left(\prod_{a \in A} (p_a)_{\kappa_a(f)} \right) \xi(f, \mathbf s) \frac{f x^{w(f)}}{|\operatorname{Aut}(f)|}. \] Now any $t \in \mathcal T_a$ can be uniquely written as $t = B_+^{(a, k)}f$ for some forest $f$ and some $k \in \mathbb Z_{\ge 1}$. Moreover we have $w(t) = w(f) + k$, $\operatorname{Aut}(t) \cong \operatorname{Aut}(f)$, and for any type $a'$ we have $\od[a']{\operatorname{rt}(t)} = \kappa_a(f)$. Hence \[ \xi(t, \mathbf s) = (1 + s_ak)_{\kappa_a(f)} \left(\prod_{a' \ne a} (s_{a'}k)_{\kappa_{a'}(f)}\right) \xi(f, \mathbf s). \] Putting all of this together, \begin{align*} T_a(x) &= 1 + \sum_{t \in \mathcal T_a} \xi(t, \mathbf s) \frac{t x^{w(t)}}{|\operatorname{Aut}(t)|} \\ &= 1 + \sum_{k \ge 1} \sum_f (1 + s_ak)_{\kappa_a(f)} \left(\prod_{a' \ne a} (s_{a'}k)_{\kappa_{a'}(f)}\right) \xi(f, \mathbf s) \frac{(B_+^{(a, k)}f) x^{w(f) + k}}{|\operatorname{Aut}(f)|} \\ &= 1 + \sum_{k \ge 1} x^k B_+^{(a, k)} \left(T_a(x)^{1 + s_ak} \prod_{a' \ne a} T_{a'}(x)^{s_{a'}k}\right) \\ &= 1 + \sum_{k \ge 1} x^k B_+^{(a, k)}(T_a(x) Q(x)^k) \end{align*} and hence these series solve \cref{eq combinatorial system} as desired. \end{proof} The analytic system corresponding to \cref{eq combinatorial system} is \begin{equation} \label{eq analytic system} \begin{aligned} G_a(x, L) &= 1 + \sum_{k \ge 1} x^k G(x, \partial_\rho) Q(x, \partial_\rho)^k (e^{L\rho} - 1)F_{a,k}(\rho)\bigg|_{\rho = 0} \\ Q(x, L) &= \prod_{a \in A} G_a(x, L)^{s_a} \end{aligned} \end{equation} where \begin{equation} F_{a, k}(\rho) = \sum_{n \ge 0} c_{n,a,k}\rho^{n-1}. \end{equation} Applying \cref{phi formula dec} to the combinatorial solution from \cref{thm cdse system sols} immediately gives the following. \begin{theorem} The solution to the analytic system \cref{eq analytic system} is given by \begin{equation} G_a(x, L) = 1 + \sum_{\alpha(\operatorname{rt}(t)) = a} \left(\prod_{v \in V(t)} \xi(v, \mathbf s)\right) \left(\sum_{\tau \in \mathrm{Tub}(t)} c(\tau) \sum_{i=1}^{b(\tau)} c_{b(\tau) - i, a, w(\operatorname{rt}(t))} \frac{L^i}{i!} \right) \frac{x^{w(t)}}{|\operatorname{Aut}(t)|}. \end{equation} \end{theorem} \section{Chord diagrams}\label{sec chord} One of us with other coauthors has used expansions indexed by rooted connected chord diagrams to solve the Dyson--Schwinger equation \eqref{dse_differential_general} first in the case $k=1$ and $s=-2$ \cite{MYchord}, then in the case where $s$ is any negative integer and no restrictions on $k$ \cite{HYchord}. Physical and combinatorial properties and consequences of these expansions were further studied in \cite{CYchord, CYZchord, CYnnl}. These chord diagram expansions were nice in that they were the first way to give combinatorial solutions to the Dyson--Schwinger equation where each indexing combinatorial object contributed simple monomials similar to the Mellin monomials of \cref{def Mellin monomial} and a small polynomial in $L$. This combinatorial control on the solution to the Dyson--Schwinger equation was particularly suitable to studying the leading log, next to leading log, etc. contributions \cite{CYchord, CYnnl}. The chord diagram expansion also singled out certain parameters on rooted connected chord diagrams, the \emph{terminal chords}, see below, which had not had substantial study in the past\footnote{An equivalent concept has appeared in the combinatorics of associated Hermite polynomials \cite{drake09} and certain infinite limits of Gaussian $\beta$-ensembles \cite{bgcg22}.} but are interesting in their distribution \cite{CYchord}, and correspond to reasonable parameters on other combinatorial objects such as vertices in bridgeless combinatorial maps \cite{CYZchord}, and lead to interesting enumerative questions and results \cite{Nchord, Nthesis}. These expansions rejuvenated the pure combinatorial study of chord diagrams. However, the chord diagram expansion solutions to Dyson--Schwinger equations also had a significant downside: namely they were proved by grinding certain matching recurrences so they did not give direct insight into questions such as which chord diagrams are contributed by which Feynman graph, how to generalize to other values of $s$ or to systems or beyond, or why really it was chord diagrams that appeared. The tubing expansions of the present paper resolve these downsides while maintaining the upsides of combinatorially indexed solutions to Dyson--Schwinger equations with each object having a simple contribution to the sum, and being enumeratively interesting combinatorial objects. To see these benefits clearly, we will lay out the definitions for the chord diagram expansions, and prove that the tubing expansions and chord diagram expansions agree on their common domain. \subsection{Chord diagram set up} \label{sec chord diagram set up} \begin{definition}\label{rooted chord diagram}\label{root chord} A \emph{rooted chord diagram} of \emph{size} $n$ is a set of ordered pairs of the form $(a_i,b_i)$, called \emph{chords}, such that $\{a_1,b_1, a_2, b_2, \dots, a_n,b_n\} = \{1,2, \dots, 2n\}$ and $a_i < b_i$ for each $1 \leq i \leq n$. The chord with $a_1=1$ is the \emph{root chord}. \end{definition} If we consider the set $\{1,2, \dots, 2n\}$ up to cyclic permutation, then the equivalence classes are unrooted chord diagrams. In the graphical sense, an unrooted chord diagram is a 1-regular graph on a cyclically ordered vertex set. Here, chords are the edges of the graph. A rooted chord diagram is a 1-regular graph on a linearly ordered vertex set and the ordered pair $(a_i,b_i)$ is a chord where $a_i$ is its first vertex, or \emph{source}, and $b_i$ is its second vertex, or \emph{sink}. The root chord is the first chord. We will only consider rooted chord diagrams, so from now on, \emph{chord diagram} indicates rooted chord diagrams. \begin{definition}\label{decomposable}\label{indecomposable} A chord diagram is \emph{decomposable} if its vertices can be partitioned into two sets, $S,T$, such that $s < t$ for all $s \in S$ and $t \in T$, and that there are no chords $(a_i,b_i)$ with $a_i \in S$ and $b_i \in T$. A chord diagram is \emph{indecomposable} if it is not decomposable. \end{definition} Intuitively, a chord diagram is decomposable if it is a concatenation of smaller nonempty chord diagrams. \begin{definition}\label{non-crossing} We say a pair of chords $(a_i,b_i)$ and $(a_j,b_j)$ \emph{cross} if $a_i<a_j<b_i<b_j$ or $a_j<a_i<b_j<b_i$. A chord diagram is \emph{non-crossing} if it contains no pair of crossing chords. \end{definition} This definition has the suggested meaning in the graphical representation as arcs above the linearly ordered endpoints: two chords cross precisely when the arcs cross. \begin{definition}\label{intersection graph}\label{connected chord diagram} The \emph{intersection graph} of a chord diagram is a graph such that for each chord $c_i$ in a chord diagram, there is a vertex $v_i$ in the intersection graph. Two vertices $v_1$ and $v_2$ are adjacent if the chords $c_1$ and $c_2$ cross in the chord diagram. A chord diagram is \emph{connected} if its intersection graph is connected. \end{definition} \begin{figure}[htb] \centering \begin{tikzpicture} \node[vertex, gray, label = below:$a_1$](a1) at (0,0){}; \node[vertex, gray, label = below:$a_2$](a2) at ($(a1) + (.8,0)$){}; \node[vertex, gray,label = below:$a_3$](a3) at ($(a2) + (.8,0)$){}; \node[vertex, gray,label = below:$b_3$](a4) at ($(a3) + (.8,0)$){}; \node[vertex, gray,label = below:$b_1$](a5) at ($(a4) + (.8,0)$){}; \node[vertex, gray,label = below:$a_4$](a6) at ($(a5) + (.8,0)$){}; \node[vertex, gray,label = below:$a_5$](a7) at ($(a6) + (.8,0)$){}; \node[vertex, gray,label = below:$b_2$](a8) at ($(a7) + (.8,0)$){}; \node[vertex, gray,label = below:$b_4$](a9) at ($(a8) + (.8,0)$){}; \node[vertex, gray,label = below:$b_5$](a10) at ($(a9) + (.8,0)$){}; \draw[chord] (a1) to node[pos=.3,above]{$c_1$} (a5); \draw[chord] (a2) to node[pos=.5, above]{$c_2$} (a8); \draw[chord] (a3) to node[pos=.5, above]{$c_3$} (a4); \draw[chord] (a6) to node[pos=.6, above]{$c_4$} (a10); \draw[chord] (a7) to node[pos=.9, above]{$c_5$} (a9); \node[vertex, label = below:$v_1$] (v1) at (9,.5){}; \node[vertex, label = below:$v_2$] (v2) at (10.5,1){}; \node[vertex, label = below:$v_3$] (v3) at (10,0){}; \node[vertex, label = below:$v_4$] (v4) at (12,1){}; \node[vertex, label = below:$v_5$] (v5) at (12,0){}; \draw[edge] (v1) -- (v2) --(v4); \draw[edge] (v2) -- (v5); \end{tikzpicture} \caption{An indecomposable (\cref{indecomposable}), but still non-connected (\cref{connected chord diagram}), chord diagram, and its intersection graph (\cref{intersection graph}).} \label{figure chord example} \end{figure} Note that connectivity in chord diagrams is not defined in the graph theoretical sense on the chord diagram as a 1-regular graph, but rather on the intersection graph, or on the arcs of the chord diagram, see \cref{figure chord example}. \begin{example}\label{eg Yukawa chord} In the Yukawa graphs of \cref{eg yukawa 1}, the fermion line gives a linear order to the vertices, so labelling these vertices $\{1, \ldots, 2n\}$, and hence the meson lines themselves define a chord diagram according to \cref{rooted chord diagram}. Drawing the meson lines as arcs as in \cref{fig yukawa}, we obtain the usual linear graphical representation. Since these Yukawa graphs are formed by inserting the one loop bubble into itself, there is always a chord $(1,2n)$ and the chords are non-crossing. Consequently, a Yukawa graph is an indecomposable (\cref{indecomposable}) non-crossing (\cref{non-crossing}) chord diagram, and all indecomposable non-crossing chord diagrams correspond to Yukawa graphs of this type. \end{example} While the earlier definitions were standard, the next definitions are special to the needs of the chord diagram expansion solutions of Dyson--Schwinger equations. \begin{definition}\label{intersection order} For a connected chord diagram $C$, the {\em intersection order} on $C$ is defined recursively as follows: starting with 1, label the root chord with the next available label, then remove the root chord and label the resulting sequence of nested connected components recursively in the order of their first points. \end{definition} \begin{figure}[htb] \centering \begin{tikzpicture} \node (a1) at (0,0){}; \node (a2) at ($(a1) + (.8,0)$){}; \node (a3) at ($(a2) + (.8,0)$){}; \node (a4) at ($(a3) + (.8,0)$){}; \node (a5) at ($(a4) + (.8,0)$){}; \node (a6) at ($(a5) + (.8,0)$){}; \node (a7) at ($(a6) + (.8,0)$){}; \node (a8) at ($(a7) + (.8,0)$){}; \node (a9) at ($(a8) + (.8,0)$){}; \node (a10) at ($(a9) + (.8,0)$){}; \node (a11) at ($(a10) + (.8,0)$){}; \node (a12) at ($(a11) + (.8,0)$){}; \draw[chord] (a1) to node[pos=.3,above]{$1$} (a4); \draw[chord] (a2) to node[pos=.5, above]{$2$} (a8); \draw[chord] (a3) to node[pos=.5, above]{$6$} (a5); \draw[chord] (a6) to node[pos=.6, above]{$3$} (a11); \draw[chord] (a7) to node[pos=.9, above]{$5$} (a9); \draw[chord] (a10) to node[pos=.9, above]{$4$} (a12); \end{tikzpicture} \caption{A connected chord diagram, labelled with the intersection order (\cref{intersection order}).} \label{figure chord intersection order} \end{figure} \begin{definition}\label{terminal chord}\label{1-terminal} A chord $c = (a, b)$ in a chord diagram $C$ is {\em terminal} if there is no chord $c' = (a', b')$ such that $a < a' < b < b'$, that is, there is no chord $c'$ crossing $c$ on the right. A diagram $C$ is {\em 1-terminal} if it has exactly one terminal chord. \end{definition} The diagram in \cref{figure chord intersection order} has three terminal cords, labelled 4,5, and 6 in intersection order. Note that the intersection order does not agree with the left to right order by sources or by sinks. Observe that the chord with rightmost endpoint in each connected component of a chord diagram is necessarily terminal. In particular, 1-terminal chord diagrams are connected. Furthermore, we require the following key fact characterizing 1-terminality. \begin{lemma}[{\cite[Corollary 4.10]{Nchord}}] \label{1-terminal characterization} Let $C$ be a connected chord diagram. Then $C$ is 1-terminal if and only if $C - c_{1}$ is 1-terminal, where $c_{1}$ is the root chord. \end{lemma} Our goal is to establish a bijection between chord diagrams and tubings. Tubings are constructed recursively, so we will work with a corresponding recursive construction for chord diagrams. The constructions are aligned by via insertion places for each type of object. \begin{definition}\label{chord diagram insertion place} Let $C$ be a chord diagram of size $n$. Then the \emph{chord diagram insertion places (CDIPs) } for $C$ are $y_i=\{i,i+1\}$ for $i \in \{1,2, \dots, 2n-1\}$. We order the chord diagram insertion places by their index. \end{definition} The chord diagram insertion places can be visualized as the space between ends of chords in a chord diagram, see \cref{figure CDIP}. \begin{figure}[htb] \centering \begin{subfigure}[b]{.7\linewidth} \input{figure_CDIP.tikzpicture} \vspace{.8cm} \caption{} \label{figure CDIP} \end{subfigure} \begin{subfigure}[b]{.29 \linewidth} \input{figure_RTIP.tikzpicture} \caption{} \label{figure RTIP} \end{subfigure} \caption{ {\bfseries(a)} The chord diagram of \cref{figure chord intersection order} with CDIPs (\cref{chord diagram insertion place}) $y_i$ indicated. {\bfseries (b)} A rooted tree with RTIPs (\cref{rooted tree insertion place}) $x_i$ indicated. } \end{figure} \begin{definition}\label{rooted tree insertion place} Given a plane rooted tree $t$ a \emph{rooted tree insertion place (RTIP)} is a place where a new leaf could be added. That is, at each vertex there is an insertion place before any of the children of the vertex, between any two consecutive children, and after the last child, and all insertion places are of this form. We place an order on the RTIPs as follows. Let $r$ be the root of $t$ and let $t_1,t_2, \dots, t_k$ be the list of subtrees (whose roots are the children of $r$ in that order). Define the order on the insertion places, $x_i$, of $t$ in this order: \begin{itemize} \item the insertion place before $t_1$. \item all insertion places of $t_1$ in this same order, applied recursively on $t_1$. \item the insertion place between $t_1$ and $t_2$. \item all insertion places of $t_2$ in this same order recursively on $t_2$. $\vdots$ \item the insertion place after $t_k$ \end{itemize} \end{definition} To think of this intuitively, this order on insertion places can be visualized by drawing the tree and traversing around it counter clockwise starting to the left of the root, see \cref{figure RTIP}. \subsection{Bijection between tubings and chord diagrams}\label{sec bijection tubings chord diagrams} The next order of business is defining a bijection between tubings and connected chord diagrams. This will be the bijection that gives us the connection between tubing expansions of Dyson--Schwinger equations and chord diagram expansions of Dyson--Schwinger equations. Some of the special classes of tubings defined previously will correspond to interesting classes of chord diagrams under this bijection. We first introduce a map from RTIPs (\cref{rooted tree insertion place}) to CDIPs (\cref{chord diagram insertion place}). \begin{definition}\label{map RTIP to CDIP} Given a plane rooted tree $t$ with $n$ vertices and a chord diagram $C$ with $n$ chords, let $x_i$ be the $i$th RTIP of $t$ and let $y_i$ be the $i$th CDIP of $C$ under the orders given in \cref{rooted tree insertion place} and \cref{chord diagram insertion place}. Then define the map $f$ via $f(x_i) = y_i$. \end{definition} \begin{lemma}\label{bijection RTIP to CDIP} The number of RTIPs on a plane rooted tree $t$ with $n$ vertices is the same as the number of CDIPs on a chord diagram $C$ with $n$ chords and so $f$ is a bijection between the RTIPs of $t$ and the CDIPs of $C$. \end{lemma} \begin{proof} Let $P_n$ be the number of RTIPs on a plane rooted tree with $n$ vertices. Let $Q_n$ be the number of CDIPs on a chord diagram with $n$ chords. We first claim that $P_n=2n-1$ by induction. Base case $n=1$. There is only one insertion place on a single vertex. So $P_1=1$. Now, suppose for a plane rooted tree with $n$ vertices that $P_n=2n-1$. Suppose a new vertex, $v_j$, is added at an insertion place, $x$, on an existing vertex $v_i$. Note that every plane rooted tree on $n+1$ vertices can be constructed by adding a new vertex in this way to a plane rooted tree on $n$ vertices. Then the new vertex $v_j$ has one insertion place; $v_i$ loses the $x$ insertion place (replaced by the edge $v_0v_1$) and thereby gains two new insertion places on either side of the edge $v_0v_1$. Therefore, $P_{n+1} = P_n -1+2+1=P_n+2$ for $n \geq 1$. Thus $P_{n+1}=2n-1+2=2(n+1)-1$. We next claim that $Q_n=2n-1$. This follows directly from the definition of chord diagram insertion places. There are exactly $2n-1$ pairs $\{i,i+1\}$ for $i \in \{1,2, \dots , 2n-1\}$. Thus, $P_n=Q_n$ and hence $f$ is a bijection. \end{proof} Now we are ready to define the main bijection. \begin{definition}\label{map tubed RTs to connected CDs} Let $\tau$ be a tubing of a plane rooted tree $t$ with $n$ vertices. Then, define the chord diagram $\theta(\tau)$ as follows. Base case: if $t=\bullet$ then $\tau$ is the unique tubing of $\bullet$ and $\theta(\tau)$ is the unique chord diagram with one chord. Recursive step: Let $t''$, $t'$, $\tau''$, and $\tau'$ be as in \cref{rem tau prime and tau double prime}. Let $C''$ and $C'$ be $\theta(\tau'')$ and $\theta(\tau')$ respectively. Let $x$ be the insertion place where $t'$ is inserted into $t''$. Let $y$ be the CDIP given by $f(x)$ (relative to $C''$). Then define $C= \theta(\tau)$ as follows: Insert $C'$ into $y$ such that the resulting chord diagram is a disconnected indecomposable chord diagram. Let $q'$ be the root chord of $C'$. Take the left end of $ q'$ and move it before all chords of $C''$. The resulting chord diagram is $C$. Graphically, the procedure is shown in \cref{figure bijection construction}. \end{definition} \begin{figure}[htb] \centering \input{figure_bijection_construction.tikzpicture} \caption{Step by step construction of the chord diagram corresponding to a tubing under $\theta$ (\cref{map tubed RTs to connected CDs}. Corresponding objects have the same color. {\bfseries (a)} a single vertex (with a tube which is not shown) corresponds to a single chord. {\bfseries (b)} A second vertex (purple) has been attached below the upper one. The new chord crosses the old one. {\bfseries (c)} The tube of b) is attached below a single vertex. The resulting chord diagram has five insertion places (\cref{chord diagram insertion place}), indicated by small numbers. {\bfseries (d)} another copy of b) is attached at position 4 to the tree c). } \label{figure bijection construction} \end{figure} \begin{remark} The description provided in \cref{map tubed RTs to connected CDs} is a more intuitive way to describe the map $\theta$. The following is a more formal definition of the recursive step of the map. With $t'', t', \tau'', \tau', C''$, and $C'$ as above, define $C=\theta(\tau)$ as follows: Let $\{1, \dots, 2n\}$ be the vertices of $C''$ with CDIP $y=\{i,i+1\}$. Similarly let $\{1, \dots, 2m\}$ be the vertices of $C'$ with root chord $(1,k)$. The vertices of $C$ are $\{1, \dots, (2n+2m)\}$. The chords of $C$ are defined from the chords of $C''$ and $C'$ as follows: \begin{enumerate}[label=(\roman*)] \item For each chord $\{a_j,b_j\}$ from $C'$: \begin{itemize} \item the root chord $\{1,k\}$ becomes $\{1,k+i\}$ \item all other chords $\{a_j,b_j\}$ become $\{a_j+i,b_j+i\}$. \end{itemize} \item For each chord $\{a_j,b_j\}$ from $C''$: \begin{itemize} \item if $a_j \leq i$ and $b_j \leq i$, then $\{a_j,b_j\}$ becomes $\{a_j+1,b_j+1\}$ \item if $a_j \leq i$ and $b_j > i$, then $\{a_j,b_j\}$ becomes $\{a_j+1,b_j+2m\}$ \item if $a_j > i$ and $b_j \leq i$, then $\{a_j,b_j\}$ becomes $\{a_j+2m,b_j+2m\}$ \end{itemize} (or to say it another way, if $a_j \text{ (or } b_j) \leq i$, then $a_j \text{ (or } b_j)$ becomes $a_j +1 \text{ (or } b_j +1)$, and if $a_j \text{ (or } b_j) > i$, then $a_j \text{ (or } b_j)$ becomes $a_j +2m \text{ (or } b_j + 2m)$). \end{enumerate} \end{remark} Write $\tau' \oplus_{x} \tau''$ for the tubing obtained by inserting $\tau'$ into $\tau''$ at insertion place $x$ and write $C' \oplus_{y} C''$ for chord diagram obtained by inserting $C'$ into $C''$ at insertion place $y$ in the above manner. \begin{theorem} \label{bijection tubed RTs to connected CDs} $\theta$ is a bijection from the set of tubed rooted plane trees with $n$ vertices to the set of rooted connected chord diagrams with $n$ chords, and its inverse map is called $\mu$. \end{theorem} \begin{proof} To prove this, we construct the inverse map, $\mu : C \mapsto \tau$. Let $C$ be a rooted connected chord diagram. If $C$ is just one chord, then define $\mu(C)$ to be the unique tubing of $\bullet$. Otherwise, the removal of the root chord results in either a connected chord diagram, or a disconnected, indecomposable chord diagram. In the former case, we let the root chord be $C'$ and the rest of the chord diagram be $C''$. In the latter case, we take the root chord together with all but the outer component and call it $C'$, and let the rest of the chord diagram, namely the outer component after removing the root, be $C''$. In both cases, both $C''$ and $C'$ are connected rooted chord diagrams. The last thing we need is the insertion place where $C'$ is inserted into $C''$ to give the chord diagram $C$. To specify this, let $Y$ be the smallest index greater than 1 of a vertex of $C$ that is an end of a chord in $C'$, then shifting indices to $C''$ we see that $C=C'\oplus_{Y-2, Y-1} C''$ and so $y=\{Y-2,Y-1\}$ is the insertion place in $C''$ we are looking for. Recursively let $\tau''=\mu(C'')$ and $\tau'=\mu(C')$ and $x=f^{-1}(y)$ as an RTIP of $t''$. Now define $t$ to be the insertion of $t'$ into $t''$ at $x$ and define $\tau$ to be the tubing of $t$ given by the tubes of $\tau''$ and $\tau'$ along with one tube containing all of $t$. Then $t$ and $\tau$ give $\mu(C)$. Directly from these definitions, we see that $\mu$ and $\theta$ are mutual inverses, and the number of vertices in $t$ is equal to the number of chords in $C$. \end{proof} \cref{figure bijection example corollas} shows the bijection $\theta$ for the tubings of a 4-vertex corolla tree, \cref{figure bijection example ladders} for the 4-vertex ladder tree, and \cref{figure bijection example} shows all other 4-vertex trees. \begin{figure}[htb] \centering \input{figure_bijection_example_corollas.tikzpicture} \caption{Chord diagrams corresponding to the tubings of the corolla tree $s_4$ of \cref{figure corollas} under the bijection $\theta$ (\cref{map tubed RTs to connected CDs}). } \label{figure bijection example corollas} \end{figure} The bijection $\theta$ behaves nicely on the special classes of tubings considered earlier in \cref{sec examples}, including ladders and leaf tubings, as we now demonstrate. We first require several additional notions picking out the associated classes of chord diagrams (see for example \cite{Nchord} for full formal definitions and further background on these notions). A {\em subdiagram} $D'$ of a chord diagram $D$ is a subset of its chords. We identify a subdiagram with the chord diagram obtained by standardizing its points to the interval $\{1, 2, \ldots, 2|D'|\}$. A chord diagram $D$ is {\em permutation} if all of its sinks lie to the right of all of its sources. Labelling the sinks of $D$ by the order of their attached sources gives a permutation that determines $D$. Permutation diagrams can also be characterized as those diagrams do not have $\{(1, 2), (3, 4)\}$ as a subdiagram. For a permutation $\sigma$, a permutation diagram $D$ is {\em $\sigma$-avoiding} if $D$ does not contain the permutation diagram determined by $\sigma$ as a subdiagram. Equivalently, if $\pi$ is the permutation determining a chord diagram $D$, then $D$ is $\sigma$-avoiding if $\pi$ does not contain $\sigma$ as a pattern. \begin{proposition}\label{prop interesting chord classes} The map $\theta$ restricts to \begin{enumerate} \item a bijection between tubed ladders and connected 213-avoiding permutation diagrams, and \item a bijection between leaf tubings and 1-terminal chord diagrams. \end{enumerate} \end{proposition} \begin{proof} Note that a diagram is 213-avoiding and permutation if and only if all of its subdiagrams are 213-avoiding and are permutation diagrams. Furthermore, for connected chord diagrams $C'$ and $C''$, observe that $C' \oplus_{x} C''$ is permutation if and only if $C'$ and $C''$ are permutation and $x = n$. Now suppose $C'$ and $C''$ are 213-avoiding permutation diagrams and write $\sigma'$ and $\sigma''$ for the permutations determining $C'$ and $C'$, respectively. Then the permutation $\sigma$ determining $C' \oplus_{n} C''$ can be written as $\pi'\pi''$, where $\pi''$ is obtained from $\sigma''$ by increasing every letter by 1 and $\pi'$ is obtained from $\sigma'$ by increasing every letter except 1 by $|C''|$. In particular, other than 1 every letter of $\pi'$ is larger than any letter of $\pi''$, so if 213 is a pattern of $\pi'\pi''$ then any instance of the pattern must lie in the first $|\pi'|$ letters, contradicting the assumption that $\pi'$ is 213-avoiding. It follows that $C' \oplus_{n} C''$ is 213-avoiding. Finally, note that the rooted tree insertion place for ladders is always $n$. Then combining all of the above facts and applying the construction of $\theta$, we conclude that $\tau$ is a tubed ladder if and only if $\theta(\tau)$ is a connected 213-avoiding permutation diagram, as desired for the first point. We now turn to the second point. By construction, a tubing $\tau$ is a leaf tubing if and only if $\theta(\tau)$ is constructed from the empty diagram by iteratively inserting root chords in such a way that the diagram is connected at each step. By Lemma~\ref{1-terminal characterization} this is equivalent to $\theta(\tau)$ being 1-terminal. \end{proof} \begin{figure}[htb] \centering \input{figure_bijection_example_ladders.tikzpicture} \caption{Chord diagrams corresponding to the tubings of the ladder tree $\ell_4$ of \cref{figure ladders} under the bijection $\theta$ (\cref{map tubed RTs to connected CDs}). Observe that these chord diagrams are different from the ones constructed in \cref{rem ladders chord diagrams}} \label{figure bijection example ladders} \end{figure} Connected 213-avoiding permutation diagrams are well known to be counted by the Catalan numbers, providing an alternative proof of \cref{lem ladders tubings}. Similarly, since 1-terminal chord diagrams have been shown to be counted by the double factorials $(2n-3)!! = 1\cdot 3\cdots (2n-5)(2n-3)$ (see \cite{CYchord, Nchord}), the above result implies that double factorials count leaf tubings (\cref{sec splitting off leaves}) as well. As we showed in \cref{lem chains tubings}, the number of tubings of corollas with $n$ vertices is given by $(n-1)!$. Following the above result it is natural to ask whether this class of tubings is also mapped to a nice class of chord diagrams under $\theta$. As immediately implied by the definition, the number of permutation diagrams with $n$ chords is given by $n!$. Additionally restricting to those permutation diagrams that are 1-terminal gives a natural class of chord diagrams counted by $(n-1)!$. Together with \cref{prop interesting chord classes} and the fact that all tubings of corollas are leaf tubings, this suggests that tubed corollas would most naturally correspond to 1-terminal permutation diagrams. But the map $\theta$ clearly does not restrict to a bijection between tubed corollas and 1-terminal permutation diagrams---e.g. see the fourth pair in the first column of \cref{figure bijection example}. We now briefly present an alternative bijection, other than $\theta$ (\cref{map tubed RTs to connected CDs}), between leaf tubings and 1-terminal chord diagrams that does restrict to the desired map on tubed corollas. The bijection is essentially described recursively in \cite{Nchord, Nthesis}, but here we give a non-recursive definition via \emph{decreasing trees}, ordered trees with a decreasing labelling. The map given in the proof of \cref{leaf_label_lemma} then completes the description. For a 1-terminal chord diagram $T$, let $c_{1}, \ldots, c_{n}$ be the chords of $T$ ordered by their sources. Furthermore, define the \emph{sink group} of a chord $c \in T$ to be the sequence of chords (in order of their sinks) attached to a sink in the maximal (possibly empty) interval of sinks immediately to the right of the source of $c$. Then define $\kappa(T)$ to be the tree with vertices labelled $1, \ldots, n$ such that the children of the vertex labelled $i$ are the vertices labelled $i_{1}, \ldots, i_{k}$, where $c_{i_{j}}$ is the $j$th chord in the sink group of $c_{i}$. It is straightforward to see that $\kappa$ is a bijection between 1-terminal chord diagrams with $n$ chords and decreasing trees with $n$ vertices. Furthermore, by 1-terminality and the fact that the terminal chord (the rightmost chord) of a 1-terminal permutation diagram is the only chord with a nonempty sink group it readily follows that $\kappa$ restricts to a bijection between 1-terminal permutation diagrams and decreasing corollas, as desired. Observe that this bijection distentangles the underlying tree of the tubing, identifying it with a simple feature of 1-terminal diagrams, sink groups, in a way that $\theta$ does not appear to. \subsection{The tubing expansion matches the chord diagram expansion}\label{sec tubing expansion matches} We have shown that the tubing expansion of \cref{thm main thm} is a solution of the Dyson--Schwinger equation \cref{dse_differential_general}, and that the map $\theta$ is a bijection between tubings and chord diagrams (\cref{bijection RTIP to CDIP}). However, this is not enough yet to conclude that the chord diagram expansion solutions of Dyson--Schwinger equations of \cite{MYchord, HYchord} are the result of applying $\theta$ to the tubing expansion of \cref{thm main thm} since they could be two different expansions indexed by the same objects; that is, two expansions could associate different terms of the formal power series expansion to the same chord diagram and so collect together terms of the formal power series solution differently. In order to show that the two expansions do line up it remains to check that the parameters used in the two expansions line up diagram-by-diagram. Showing this is the goal of the present section. \medskip The solutions to Dyson--Schwinger equations of \cite{MYchord, HYchord} are indexed by rooted connected chord diagrams with weighted chords. Specifically, a \emph{weighted rooted chord diagram} is a rooted chord diagram $C$ (\cref{rooted chord diagram}) along with a map $w$ from the chords of $C$ to the positive integers. For a chord $a$, $w(a)$ is called the weight of $a$. The weight of the chord diagram, written $\|C\|$ is the sum of the weights of the chords. We will also conflate chords and their indices in intersection order (\cref{intersection order}) and so write $w(i)$ for the weight of the $i$th chord in intersection order. Also for a chord diagram $C$ with terminal chords indexed by $t_1<t_2<\cdots < t_j$ and sequences $\{c_{m,n}\}$ define \[ c(C) = \prod_{i=2}^{j} c_{(t_i-t_{i-1}) , w(t_i)} \prod_{a \text{ not terminal}} c_{0, w(a)}. \] We need to define one more parameter of a chord before we can state the chord diagram expansion result and that is the definition of the branch-left or $\nu$ parameter. This definition requires an auxiliary binary tree, but fortunately, we do not need the leaf labelling of this binary tree, only its shape. These binary trees are the kind which is given by either a root alone or a root and two binary trees, called the left subtree and the right subtree. Note that in this case the subtrees may not be empty, so this is a type of full binary tree. Given two such binary trees $T_1$ and $T_2$ define the insertion operation $T_1 \circ_k T_2$ with $k$ at most the number of vertices of $T_2$ as follows (see Definition 3.8 of \cite{MYchord} and Definition 4.1 of \cite{HYchord}, and the example in \cref{figure branch left insertion}). \begin{itemize} \item Label the vertices of $T_2$ following a pre-order traversal of $T_2$. \item Put a new vertex in the middle of the edge leading from vertex $k$ of $T_2$ to the parent of that vertex making the subtree rooted at vertex $k$ the right subtree of this new vertex. If $k=1$ so the vertex is the root of $T_2$, then put a new vertex above the root of $T_2$ with $T_2$ as the right subtree. \item Place $T_1$ as the left subtree of the new vertex. \end{itemize} \begin{figure}[htbp] \centering \input{figure_branch_left_insertion.tikzpicture} \caption{Insertion operation $T_1 \circ_k T_2$ to build the auxiliary binary tree.} \label{figure branch left insertion} \end{figure} In a similar way to the construction of $\mu$ in \cref{bijection tubed RTs to connected CDs}, this decomposition allows us to recursively define a map from rooted connected chord diagrams to binary trees. Specifically, map the rooted connected chord diagram on one vertex to the binary tree on one vertex. Given a rooted connected chord diagram $C$ with more than one chord, decompose it into the outermost connected component after removing the root, $C_2$ and the rest of the diagram, $C_1$, and let $k$ be the insertion place in $C_2$ where $C_1$ less its root was inserted. Recursively apply this map to $C_1$ and $C_2$ to get $T_1$ and $T_2$ respectively and then define the result of this map on $C$ to be $T_1 \circ_k T_2$. See \cite{MYchord} Definition 3.9 or \cite{HYchord} Definition 4.3 for details. Note that this map is not a bijection. It can be made injective by labelling the leaves in a way that allows us to recreate the chord diagram, however then the map is not surjective onto all leaf labelled binary trees. A characterization of which leaf labelled binary trees occur is given in \cite{MYchord} Theorem 4.8 but it is quite unsatisfactory. Fortunately, for the present purposes we do not need the leaf labelling nor any form of bijectivity, but it is important to note that under the map to binary trees every chord of the chord diagram corresponds to a leaf of the binary tree and every leaf comes from a chord of the chord diagram. Now, given a rooted connected chord diagram $C$ and a chord $a$ of $C$, define $\nu(a)$ to be the number of edges in the path that begins at the vertex of the binary tree associated to $a$ and goes up and to the left so long as that is possible. The chord diagram expansion result is that when $s$ is a negative integer, the solution to the Dyson--Schwinger equation \cref{dse_differential_general} with $F_k(\rho) = \sum_{i\geq 0} c_{i,k}\rho^{i-1}$ can be written as (Theorem 7.4 of \cite{HYchord}) \begin{equation}\label{eq chord soln} G(x,L) = 1+\sum_{C} \left(\prod_{a \text{ chord of } C}(-1)^{\nu(a)}\binom{w(a)(-s)+\nu(a)-2}{\nu(a)}\right) c(C)x^{\|C\|}\sum_{k = 1}^{b(C)}\frac{(-L)^k}{k!}a_{w(t_1), t_1-k} \end{equation} where the sum is over weighted rooted connected chord diagrams with terminal chords indexed $t_1<t_2<\cdots t_j$ in intersection order. The signs in \eqref{eq chord soln} are due to different conventions between the present paper and \cite{HYchord}. Using the negative binomial identity, we can rewrite the factor in parentheses as \[ \prod_{a \text{ chord of } C}\binom{1+w(a)s}{\nu(a)}. \] \medskip Our claim now is that this expansion agrees with the tubing expansion (\cref{thm main thm}) under the action of $\theta$ (\cref{map tubed RTs to connected CDs}). We will need quite a few preliminary lemmas towards the proof of this claim. \begin{lemma}\label{lem root first term} Let $\tau$ be a tubing of a rooted plane tree $t$ and let $C= \theta(\tau)$ be the associated chord diagram under the bijection $\theta$ of \cref{map tubed RTs to connected CDs}. Then the first terminal chord of $C$ corresponds to the root vertex of $t$. \end{lemma} Note that $\theta$ induces a bijection between the vertices of $t$ and the chords of $C$. \begin{proof} By Proposition 22 of \cite{CYchord} the first terminal chord is the chord with the rightmost endpoint. The proof of the lemma is inductive. When $t$ has only one vertex then $C$ has only one chord. That one chord is terminal and corresponds to the root of $t$. Suppose $t$ has two or more vertices. Then $\tau$ has two tubes immediately inside the outermost tube and these two tubes partition the vertices of $t$ into two trees. Let $t'$ and $t''$ be these two trees with $t''$ containing the root of $t$ and let $\tau'$ and $\tau''$ be the induced tubings on $t'$ and $t''$ respectively as discussed in \cref{rem tau prime and tau double prime}. Inductively, the first terminal chord of $\theta(\tau'')$ corresponds to the root of $t''$. In inserting $\theta(\tau')$ into $\theta(\tau'')$ so as to form $\theta(\tau)$, the chords of $\theta(\tau')$ have all their endpoints either strictly inside $\theta(\tau'')$ or to the left of $\theta(\tau'')$. In particular the chord with the rightmost endpoint of $\theta(\tau)$ comes from the chord with the rightmost endpoint of $\theta(\tau'')$, hence corresponds to the root of $t''$, and thus to the root of $t$. \end{proof} \begin{lemma} With $\tau, t, C$ as in \cref{lem root first term}, the set of terminal chords of $C$ corresponds to the set containing the root of $t$ along with all vertices of $t$ that are the root of at least one tube containing two or more vertices. \end{lemma} Note that the root of $t$ is always the root of the outermost tube of $\tau$, so the only case where it needs to be separately included as in the statement of the lemma is the case where $t$ has exactly one vertex. The chord of the one chord diagram is terminal and so the vertex of unique tubing of the one vertex tree must also be terminal. The one chord diagram is the only rooted connected chord diagram whose root chord is terminal. \begin{proof} The proof of the lemma is again inductive. When $t$ has only one vertex then $C$ has only one chord. That one chord is terminal and is included among the set of vertices described in the statement. Suppose $t$ has 2 or more vertices. Let $t'$, $t''$, $\tau'$, $\tau''$ be as in the proof of the previous lemma and \cref{rem tau prime and tau double prime}. The only new crossings created by the insertion of $\theta(\tau')$ into $\theta(\tau'')$ in order to build $\theta(\tau)$ are those between the root of $\theta(\tau')$ (which becomes the root of $\theta(\tau)$ and one or more chords of $\theta(\tau'')$. Since the root chord is the first chord, these new crossings can not cause any chords of $\theta(\tau'')$ to stop being terminal. The new crossings stop the root of $\theta(\tau')$ from being terminal, if it was before, which only happens when $t'$ is the one vertex tree. The insertion of $\theta(\tau')$ into $\theta(\tau'')$ in order to build $\theta(\tau)$ does not remove any crossings, so it does not cause any previously non-terminal chords to become terminal. Now consider the insertion of $t'$ into $t''$ in order to build $t$. Any vertex that is in a tube of size $2$ or more in $\tau'$ or $\tau''$ remains so in $\tau$ since the tubes of $\tau$ are exactly the tubes of $\tau''$, the tubes of $\tau'$ and the outermost tube. If $t'$ had only one vertex, then that vertex is in it's own tube and in the outermost tube in $\tau$, so it is not the root of a tube containing 2 or more vertices in $\tau$. This exactly mirrors the situation with the terminal chords, so using the statement inductively on $\tau''$ and $\tau'$ we get that the vertices of $t$ corresponding to terminal chords are exactly those which are roots of tubes containing 2 or more vertices. \end{proof} \Cref{figure bijection example} shows a larger number of 4-vertex tubings with emphasis on the terminal chords as given by \cref{lem root first term}. \begin{figure}[htb] \centering \input{figure_bijection_example.tikzpicture} \caption{The bijection between tubings and chord diagrams for all tubings on 4 vertices except for ladders and corollas. Terminal chords / vertices are drawn in red, they satisfy \cref{lem root first term}. } \label{figure bijection example} \end{figure} \begin{lemma}\label{lem root b} With $\tau, t, C$ as in \cref{lem root first term}, let $t_1$ be the index of the first terminal chord of $C$ in the intersection order (\cref{intersection order}), then the $b$ statistic (\cref{def b statistic}) is $b(\tau) = t_1$ \end{lemma} \begin{proof} When $t$ has only one vertex then $C$ has only one chord. That one chord is terminal and has index $1$. The root vertex is in exactly one tube so $b(\tau) = t_1$. Suppose $t$ has 2 or more vertices. Let $t'$, $t''$, $\tau'$, $\tau''$ be as in the proof of the previous lemma and \cref{rem tau prime and tau double prime}. The index of the first terminal chord in $\theta(\tau'')$ is one less than the index of the first terminal chord in $\theta(\tau)$ since in the intersection order for $\theta(\tau)$, the root comes first, then all the chords of $\theta(\tau'')$, then other chords of $\theta(\tau')$. Similarly, $b(\tau'') -1 = b(\tau)$ since the outermost tube contains the root in $\tau$ and otherwise the tubes containing the root are the same as in $\tau''$. The result follows by induction. \end{proof} \begin{lemma} With $\tau, t, C$ as in \cref{lem root first term}, let $t_1 < t_2 < \cdots < t_k$ be the indices of the terminal chords of $C$ in the intersection order, and let $v_1, v_2, \ldots, v_k$ be the vertices corresponding to the terminal chords with $v_i$ corresponding to the terminal chord with index $t_i$. Then $b(v_i, \tau)-1 = t_i-t_{i-1}$ for $1 < i \leq k$. \end{lemma} Note that for the use we are making of the terminal chords, \eqref{eq chord soln}, the indices $t_i$ do not matter, only $t_1$ and the $t_i-t_{i-1}$ matter. Conveniently, these values are easy to read off the tubing, while the indices themselves are messier to see at the level of the tubing. \begin{proof} Proceed one final time in the same way. When $t$ has only one vertex then $C$ has only one chord. Then $k=1$ so there is nothing to prove. Suppose $t$ has 2 or more vertices. Let $t'$, $t''$, $\tau'$, $\tau''$ be as in the proof of the previous lemma and the discussion after Lemma~\ref{lem recursive tubing}. Recall that the intersection order on $\theta(\tau)$ is, first the root (which comes from the root of $\theta(\tau')$, then all the chords of $\theta(\tau'')$ in intersection order, then the remaining chords of $\theta(\tau')$ in intersection order. These facts together tell us that the differences $t_i-t_{i-1}$ are all the differences of indices of terminal chords from $\theta(\tau'')$ and from $\theta(\tau')$ along with the difference between the index of the chord of $\theta(\tau)$ which comes from the first terminal chord of $\theta(\tau')$ and the index of the chord of $\theta(\tau)$ which comes from the last terminal chord of $\theta(\tau'')$. Let $t_j$ and $t_{j-1}$ be respectively the indices of these two chords in $\theta(\tau)$. Note that the last chord of a diagram is always terminal, so along with the structure of the intersection order, we obtain $t_{j-1} = |\theta(\tau'')| + 1$ and, using Lemma~\ref{lem root b} $t_j = |\theta(\tau'')| + b(\tau')$. Therefore $t_{j} - t_{j-1} = b(\tau')-1$. Now returning to the tubings, $v_1$ is the root of $t$ by Lemma\ref{lem root first term}, so for $1<i\leq k$, $v_i$ is not the root of $t$ and so $b(v_i, \tau^\ell) = b(v_i, \tau)$ where $\ell$ is ${}'$ or ${}''$ according to whether $v_i$ is in $t'$ or $t''$. Therefore, inductively $b(v_i,\tau)-1 = t_i-t_{i-1}$ for $i\neq j$, $1<i\leq k$, and $b(v_j, \tau) - 1 = b(v_j, \tau') -1 = b(\tau')-1 = t_{j}-t_{j-1}$ using the explicit calculation above and thus completing the induction. \end{proof} \begin{lemma} Let $C$ be a rooted connected chord diagram, let $t$ be the underlying tree of the tubing $\mu(C)$, and let $T$ be the binary tree obtained from $C$ as discussed at the beginning of this subsection. Then, $t$ can be obtained from $T$ by contracting all paths in $T$ that start at a leaf and move up and to the left as long as that is possible. In particular, if $a$ is a chord of $C$ and corresponds to $v\in V(t)$ then $\nu(a) = \od{v}$. Furthermore, if $C$ is decorated or weighted and the decorations or weights are assigned to the leaves of $T$ and the vertices of $t$ correspondingly, then contracting the up left paths as described above and associating the weight of the unique leaf in the path to the resulting vertex, the weights obtained for $t$ through $T$ agree with the weights for $t$ obtained directly from $C$ via $\mu$. \end{lemma} \begin{proof} The key is to show that vertices of $T$ correspond to the insertion places of $t$ after the up left paths are contracted. To that end suppose for the moment that $T$ is any binary rooted tree and $t$ the result of contracting the up left paths of $T$. When contracting the up left paths, each edge that went to a right child gets contracted and each edge that goes to a left child remains an edge in the new tree. Each up left path becomes a vertex with children attached by the edges which led to left children of vertices on the path. If the up left path has $k$ edges then there are exactly $k$ such left children and so the contracted vertex itself has $k$ children. This proves that the second statement of the lemma is implied by the first statement of the lemma. Note that these $k$ children inherit an order from their order along the up left path. Every up left path has exactly one leaf at its lower end. The leaves that are left children have no up left edge and fit into this picture by having up left paths of length $0$. Including the leaves that are left children in this way every leaf of $T$ corresponds to an up left path and every vertex of $T$ is in exactly one up left path, so the vertices of $t$ are in bijection with the leaves of $T$ and $t$ is a plane rooted tree. Insertion in $T$ acts by picking a vertex $v$ and then inserting above $v$ with $v$ as the new right child and the inserted tree as the new left child $v$. The edge from the new vertex to $v$ is then an edge that will be contracted in an up left path and so $v$ and the new vertex belong to the same up left path while the inserted tree will be a child of the vertex in $t$ resulting from the contraction of this up left path. This is the usual insertion into $t$. Specifically, if $v$ is at neither end of its up left path, then this is insertion into $t$ into the insertion place between the child of $v'$ given by $v$'s parent's left child and the child of $v'$ given by $v$'s left child, where $v'$ is the vertex in $t$ obtained by the contraction of the up left path containing $v$. If $v$ was a leaf, then $v$ has no left child so the insertion place in $t$ is the insertion place after every child of $v'$. If $v$'s parent was not in the up left path or $v$ was the root, then the insertion place in $t$ is the insertion place before every child of $v'$. Furthermore, the indexing of the insertion places in $T$ is according to a pre-order traversal. Contracting the up left paths, each vertex of the path becomes an insertion place of $t$ as described above, but the order these places are met in the traversal does not change, so the indexing of the insertion places agrees with the indexing of the insertion places in $t$ \cref{rooted tree insertion place}. Finally, now return to a rooted connected chord diagram $C$ with $T$ and $t$ obtained from it as in the statement of the lemma. The above discussion demonstrated that insertion in $T$ and insertion in $t$ correspond and that the indexing of the insertion places correspond upon contracting up left paths of $T$. Additionally, the one vertex $T$ contracts trivially to the one vertex $t$. Inductively, then, the constructions of $T$ and $t$ from $C$ correspond after contracting the up left paths of $T$ implying the first statement of the lemma. As observed earlier in the proof, the first statement of the lemma implies the second statement of the lemma. The identification between chords of $C$, leaves of $T$ and vertices of $t$ carries through the induction, proving the final statement of the lemma. \end{proof} \begin{remark} One of the arguably unsatisfactory things about \cite{MYchord} and \cite{HYchord} was the need to move to these binary trees in order to define the $\nu$ statistic and for other parts of the constructions. One question that was never able to be answered in the past was what set of leaf labelled binary trees is generated. The result above finally gives a kind of answer. The leaf labelling existed in order to make explicit the bijection between the leaves and the chords, and it was necessary to get an injective map from chord diagrams to some sort of binary rooted trees, as without the leaf labelling the map is highly non-injective. The results of the present paper give us a much more natural and elegant way to record enough extra information in a tree format, namely the tubings. By \cref{bijection tubed RTs to connected CDs}, $\theta$ is a bijection between rooted connected chord diagrams and tubed rooted trees, so we finally have a bijection with a combinatorially nice image that carries information like $\nu$. This is what we were looking for but failed to find in the original construction. \end{remark} \begin{theorem}\label{thm expansions agree} The chord diagram expansion solutions \cref{eq chord soln} to the Dyson--Schwinger equation \cref{dse_differential_general} when $s$ is a negative integer agree with the tubing solutions of \cref{thm main thm} after applying the bijection $\theta$ (\cref{map tubed RTs to connected CDs}). \end{theorem} \begin{proof} Combining the previous lemmas we see that the expansions line up term for term. \end{proof} \begin{remark}\label{rem graph by graph} As mentioned at the beginning of \cref{sec chord}, the other main deficiency of the original chord diagram expansions is that despite starting with a Feynman graph expansion, which is combinatorially indexed, albeit with an intricate contribution from each graph, and moving to the combinatorially indexed chord diagram expansion, it was not clear which chord diagrams corresponded to the contribution of a given Feynman graph, or even if each Feynman graph's contribution could be written as a sum of individual chord diagram contributions. The nature of the original proof made this potential connection entirely opaque. The original impetus for what became the work of this paper was the desire to answer the question of which chord diagrams give the contribution of a given Feynman graph. Now we have done this, as we explain below. For concreteness, let us start with the Yukawa example (\cref{eg Yukawa chord,eg yukawa 1}). In that case from \cref{eg yukawa insertion trees} and \cref{bijection tubed RTs to connected CDs} we see that tubings of the insertion trees of Yukawa graph are in bijection with rooted connected chord diagrams. \Cref{thm expansions agree} and its proof tell us that the chord diagram and tubing expansions of the solution to the Dyson--Schwinger equation line up term by term under $\theta$ so we have a precise identification of the chord diagrams corresponding to the Yukawa graph by tubing the insertion tree of the Yukawa graph and applying $\theta$. Finally, the contribution of the Yukawa graph to the Feynman graph expansion of the Dyson--Schwinger equation agrees with the contribution of these tubings to the tubing expansion, because from \cite{broadhurst_combinatoric_2000} we know that the contribution of the Yukawa graph can be obtained through iterated linearized coproduct via the infinitesimal character $\sigma$ and its convolution powers $\sigma^{*k}$. In terms of renormalization group theory, this is \cref{gammak_rge}: The full Green function can be recovered from the anomalous dimension $\gamma(x)$, and the latter is the linear coefficient in $L$ of the involved Feynman graphs. In fact this last argument regarding the convolution powers of $\sigma$ giving the Feynman rules is the argument given more mathematically in \cref{sec tubing feynman rules} and hence holds generally, not just for the Yukawa example. That is, the Hopf algebraic structure of renormalization tells us that any Feynman graph will contribute to the Green function via linearized coproduct and $\sigma^{*k}$ in precisely the manner which we capture by the tubings of its insertion trees and the proof of this is the argument of \cref{sec tubing feynman rules} and applies to all the Dyson--Schwinger equations of the types we study here. Effectively, the tubings are nothing but a graphical representation of the iterated linearized coproduct applied to the relevant Feynman graphs, represented by their insertion trees. From there we can apply $\theta$ to get the contribution in terms of chord diagrams. Thus we can finally answer the question of which chord diagrams correspond to the contribution to the Green function of a given Feynman graph, namely, tube the insertion tree of the Feynman graph in all possible ways and then apply $\theta$. \end{remark} \section{Tubings and associahedra}\label{sec associahedra} In the literature, a slightly different notion of tubings exists \cite{carr_coxeter_2006}. Those tubings are defined not only for trees, but for arbitrary finite graphs; they are described algebraically in \cite{forcey_algebraic_2019}, and an extension to colored tubings has been defined in \cite{devadoss_colorful_2020}. Those tubings furnish the vertices of \emph{graph associahedra} \footnote{We use the term \emph{associahedra} only for the classical case, based in this context on ladder graphs $\ell_n$, while the analogous objects based on more general graphs are called \emph{graph associahedra}.} \cite{stasheff_homotopy_1963,carr_coxeter_2006} (see \cref{figure assoiciahedron 1}) therefore we call them \emph{A-tubings} in order to distinguish them from our own notion of binary tubings (\cref{def tubing}). \begin{figure}[htb] \centering \begin{subfigure}[b]{.6\linewidth} \centering \input{figure_associahedron_1.tikzpicture} \vspace{.7cm} \caption{} \label{figure assoiciahedron 1} \end{subfigure} \begin{subfigure}[b]{.35\linewidth} \centering \input{figure_associahedron_2.tikzpicture} \caption{} \label{figure assoiciahedron 2} \end{subfigure} \caption{\textbf{(a)} The 2-dimensional associahedron (grey pentagon). The vertices represent the five different A-tubings of $\ell_3$, each of which consists of two tubes. The edges of the associahedron correspond to A-tubings where one of the tubes is removed (not drawn) \textbf{(b)} The same associahedron, but decorated with the binary tubings of $\ell_4$, corresponding to the A-tubings of (a) via the map $L$ (\cref{def tubing L map}). As usual, we do not draw the innermost and outermost tubes. } \end{figure} \begin{definition}\label{def A-tubing} An \emph{A-tubing} is a set of tubes (\cref{def tube}) of a connected finite graph such that any two tubes are either nested, or their union is not a tube. A tube must not contain all of the vertices of the graph\footnote{In the literature, there are different conventions regarding the outermost tube of an A-tubing. Following \cite{carr_coxeter_2006,devadoss_colorful_2020}, we choose to leave it out, although its presence would only require a trivial modification to the map $L$ defined below.}. A \emph{maximal A-tubing} of a graph is an A-tubing where no more tubes can be added without violating the conditions of an A-tubing. \end{definition} In \cref{def A-tubing}, a maximal A-tubing excludes the outermost tube which contains all vertices of a graph, but this is a mere convention difference compared to the binary tubings. The pivotal difference to binary tubings is the last condition of \cref{def A-tubing}: In a binary tubing every tube of size $>1$ contains two smaller tubes whose union is the original tube. In contrast an A-tubing can never contain two tubes whose union is a tube, not even a tube which is not included in the tubing. For an A-tubing, we will draw \emph{all} tubes and not leave out the innermost and outermost ones, as we do for binary tubings. Recall that a binary tubing is always maximal in the sense that no more tubes can be added. We did not introduce a notion of a partial binary tubing which would correspond to a non-maximal A-tubing, though we could have. We will need the \emph{line graph} construction from graph theory. The line graph of a graph $G$ is the graph $L(G)$ whose vertices are the edges of $G$ and where two vertices are adjacent if they are incident to a common vertex in $G$. Note that edges incident to a $k$-valent vertex $v$ in $G$ become the vertices of a complete graph $K_k$ in $L(G)$ and so for an arbitrary simple graph $G$, the line graph $L(G)$ consists of complete graphs $K_n$ on $n \geq 1$ vertices, such that each vertex of the line graph is part of not more than two distinct complete graphs \cite{krausz_demonstration_1932}. In particular, the line graph $L(t)$ of a tree $t$ is not necessarily a tree itself, though the line graph of a ladder is a ladder. If a tree $t$ has $n$ vertices, then, by Eulers formula, $L(t)$ has $n-1$ vertices. \begin{definition}\label{def tubing L map} Let $\tau$ be a binary tubing of a tree $t$. Then let $L(\tau)$ be a tubing of the line graph $L(t)$, constructed by the following algorithm: \begin{enumerate} \item Leave out all those tubes of $\tau$ which contain only a single vertex. \item If $t$ is not a single vertex, leave out the tube of $\tau$ which contains all vertices of $t$. \item Every remaining tube of $\tau$ is a tube of the line graph $L(t)$, containing those vertices corresponding to the edges contained in the original tube. \end{enumerate} \end{definition} \begin{proposition}\label{prop L bijection} The map $L$ from \cref{def tubing L map} is a bijection between the binary tubings of a tree $t$ (\cref{def tubing}) and the maximal A-tubings (\cref{def A-tubing}) of the corresponding line graph $L(t)$. \end{proposition} \cref{prop L bijection} is a consequence of \cref{lem L A,lem L maximal,lem L inverse}. \cref{figure associahedra bijection} shows examples of $L(\tau)$. \begin{figure}[htb] \centering \input{figure_associahedra_bijection.tikzpicture} \caption{ Examples of the map $L$ from \cref{def tubing L map}. Observe that the line graphs have the complete graphs $K_2,K_3$ and $K_4$ as building blocks. } \label{figure associahedra bijection} \end{figure} \begin{lemma}\label{lem L A} If $\tau$ is a binary tubing of a tree $t$, then $L(\tau)$ from \cref{def tubing L map} is an A-tubing of the line graph $L(t)$. \end{lemma} \begin{proof} The containment structure of the tubes is preserved by $L$ so the tubes of $L(\tau)$ are either nested or disjoint. Next we want to show that there are no two tubes $a_1,a_2$ in $L(\tau)$ such that $a_1 \cup a_2$ is a tube in the line graph $L(t)$. Assume that $a_1\cup a_2$ were a tube, and that neither of $a_1$ or $a_2$ is contained in the other. This means that they are disjoint and adjacent, i.e. there is an edge $e$ joining the two vertices $v_1\in a_1$ and $v_2 \in a_2$. Those two vertices correspond to edges $e_1,e_2$ in $t$. Since the vertices $v_1,v_2$ are adjacent in $L(t)$, the two edges $e_1,e_2$ must both be adjacent to a vertex $v\in t$. By assumption $v_1\in a_1$, this means by \cref{def tubing L map} that both vertices adjacent to the edge $e_1\in t$ are contained in the tube $b_1$ in $t$ associated to $a_1$, therefore $v$ is also in this tube. But the same argument holds for the edge $e_2\in t$, therefore $v$ is also in the tube $b_2$ associated to $a_2$. By assumption, neither of the tubes $a_1,a_2$ is contained in the other in $L(t)$ and so the same holds for the associated tubes $b_1,b_2$ of $t$. Consequently they can not both contain the same vertex $v$ in a valid binary tubing. Hence, no two disjoint tubes of $L(\tau)$ can be adjacent, so $L(\tau)$ is a valid A-tubing. \end{proof} \begin{lemma}\label{lem L maximal} If $\tau$ is a binary tubing of a tree $t$, then the A-tubing $L(\tau)$ is maximal. \end{lemma} \begin{proof} Assume that it were possible to add a tube $a$ to $L(\tau)$ such that $a\cup L(\tau)$ is still a valid A-tubing. The tube $a$ encircles one or multiple vertices of $L(t)$, this corresponds to a tube $b \in t$ which encircles one or multiple edges, and the vertices $\lbrace v_1,\ldots, v_n\rbrace$ adjacent to them, see \cref{figure lem L maximal 1}. By assumption, $b$ is not a tube of the binary tubing $\tau$ of $t$. This implies that there is at least one tube $b'\in t$ which intersects non-trivially with $b$. Concretely, without loss of generality, $b'$ contains $v_1$, $b'$ does not contain $v_n\in b$, and $b'$ contains at least one vertex not contained in $b$. The situation is depicted in \cref{figure lem L maximal 2}. To see that such $b'$ exists, note that $b$ contains at least two vertices since it came from an edge. Now take a minimal tube of $\tau$ that contains $b$. This tube is not equal to $b$ since $b$ is not in $\tau$, and neither of the tubes partitioning this tube contain $b$ (by minimality) so each of them contain a proper subset of vertices of $b$ and at least one of them contains a vertex not in $b$. The so-constructed tube $b'$ in turn corresponds to a tube $a'=L(b')$ in the line graph $L(t)$. Since $b'$ contains at least one of the vertices which are also contained in $b$, the two tubes $a'$ and $a$ are adjacent or overlap (if $b'$ and $b$ share more than one vertex, $a'$ and $a$ overlap). But this is not allowed in the A-tubing $L(\tau)$. By assumption, $a'$ is present in $L(\tau)$, consequently $a$ can not be present. It is not possible to add any new tube to $L(\tau)$, therefore $L(\tau)$ is maximal. \end{proof} \begin{figure} \centering \begin{subfigure}[b]{.48\linewidth} \centering \input{figure_lem_L_maximal_1.tikzpicture} \caption{} \label{figure lem L maximal 1} \end{subfigure} \begin{subfigure}[b]{.48\linewidth} \centering \input{figure_lem_L_maximal_2.tikzpicture} \caption{} \label{figure lem L maximal 2} \end{subfigure} \caption{Proof of \cref{lem L maximal}. \textbf{(a)} The hypothetical tube $a$ to be added to the A-tubing of the line graph (right hand side), corresponding to a new tube $b$ in the tree $t$ (left hand side). \textbf{(b)} The tube $b'$, which is present in the binary tubing $\tau$ of $t$, and its corresponding tube $a'$, which is present in $L(\tau)$ and which prohibits the existence of $a$. } \label{figure lem L maximal} \end{figure} \begin{lemma}\label{lem L inverse} The inverse $L^{-1}$ of the map from \cref{def tubing L map} is given by the following algorithm: Let $L(t)$ be the line graph of a tree $t$ and $\alpha$ be a maximal A-tubing of $L(t)$. \begin{enumerate} \item For every tube $a\in \alpha$, draw a tube $b$ in $t$ which contains all edges, and their adjacent vertices, corresponding to the vertices contained in $a$. \item Add one tube around the whole tree $t$. \item If $t$ is not a single vertex, add one tube around every individual vertex in $t$. \end{enumerate} \end{lemma} \begin{proof} This algorithm clearly is the inverse of the algorithm in \cref{def tubing L map}, what needs to be shown is that $\tau=L^{-1}(\alpha)$ is a valid binary tubing of $t$ given that $\alpha$ is a maximal A-tubing of $L(t)$. The statement is correct for the tubing of $t=\rtLine 1$, so we assume that $t$ contains more than one vertex. To show that $\tau$ is a binary tubing according to \cref{def tubing}, we have to establish two points. Firstly, the tubes of $\tau$ are mutually nested or disjoint because the same is true for the tubes in $\alpha$, which are pairwise either nested or not adjacent, compare the proof of \cref{lem L maximal}. Secondly, each tube $b$ of $\tau$ is either a vertex or partitioned by exactly two other tubes contained in $\tau$. To see that this is the case, consider a tube $b\in \tau$ containing more than one vertex (such a tube $b$ exists because $\tau$ contains a tube containing all vertices of $t$). Now let $b'$ be a maximal tube contained in $b$, that is, there is no other tube contained in $b$ which contains $b'$. Such a tube $b'$ exists because every vertex is contained in its individual tube, so every tube of size bigger than one does contain another tube. If $\tau$ is a binary tubing then there is exactly one other maximal tube $b''$ contained in $b$, and $b'\cup b''$ is a partition of $b$. Assume that there were at least one tube $b$ in $\tau$ which does not contain a corresponding subtube $b'' = b-b'$. In that case, we can add $b''$ to $\tau$ and obtain a tubing $\tau' = \tau \cup b''$. Under the map $L$, this new subtube gives rise to a new tube $a'' = L(b'')$ which is a valid tube of the $A$-tubing of $L(t)$ by \cref{lem L A}. By assumption, $a''$ is not contained in $\alpha$, but this is a contradiction to $\alpha$ being maximal. Hence, every such tube $b''=b-b'$ must already be contained in $\tau$, and therefore $\tau$ is a binary tubing. \end{proof} \begin{example}\label{ex A tubings ladders} The ladders $\ell_n$ from \cref{sec ladders} provide a straightforward example of the map $L$ (\cref{def tubing L map}): The line graph of a ladder $\ell_n$ is the ladder $L(\ell_n) = \ell_{n-1}$. By \cref{lem ladders tubings}, the number of binary tubings of $\ell_n$ is $N(\ell_n)=C_{n-1}$. At the same time, it is known \cite{carr_coxeter_2006} that $\ell_{n-1}$ has $C_{n-1}$ different A-tubings. Indeed, by \cref{prop L bijection}, the binary tubings of $\ell_n$ correspond to the A-tubings of $\ell_n$. The A-tubings of $\ell_{n-1}$ furnish the vertices of the classical $(n-2)$-dimensional associahedron, shown in \cref{figure assoiciahedron 1} for the case $n=4$. Using the map $L$, the same associahedron can be decorated by binary tubings of $\ell_n$, shown in \cref{figure assoiciahedron 2}. \end{example} \begin{comment} \begin{lemma} \label{lem associahedra bijection} With notation and set up as above $L(\tau)$ is a maximal A-tubing of $\ell_{n-1}$ and the map $L$ from binary tubings of $\ell_n$ to maximal A-tubings of $\ell_{n-1}$ is bijective. \end{lemma} \begin{proof} The tubes of $L(\tau)$ are valid tubes by construction, so to show that $L(\tau)$ is an A-tubing we only need to check that they are pairwise compatible. The containment structure of the tubes is preserved by $L$ so the tubes of $L(\tau)$ are either nested or disjoint. Take two disjoint tubes $a_1$ and $a_2$ of $L(\tau)$ and suppose their union were a tube in $\ell_{n-1}$. Then their union would induce a connected subgraph of $\ell_{n-1}$ and by the structure of ladders, then $a_1$ and $a_2$ consist of consecutive runs of vertices in $\ell_{n-1}$. Interpreted back in $\ell_n$, then, $a_1$ and $a_2$ correspond to consecutive runs of edges, but then they must share a vertex where the two runs of edges meet, and must each contain at least one vertex that the other does not by taking the other ends of the edges which meet. This contradicts the fact that the tubes of $\tau$ are either nested or disjoint. Therefore, $L(\tau)$ is an A-tubing. It follows from \cref{remark ladders trees} that $\ell_n$ has $n$ vertices $\tau$ has $2n-1$ tubes, $n-1$ of which are not tubes of size $1$. Therefore $L(\tau)$ also has $n-1$ tubes and is an A-tubing of $\ell_{n-1}$. However, the maximal A-tubings of $\ell_{n-1}$ are one of the classical descriptions of the vertices of the $(n-2)$-dimensional associahedron and are known to be exactly the A-tubings with $n-1$ tubes implying that $L(\tau)$ must be maximal. $L$ is injective since the edges of an induced connected subgraph specify the vertices of the induced connected subgraph, so a tube in $L(\ell_n)$ uniquely determines the tube of size $>1$ in $\ell_n$ and all tubes of size $1$ are included in all binary tubings. Finally, to see $L$ is bijective, we can appeal to the fact that both sides are known to be Catalan, by \cref{ladders_tubings_lemma} on the left and the fact that graph associahedra of ladders are classical associahedra on the right. Alternately, the inverse to $L$ can be constructed directly using maximality to achieve the binary property. \end{proof} \end{comment} \begin{remark}\label{rem count A-tubings} The central outcome of the present paper is that binary tubings (\cref{def tubing}) represent a solution to a Dyson--Schwinger equation. In particular, for the Yukawa Mellin transform \cref{eg yukawa mellin transform}, the solution is, up to overall signs, the generating function of binary tubings of a certain class of rooted trees. Using the bijection $L$, the solution can equivalently be viewed as a sum of maximal $A$-tubings (\cref{def A-tubing}) of line graphs of certain trees. Knowing the solution of the Yukawa DSE implies knowing the generating function of the maximal $A$-tubings of line graphs in the corresponding cases. For the linear DSE (\cref{ex dse trees ladder}), the solution is given by the binary tubings of ladder trees, and we confirm that the Catalan numbers count the maximal $A$-tubings of ladders, see \cref{ex A tubings ladders}. Likewise, by \cref{lem chains tubings}, there are $n!$ binary tubings of a corolla tree on $(n+1)$ vertices. Using the bijection $L$, this means that there are $n!$ maximal $A$-tubings of a complete graph $K_n$. For the Yukawa DSE with $s=-2$, the Green function is the sum of binary tubings of all plane rooted trees (\cref{eg yukawa insertion trees}). The resulting function is known \cite{bkerfc}, and by the bijection $L$ it is the generating function of maximal A-tubings of all line graphs corresponding to plane rooted trees. These examples illustrate that it is possible to obtain information about A-tubings of line graphs by the bijection to binary tubings. We did not investigate this possibility further. \end{remark} \cref{figure associahedron large} shows the graph associahedron associated to a 5-vertex tree other than $\ell_5$. Note that one consequence of \cref{prop L bijection} is that binary tubings of trees always define the vertices of a polyhedron, and reversing the $L$ map we see the other faces always correspond to sets of tubes which are partial tubings in the sense that they are the result of removing tubes from binary tubings. \begin{figure}[htb] \centering \input{figure_associahedron_large.tikzpicture} \caption{Projection of a 3-dimensional graph associahedron (gray), decorated with the 18 different binary tubings of the underlying 5-vertex tree.} \label{figure associahedron large} \end{figure} \FloatBarrier \section{Conclusion}\label{sec conclusion} We discussed the relation between binary tubings, chord diagrams, and Dyson--Schwinger equations where graphs are inserted into only one edge. Concretely: \begin{enumerate} \item Our main result \cref{thm main thm} expresses the series coefficients of the solution $G(x,L)$ of the DSE in terms of binary tubings. In particular, the anomalous dimension can be computed as a weighted sum of tubings. \item The tubings represent a 1:1 map between individual Feynman graphs, or their insertion trees, and the summand in the Green function which correspond to this very graph. \item Our tubing expansions solve systems of Dyson--Schwinger equations, not just single equations. This had not been achieved with the earlier chord diagram expansions. \item Restricting to ladder trees, we reproduce the known solutions of linear DSEs (\cref{sec ladders}). \item Ladders and corollas represent extreme cases with respect to the number of tubings (\cref{tubings_bound}), they imply a bound for the coefficients of the anomalous dimension of the Yukawa model (\cref{ex yukawa bound}). \item The solution of the DSEs in question is known to be encoded by chord diagrams. Our proofs (\cref{sec tubing feynman rules}) are based entirely on tubed rooted trees, and do not refer to chord diagrams. \item We derive an explicit bijection between tubings and the corresponding chord diagrams (\cref{map tubed RTs to connected CDs}). Furthermore, we identify the counterparts of terminal chords, the branch-left parameter and the intersection order, in terms of tubed trees (\cref{sec tubing expansion matches}). \item We find that under this bijection, interesting classes of rooted trees correspond to interesting classes of chord diagrams (\cref{prop interesting chord classes}). \item A slightly different notion of tubings has existed in the literature, which we call A-tubings since they furnish the edges and vertices of graph associahedra. We show that our tubings are in bijection with maximal A-tubings of line graphs (\cref{prop L bijection}). \end{enumerate} From a physics perspective, the perhaps most striking point of our results is that they operate on objects which are well-known in Hopf algebra renormalization theory, namely the insertion trees associated to Feynman graphs, and the coproduct, which amounts to cutting these trees. As discussed in \cref{rem linearized coprod,rem graph by graph}, a tubing can be understood as one particular series of iterated coproducts applied to the tree, and each such series gives a contribution to the $L$-linear summand of the Green function, namely the anomalous dimension \cref{G_log_expansion}. The Connes--Kreimer Hopf algebra of rooted trees, which has proven valuable in the abstract understanding and classification of Dyson--Schwinger equations, now also serves as a combinatorial formalism for their solution. This way, one can avoid entirely the use of chord diagrams, which -- apart from looking graphically similar to the particular example of Yukawa Feynman graphs -- are alien to the Hopf algebraic theory of renormalization. Furthermore, the tubing formulation allowed us to easily generalize beyond Dyson--Schwinger equations which had been solved by chord diagrams to all real $s$ and to systems. From a combinatorial perspective, our results give a new notion of binary tubings of rooted trees, connect this notion to rooted chord diagrams, to previous notions of tubings which we called A-tubings, and to the Connes-Kreimer Hopf algebra. Furthermore, we considered interesting statistics on these objects such as the $b$-statistic, which are nice combinatorially, but would likely not have occured to anyone to study without the physics asking for them. The following questions are left for future work: \begin{enumerate} \item Consider the tubings of trees on $n$ vertices. In a certain sense, they are ``grouped'' on two levels: Firstly, one can count all those tubings into one set which arise from the same underlying rooted tree. Secondly, by \cref{lem recursive tubing count}, the number of tubings is independent of which vertex is the root, and thereby one could gather all those sets which arise from the same un-rooted tree upon choosing different roots. Is this structure represented in any way on the chord diagram side of the bijection? Similarly, when a chord diagram is drawn in circular form, we can call all those diagrams ``related'' which arise by choosing a different root chord. What does this operation do on the tubing side of the bijection? \item Can we obtain useful information on A-tubings by the bijection to binary tubings, as remarked in \cref{rem count A-tubings}? \item The bulk of \cref{sec bijection tubings chord diagrams} consisted of the construction of a recursively defined bijection $\theta$ from tubings to connected chord diagrams, but at the end of the section we noted the existence of an alternate bijection which has a non-recursive definition in the case of leaf tubings and is related to a map described more generally, albeit again recursively, in \cite{Nchord, Nthesis}. We speculate that it is possible to adapt the recursive map $\alpha$ on connected chord diagrams constructed in \cite{Nchord, Nthesis} into a natural non-recursive bijection between tubings and connected chord diagrams extending $\kappa$, but leave this for later work. \item Similar techniques to what are used here to solve Dyson--Schwinger equations by tubing expansions can be used to tackle multiple insertion places. This will be the subject of an upcoming paper of some of us. \end{enumerate} \printbibliography \end{document}
\section{Introduction} Inversions, insertions, deletions, duplications, substitutions and translocations are some of the operations that transform a DNA sequence from a primitive sequence (see \cite{Cantone2013,Cantone2010,Zhong2004,mahalingam2020}). A rearrangement of chromosomes can happen when a single sequence undergoes breakage and one or more segments of the chromosome are shifted by some form of dislocation (\cite{Zhong2004}). Mahalingam et al. (\cite{blore}) defined the block reversal of a word which is a rearrangement of strings when dislocations happen through inversions. The authors generalized the concept of the reversal of a word where in place of reversing individual letters, they decomposed the word into factors or blocks and considered the new word such that the blocks appear in the reverse order. The block reversal operation of a word $w$, denoted by $\mathtt{BR}(w)$, is represented in Figure \ref{f2}. \begin{figure}[h] \centering \tikzset{every picture/.style={line width=0.75pt}} \begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1] \draw (101,438.65) -- (423.79,438.65) ; \draw (102.51,485.23) -- (425.3,485.23) ; \draw (102.51,485.23) -- (128.36,485.23) -- (128.36,490.41) -- (102.51,490.41) -- cycle ; \draw (385.88,485.23) -- (425.3,485.23) -- (425.3,490.41) -- (385.88,490.41) -- cycle ; \draw (101,438.65) -- (140.42,438.65) -- (140.42,443.83) -- (101,443.83) -- cycle ; \draw (332.9,485.23) -- (385.88,485.23) -- (385.88,490.41) -- (332.9,490.41) -- cycle ; \draw (140.42,438.65) -- (193.4,438.65) -- (193.4,443.83) -- (140.42,443.83) -- cycle ; \draw (397.94,438.65) -- (423.79,438.65) -- (423.79,443.83) -- (397.94,443.83) -- cycle ; \draw (128.36,485.23) -- (173.05,485.23) -- (173.05,490.41) -- (128.36,490.41) -- cycle ; \draw (353.25,438.65) -- (397.94,438.65) -- (397.94,443.83) -- (353.25,443.83) -- cycle ; \draw (232.02,485.23) -- (263.9,485.23) -- (263.9,490.41) -- (232.02,490.41) -- cycle ; \draw (250.98,438.78) -- (282.86,438.78) -- (282.86,443.96) -- (250.98,443.96) -- cycle ; \draw (106.33,420.03) node [anchor=north west][inner sep=0.75pt] {$B_{1}$}; \draw (147.79,419.63) node [anchor=north west][inner sep=0.75pt] {$B_{2}$}; \draw (398.59,419.63) node [anchor=north west][inner sep=0.75pt] {$B_{k}$}; \draw (256.56,419.14) node [anchor=north west][inner sep=0.75pt] {$B_{i}$}; \draw (359.47,418.09) node [anchor=north west][inner sep=0.75pt] {$B_{k-1}$}; \draw (102.51,490.41) node [anchor=north west][inner sep=0.75pt] {$B_{k}$}; \draw (134.88,490.59) node [anchor=north west][inner sep=0.75pt] {$B_{k-1}$}; \draw (237.72,491.04) node [anchor=north west][inner sep=0.75pt] {$B_{i}$}; \draw (346.75,492.69) node [anchor=north west][inner sep=0.75pt] {$B_{2}$}; \draw (391.97,492.04) node [anchor=north west][inner sep=0.75pt] {$B_{1}$}; \draw (256.94,448.95) node [anchor=north west][inner sep=0.75pt] {$w$}; \draw (251.91,502.46) node [anchor=north west][inner sep=0.75pt] {$w'$}; \end{tikzpicture} \caption{For $w \in \Sigma^*$, $w'\in \mathtt{BR}(w)$} \label{f2} \end{figure} If the word $w$ can be expressed as a concatenation of its factors or blocks $B_i$ such that $w=B_1B_2\cdots B_k$, then $w'=B_kB_{k-1}\cdots B_1$ is an element of $\mathtt{BR}(w)$. Since there are multiple ways to divide a word into blocks, the block reversal of a word forms a set. Mahalingam et al. (\cite{blore}) proved that there is a strong connection between the block reversal and the non-overlapping inversion of a word. A non-overlapping inversion of a word is a set of inversions that do not overlap with each other. In 1992, Sch\"oniger et al. (\cite{Schon1992}) presented a heuristic for computing the edit distance when non-overlapping inversions are allowed. They presented an $\mathcal{O}$($n^ 6$) exact solution for the alignment with the non-overlapping inversion problem and showed the non-overlapping inversion operation ensures that all inversions occur in one mutation step. Instances of problems considering the non-overlapping inversions include the string alignment problem, the edit distance problem, the approximate matching problem, etc. (\cite{Cantone2010,Cantone20,Kece93,Augusto2006}). Kim et al. (\cite{Kim2015}) studied the non-overlapping inversion on strings from a formal language theoretic approach. A word is a palindrome if it is equal to its reverse. Let $|w|$ be the length of the word $w$. It was proved by Droubay et al. (\cite{epi}) that a word $w$ has at most $|w|$ non-empty distinct palindromic factors. The words that achieve the bound were referred to as rich words by Glen et al. (\cite{palrich}). Several properties of rich words were studied in the literature (see \cite{pal3,epi,palrich,guo}). Droubay et al. (\cite{epi}) proved that a word $w$ contains exactly $|w|$ non-empty distinct palindromic factors iff the longest palindromic suffix of any prefix $p$ of $w$ occurs exactly once in $p$. Guo et al. (\cite{guo}) provided necessary and sufficient conditions for richness in terms of the run-length encoding of binary words. It is known that on a binary alphabet, the set of rich words contain factors of the period-doubling words, factors of Sturmian words, factors of complementary symmetric Rote words, etc. (see \cite{palrot1, epi, schaclo}). In a non-binary alphabet, the set of rich words contain, for example factors of Arnoux–Rauzy words and factors of words coding symmetric interval exchange. There are many results in the literature regarding the occurrence of rich words in infinite and finite words, but there are significantly fewer results about the occurrence of rich words in a language. The occurrence of rich words in the conjugacy class of a word $w$, denoted by $C(w)$, is a well-studied concept in literature (see \cite{careymusic, palrich, restivobwt, oeis1}). Shallit et al. (\cite{oeis1}) calculated the number of binary words $w$ of a particular length such that every conjugate of $w$ is rich. A word $w$ is said to be circularly rich if all of the conjugates of $w$ (including itself) are rich, and $w$ is a product of two palindromes. Glen et al. (\cite{palrich}) studied circularly rich words and proved the equivalence conditions for circularly rich words. They proved that a word $w$ is circularly rich iff the infinite word $w^\omega$ is rich iff $ww$ is rich where $w^\omega$ is a word formed by concatenating infinite copies of $w$. Restivo et al. (\cite{restivobwt, bwtRESTIVO}) outlined relationships between circularly rich words and the Burrows–Wheeler transform, a highly efficient data compression algorithm. In many musical contexts, scale and rhythmic patterns are extended beyond a single iteration of the interval of periodicity. From the equivalent conditions for circularly rich words, proved by Glen et al. (\cite{palrich}), if $w$ is the step pattern of an octave-based scale and is rich, and if $ww$ is also rich, then the property can be extended without limit $(w^\omega)$. Lopez et al. (\cite{lopezmusic}) examined that circular palindromic richness is inherent in numerous musical contexts, including all well-formed and maximally even sets and also in non well-formed scales which display three different step sizes. Carey (\cite{careymusic}) also deeply studied circularly rich words from a music theory perspective. He proposed that perfectly balanced scales that display circular palindromic richness and also exhibit relatively few step differences may prove to be advantageous from a cognitive and musical perspective. Since block reversal operation is a generalization of conjugate operation, the study of rich words in the block reversal of the word has possible applications in music theory and data compression techniques. In this paper, we characterize words whose block reversal contains only rich words. We find a necessary and sufficient condition for a non-binary word such that all elements in its block reversal are rich. For a binary word $w'$, we prove that the richness of elements of $\mathtt{BR}(w')$ depends on $l(w')$ which is the length of the run sequence of $w'$. We show that for a binary word $w$, if all elements of $\mathtt{BR}(w)$ are rich, then $2\leq l(w) \leq 8$. We also find the structure of binary words whose block reversal consists of only rich words. The paper is organized as follows. In Section \ref{sec3}, we prove that for a non-binary word $w$, all elements of $\mathtt{BR}(w)$ are rich iff $w$ is either of the form $a_1a_2a_3 \cdots a_k$ or $a_j^{|w|}$ where each $a_i\in \Sigma$ is distinct. In Section \ref{sec4}, we show that for a binary word $w$, all elements of $\mathtt{BR}(w)$ are rich if $l(w) =2$. We also show that if all elements of $\mathtt{BR}(w)$ are rich, then $2\leq l(w) \leq 8$. We discuss the case when $3\leq l(w)\leq 8$ separately in detail and provide the structure of words such that all elements in their block reversal are rich. We end the paper with a few concluding remarks. \section{Basic definitions and notations}\label{sec2} Let $\Sigma$ be a non-empty set of letters. A word $w=[a_{i}]$ over $\Sigma$ is a finite sequence of letters from $\Sigma$ where $a_i$ is the $i$-$th$ letter of $w$. We denote the empty word by $\lambda$. By $\Sigma^*$, we denote the set of all words over $\Sigma$ and $\Sigma^+=\Sigma^*\setminus \{\lambda\}$. The length of a word $w$, denoted by $|w|$, is the number of letters in $w$. $\Sigma^n$ and $\Sigma^{\geq n}$ denote the set of all words of length $n$ and the set of all words of length greater than or equal to $n$, respectively. For $a \in \Sigma$, $|w|_a$ denotes the number of occurrences of $a$ in $w$. A word $u$ is a factor or block of the word $w$ if $w=puq$ for some $p, q\in \Sigma^*$. If $p= \lambda$, then $u$ is a prefix of $w$ and if $q = \lambda$, then $u$ is a suffix of $w$. Let $Fac(w)$ denote the set of all factors of the word $w$. $\ALPH(w)$ denotes the set of all letters in $w$. Two words $u$ and $v$ are called conjugates of each other if there exist $x,y\in \Sigma^*$ such that $u=xy$ and $v=yx$. For a word $w= w_1w_2\cdots w_n$ such that $w_i\in \Sigma$, the reversal of $w$, denoted by $w^R$, is the word $w_n\cdots w_2w_1$. A word $w$ is a palindrome if $w=w^R$. By $P(w)$, we denote the number of all non-empty palindromic factors of $w$. A word $w$ has at most $|w|$ distinct non-empty palindromic factors. The words that achieve the bound are called rich words. Every non-empty word $w$ over $\Sigma$ has a unique encoding of the form $w = a_1^{n_1}a_2^{n_2}\ldots a_k^{n_k},$ where $n_i \geq 1$, $a_i \neq a_{i+1}$ and $a_i\in \Sigma$ for all $i$. This encoding is called run-length encoding of $w$ (\cite{guo}). The word $a_1 a_2 \ldots a_k$ is called the trace of $w$. The sequence $(n_1, n_2, \ldots, n_k)$ is called the run sequence of $w$ and the length of the run sequence of $w$ is $k$. For any binary word $w$ over $\Sigma = \{a,b\}$, the complement of $w$, denoted by $w^c$, is the word $\phi(w)$ where, $\phi$ is a morphism such that $\phi(a)=b$ and $\phi(b)=a$. For example, if $w= ababb$, then $w^c = babaa$. We recall the definition of the block reversal of a word from Mahalingam et al. (\cite{blore}). \begin{definition}\cite{blore} \label{br} Let $w,\;B_i \in \Sigma^+$ for all $i$. The block reversal of $w$, denoted by $\mathtt{BR}(w)$, is the set $$\mathtt{BR}(w) =\{ B_tB_{t-1}\cdots B_1 \;:\; \;w=B_1B_2 \ldots B_t, \; ~t\ge 1\}.$$ \end{definition} Note that a word can be divided into a maximum of $|w|$ blocks. We illustrate Definition \ref{br} with the help of an example. \begin{example}\label{e2} Let $\Sigma=\{a, b,c\}$. Consider $u=abbc$ over $\Sigma$. Then, $$\mathtt{BR}(u) = \{ cbab, cbba, cabb, bbca, bcab, abbc, bcba \}.$$ \end{example} For more information on words, the reader is referred to Lothaire (\cite{Lothaire1997}) and Shyr (\cite{Shyr2001}). \section{Block Reversal of Non-binary Words}\label{sec3} It is well known that a rich word $w$ contains exactly $|w|$ distinct palindromic factors. In this section, we find a necessary and sufficient condition for a non-binary word such that all elements in its block reversal are rich. We recall the following from Glen et al. (\cite{palrich}). \begin{theorem}\cite{palrich}\label{tglen} For any word $w$, the following properties are equivalent:\\ (i) $w$ is rich;\\ (ii) for any factor $u$ of $w$, if $u$ contains exactly two occurrences of a palindrome $p$ as a prefix and as a suffix only, then $u$ is itself a palindrome. \end{theorem} \begin{lemma}\cite{palrich}\label{rich} If $w$ is rich, then \begin{itemize} \item all factors of $w$ are rich. \item $w^R$ is rich. \end{itemize} \end{lemma} We first give a necessary condition under which $\mathtt{BR}(w)$ contains at least one rich word. \begin{lemma}\label{45tn} Let $w \in \Sigma^n$. If $\mathtt{BR}(w)$ has no rich element, then $|\ALPH(w)|< n-1$. \end{lemma} \begin{proof} Let $w \in \Sigma^n$ such that $\mathtt{BR}(w)$ contains no rich element. We prove that if $|\ALPH(w)| \geq n-1$, then there exists at least one rich word in $\mathtt{BR}(w)$. If $|\ALPH(w)|=n $, then all elements in $\mathtt{BR}(w)$ are rich. If $|\ALPH(w)|=n-1 $, then for $u_1, u_2, u_3 \in \Sigma^*$, $w = u_1 a u_2 a u_3$ such that $a \notin \ALPH(u_i)$ for all $i$ and $\ALPH(u_i) \cap \ALPH(u_j) = \emptyset$ for $i\neq j$. Now, $u_3u_2a^2u_1 \in \mathtt{BR}(w)$ is a rich word. \end{proof} We now give an example of a word $w \in \Sigma^n$ with $|\ALPH(w)|=n-2$ such that $\mathtt{BR}(w)$ contains no rich word. \begin{example}\label{45tnr} For $a, b \in \Sigma$, consider $w= u_1 \textbf{a} u_2 \textbf{b} u_3 \textbf{b} u_4 \textbf{a} u_5$ such that $a, b \notin \ALPH(u_i)$, $|u_i|\geq 3$ for each $i$, $\ALPH(u_i) \cap \ALPH(u_j)=\emptyset$ for $i\neq j$ and $\sum_{i=1}^{i=5}|\ALPH(u_i)|=|w|-4$. Then, $|\ALPH(w)|=|w|-2$. We denote by $\pi(w)$, the set of all permutations of the word $w$, i.e., $\pi(w)=\{u\in \Sigma^*|\; |u|_a=|w|_a \text{ for all } a\in \Sigma \}$. One can easily observe that $\mathtt{BR}(w)$ is a subset of $\pi(w)$. If $\pi(w)$ has no rich words, then $\mathtt{BR}(w)$ also has no rich words. Suppose there is a $ v \in \pi(w)$ such that $v$ is rich then, as $|\ALPH(v)|=|v|-2$, $|v|_a=|v|_b=2$, by Theorem \ref{tglen}, we have, $\{ a \alpha a, b \alpha' b~ |~ \alpha, \alpha' \in \Sigma^{\geq 2} \text{ such that } \alpha \neq bzb, \alpha' \neq az'a \text{ where } z, z' \in \Sigma \cup \{\lambda\} \}$ $\cap \; Fac(v) = \emptyset$. Otherwise, if $a \alpha a$ or $b \alpha' b$ lies in $Fac(v)$, then as $\alpha \neq bzb$, $\alpha' \neq az'a$ where $z, z' \in \Sigma \cup \{\lambda\}$, $\alpha, \alpha' \in \Sigma^{\geq 2}$, $|\alpha|_a = 0$ and $|\alpha'|_b = 0$, we have, $a \alpha a$ and $b \alpha' b$ are not palindromes, which contradicts Theorem \ref{tglen}. This implies that $v$ is of one of the following forms: \begin{align}\label{algrt1} v_1 x^2 v_2 y^2 v_3,\; v_1 x x_1 x v_2 y x_2 y v_3, \; v_1 xy^2x v_2,\; v_1 xx_1x v_2 y^2 v_3, \; v_1 y^2 v_2 xx_1x v_3, \; v_1 xyxy v_2, \; v_1 x y x_1 y x v_2 \end{align} where $x \neq y \in \{a, b\}$, $ x_1, x_2 \in \Sigma \setminus \{a, b\}$ and $v_i \in \Sigma^*$ for all $i$. Now, from the structure of $w$, we observe that $\mathtt{BR}(w)$ does not contain any element of forms in (\ref{algrt1}). Thus, $v \notin \mathtt{BR}(w)$. Now, $\mathtt{BR}(w) \subseteq \pi(w)$ and $v\in\pi(w) $ is rich implies no element of $\mathtt{BR}(w)$ is rich. \end{example} Note that some elements of $\mathtt{BR}(w)$ may not be rich even when $w$ is rich. For example, the word $w=abbc$ is rich, but $ bcab \in \mathtt{BR}(w)$ is not rich. We now give a necessary and sufficient condition on a non-binary word $w$ such that all elements of $\mathtt{BR}(w)$ are rich. We need the following results. \begin{lemma} \label{nori} Let $w = a_1^{n_1}a_2uv$ where $a_1\neq a_2$, $u \in \{a_1,a_2\}^+$, $v \in (\Sigma \setminus \{ a_1, a_2\})^+$ and $n_1 \geq 1$. Then, there exists an element in $\mathtt{BR}(w)$ which is not rich. \end{lemma} \begin{proof} Let $w = a_1^{n_1} a_2 u v$ such that $a_1\neq a_2$, $u \in \{a_1,a_2\}^+$, $v \in (\Sigma \setminus \{ a_1, a_2\})^+$ and $n_1 \geq 1$. Let $u = u' a_i$ where $i=1$ or $2$. Then, $w = a_1^{n_1} a_2 u'a_i v $. Note that $w'=u' a_i v a_2 a_1^{n_1} \in \mathtt{BR}(w)$ and $w''=a_i v a_1^{n_1} a_2 u' \in \mathtt{BR}(w)$. The factor $ a_i v a_2 a_1$ of $w'$ is not a palindrome for $i=1$ as $a_i\notin \ALPH(v)$ and similarly the factor $ a_iv a_1^{n_1} a_2$ of $w''$ is not a palindrome for $i=2$. Hence, by Theorem \ref{tglen} and Lemma \ref{rich}, $w'\in \mathtt{BR}(w)$ is not rich when $i=1$ and $w''\in \mathtt{BR}(w)$ is not rich when $i=2$. \end{proof} We also have the following: \begin{lemma}\label{notrich} For $u_1, u_2, u_3, u_4, u_5 \in \Sigma^*$, consider $w= u_1 a_i u_2 a_j u_3 a_{k} u_4 a_i u_5$ such that $a_j \neq a_k$, $a_j \neq a_i \neq a_k$ and $a_k$ is not a suffix of $u_3$. Then, there exists an element in $\mathtt{BR}(w)$ which is not rich. \end{lemma} \begin{proof} For $u_1, u_2, u_3, u_4, u_5 \in \Sigma^*$, consider $w= u_1 a_i u_2 a_j u_3 a_{k} u_4 a_i u_5$ where $a_j \neq a_k$, $a_j \neq a_i \neq a_k$ and $a_k$ is not a suffix of $u_3$. We have the following cases: \begin{itemize} \item $a_i\notin \ALPH(u_3) : $ Then, $w'= u_5 u_4 a_i a_k u_3 a_j a_i u_2 u_1 \in \mathtt{BR}(w)$ and $a_j \neq a_k$ implies $a_i a_k u_3 a_j a_i$ is not a palindromic factor of $w'$. Then, by Theorem \ref{tglen}, $w'$ is not rich. \item $a_i\in \ALPH(u_3) : $ Then, let $u_3 = u_3' a_i u_3''$ such that $u_3', u_3'' \in \Sigma^*$ and $|u_3''|_{a_i}=0$. Now, $w''= u_5 u_4 a_i a_{k} u_3'' a_i u_1 a_i u_2 a_j u_3' \in \mathtt{BR}(w)$. If $w''$ is not rich, then we are done. If $w''$ is rich, then $a_i a_{k} u_3'' a_i\in Fac(w'')$ and since, $|u_3''|_{a_i}=0$, by Theorem \ref{tglen}, $a_i a_{k} u_3'' a_i$ is a palindrome. This implies $u_3''=\lambda$ as $a_k$ is not a suffix of $u_3$. Then, $w=u_1 a_i u_2 a_j u_3' a_i a_{k} u_4 a_i u_5$. Now, $w'''= u_4 a_i u_5 u_3' a_i a_{k} a_j a_i u_2 u_1 \in \mathtt{BR}(w) $. Then, $a_i a_{k} a_j a_i \in Fac(w''')$ is not a palindrome as $a_j\neq a_k$. Therefore, by Theorem \ref{tglen}, $w'''$ is not rich. \end{itemize} \end{proof} Now, we find a necessary and sufficient condition for a non-binary word such that all elements in its block reversal are rich. \begin{theorem} Let $w$ be a non-binary word. Then, all elements of $\mathtt{BR}(w)$ are rich iff $w$ is either of the form $a_1a_2a_3 \cdots a_k$ or $a_i^{|w|}$ where $a_i\in \Sigma$ are distinct. \end{theorem} \begin{proof} Let $w \in \Sigma^*$. If $|\ALPH(w)|=1$, we are done. Assume $|\ALPH(w)|\geq 3$ and consider the run-length encoding of $w$ to be $ a_1^{n_1}a_2^{n_2}a_3^{n_3} \cdots a_k^{n_k}$ where $a_i \neq a_{i+1}\in \Sigma$, $k \geq 3$ and $n_i \geq 1$. Let all elements of $\mathtt{BR}(w)$ be rich. We have the following cases: \begin{itemize} \item All $a_t$'s are distinct for $1\leq t\leq k$ : We prove that $n_t=1$ for $1\leq t\leq k$. Assume if possible that there exists at least one $n_j \geq 2$ for some $j$, i.e., $n_j = 2m +s$ for $m\geq 1$ and $ s\in \{0,1\}$. Let $\gamma = a_1^{n_1} a_2^{n_2} \cdots a_{j-1}^{n_{j-1}}$ and $\gamma'=a_{j+1}^{n_{j+1}} a_{j+2}^{n_{j+2}} \cdots a_k^{n_k}$. Then, $w = \gamma a_j^{2m+s}\gamma'$. Since, $a_j^m \gamma' \gamma a_j^m a_j^s \in \mathtt{BR}(w)$ is rich and all $a_t$'s are distinct, by Theorem \ref{tglen}, $u = a_j^m \gamma' \gamma a_j^m$ is a palindrome. Now, as $|\ALPH(w)|\geq 3$ and all $a_t$'s are distinct, $u$ is not a palindrome which is a contradiction. Therefore, $n_t = 1$ for $1\leq t\leq k$ and $w=a_1a_2a_3 \cdots a_k$. \item Otherwise, suppose $i$ is the least index such that $|a_1a_2\cdots a_k|_{a_i}\geq 2$ and $a_j=a_i$ where $a_l\neq a_i$ for $i+1\leq l\leq j-1$ i.e., $j$ is the first position at which $a_i$ repeats for $i<j$. We have the following cases : \begin{itemize} \item $i\geq 3$ : Note that $a_i \neq a_1$ and $a_i \neq a_2$. Let $n_i \geq n_j$ such that $n_i = n_j + s' $ where $s' \geq 0$. Now, for $\delta = a_3^{n_3} a_4^{n_4} \cdots a_{i-2}^{n_{i-2}}$, $\alpha = a_{i+1}^{n_{i+1}} a_{i+2}^{n_{i+2}} \cdots a_{j-1}^{n_{j-1}}$ and $\beta = a_{j+1}^{n_{j+1}} a_{j+2}^{n_{j+2}}\cdots a_{k}^{n_{k}}$, we have, $$w = a_1^{n_1}a_2^{n_2} \delta a_{i-1}^{n_{i-1}} a_i^{n_j + s'} \alpha a_j^{n_j} \beta. $$ Since, $\beta a_j^{n_j} a_1^{n_1} a_2^{n_2} \delta a_{i-1}^{n_{i-1}} a_i^{n_j + s'} \alpha \in \mathtt{BR}(w)$ is rich, by Theorem \ref{tglen}, we get, $a_j^{n_j} a_1^{n_1} a_2^{n_2} \delta a_{i-1}^{n_{i-1}} a_i^{n_j}$ is a palindrome, and hence, $a_1 = a_{i-1}$. Similarly, as $\beta a_j^{n_j} a_2^{n_2} \delta a_{i-1}^{n_{i-1}} a_i^{n_j} a_i^{s'} \alpha a_1^{n_1} \in \mathtt{BR}(w)$, by Theorem \ref{tglen}, we have, $a_j^{n_j} a_2^{n_2} \delta a_{i-1}^{n_{i-1}} a_i^{n_j}$ is a palindrome, which gives $a_2 = a_{i-1}$. Thus, $a_1 = a_2$ which is a contradiction. A symmetrical argument holds for the case $n_i< n_j$. \item $i\leq 2$ : Let $i=1$, i.e., $a_1$ has a repetition and there exists an index $l>1$ such that $a_1 = a_l$. If all elements in $\mathtt{BR}(w)$ are rich, then by Lemma \ref{notrich}, there exists at most one distinct letter between $a_1$ and $a_l$. Similarly, between any two occurrences of $a_2$, there exists at most one distinct letter. Then, $w$ can only be of forms $a_1^{n_1} a_2^{n_2} a_3^{n_3} a_2 z'$ or $ a_1^{n_1} a_2 u v$ where $a_1 \neq a_3$, $z' \in \{\Sigma \setminus \{a_1\}\}^*$, $u \in \{ a_1, a_2 \}^+$ and $v \in (\Sigma \setminus \{ a_1, a_2 \} )^+$. If $w$ is in form $a_1^{n_1} a_2^{n_2} a_3^{n_3} a_2 z'$, then $z'a_2 a_3^{n_3} a_1^{n_1} a_2^{n_2} \in \mathtt{BR}(w)$. Since, $a_2 a_3^{n_3} a_1^{n_1} a_2$ is not a palindrome, by Theorem \ref{tglen}, $z'a_2 a_3^{n_3} a_1^{n_1} a_2^{n_2} $ is not rich, a contradiction. Now, consider $w$ is in form $ a_1^{n_1} a_2 u v$. Note that as $|\ALPH(w)|\geq 3,$ $v\neq \lambda$. By Lemma \ref{nori}, there exists an element in $\mathtt{BR}(w)$ which is not rich, a contradiction. \end{itemize} \end{itemize} Thus, if $|\ALPH(w)|\geq 3$ and all elements of $\mathtt{BR}(w)$ are rich, then $w=a_1a_2a_3 \cdots a_k$ where each $a_i\in \Sigma$ are distinct.\\ The converse is straightforward. \end{proof} \section{Block Reversal of Binary Words}\label{sec4} Anisiu et al. (\cite{pcofw}) showed that any binary word of length greater than $8$, has at least $8$ non-empty palindromic factors. A set of words that achieve the bound of having exactly $8$ palindromic factors was given by Fici et al. (\cite{lepin}). We recall the definition of $k$-$th$ power of $u \in \Sigma^*$ from Brandenburg (\cite{FUPH}) as the prefix of least length $u'$ of $u^n$ where $n\geq k$ such that $|u'|\geq k|u|$. For example, given a word $aba$, the $\frac{5}{3}$-$th$ power of $aba$ is $ aba^{(\frac{5}{3})} = abaab$. Fici et al. (\cite{lepin}) showed that for all $u\in C(v)$ where $v= abbaba$, $P(u^{(\frac{n}{6})})=8$, $n\geq 9$. Mahalingam et al. (\cite{lep}) characterized words $w$ such that $P(w) =8$. They proved that a binary word $w$ has $8$ palindromic factors iff $w$ is of the form $u^{(\frac{n}{6})}$ where $u\in C(v) \cup C(v^R)$ and $v=abbaba$. In this section, we discuss the case of binary words. Let $l(w)$ be the length of the run sequence of a binary word $w$. We prove that if $l(w)=2$, then all elements of $\mathtt{BR}(w)$ are rich and if $l(w)\geq 9$, then there exists an element in $\mathtt{BR}(w)$ that is not rich. Then, we study the block reversal of binary words with $3\leq l(w)\leq 9$. The results in this section also hold for complement words as we have considered unordered alphabet $\Sigma=\{a,b\}$. \subsection{\textbf{Block reversal of binary words $\bf{w}$ with} $\bf{l(w)= 2}$ $\bf{\&}$ $\bf{l(w)\geq 9}$} \vspace{.25cm} Now, we discuss the block reversal of binary words $w$ with $l(w)=2$ $\&$ $l(w)\geq 9$. We first recall the following from Guo et al. (\cite{guo}). \begin{proposition} \cite{guo}\label{runlen} Every binary word having a run sequence of length less than or equal to $4$ is rich. \end{proposition} It was verified by Anisiu et al. (\cite{pcofw}) that for all short binary words (up to $|w|=7$), $P(w)=|w|$. We observe that for words $w$ with $|w|> 7$, some elements of $\mathtt{BR}(w)$ may not be rich even when $w$ is rich. For example, $w = a^2b^3a^3$ is rich but $a^2bab^2a^2 \in \mathtt{BR}(w)$, is not rich. We discuss the case when $l(w)=2$ for a word $w$ in the following. \begin{proposition}\label{u1} If $w = a^{n_1}b^{n_2}$ where $n_1, n_2 \geq 1$, then all elements of $\mathtt{BR}(w)$ are rich. \end{proposition} \begin{proof} Let $w=a^{n_1}b^{n_2}$ where $n_1, n_2 \geq 1$. Then, $$\mathtt{BR}(w) = \{b^{n_2'}a^{n_1'}b^{n_2-n_2'}a^{n_1-n_1'}\; : \;0 \leq n_1' \leq n_1, \; 0 \leq n_2' \leq n_2\}.$$ Since the length of the run sequence of each element of $\mathtt{BR}(w)$ is less than or equal to $4$, by Proposition \ref{runlen}, all elements of $\mathtt{BR}(w)$ are rich. \end{proof} We now prove that for a binary word $w$ with length of the run sequence greater than $8$, there exists an element in $\mathtt{BR}(w)$ that is not rich. We recall the following from Mahalingam et al. (\cite{blore}). \begin{lemma}\label{hhh}\cite{blore} $\mathtt{BR}(v) \mathtt{BR}(u) \subseteq \mathtt{BR}(uv)$ for $u,\; v\in \Sigma^*$. \end{lemma} We now have the following: \begin{proposition}\label{u3} Let $w \in \{a, b\}^*$ such that $l(w)\geq 9$. Then, there exists an element in $\mathtt{BR}(w)$ that is not rich. \end{proposition} \begin{proof} Let $w \in \{a, b\}^*$ such that $l(w) \geq 9$. Since, $l(w) \geq 9$, then for $n_i\geq 1$, consider $w' = a^{n_1} b^{n_2} a^{n_3} b^{n_4} a^{n_5} b^{n_6}\\ a^{n_7} b^{n_8} a^{n_9}$ to be a prefix of $w$. If $w$ is not rich, then we are done. Otherwise, $w$ is rich, then by Lemma \ref{rich}, all factors of $w$ are rich. Also, from Lemma \ref{hhh}, we have, $\mathtt{BR}(v) \mathtt{BR}(u) \subseteq {\mathtt{BR}(uv)}$ for $u,\; v\in \Sigma^*$. We show that there exists an element in $\mathtt{BR}(w')$ that is not rich to complete the proof. Suppose to the contrary that all elements of $\mathtt{BR}(w')$ are rich. Let $w_1, w_2, w_3 \in \mathtt{BR}(w')$ where $$w_1 = a^{n_9+n_7} b^{n_8+n_6} a b a^{n_5-1+n_3}b^{n_4-1+n_2}a^{n_1},$$ $$w_2 = b^{n_8} a^{n_9+n_7} b a b^{n_6-1+n_4} a^{n_5-1+n_3+n_1}b^{n_2} \text{ \;\;and}$$ $$ w_3 = a^{n_9} b^{n_8+n_6} a^{n_7+n_5} b a b^{n_4-1+n_2} a^{n_3-1+n_1}.$$ We have the following: \begin{itemize} \item If $n_3+n_5\geq 3$, then $a^2 b^{n_8+n_6} a b a^2$ is a factor of $w_1$ that contains exactly two occurrences of a palindrome $a^2$ as a prefix and as a suffix. By Theorem \ref{tglen}, if $w_1$ is rich, then $a^2 b^{n_8+n_6} a b a^2$ is a palindrome which is a contradiction. Hence, $n_3 = n_5 =1$. \item If $n_4+n_6\geq 3$, then $a^2 b a b^{n_6-1+n_4} a^2$ is a factor of $w_2$ that contains exactly two occurrences of a palindrome $a^2$ as a prefix and as a suffix. By Theorem \ref{tglen}, if $w_2$ is rich, then $ a^2 bab^{n_6-1+n_4} a^2$ is a palindrome which is a contradiction. Hence, $n_4 =n_6=1$. \item If $n_2 \geq 2$, then $b^2 a^{n_7+n_5} b a b^2$ is a factor of $w_3$ that contains exactly two occurrences of a palindrome $b^2$ as a prefix and as a suffix. By Theorem \ref{tglen}, if $w_3$ is rich, then $ b^2 a^{n_5+n_7} b a b^2$ is a palindrome which is a contradiction. Hence, $n_2=1$. \end{itemize} Hence, we have $n_2=n_3=n_4=n_5=n_6=1$ and $w' = a^{n_1} b a b a b a^{n_7} b^{n_8} a^{n_9}$. Let $w_4,\; w_5\in \mathtt{BR}(w')$ where $w_4= a^{n_9+n_7} b^{n_8} a b^2 a^{n_1+1} b$ and $w_5 = a^{n_9+n_7} b^{n_8+1} a b^2 a^{1+n_1}$. Now, $a^2 b^{n_8}a b^2 a^2$ is a factor of $w_4$ that contains exactly two occurrences of a palindrome $a^2$ as a prefix and as a suffix. By Theorem \ref{tglen}, since $w_4$ is rich, $n_8=2$. Also, $a^2 b^{n_8+1}a b^2 a^2$ is a factor of $w_5$ that contains exactly two occurrences of a palindrome $a^2$ as a prefix and as a suffix. By Theorem \ref{tglen}, since $w_5$ is rich, $n_8=1$, which is a contradiction. Thus, there always exists an element in $\mathtt{BR}(w')$ that is not rich. \end{proof} \subsection{\bf{Block reversal of binary words $\bf{w}$ with} $\bf{3\leq l(w)\leq 8}$} \vspace{.25cm} We now consider the case for a binary word $w$ such that $3\leq l(w)\leq 8$. We observe that the result varies with the structure of the word. We compile all results towards the end of this section. We first recall the following from Anisiu et al. (\cite{pcofw}). \begin{theorem}\cite{pcofw}\label{7ric} If $w$ is a binary word of length less than $8$, then $P(w)=|w|$. If $w$ is a binary word of length $8$, then $7\leq P(w)\leq 8$ and $P(w)= 7$ iff $w$ is of the form $aabbabaa$ or $aababbaa$. \end{theorem} Now, with the help of examples, we illustrate that all elements of $\mathtt{BR}(w)$ may be rich for a binary word $w$ such that $3\leq l(w)\leq 8$. \begin{example}\label{u2} For $3\leq l(w)\leq 8$, consider \[w=\left \{\begin{array}{cc} a(ba)^i & \text{for $i=\frac{l(w)-1}{2}$ and $l(w)$ odd,}\\ (ab)^i & \text{for $i=\frac{l(w)}{2}$ and $l(w)$ even.}\end{array} \right.\] It can be observed that all elements of $\mathtt{BR}(w)$ are rich. \end{example} Thus, from Propositions \ref{u1} and \ref{u3} and Example \ref{u2}, we conclude the following. \begin{theorem} Let $w$ be a binary word and $l(w)$ be the length of the run sequence of $w$. If all elements of $\mathtt{BR}(w)$ are rich, then $2\leq l(w)\leq 8$. \end{theorem} We now consider the following example of a binary word $v$ with $3\leq l(v)\leq 8$ such that there exists an element in $\mathtt{BR}(v)$ that is not rich. \begin{example}\label{u4} For $3\leq l(v)\leq 8$, consider \[v=\left \{\begin{array}{cc} a^2b^3a^3(ba)^i & \text{for $i=\frac{l(v)-3}{2}$ and $l(v)$ odd,}\\ a^2b^3a^3(ba)^ib & \text{for $i=\frac{l(v)-4}{2}$ and $l(v)$ even.}\end{array} \right.\] and \[v'=\left \{\begin{array}{cc} (ba)^i a^2 b^2 a b a^2 & \text{for $i=\frac{l(v)-3}{2}$ and $l(v)$ odd,}\\ (ba)^i b a^2 b^2 a b a^2 & \text{for $i=\frac{l(v)-4}{2}$ and $l(v)$ even.} \end{array} \right.\] It can observed that $v' \in \mathtt{BR}(v)$. Note that by Lemma \ref{rich}, $v'$ is not rich as $a^2 b^2 a b a^2$ is not rich. \end{example} We conclude from Examples \ref{u2} and \ref{u4} that all elements of $\mathtt{BR}(w)$ may or may not be rich for a binary word $w$ such that $3\leq l(w)\leq 8$. Now, we find the structure of binary words $w$ with $3\leq l(w)\leq 8$ such that the block reversal of $w$ contains only rich words. We recall the following from Mahalingam et al. (\cite{blore}). \begin{lemma}\label{f1}\cite{blore} Let $w\in \Sigma^+$, $(\mathtt{BR}(w))^R = \mathtt{BR}(w^R)$. \end{lemma} We conclude the following from Lemmas \ref{rich} and \ref{f1}. \begin{remark}\label{o1} All elements of $\mathtt{BR}(w)$ are rich iff all elements of $\mathtt{BR}(w^R)$ are rich. \end{remark} We first study the case when the length of the run sequence of the word is equal to $8$. \begin{proposition}\label{g8} Let $w\in \{a, b\}^*$ and $l(w)=8$. Then, all elements of $\mathtt{BR}(w)$ are rich iff $w=abababab$. \end{proposition} \begin{proof} Let $w$ be a binary word with $l(w)=8$ such that all elements of $\mathtt{BR}(w)$ are rich. Consider $w=a^{n_1}b^{n_2}a^{n_3}b^{n_4}a^{n_5}b^{n_6}a^{n_7}b^{n_8}$ to be the run-length encoding of $w$ where $n_i\geq 1$ for all $i$. Let $$w'=b^{n_8+n_6} a^{n_7+n_5} b a b^{n_4-1+n_2} a^{n_3-1+n_1} \in \mathtt{BR}(w).$$ Then, $w'$ is rich. If $n_4 \geq 2$ or $n_2\geq 2$, then since $v=b^{2} a^{n_7+n_5} b a b^{2}\in Fac(w')$ and $v$ contains exactly two occurrences of $b^2$, by Theorem \ref{tglen}, $b^{2} a^{n_7+n_5} b a b^{2}$ is a palindrome which is a contradiction. Thus, $n_2=n_4=1$. Now, by Remark \ref{o1}, we get, $n_7=n_5=1$. Thus, $w=a^{n_1}ba^{n_3}bab^{n_6}ab^{n_8}$. Now, consider $$w''= b^{n_8} a^{2} b^{n_6+1} a b a^{n_3-1+n_1} \in \mathtt{BR}(w).$$ Then, $w''$ is rich. If $n_1\geq 2$ or $n_3\geq 2$, then since $v'=a^{2} b^{n_6+1} a b a^{2} \in Fac(w'')$ and $v'$ contains exactly two occurrences of $a^2$, by Theorem \ref{tglen}, $ a^{2} b^{n_6+1} a b a^{2}$ is a palindrome which is a contradiction. Thus, $n_1=n_3=1$. Now, by Remark \ref{o1}, we get, $n_8=n_6=1$. Thus, $w=abababab$. The converse follows from Theorem \ref{7ric}. \end{proof} We conclude the following from Proposition \ref{g8}. \begin{remark} Let $w$ be a binary word such that $l(w)=8$ and $|w|>8$. Then, there exists an element in $\mathtt{BR}(w)$ that is not rich. \end{remark} We now consider the case when the length of the run sequence of the word is $7$. For a binary word $w$, if $l(w)=7$, then $|w|\geq 7$. If $|w|=7$, it is well known (\cite{pcofw}) that all elements of $\mathtt{BR}(w)$ are rich. We consider the case when $|w|>7$ in the following. \begin{proposition}\label{g7} Let $w$ be a binary word with $|w|>7$ and $l(w)=7$. Then, all elements of $\mathtt{BR}(w)$ are rich iff $w$ is $ababab^2a$, $abab^2aba$ or $ab^2ababa$. \end{proposition} \begin{proof} Let $w$ be a binary word with $l(w)=7$ such that all elements of $\mathtt{BR}(w)$ are rich. Consider $w=a^{n_1}b^{n_2}a^{n_3}b^{n_4}a^{n_5}b^{n_6}a^{n_7}$ to be the run-length encoding of $w$ where $n_i\geq 1$ for all $i$. Let $$\alpha = a^{n_7-1+n_5} b^{n_6} a b^{n_4+n_2} a^{n_3+n_1} \in \mathtt{BR}(w)$$ and $$\beta =a^{n_7-1+n_5} b^{n_6} a b^{n_4} a^{n_3+n_1} b^{n_2} \in \mathtt{BR}(w) .$$ Then, $\alpha,\; \beta$ are rich. If $n_7 \geq 2$ or $n_5 \geq 2$, then by Theorem \ref{tglen}, $a^{2} b^{n_6} a b^{n_4+n_2} a^{2}$ and $a^{2} b^{n_6} a b^{n_4} a^{2}$ are palindromic factors of $\alpha$ and $\beta $, respectively. This implies $n_6=n_4+n_2$ and $n_6=n_4$, which is a contradiction to the fact that $n_2 \geq 1$. Thus, $n_7 = n_5 =1$. \\ Since, $n_7=n_5=1$, by Remark \ref{o1}, we get, $n_1=n_3=1$. Thus, $w=a b^{n_2}a b^{n_4}a b^{n_6} a$. We now show that $n_6\leq2$. Consider $\gamma = b^{n_6-1} aa b a b^{n_4+n_2} a \in \mathtt{BR}(w)$. Then, $\gamma$ is rich. If $n_6\geq 3$, then by Theorem \ref{tglen}, $b^{2} a^2 b a b^{2}$ is a palindromic factor of $\gamma$ which is a contradiction. Thus, $n_6\leq 2$. We have the following cases: \begin{enumerate} \item $n_6=2: $ If $n_4\geq 2$ or $n_2\geq 2$, then $b^2 a^2 ba b^{n_4-1+n_2} a \in \mathtt{BR}(w)$ is not rich which is a contradiction. Thus, in this case, $n_4=n_2=1$. We have, $w=a b a b a b^{2} a$. \item $n_6=1 :$ Here, $w=a b^{n_2}a b^{n_4}a b a$. If $n_4\geq 2$ and $n_2\geq 2$, $b^{n_4} a b a^2 b^{n_2} a \in \mathtt{BR}(w)$ is not rich which is a contradiction. So, either $n_2=1$ or $n_4=1$. Note that if $n_2=n_4=1$, then $|w|=7$, which is a contradiction. We are left with the following cases: \begin{itemize} \item $n_2=1$ and $n_4 \geq 2$ : Here, $w=a b a b^{n_4}a b a$. If $n_4\geq 3$, $b^{n_4-1} a b a^2 b^2 a \in \mathtt{BR}(w)$ is not rich, a contradiction. Thus, $n_4 =2$ and $w=a b a b^{2}a b a$. \item $n_4=1$ and $n_2\geq 2$ : Here, $w=a b^{n_2} a ba b a$. If $n_2\geq 3$, $ a b^2 a b a^2 b^{n_2-1} \in \mathtt{BR}(w)$ is not rich, a contradiction. Thus, $n_2=2$ and $w=a b^2 a ba b a$. \end{itemize} \end{enumerate} The converse follows from Theorem \ref{7ric}. \end{proof} We conclude the following from Proposition \ref{g7}. \begin{remark} Let $w$ be a binary word such that $l(w)=7$ and $|w|>8$. Then, there exists an element in $\mathtt{BR}(w)$ that is not rich. \end{remark} We now consider the case when the length of the run sequence of the word is $6$. We need the following: \begin{remark}\label{rem2} We consider the block reversal of the following words: \begin{enumerate} \item Let $w=a^2 b a b a b^{n_6}$ for $n_6<4$. \begin{itemize} \item If $n_6=1$ or $2$, then as $|w|\leq 8$, by Theorem \ref{7ric}, all elements of $\mathtt{BR}(w)$ are rich. \item If $n_6=3$, then $b a b^2 a^2 bab \in \mathtt{BR}(w)$ is not rich which implies that not all elements of $\mathtt{BR}(w)$ are rich. \end{itemize} \item Let $w=a^3 b a b a b^{n_6}$ for $n_6<4$. \begin{itemize} \item If $n_6=1$, then by Theorem \ref{7ric}, all elements of $\mathtt{BR}(w)$ are rich. \item If $n_6=2$, then $a b a b^2 a^2 b a \in \mathtt{BR}(w)$ is not rich which implies that not all elements of $\mathtt{BR}(w)$ are rich. \item If $n_6=3$, then $ba b^2 a^3 bab \in \mathtt{BR}(w)$ is not rich which implies that not all elements of $\mathtt{BR}(w)$ are rich. \end{itemize} \item Let $w=a^{n_1} b a b a b$ for $n_1\geq 1$. We show that all elements of $\mathtt{BR}(w)$ are rich. Let $w=D_1 D_2 D_3 \cdots D_k$ where $k \geq 2$ and each $D_i \in \Sigma^+$. Then, either $D_1 = a^j$, $D_2=a^{n_1-j}x$ and $D_3 \cdots D_k = y$ where $x, y \in \Sigma^*$, $x y =babab$ and $1 \leq j <n_1$ or $D_1 = a^{n_1} x'$ and $D_2 D_3 \cdots D_k=y'$ where $x' \in \Sigma^*, y' \in \Sigma^+$ and $x' y' = babab$. Then, for distinct elements of $\mathtt{BR}(w)$, we can divide $w$ in at most seven non-empty blocks. \begin{itemize} \item When we divide $w$ in two non-empty blocks, then $\mathtt{BR}(w)$ contains the following:\\ Let, $A_2 = \{ b a^{n_1} baba, ab a^{n_1} bab, bab a^{n_1} ba, abab a^{n_1} b, babab a^{n_1}, a^{n_1-i}babab a^i~ |~ 1 \leq i \leq n_1-1 \}.$ We can observe that each element of $A_2$ is rich. \item When we divide $w$ in three non-empty blocks, then $\mathtt{BR}(w)$ contains the following:\\ Let, $A_3 = \{ ba a^{n_1} bab, bba a^{n_1}ba, baba a^{n_1}b, bbaba a^{n_1}, b a^{n_1-i} baba a^{i}, abba^{n_1}ba, ababa^{n_1}b, ab bab a^{n_1},\\ ab a^{n_1-i} bab a^{i}, babba a^{n_1}, bab a^{n_1-i} ba a^{i}, abab b a^{n_1}, abab a^{n_1-i} b a^{i}, babab a^{n_1} ~|~ 1 \leq i \leq n_1-1 \}$. We can observe that each element of $A_3$ is rich. \item When we divide $w$ in four non-empty blocks, then $\mathtt{BR}(w)$ contains the following:\\ Let, $A_4 = \{ bab a^{n_1} ba, baab a^{n_1} b, babab a^{n_1}, ba a^{n_1-i} bab a^{i}, bbaa a^{n_1} b, bb aba a^{n_1}, bba a^{n_1-i} ba a^{i}, baba a^{n_1-i} b a^{i},\\ b baba a^{n_1}, abba a^{n_1} b, abbba a^{n_1}, abb a^{n_1-i} ba a^{i}, ababb a^{n_1}, abab a^{n_1-i} b a^{i}, abb ab a^{n_1}, babba a^{n_1}, ababb a^{n_1} ~|~ 1 \leq i \leq n_1-1 \}$. We can observe that each element of $A_4$ is rich. \item When we divide $w$ in five non-empty blocks, then $\mathtt{BR}(w)$ contains the following:\\ Let, $A_5 =\{ baba a^{n_1} b, babba a^{n_1}, bab a^{n_1-i} ba a^{i}, baab b a^{n_1}, baab a^{n_1-i} b a^{i}, ba bab a^{n_1}, bbaa b a^{n_1}, bb aa a^{n_1-i} b a^{i},\\ bbaba a^{n_1}, abbab a^{n_1}, abba a^{n_1-i} b a^{i}, ababb a^{n_1}, a bbb a a^{n_1} ~|~ 1 \leq i \leq n_1-1 \}$. We can observe that each element of $A_5$ is rich. \item When we divide $w$ in six non-empty blocks, then $\mathtt{BR}(w)$ contains the following:\\ Let, $A_6 = \{ babab a^{n_1}, baba a^{n_1-i} b a^{i}, babba a^{n_1}, baabb a^{n_1}, bbaab a^{n_1}, abb ab a^{n_1} ~|~ 1 \leq i \leq n_1-1\}$. We can observe that each element of $A_6$ is rich. \item When we divide $w$ in seven non-empty blocks, then $\mathtt{BR}(w)$ contains the following:\\ Let, $A_7=\{ babab a^{n_1} \}$. Clearly, $babab a^{n_1}$ is rich. Thus, each element of $A_7$ is rich. Also, as $babab a^{n_1}$ is rich, $w=a^{n_1} babab $ is rich. \end{itemize} Therefore, as $\mathtt{BR}(w)= \{w\} \cup A_2 \cup A_3 \cup A_4 \cup A_5 \cup A_6 \cup A_7$, each element of $\mathtt{BR}(w)$ is rich. In a similar fashion one can also show that each element of $\mathtt{BR}(ababab^{n_1})$ is also rich. \end{enumerate} \end{remark} We now have the following: \begin{proposition}\label{g6} Let $w$ be a binary word with $|w|>7$ and $l(w)=6$. Then, all elements of $\mathtt{BR}(w)$ are rich iff $w\in \{u, (u^c)^R\;|\; u\in T\}$ where $$T=\{a b^2 a b a^2 b, a b a b^2 a^2 b, a b a b a^2 b^2, a^2 b a b^2 a b, a^2 b a b a b^2, a b a^2 b^2 a b, a^{n_1} b a b a b\; |\;n_1\geq 3\}.$$ \end{proposition} \begin{proof} Let $w$ be a binary word with $|w|>7$ and $l(w)=6$ such that all elements of $\mathtt{BR}(w)$ are rich. Consider $w=a^{n_1}b^{n_2}a^{n_3}b^{n_4}a^{n_5}b^{n_6}$ to be the run-length encoding of $w$ where $n_i\geq 1$ for all $i$. If $n_5\geq 3$, then by Theorem \ref{tglen}, $ b^{n_6-1} a^{n_5-1} b a b^{n_4+n_2} a^{n_3+n_1} \in \mathtt{BR}(w)$ is not rich. This implies, $n_5\leq 2$. By Remark \ref{o1}, we get, $n_2\leq 2$. We have the following cases: \begin{itemize} \item $n_5 = 2 : $ If $n_1 \geq 2$ or $n_3\geq 2$, then by Theorem \ref{tglen}, $ b^{n_6-1} a^{2} b a b^{n_4+n_2} a^{n_3-1+n_1} \in \mathtt{BR}(w)$ is not rich which is a contradiction. Thus, $n_1 =n_3= 1$. Thus, in this case, we get, $w = a b^{n_2} a b^{n_4} a^2 b^{n_6}$ where $n_2\leq 2$. We have the following cases: \begin{itemize} \item $n_2=2 : $ Then, $w^R = b^{n_6} a^{2} b^{n_4} a b^{2} a$. By Remark \ref{o1}, all elements of $\mathtt{BR}(w^R)$ are rich. Here, $n_4=n_6=1$, otherwise $a b^2 a b a^2 b^{n_4-1+n_6} \in \mathtt{BR}(w^R)$ is not rich. Thus, $w = a b^{2} a b a^2 b$. \item $n_2 = 1 : $ Then, $w = a b a b^{n_4} a^2 b^{n_6}$. We have the following cases: \begin{itemize} \item $n_4 \geq 2$ : If $n_6 \geq 2$, then by Theorem \ref{tglen}, $b^{n_6} a^2 b a b^{n_4} a \in \mathtt{BR}(w)$ is not rich which is a contradiction. Otherwise, $n_6 =1$ and $w = a b a b^{n_4} a^2 b$. If $n_4 \geq 3$, then by Theorem \ref{tglen}, $b^{n_4-1} a^2 b a b^2 a \in \mathtt{BR}(w)$ is not rich which is a contradiction. Thus, $n_4 =2$ and $w = a b a b^{2} a^2 b$. \item $n_4=1$ : If $n_6 \geq 3$, then by Theorem \ref{tglen}, $ b^{n_6-1} a^2 b a b^2 a \in \mathtt{BR}(w)$ is not rich which is a contradiction. Thus, $n_6\leq 2$. If $n_6=1$, then $|w|=7$, thus, $n_6=2$ and $w = a b a b a^2 b^{2}$. \end{itemize} \end{itemize} \item $n_5 = 1 : $ Here, $w=a^{n_1}b^{n_2}a^{n_3}b^{n_4} a b^{n_6}$. We have the following cases: \begin{itemize} \item $n_1 \geq 2$ : If $n_3\geq 2$, then by Theorem \ref{tglen}, $ a^{n_3} b^{n_4} a b^{n_6} a^{n_1} b^{n_2} \in \mathtt{BR}(w)$ for $n_4 \neq n_6$ ($ a^{n_3} b^{n_4} a b^{n_6+n_2} a^{n_1} \in \mathtt{BR}(w)$ for $n_4 = n_6$, respectively) is not rich which is a contradiction. So, $n_3=1$ and $w= a^{n_1}b^{n_2} a b^{n_4}a b^{n_6}$ where $n_2\leq 2$. We have the following cases: \begin{itemize} \item $n_2 = 2 : $ Now, $w^R = b^{n_6} a b^{n_4} a b^2 a^{n_1}$. By Remark \ref{o1}, all elements of $\mathtt{BR}(w^R)$ are rich. If $n_4\geq 2$ or $n_6\geq 2$, then $a^{n_1-1} b^2 a b a^2 b^{n_4-1+n_6} \in \mathtt{BR}(w^R)$ is not rich, a contradiction. Thus, $n_4 = n_6=1$. We get, $w= a^{n_1}b^{2} a b a b $. If $n_1\geq 3$, then by Theorem \ref{tglen}, $b a^{n_1-1} b^2 a b a^2 \in \mathtt{BR}(w)$ is not rich which is a contradiction. Thus, $n_1=2$ and $w= a^2 b^{2} a b a b$. \item $n_2 = 1 : $ Then, $w= a^{n_1} b a b^{n_4}a b^{n_6}$. We have the following cases: \begin{itemize} \item $n_4\geq 2$ : If $n_6 \geq 2$, then by Theorem \ref{tglen}, $b^{n_6} a^{n_1} b a b^{n_4}a \in \mathtt{BR}(w)$ is not rich which is a contradiction. Otherwise, $n_6=1$. Here, $n_1=2$, otherwise, by Theorem \ref{tglen}, $b a^{n_1-1} b a b^{n_4} a^2 \in \mathtt{BR}(w)$ is not rich. Thus, $w= a^{2} b a b^{n_4} a b$. Also, $n_4=2$, otherwise, by Theorem \ref{tglen}, $ab b^{n_4-2} a^2 b a b^2 \in \mathtt{BR}(w)$ is not rich. Thus, $w= a^{2} b a b^{2} a b$. \item $n_4 = 1 : $ If $n_6\geq 4$, then by Theorem \ref{tglen}, $b^{n_6-2} a^{n_1} b a b a b^2\in \mathtt{BR}(w)$ is not rich which is a contradiction. Thus, $w=a^{n_1} b a b a b^{n_6}$ for $1\leq n_6\leq 3$. In this case, if $n_1\geq 4$ and $2\leq n_6 \leq 3$, then by Theorem \ref{tglen}, $a^{n_1-2} b a b a b^{n_6} a^2 \in \mathtt{BR}(w)$ is not rich. We are left with the words $a^2 b a b a b^{n_6}$, $a^3 b a b a b^{n_6}$ for $n_6<4$ and $a^{n_1} b a b a b$ for $n_1\geq 1$. By Remark \ref{rem2}, one can conclude that if all elements of $\mathtt{BR}(w)$ are rich, then $w$ is $a^{n_1} b a b a b$ or $a^{2} b a b a b^{2}$ where $n_1 \geq 3$. \end{itemize} \end{itemize} \item $n_1=1$ : Similar to the case $n_1=2$, one can prove that if all elements of $\mathtt{BR}(w)$ are rich, then $w$ is of one of the following forms: $a b^2 a^2 b a b,\; a b a^2 b^2 a b, \; a b a^2 b a b^2,\; a b a b a b^{n_6} $, where $n_6 \geq 3$. \end{itemize} \end{itemize} The converse follows from Theorem \ref{7ric} and Remark \ref{rem2}. \end{proof} We now consider the case when the length of the run sequence of the word is $5$. \begin{proposition}\label{g5} Let $w$ be a binary word with $|w|>7$ and $l(w)=5$. Then, all elements of $\mathtt{BR}(w)$ are rich iff $w$ is $a^{n_1}ba^{n_3}ba^{n_5}$, $ab^{n_2}ab^{n_4}a^2$, $a^2b^{n_2}ab^{n_4}a$, $ab^{n_2}a^2b^{n_4}a$ where $n_2+n_4 =4$ for $n_i\geq 1$. \end{proposition} \begin{proof} Let $w$ be a binary word with $|w|>7$ and $l(w)=5$ such that all elements of $\mathtt{BR}(w)$ are rich. Consider $w=a^{n_1}b^{n_2}a^{n_3}b^{n_4}a^{n_5}$ to be the run-length encoding of $w$ where $n_i\geq 1$ for all $i$. If $n_2 = n_4 = 1$, then by Theorem \ref{tglen}, all elements of $\mathtt{BR}(w)$ are rich. Now, consider $n_2 + n_4 \geq 3$. If $n_5 \geq 3$, then by Theorem \ref{tglen}, $a^{n_5-1} b a b^{n_4-1+n_2} a^{n_3+n_1} \in \mathtt{BR}(w)$ is not rich which is a contradiction. Thus, $n_5\leq 2$. By Remark \ref{o1}, we get, $n_1\leq 2$. We are left with the following cases: \begin{itemize} \item $n_5=2 : $ Then, $w=a^{n_1}b^{n_2}a^{n_3}b^{n_4}a^{2}$ where $n_2 + n_4 \geq 3$ and $n_1\leq 2$. If $n_3\geq 2$ or $n_1= 2$, then by Theorem \ref{tglen}, $a^{2} b a b^{n_4-1+n_2} a^{n_3-1+n_1} \in \mathtt{BR}(w)$ is not rich which is a contradiction. Thus, $n_3=n_1=1$ and in this case, $w=a b^{n_2} a b^{n_4} a^{2}$ where $n_2 + n_4 \geq 3$. As $|w|>7$, we get, $n_2+n_4\geq 4$. If $n_2+n_4= 4$, then by Theorem \ref{7ric}, all elements of $\mathtt{BR}(w)$ are rich. We now consider the case when $n_2 + n_4 \geq 5$. We have the following cases: \begin{itemize} \item $n_2=i$ for $1\leq i\leq 3$: Then, $n_4 \geq 5-i$ and $w=a b^i a b^{n_4} a^{2}$. By Theorem \ref{tglen}, we get, $b^{n_4-3+i} a^2 b a b^2 a \in \mathtt{BR}(w)$ is not rich which is a contradiction. \item $n_2 \geq 4 : $ Then, $n_4 \geq 1$ and $w=a b^{n_2} a b^{n_4} a^{2}$. If $n_4 = 1$, then $b^{n_2-2} a b a^2 b^2 a \in \mathtt{BR}(w)$ is not rich which is a contradiction. If $n_4 \geq 2$, then $b^{n_4} a^2 b a b^{n_2-1} a \in \mathtt{BR}(w)$ is not rich which is a contradiction. \end{itemize} Hence, if $n_5=2$ and all elements of $\mathtt{BR}(w)$ are rich, then $w=a b^{n_2} a b^{n_4} a^{2}$ where $n_2+n_4=4$. \item $n_5= 1 $: If $n_1=2$, then by Remark \ref{o1}, we get from the case $n_5=2$, if all elements of $\mathtt{BR}(w)$ are rich, then $w= a^2 b^{n_2} a b^{n_4} a$ where $n_2+n_4=4$. Otherwise, $n_1=1$. Then, $w=ab^{n_2}a^{n_3}b^{n_4}a$ where $n_2+n_4 \geq 3$. We have the following cases: \begin{itemize} \item $n_3 \geq 3$ : If $n_2=n_4$, then since $n_2+n_4 \geq 3$, we get both $n_2,\;n_4 \geq 2$. By Theorem \ref{tglen}, $a^{n_3-1} b^{n_4} a b a^{2} b^{n_2-1} \in \mathtt{BR}(w)$ is not rich which is a contradiction. Thus, $n_2 \neq n_4$. By Theorem \ref{tglen}, $a^{n_3-1} b^{n_4} a b^{n_2} a^{2} \in \mathtt{BR}(w)$ is not rich which is a contradiction. \item $n_3\leq 2$ : Then, $w = a b^{n_2} a^{n_3} b^{n_4} a$ where $n_2+n_4\geq 3$. As $|w|>7$, we get, $n_2+n_4\geq 4$. If $n_2+n_4 = 4$, then by Theorem \ref{7ric}, all elements of $\mathtt{BR}(w)$ are rich. Thus, $w = a b^{n_2} a^{n_3} b^{n_4} a$ where $n_2+n_4 = 4$. Now, we consider the case when $n_2+n_4\geq 5$. We have the following cases: \begin{itemize} \item $n_2=i$ for $1\leq i\leq 3$: Then, $n_4 \geq 5-i$ and $w=a b^i a^{n_3} b^{n_4} a$. By Theorem \ref{tglen}, we get, $b^{n_4-3+i} a b a^2 b^2 a \in \mathtt{BR}(w)$ for $n_3=2$ ( $b^{n_4-3+i} a^2 b a b^2 \in \mathtt{BR}(w)$ for $n_3=1$, respectively) is not rich which is a contradiction. \item $n_2 \geq 4 : $ Then, $n_4 \geq 1$ and $w = a b^{n_2} a^{n_3} b^{n_4} a$. If $n_4=1$, then by Theorem \ref{tglen}, $b^{n_2-2} a^2 b a b^2 a \in \mathtt{BR}(w)$ for $n_3 =2$ ( $b^{n_2-2} a b a^2 b^2 \in \mathtt{BR}(w)$ for $n_3 =1$, respectively ) is not rich which is a contradiction. Otherwise, $n_4 \geq 2$. By Theorem \ref{tglen}, $b^{n_4} a b a^2 b^{n_2-1} a \in \mathtt{BR}(w)$ for $n_3=2$ ( $b^{n_4} a^2 b a b^{n_2-1} \in \mathtt{BR}(w)$ for $n_3=1$, respectively) is not rich which is a contradiction. \end{itemize} \end{itemize} \end{itemize} The converse follows from Theorems \ref{tglen} and \ref{7ric}. \end{proof} We consider the case when the length of the run sequence of the word is $4$ and the length of the word is greater than $7$. We have the following result. \begin{proposition}\label{g4} Let $w$ be a binary word with $|w|>7$ and $l(w)=4$. Then, all elements of $\mathtt{BR}(w)$ are rich iff $w$ is of the form $ab^{n_2}ab^{n_4}$ or $a^{n_1}b a^{n_3}b$ or $w\in S$ where \[S=\big\{ a^{n_1}b^{n_2}a^{n_3}b^{n_4}| (n_2,n_4), (n_1,n_3) \in \{(3,1),(2,2),(1,3)\}\big\} \] and $n_i\geq 1$. \end{proposition} \begin{proof} Let $w$ be a binary word with $l(w)=4$ such that all elements of $\mathtt{BR}(w)$ are rich. Consider $w=a^{n_1}b^{n_2}a^{n_3}b^{n_4}$ to be the run-length encoding of $w$ where $n_i\geq 1$ for all $i$. If $n_1=n_3=1$ or $n_2= n_4 = 1$, then all elements of $\mathtt{BR}(w)$ are rich. Now, we consider the case $n_1+n_3 \geq 3$ and $n_2 + n_4 \geq 3$. If $n_3 \geq 4$, then for $j \neq r$ and $i+j=n_4$, and $r+s = n_2$, consider $\alpha = b^i a^{n_3-2} b^j a b^r a^{1+n_1} b^s \in \mathtt{BR}(w)$. By Theorem \ref{tglen}, $\alpha$ is not rich which is a contradiction. Thus, $n_3 \leq 3$. We have the following cases: \begin{itemize} \item $n_3=3$ : Then, for $j' \neq r'$ and $i'+j'=n_4$, and $r'+s' = n_2$, consider $\beta = b^{i'} a^{2} b^{j'} a b^{r'} a^{n_1} b^{s'} \in \mathtt{BR}(w)$. If $n_1 \geq 2$, then by Theorem \ref{tglen}, $\beta$ is not rich which is a contradiction. Thus, if $n_3=3$, then $n_1=1$. \item $n_3=2: $ Then, for $j'' \neq n_2$ and $i''+j''=n_4$, consider $\gamma = b^{i''} a^{2} b^{j''} a b^{n_2} a^{n_1-1} \in \mathtt{BR}(w) $. If $n_1 \geq 3$, $\gamma $ is not rich which is a contradiction. Thus, if $n_3=2$, then $n_1\leq 2$. \item $n_3=1 :$ Then, by Theorem \ref{tglen}, for $n_1 \geq 4$, $a^{n_1-2}b^{n_2}a b^{n_4} a^2 \in \mathtt{BR}(w)$ is not rich when $n_2 \neq n_4$ and $ b a^{n_1-2}b^{n_2}a b^{n_4-1} a^2 \in \mathtt{BR}(w)$ is not rich when $n_2 = n_4$. Thus, if $n_3=1$, then $n_1\leq 3$. \end{itemize} Now, $w^R = b^{n_4} a^{n_3} b^{n_2} a^{n_1}$. Then from Remark \ref{o1}, one can similarly deduce that $n_2\leq 3$ and we also conclude the following: \begin{itemize} \item If $n_2=3$, then $n_4=1$. \item If $n_2=2$, then $n_4\leq 2$. \item If $n_2=1$, then $n_4\leq 3$. \end{itemize} Hence, as $|w|>7$, we get, $w\in S$ where \[S=\big\{ a^{n_1}b^{n_2}a^{n_3}b^{n_4}| (n_2,n_4), (n_1,n_3) \in \{(3,1),(2,2),(1,3)\}\big\} \] for $n_i\geq 1$ and $n_1+n_2+n_3+n_4>7$.\\ The converse follows from Theorems \ref{tglen} and \ref{7ric}. \end{proof} We consider the case when the length of the run sequence of the word is $3$ and the length of the word is greater than $7$. We need the following result. \begin{lemma}\label{l1} Let $w=a^{n_1} b^{n_2} a$ or $a b^{n_2} a^{n_1}$ where $n_1\geq 1$ and $n_2\in \{3, 4\}$. Then, all elements of $\mathtt{BR}(w)$ are rich. \end{lemma} \begin{proof} We prove the result for $w=a^{n_1} b^{n_2} a$. The proof for $w=a b^{n_2} a^{n_1}$ is similar. Let $w=a^{n_1} b^{n_2} a$ where $n_1\geq 1$ and $n_2\in \{3, 4\}$. Consider $w' \in \mathtt{BR}(w)$. Then, one can observe that $2\leq l(w')\leq 6$. If $l(w')\leq 4$, then from Proposition \ref{runlen}, $w'$ is rich. We are left with the following cases: \begin{itemize} \item $l(w')=5 :$ Then, $w'$ is either $a b^{i_1} a^{i_2} b^{i_3} a^{i_4}$ or $b^{j_1} a b^{j_2} a^{n_1} b^{j_3}$ where $i_1+i_3=n_2$, $i_2+i_4 = n_1$ and $j_1+j_2+j_3=n_2$. By Theorem \ref{tglen}, $w'$ is rich. \item $l(w')=6 :$ Then, $w'= b^{k_1} a b^{k_2} a^{k_3} b^{k_4} a^{k_5} $ where $k_1+k_2+k_4=n_2$ and $k_3+k_5=n_1$. By Theorem \ref{tglen}, $w'$ is rich. \end{itemize} \end{proof} We have the following: \begin{proposition}\label{g3} Let $w$ be a binary word with $|w|>7$ and $l(w)=3$. Then, all elements of $\mathtt{BR}(w)$ are rich iff $w$ is of one of the following forms: \begin{itemize} \item $a^2 b^4 a^2$, $ab^{m_2}a$, $a^{m_1}ba^{m_3}$, $a^{m_1}b^2a^{m_3}$. \item $a b^{n_2} a^{n_3}, a^{n_1} b^{n_2} a $ where $n_2 \in \{ 3, 4\}$ and $ n_1, n_3 \geq 3$. \end{itemize} where $m_i\geq 1$. \end{proposition} \begin{proof} Let $w$ be a binary word with $l(w)=3$ such that all elements of $\mathtt{BR}(w)$ are rich. Consider $w=a^{n_1}b^{n_2}a^{n_3}$ to be the run-length encoding of $w$ where $n_i\geq 1$ for all $i$. If $n_1=n_3=1$ or $n_2 \in \{1, 2\}$, then all elements of $\mathtt{BR}(w)$ are rich. Here, $w=ab^{n_2}a$ or $a^{n_1}ba^{n_3}$ or $a^{n_1}b^2a^{n_3}$. Now, we consider $n_1+n_3 \geq 3$ and $n_2 \geq 3$. Let $n_2\geq 5$ and for $j \neq r$, $i+j=n_3$ and $r+s=n_1$, consider $\alpha = a^i b^2 a^j b a^r b^{n_2-3} a^s\in \mathtt{BR}(w)$. Since, $b^2 a^j b a^r b^{2}$ is not a palindrome, by Theorem \ref{tglen}, $\alpha$ is not rich which is a contradiction. Thus, $n_2\leq 4$. So, $n_2 \in \{ 3, 4\}$. We have the following cases: \begin{itemize} \item $n_3\geq 3$ : Then, consider $\beta = a^{n_3-1} b a b^2 a^{n_1} b^{n_2-3} \in \mathtt{BR}(w)$. If $n_1\geq 2$, then by Theorem \ref{tglen}, $a^{2} b a b^2 a^{2}$ is a palindrome, which is a contradiction. Thus, if $n_3 \geq 3$, then $n_1=1$. Here, $w= a b^{n_2} a^{n_3}$ where $n_2 \in \{ 3, 4\}$ and $ n_3 \geq 3$. \item $n_3=2$ : Then, consider $\beta' = a^2 b a b^{n_2-1} a^{n_1-1}\in \mathtt{BR}(w)$. If $n_1\geq 3$, then $\beta'$ is not rich. Thus, if $n_3=2$, then $n_1 \leq 2$. Thus, as $|w|\geq 8$, $w= a^2 b^4 a^2$. \item $n_3=1$ : Then by Lemma \ref{l1}, all elements of $\mathtt{BR}(w)$ are rich. \end{itemize} The converse follows from Theorems \ref{tglen} and \ref{7ric} and Lemma \ref{l1}. \end{proof} We conclude the following from Propositions \ref{g8}, \ref{g7}, \ref{g6}, \ref{g5}, \ref{g4} and \ref{g3} for the binary words with $3\leq l(w) \leq 8.$ \begin{theorem} Let $w$ be a binary word with $|w|>7$. Then, all elements of $\mathtt{BR}(w)$ are rich for \begin{enumerate} \item $l(w)=8$ iff $w=abababab$ \item $l(w)=7$ iff $w$ is $ababab^2a$, $abab^2aba$ or $ab^2ababa$ \item $l(w)=6$ iff $w\in \{u, (u^c)^R\;|\; u\in T\}$ where $$T=\{a b^2 a b a^2 b, a b a b^2 a^2 b, a b a b a^2 b^2, a^2 b a b^2 a b, a^2 b a b a b^2, a b a^2 b^2 a b, a^{n_1} b a b a b\; |\;n_1\geq 3\}$$ \item $l(w)=5$ iff $w$ is $a^{n_1}ba^{n_3}ba^{n_5}$, $ab^{n_2}ab^{n_4}a^2$, $a^2b^{n_2}ab^{n_4}a$, $ab^{n_2}a^2b^{n_4}a$ where $n_2+n_4 =4$ \item $l(w)=4$ iff $w$ is $ab^{n_2}ab^{n_4}$ or $a^{n_1}b a^{n_3}b$ or $w\in S$ where \[S=\big\{ a^{n_1}b^{n_2}a^{n_3}b^{n_4}| (n_2,n_4), (n_1,n_3) \in \{(3,1),(2,2),(1,3)\}\big\} \] \item $l(w)=3$ iff $w$ is of one of the following forms: \begin{itemize} \item $a^2 b^4 a^2$, $ab^{n_2}a$, $a^{n_1}ba^{n_3}$, $a^{n_1}b^2a^{n_3}$ \item $a b^{n_2} a^{n_3}, a^{n_1} b^{n_2} a $ where $n_2 \in \{ 3, 4\}$ and $ n_1, n_3 \geq 3$ \end{itemize} \end{enumerate} where $n_i\geq 1$. \end{theorem} \section{Conclusions} In this paper, we have characterized words whose block reversal contains only rich words. We have found necessary and sufficient conditions for a non-binary word such that all elements in its block reversal are rich. For a binary word, we have showed that the result varies with the length of the run sequence of the word and the structure of the word. In future, we would like to find an upper bound on the number of elements in the block reversal of the binary word. It would also be interesting to study other combinatorial properties such as counting primitive words, bordered and unbordered words in the block reversal set of a word. \bibliographystyle{splncs04.bst}
\section{Introduction} \subsection{Motivation} In the study of differentiable dynamical systems, a central problem is to understand most of the systems. From a topological viewpoint, this could mean to characterize an open and dense subset, or at least a residual subset, of all systems. It was once conjectured by Smale in the early 1960's that an open and dense subset of all systems should be comprised of uniformly hyperbolic ones. Recall that a dynamical system is {\em uniformly hyperbolic} if its limit set consists of finitely many transitive hyperblic sets and without cycles in between. The first counterexamples to this conjecture were given by Abraham and Smale \cite{AS} in the $C^1$ topology, and by Newhouse \cite{Ne,Ne2} in the $C^2$ topology. These examples give the following two obstructions to hyperbolicity: \begin{enumerate} \item {\em heterodimensional cycle}\,: there exist two hyperbolic periodic orbits of different indices such that the stable manifold of one periodic orbit intersects the unstable manifold of the other and vice versa; \item {\em homoclinic tangency}\,: there exists a hyperbolic periodic orbit whose stable and unstable manifolds have a nontransverse intersection. \end{enumerate} Bifurcations of these two mechanisms can exhibit very rich dynamical phenomena. For example, a heterodimensional cycle associated to a pair of periodic saddles with index $i$ and $j=i+1$ can be perturbed to obtain a {\em robust heterodimensional cycle} \cite{BD}: there exist transitive hyperbolic sets $\Lambda_1$ and $\Lambda_2$ with different indices such that the stable manifold of $\Lambda_1$ meets the unstable manifold of $\Lambda_2$ in a $C^1$ robust way, and vice versa. For more results, see e.g. \cite{PT,D,BDPR}. Trying to give a global view of all dynamical systems, Palis \cite{Pa90, Pa00, Pa05, Pa08} conjectured in the 1990’s that the uniformly hyperbolic systems and the systems with heterodimensional cycles or homoclinic tangencies form a dense subset of all diffeomorphisms. The Palis conjecture has been proved by Pujals and Sambarino \cite{PS} for $C^1$ diffeomorphisms on surfaces. Moreover, a weaker version, known as the weak Palis conjecture, was shown to hold for $C^1$ diffeomorphisms on any closed manifold \cite{BGW, C}. When it comes to flows, or vector fields, the Palis conjecture has to be recast so as to take into consideration the {\em singularities}. There have been many progresses on this topic, see e.g. \cite{ARH,GY,CY18}. Also, related conjectures have been given by Bonatti \cite{B} in his program for a global view of $C^1$ systems. The conjectures by Palis and Bonatti have lead to the study of systems away from homoclinic tangencies and/or heterodimensional cycles. In the $C^1$ topology, a diffeomorphism (or a vector field) is said to be {\em away from homoclinic tangencies} if every system in a $C^1$ neighborhood exhibits no homoclinic tangency. It is now well understood \cite{W02,Go} that for a diffeomorphism away from homoclinic tangencies there exist dominated splittings of the tangent bundle over preperiodic sets. More delicate results can be obtained in the $C^1$ generic setting, see e.g. \cite{CSY}. Also, it is known \cite{LVY} that every $C^1$ diffeomorphism away from homoclinic tangencies is entropy expansive, and it follows that there exists a measure of maximum entropy. When considering diffeomorphisms away from homoclinic tangencies {\em and} heterodimensional cycles, it is shown in \cite{CP} that a $C^1$ generic system is essentially hyperbolic. See also \cite{C2}. While there have been plenty of results on diffeomorphisms away from homoclinic tangencies (and heterodimensioinal cycles), parallel studies on vector fields are rare. Regarding the Palis conjecture, it is shown \cite{CY18} that on every 3-manifold the singular hyperbolic vector fields form a $C^1$ open and dense subset of all vector fields away from homoclinic tangencies. Also in dimension 3, the weak Palis conjecture has been proved for $C^1$ vector fields \cite{GY}. For higher dimensional (dim $\geq 3$) vector fields, studies are mostly limited to either the singular hyperbolic vector fields \cite{MPP} or the star vector fields, see e.g. \cite{SGW,PYY21,CY,dL,BdL}. General vector fields away from homoclinic tangencies (not star) on a higher dimensional manifold are rarely studied. In \cite{GYZ}, for general higher dimensional flows away from homoclinic tangencies, it is shown that $C^1$ generically a nontrivial Lyapunov stable chain recurrence class contains periodic orbits and hence is a homoclinic class. Their result leaves the possibility that the periodic orbits in the chain recurrence class can have different indices. When this happens robustly, such a chain recurrence class shall exhibit a robust heterodimensional cycle \cite{BD} and the flow can not be star. Apart from this result and possibly a handful others, the world of general higher dimensional vector fields away from homoclinic tangencies is far from being understood. Inspired by the result of \cite{GYZ}, we notice that there is no known example of a singular flow which is away from homoclinic tangencies and is not singular hyperbolic or star. The aim of this paper is to provide such an example, and to open a door to the world of general higher dimensional vector fields away from homoclinic tangencies. Hopefully it will also attract interests to the study of higher dimensional vector fields. As a by-product, our example exhibits an interesting property which is not observed before: the tangent bundle of the obtained chain recurrence class is shown to admit robustly an invariant subbundle (containing the flow direction), which is {\em properly} included in a subbundle of the finest dominated spitting of the tangent bundle. We shall call such an invariant subbundle {\em exceptional} (see Definition \ref{def.exceptional-bundle}). Note that there can not be any exceptional subbundle for diffeomorphisms away from homoclinic tangencies: robustness of an invariant subbundle implies a corresponding dominated spitting of the tangent bundle. Thus the existence of exceptional subbundles may be counted as an essential difference between diffeomorphisms and (singular) vector fields, and is worth studying. \subsection{Precise statement of our result} Let $M$ be a compact Riemannian manifold without boundary. Given a $C^1$ vector field on $M$, it generates a $C^1$ flow $\phi^X_t$, or simply $\phi_t$, on the manifold. A point $x\in M$ with $X(x)=0$ is called a {\em singularity} of $X$. Any point other than singularities is called a {\em regular} point. A regular point $x$ satisfying $\phi_T(x)=x$ for some $T>0$ is called a {\em periodic} point, and its orbit $\operatorname{Orb}(x)=\{\phi_t(x): t\in\RR\}$ will be called a {\em periodic orbit}. Singularities and periodic orbits are called {\em critical elements}. Let $\Lambda$ be a compact invariant set of the flow $\phi_t$. It is called {\em chain transitive} if for any two points $x,y\in\Lambda$ and any constant ${\varepsilon}>0$, there exist a sequence of points $x_0=x,x_1,\ldots,x_n=y$ in $\Lambda$ and a sequence of positive numbers $t_0, t_1,\ldots,t_{n-1}\geq 1$, such that $d(\phi_{t_i}(x_i),x_{i+1})<{\varepsilon}$ for all $i=0,1,\ldots,n-1$. If $\Lambda$ is {\em maximally chain transitive}, i.e. it is chain transitive and is not a proper subset of any other chain transitive set, then $\Lambda$ is called a {\em chain recurrence class}. The union of all chain recurrence classes is called the chain recurrent set, denoted by $\mathrm{CR}(X)$. For any point $x$ in $\mathrm{CR}(X)$, we denote by $C(x,X)$ the chain recurrence class containing $x$. Denote by $\Phi_t$ the tangent flow of $X$, i.e. $\Phi_t=D\phi_t$. A $\Phi_t$-invariant subbundle $E$ of $T_{\Lambda}M$ with $\operatorname{dim} E\geq 2$ is called {\em sectionally expanded} if there exists constants $C\geq 1$, $\lambda>0$ such that for any $x\in \Lambda$ and any 2-dimensional subspace $S\subset E(x)$, it holds \[|\det(\Phi_{-t}|_S)|\leq C\mathrm{e}^{-\lambda t}, \quad \forall t\geq 0.\] A $\Phi_t$-invariant splitting $E\oplus F\subset T_{\Lambda}M$ is called {\em dominated} if there exists $C\geq 1$, $\lambda>0$ such that for any $x\in \Lambda$, it holds \[\|\Phi_t|_{E(x)}\|\cdot\|\Phi_{-t}|_{F(\phi_t(x))}\|\leq C\mathrm{e}^{-\lambda t},\quad \forall t\geq 0.\] We also say that a $\Phi_t$-invariant splitting $E_1\oplus E_2\oplus\cdots\oplus E_k\subset T_{\Lambda}M$ is dominated if $(E_1\oplus\cdots\oplus E_i)\oplus (E_{i+1}\oplus\cdots\oplus E_k)$ is dominated for every $i=1,\ldots,k-1$. The {\em finest dominated splitting} of $T_{\Lambda}M$ is a $\Phi_t$-invariant splitting $T_{\Lambda}M=E_1\oplus E_2\oplus \cdots\oplus E_k$ such that it is dominated and no subbundle $E_i$ ($i=1,\ldots,k$) can be decomposed further into a dominated splitting. \begin{Definition}\label{def.exceptional-bundle} Let $\Lambda$ be a chain transitive compact invariant set of a $C^1$ vector field $X$, a subbundle $E\subset T_{\Lambda}M$ is called {\em exceptional} if it satisfies all the following properties: \begin{itemize} \item $\operatorname{dim} E\geq 2$, and $X(x)\in E(x)$ for any $x\in\Lambda$; \item $E$ is invariant for the tangent flow; \item $E$ is properly included in a subbundle of the finest dominated splitting of $T_{\Lambda}M$. \end{itemize} \end{Definition} In particular, if $E\subset T_{\Lambda}M$ is exceptional, it is not a subbundle of any dominated splitting of $T_{\Lambda}M$. Recall that a compact invariant set $\Lambda$ is called {\em Lyapunov stable} if for any neighborhood $U$ of $\Lambda$ there exists a neighborhood $V$ of $\Lambda$ such that $\overline{\phi_t(V)}\subset U$ for all $t\geq 0$. Let $\mathscr{X}^1(M)$ be the set of all $C^1$ vector fields on $M$, endowed with the $C^1$ topology. We denote by $\cH\cT$ the set of all $C^1$ vector fields on $M$ exhibiting a homoclinic tangency. Then $\mathscr{X}^1(M)\setminus\overline{\cH\cT}$ consists of all $C^1$ vector fields away from homoclinic tangencies. \begin{Theorem A} On every 4-dimensional closed Riemannian manifold $M$ there exists a non-empty open set $\cV\subset \mathscr{X}^1(M)\setminus\overline{\cH\cT}$ and an open set $U\subset M$ such that for any $X\in\cV$, one has $\phi^X_t(\overline{U})\subset U$ for any $t>0$, and \begin{itemize} \item there is a unique singularity $\sigma_X\in U$ and it is hyperbolic; \item $C(\sigma_X,X)$ is the unique Lyapunov stable chain recurrence class contained in $U$; \item $C(\sigma_X,X)$ contains a robust heterodimensional cycle; \item the tangent bundle $T_{C(\sigma_X,X)}M$ contains a 2-dimensional subbundle $E^X$ which is exceptional and sectionally expanded, and it varies upper semi-continuously with respect to $X$. \end{itemize} \end{Theorem A} \begin{Remark} Since a robust heterodimensional cycle yields non-hyperbolic periodic orbits by arbitrarily small $C^1$ perturbations, the chain recurrence class $C(\sigma_X,X)$ for any $X\in\cV$ is not singular hyperbolic or star. \end{Remark} \begin{Remark} In \cite{BLY}, a non-empty $C^1$ open set of vector fields having an attractor containing singularities of different indices is constructed on a given 4-manifold. Their example exhibits also a robust heterodimensional cycle, but is accumulated by vector fields with homoclinic tangencies. \end{Remark} \subsection{Idea of the construction} The example (in Theorem A) is derived from Lorenz attractor in the sense that the construction begins with the Lorenz attractor and uses a DA-type surgery. The Lorenz attractor, discovered by the meteorologist E. Lorenz in the early 1960's \cite{Lo}, is among the most important examples of singular flows. It is a chaotic attractor given by a simple group of three ordinary differential equations. We will consider the geometric model of the Lorenz attractor \cite{ABS1, GW}, which is equivalent to the original attractor for classical parameters \cite{T}. The DA surgery was introduced by Smale \cite{Sm67} as a way of constructing nontrivial basic sets, see also \cite{Wi}. It has been used to give many inspiring and important examples, especially in the study of partially hyperbolic systems, see e.g. \cite{Ma,BV}. In the following we give some ideas of the construction. We begin with a vector field $X^0$ on the 3-ball $B^3$ having a Lorenz attractor $\Lambda_0$. Then we consider a vector field $X(x,s)=(X^0(x),-\theta s)$ on the product $B^3\times [-1,1]$, where $(x,s)$ are coordinates on $B^3\times [-1,1]$ and $\theta>0$ is a constant. In particular, the dynamics is contracting along fibers. Note that $\Lambda=\Lambda_0\times\{0\}$ is an attractor and it contains a periodic orbit $P$. Now the idea is to modify the vector field $X$ in a neighborhood of the periodic orbit $P$ so that one obtains a robust heterodimensional cycle. For this purpose we combine a DA-type surgery with the construction of a blender \cite{BDV}. Roughly speaking, a blender is a hyperbolic set which verifies some specific geometric properties so that it unstable manifold looks like a manifold of higher dimension. It naturally appears in the unfolding of a heterodimensional cycle of two periodic orbits and can be used to obtain robust heterodimensional cycles. For this construction, we need to show that the obtained vector field is away from homoclinic tangencies. This requires a careful choice of the contraction rate $\theta$ along the fibers. Moreover, we need to show that the singularity and the heterodiemnsional cycle are contained in the same chain recurrence class. This constitutes the most difficult part of our proof. \subsection{Further discussions} For the example in Theorem A, we would like to raise the following questions. \begin{Question} Is the chain recurrence class $C(\sigma_Y,Y)$ (robustly) transitive? Or even isolated? \end{Question} Apart from topological properties, one can also studies ergodic properties of the example. In \cite{SYY} it is proved that the entropy function for singular flows away from homoclinic tangencies is upper semi-continuous with respect to both invariant measures and the flows, provided that the limiting measure is not supported on singularities. \begin{Question} Is the entropy function upper semi-continuous for the chain recurrence class $C(\sigma_Y,Y)$ in Theorem A? \end{Question} One may even consider existence of SRB measures or physical measures. However, let us mention one difficulty in the study of this example. In contrast to the Lorenz attractor or a singular hyperbolic attractor, the usual analysis of the return map to a global cross-section may not be applicable in our example. This is because the chain recurrence class in our example admits a partially hyperbolic splitting $E^s\oplus F$, where the 3-dimensional center-unstable subbundle $F$ contains an exceptional 2-dimensional subbundle and is not sectionally expanded. Apart from the present example, it may also be interesting to consider a DA-type surgery on the two-sided Lorenz attractor constructed by Barros, Bonatti and Pacifico \cite{BBP}. The rest of this paper is organized as follows. We present some preliminaries of flows in Section \ref{sect.preliminaries} and give the construction of the example in Section \ref{sect.construction}. The proof of Theorem A is also given in Section \ref{sect.construction}, assuming some robust properties that will be proved in subsequent sections: in Section \ref{sect.away-from-ht} we show that the example is away from homoclinic tangencies; then in Section \ref{sect.sectional-expanding} we show existence of an exceptional subbundle; finally in Section \ref{sect.ls} we show that the singularity and the heterdimensional cycle are contained in the same chain recurrence class. \section{Preliminaries}\label{sect.preliminaries} In this section we give some preliminaries on vector fields, including hyperboicity, linear Poincar\'e flow, fundamental limit, and so on. Let $M$ be a compact Riemannian manifold without boundary. Let $X$ be a $C^1$ vector field on $M$. Denoted by $\operatorname{Sing}(X)$ the set of singularities, i.e. $\operatorname{Sing}(X)=\{x\in M: X(x)=0\}$. For any point $x\in M$, we denote by $\langle X(x)\rangle$ the subspace of $T_xM$ that is generated by $X(x)$. Note that $\langle X(x)\rangle$ is a one-dimensional subspace of $T_xM$ when $x\not\in \operatorname{Sing}(X)$. To simplify notations, we also denote $l^X_x=\langle X(x)\rangle$ for $x\notin\operatorname{Sing}(X)$. \subsection{Hyperbolicity} Recall that the flow and the tangent flow generated by $X$ are denoted as $\phi_t$ and $\Phi_t$, respectively. Let $\Lambda$ be a compact $\phi_t$-invariant set and $E\subset T_{\Lambda}M$ a $\Phi_t$-invariant subbundle. The dynamics $\Phi_t|_E$ is {\em contracting}, or $E$ is {\em contracted}, if there exists constants $C\geq 1$, $\lambda >0$, such that \[\|\Phi_t|_{E(x)}\|\leq C\mathrm{e}^{-\lambda t},\quad \text{for any}\ x\in \Lambda, \ t\geq 0.\] One says that $\Phi_t|_E$ is {\em expanding} if $\Phi_{-t}|_E$ is contracting. The set $\Lambda$ is called {\em hyperbolic} if its tangent bundle admits a continuous splitting $T_{\Lambda}M=E^s\oplus\langle X\rangle\oplus E^u$, where $\langle X\rangle$ is the subbundle generated by the vector field $X$, and $E^s$ (resp. $E^u$) is contracted (resp. expanded). When $\Lambda$ is hyperbolic, for every $x\in\Lambda$, the sets \[W^{ss}(x)=\{y\in M: \mathrm{dist}(\phi_t(x), \phi_t(y))\to 0\ \text{as}\ t\to +\infty\}\] and \[W^{uu}(x)=\{y\in M: \mathrm{dist}(\phi_t(x), \phi_t(y))\to 0\ \text{as}\ t\to -\infty\}\] are invariant $C^1$ submanifolds tangent to $E^s(x)$ and $E^u(y)$ respectively at $x$, see \cite{HPS}. We denote $W^s(\operatorname{Orb}(x))=\bigcup_{z\in\operatorname{Orb}(x)}W^{ss}(z)$ and $W^u(\operatorname{Orb}(x))=\bigcup_{z\in\operatorname{Orb}(x)}W^{uu}(z)$, which are the stable and unstable manifolds of $\operatorname{Orb}(x)$ respectively. For a chain transitive hyperbolic set, all stable manifolds $W^{ss}(x)$ have the same dimension $\operatorname{dim} E^s$, which will be called the {\em stable index} of the hyperbolic set. Sometimes we simply say {\em index} with the same meaning of the stable index. Flows with singularities, or singular flows, can exhibit complex dynamics with regular orbits accumulating on singularities, such as the famous Lorenz attractor \cite{Lo,GW}. In such cases, the set $\Lambda$ can not be hyperbolic. Nevertheless, a weaker version of hyperbolicity can be defined. One says that $\Lambda$ is {\em partially hyperbolic} if there exists a $\Phi_t$-invariant splitting of the tangent bundle $T_{\Lambda}M=E^s\oplus E^{cu}$ such that $E^s$ is contracted and it is dominated by $E^{cu}$. If, moreover, the bundle $E^{cu}$ is sectionally expanded, then $\Lambda$ is said to be {\em singular hyperbolic} \cite{MPP}. Note that the partial hyperbolicity or singular hyperbolicity ensures also the existence of stable manifolds. We will study mainly chain recurrence classes. A chain recurrence class $C(x,X)$ is {\em nontrivial} if it is not reduced to a critical element. In \cite{PYY21}, it is shown that a nontrivial, Lyapunov stable, and singular hyperbolic chain recurrence class contains a periodic orbit, and $C^1$ generically, such a chain recurrence class is indeed an attractor. This result has been generalized to $C^1$ open and dense vector fields in \cite{CY}. \begin{Lemma}[\cite{CY}] There is an open and dense set $\cU \in \mathscr{X}^1(M)$ such that for any $X\in \cU$, any nontrivial, Lyapunov stable, and singular hyperbolic chain recurrence class $C(\sigma)$ of $X$ is a homoclinic class. Moreover, for any hyperbolic periodic orbit $\gamma\subset C(\sigma)$, there exists a neighborhood $U$ of $C(\sigma)$ and a neighborhood $\cU_X$ of $X$ such that for any $Y\in\cU_X$, the stable manifold $W^s(\gamma_Y,Y)$ is dense in $U$. \end{Lemma} \subsection{Linear Poincar\'e flow and its extension} Given a $\phi_t$-invariant set $\Lambda\subset M$. Define the normal bundle over $\Lambda$ as \[\cN_{\Lambda}=\bigcup_{x\in\Lambda\setminus\operatorname{Sing}(X)}\cN_x,\] where $\cN_x$ is the orthogonal complement of the one-dimensional subspace $l^X_x\subset T_xM$ generated by $X(x)$. In particular, if $\Lambda=M$, then $\cN_M=\bigcup\limits_{M\setminus \operatorname{Sing}(X)}\cN_x$. For any $x\in M\setminus\operatorname{Sing}(X)$, $v\in \cN_x$ and $t\in\RR$, let $\psi_t(v)$ to be the orthogonal projection of $\Phi_t(v)$ to $\cN_{\phi_t(x)}$. In this way one defines a flow $\psi_t=\psi^X_t$ on the normal bundle $\cN_M$, which is called the {\em linear Poincar\'e flow}. Note that the normal bundle is not defined at singularities. Hence the base of the normal bundle is non-compact for singular flows. We present below a compactification given by \cite{LGW}. Define the fiber bundle $G^1=\bigcup\limits_{x\in M}Gr(1,T_xM)$, where $Gr(1,T_xM)$ is the Grassmannian of lines in the tangent space $T_xM$ through the origin. Let $\beta:G^1\to M$ be the corresponding bundle projection that sends a line $l\in Gr(1,T_xM)$ to $x$. The tangent flow $\Phi_t$ induces a flow $\hat{\Phi}_t$ on $G^1$ defined by $\hat{\Phi}_t(\langle v\rangle)=\langle\Phi_t(v)\rangle$, where $v\in TM$ is a nonzero vector and $\langle v\rangle$ is the linear subspace spanned by $v$. Let $\xi: TM\to M$ be the bundle projection of the tangent bundle. One then defines a vector bundle with base $G^1$ as \[\beta^*(TM)=\{(l,v)\in G^1\times TM: \beta(l)=\xi(v)\}.\] The corresponding bundle projection $\iota$ sends every vector $(l,v)\in\beta^*(TM)$ to $l$. The tangent flow induces also a flow $\tilde{\Phi}_t$ on $\beta^*(TM)$: \[\tilde{\Phi}_t(l,v)=(\hat{\Phi}_t(l),\Phi_t(v)),\quad \forall (l,v)\in\beta^*(TM).\] The flow $\tilde{\Phi}_t$ will be called the {\em extended tangent flow}. For any $l\in G^1$ such that $\beta(l)=x$, there is a natural identification between $T_xM$ and $\{l\}\times T_xM$. Thus we define the {\em extended normal bundle} as \[\widetilde{\cN}=\{(l,v)\in \beta^*(TM): v\perp l\}.\] We also define the extended normal bundle over any nonempty subset $\Delta\subset G^1$: \[\widetilde{\cN}_{\Delta}=\{(l,v)\in\iota^{-1}(\Delta): v\perp l\}.\] Finally, we define the {\em extended linear Poincar\'e flow} $\tilde{\psi}_t$ on $\widetilde{\cN}$ as follows: \[\tilde{\psi}_t(l,v)=\tilde{\Phi}_t(l,v)-\langle \Phi_t(u),\Phi_t(v)\rangle\cdot\tilde{\Phi}_t(l,u),\] where $u\in l$ is a unit vector, and $\langle \cdot,\cdot\rangle$ stands for the inner product on the tangent bundle. \begin{Remark}\label{rem.normal-bundle} For any $x\notin\operatorname{Sing}(X)$, let $l=l^X_x$, then $\widetilde{\cN}_l$ can be naturally identified with $\cN_x$ and $\tilde{\psi}_t|_{\widetilde{\cN}_l}$ can be naturally identified with $\psi_t|_{\cN_x}$. \end{Remark} We will also consider invariant measures on $G^1$. Let $\mu$ be any Borel measure on $G^1$, the bundle projection $\beta:G^1\to M$ induces a measure $\beta_*\mu$ on $M$ such that $(\beta_*\mu)(A)=\mu(\beta^{-1}(A))$ for any Borel set $A\subset M$. When $\mu$ is $\hat{\Phi}_t$-invariant, the induced measure $\beta_*\mu$ is $\phi_t$-invariant. \subsection{Fundamental limit and dominated splitting} Given a chain recurrent set $\Gamma$ of the vector field $X$. Let $X_n$ be a sequence of $C^1$ vector fields such that $X_n\to X$ in the $C^1$ topology. Suppose there exists a periodic orbit $\gamma_n$ of $X_n$ such that $\gamma_n$ converges to a compact subset of $\Gamma$ in the Hausdorff topology, then the sequence of pairs $(\gamma_n, X_n)$ is called a {\em fundamental sequence} of $\Gamma$, and will be denoted as $(\gamma_n,X_n)\hookrightarrow (\Gamma,X)$. The sequence $(\gamma_n,X_n)$ is called an {\em $i$-fundamental sequence} if $\operatorname{Ind}(\gamma_n)=i$ for all $n$ large enough. When there is no possible ambiguity, we will simply say that $\gamma_n$ is a fundamental sequence of $\Gamma$. We denote by $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Gamma)$ the limit of directions of all fundamental sequences of $\Gamma$, {\it i.e.} \[\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Gamma)=\{l\in G^1: \exists (\gamma_n,X_n)\hookrightarrow (\Gamma,X),\ p_n\in \gamma_n, \ \text{such that}\ l^{X_n}_{p_n} \to l\}.\] As an immediate consequence of the definition, the map $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\cdot)$ is upper semi-continuous in the following sense. \begin{Lemma}\label{lem.semi-cont} Suppose $\Gamma$ is a chain transitive set of $X$. Then for any neighborhood $\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}$ of $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Gamma)$ in $G^1$, there exist a neighborhood $U$ of $\Gamma$ and $C^1$ neighborhood $\cU$ of $X$ such that for any $Y\in\cU$ and any chain transitive set $\Gamma_Y$ of $Y$ contained in $U$, it holds $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Gamma_Y)\subset \mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}$. \end{Lemma} We also denote by $B(\Gamma)$ the limit set of directions of regular points contained in $\Gamma$, {\it i.e.} \[B(\Gamma)=\{l\in G^1: \exists x_n\in \Gamma\setminus\operatorname{Sing}(X), \ \text{such that}\ l^X_{x_n} \to l\}.\] Note that for any $l\in\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Gamma)$, if $x=\beta(l)$ is a regular point, then $l=l^X_x$. This also holds for $B(\Gamma)$. Thus $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Gamma)\setminus B(\Gamma)$ is contained in the tangent spaces of singularities. A hyperbolic singularity $\rho$ is called {\em Lorenz-like} if there is a partially hyperbolic splitting of the tangent bundle $T_{\rho}M=E^{ss}_{\rho}\oplus E^{cu}_{\rho}$ such that $E^{cu}_{\rho}$ is sectionally expanded and it decomposes further into a dominated spitting $E^c_{\rho}\oplus E^u_{\rho}$ with $\operatorname{dim} E^c_{\rho}=1$ and $\Phi_t|_{E^c_{\rho}}$ is contracting. For a Lorenz-like singularity $\rho$, denote by $W^{ss}(\rho)$ its strong stable manifold tangent to $E^{ss}_{\rho}$ at the singularity. \begin{Lemma}\label{lem.loren-like-singularity} Let $C(\rho,X)$ be a chain recurrence class of $X$ containing a Lorenz-like singularity $\rho$ such that $C(\rho,X)\cap(W^{ss}(\rho)\setminus\{\rho\})=\emptyset$. Then there exists a $C^1$ neighborhood $\cU$ of $X$ such that for any $Y\in\cU$, it holds $C(\rho_Y,Y)\cap (W^{ss}(\rho_Y,Y)\setminus\{\rho_Y\})=\emptyset$ and $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(C(\rho_Y,Y))\cap T_{\rho_Y}M\subset E^{cu}_{\rho_Y}$.\footnote{Here, to simplify notations, we have identified $T_{\rho_Y}M$ with $Gr(1,T_{\rho_Y}M)$, and $E^{cu}_{\rho_Y}$ with $Gr(1,E^{cu}_{\rho_Y})$. We hope that such abuses of notations shall not cause much confusion.} \end{Lemma} \begin{proof} Note that the properties defining a Lorenz-like singularity is $C^1$ robust. Since the singularity $\rho$ is Lorenz-like, there is a $C^1$ neighborhood $\cU$ of $X$ such that for any $Y\in\cU$, the continuation $\rho_Y$ is also Lorenz-like. Moreover, by the upper semi-continuity of chain recurrence class and the continuity of local strong stable manifolds, one deduces that $C(\rho_Y,Y)\cap (W^{ss}(\rho_Y,Y)\setminus\{\rho_Y\})=\emptyset$ for any $Y\in \cU$ (shrinking $\cU$ if necessary). Then, a similar argument as in the proof of [LGW, Lemma 4.4] gives $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(C(\rho_Y,Y))\cap T_{\rho_Y}M\subset E^{cu}_{\rho_Y}$. \end{proof} A fundamental sequence $(\gamma_n,X_n)$ of $\Gamma$ is said to {\em admit an index $i$ dominated splitting} if there exist a $\psi^{X_n}_t$-invariant splitting $\cN_{\gamma_n}=\cN_n^{cs}\oplus \cN_n^{cu}$ ($n\in\mathbb{N}$) of the normal bundle and constants $T>0$, $n_0>0$ such that for any $t>T$ and $n>n_0$, it holds $\operatorname{dim} \cN_n^{cs}=i$ and \[\|\psi^{X_n}_t|_{\cN_n^{cs}(x)}\|\cdot\|\psi^{X_n}_{-t}|_{\cN_n^{cu}(\phi^{X_n}_t(x))}\|<1/2.\] Identifying the extended normal bundle $\widetilde{\cN}_{B(\gamma_n)}$ with $\cN_{\gamma_n}$ (see Remark \ref{rem.normal-bundle}), we see that $\widetilde{\cN}_{B(\gamma_n)}$ also admits a dominated splitting with respect to $\tilde{\psi}_t^{X_n}$ and of the same index. Thus, the following lemma is a consequence of continuity of domination. \begin{Lemma}\label{lem.dom-equivalence} $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Gamma)$ admits a dominated splitting of index $i$ with respect to $\tilde{\psi}^X_t$ if and only if every fundamental sequence of $\Gamma$ admits an index $i$ dominated splitting (with the same domination constant $T$). \end{Lemma} \section{The example: construction and robust properties}\label{sect.construction} In this section we construct the example and claim some key properties of the example. With these properties, a proof of Theorem A is given at the end of this section. \subsection{The Lorenz attractor}\label{sect.lorenz} Let us begin with the geometric model of the Lorenz attractor, see e.g. \cite{GH,GW,BDV}. Let $(x_1,x_2,x_3)$ be a Cartesian coordinate system in $\RR^3$. Let $B^3$ be a ball in $\mathbb{R}^3$ centered at the origin $O=(0,0,0)$. We shall consider a $C^1$ vector field $X^0$ on $\RR^3$ such that it is transverse to the boundary of $B^3$ and that the ball $B^3$ is an attracting region, i.e. $\phi_t^{X^0}(x)\in B^3$ for any $x\in B^3$ and $t>0$. Moreover, the following properties are assumed (see \cite[Section 3]{AP}): \begin{enumerate}[label=(P\arabic*)] \item (Lorenz-like singularity) The origin $O$ is a hyperbolic singularity of stable index 2 such that its local stable manifold $W^s_{loc}(O)$ coincides with the $x_1x_3$-plane, and its local unstable manifold $W^u_{loc}(O)$ coincides with the $x_2$-axis. Moreover, the two-dimensional stable subspace $E^s_O$ decomposes into a dominated splitting $E^s_O=E^{ss}_O\oplus E^{c}_O$. Assume that the local strong stable manifold (tangent to $E^{ss}_O$) coincides with the $x_1$-axis. The three Lyapunov exponents at the singularity are \[\lambda^s=\log\|D\Phi^{X^0}_1|_{E^{ss}_O}\|,\quad \lambda^c=\log\|D\Phi^{X^0}_1|_{E^{c}_O}\|,\quad \text{and}\ \lambda^u=\log\|D\Phi^{X^0}_1|_{E^{u}_O}\|.\] Here, $E^u_O$ is the unstable subspace of $O$. One has $\lambda^s<\lambda^c<0<\lambda^u$. We assume that $\lambda^c+\lambda^u>0$, which implies sectional expanding property of the subspace $E^{cu}_O=E^{c}_O\oplus E^u_O$. \item (Cross-section and the first return map) The square $\Sigma_0=\{(x_1,x_2,1): -1\leq x_1,x_2\leq 1\}$ is a cross-section of the flow $\phi^{X^0}_t$, meaning that the vector field at every point of $\Sigma_0$ is transverse to $\Sigma_0$. For simplicity, we assume that the vector field is {\em orthogonal} to $\Sigma_0$ and $\|X^0(x)\|=1$ for any $x\in\Sigma_0$. The cross-section $\Sigma_0$ intersects $W^s_{loc}(O)$ at a line segment $L_0=\{(x_1,0,1): -1\leq x_1\leq 1\}$, which cuts $\Sigma_0$ into a left part $\Sigma_0^-$ and a right part $\Sigma_0^+$, $\Sigma_0\setminus L_0=\Sigma_0^-\cup \Sigma_0^+$. There is a first return map $R_0: \Sigma_0\setminus L_0\to \Sigma_0$ such that the images $R_0(\Sigma_0^-)$ and $R_0(\Sigma_0^+)$ are each a square pinched at one end and contained in the interior of $\Sigma_0$, as shown in Figure \ref{fig.1}. Let us assume that for any $x\in \Sigma_0\setminus L_0$, the time $t_x>0$ satisfying $\phi^X_{t_x}(x)=R_0(x)$ for its first return is at least 2, i.e. $t_x>2$. \begin{figure}[htbp] \centering \includegraphics[width=.5\textwidth]{lorenz-attractor} \caption{The Lorenz attractor }\label{fig.1} \end{figure} \item (Cone field on the cross-section) For each $\alpha>0$, there is a cone $C_{\alpha}(x)$ at the point $x=(0,0,1)$: \[C_{\alpha}(x)=\{(x_1,x_2)\in T_{x}\Sigma_0 : \|x_1\|\leq \alpha\|x_2\|\}.\] Here, we have identified $T_x\Sigma_0$ with $\Sigma_0$ and use the same coordinates $x_1,x_2$. By translating $C_{\alpha}(x)$ to every other point on $\Sigma_0$, one defines a cone field $C_{\alpha}$ on $\Sigma_0$. We assume that $R_0$ preserves the cone $C_{\alpha}$ with $\alpha=1$. More precisely, for any $x\in \Sigma_0\setminus L_0$ and any vector $u\in C_1(x)$, we assume $DR_0(u)\in C_{1/2}(R_0(x))$. \item (The attractor) Let $\Lambda_0={\rm Cl}(\phi^{X^0}_{t\in\mathbb{R}}(\Lambda_{\Sigma_0}))$, where $\Lambda_{\Sigma_0}=\cap_{n\geq 0}\overline{R_0}^n(\Sigma_0)$ and $\overline{R_0}^n(\Sigma_0)$ is the closure of $n$-th return of $\Sigma_0$, ignoring $L_0$ for each return. Then $\Lambda_0$ contains $O$ and is the unique attractor in $B^3$, with an attracting neighborhood $U_{\Lambda_0}\subset B^3$ that contains $\Sigma_0$. \item (Singular hyperbolicity) The attractor $\Lambda_0$ admits a singular hyperbolic splitting $T_{\Lambda_0}\RR^3=E^{ss}\oplus E^{cu}$, where $E^{ss}$ is uniform contracted and $E^{cu}$ is sectionally expanded. Precisely, we assume that for any two dimensional subspace $S\subset E^{cu}_x$, $x\in\Lambda_0$, it holds \begin{equation}\label{eq.sect-exp} \left|\det(\Phi^{X^0}_t|_S)\right|>e^{\gamma t},\quad \forall t\geq 1, \end{equation} where $\gamma>0$ is a constant. The constant $\gamma$ will be assumed to be large so that the inequality \eqref{eq.sect-exp} implies expanding property for the first return map $R_0$: there exists $\rho>1$ such that for any $x\in \Lambda_0\cap(\Sigma_0\setminus L_0)$, $v\in E^{cu}_x\cap (T_x\Sigma_0\setminus\{0\})$, it holds \[\|DR_0(v)\|>\rho\|v\|.\] As the flow direction $X^0$ is invariant and can not be uniformly contracted, it is contained in the subbundle $E^{cu}$, i.e. ${X^0}(x)\in E^{cu}_x$ for every $x\in\Lambda_0\setminus\operatorname{Sing}(X)$ (see \cite[Lemma 3.4]{BGY}). At the singularity $O$, we have $E^{cu}_O=E^{c}_O\oplus E^u_O$. Define \[\lambda^s_0=\log\|D\Phi^{X^0}_1|_{E^{ss}_{\Lambda_0}}\|.\] Note that $\lambda^s\leq \lambda^s_0$. We assume $\lambda^s_0<\lambda^c$. \item (Stable foliation) The stable foliation $\cW^s(\Lambda_0)=\{W^s(\operatorname{Orb}(x)): x\in \Lambda_0\}$ is $C^1$ (see \cite{AM}), which induces a $C^1$ foliation $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}^s$ on $\Sigma_0$ such that for any $x\in \Sigma_0$, $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}^s(x)$ is transverse to $C_1(x)$. Since $L_0$ is the intersection of $W^s_{loc}(O)$ with $\Sigma_0$, it is a leaf of $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}^s$. \item (Transitivity) The attractor $\Lambda_0$ is a homoclinic class (see \cite{Ba}), so that $\Lambda_0$ is transitive and there is a periodic orbit $Q_0\subset \Lambda_0$ whose stable manifold is dense in $U_{\Lambda_0}$. \end{enumerate} \subsection{The skew product construction}\label{sect.skew-product} Let $\Omega=B^3\times I$, where $I=[-1,1]$. Let $x$, $s$ be the coordinates on $B^3$ and $I$, respectively. Define on $\Omega$ the vector field $\hat{X}(x,s)=(X^0(x),-\theta s)$, where $\theta>0$ is a constant. As the fiber direction (along $I$) is uniformly contracting, there exists a unique attractor $\Lambda=\Lambda_0\times\{0\}$, which is a trivial construction of the Lorenz attractor in dimension 4. All properties of the 3-dimensional attractor $\Lambda_0$ can be easily generalized to $\Lambda$. We now modify the vector field $\hat{X}$ along fibers to obtain a vector field $X$ so that $\Lambda$ remains an attractor but not singular hyperbolic. This is why we say the example is derived from the Lorenz attractor. The modification will be done in a small neighborhood of a periodic orbit in $\Lambda$. Let $P_0\subset \Lambda_0$ be a periodic orbit of $X^0$ other than $Q_0$ such that it is homoclinically related to $Q_0$. Let $P=P_0\times\{0\}$ and $Q=Q_0\times \{0\}$. Consider a small neighborhood $V_P$ of $P$ contained in $U_{\Lambda_0}\times(-1,1)$ such that $\overline{V_P}\cap (Q\cup\{\sigma\})=\emptyset$, where $\sigma=(O,0)$. Let $\eta$ be a $C^{\infty}$ function on $M_0$ that satisfies the following conditions: \begin{itemize} \item $0\leq \eta(x,s)\leq 1$, for all $(x,s)\in \Omega$; \item $\eta$ is supported on $V_P$, i.e. $\eta(x,s)=0$ for any $(x,s)\not\in V_P$; \item $\eta(x,s)=1$ if and only if $(x,s)\in P$. \end{itemize} The vector field $X$ on $\Omega$ is defined as the following: \begin{equation}\label{eq.vector-field} X(x,s)=(X^0(x), -\theta s(1-\eta(x,s))). \end{equation} Observe that the dynamics of the vector field is contracting along the fibers, except only for $P$ where it is neutral. Also, $U_{\Lambda}=U_{\Lambda_0}\times (-1,1)$ is an attracting region of $X$ and the maximal invariant set $\Lambda=\Lambda_0\times\{0\}$ in $U_{\Lambda}$ is an attractor. The attractor contains a unique singularity $\sigma=(O,0)$. The tangent space at $\sigma$ admits a $\Phi^X_t$-invariant splitting $T_{\sigma}\Omega=T_{\sigma}B^3\oplus \RR^I$, in which we identify $B^3$ with $B^3\times\{0\}$ and $\RR^I$ is the subspace corresponding to fiber. Thus, the Lyapunov exponents of $\sigma$ are $\lambda^s, \lambda^c, \lambda^u$ and $-\theta$. Note that $-\theta$ is the Lyapunov exponent of the singularity along the fiber direction. We assume further that \begin{equation}\label{eq.eigenvalues} \lambda_0^s<-\theta<\lambda^c. \end{equation} This implies in particular that there is a dominated splitting of the stable subspace $E^s_{\sigma}=E^{ss}\oplus\RR^I\oplus E^{cs}$. The following properties can be easily verified: \begin{enumerate}[label=(C\arabic*)] \item The cube $\Sigma=\Sigma_0\times I$ is a cross section of the flow $\phi^X_t$. The local stable manifold of $\sigma$ cuts $\Sigma$ along a two-dimensional disk $L=L_0\times I$. So $\Sigma\setminus L$ consists of a left part $\Sigma^-=\Sigma_0^-\times I$ and a right part $\Sigma^+=\Sigma_0^+\times I$. Let $R:\Sigma\setminus L\to \Sigma$ be the first return map. Then $R(\Sigma^-)$ is a cube pinched at one end and contained in the interior of $\Sigma$, and similarly for $R(\Sigma^+)$. For any $p\in \Sigma\setminus L$, let $t_p>0$ be the smallest time that $\phi^X_{t_p}(p)=R(p)$. By assumption on $R_0$, we have $t_p>2$ for any $p\in \Sigma\setminus L$. \item $Q$ is a hyperbolic periodic orbit contained in $\Lambda$ with stable index 2. The stable manifold $W^s(Q,X)$ is dense in $U_{\Lambda}$. This follows from the fact that the stable manifold of the periodic orbit $Q_0$ is dense in $U_{\Lambda_0}$ and that the tangent flow along the fibers is topologically contracting. Moreover, $W^s(Q,X)$ intersects $\Sigma$ along a dense family of 2-dimensional $C^1$ disks, which are leaves of the foliation $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}^s\times I$. Here, $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}^s$ is the foliation on $\Sigma_0$ as in (P6). \item $P\subset \Lambda$ is a non-hyperbolic periodic orbit of $X$: it has a zero exponent along the fiber direction. Nonetheless, $P$ has a 3-dimensional topologically stable manifold and its strong stable manifold $W^{ss}(P,X)$ (2-dimensional) has nonempty intersection with the unstable manifold of $Q$. Also, its unstable manifold has a transverse intersection with the stable manifold of $Q$. \end{enumerate} \subsection{Robust properties of the example} As a first result, we show that $\Lambda$ admits a partially hyperbolic splitting. \begin{Lemma}\label{lem.ph-splitting} There exists a partially hyperbolic splitting $T_{\Lambda}\Omega=E^{ss}\oplus F$ for the tangent flow with $\operatorname{dim} E^{ss}=1$. \end{Lemma} \begin{proof} Since $T_{\Lambda}\Omega=T_{\Lambda_0}B^3\oplus \RR^I$ and $T_{\Lambda_0}B^3$ admits a partially hyperbolic splitting $E^{ss}\oplus E^{cu}$, one obtains an invariant splitting $T_{\Lambda}\Omega=E^{ss}\oplus F$, where $F=E^{cu}\oplus \RR^I$. Since $E^{ss}$ is already dominated by $E^{cu}$, equation \eqref{eq.eigenvalues} implies that $E^{ss}$ is dominated by $F$. Moreover, $\Phi^X_t|_{E^{ss}}$ is contracting as it can be identified with $\Phi^{X_0}_t|_{E^{ss}}$. Hence $T_{\Lambda}\Omega=E^{ss}\oplus F$ is a partially hyperbolic splitting. \end{proof} Note that the splitting $F=E^{cu}\oplus \RR^I$ is invariant but not dominated. This is because the bundle $\RR^I$ is neutral on the periodic orbit $P=P_0\times\{0\}$ and cannot be dominated by the bundle $E^{cu}$ which contains the flow direction, and vice versa. Also, $F$ is not sectionally expanded. Hence $\Lambda$ is not singular hyperbolic. Nonetheless, the invariance of the splitting $T_{\Lambda}\Omega=E^{ss}\oplus E^{cu}\oplus \RR^I$ suggests also an invariant splitting of the extended normal bundle with one-dimensional subbundles. \begin{Proposition}\label{prop.away-tangencies} The extended normal bundle $\widetilde{\cN}_{\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)}$ admits a dominated splitting $\cN^{ss}\oplus\cN^I\oplus\cN_2$ with one-dimensional subbundles. Consequently, $X|_{\Lambda}$ is $C^1$ locally away from homoclinic tangencies. \end{Proposition} Here, a chain recurrence class is called {\em locally away from homoclinic tangencies} if there exists a neighborhood $U$ of the class and a $C^1$ neighborhood $\cU$ of $X$ such that any $Y\in\cU$ admits no homoclinic tangency in $U$. Also, the sectionally expanding subbundle $E^{cu}$ in the splitting $T_{\Lambda}\Omega=E^{ss}\oplus E^{cu}\oplus \RR^I$ will be shown to exist robustly in the following sense. \begin{Proposition}\label{prop.sect-exp} There exist a neighborhood $U\subset U_{\Lambda}$ of $\Lambda$ and a neighborhood $\cU$ of $X$ such that for any $Y\in \cU$ and any chain recurrence class $C_Y\subset U$, there is a continuous 2-dimensional subbundle $E^Y$ of $T_{C_Y}\Omega$ containing the flow direction such that it is invariant for $\Phi^Y_t$ and sectionally expanded. Moreover, if $C_Y=C(\sigma_Y,Y)$ is the chain recurrence class containing $\sigma_Y$, then $E^Y$ varies upper semi-continuously with respect to $Y\in\cU$. \end{Proposition} The proof of Proposition \ref{prop.away-tangencies} and Proposition \ref{prop.sect-exp} will be given in Section \ref{sect.away-from-ht} and Section \ref{sect.sectional-expanding}, respectively. By construction, the chain recurrence class $\Lambda$ is an attractor containing the unique singularity $\sigma=(O,0)$. We will show that for any $C^1$ vector field $Y$ close enough to $X$, the chain recurrence class $C(\sigma_Y,Y)$ is nontrivial and Lyapunov stable. Moreover, it is the only Lyapunov stable chain recurrence class in $U_{\Lambda}$, where $\sigma_Y$ is the continuation of the singularity. Precisely, we have \begin{Proposition}\label{prop.ls-class} There exists a $C^1$ neighborhood $\cU$ of $X$ such that for any $Y\in \cU$, the chain recurrence class $C(\sigma_{Y},Y)$ is the unique Lyapunov stable chain recurrence contained in $U_{\Lambda}$. Moreover, $C(\sigma_{Y},Y)$ contains the periodic orbit $Q_Y$, which is the continuation of $Q$. \end{Proposition} The proof of Proposition \ref{prop.ls-class} will be given in Section \ref{sect.ls}. \subsection{Robust heterodimensional cycles}\label{sect:robust-cycles} Let us continue the construction of the example. We will prove the following result. \begin{Lemma}\label{lem.hc} In every $C^1$ neighborhood of $X$ there is an open subset $\cV$ of vector fields such that for each $Y\in\cV$ the chain recurrence class $C(\sigma_{Y},Y)$ contains a robust heterodimensional cycle. \end{Lemma} \begin{Remark} By the lemma, the vector field $X$ can be $C^1$ approximated by vector fields with robust heterodimensional cycles. Also, it follows from the construction that $X$ can be $C^1$ approximated by vector fields with singular hyperbolic attractors. Therefore, $X$ is on the boundary between singular hyperbolicity and robust heterodimensional cycles. \end{Remark} The proof of Lemma \ref{lem.hc} is essentially contained in \cite[Section 4]{BD}. We say that a periodic orbit is a {\em saddle-node} if its normal bundle has an (orientable) one-dimensional center along which the Lyapunov exponent is zero, and all other Lyapunov exponents are nonzero. For the vector field $X$, the periodic orbit $P$ is a saddle-node with a one-dimensional center in the fiber direction, along which the Lyapunov exponent is zero. The saddle-node $P$ has a strong stable manifold $W^{ss}(P,X)$ contained in $B^3\times\{0\}$ (as in the 3-dimensional Lorenz attractor). Also its unstable manifold $W^u(P,X)$ is contained in $B^3\times\{0\}$. The saddle-node $P$ has a {\em strong homoclinic intersection}: there exists $r\notin P$ which belongs to the intersection $W^{ss}(P,X)\cap W^u(P,X)$. Moreover, the intersection is {\em quasi-transverse}: $\operatorname{dim} (T_rW^{ss}(P,X)\oplus T_rW^u(P,X))=3<\operatorname{dim} \Omega=4$. \begin{Lemma}[{\cite[Theorem 4.1]{BD}}]\label{lem.robust-cycles} Let $X$ be a $C^1$ vector field with a quasi-transverse strong homoclinic intersection associated to a saddle-node. Then in every $C^1$ neighborhood of $X$ there is an open set of vector fields exhibiting robust heterodimensional cycles. \end{Lemma} It follows from the discussions above and Lemma \ref{lem.robust-cycles} that there exists vector field $Y$ arbitrarily close to $X$ which exhibits a robust heterodimensional cycle. Thus, to prove Lemma \ref{lem.hc}, it remains to show that the robust heterodimensional cycle is contained in $C(\sigma_{Y},Y)$. For this, we need to slightly change the proof of Lemma \ref{lem.robust-cycles} ({\cite[Section 4]{BD}}), in which a key ingredient is the creation of robust heterodimensional cycles through {\em blenders}. Roughly speaking, a blender is a hyperbolic set whose stable (or unstable) set behaves as if it is one dimensional higher than it actually is. One can refer to \cite[Chapter 6]{BDV} for more discussions on blenders. \begin{proof}[Proof of Lemma \ref{lem.hc}] We have seen that the periodic orbit $P$ is a saddle-node associated to which there is a quasi-transverse strong homoclinic intersection. In fact, we can take two quasi-transverse strong homoclinic intersections $z$ and $w$ associated to $P$ such that their orbits are disjoint. Following the proof of Lemma \ref{lem.robust-cycles} (\cite[Section 4]{BD}), one can make arbitrarily small $C^1$ perturbations in a neighborhood of ${\rm Cl}(\operatorname{Orb}(z,X)\cup\operatorname{Orb}(w,X))$ (containing $P$) to obtain a vector field $Y$ having a blender $\Lambda'$, together with a hyperbolic periodic orbit $P_{\delta}$ close to $P_Y=P$ such that: \begin{itemize} \item the blender $\Lambda'$ is a hyperbolic set of stable index $1$ containing the periodic orbit $P_Y$; \item the periodic orbit $P_{\delta}$ has stable index $2$, and its stable manifold intersect transversely the unstable manifold of $P_Y$; \item the unstable manifold of $P_{\delta}$ meets robustly the stable set of the blender $\Lambda'$ (by the property of the blender); \item thus, the vector field $Y$ has a robust heterodimensional cycle associated with the hyperbolic set $\Lambda'\supset P_Y$ and the hyperbolic saddle $P_{\delta}$. \end{itemize} We can assume that $Y$ is close enough to $X$ so that by Proposition \ref{prop.ls-class}, $C(\sigma_Y,Y)$ robustly contains the periodic orbit $Q_Y$. Thus, to guarantee that $C(\sigma_Y,Y)$ contains the robust heterodimensional cycle, we make sure that $Q_Y$ and $P_Y$ are robustly contained in the same chain recurrence class. A slightly different procedure should be followed when making the perturbations to obtain the robust heterodimensional cycle. Note that $W^s(Q,X)$ intersects $W^u(P,X)$ transversely. As $Y$ is $C^1$ close to $X$, we can assume that $W^s(Q_Y,Y)$ and $W^u(P_Y,Y)$ intersects robustly. Now if $W^u(Q_Y,Y)\pitchfork W^s(P_{\delta},Y)\neq\emptyset$, the Inclination Lemma would imply that $W^u(Q_Y,Y)$ accumulates on $W^u(P_{\delta},Y)$ and hence meets transversely the characteristic region of the blender $\Lambda'$. By the property of blender and since $W^s(Q_Y,Y)$ intersects $W^u(P_Y,Y)$ robustly, we would obtain that $Q_Y$ and $P_Y$ are robustly contained in the same chain recurrence class. \begin{figure}[htbp] \centering \subcaptionbox{Blow up to twins}{ \includegraphics[width=0.21\linewidth]{hc1} } \qquad \subcaptionbox{Blow up to triplets}{ \includegraphics[width=0.2\linewidth]{hc2} } \caption{DA-type surgery at the saddle-node $P$}\label{fig.2} \end{figure} Therefore, when perturbing to obtained the periodic orbit $P_{\delta}$ we need to make sure that $W^u(Q_Y,Y)\pitchfork W^s(P_{\delta},Y)\neq\emptyset$. Recall that in \cite[Section 4]{BD}, $P_{\delta}$ is obtained as a twin of $P$ by blowing up the saddle-node $P$ along the neutral center, as shown in Figure \ref{fig.2}(a). In stead of obtaining only a twin $P_{\delta}$, we blow up the saddle-node to obtain a set of triplet saddles, $P$, $P_{\delta}$ and $P_{-\delta}$, as shown in Figure \ref{fig.2}(b). See also \cite{Ma} for a similar construction. The saddles $P_{\delta}$ and $P_{-\delta}$ are both of index 2, while $P$ has index 1. Note that for the vector $X$, there is a quasi-transverse intersection between $W^u(Q,X)$ and $W^{ss}(P,X)$. After the blow-up, we can assume without loss of generality that $W^u(Q_Y,Y)\pitchfork W^s(P_{\delta},Y)\neq\emptyset$. Then the construction continues as in \cite[Section 4]{BD}. This ends the proof of Lemma \ref{lem.hc}. \end{proof} \subsection{Proof of Theorem A} Let $M$ be any 4-dimensional closed Riemannian manifold. One considers a gradient-like vector field $Z_0$ on $M$, which has at least a sink. Consider a local chart around a sink and a ball $B^4$ in the chart, centered at the sink. By shrinking the local chart, we assume that the ball $B^4$ is an attracting region of the flow. In particular, the vector field $Z_0$ is transverse to $\partial B^4$ and inwardly pointing. By changing the metric, we assume that $\frac{1}{2}B^4$ contains $\Omega=B^3\times [-1,1]$. Let $X$ be a vector field on $\Omega$ as constructed in Section \ref{sect.lorenz} and Section \ref{sect.skew-product}. One then modifies the vector field $Z_0$ in a neighborhood of $\frac{1}{2}B^4$ to obtain a $C^1$ vector field $Z$ such that it coincides with $X$ on $\Omega\subset\frac{1}{2}B^4$. The modification shall be taken outside a neighborhood of $M\setminus B^4$, thus $Z$ coincides with $Z_0$ in a neighborhood of $M\setminus B^4$. Moreover, since the vector field on $\Omega$ is transverse to each smooth component of $\partial \Omega$ and inwardly pointing, one can require that the obtained vector field $Z$ has no recurrence in $B^4\setminus \Omega$. Then the chain recurrence set of $Z$ is composed of finitely many hyperbolic critical elements and the maximal invariant set in $\Omega$. The following properties can be verified. \begin{enumerate}[label=(\arabic*)] \item There is nontrivial chain recurrence class $C(\sigma,Z)$ associated to a hyperbolic singularity $\sigma\in\Omega$. \item There exist a neighborhood $U\subset \Omega$ of $C(\sigma,Z)$ and a neighborhood $\cU$ of $Z$ such that for any $Y\in \cU$, the continuation $C(\sigma_Y,Y)$ is well-defined and contained in $U$. In particular, $\sigma_Y$ is the only singularity in $U$. Moreover, since $C(\sigma,Z)$ is an attractor, $U$ can be chosen to be an attracting neighborhood of $C(\sigma,Z)$. By reducing $\cU$, we assume that $U$ remains an attracting region for any $Y\in\cU$ and the chain recurrent set of $Y$ is composed of finitely many hyperbolic critical elements plus the maximal invariant set in $U$. \item For any $Y\in\cU$, there exists no homoclinic tangency in $U$ (Proposition \ref{prop.away-tangencies}). As the chain recurrent set of $Y$ outside $U$ is composed of finitely many hyperbolic critical elements, one concludes that $Y$ is away from homoclinic tangencies. \item There is a partially hyperbolic splitting $T_{C(\sigma_Y,Y)}M=E^{ss}\oplus F$ with $\operatorname{dim} E^{ss}=1$ (Lemma \ref{lem.ph-splitting}). The subbundle $F$ contains a continuous 2-dimensional subbundle $E^Y\subset T_{C(\sigma_Y,Y)}M$ containing the flow direction such that it is invariant for $\Phi^Y_t$ and sectionally expanded. Moreover, $E^Y$ varies upper semi-continuously with respect to $Y\in\cU$. (Proposition \ref{prop.sect-exp}) \item $C(\sigma_Y,Y)$ is the unique Lyapunov stable chain recurrence class contained in $U$. (Proposition \ref{prop.ls-class}) \end{enumerate} By Lemma \ref{lem.hc}, there exists an open set $\cV\subset \cU$ such that for any $Y\in\cV$, the chain recurrence class $C(\sigma_Y,Y)$ exhibits a robust heterodimensional cycle. To finish the proof of Theorem A, it remains to show that for any $Y\in\cV$, the subbundle $E^Y$ is exceptional. Arguing by contradiction, if $E^Y$ is not exceptional, then there exists a dominated splitting $F=E^Y\oplus E'$ or $F=E'\oplus E^Y$. In the first case, since $E^Y$ is sectionally expanded and is dominated by $E'$, one deduces that $E'$ is expanded. It follows that $C(\sigma_Y,Y)$ is singular hyperbolic, contradicting to the fact that $C(\sigma_Y,Y)$ contains a robust heterodimensional cycle. In the second case, since $E'$ is dominated by $E^Y$ which contains the flow direction, one deduces that $E'$ should be contracted. Then $C(\sigma_Y,Y)$ would also be singular hyperbolic, a contradiction again. This completes the proof of Theorem A. \section{Away from tangencies: proof of Proposition \ref{prop.away-tangencies}}\label{sect.away-from-ht} This section is devoted to the proof of Proposition \ref{prop.away-tangencies}. Recall that the statement of Proposition \ref{prop.away-tangencies} contains two parts: \begin{enumerate}[label=(\alph*)] \item $\widetilde{\cN}_{\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)}$ admits a dominated splitting $\cN^{ss}\oplus\cN^I\oplus\cN_2$ with one-dimensional subbundles; \item the dynamics $X|_{\Lambda}$ is locally away from homoclinic tangencies. \end{enumerate} Note first that part (b) follows from part (a) and the next lemma. \begin{Lemma}[\cite{W02,Go}]\label{lem.away-tang} The dynamics $X|_{\Lambda}$ is locally away from homoclinic tangencies if and only if every $i$-fundamental sequence of $\Lambda$ admits an index $i$ dominated splitting. \end{Lemma} Part (a) holds if we show that $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)=B(\Lambda)$ and $\widetilde{\cN}_{B(\Lambda)}$ admits a dominated splitting with one dimensional subbundles. These two steps are given below in Lemma \ref{lem.f-seq} and Lemma \ref{lem.dominated-splitting}, respectively. Note that these results are obtained for the unperturbed vector field $X$ whose dynamics in $\Omega=B^3\times I$ is a skew-product. \begin{Lemma}\label{lem.f-seq} $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)=B(\Lambda)$. \end{Lemma} \begin{proof} Since $\Lambda$ is a homoclinic class, periodic orbits are dense in $\Lambda$. This implies that $B(\Lambda)\subset \mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)$. We need to show that the converse also holds. By definition of the function $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\cdot)$, for any $l\in \mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)$, we have $\beta(l)\in \Lambda$, and if $\beta(l)=x$ is a regular point, then $l=l^X_x$. Therefore, as $\sigma$ is the only singularity in $\Lambda$, the set $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)\setminus B(\Lambda)$ is contained in $T_{\sigma}\Omega$. At the singularity, there is a dominated splitting $T_{\sigma}\Omega= (E^{ss}_{\sigma}\oplus \RR^I)\oplus E^c_{\sigma}\oplus E^u_{\sigma}$, see \eqref{eq.eigenvalues}. Let $W^{ss}(\sigma)$ be the strong stable manifold of $\sigma$ that is tangent to $E^{ss}_{\sigma}\oplus\RR^I$ at $\sigma$. By construction, $\Lambda\cap W^{ss}(\sigma)\setminus\{\sigma\}=\emptyset$. Thus it follows from Lemma \ref{lem.loren-like-singularity} that $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)\cap T_{\sigma}\Omega \subset E^c_{\sigma}\oplus E^u_{\sigma}$. Note that for the 3-dimensional Lorenz attractor $\Lambda_0$, the intersection of $B(\Lambda_0)$ with $T_OB^3$ coincides with $E^{cu}_O=E^c_O\oplus E^u_O$. Identifying $O$ with $\sigma=(O,0)$ and $\Lambda_0$ with $\Lambda=\Lambda\times\{0\}$, we obtain that $B(\Lambda)=B(\Lambda_0)=E^c_{\sigma}\oplus E^u_{\sigma}$. Thus, $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)\cap T_{\sigma}\Omega \subset B(\Lambda)\cap T_{\sigma}\Omega$. Consequently, $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)\subset B(\Lambda)$. Therefore, $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)=B(\Lambda)$. \end{proof} \begin{Lemma}\label{lem.dominated-splitting} $\widetilde{\cN}_{B(\Lambda)}$ admits a dominated splitting $\cN^{ss}\oplus\cN^I\oplus\cN_2$ with one-dimensional subbundles. \end{Lemma} \begin{proof} For the Lorenz attractor $\Lambda_0$ in $B^3$, there exists a singular hyperbolic splitting $T_{\Lambda_0}B^3=E^{ss}\oplus E^{cu}$. For any point $x\in\Lambda_0\setminus\{O\}$, one has $l^{X^0}_x\subset E^{cu}_x$, see (P5). In particular, the domination gives a lower bound of the angle between $E^{ss}_x$ and $l^{X^0}_x$, which is uniform for $x\in\Lambda_0\setminus\{O\}$. Let $\cN^{ss}_x$ be the orthogonal projection of $E^{ss}_x$ to $\cN_x$, and let $\cN_2(x)=E^{cu}_x\cap\cN_x$. The domination property of $T_{\Lambda_0}B^3=E^{ss}\oplus E^{cu}$ and the uniform lower bound of the angle between $E^{ss}_x$ and $l^{X^0}_x$ imply that the bundle $\cN^{ss}$ is also dominated by $\cN_2$ for the linear Poincar\'e flow (\cite[Lemma 2.3]{BGY}). Moreover, with the contracting property of $\Phi^{X_0}_t|_{E^{ss}}$ one can show that the bundle $\cN^{ss}$ is also contracted by the linear Poncar\'e flow. Taking limits of the splitting $\cN_{\Lambda_0}=\cN^{ss}\oplus \cN_2$ in the Grassmannian $G^1$, one obtains a dominated splitting $\widetilde{\cN}_{B(\Lambda_0)}=\cN^{ss}\oplus \cN_2$. Moreover, the subbundle $\cN^{ss}$ is contracting for the extended linear Poincar\'e flow. Note that the dynamics in $\Omega=B^3\times I$ is a skew-product and $\Lambda=\Lambda_0\times\{0\}$ is an invariant set for $X$. We may assume that the one-dimensional subbundle $\RR^I$ tangent to the fiber $I$ is orthogonal to $T(B^3\times\{0\})$. Identifying $B^3$ with $B^3\times\{0\}$, one can see that $\widetilde{\cN}_{B(\Lambda)}$ admits an invariant splitting $\cN^{ss}\oplus \cN^I\oplus \cN_2$, where $\cN^{ss}$ and $\cN_2$ are given by the splitting $\widetilde{\cN}(B(\Lambda_0))=\cN^{ss}\oplus \cN_2$ and $\cN^I=\RR^I$. We need to prove that this splitting is dominated. Following \cite{Ma2}, it suffices to show that for any ergodic invariant measure supported on $B(\Lambda)$, the Lyapunov exponents corresponding to the three subbundles satisfy \begin{equation}\label{eq.exponents} \eta^{ss}<\eta^{I}<\eta_2. \end{equation} Recall from the construction that there is a dominated splitting $T_{\sigma}\Omega=E^{ss}\oplus \RR^I\oplus E^c\oplus E^u$, such that the corresponding Lyapunov exponents of the subbundles are \[\lambda^s<-\theta<\lambda^c<\lambda^u.\] Moreover, we have defined $\lambda^s_0=\log\|D\Phi_1^{X^0}|_{E^{ss}_{\Lambda_0}}\|$ which satisfies $\lambda^s\leq\lambda^s_0<-\theta$. See Section \ref{sect.skew-product}. Let $\mu$ be any ergodic invariant measure supported on $B(\Lambda)$. Suppose $\beta_*\mu$ is the Dirac measure at $\sigma$, then $\mu$ is the Dirac measure supported either on $\langle E^c_{\sigma}\rangle$ or on $\langle E^u_{\sigma}\rangle$. In both cases, we have \[\eta^{ss}=\lambda^s < -\theta=\eta^{I}.\] Then we show that $\eta^{I}<\eta_2$ as follows: if $\mu$ is the Dirac measure on $\langle E^c_{\sigma}\rangle$, then $\eta_2=\lambda^u$; otherwise, $\mu$ is the Dirac measure on $\langle E^u_{\sigma}\rangle$, then $\eta_2=\lambda^c$. In both cases, it follows from equation \eqref{eq.eigenvalues} that \[\eta^{I}=-\theta<\lambda^c\leq \eta_2.\] Hence \eqref{eq.exponents} holds when $\beta_*\mu$ is the Dirac measure at $\sigma$. Now, suppose $\beta_*\mu$ is not the Dirac measure at $\sigma$, then it is a nonsingular ergodic measure for the flow $\phi_t^X$. Since the bundle $\cN^{ss}$ is obtained from $E^{ss}$ by orthogonal projection, the Lyapunov exponent along $\cN^{ss}$ is no larger than $\log\|D\Phi_1^{X^0}|_{E^{ss}_{\Lambda_0}}\|=\lambda^s_0$, i.e. \[\eta^{ss}\leq \lambda^s_0.\] By construction of the example, on every point $(x,0)\in \Lambda$, it holds \[-\theta\leq \frac{\partial \zeta(x,s)}{\partial s}\bigg|_{s=0}\leq 0,\] where $\zeta(x,s)=-\theta s(1-\eta(x,s))$ is the last component of $X(x,s)$. This implies that $-\theta\leq \eta^{I}\leq 0$. Then by the inequality \eqref{eq.eigenvalues}, one has \[\eta^{ss}\leq \lambda^s_0<-\theta\leq \eta^I\leq 0.\] Since $E^{cu}$ is sectionally expanding and $\cN_2$ is obtained from $E^{cu}$ by intersecting with the normal bundle, one deduces that the Lyapunov exponent along $\cN_2$ is larger than zero, i.e. $\eta_2>0$. Therefore, \eqref{eq.exponents} also holds in this case. This finishes the proof of the lemma. \end{proof} \begin{Remark}\label{rmk.exceptional-bundle} From the proof, we can see that $E^{cu}_{\Lambda}=\beta_*(\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)\oplus \cN_2)$, where the map $\beta_*$ takes each vector $(l,v)\in\beta^*(TM)$ to $v\in TM$. \end{Remark} \begin{proof}[Proof of Proposition \ref{prop.away-tangencies}] By Lemma \ref{lem.f-seq} and Lemma \ref{lem.dominated-splitting}, the extended normal bundle $\widetilde{\cN}_{\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)}$ admits a dominated splitting with 1-dimensional subbundles. Then it follows from Lemma \ref{lem.dom-equivalence} that any fundamental sequence of $\Lambda$ admits an index $i$ dominated splitting, for $i=1$ and $i=2$. Thus Lemma \ref{lem.away-tang} shows that $X|_{\Lambda}$ is locally away from homoclinic tangencies. \end{proof} \section{Existence of sectionally expanding subbundle: proof of Proposition \ref{prop.sect-exp}} \label{sect.sectional-expanding} By construction, the chain recurrence class $\Lambda$ admits a 2-dimensional invariant bundle $E^{cu}\subset T_{\Lambda}\Omega$ which is sectionally expanding for $\Phi^X_t$. Proposition \ref{prop.sect-exp} asserts that this property also holds for nearby chain recurrence classes for $C^1$ perturbations. This section gives a proof of Proposition \ref{prop.sect-exp}. For this purpose, we turn to the dominated splitting $\widetilde{\cN}_{\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)}=\cN_1\oplus \cN_2$ given by Proposition \ref{prop.away-tangencies}, where $\cN_1=\cN^{ss}\oplus\cN^I$. As in Remark \ref{rmk.exceptional-bundle}, we have $E^{cu}_{\Lambda}=\beta_*(\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)\oplus \cN_2)$, which is a two-dimensional sectionally expanding subbundle for the tangent flow. \begin{Definition} Let $\mathcal{E}} \def\cK{\mathcal{K}} \def\cQ{\mathcal{Q}} \def\cW{\mathcal{W}\subset \beta^*(TM)$ be any invariant bundle for the extended tangent flow $\tilde{\Phi}_t$. We say that the bundle $\mathcal{E}} \def\cK{\mathcal{K}} \def\cQ{\mathcal{Q}} \def\cW{\mathcal{W}$ {\em projects to a continuous bundle $E\subset TM$} if $E$ is continuous and for any $l\in \iota(\mathcal{E}} \def\cK{\mathcal{K}} \def\cQ{\mathcal{Q}} \def\cW{\mathcal{W})$, it holds $\beta_*(\mathcal{E}} \def\cK{\mathcal{K}} \def\cQ{\mathcal{Q}} \def\cW{\mathcal{W}_l)=E_{\beta(l)}$. \end{Definition} \begin{Remark} If $\mathcal{E}} \def\cK{\mathcal{K}} \def\cQ{\mathcal{Q}} \def\cW{\mathcal{W}$ is continuous and it satisfies $\beta_*(\mathcal{E}} \def\cK{\mathcal{K}} \def\cQ{\mathcal{Q}} \def\cW{\mathcal{W}_{l_1})=\beta_*(\mathcal{E}} \def\cK{\mathcal{K}} \def\cQ{\mathcal{Q}} \def\cW{\mathcal{W}_{l_2})$ for any $l_1,l_2\in \iota(\mathcal{E}} \def\cK{\mathcal{K}} \def\cQ{\mathcal{Q}} \def\cW{\mathcal{W})$ with $\beta(l_1)=\beta(l_2)$, then $E=\beta_*(\mathcal{E}} \def\cK{\mathcal{K}} \def\cQ{\mathcal{Q}} \def\cW{\mathcal{W})$ is a well-defined continuous subbundle of $TM$. Moreover, it is easy to see that $E$ is invariant for the tangent flow $\Phi_t$ if $\mathcal{E}} \def\cK{\mathcal{K}} \def\cQ{\mathcal{Q}} \def\cW{\mathcal{W}$ is invariant for the extended tangent flow $\tilde{\Phi}_t$. \end{Remark} Proposition \ref{prop.sect-exp} will be proved as a corollary of the following result, which is stated in a slightly more general setting. \begin{Proposition}\label{prop.sectional-expanding} Let $C_X$ be a chain recurrence class of a vector field $X\in\mathscr{X}^1(M)$ such that every singularity in the class, say $\rho$, is Lorenz-like with stable index $i_0$ and $C_X\cap(W^{ss}(\rho,X)\setminus\{\rho\})=\emptyset$. Suppose $\widetilde{\cN}_{\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(C_X)}$ admits a dominated splitting $\cN_1\oplus \cN_2$ such that $\operatorname{dim} \cN_1=i_0-1$. Then there is a neighborhood $U$ of $C_X$ and a neighborhood $\cU$ of $X$ such that for any $Y\in\cU$ and any chain recurrence class $C_{Y}\subset U$ of $Y$, the class admits a dominated splitting $\widetilde{\cN}_{\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(C_Y)}=\cN^Y_1\oplus\cN^Y_2$, such that $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(C_Y)\oplus \cN^Y_2$ projects to a continuous bundle $E^Y\subset T_{C_Y}M$ with $\operatorname{dim} E^Y=\operatorname{dim} M-i_0+1$. \end{Proposition} \begin{proof} By robustness of dominated splitting, there exist a neighborhood $\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}$ of $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(C_X)$ and a neighborhood $\cU$ of $X$, such that for any $Y\in\cU$ and for any invariant set $\Delta\subset \mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}$ of the extended tangent flow of $Y$, the normal bundle $\widetilde{\cN}(\Delta)$ admits a dominated splitting $\cN^Y_1\oplus \cN^Y_2$ with respect to the extend linear Poincar\'e flow $\tilde{\psi}_t^{Y}$, and it satisfies $\operatorname{dim} \cN^Y_1=i_0-1$. By Lemma \ref{lem.semi-cont}, there exists a neighborhood $U$ of $C_X$ such that for any $Y\in\cU$ (shrinking $\cU$ if necessary), for any chain recurrence class $C_{Y}\subset U$, one has $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(C_{Y})\subset\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}$. Hence there is a dominated splitting $\widetilde{\cN}_{\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(C_{Y})}=\cN^Y_1\oplus \cN^Y_2$ with index $i_0-1$, i.e. $\operatorname{dim} \cN^Y_1=i_0-1$. Since the singularities in $C_X$ are all Lorenz-like, by reducing $U$ and $\cU$, we can assume that singularities in $C_Y$ are also Lorenz-like. In particular, for any singularity $\rho\in C_Y$, there is a dominated splitting $T_{\rho}M=E^{ss}_{\rho}\oplus E^{cu}_{\rho}$ such that $\operatorname{dim} E^{ss}_{\rho}=i_0-1$. Moreover, by Lemma \ref{lem.loren-like-singularity} we can assume that for any $l\in \mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(C_Y)$, if $\beta(l)=\rho$ is a singularity, then $l\in E^{cu}_{\rho}$. As the dominated splitting $\widetilde{\cN}_{\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(C_{Y})}=\cN^Y_1\oplus \cN^Y_2$ has index $i_0-1$, which equals to $\operatorname{dim} E^{ss}_{\rho}$, the uniqueness of domination implies that $\cN^Y_2(l)\subset E^{cu}_{\rho}$ and hence $\beta_*(l\oplus \cN^Y_2(l))=E^{cu}_{\rho}$. Note that the subspace $E^{cu}_{\rho}$ is unique for all $l\in\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(C_Y)\cap\beta^{-1}(\rho)$. For any $l\in\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(C_Y)$ with $\beta(l)=x$ a regular point, we have $l=l^Y_x$. Thus, we can define $E^{cu}_x=\beta_*(l\oplus\cN_2(l))$. In this way, we define a bundle $E^{cu}$ over $C_Y$. By continuity of the map $\beta_*$ and the bundle $\cN^Y_2$, one can see that the bundle $E^{cu}$ is continuous at regular points. For any singularity $\rho\in C_Y$, let $x_n$ be a sequence in $C_Y$ such that $x_n\to\rho$ and $l_n=l^Y_{x_n}\to l$, we have \[E^{cu}_{x_n}=\beta_*(l_n\oplus \cN_2^Y(l_n))\to \beta_*(l\oplus\cN_2^Y(l))=E^{cu}_{\rho}.\] Hence $E^{cu}$ is also continuous at $\rho$. Therefore $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(C_Y)\oplus \cN^Y_2$ projects to the continuous bundle $E^{cu}$ with $\operatorname{dim} E^{cu}=\operatorname{dim} M-i_0+1$. \end{proof} \begin{proof}[Proof of Proposition \ref{prop.sect-exp}] Let $\widetilde{\cN}_{\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)}=\cN_1\oplus \cN_2$ with $\operatorname{dim} \cN_2=1$ be the dominated splitting given by Proposition \ref{prop.away-tangencies}. Then $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)\oplus\cN_2$ projects to the two-dimensional continuous bundle $E^{cu}_{\Lambda}$, which is sectionally expanded. The neighborhoods $U\subset U_{\Lambda}$ of $\Lambda$ and $\cU$ of $X$ are given by Proposition \ref{prop.sectional-expanding}. By reducing these neighborhoods, we can assume that for any $Y\in\cU$ and any chain recurrence class $C_Y\subset U$, the splitting $\widetilde{\cN}_{\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(C_Y)}=\cN^Y_1\oplus \cN^Y_2$ is close enough to $\widetilde{\cN}_{\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)}=\cN_1\oplus \cN_2$. This implies that $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(C_Y)\oplus \cN^Y_2$ projects to a continuous bundle $E^Y$ that is close enough to $E^{cu}_{\Lambda}$, hence is also sectionally expanded. Moreover, as $E^Y$ contains $\beta_*(\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(C_Y))$, it contains $Y(x)$ for all $x\in C_Y$. Finally, if $C_Y=C(\sigma_Y,Y)$, then $C_Y$ varies upper semi-continuously with respect to $Y$. By Lemma \ref{lem.semi-cont}, $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(C_Y)$ also varies upper semi-continuously with respect to $Y$. Note that $E^Y=\beta_*(\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(C_Y)\oplus \cN_2^Y)$. As the dominated splitting $\widetilde{\cN}_{F(C_Y)}=\cN^Y_1\oplus \cN^Y_2$ varies continuously with respect to $Y$ and the projection $\beta_*$ is continuous, one conclude that $E^Y$ varies upper semi-continuously with respect to $Y$. \end{proof} In the case $C_Y$ is non-singular, the sectional expanding property of the $E^Y$ bundle implies that the normal bundle $\cN^Y_2$ is expanded. This also holds for any non-singular compact invariant set in $U$. \begin{Corollary}\label{cor.sect-exp} Let the neighborhoods $U$ and $\cU$ be given by Proposition \ref{prop.sect-exp}. For any $Y\in\cU$ and any compact $\phi^Y_t$-invariant set $\Lambda_Y\subset U$ such that $\Lambda_Y\cap\operatorname{Sing}(Y)=\emptyset$, the normal bundle $\cN_{\Lambda_Y}$ admits a dominated splitting $\cN_1\oplus \cN_2$ such that $\cN_2$ is one-dimensional and expanded. \end{Corollary} \section{Uniqueness of Lyapunov stable class: proof of Proposition \ref{prop.ls-class}}\label{sect.ls} In this section we prove Proposition \ref{prop.ls-class}. In other words, we show that for $C^1$ perturbations of the vector field $X$, any Lyapunov stable chain recurrence class in a small neighborhood of $\Lambda$ contains the singularity $\sigma$ and the periodic orbit $Q$. We shall make use of the sectional expanding property of the $E^{cu}$ subbundle in the splitting $T_{\Lambda}\Omega=E^{ss}\oplus E^{cu}\oplus \RR^I$. The difficulty lies in the fact that $E^{cu}$ is exceptional: there is no domination between the subbundles $E^{cu}$ and $\RR^I$. As a bypass, we will consider the dominated splitting $\widetilde{\cN}_{\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)}=\cN_1\oplus \cN_2$ given by Proposition \ref{prop.away-tangencies}, where $\cN_1=\cN^{ss}\oplus \cN^I$. The rough idea for the proof of Propostion \ref{prop.ls-class} goes as follows. We will first extend the dominated splitting $\widetilde{\cN}_{\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)}=\cN_1\oplus \cN_2$ to a neighborhood $\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$ of $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)$ and define a cone around $\cN_2$ on the normal bundle (Section \ref{sect.cone-on-normal-bundle}), then use the cone on the normal bundle to construct an invariant cone on the cross-section $\Sigma$ for the first return map and show that vectors in the cone on $\Sigma$ are expanded by the first return map (Section \ref{sect.forward-inv} and Section \ref{sect.inv-cone}), and finally finish the proof of the proposition by an analysis of the first return map (Section \ref{sect.pf-prop-ls}). \subsection{Dominated splitting and cone field on the normal bundle}\label{sect.cone-on-normal-bundle} For simplicity, we assume that for the dominated splitting $\widetilde{\cN}_{\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)}=\cN_1\oplus \cN_2$ the domination constant $T=1$. In other words, \[\|\tilde{\psi}_t|_{\cN_1(l)}\|\cdot\|\tilde{\psi}_{-t}|_{\cN_2(l_t)}\|<\frac{1}{2},\quad\forall t\geq 1,\] where $l_t=\hat{\Phi}_t(l)$. We extend the splitting $\widetilde{\cN}_{\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)}=\cN_1\oplus \cN_2$ to a neighborhood $\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$ of $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)$ in a continuous way. Define on $\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$ a cone field $\mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}_{\alpha}$ on the normal bundle around the $\cN_2$ subbundle for any $\alpha>0$: \[\mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}_{\alpha}=\{v=v_1+v_2\in\cN_{\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0}: v_1\in\cN_1, v_2\in \cN_2, \|v_1\|\leq\alpha\|v_2\|\}.\] We define also the cone\footnote{Technically, $\widetilde{\mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}}_{\alpha}$ is not a cone, but a ``wedge''.} $\widetilde{\mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}}_{\alpha}=\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0\oplus\mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}_{\alpha}$. In other words, $v\in\widetilde{\mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}}_{\alpha}$ if and only if there is a decomposition $v=v_1+v_2$ such that $v_1\in\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$ and $v_2\in\mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}_{\alpha}$. By domination of the splitting $\cN_1\oplus\cN_2$ and continuity, we have the following lemma. \begin{Lemma}\label{lem.cone-0} For any $\alpha>0$, there exist a neighborhood $\cU$ of $X$ and a neighborhood $\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}\subset\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$ of $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)$ such that for any any $Y\in\cU$ and $l\in\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}$, if $\hat{\Phi}^Y_{[0,t]}(l)\subset \mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}$ with $t\geq 1$, then \[\tilde{\psi}^Y_t(\mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}_{\alpha}(l))\subset\mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}_{\alpha/2}(\hat{\Phi}^Y_t(l)) \quad \text{and}\quad \tilde{\Phi}^Y_t(\widetilde{\mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}}_{\alpha}(l))\subset\widetilde{\mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}}_{\alpha/2}(\hat{\Phi}^Y_t(l)).\] \end{Lemma} Note that the vector bundle $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)\oplus \cN_2$ is invariant for the extended tangent flow $\tilde{\Phi}_t$. By Remark \ref{rmk.exceptional-bundle}, $\beta_*(\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)\oplus \cN_2)=E^{cu}_{\Lambda}$, which is sectionally expanded by the tangent flow. Following from the continuity of the map $\beta_*$ and by reducing $\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$, we can fix $\alpha_0>0$ small and a neighborhood $\cU_0$ of $X$ such that for any $Y\in\cU_0$ and $l\in\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$, if $\hat{\Phi}^Y_{[0,t]}(l)\subset \mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$ with $t\geq 1$, then for any 2-dimensional subspace $\cP\subset\widetilde{\mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}}_{\alpha_0}(l)$, the projection $\beta_*(\cP)$ is close enough to $E^{cu}_{\Lambda}$ and hence \begin{equation}\label{eq.sectional-expanding} \left|\det\left(\Phi^Y_t|_{\beta_*(\cP)}\right)\right|>e^{\gamma t/2}, \end{equation} where $\gamma>0$ is given as in \eqref{eq.sect-exp}. We assume that the results of Lemma \ref{lem.cone-0} hold for the fixed $\alpha=\alpha_0$ with $\cU=\cU_0$ and $\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}=\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$. Moreover, by Lemma \ref{lem.loren-like-singularity} we assume that \begin{equation}\label{eq.lorenz-like} W^{ss}(\sigma_Y,Y)\cap C(\sigma_Y,Y)=\{\sigma_Y\}, \quad \text{for any }\ Y\in\cU_0, \end{equation} where $W^{ss}(\sigma_Y,Y)$ is the strong stable manifold of $\sigma_Y$ tangent to $E^{ss}_{\sigma}\oplus \RR^I$. \subsection{A forward invariance of \texorpdfstring{$\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$}{B0}}\label{sect.forward-inv} Recall that there is a cross-section $\Sigma=\Sigma_0\times I$ of the flow $\phi^X_t$. One can see that $\Sigma$ remains a cross-section for vector fields close to $X$. In this section we prove the following lemma. \begin{Lemma}\label{lem.forward-inv} There exist a neighborhood $U_1$ of $\Lambda$ and a $C^1$ neighborhood $\cU_1$ of $X$, such that for any $p\in\Sigma\cap\overline{U_1}$, for any $Y\in\cU_1$, and $t\geq 0$, it holds $l^Y_{p_t}\in\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$, where $p_t=\phi^Y_t(p)$. \end{Lemma} For the proof of Lemma \ref{lem.forward-inv} we need consider orbit segments arbitrarily close to the singularity. Note that the tangent space at the singularity $\sigma$ admits a dominated splitting $T_{\sigma}\Omega=F^{ss}_{\sigma}\oplus E^{cu}_{\sigma}$, where $F^{ss}_{\sigma}=E^{ss}_{\sigma}\oplus \RR^I$; and by construction, it holds $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)\cap T_{\sigma}\Omega=E^{cu}_{\sigma}$. One defines on $T_{\sigma}\Omega$ a $cu$-cone $C^{cu}_{\alpha}$ around the $E^{cu}_{\sigma}$ bundle. By domination, the cone $C^{cu}_{\alpha}$ is forward contracting. We extend the cone continuously to a ball around $\sigma$, which is denoted by $W_0$. Let $K$ be the intersection of $\bigcup_{t\geq 0}\phi^X_t(L)$ with $\partial W_0$, which is a compact subset of $\partial W_0$. We assume that the ball $W_0$ is small such that $W_0\cap \Sigma=\emptyset$ and since the singularity is Lorenz-like, there exists $\alpha>0$ such that for any $p\in K$, it holds $l^X_p\subset C^{cu}_{\alpha}(p)$. By reducing $\cU_0$ if necessary, there exists a neighborhood $N_K\subset \partial W_0$ of $K$ such that $l^Y_p\subset C^{cu}_{\alpha}(p)$ for any $p\in N_K$ and $Y\in\cU_0$. Moreover, we assume that the cone $C^{cu}_{\alpha}$ is forward contracting under the tangent flow $\Phi^Y_t$ for any $Y\in\cU_0$. \begin{Lemma}\label{lem.nbhd-of-sigma} There exists a neighborhood $W_1\subset W_0$ of $\sigma$ and a neighborhood $\cU_1\subset \cU_0$ of $X$ such that for any $Y\in\cU_1$, any orbit segment from a point $p\in\Sigma$ to a point $q\in \overline{W_1}$ crosses $N_K$, and moreover, $l^Y_q\in \mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$. \end{Lemma} \begin{proof} Since $\Sigma$ can be a cross-section for any vector field $C^1$ close to $X$ and its image under the first return map remains in the interior of $\Sigma$, we need only consider orbit segments from $p\in\Sigma$ to $q\in\overline{W_1}$ without returns to $\Sigma$. Since $N_K$ is a neighborhood of $K$, there exists a neighborhood $W_1\subset W_0$ of $\sigma$ such that any orbit segment $S$ of $X$ from a point $p\in\Sigma$ to a point $q\in \overline{W_1}$ (without returns) crosses $N_K$. Moreover, let $r$ be the intersection of $S$ with $N_K$, then the orbit segment from $r$ to $q$ is contained in $\overline{W_0}$. See Figure \ref{fig.local-dynamics}. Shrinking $W_1$ if necessary, there exists a neighborhood $\cU_1\subset \cU_0$ of $X$ such that the same property holds for every $Y\in\cU_1$. The following argument shows that $l^Y_q\in\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$ if we choose $W_1$ small enough. \begin{figure}[htbp] \centering \includegraphics[width=.25\textwidth]{local-dynamics} \caption{Local analysis around the singularity. Note \\ that the strong stable direction is 2-dimensional.}\label{fig.local-dynamics} \end{figure} Since $E^{cu}_{\sigma}\subset \mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)$ and $\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$ is a neighborhood of $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)$, we can assume that $W_1$ is small enough and there exists a constant $\alpha'>0$ such that for any $q\in \overline{W_1}$ and nonzero vector $v\in T_q\Omega$, if $v\in C^{cu}_{\alpha'}(q)$, then $\langle v\rangle \in \mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$; and if the backward orbit of $q$ hits $N_K$ at a point $r$ before leaving $W_0$, then the time $t$ from $r$ to $q$ is large enough so that $\Phi^Y_t(C^{cu}_{\alpha}(r))\subset C^{cu}_{\alpha'}(q)$, by the contracting property of the cone. In particular, since $l^Y_r\subset C^{cu}_{\alpha}(r)$, we have $l^Y_q=\hat{\Phi}^Y_t(l^Y_r)\subset C^{cu}_{\alpha'}(q)$. It follows that $l^Y_q\in\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$. \end{proof} The next result considers orbit segments away from the singularity. \begin{Lemma}\label{lem.cone-1} Reducing $\cU_1$ if necessary, there exists an attracting neighborhood $U_1$ of $\Lambda$, such that for any $Y\in\cU_1$, one has $\phi^Y_1(\overline{U_1})\subset U_1$. Moreover, for any $p\in \overline{U_1}\setminus W_1$, it holds that $l^{Y}_{p_t}\in \mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$ for all $t\in[0,1]$, where $p_t=\phi^Y_t(p)$, and $\tilde{\psi}^{Y}_1(\mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}_{\alpha_0}(l^{Y}_p))\subset \mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}_{\alpha_0/2}(l^{Y}_{p_1})$. \end{Lemma} \begin{proof} Reducing $\cU_1$ if necessary, we can take a neighborhood $W'_1\subset W_1$ of $\sigma$ such that for any $p\in W'_1$ and any $Y\in\cU_1$, we have $\phi^Y_t(p)\in W_1$ for all $t\in[-1,1]$. Since $\sigma$ is the only singularity in $\Lambda$, we have \begin{equation}\label{eq.non-singular} \mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}(\Lambda)\setminus\beta^{-1}(W'_1)=\{l^X_p: p\in \Lambda\setminus W'_1\}. \end{equation} By construction of the vector field $X$, there exist arbitrarily small attracting neighborhoods of $\Lambda$. Following from \eqref{eq.non-singular}, we can take an attracting neighborhood $U_1$ of $\Lambda$ and reduce the neighborhood $\cU_1$ of $X$ such that $\phi^Y_1(\overline{U_1})\subset U_1$ and $l^Y_p\in\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$ for any $Y\in\cU_1$ and for any $p\in \overline{U_1}\setminus W'_1$. This implies that for all $p\in\overline{U_1}\setminus W_1$ and $t\in[0,1]$, we have $l^{Y}_{p_t}\in \mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$, and hence by Lemma \ref{lem.cone-0}, $\tilde{\psi}^{Y}_1(\mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}_{\alpha_0}(l^{Y}_p))\subset \mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}_{\alpha_0/2}(l^{Y}_{p_1})$. \end{proof} We can now finish the proof of Lemma \ref{lem.forward-inv}. \begin{proof}[Proof of Lemma \ref{lem.forward-inv}] Let the neighborhoods $\cU_1$ of $X$ and $U_1$ of $\Lambda$ be given by Lemma \ref{lem.nbhd-of-sigma} and Lemma \ref{lem.cone-1}. Let $p$ be any point in $\Sigma\cap \overline{U_1}$. By Lemma \ref{lem.cone-1}, $l^Y_{p_t}\in \mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$ for $t\in [0,1]$. If $p_1\in W_1$, let $t_1>1$ be such that the orbit segment $\phi^Y_{[1,t_1]}(p)\subset \overline{W_1}$ and $p_{t_1}\in\partial W_1$. Then it follows from Lemma \ref{lem.nbhd-of-sigma} that $l^Y_{p_t}\in \mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$ for $t\in [1,t_1]$. If $p_1\notin W_1$, it follows from Lemma \ref{lem.cone-1} again that $l^Y_{p_t}\in \mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$ for any $t\in[1,2]$. Inductively, one concludes that $l^Y_{p_t}\in\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$ for all $t\geq 0$. \end{proof} \subsection{Invariant cone on the cross-section and expanding property}\label{sect.inv-cone} Recall that $R:\Sigma\setminus L\to \Sigma$ is the first return map, where $L$ is the intersection of the local stable manifold of $\sigma$ with $\Sigma$ (Section \ref{sect.skew-product}). For any $Y\in\cU_1$, let $L_Y=W^s_{loc}(\sigma_Y,Y)\cap\Sigma$ and $R^Y:\Sigma\setminus L_Y\to \Sigma$ be the first return map. Let $TR^Y$ be the tangent map of $R^Y$. For simplicity, let us denote \[\Sigma^*=\Sigma\cap \overline{U_1}.\] We define in this section a cone on $\Sigma^*$ such that it is invariant under $TR^Y$ and moreover, vectors in the cone will be shown to be expanded by $TR^Y$. This allows us to consider curves tangent to the cone on $\Sigma^*$ and show that the length of such curves increase under the iteration of the first return map. In the following, for any $0<\alpha\leq\alpha_0$ and $p\in \overline{U_1}\setminus \{\sigma_Y\}$ such that $l^Y_p\in\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$ we denote $\mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}^Y_{\alpha}(p)=\beta_*(\widetilde{\mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}}_{\alpha}(l^Y_p))$, which is a cone on the tangent space $T_p\Omega$. We then define a cone field $\mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^Y_{\alpha}$ on $\Sigma^*$ by letting $\mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^Y_{\alpha}(p)=\mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}^Y_{\alpha}(p)\cap T_p\Sigma$. By shrinking $U_1$ and $\cU_1$, the following result holds. \begin{Lemma}\label{lem.expanding} There exist $0<\alpha_1<\alpha_0$ and $\lambda>1$ such that for any $Y\in\cU_1$, any $p\in\Sigma^*\setminus L_Y$ and any $v\in \mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^X_{\alpha_1}(p)$, one has $TR^Y(v)\in \mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^X_{\alpha_1}(p')$, where $p'=R^Y(p)$. Moreover, $\|TR^Y(v)\|\geq\lambda\|v\|$. \end{Lemma} \begin{proof} Note that restricted to $\Sigma^*$, the cone $\mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}^Y_{\alpha}(p)$ and hence $\mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^Y_{\alpha}(p)$ are uniformly continuous with respect to the vector field $Y$ in the $C^1$ topology. Let us fix $\alpha_1\in(\alpha_0/2,\alpha_0)$. Then by reducing $\cU_1$, we can assume that for any $Y\in\cU_1$, it holds \[\mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^Y_{\alpha_0/2}(p)\subset \mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^X_{\alpha_1}(p)\subset \mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^Y_{\alpha_0}(p).\] Also, from (C1) in Section \ref{sect.skew-product} we can assume that $t_p>2$ for any $p\in \Sigma^*\setminus L_Y$. Now, for any $v\in \mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^X_{\alpha_1}(p)\subset \mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^Y_{\alpha_0}(p)$, we have $(l^Y_p,v)\in \widetilde{\mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}}^Y_{\alpha_0}(l^Y_p)$. From Lemma \ref{lem.forward-inv} it follows that $l^Y_{p_t}\in\mathcal{B}} \def\cH{\mathcal{H}} \def\cN{\mathcal{N}} \def\cT{\mathcal{T}_0$ for all $t\geq 0$. Thus, by Lemma \ref{lem.cone-0}, we have $\widetilde{\Phi}^Y_{t_p}(l^Y_p,v)\in\widetilde{\mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}}_{\alpha_0/2}(l^Y_{p'})$, where $p'=R^Y(p)$. Equivalently, we have $\Phi^Y_{t_p}(v)\in \mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}^Y_{\alpha_0/2}(p')$. Projecting $\Phi^Y_{t_p}(v)$ to $T_{p'}\Sigma$ along $l^Y_{p'}$, we obtain that \[TR^Y(v)\in \mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^Y_{\alpha_0/2}(p')\subset \mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^X_{\alpha_1}(p').\] This establishes the invariance of the cone $\mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^X_{\alpha_1}$. To see that $TR^Y$ is expanding on $\mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^X_{\alpha_1}$, we shall refer to the sectional expanding property \eqref{eq.sectional-expanding}. Recall that in the construction of the example, we have assumed the vector field $X^0$ to be orthogonal to the cross-section $\Sigma_0$ and $\|X^0(x)\|=1$ for $x\in \Sigma_0$, see (P2) in Section \ref{sect.lorenz}. Then it follows from \eqref{eq.vector-field} that the vector field $X$ is orthogonal to the cross-section $\Sigma$ at points $p\in \Sigma_0\times\{0\}$ and $\|X(p)\|=1$. In particular, this holds for $p\in \Lambda\cap\Sigma$. By shrinking $U_1$ and $\cU_1$ if necessary, we can assume that for any $Y\in\cU_1$ and any $p\in \Sigma^*=\Sigma\cap\overline{U_1}$, $Y(p)$ is almost orthogonal to the cross-section and $\|Y(p)\|$ is close to 1. Then the sectional expanding property \eqref{eq.sectional-expanding} allows us to obtain a constant $\lambda>1$, independent of $Y$, such that $\|TR^Y(v)\|\geq \lambda\|v\|$. \end{proof} The previous result shows that the cone $\mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^X_{\alpha_1}$ on $\Sigma^*$ is invariant for $TR^Y$, for any $Y\in\cU_1$. Moreover, $TR^Y$ is expanding on $\mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^X_{\alpha_1}$. Note the first return time $t_p$ of a point $p\in\Sigma^*\setminus L_Y$ can be arbitrarily large if it is close enough to $L_Y$. In this case, the sectional expanding property \eqref{eq.sectional-expanding} will guarantee a large expansion rate for $TR^Y$. \begin{Lemma}\label{lem.expanding-2} There exists a neighborhood $N_L$ of $L$ in $\Sigma$ such that for any $Y\in\cU_1$ (reducing $\cU_1$ if necessary), one has $L_Y\subset N_L$ and for any $p\in (N_L\setminus L_Y)\cap \Sigma^*$, \begin{equation}\label{eq.expanding-2} \|TR^Y(v)\|>3\|v\|,\quad \forall v\in \mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^X_{\alpha_1}(p)\setminus\{0\}. \end{equation} \end{Lemma} \begin{proof} By Lemma \ref{lem.forward-inv} and the sectional expanding property \eqref{eq.sectional-expanding}, there exists $t_0>0$ such that for any $Y\in\cU_1$ and any $p\in \Sigma^*\setminus L_Y$, if the first return time $t_p>t_0$, then equation \eqref{eq.expanding-2} holds. By continuity of local stable manifold, for any neighborhood $N_L$ of $L$ in $\Sigma$ there exists a $C^1$ neighborhood $\cU$ of $X$ such that for any $Y\in\cU$, the intersection $L_Y=W^s_{loc}(\sigma_Y,Y)\cap \Sigma$ is contained in $N_L$. Therefore, by reducing $\cU_1$, we can assume that this property holds for $Y\in\cU_1$ and $N_L$ is small enough such that for any $p\in (N_L\setminus L_Y)\cap \Sigma^*$, the first return time $t_p$ is larger than $t_0$. Hence equation \eqref{eq.expanding-2} holds. \end{proof} \begin{Definition}[$cu$-curve] A $C^1$ curve $J$ on $\Sigma$ is called a {\em $cu$-curve} if it is contained in $\Sigma^*$ and is tangent to the cone $\mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^X_{\alpha_1}$. \end{Definition} \begin{Lemma}\label{lem.cu-curve0} For any $Y\in\cU_1$ and any $cu$-curve $J$ such that $J\cap L_Y=\emptyset$, the image $R^Y(J)$ remains a $cu$-curve. \end{Lemma} \begin{proof} Since $J\cap L_Y=\emptyset$, for any $p\in J$, there is a neighborhood $J_p\subset J$ of $p$ and a constant $\delta>0$ such that the set $\Gamma=\bigcup_{|t-t_p|\leq \delta}\phi^Y_t(J_p)$ is a 2-dimensional submanifold tangent to the cone $\mathcal{C}} \def\cI{\mathcal{I}} \def\cO{\mathcal{O}} \def\cU{\mathcal{U}^Y_{\alpha_0}$, transverse to $\Sigma$. The intersection $\Gamma\cap \Sigma$ is contained in $\Sigma^*$ and by Lemma \ref{lem.expanding}, is a $cu$-curve. This implies that $R^Y(J)$ is a $cu$-curve. \end{proof} Assuming $\cU_1$ small enough, the following result holds. \begin{Lemma}\label{lem.cu-curve2} There exists ${\varepsilon}_0>0$ such that for any $Y\in\cU_1$ and any $cu$-curve $J$, there exists $k>0$ such that $\bigcup_{n=0}^{k-1} (R^Y)^n(J)$ contains a $cu$-curve with length larger than ${\varepsilon}_0$. \end{Lemma} \begin{proof} Assume that the $C^1$ neighborhood $\cU_1$ of $X$ is small enough such that $L_Y$ is $C^1$ close to $L$ and transverse to $\mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^X_{\alpha_1}$ with uniform angle. Moreover, $N_L$ contains an $\varepsilon$-neighborhood of $L_Y$ in $\Sigma$, where ${\varepsilon}>0$ is uniform for $Y\in\cU_1$. Then there exists ${\varepsilon}_0\in(0,{\varepsilon})$ such that any $cu$-curve with length smaller than $\varepsilon_0$ intersects $L_Y$ at most once, and moreover, when it does intersect $L^Y$ then it is contained in $N_L$. Let $J$ be any $cu$-curve that does not intersect $L_Y$. By Lemma \ref{lem.cu-curve0}, $R^Y(J)$ remains a $cu$-curve. Moreover, Lemma \ref{lem.expanding} shows that $\operatorname{len}(R^Y(J))>\lambda\operatorname{len}(J)$, where $\operatorname{len}(\cdot)$ denotes the length of a $C^1$ curve. By iteration, the length of $(R^Y)^n(J)$ keeps growing if it does not intersect $L_Y$. When $(R^Y)^n(J)$ does intersect $L_Y$, then either $(R^Y)^n(J)$ has length larger than $\varepsilon_0$, or it is contained in $N_L$ and is cut by $L_Y$ into two pieces. In the latter case, let $J'$ be the longer piece. Then Lemma \ref{lem.expanding-2} implies that $R^Y(J')$ has length larger than $3/2$ times the length of $(R^Y)^n(J)$. The conclusion of the lemma holds by induction. \end{proof} \subsection{Proof of Proposition \ref{prop.ls-class}}\label{sect.pf-prop-ls} We now fix the neighborhoods $U_1$ and $\cU_1$ small enough so that all the results on Section \ref{sect.forward-inv} and Section \ref{sect.inv-cone} hold. Recall that there is a periodic orbit $Q$ in $\Lambda$ with stable index 2 such that its stable manifold is dense in $U_{\Lambda}$, see (C2) in Section \ref{sect.skew-product}. In particular, the stable manifold of $Q$ intersects $\Sigma$ along a dense family of 2-dimensional $C^1$ disks of the form $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}^s(x)\times I$. As is easy to see that the foliation $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}^s\times I$ is transverse to the bundle $E^{cu}$, we can assume that $\alpha_0$ is small such that $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}^s\times I$ is transverse to the cone $\mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^X_{\alpha_0}$. This implies, in particular, that any $cu$-curve is transverse to the foliation $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}^s\times I$ and the angle between them is uniformly bounded below. By continuity of local stable manifold, there exists a $C^1$ neighborhood $\cU_2$ of $X$ such that for any $Y\in\cU_2$, any $cu$-curve with length ${\varepsilon}_0$ intersects the stable manifold $W^s(Q_Y,Y)$, where ${\varepsilon}_0>0$ is given by Lemma \ref{lem.cu-curve2} and $Q_Y$ is the continuation of $Q$. \begin{Lemma}\label{lem.unique-ls-class} For any $Y\in\cU_1\cap\cU_2$, for any $\phi^Y_t$-invariant compact set $\Gamma\subset U_1$ such that $\Gamma\cap\operatorname{Sing}(Y)=\emptyset$, it holds $W^u(\Gamma,Y)\cap W^s(Q_Y,Y)\neq\emptyset$ and $W^u(\Gamma,Y)\cap W^s(\sigma_Y,Y)\neq\emptyset$. \end{Lemma} \begin{proof} By Corollary \ref{cor.sect-exp}, there is a dominated splitting $\cN_{\Gamma}=\cN_1\oplus \cN_2$ such that $\cN_2$ is one-dimensional and expanding. This implies that $\Gamma$ has an unstable manifold tangent to $\langle Y\rangle\oplus\cN_2$. By Lemma \ref{lem.cone-0}, the cone $\mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^X_{\alpha_1}$ is invariant under $TR^Y$, which implies that $(l^Y_p\oplus \cN_2(p))\cap T_p\Sigma\subset \mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^X_{\alpha_1}(p)$ for any $p\in \Gamma\cap \Sigma$. Then the intersection of the unstable manifold of $\operatorname{Orb}(p)$ with $\Sigma$ contains a $cu$-curve $J$. It follows from Lemma \ref{lem.cu-curve2} that the length of $J$ can be assumed to be larger than ${\varepsilon}_0$. Since $Y\in\cU_2$, $J\cap W^s(Q_Y,Y)\neq\emptyset$. Hence $W^u(\Gamma,Y)\cap W^s(Q_Y,Y)\neq\emptyset$. For the proof of $W^u(\Gamma,Y)\cap W^s(\sigma_Y,Y)\neq\emptyset$, we need only show that $W^u(\Gamma,Y)\cap L_Y\neq\emptyset$. Assume that $J$ does not intersect $L_Y$, then by invariance of the cone $\mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^X_{\alpha_1}$ and Lemma \ref{lem.expanding}, the iterate $R^Y(J)$ remains a $cu$-curve with length larger than $\lambda \operatorname{len}(J)$. By iteration, the length of $(R^Y)^n(J)$ keeps growing if the first $n-1$ iterates does not intersects with $L_Y$. As the cone $\mathcal{D}} \def\cJ{\mathcal{J}} \def\cP{\mathcal{P}} \def\cV{\mathcal{V}^X_{\alpha_1}$ is transverse to $\mathcal{F}} \def\cL{\mathcal{L}} \def\cR{\mathcal{R}} \def\cX{\mathcal{X}^s\times I$, there exists a finite upper bound for the length of $cu$-curves. Hence there exists $n>0$ such that $(R^Y)^n(J)\cap L_Y\neq\emptyset$. Therefore, $W^u(\Gamma,Y)\cap L_Y\neq\emptyset$. \end{proof} \begin{Corollary}\label{cor.unique-ls-class} For any $Y\in \cU_1\cap\cU_2$, the chain recurrence class $C(\sigma_Y,Y)$ is the only Lyapunov stable one contained in $U_1$. \end{Corollary} \begin{proof} Let $C_Y$ be any Lyapunov stable chain recurrence class of $Y$ contained in $U_1$. Suppose that $C_Y$ does not contain the singularity $\sigma_Y$. Then $C_Y$ is non-singular. By Lemma \ref{lem.unique-ls-class}, we have $W^u(C_Y,Y)\cap W^s(\sigma_Y,Y)\neq\emptyset$. By Lyapunov stability of the chain recurrence class $C_Y$, one would obtain that $\sigma_Y\in {\rm Cl}(W^u(C_Y,Y))\subset C_Y$, a contradiction. Thus, $C_Y$ contains $\sigma_Y$. It follows that $C(\sigma_Y,Y)$ is the only Lyapunov stable chain recurrence class in $U_1$. \end{proof} Let $Y\in \cU_1\cap \cU_2$, we need to show that $Q_Y$ is contained in the Lyapunov stable chain recurrence class $C(\sigma_Y,Y)$. Let us recall the following result in \cite{GY}. \begin{Lemma}[{\cite[Proposition 4.9]{GY}}]\label{lem.mixingdominated} Let $\Delta$ be a compact invariant set of $Y\in \mathscr{X}^1(M)$ verifying the following properties: \begin{itemize} \item $\Delta\setminus{\rm Sing}(Y)$ admits a dominated splitting $\cN_{\Delta}=G^{cs}\oplus G^{cu}$ in the normal bundle w.r.t. the linear Poincar\'e flow $\psi_t$, with index $i$. \item Every singularity $\rho\in\Delta$ is hyperbolic and $\operatorname{Ind}(\rho)>i$. Moreover, $T_\rho M$ admits a partially hyperbolic splitting $T_{\rho}M=F^{ss}\oplus F^{cu}$ with respect to the tangent flow, where $\operatorname{dim} F^{ss}=i$ and for the corresponding strong stable manifolds $W^{ss}(\rho)$, one has $W^{ss}(\rho)\cap \Delta=\{\rho\}$. \item For every $x\in\Delta$, one has $\omega(x)\cap {\rm Sing}(Y)\neq\emptyset$. \end{itemize} Then either $\Delta$ admits a partially hyperbolic splitting $T_\Delta M=E^{ss}\oplus F$ with respect to the tangent flow $\Phi^Y_t$, where $\operatorname{dim} E^{ss}=i$, or $\Delta$ intersects the homoclinic class $H(\gamma)$ of a hyperbolic periodic orbit $\gamma$ of index $i$. \end{Lemma} Since $Y\in\cU_1$, the singularity $\sigma_Y$ is Lorenz-like and it follows from Proposition \ref{prop.sectional-expanding} that $\cN_{C(\sigma_Y,Y)}$ admits a dominated splitting $\cN_1\oplus\cN_2$ with index $2$. Moreover, since $\cU_1\subset \cU_0$ and by \eqref{eq.lorenz-like}, we have $W^{ss}(\sigma_Y,Y)\cap C(\sigma_Y,Y)=\{\sigma_Y\}$. Let us consider the following two cases: \begin{enumerate}[label=(\arabic*)] \item either $\omega(x)\cap\operatorname{Sing}(Y)\neq\emptyset$, for every $x\in C(\sigma_Y,Y)$; \item or there exists $x\in C(\sigma_Y,Y)$ such that $\omega(x)\cap\operatorname{Sing}(Y)=\emptyset$, i.e. $\sigma_Y\notin\omega(x)$. \end{enumerate} If Case (1) happens, then all the conditions in Lemma \ref{lem.mixingdominated} are satisfied for $C(\sigma_Y,Y)$ and since $C(\sigma_Y,Y)$ can not intersect a homoclinic class, it follows that $C(\sigma_Y,Y)$ admits a partially hyperbolic splitting $T_{C(\sigma_Y,Y)}M=F^{ss}\oplus F^{cu}$ with respect to the tangent flow. One can see that the bundle $F^{cu}$ is exactly the sectionally expanding subbundle $E^Y$ given by Proposition \ref{prop.sect-exp}. Therefore, $C(\sigma_Y,Y)$ is singular hyperbolic, and by Corollary \ref{cor.unique-ls-class} it is also Lyapunov stable. By the result \cite[Corollary D]{PYY21}, the class $C(\sigma_Y,Y)$ contains a periodic orbit, which is a contradiction to the assumption that $\omega(x)\cap\operatorname{Sing}(Y)\neq\emptyset$ for all $x\in C(\sigma_Y,Y)$. So we are left with Case (2), in which $C(\sigma_Y,Y)$ contains a non-singular compact invariant subset $\Gamma$. Then it follows from Lemma \ref{lem.unique-ls-class} that $W^u(\Gamma,Y)\cap W^s(Q_Y,Y)\neq\emptyset$. Hence $W^u(C(\sigma_Y,Y),Y)\cap W^s(Q_Y,Y)\neq\emptyset$. Applying Lemma \ref{lem.unique-ls-class} to $\Gamma=Q_Y$, we also obtain that $W^u(Q_Y,Y)\cap W^s(\sigma_Y,Y)\neq\emptyset$. Thus $Q_Y\subset C(\sigma_Y,Y)$. This ends the proof of Proposition \ref{prop.ls-class}.
\section{Introduction} In classical statistics, the $\chi^2$ test is used to test the correlation between nominal variables. A contingency table is created for nominal data. On its basis, the $\chi^2$ statistic can be used to assess the significance of the correlation between two nominal variables. The V-Cramer coefficient, also estimated using $\chi^2$ statistics, can be used to measure the strength of this relationship \cite{Blalock1960}. On the other hand, for variables measured in at least an ordinal scale, the Pearson correlation coefficient or the Spearman rank correlation coefficient \cite{Blalock1960}\cite{Francuz2007} are examined. In \cite{Gniazdowski2015} a different approach to the problem was proposed. In this approach, nominal data is given a numerical interpretation. Since a random variable measured on a nominal scale takes k different values, each of the k subsets of identical values will be called a class later in this article. Depending on the cardinality of different classes, the elements of a given class will be coded with real numbers or complex numbers. If there are no classes with equal cardinality, then a given class will be assigned a real number which is a function of the cardinality of the class. If there are m classes of equal cardinality in the considered set of values, then each of these classes is assigned a complex number whose modulus is a function of the cardinality of a given class, and the phase is equal to the phase of one of the m roots of unity. The phases are chosen arbitrarily. However, it is required that the phases for each of the classes with identical cardinalities be different. The properties of numerical coding make it possible to cluster or classify nominal data using algorithms specific to numerical data \cite{Gniazdowski2015}. It remains an open question whether the numerical coding of nominal data mentioned here can be used to assess the level of correlation between coded nominal random variables. This article will attempt to answer this question. For this purpose, the possibility of measuring the strength of the correlation between variables measured in the nominal scale and variables measured in the nominal scale or at least in the ordinal scale will be analyzed. The starting point for this analysis will be two observations: \begin{itemize} \item The correlation coefficient between two random variables has an interpretation of the cosine of the angle between the vectors containing the random components of these variables \cite{Gniazdowski2013}. \item Nominal data can be coded with real or complex numbers. Since in a real and complex vector space it is possible to define the scalar product and the Euclidean norm, it is also possible to calculate the cosine of the angle between the vectors \cite{Gniazdowski2015}. \end{itemize} The examples will show the influence of coding proposed in the paper \cite{Gniazdowski2015} on the possibility of identifying linear correlation between nominal variables. First, examples of correlation analysis for nominal variables described by real numbers will be shown. Next , the possibility of correlation analysis for nominal variables described by complex numbers will be examined and discussed. The analysis will be carried out on artificial data, specially prepared for the purposes of this work\footnote{To present the discussed problems, the author of this article uses artificially prepared data, because so far he has not encountered non-trivial nominal data sets that would contain classes of identical elements with equal cardinalities.}. Sample input data for the analysis will be provided in the form of a contingency table. A contingency table provides a compact representation of data consisting of many records. Since the aim of this article is to attempt to assess the possibility of measuring the strength of correlation between a variable measured on a nominal scale and a variable measured on a nominal or stronger scale, the analyzed data should be selected in such a way that at least one variable can be interpreted as if it had been measured on a scale stronger than nominal, and therefore at least on an ordinal scale. For this reason, an additional restriction is imposed on the contingency table. It is required that after numerical coding of the nominal variables, the second variable may be treated as if it were measured on a scale stronger than the nominal scale: \begin{itemize} \item The first variable will be constructed in such a way that it can be coded using real numbers or complex numbers. In the case of coding with complex numbers, the first variable will contain at least two classes with identical cardinalities. This will be manifested by the fact that at least two rows in the contingency table will have the same sums of elements. \item The second variable will always be constructed in such a way that it can only be coded with real numbers. This will only be possible if the variable does not contain classes with equal cardinalities. This will be manifested by the fact that in the columns of the contingency table the sums of elements will always be different in pairs. This approach will allow the second variable to be treated as if it were measured on a scale with a possible linear order relation, i.e. on a scale stronger than the nominal scale. \end{itemize} Since the second variable will be coded with real numbers with a well-defined linear order relation, the analyzed problem will become equivalent to the problem of examining the strength of the linear correlation relationship between a random variable measured in a nominal scale and a random variable measured in at least an ordinal scale. Thanks to this, the conclusions resulting from the study of correlations for two nominal variables will also be appropriate for the case of correlation between a variable measured in a nominal scale and a variable measured in one of the stronger scales: ordinal, interval or ratio. Finally, there is a comment on the accepted designations. In some mathematical formulas, a line will appear over the letter denoting the variable. If a given subsection concerns the geometric interpretation of correlations between random variables, the line will be placed over the capital letter and will represent the average value of the random variable. On the other hand, when a subsection deals with the definition of a scalar product for vectors containing complex numbers, or concerns correlation for complex random variables, then the line will be over lowercase letters and will indicate the conjugate of a complex number. \section{Preliminaries} The preliminaries will present some ideas to which the author will refer later in this article. Here, the following concepts will be introduced: binary relation, measurement scales, statistics $\chi^2$, strength of the correlation relationship for nominal data, numerical coding of nominal data, geometric interpretation of a correlation, as well as the least squares complex method. \begin{table}[t] \centering \caption{ Properties of a binary relation }\label{tab1} \fontsize{9}{13}\selectfont{ \begin{tabular}{ c||c } The name of property&The essence of a given property\\ \hline\hline Reflexivity&$\forall x\in X:\;x\rho x$ \\\hline Irreflexivity&$\forall x\in X:\;\neg(x\rho x)$. \\\hline Symmetry&$\forall x,y\in X:\;x\rho y\Rightarrow y\rho x$ \\\hline Antisymmetry&$\forall x,y\in X:\;x\rho y \wedge y\rho x\Rightarrow x=y$ \\\hline Connecttivity&$\forall x,y\in X:\;x\rho y \vee y\rho x\vee x=y$ \\\hline Transitivity&$\forall x,y,z\in X:\;x\rho y \wedge y\rho z\Rightarrow x\rho z$ \end{tabular}} \end{table} \subsection{Binary relation}\label{binary} For given sets $ X $ and $ Y $, the binary relation $ \rho $ defined over sets $ X $ and $ Y $ is any subset of the Cartesian product $ X\times Y $. If $ X=Y $, then the relation over the set $ X $ is a subset of the Cartesian product $ X\times X $ \cite{Gniazdowski2011}. Here, only relations over the n-element set $ X $ will be considered. A binary relation can have specific properties. Among others, a binary relation can be reflexive, irreflexive, symmetric, antisymmetric, connected, and transitive (Table \ref{tab1}). The properties of a binary relation determine its type. Several types of relations in particular are important from the point of view of data analysis: \begin{itemize} \item If a relation is reflexive, symmetric, and transitive, it is an equivalence relation. An equivalence relation divides a set into disjoint equivalence classes. \item If the relation is reflexive and symmetric, then it is a similarity relation. The similarity relation divides a set into similarity classes. \item If the relation is reflexive, antisymmetric and transitive, then it is a partial order relation. In a set with a partial order relation, ordering of a set (or sorting in the sense of a given relation) is possible only within certain subsets, and a set with a partial order relation is called a partially ordered set. \item If a relation is a partial order relation and at the same time is connected, then it is a linear order relation (or total order relation). A linear order is a stronger property than a partial order. In a set with a linear order relation, it is possible to fully ordering of a set. \end{itemize} In the set of real numbers $ R $, the following linear order relation is possible: \begin{equation}\label{eq1} \forall m,n\in R\;\; m\rho n\Leftrightarrow m\ge n. \end{equation} In the set of complex numbers $ C $, it is not possible to define the relation in the above way. Here it is possible to define the weaker relation, that is, a partial order relation: \begin{equation}\label{eq2} \forall m,n\in C\;\; m\rho n\Leftrightarrow (m=n)\vee (|m|>|n|). \end{equation} \subsection{Scales of measurement} Measurement (or data collection) assumes the existence of four measurement scales \cite{Stevens1946}: \begin{itemize} \item Nominal scale, \item Ordinal scale, \item Interval scale, \item Ratio scale. \end{itemize} The nominal scale assumes the classification of data into different classes. For data measured on a nominal scale, it can be said that the two measured values are equivalent or different. It cannot be said that one value precedes another. This means that nominal data cannot be sorted in any way. Measurement on the ordinal scale is more precise than measurement on the nominal scale. The ordinal scale allows you to order a set according to the degree to which the elements of the set have certain features, but does not give information about the magnitude of the differences between these elements. The interval scale makes it possible not only to order objects in terms of the degree of possessing a certain feature, but also gives the ability to determine the distance between objects. An interval scale is a continuous numerical scale that has no absolute zero. Zero on the measurement scale is set arbitrarily. An example of interval scale measurement is a temperature measurement in degrees Celsius or degrees Fahrenheit. It is known how much one measurement result is greater than another. However, it is impossible to say how many times one result is greater than the other. For example, for temperature measurement on the Celsius scale, it can be said that the temperature of 27 degrees is 18 degrees higher than the temperature of 9 degrees. On the other hand, it cannot be said that a temperature of 27 degrees is three times higher than a temperature of 9 degrees. The ratio scale has all the features of an interval scale. Its additional feature is that this scale has absolute zero. Therefore, with regard to the measurement results on a ratio scale, it can be said how many times one measurement result is greater than another. An example of a ratio scale is the temperature measurement scale in degrees Kelvin. The concept of measurement scales is closely related to the concept of two types of relations. For elements of a set measured at a nominal scale, an equivalence relation can be defined. For elements of a set measured on an ordinal, interval and ratio scale, a linear order relation can be defined. Thanks to the linear order relation, data measured on ordinal, interval, and ratio scales can also be ranked. \begin{table}[t] \centering \caption{Sample contingency table}\label{tab2} \fontsize{9}{13}\selectfont{ \begin{tabular}{ c||c|c||c } &$ X $&$ Y $&Total\\ \hline \hline $ A $&$ 3 $&$ 0 $&$ 3 $\\ \hline $B$&$2$&$2$&$4$\\ \hline $C$&$0$&$2$&$2$\\ \hline\hline Total&$5$&$4$&$9$\\ \end{tabular}} \end{table} \begin{table}[t] \centering \caption{Random variables $ V_1 $ and $ V_2 $ identified from Table \ref{tab2}}\label{tab3} \fontsize{9}{13}\selectfont{ \begin{tabular}{ c||c } $ V_1 $&$ V_2 $\\ \hline\hline A & X \\\hline A & X \\\hline A & X \\\hline B & X \\\hline B & X \\\hline B & Y \\\hline B & Y \\\hline C & Y \\\hline C & Y \end{tabular}} \end{table} \subsection{The study of the relationship between nominal data in classical statistics} An example of a contingency table for nominal data (Table \ref{tab2}) is given. The table describes the interdependence of two nominal random variables $ V_1 $ and $ V_2 $. The first variable ($ V_1 $) takes three values: $ \{A,B,C\} $. The second variable ($ V_2 $) takes two values: $ \{X,Y\} $. Table \ref{tab3} shows the random variables $ V_1 $ and $ V_2$ reconstructed from the contingency table (Table \ref{tab2}). \begin{table}[t] \centering \caption{Table of expected frequencies estimated from Table \ref{tab2}}\label{tab4} \fontsize{9}{13}\selectfont{ \begin{tabular}{ c||c|c||c } &X&Y&Total\\ \hline \hline A&1.667&1.333&3\\ \hline B&2.222&1.778&4\\ \hline C&1.111&0.889&2\\ \hline \hline Total&5&4&9\\ \end{tabular}} \end{table} \subsubsection{Statistics $ \chi^2 $} Individual cells of the contingency table ($ O_{i,j} $) count the observed frequencies of pairs of different nominal values. Based on the observed frequencies, the relevant elements ($ E_{ij} $) in the expected frequency table (Table \ref{tab4}) can be estimated \cite{Blalock1960}. The $ E_{ij} $ element is equal to the product of the sum of the elements in the i-th row of the contingency table $ (\sum_{j}O_{ij}) $ and the sum of the elements in the j-th column of the contingency table $ (\sum_{i}O_{ij}) $, divided by sum of all elements of the contingency table $ (\sum_{ij}O_{ij}) $: \begin{equation} E_{ij}=\frac{\sum_{j}O_{ij}\cdot\sum_{i}O_{ij}}{\sum_{ij}O_{ij}}. \end{equation} The estimated table of expected frequencies is shown in Table \ref{tab4}. Now, based on the contents of the table of observed frequencies and the table of expected frequencies, the value of the statistic $ \chi^2 $ can be estimated \cite{Blalock1960}: \begin{equation} \chi^2=\sum_{i.j}\frac{\left(O_{ij}-E_{ij}\right)^2}{E_{ij}}. \end{equation} For the contingency table considered here (Table \ref{tab2}), the statistic $ \chi^2 $ is $ 4.95 $. In classical statistics, the value of the $ \chi^2 $ statistic can be used to test the significance of the correlation between the two nominal variables. To do this, a null hypothesis should be formulated and then checked whether the null hypothesis can be rejected. \subsubsection{Testing the null hypothesis} The null hypothesis assumes that the examined variables are independent of each other, i.e. there is no correlation between the variables $ V_1 $ and $ V_2 $. The negation of the null hypothesis is the alternative hypothesis, which says that the variables $ V_1 $ and $ V_2 $ are significantly correlated. If the null hypothesis is rejected, the alternative hypothesis should be accepted instead. Denoting by r and c respectively the number of rows and the number of columns in the contingency table, the number of degrees of freedom of the test is obtained: \begin{equation} d_f=\left(r-1\right)\times\left(c-1\right). \end{equation} For the example considered here, $ d_f=\left(3-1\right)\left(2-1\right)=2 $. The probability $ p $ is estimated as the integral of the distribution function $ \chi^2 $: \begin{equation} p=\int_{\chi^2}^{\infty}f\left(x,d_f\right)dx. \end{equation} If the probability $ p $ is small enough, the null hypothesis can be rejected. Assuming that the significance level $ \alpha=0.1 $, the null hypothesis can be rejected when the obtained probability $ p $ is less than $ \alpha $. For the example in Table \ref{tab2}, the estimated probability $ p $ is $ 0.0841 $. This means that at the significance level $ \alpha=0.1 $, the null hypothesis should be rejected. At the same time, the alternative hypothesis, which says that both variables are significantly correlated, should be accepted. The $ \chi^2 $ test also has its limitations. When using this test, it is required that the expected frequencies be not less than five \cite{Blalock1960}. Some sources state that expected frequencies should not be less than ten \cite{Francuz2007}\cite{StatSoft2011}. If the expected numbers are too small, Yates' correction or Fisher's exact test \cite{Blalock1960}\cite{Francuz2007}\cite{StatSoft2011} is used for contingency tables of size $ 2\times2 $. For tables of larger sizes, Fisher's exact test is a combinatorial problem of high computational complexity. For such a case, a graph algorithm was proposed that extends the feasibility limits of Fisher's exact test \cite{Mehta1983}. \subsubsection{The strength of the correlation relationship} Regardless of the significance assessment, the $ \chi^2 $ statistic can also be used to estimate the strength of the correlation relationship. For this, you can use the V-Cramer coefficient, which takes values in the range $ [0,1] $. The square of the V-Cramer coefficient can be calculated using the formula: \begin{equation}\label{eq15} V^2=\frac{\chi^2}{N\cdot\min{\left(r-1,c-1\right)}}. \end{equation} In formula (\ref{eq15}), $ N $ is the number of observations. In the considered case $ N=9 $ and the calculated value of the coefficient $ V^2 $ is $ 0.550 $. \subsection{Numerical coding of nominal data} In statistics, in some cases, the numerical values of the observation results are replaced by their ranks. The ranking procedure consists in the fact that first the data set is sorted in non-decreasing order, and then its successive elements are assigned a rank equal to its position in the sorted set \cite{Wilcoxon1945}. It may happen that in a sorted set there will be elements with identical values. In this case, the ranks assigned to identical values should be the same. When a sorted set contains elements with identical values, these elements are assigned a rank equal to the average value of their positions in the sorted set \cite{Wilcoxon1945}. In this case, we talk about tied ranks. It should be emphasized that the value of assigned ranks depends on two factors. The first factor is the numerical value of the element in the set to be sorted. The second factor is the number of elements with equal values. In the case of nominal data, it is not possible to establish a linear order relation. A potential method of ranking nominal data could not use element sorting. On the other hand, intuition suggests that in a statistical collectivity, both in the case of numerical data and nominal data, an element with a higher cardinality is more important than an element with a lower cardinality. Therefore, a proposal arises to rank nominal variables, starting from the cardinality of their individual values. \subsubsection{The case of classes with different cardinality}\label{rangi} A specific feature of nominal data is that it cannot be sorted by values, but can be clustered by identical values. In a given class containing $ n $ identical elements, these elements can be numbered with numbers from $ 1 $ to $ n $. By analogy with tied ranks, each of the identical elements can be assigned a rank equal to the average value of the assigned numbers: \begin{equation}\label{eq16} R=\frac{\left(n+1\right)}{2}. \end{equation} The rank of elements in the class with higher cardinality will be greater than the rank of elements belonging to the class of lower cardinality. Hence, it can be seen that in the set with ranks defined by the formula (\ref{eq16}) a linear order relation (\ref{eq1}) is possible. \subsubsection{The case of classes with equal cardinality} For classes with identical cardinalities, method (\ref{eq16}) would give identical ranks. This would lead to a situation where, after coding, elements belonging to classes with identical cardinalities would be indistinguishable. To prevent this, the method should be modified. If the nominal variable contains $ k $ different classes with identical cardinality, then the elements of the j-th class ($ j=0,1,\ldots,k-1 $) can be coded with $ k $ successive complex roots of unity: \begin{equation} R_j=R\cdot\sqrt[k]{1}=R\cdot e^{i\cdot\frac{2\pi j}{k}}=R\left(\cos{\frac{2\pi j}{k}}+i\sin{\frac{2\pi j}{k}}\right). \end{equation} In the above expression $ i=\sqrt{-1} $ , $ \varphi=2\pi j/k $ is the phase arbitrarily assigned to the successive (j-th) class, and $ R $ is the rank calculated according to the formula (\ref{eq16}) - the same as in the case of classes with different cardinalities. In the presented concept, $ R $ is a module of complex rank, depending on the cardinality of a given nominal value in the set. This approach assigns identical rank modules to classes with identical cardinalities, and distinguishes classes with identical cardinalities by their different phases. Unfortunately, unlike in a set with real ranks, a linear order relation is not possible in a set with complex ranks. Here only the partial order relation (\ref{eq2}) is possible. \subsubsection{Properties of numerical coding} Data coded with numbers (real or complex) acquire additional properties \cite{Gniazdowski2015}: \begin{itemize} \item Within a given variable, all classes are mutually distinguishable. \item The module of the number assigned to a given class contains information about the cardinality of the class, and thus about its statistical strength. \item In the phase of the complex number assigned to a given class, information about the number of classes with identical cardinality is contained. \end{itemize} Random variables gain the properties of vectors in numerical space (real or complex), on which arithmetic operations such as sum, difference, product, quotient, as well as exponentiation and root can be performed. In a complex vector space, it is also possible to define the scalar product: \begin{equation} \left(x,y\right)=\sum_{i=0}^{n}{x_i\overline{y_i}}. \end{equation} Based on the above definition of the scalar product, the Euclidean norm can also be defined: \begin{equation} ||x||=\sqrt{(x,x)}. \end{equation} If a norm is defined, then a metric can also be consistently defined: \begin{equation} \rho\left(x,y\right)=||y-x||. \end{equation} Since the real number is a special case of a complex number, the above formulas for the scalar product, the Euclidean norm and the metric are also valid when coding nominal variables with real numbers. And the ability to define a metric allows the use of numerical coding for the purposes of clustering and classification \cite{Gniazdowski2015}. \subsection{Geometric interpretation of the correlation coefficient} The measure of the relationship between two random variables is their covariance: \begin{equation} Cov(X,Y)=E[(X-\overline{X})(Y-\overline{Y})]. \end{equation} The covariance normalized to unity is called the Pearson correlation coefficient: \begin{equation} R(X,Y)=\frac{Cov(X,Y)}{s_X s_Y}=\frac{E[(X-\overline{X})(Y-\overline{Y})]}{\sqrt{E[(X-\overline{X})^2]}\sqrt{E[(Y-\overline{Y})^2]}}. \end{equation} This expression can be further transformed to the form: \begin{equation} R(X,Y)=\frac{\sum_{i=1}^{n}[(X_i-\overline{X})(Y_i-\overline{Y})]}{\sqrt{\sum_{i=1}^{n}(X_i-\overline{X})^2}\sqrt{\sum_{i=1}^{n}(Y_i-\overline{Y})^2}}. \end{equation} Denoting the random components of both variables $ X $ and $ Y $ as $ x=X-\overline{X} $ and $ y=Y-\overline{Y} $, the formula for the correlation coefficient can be transformed into: \begin{equation} R(X,Y)=\frac{\sum_{i=1}^{n}{x_iy_i}}{\sqrt{\sum_{i=1}^{n}x_i^2}\sqrt{\sum_{i=1}^{n}y_i^2}}. \end{equation} In the numerator of the above formula there is the scalar product of the vectors $ x $ and $ y $, and in the denominator there is the product of the lengths of these vectors. This quotient expresses the cosine of the angle between the two vectors. This means that the correlation coefficient is identical to the cosine of the angle between the random components of random variables \cite{Gniazdowski2013}: \begin{equation}\label{eq7} R(X,Y)=\frac{\sum_{i=1}^{n}{x_iy_i}}{\sqrt{\sum_{i=1}^{n}x_i^2}\sqrt{\sum_{i=1}^{n}y_i^2}}=\frac{x\cdot y}{||x||\cdot ||y||}=cos(\angle x,y). \end{equation} \subsubsection{Linear transformation of a random variable}\label{linear} A random variable $ X $ can be represented as the sum of its mean value $ \overline{X} $ and its random component $ x $: \begin{equation} X=\overline{X}+x. \end{equation} It can be seen that the linear transformation ($ a+bX $) of a random variable $ X $ does not change the direction of the vector representing its random component: \begin{equation} a+bX=a+b(\overline{X}+x)=a+b\overline{X}+bx. \end{equation} The constant $ a+b\overline{X} $ represents the mean value of variable $ X $ after a linear transformation. The random component $ x $ becomes a new random component $ bx $ after the transformation of the variable $ X $. Since the vector $ bx $ is parallel to the vector $ x $, and the correlation coefficient is formally identical to the cosine of the angle between the vectors representing the random components of two random variables, this linear transformation does not change the modulus of the correlation coefficient. \subsection{Pearson correlation coefficient for complex random variables} By analogy, a method of calculating the correlation coefficient for complex random variables can be proposed. If $ x $ and $ y $ are the random components of the complex random variables $ X $ and $ Y $, then the correlation coefficient found as the cosine of the angle between the random components has the following form: \begin{equation} R=\frac{Cov(X,Y)}{\sqrt{var(X)var(Y)}}=\frac{E[x\overline{y}]}{\sqrt{E[x\overline{x}]E[y\overline{y}]}}=\frac{\sum_{i=1}^{n}x_i\overline{y_i}}{\sqrt{\sum_{i=1}^{n}x_i\overline{x_i}}\sqrt{\sum_{i=1}^{n}y_i\overline{y_i}}}. \end{equation} As noted in the introduction, in the formula above, $\overline{x}$ and $\overline{y}$ are conjugates of the complex numbers $x$ and $y$. \subsection{Least squares complex method} A linear model of $ \widehat{y} $ of a complex variable $ y $ with respect to complex variables $ x_1,x_2,\ldots,x_s $ is considered. The vector $ y=\left[y_1,y_2\ldots y_n\right]^T $ is the dependent variable of the model. The vector $ \widehat{y}=\left[\widehat{y}_1,\widehat{y}_2\ldots\widehat{y}_n\right]^T $ is the estimate of the variable $ y $. For successive realizations of variables $ x_1,x_2,\ldots,x_s $ successive approximations of the vector $ y $ are obtained in the form of calculated values of $ \widehat{y} $: \begin{equation} \begin{matrix}\begin{matrix}{\widehat{y}}_1=b_0+b_1x_{11}+\ldots+b_sx_{1s}\\{\widehat{y}}_2=b_0+b_1x_{21}+\ldots+b_sx_{2s}\\\vdots\\\end{matrix}\\{\widehat{y}}_n=b_0+b_1x_{n1}+\ldots+b_sx_{ns}\\\end{matrix}. \end{equation} The above system of equations can be represented in matrix notation: \begin{equation} \widehat{y}=Xb. \end{equation} In the above equation, the following notations were assumed: \begin{itemize} \item The matrix X represents the independent variables of the model: \begin{equation} X=\left[\begin{matrix}\begin{matrix}1&x_{11}&\ldots\\\vdots&\vdots&\vdots\\1&x_{n1}&\ldots\\\end{matrix}&\begin{matrix}x_{1s}\\\vdots\\x_{ns}\\\end{matrix}\\\end{matrix}\right]. \end{equation} \item The vector $ b=\left[b_0,b_1\ldots b_s\right]^T $ is the vector of the model parameters. \item The vector $ e=\left[e_1,e_2\ldots e_n\right]^T=y-\widehat{y} $ is the error vector of the model. \end{itemize} The measure of model error is the quantity $ Q $, which is the square of the Euclidean norm of the error vector $ e $. Denoting the Hermitian transposition\footnote{The Hermitian transposition (or conjugate transposition) of a complex vector or complex matrix is understood as the composition of the transposition and conjugate of that vector or matrix, respectively.} of a vector (or matrix) $ M $ as $ M^H $, the measure of error of the model takes the form: \begin{equation} Q\left(b\right)=||e||^2=e^H\cdot e=(y-\widehat{y})^H\cdot (y-\widehat{y})=(y-Xb)^H\cdot(y-Xb). \end{equation} After multiplication, the error measure takes the form: \begin{equation} Q\left(b\right)=\left(y-Xb\right)^H\left(y-Xb\right)=y^Hy-y^HXb-b^HX^Hy+b^HX^HXb. \end{equation} It can be seen that the error measure Q (the square of the Euclidean norm) is the sum of the four real terms. On the other hand, $ y^HXb $ is a Hermitian transposition of $ b^HX^Hy $. Since the Hermitian transposition of a real number does not change its value, the equality holds: \begin{equation} y^HXb=b^HX^Hy. \end{equation} Therefore, the expression for $ Q\left(b\right) $ can be simplified a bit: \begin{equation} Q\left(b\right)=y^Hy-2b^HX^Hy+b^HX^HXb. \end{equation} The model error measure depending on model parameters $ b $ should be minimal. Hence: \begin{equation} \frac{\partial Q}{\partial b}=-2X^Hy+2X^HXb=0. \end{equation} After transformation, a system of normal equations is obtained \cite{Mok2014}\cite{whuber}: \begin{equation}\label{eq29} X^HXb=X^Hy. \end{equation} \begin{table}[t] \centering \caption{Nominal data from Table \ref{tab3} coded with numbers}\label{tab5} \fontsize{9}{13}\selectfont{ \begin{tabular}{ c||c } $ V_1 $ & $ V_2 $ \\ \hline \hline 2 & 3 \\ \hline 2 & 3 \\ \hline 2 & 3 \\ \hline 2.5 & 3 \\ \hline 2.5 & 3 \\ \hline 2.5 & 2.5 \\ \hline 2.5 & 2.5 \\ \hline 1.5 & 2.5 \\ \hline 1.5 & 2.5 \\ \end{tabular}} \end{table} \section{Study of linear correlation between nominal random variables coded with numbers}\label{korelacje} Nominal data can be coded using real or complex numbers. On the one hand, the correlation coefficient between real random vectors has an interpretation of the cosine of the angle between their random components \cite{Gniazdowski2013}. On the other hand, for vectors in complex space, one can define the scalar product and the Euclidean norm, so one can also calculate the cosine of the angle between their random components. Similarly to the real space, this cosine can be interpreted as a correlation coefficient between complex random variables. \subsection{Example No. 1 - Nominal data coded with real numbers}\label{examp1} After coding the data from Table \ref{tab2}, their numerical representation was obtained as presented in Table \ref{tab5}. For the data from Table \ref{tab5}, the correlation coefficient $ R\left(V_1,V_2\right)=0.253 $ was obtained. The problem was also investigated for many other datasets where both random variables could be coded with real numbers. Coding with real numbers introduced a linear order to the set of nominal data. In all analyzed cases, unambiguous real measures of linear correlation were obtained. \subsection{Nominal data coded with complex numbers} It can be seen that in Example No. 1 (Subsection \ref{examp1}), for a given variable, its different classes had different cardinalities. That is, they could be coded with different real numbers. It should be investigated whether the existence of classes with equal cardinality also allows the estimation of correlations between variables. \begin{table}[t] \centering \caption{Contingency table for nominal data with a random variable $ V_1 $ containing two classes ($ A $ and $ B $) with identical cardinalities}\label{tab6} \fontsize{9}{13}\selectfont{ \begin{tabular}{ c||c|c||c } &X&Y&Total\\ \hline \hline A&3&1&4\\ \hline B&2&2&4\\ \hline \hline Total&5&3&8\\ \end{tabular}} \end{table} \begin{table}[t] \centering \caption{Observation table identified from Table \ref{tab6}}\label{tab7} \fontsize{9}{13}\selectfont{ \begin{tabular}{ c||c } $ V_1 $&$ V_2 $\\ \hline \hline A&X \\ \hline A&X \\ \hline A&X \\ \hline A&Y \\ \hline B&X \\ \hline B&X \\ \hline B&Y \\ \hline B&Y \\ \end{tabular}} \end{table} \begin{table}[t] \centering \caption{Data from Table \ref{tab7} after complex coding of variables $ V_1 $ and $ V_2 $. In the columns $ V_{11} $ and $ V_{12} $ two phase permutations are taken into account }\label{tab8} \fontsize{9}{13}\selectfont{ \begin{tabular}{ c|c||c } $ V_{11} $&$ V_{12} $&$ V_2 $\\ \hline \hline $ -2.5+0i $&$ 2.5+0i $& 3 \\ \hline $ -2.5+0i $&$ 2.5+0i $&3\\ \hline $ -2.5+0i $&$ 2.5+0i $&3\\ \hline $ -2.5+0i $&$ 2.5+0i $&2\\ \hline $ 2.5+0i $&$ -2.5+0i $&3\\ \hline $ 2.5+0i $&$ -2.5+0i $&3\\ \hline $ 2.5+0i $&$ -2.5+0i $&2\\ \hline $ 2.5+0i $&$ -2.5+0i $&2\\ \end{tabular}} \end{table} \begin{figure}[t] \centering \includegraphics[width=0.65\textwidth]{Obraz1.png} \caption{The correlation coefficients between variables $V_1$ and $V_2$ presented in the complex plane for the coded data from Table \ref{tab7}, obtained for $2!=2$ different phase permutations}\label{fig1} \end{figure} \subsubsection{Example No. 2 – nominal variable with two classes with identical cardinalities}\label{examp2} Table \ref{tab6} shows an example of a contingency table in which the first nominal variable contains two classes with identical cardinalities. These are classes containing values $ A $ and $ B $. Table \ref{tab7} shows the reconstructed random variables $ V_1 $ and $ V_2 $. Since the variable $ V_1 $ takes the value of $ A $ four times and also takes the value of $ B $ four times, the modulus of numbers used to code these values is $ 2.5 $. On the other hand, the arbitrarily adopted phase allowing to distinguish the values of $ A $ and $ B $ after their complex coding is $ \varphi=0^0 $ and $ \varphi={180}^0 $, respectively. Since the phase for complex coding is chosen arbitrarily, the question arises about the influence of the selected phase on the value of the correlation coefficient. For two classes with identical cardinalities, the phases can be chosen in $ 2!=2 $ ways. Both ways of coding a random variable $ V_1 $ are shown in the first two columns of Table \ref{tab8} ($ V_{11} $ and $ V_{12} $). The third column shows the variable $ V_2 $ after coding. For the data from Table \ref{tab8}, correlation coefficients have been estimated, which are $ R\left(V_1,V_2\right)=-0.258 $ and $ R\left(V_1,V_2\right)=0.258 $, respectively. The correlation coefficients for different phase permutations are shown in Figure \ref{fig1}. Comparing both values of the estimated correlation coefficients, it should be noted that their values result from the arbitrarily assigned phase in the coding of the nominal variable with two classes with identical cardinalities. It can be seen that both values of the correlation coefficient are located on the real axis symmetrically with respect to the center of the coordinate system. This means that the obtained solution is not unambiguous. \begin{table}[t] \centering \caption{Contingency table for nominal data with a random variable containing three classes ($ A $, $ B $ and $ C $) with identical cardinalities}\label{tab9} \fontsize{9}{13}\selectfont{ \begin{tabular}{ c||c|c||c } &$ X $&$ Y $&Total\\ \hline \hline A&1&4&5\\ \hline B&2&3&5\\ \hline C&3&2&5\\ \hline D&1&2&3\\ \hline \hline Total&7&11&18\\ \end{tabular}} \end{table} \begin{table}[t] \centering \caption{Data from the Table \ref{tab9} after coding variables $V_1$ and $ V_2 $. The first six columns show the representations of the $ V_1 $ variable obtained for different phase permutations}\label{tab10} \fontsize{9}{13}\selectfont{ \begin{tabular}{ c|c|c|c|c|c||c } $V_{11}$&$V_{12}$&$V_{13}$&$V_{14}$&$V_{15}$&$V_{16}$&$V_2$\\ \hline\hline 3&-1.5+2.6i&-1.5-2.6i&3&-1.5+2.6i&-1.5-2.6i&4\\\hline 3&-1.5+2.6i&-1.5-2.6i&3&-1.5+2.6i&-1.5-2.6i&6\\\hline 3&-1.5+2.6i&-1.5-2.6i&3&-1.5+2.6i&-1.5-2.6i&6\\\hline 3&-1.5+2.6i&-1.5-2.6i&3&-1.5+2.6i&-1.5-2.6i&6\\\hline 3&-1.5+2.6i&-1.5-2.6i&3&-1.5+2.6i&-1.5-2.6i&6\\\hline -1.5+2.6i&3&3&-1.5-2.6i&-1.5-2.6i&-1.5+2.6i&4\\\hline -1.5+2.6i&3&3&-1.5-2.6i&-1.5-2.6i&-1.5+2.6i&4\\\hline -1.5+2.6i&3&3&-1.5-2.6i&-1.5-2.6i&-1.5+2.6i&6\\\hline -1.5+2.6i&3&3&-1.5-2.6i&-1.5-2.6i&-1.5+2.6i&6\\\hline -1.5+2.6i&3&3&-1.5-2.6i&-1.5-2.6i&-1.5+2.6i&6\\\hline -1.5-2.6i&-1.5-2.6i&-1.5+2.6i&-1.5+2.6i&3&3&4\\\hline -1.5-2.6i&-1.5-2.6i&-1.5+2.6i&-1.5+2.6i&3&3&4\\\hline -1.5-2.6i&-1.5-2.6i&-1.5+2.6i&-1.5+2.6i&3&3&4\\\hline -1.5-2.6i&-1.5-2.6i&-1.5+2.6i&-1.5+2.6i&3&3&6\\\hline -1.5-2.6i&-1.5-2.6i&-1.5+2.6i&-1.5+2.6i&3&3&6\\\hline 2&2&2&2&2&2&4\\\hline 2&2&2&2&2&2&6\\\hline 2&2&2&2&2&2&6\\ \end{tabular}} \end{table} \begin{figure}[t] \centering \includegraphics[width=0.80\textwidth]{Obraz2.png} \caption{The correlation coefficients between variables $V_1$ and $V_2$ presented in the complex plane for the coded data from Table \ref{tab10}, obtained for $3!=6$ different phase permutations}\label{fig2} \end{figure} \subsubsection{Example No. 3 - nominal variable with three classes with identical cardinalities}\label{examp3} Another example of data is presented in Table \ref{tab9}. Variable $ V_1 $ contains three classes of elements with equal cardinality. These are classes $ A $, $ B $ and $ C $. There is also a class $ D $ with cardinality other than classes $ A $, $ B $ and $ C $. Classes $ A $, $ B $ and $ C $ contain $ 5 $ elements each. Class $ D $ contains $ 3 $ elements. The nominal value of $ D $ was coded with the real number $ 2=\left(3+1\right)/2 $. The nominal values $ A $, $ B $ and $ C $ are assigned the modulus $ 3=(5+1)/2 $. An arbitrary phase allowing to distinguish the coded values of $ A $, $ B $ and $ C $ can take one of three values $ \varphi=0^0 $, $ \varphi={120}^0 $ and $ \varphi={240}^0 $, respectively. In table \ref{tab10}, the first six columns show the coded prime variable for all $ 6=3! $ phase permutations. The second index digit in the variable name $ V_1 $ is used to distinguish permutations. The last column of Table \ref{tab10} also shows the variable $ V_2 $ after coding. For the data in Table \ref{tab10}, six complex correlation coefficients between the $ V_1 $ and $ V_2 $ variables were estimated, for different phase permutations attributed to different values of the $ V_1 $ variable belonging to classes having identical cardinalities. The obtained results are presented in the complex plane in Figure \ref{fig2}. It can be seen that the obtained correlation coefficients are distributed in the complex plane symmetrically with respect to the point with the coordinate $ 0.013 $ lying on the real axis. In contrast to the previous example, the center of symmetry for all obtained correlation coefficients is outside the central point of the complex plane. This is because in the current example, the variable $ V_1 $, in addition to the three equal-cardinality classes containing the values $ A $, $ B $, and $ C $, also has a class $ D $ with a cardinality different from classes $ A $, $ B $, and $ C $. As in the previous example, the solution obtained is not unambiguous. \begin{table}[t] \centering \caption{Contingency table for data with random variable $V_1$ containing four classes ($ U $, $ W $, $ X $ and $ Y $) with the same cardinality}\label{tab11} \fontsize{9}{13}\selectfont{ \begin{tabular}{ c||c|c|c|c||c } &A&B&C&D&Total\\ \hline \hline U&45&20&13&12&90\\ \hline W&15&45&20&10&90\\ \hline X&5&8&50&27&90\\ \hline Y&8&10&17&55&90\\ \hline Z&10&30&50&450&540\\ \hline \hline Total&83&113&150&554&900 \end{tabular}} \end{table} \begin{figure}[t] \centering \includegraphics[width=0.99\textwidth]{Obraz3.png} \caption{The correlation coefficients between variables $V_1$ and $V_2$ presented in the complex plane for the coded data from Table \ref{tab11}, obtained for $ 4!=24 $ different phase permutations}\label{fig3} \end{figure} \subsubsection{Example No. 4 - nominal variable with four classes with identical cardinalities}\label{examp4} Another example of data is shown in Table \ref{tab11}. The variable $ V_1 $ contains four classes with equal cardinality, containing the values of $ U $, $ W $, $ X $ and $ Y $. This variable also contains a class of $ Z $ values whose cardinality is different from the cardinality of classes $ U $, $ W $, $ X $ and $ Y $. The variable $ V_1 $ was coded using complex numbers. Since the variable $ V_1 $ contains four classes with the same cardinality, $ 4!=24 $ different phase permutations are possible. For all these permutations, Figure \ref{fig3} shows all possible values of correlation coefficients between variable $ V_1 $ and variable $ V_2 $ in the complex plane. Since the variable $ V_1 $ contains a class of $ Z $ values with a cardinality different from the cardinality of classes $ U $, $ W $, $ X $ and $ Y $, therefore also this time the estimated correlation coefficients are not symmetric with respect to the center of the coordinate system. The results are distributed symmetrically around a point with the coordinate $ 0.542 $ on the real axis. In this case, too, no unambiguous solution was obtained. \begin{table}[t] \centering \caption{Contingency table for data with random variable $V_1$ containing five classes ($ A $, $ B $, $ C $, $ D $ and $ E $) with the same cardinality}\label{tab12} \fontsize{9}{13}\selectfont{ \begin{tabular}{ c||c|c|c||c } &X&Y&Z&Total\\ \hline \hline A&200&120&130&450\\ \hline B&250&100&100&450\\ \hline C&50&80&320&450\\ \hline D&170&130&150&450\\ \hline E&300&100&50&450\\ \hline \hline Total&970&530&750&2250 \end{tabular}} \end{table} \begin{figure}[t] \centering \includegraphics[width=0.99\textwidth]{Obraz4.png} \caption{The correlation coefficients between variables $V_1$ and $V_2$ presented in the complex plane for the coded data from Table \ref{tab12}, obtained for $ 5!=120 $ different phase permutations}\label{fig4} \end{figure} \subsubsection{Example No. 5 – nominal variable with five classes with identical cardinalities}\label{examp5} Another example of nominal data is shown in Table \ref{tab12}. In the considered example, the first variable takes $ 450 $ times each of the values from the set $ \{A,B.C,D,E\} $. For five classes with equal cardinality, the number of different codings resulting from the phase permutations is $ 5!=120 $. For all these cases, complex correlation coefficients were estimated between both variables. $ 120 $ different correlation coefficients were obtained, which are presented in the complex plane in Figure \ref{fig4}. Since all classes contained in the set of values of the first variable have equal cardinality, therefore the obtained correlation coefficients are distributed symmetrically with respect to the center of the coordinate system. \section{Linear correlation ambiguity problem with complex coding of nominal data} The examples show that for nominal data coded with complex numbers, the problem of finding the linear correlation coefficient is ambiguous. Complex coding of $ k $ equal-cardinality classes assumes that each of these classes is coded with a complex number of equal modulus and with an arbitrarily chosen phase equal to the phase of one of the $ k $ roots of unity. Therefore, $ k $ classes of equal cardinality can be assigned phases in $ k! $ ways. This means that a nominal random variable can be represented in $ k! $ ways. For these $ k $! possible representations of the first random variable and a unique representation of the second random variable, $ k! $ different complex correlation coefficients are obtained. In the complex plane, these correlation coefficients are symmetrical about some point on the real axis. In real space, the correlation coefficient is identical to the cosine of the angle between the random components of two random variables. Calculating the cosine of an angle in a complex space and treating it as a correlation coefficient, due to ambiguity, does not lead to a satisfactory result. \subsection{Searching for invariants with respect to phase permutations in complex coding of nominal data} Since the measure of linear correlation cannot be the cosine of the angle between the vectors representing the random components of complex random variables, an attempt was also made to find alternative correlation measures that would be invariant with respect to phase permutations between classes with equal cardinalities. For this purpose, a linear correlation between the $ V_2 $ variable and its model $ \widehat{V_2}=f\left(V_1\right) $ was considered. First, tests were carried out for the linear model $ f(V_1) $, and then for the non-linear model. \begin{table}[t] \centering \caption{ Comparison between the correlation coefficients $R\left(V_1,V_2\right)$ and $R\left(V_2,\widehat{V_2}\right)$ for the coded data from Table \ref{tab10}, obtained for $3!=6$ different phase permutations}\label{tab13} \fontsize{9}{13}\selectfont{ \begin{tabular}{ c|c|c|c|c } No.&$ R\left(V_1,V_2\right) $&$ |R\left(V_1,V_2\right)|$&$ \widehat{V_2}=b_0+b_1 V_1 $&$ R\left(V_2,\widehat{V_2}\right) $ \\ \hline \hline 1&0.194+0.104i&0.220&$\left(5.200+0.012i\right)+\left(0.067+0.036i\right) V_1$&0.220\\ \hline 2&0.013+0.209i&0.209&$\left(5.221+0.024i\right)+\left(0.005-0.072i\right) V_1$&0.209\\ \hline 3&0.013-0.209i&0.209&$\left(5.221-0.024i\right)+\left(0.005+0.072i\right) V_1$&0.209\\ \hline 4&0.194-0.104i&0.220&$\left(5.200-0.012i\right)+\left(0.067+0.036i\right) V_1$&0.220\\ \hline 5&-0.167+0.104i&0.197&$\left(5.241+0.012i\right)-\left(0.058+0.036i\right) V_1$&0.197\\ \hline 6&-0.167-0.104i&0.197&$\left(5.241-0.012i\right)-\left(0.058-0.036i\right) V_1$&0.197 \end{tabular}} \end{table} \subsubsection{Correlation between variable $ V_2 $ and linear model $ \widehat{V_2}=f\left(V_1\right) $} In the considered cases, the data were selected in such a way that the first (only the first) random variable had classes with identical cardinality. For these classes, all phase permutations were taken into account in their complex coding. For many pairs of random variables, the least squares method was used to identify linear models of variable $ V_2 $ with respect to the complex variable $ V_1 $. To solve the complex system of normal equations (\ref{eq29}, the Gaussian elimination algorithm with partial pivoting was used \cite{Dryja1982}\cite{Kielbasinski1992}. In all cases, complex correlations between the $ V_2 $ variable and its $ \widehat{V_2} $ model were estimated. These correlations depended on phase permutations, and the correlation modulus was identical to the linear correlation modulus between variables $ V_1 $ and $ V_2 $. Table \ref{tab13} shows an example of the data from Table \ref{tab9}. The table compares the correlation coefficients$ R\left(V_1,V_2\right) $ obtained for all phase permutations from Table \ref{tab10} with the correlation coefficients $ R\left(V_2,\widehat{V_2}\right) $ obtained for the same phase permutations. As a result of the research, it was found that the correlation between the variable and its linear model is not invariant with respect to phase permutations. Therefore, it cannot be considered as a practical measure of the correlation between a nominal random variable and a random variable measured on a nominal scale or on a stronger measurement scale. \begin{figure}[t] \centering {\subfloat[] {\label{figure5a} \includegraphics[width=0.475\textwidth]{Rys5a.png} } \, \subfloat[] {\label{figure5b} \includegraphics[width=0.475\textwidth]{Rys5b.png} } \caption{Approximation of the relationship $ \widehat{V_2}=f\left(V_1\right) $ for $ k $ of different values contained in the variable $ V_1 $: (a) straight line for $ k=2 $; (b) a polynomial of the third degree for $ k=4 $}\label{fig5}} \end{figure} \begin{table}[t] \centering \caption{Comparison of correlation coefficients between variable $V_2$ and its non-linear model $\widehat{V_2}=f(V_1)$ for the coded data from Table \ref{tab10}, obtained for $3!=6$ different phase permutations}\label{tab14} \fontsize{8}{13}\selectfont{ \begin{tabular}{ c|c|c } No.&$\widehat{V_2}=b_0+b_1V_1+b_2V_1^2+b_3V_1^3$&$R\left(V_2,\widehat{V_2}\right)$\\ \hline \hline 1&$\left(5.074+0.036i\right)+\left(0.067-0.038i\right) V_1+\left(0.022+0.013i\right) V_1^2+\left(0.005-0.001i\right) V_1^3$&0.31\\ \hline 2&$\left(5.389+0.073i\right)+\left(0.000-0.077i\right) V_1+\left(0.000+0.026i\right) V_1^2-\left(0.007+0.003i\right) V_1^3$&0.31\\ \hline 3&$\left(5.389-0.073i\right)+\left(0.000+0.077i\right) V_1+\left(0.000-0.026i\right) V_1^2-\left(0.007-0.003i\right) V_1^3$&0.31\\ \hline 4&$\left(5.074-0.036i\right)+\left(0.067+0.038i\right) V_1+\left(0.022-0.013i\right) V_1^2+\left(0.005+0.001i\right) V_1^3$&0.31\\ \hline 5&$\left(5.705+0.036i\right)-\left(0.067+0.038i\right) V_1-\left(0.022-0.013i\right) V_1^2-\left(0.019+0.001i\right) V_1^3$&0.31\\ \hline 6&$\left(5.705-0.036i\right)-\left(0.067-0.038i\right) V_1-\left(0.022+0.013i\right) V_1^2-\left(0.019-0.001i\right) V_1^3$&0.31 \end{tabular}} \end{table} \subsubsection{Correlation between variable $ V_2 $ and non-linear model $ \widehat{V_2}=f\left(V_1\right)$}\label{nonlin} Due to the resulting ambiguities of linear correlation, another attempt was made to find a measure used to assess the strength of the correlation relationship. This time the non-linear correlation was studied. If the nominal variable $ V_1 $ contains $ k $ classes, then after numerical coding this variable takes $ k $ of different complex or real values. Each value of the variable $ V_1 $ corresponds to some (real) values representing the variable $ V_2 $. The relationship $ \widehat{V_2}=f\left(V_1\right) $ can be described by a polynomial of degree $ k-1 $. This relationship can be identified by the method of least squares. This is symbolically illustrated by the examples in Figure \ref{fig5}. For $ k=2 $, the relationship is approximated by a straight line (Figure \ref{fig5}(a)), and for $ k=4 $ it is a polynomial of the third degree (Figure \ref{fig5}(b)). By finding the correlation coefficient between the values calculated using the $ \widehat{V_2}=f\left(V_1\right) $ model and the numerical values representing the $ V_2 $ variable, the non-linear correlation between the $ V_1 $ variable and the $ V_2 $ variable can be estimated. If among all $ k $ different values of the variable $ V_1 $ there are $ m $ classes with equal cardinality ($ m\le k $), then these classes are coded with complex numbers. For all these classes, the moduli of the complex numbers are identical. To distinguish between classes of equal cardinality, modules were arbitrarily assigned phases of successive roots of degree $ m $ of unity. For different phase permutations, different coefficients in the identified polynomial will also be obtained. The question remains whether the correlation coefficients between the values calculated using the $ \widehat{V_2} $ model and the numerical values representing the $ V_2 $ variable change for different phase permutations. The problem posed in this way was tested for many different data sets in which there were classes with equal cardinality. Variables with two, with three, with four and also with five classes with the same cardinalities were tested. For each data set, for all phase permutations, non-linear models $ \widehat{V_2}=f(V_1) $ were identified using the least squares method. For two, three, four and five identical cardinalities, $ 2!=2 $, $ 3!=6 $, $ 4!=24 $ and $ 5!=120 $ polynomials were identified, respectively. In all tested cases, regardless of the phase permutations for the coded nominal values of the random variable, the linear correlation coefficient $ R(V_2,\widehat{V_2}) $ between the non-linear polynomial $ \widehat{V_2}=f(V_1) $, and the variable $ V_2 $ did not change with successive permutations. This means that the measure obtained here is invariant with respect to phase permutations in the complex coding of a random variable. Unfortunately, the found measure measures the non-linear correlation between the variables $ V_1 $ and $ V_2 $. For this reason, in those cases where a linear measure of correlation is expected, the non-linear correlation coefficient above could not be used. Table \ref{tab14} shows examples of results obtained for the data in Table \ref{tab9}. In the dataset, variable $ V_1 $ contained four different classes, three of which had equal cardinality. Hence, the variable $ V_2 $ could be modeled using a third degree polynomial. For three classes with equal cardinality, $ 3!=6 $ different polynomials were obtained. \section{Conclusions} The aim of the work was to examine the possibility of measuring the strength of the linear correlation relationship between two random variables measured on a nominal scale, coded with real numbers or complex numbers. The research was conducted with the assumption that the second random variable will always be coded with real numbers. This assumption caused the analyzed problem to become equivalent to the problem of testing the strength of a linear correlation relationship between a random variable measured on a nominal scale and a random variable measured at least on an ordinal scale. The calculations made use of the fact that the correlation coefficient has an interpretation of the cosine of the angle between the vectors containing the random components of the analyzed variables. Since for vectors of numbers (both real and complex) Euclidean norms and the scalar product can be calculated, it is also possible to calculate the cosine of the angle between vectors, and consequently also to estimate the correlation coefficient between them. The conducted research allowed to draw several conclusions that may potentially be useful in the analysis of linear correlation for nominal data, and which will be presented in more detail in the following subsections. \subsection{Study of the correlation relationship between nominal data coded with real numbers} A set of data measured on a nominal scale may be coded using real numbers if there are no classes with identical cardinalities among the classes of identical elements contained in this set. In this case, correlations were studied for two variables, each of which could be coded with real numbers. Coding with real numbers introduced a linear order to the nominal data sets. As a consequence, unambiguous real measures of linear correlation were obtained in all analyzed cases. \subsection{Study of the correlation relationship between nominal data coded with complex numbers} According to the adopted assumptions, correlations between two random variables were investigated, one of which was coded with real numbers, and the other had to be coded with complex numbers. A set of data measured on a nominal scale cannot be coded with real numbers if there are at least two classes with identical cardinalities among the classes of identical elements contained in this set. For two random variables, one of which contained complex numbers and the other contained real numbers, complex correlation coefficients were obtained, which changed with the permutation of phases in complex numbers coding classes of elements with equal cardinality. The solution to the problem of finding linear correlation turned out to be ambiguous. \subsection{Necessary condition for linear correlation} The correlation coefficient can only be estimated for real random variables, that is, variables that have been measured on an ordinal, interval or ratio scale. The conducted research shows that the correlation coefficient can also be estimated for nominal data without classes of equal cardinality, which will be coded with real numbers. On the other hand, for data coded with complex numbers, it was not possible to unambiguously estimate the correlation coefficient. A common feature of the above-mentioned sets of real numbers, for which the linear correlation coefficient can be estimated, is that these sets can be sorted and, consequently, they can also be assigned ranks\footnote{For ranks, a correlation coefficient can be estimated. This is the so-called Spearman rank correlation coefficient.}. Thus, these are sets for which a linear order relation can be established. For sets containing complex numbers, linear order relations cannot be defined. The strongest relation possible in the set of complex numbers is the partial order relation. It can therefore be said that a necessary condition that should be met in order to be able to estimate the linear correlation coefficient is the possibility of establishing a linear order relation in both data sets representing the analyzed random variables. \subsection{Non-linear correlation} Due to the dependence of correlation on phase permutations in complex coding, an attempt was also made to search for a possible measure of non-linear correlation that would be invariant with respect to phase permutations in complex coding. For different permutations of phases in a complex variable $ V_1$, the correlation coefficient between a real variable $ V_2 $ and its non-linear approximation $ \widehat{V_2}=f(V_1) $ was investigated. For $ k $ different values of the variable $ V_1 $ containing $ m $ classes with equal cardinalities ($m\le{k}$), $ m! $ polynomials of degree $ k-1 $ were identified. In all cases, identical correlation coefficients were obtained. The obtained result is only partially satisfactory. Instead of the expected measure of linear correlation, this coefficient measures non-linear correlation. Regardless of this result, an unsolved problem beyond the scope of this article is the mathematical proof of the hypothesis that the linear correlation coefficient $ R(V_2,\widehat{V_2}) $ between the variable $ V_2 $ and the polynomial $ \widehat{V_2}=f(V_1) $ does not change with successive phase permutations. \subsection{Alternative solutions for classes with equal cardinalities} The analysis described in the article was conducted using artificial data, specially prepared for the purposes of this work. This was due to the fact that the author of the article did not find non-trivial nominal data sets that would contain classes of identical elements with equal cardinality. Thus, it cannot be excluded that the intuition that suggests that in large data sets it is unlikely that a given variable will contain two classes with equal cardinalities is true. It is even less likely that there could be more such classes. However, even if this is true, it is necessary to be able to deal with such potential problems. It seems that the methods used for pre-processing of missing or outlying data can be used here \cite{Maimon2010}\cite{Hand2001}\cite{Berthold2007}. For example, if the rejection of a single object causes two classes to no longer have equal cardinality, then the need for complex coding of the nominal variable also disappears. On the other hand, if the analyzed sets have high cardinalities, then one can also reasonably hope that such an action will have a negligible effect on the statistics in the big dataset. The proposal presented here is not elegant. This proposal is a substitute. It can be used temporarily until further research provides a satisfactory solution to the problem presented here. \subsection{Possible simplification in nominal data coding} In subsection \ref{rangi}, the coding method is analogous to that used for ranking with tied ranks. A class of identical elements whose cardinality is equal to n is assigned the rank (\ref{eq16}). This approach was used in the calculations described in Section \ref{korelacje}. On the other hand, Subsection \ref{linear} noted that a linear transformation of a random variable does not change the direction of the vector representing its random component. Thanks to this, the coding method can be simplified for the purposes of correlation studies. In this case, it is enough to replace the ranks (\ref{eq16}) with cardinalities of the elements. The above change will give an unchanged value of the correlation coefficient, and at the same time slightly simplify the calculations performed during the coding procedure for the purpose of testing the strength of the correlation relationship. \subsection{Possible further directions of research} The usefulness of the proposed method for assessing the linear correlation between nominal random variables coded with numbers requires further investigation. Regardless of the research carried out in this work, preliminary studies were carried out on the possibility of clustering numerically coded nominal variables into similarity classes (see Subsect. \ref{binary}) based on the correlation matrix. As a result, promising results have been obtained, which are a positive incentive for further work in this area. In subsection \ref{nonlin} it is noted that the linear correlation $R(V_2,\widehat{V_2})$ between the variable $V_2$ and the polynomial $\widehat{V_2}=f(V_1)$ does not change with successive phase permutations at complex coding of the nominal variable $ V_1 $. The above result is only partially satisfactory, because instead of the expected measure of linear correlation, it gives a measure of non-linear correlation. Regardless of this, it would be interesting to solve the theoretical problem of proving or rejecting the hypothesis that these correlation coefficients are invariant with respect to phase permutations in the complex coding of nominal data. \section*{Acknowledgments} The author would like to express his gratitude to Dr. Leszek Rudak for valuable comments that helped to improve the content of the article.
\section*{Abstract} The ability to interpret machine learning models has become increasingly important as their usage in data science continues to rise. Most current interpretability methods are optimized to work on either (\textit{i}) a global scale, where the goal is to rank features based on their contributions to overall variation in an observed population, or (\textit{ii}) the local level, which aims to detail on how important a feature is to a particular individual in the dataset. In this work, we present the ``GlObal And Local Score'' (GOALS) operator: a simple \textit{post hoc} approach to simultaneously assess local and global feature variable importance in nonlinear models. Motivated by problems in statistical genetics, we demonstrate our approach using Gaussian process regression where understanding how genetic markers affect trait architecture both among individuals and across populations is of high interest. With detailed simulations and real data analyses, we illustrate the flexible and efficient utility of GOALS over state-of-the-art variable importance strategies. \section*{Introduction} Over the past decade, ``interpretability'' has become a major focus in statistical and probabilistic machine learning --- particularly in the space of biomedicine. While there remains to be a universal definition for what makes a computational method interpretable \citep[e.g.,][]{guidotti2018survey,carvalho2019machine,hall2019guidelines}, it generally refers to a model's ``ability to explain or to present in understandable terms to a human'' \citep[e.g.,][]{doshi2017towards}. The simple structure of linear models gives an intrinsic interpretation to their parameters and, as a result, enables them to be used for downstream tasks that extend beyond prediction. For example, in biomedical applications, linear models have been widely implemented to identify differentially expressed genes and enriched signaling pathways in functional genomics \citep[e.g.,][]{robinson2009edgeR, love2014moderated, nueda2014next, ritchie2015limma}, characterize complex trait architecture in genome-wide association studies \citep[e.g.,][]{Kang2008popstructure, Kang2010samplestructure, Price2010populationstratification, Lippert2011FaST, Korte2012mixedmodel, Zhou2012mixedmodel, Hayeck2015casecontrolascertainment, Heckerman2016environmentalvariation, Zeng2017latentdirichlet, Loh2018biobankscale, Jiang2019resourceefficient, Runcie2019fastflexible}, and estimate the underlying generative model of gene networks \citep[e.g.,][]{Ma2018hierarchicalstructure, Karlebach2008modelling, LaManno2018rnavelocity}. Part of the utility of these approaches is their ability to provide statistical significance measures such as $P$-values, posterior inclusion probabilities (PIPs), or Bayes factors --- all of which lend a notion of statistical evidence about how important each feature is in explaining an outcome variable. Unfortunately, linear models can be inappropriate or infeasible in practice. The strict additive assumptions underlying linear regression can be a hinderance in many supervised learning tasks where the variation of a measured response is dominated by nonlinear interactions. As data collection technologies continue to advance, even the most powerful linear models have struggled scale to high dimensions due to both inefficient model fitting procedures \citep{Runcie2019fastflexible,Runcie2021megalmm} and increasingly large combinatorial feature spaces when searching over both additive and non-additive effects \citep[e.g.,][]{crawford_detecting_2017,Stamp2022.11.30.518547}. Machine learning methods can overcome limitations of linear regression by accommodating nonlinear relationships between features (e.g., through activation units in neural networks or via nonparametric covariance functions in Gaussian processes) and implement scalable training algorithms. However, many machine learning methods are also known to be ``black box'' since they are not inherently transparent about how parameters are learned in making decisions and predicting outcomes \citep[e.g.,][]{rudin2019stop,degrave2021ai,Rudin:2022aa}. Classically, there are two strategies to achieving interpretability of machine learning methods. The first solution attempts to achieve intrinsic interpretability by limiting the architecture of machine learning methods to simple structures \citep{ai2021model}. As an example, in the biomedical sciences, a recent trend has been to develop customized neural network architectures that are inspired by biological systems \citep[e.g.,][]{Demetci:2021aa,elmarakeby2021biologically,Bourgeais2021deepgonet,bourgeais2022graphgonet}. Rather having fully connected, potentially over-parameterized architectures, these frameworks have partially connected architectures that are based on biological annotations in the literature or derived from other functional relationships that have been identified through experimental validation. Each neural network node then has an intrinsic interpretation because they encode some biological unit (e.g., signaling pathways, protein motif, or gene regulatory network) and each neural network weight connecting nodes represent known relationships between the corresponding entities. A key aspect of this approach is that it depends on reliable domain knowledge to generate these architectures. When this level of information is not available, as is the case for many practical scientific problems, implementing this strategy can be extremely challenging. The second strategy to gain interpretability uses \textit{post hoc} or \textit{auxiliary} methods to assess the importance of features after a model has been trained. A wide range of such approaches have been proposed in the literature. Although many of these techniques share theoretical connections \citep{lundberg2016unexpectedunity}, they generally can be separated into two categories. The first group of methods are ``salience methods'' \citep[also commonly known as ``saliency maps'';][]{simonyan2014deep} which, in their simplest form, provide variable importance by calculating the gradient of a model loss function with respect to each input feature for a class of interest. \citet{Kindermans:2019aa} showed that these types of attribution approaches can be highly unreliable in the presence of simple noise structures. In this paper, we will focus on a second class of explainable methods that produce ``sensitivity scores'' which quantify variable importance by measuring the amount predictive accuracy that is lost when a particular feature is perturbed. Common examples in this second class of methods include information criterion \citep{gelman_understanding_2014}, distributional centrality measures \citep{woo2015elucidating,piironen_projection_2016,piironen_comparison_2017,crawford_variable_2019,paananen2019variable,paananen2021uncertainty}, Shapley Additive Explanations (SHAP) \citep{lundberg_unified_2017,chen2022explaining}, and knockoffs \citep{candes_panning_2018,Sesia:2020aa,Sesia:2021aa}. Each of these methods have been shown to have their advantages, but one limitation they all have in common is that they mainly focus on addressing either (\textit{i}) global interpretability where the goal is to rank/select input features based on their contributions to overall variation in an observed population, or (\textit{ii}) local interpretability which aims to detail how important a feature is to any particular individual in the dataset. In many biomedical applications, it would be ideal to have a measure that leads to conclusions on both scales, simultaneously. For example, in statistical genetics, it is important to understand how a genetic variant contributes to the architecture of a complex trait --- but, for the purpose of precision medicine, it is also important to understand how that variant might have disproportionate effects on individuals coming from different subpopulations \citep[e.g.,][]{martin_clinical_2019}. In this work, we present the “GlObal And Local Score” (GOALS) operator: a simple approach that builds off of the distributional centrality literature to provide a measure that assesses both local and global variable importance for features, simultaneously. Our method is entirely general with respect to the modeling approach taken. The only requirements are that we have access to the fitted model and the ability to generate out-of-sample predictions. As an illustration of our approach, we focus on using Gaussian process regression. However, also note that this variable importance approach immediately applies to other methodologies such as neural networks \citep{Richard:1991aa}. We assess our proposed approach in the context of association mapping (i.e., inference on significant variants or loci) in statistical genetics as a way to highlight data science applications that (\textit{i}) contain outcomes that are driven by many covarying and interacting predictors \citep[e.g., epistasis or gene-by-gene interactions;][]{crawford_detecting_2017} and (\textit{ii}) can contain diverse subsets of populations where the importance of features may not be uniform across all individuals in the data. The remainder of the paper is organized as follows. First, we briefly detail the distributional centrality framework for achieving interpretability in nonlinear regression. Here, we review Gaussian processes, motivate the need for an effect size (regression coefficient) analog for input features, and define the concept of relative centrality which can be used to perform variable importance. In the next section, we derive the GOALS operator and detail its ability to make local and global interpretations for features. Lastly, we show the utility of our methodology with extensive simulations and a real data analysis of complex traits assayed in a heterogenous stock of mice from Wellcome Trust Centre for Human Genetics \citep{valdar_simulating_2006, valdar_gwas_2006}. \section*{Overview: Distributional Centrality for Nonlinear Models} In this work, we will follow positions taken by previous studies and assume that an interpretable statistical method is made up of three key components: (\textit{i}) a motivating probabilistic model, (\textit{ii}) a notion of an effect size (or regression coefficient) for each genetic variant and (\textit{iii}) a statistical metric that determines marker significance according to a well-defined null hypothesis \citep{crawford_variable_2019}. The third component is commonly defined by the task of achieving either global or local interpretability. From a genetics perspective, the main objective of global interpretability is to rank each genetic variant based on its contributions to overall phenotypic variation in an observed population. In contrast, local interpretability aims to provide an explanation on how important a variant is to any particular individual in the data set. The purpose of this section is to review background which allows us to formulate all three of these key components within the context of Bayesian Gaussian process regression for continuous quantitative traits; however, note that extending this theoretical framework to both other nonlinear and nonparametric methodologies \citep[e.g., neural networks;][]{ish2019interpreting}; as well as to categorical phenotypes (e.g., binary traits in case-control studies) \citep[e.g.,][]{MJ:2011aa} is straightforward. In terms of global interpretability, we will introduce the concept of an effect size analog and describe how distributional centrality measures can be used to perform \textit{post hoc} variable prioritization (also sometimes referred to as performing ``variable importance'' in certain areas of the literature). We then comment on the landscape of existing approaches to assess local interpretability within these same methods and discuss some the need for unifying these concepts for GWA studies. \subsection*{Weight-Space Gaussian Process Regression} Consider data from a GWA study with $N$ individuals. We have an $N$-dimensional vector of quantitative traits $\mathbf{y}$ and an $N\times J$ genotype matrix $\mathbf{X}$ with $J$ denoting the number of single nucleotide polymorphisms (SNPs) encoded as $\{0, 1, 2\}$ copies of a reference allele at each locus. To build intuition, we begin by considering a standard linear model for phenotypes such that \begin{align} \mathbf{y} = \bm{f} + \boldsymbol\varepsilon, \quad \quad \bm{f} = \mathbf{X}\boldsymbol\beta, \quad \quad \boldsymbol\varepsilon \sim\mathcal{N}(\bm{0},\tau^2\mathbf{I})\label{linmodel} \end{align} where the function to be estimated $\bm{f}$ is assumed to be a linear combination of SNPs in $\mathbf{X}$ and their respective effects denoted by the $J$-dimensional vector $\boldsymbol\beta = (\beta_1,\ldots,\beta_J)$ additive coefficients, $\boldsymbol\varepsilon$ is a normally distributed error term with mean zero and scaled variance term $\tau^2$, and $\mathbf{I}$ denotes an $N\times N$ identity matrix. For convenience, we will assume that the trait of interest has been mean-centered and standardized. In this setting, the phenotypic variance for the trait $\mathbb{V}[\mathbf{y}] = 1$, the proportion of variance explained by genetics $\mathbb{V}[\mathbf{X}\boldsymbol\beta] = h^2$ is referred to as the narrow-sense heritability, and $\tau^2 = (1-h^2)$ makes up the remaining variance \citep{Bulik-Sullivan:2015aa}. It has been well documented in the literature that the genetic architecture of many complex traits can be driven by nonlinear phenomena such as dominance and epistasis \citep[i.e., gene-by-gene interactions][]{Mackay:2014aa,Phillips:2008aa}. In these cases, the assumption in Eq.~\eq{linmodel} that phenotypic variation can be fully explained by additive genetic effects is restrictive. One way to overcome this limitation is to conduct model inference within a high-dimensional function space. In this work, we take a nonparametric approach and conduct inference in reproducing kernel Hilbert space (RKHS) by specifying a Gaussian process (GP) prior \begin{align} f(\mathbf{x})\sim\mathcal{GP}(m(\mathbf{x}),k_\theta(\mathbf{x},\mathbf{x}^{\prime}))\label{GPprior} \end{align} where $f(\bullet)$ is defined by its mean function $m(\bullet)$ (which we will consider to be fixed at zero) and positive definite covariance function $k(\bullet,\bullet)$. In practice, we assume that our model is only evaluated on the $N$ individuals in our data. When conditioning on these finite observations (or finite set of locations), the GP prior in Eq.~\eq{GPprior} becomes a multivariate normal distribution \citep{Kolmogorov:1960aa,rasmussen_gaussian_2006} and we can write the following ``weight-space'' nonlinear model for complex traits \begin{align} \mathbf{y} = \bm{f} + \boldsymbol\varepsilon, \quad \quad \bm{f} \sim\mathcal{N}(\bm{0},\mathbf{K}), \quad \quad \boldsymbol\varepsilon \sim\mathcal{N}(\bm{0},\tau^2\mathbf{I}).\label{GPmodel} \end{align} Here, $\bm{f} = [f(\mathbf{x}_1),\ldots,f(\mathbf{x}_N)]$ is an $N$-dimensional normally distributed random variable with mean vector $\bm{0}$, and the covariance matrix $\mathbf{K}$ is computed with each element given by $k_{ii^{\prime}} = k(\mathbf{x}_i,\mathbf{x}_{i^\prime})$ where $\mathbf{x}_i$ and $\mathbf{x}_{i^\prime}$ denote the genotypes of the $i$-th and $i^\prime$-th individual, respectively. Many covariance functions have been shown to implicitly account for higher-order interactions between features, which often lead to more accurate characterization of complex data types \citep{Demetci:2021aa,Wahba:1990aa,tsang2018detecting,tsang2018NIT,Murdoch2019definitions,Cotter:2011aa}. Without loss of generality, we will use a radial basis function such that $k_{ii^{\prime}} = \exp\{-\theta\|\mathbf{x}_i - \mathbf{x}_{i^\prime}\|^2\}$ where the bandwidth parameter $\theta$ is set using the “median criterion” approach to maintain numerical stability and avoid additional computational costs \citep{Chaudhuri:aa}. Altogether, there are a few important points to note between the linear model in Eq.~\eq{linmodel} and the ``weight-space'' GP regression model in Eq.~\eq{GPmodel}. First, the GP regression model can be seen as a generalization of a linear mixed model which uses a nonlinear covariance $\mathbf{K}$ to account for genetic interactions instead of the usual (additive) gram matrix $\mathbf{X}\bX^{\intercal}/J$ \citep[e.g.,][]{Lippert2011FaST,Zhou2012mixedmodel}. Second, under the standardized phenotype assumption, the proportion of variation explained by function in the GP model $\mathbb{V}[\bm{f}] = H^2$ is referred to as the broad-sense heritability of a trait since it accounts for both additive and non-additive genetic effects, and the scaled variance term is now $\tau^2 = (1-H^2)$. Lastly, like linear regression, the GP model can also be easily extended to accommodate other fixed effects (e.g., age, sex or genotype principal components) \citep{Campos:2009aa,Shi:2012aa} as well as be adapted to account for interactions between variants and non-genetic risk factors (e.g., environment) \citep{Cuevas:2017aa,Weissbrod:2016aa}. We will not explicitly consider these fixed effects here and, instead, will leave those explorations to the reader. \subsection*{Effect Size Analogs and Relative Centrality Measures} In this section, we assume access to some trained Bayesian model with the ability to fully characterize or draw samples from its posterior predictive distribution. A central goal in GWA studies is to jointly infer the true global effect and statistical significance of each SNP given both genotypic and phenotypic measurements for an observed population. One classic strategy to estimating regression coefficients in Eq.~\eq{linmodel} is to use least squares where the response variable is projected onto the column space of the data $\widehat\boldsymbol\beta := \text{Proj}(\mathbf{X},\mathbf{y}) = \mathbf{X}^{\dagger}\mathbf{y}$ with $\mathbf{X}^{\dagger}$ denoting some generalized inverse since $J > N$ in many GWA applications. We refer to the vector $\widehat\boldsymbol\beta = [\widehat\beta_1,\ldots,\widehat\beta_J]$ as the (additive) effect size for each SNP in the data set. The effect size analog was developed with the intention of being the nonparametric version of a regression coefficient for each input feature of a nonlinear model \citep{crawford_bayesian_2018}. In general, this leverages the idea that, $\mathbb{E}[\mathbf{y}\, | \,\mathbf{X}] = \bm{f}$ when conditioning on $N$ finite observations in Eq.~\eq{GPmodel}. Thus, similar to the linear regression case, the effect size analog can be defined by projecting the smooth nonlinear function onto the column space of the data. While there are many projections one can use \citep[e.g.,][]{woody_model_2021,kowal_fast_2021}, we will consider the following least squares-like projection where \begin{align} \widetilde\boldsymbol\beta := \text{Proj}(\mathbf{X},\bm{f}) = \mathbf{X}^{\dagger}\bm{f}.\label{ESA} \end{align} This is a simple way of understanding the genetic relationships that the model has learned. Under the linear projection in Eq.~\eq{ESA}, the effect size analogs have the usual interpretation. For example, while holding everything else constant, increasing the $j$-th feature by 1 will increase $\bm{f}$ by $\widetilde\beta_j$ \citep{crawford_bayesian_2018}. Importantly, because of the closed-form projection, drawing samples from the posterior distribution of $\bm{f}$ can be deterministically transformed to samples from the implied posterior distribution of the effect size analogs. Similar to regression coefficients in linear models, the effect size analog is not enough on its own to determine variable importance. Indeed, there are many ways to achieve global interpretability based on the magnitude of effect size estimates \citep[e.g.,][]{Barbieri:2004aa,Hoti2006bayesianmapping,Stephens2009bayesianmethods}, but many of these approaches rely on arbitrary thresholding and fail to theoretically test a null hypothesis. One analogy to traditional Bayesian hypothesis testing for nonparametric regression methods is a \textit{post hoc} approach for association mapping via a series of ``distributional centrality measures'' using Kullback–Leibler divergence (KLD) \citep[e.g.,][]{goutis1998model,Smith:2006aa,Tan:2017aa,piironen_comparison_2017,piironen_projection_2016,woo2015elucidating,Alaa:2017aa}. Assume that we have a collection samples from the implied posterior distribution of the effect size analog. We can summarize the importance of the $j$-th SNP in our data by taking the KLD between (\textit{i}) the conditional distribution $p(\widetilde\boldsymbol\beta_{-j}\, | \,\widetilde\beta_j = 0)$ with the effect of that SNP being set to zero and (\textit{ii}) the marginal distribution $p(\widetilde\boldsymbol\beta_{-j})$ with the effect of that SNP having been marginalized over. This is defined by solving the following \begin{align} \text{KLD}(j) := \text{KL}\left[p(\widetilde\boldsymbol\beta_{-j})\,\|\,p(\widetilde\boldsymbol\beta_{-j}\, | \, \widetilde\beta_j = 0)\right] = \int_{\widetilde\boldsymbol\beta_{-j}}{\rm log}\left(\frac{p(\widetilde\boldsymbol\beta_{-j})}{p(\widetilde\boldsymbol\beta_{-j}\, | \, \widetilde\beta_j = 0)}\right) p(\widetilde\boldsymbol\beta_{-j}) \diff\widetilde\boldsymbol\beta_{-j}. \label{KLD} \end{align} for each $j = 1,\ldots, J$ variants in the data. We can normalize each of these quantities to obtain a final global association metric \begin{align} \text{RATE}(j) = \text{KLD}(j)/\sum \text{KLD}(l).\label{RATE} \end{align} The above metric is referred to as the ``RelATive cEntrality'' measure or RATE \citep{crawford_variable_2019}. There are two main takeaways that are important about this metric. First, the $\text{KLD}(j)$ value is non-negative, and it equals zero if and only if removing the effect of a given SNP has no impact on explaining the genetic architecture of a trait (i.e., the posterior distribution of $\widetilde\boldsymbol\beta_{-j}$ is independent of $\widetilde\beta_j$). Second, the RATE measure is bounded on the unit interval [0, 1] with the natural interpretation of providing relative evidence of association for each SNP (where values close to 1 suggest greater importance). From a classical hypothesis testing point-of-view, the null under RATE measure assumes that each SNP contributes equally to the phenotypic variance, while the alternative assumes proposes that some SNPs drive the broad-sense heritability of a trait much more than others. Formally, this can stated as \begin{align} \begin{aligned} H_0: \text{RATE}(j) = 1/J \quad \text{vs.} \quad H_A: \text{RATE}(j) > 1/J \end{aligned} \end{align} where $1/J$ represents the level that all SNPs in the data have the same relative variable importance. \subsection*{Limitations of the Current Distributional Centrality Framework} There are several notable issues with effect size analog and RATE framework, particularly for GWA applications. First, calculating both the effect size analog and the KLD in turn for each SNP is computationally expensive even with low-rank matrix approximations \citep{crawford_variable_2019}. Both of these operations involve taking inverses of matrices on the order of $J$. As the number of variants $J$ grows, these calculations become infeasible. Second, the the significance threshold $1/J \rightarrow 0$ as $J\rightarrow\infty$, which effectively means that all variants will be considered important for high-dimensional settings. Third, while this framework summarizes the global association for each SNP within the observed population, it lacks the ability to locally explain how important each variant is to each individual in the data. This limits its potential impact, particularly within the context of precision medicine where the goal is to provide individualized patient care. Finally, the least squares projection for the effect size analog in Eq.~\eq{ESA} will only estimate nonlinear effects that are correlated with the linear effects of each SNP \citep{woody_model_2021, kowal_fast_2021}. To see this, define a matrix $\mathbf{Z}$ whose elements are just each column of $\mathbf{X}$ squared. Theoretically, we could define quadratic effects by taking the residuals from the regression of $\bm{f}$ on $\mathbf{X}$ and regressing them onto $\mathbf{Z}$ in the following way \begin{align*} \boldsymbol\gamma = (\mathbf{Z}^\intercal\mathbf{Z})^{\dagger}\mathbf{Z}^\intercal\left(\mathbf{I}-(\mathbf{X}^{\intercal}\mathbf{X})^{\dagger}\mathbf{X}^{\intercal}\right)\bm{f}. \end{align*} Here, implementing the RATE measure on these new effect sizes $\boldsymbol\gamma$ would yield global importance on the quadratic functions of each SNP in the data. However, note that $\boldsymbol\gamma$ vanishes if we combine $\widetilde\boldsymbol\beta+\boldsymbol\gamma$ via linear projections onto $\mathbf{X}$. Therefore, if we wanted to study all linear and quadratic effects together, we would instead need to consider a nonlinear projection such as $\widetilde\boldsymbol\beta^2+\boldsymbol\gamma^2$. The projection operator in Eq.~\eq{ESA} will sometimes miss nonlinear relationships because it only ends up evaluating the part of the nonlinear function $\bm{f}$ that is linearly associated with each SNP. Each of these issues serve as motivation to develop an alternative and more unified framework for nonlinear models. \section*{Global and Local Score Operators in Nonlinear Models} \looseness=-1 We now present a simple alternative to achieve interpretability in nonlinear regression models. We will refer to this new summary as the ``GlObal And Local Score'' (GOALS) operator with the aim to simultaneously identify SNPs that are significantly associated with genetic architecture for a population as well as explain marginal variant effects on an individual level. Again, let $\bm{f}$ be a nonlinearly estimated function from a weight-space Gaussian process estimated similar to Eq.~\eq{GPmodel} and consider the scenario where we want to investigate the importance of the $j$-th feature in explaining what that function has learned from the data. To do so, we can define an $N$-dimensional vector $\mathbf{g}^{(j)} = \mathbb{E}[\mathbf{y}\, | \,\mathbf{X}+\boldsymbol\Xi^{(j)}]$ where $\boldsymbol\Xi^{(j)}$ is an $N\times J$ matrix of all zeros except for the $j$-th column which we set to be a vector of some positive constant $\xi$. If we think about the interpretation of a regression coefficient in a linear model as detailing the expected change in the mean response given a $\xi$-unit increase in the corresponding covariate (holding all else constant), then a natural quantity to understand the importance of each variable is \begin{align} \boldsymbol\delta^{(j)} = \bm{f}-\mathbf{g}^{(j)}. \end{align} Here, each element of the $N$-dimensional vector $\boldsymbol\delta^{(j)} = (\delta^{(j)}_1,\ldots,\delta^{(j)}_N)$ explains the importance of the $j$-th variable for Gaussian process fit with respect to each sample. The sample average $\bar\delta^{(j)} = \sum_i \delta^{(j)}_i/N$ can then be interpreted as a global effect size for the $j$-th variable within the observed population. Intuitively, in the context of statistical genetics, $\boldsymbol\delta^{(j)}$ will be concentrated around zero if the $j$-th SNP generally has no effect on the phenotypic variation for a trait. This yields the following natural formulation of a null hypothesis for statistical inference and testing \begin{align} H_0: \boldsymbol\delta^{(j)} = \bm{0} \quad \text{vs.} \quad H_A: \boldsymbol\delta^{(j)} \ne \bm{0}\label{GOALS} \end{align} where significantly associated variables have sample means with magnitudes that largely deviate from zero. Since we are assessing a ``shift'' in function space, each $\boldsymbol\delta^{(j)}$ takes into account both additive and nonlinear effects for each variable. Note that the GOALS operator can be flexibly implemented by applying the factor $\boldsymbol\Xi^{(j)}$ with any constant and even partitioning the data into subsets for which different values of the constant $\xi$ are used. Motivated by the popularity of the standard linear model provided in Equation~\eqref{linmodel} and use of the least-squares like projection in Equation~\eqref{ESA}, we consider the constant $\xi = 1$. Thus, each $\delta^{(j)}_i$ refers to the expected change in the corresponding phenotype $y_i$ associated with increasing the $j$-th feature by 1 for individual $i$. The GOALS operator generalizes the linear model effect size (regression coefficient); when a linear model of the form \eqref{linmodel} is assumed, elements of $\boldsymbol\delta^{(j)}$ and the average $\bar\delta^{(j)}$ will be equal to $\beta_j$. This choice of $\xi$ is also well aligned with GWA applications, where SNPs are encoded as $\{0,1,2\}$ and increasing a genotype by 1 has a natural interpretation. That said, other values here could also be useful, especially if we assume that genotypes are centered and scaled or want to account for the upper bound of $2$ on SNP encodings--- we address some of these alternative choices in the Discussion. \subsection*{Closed-Form Solution and Distributional Properties of GOALS} In this subsection, we describe some of the probabilistic qualities underlying the GOALS operator. Although this approach can be applied to any probabilistic model, we will continue to work under Gaussian process regression as detailed in Eq.~\eq{GPmodel}. To begin, notice that $\bm{f}$ and each $\mathbf{g}^{(j)}$ are dependent because they are derived from the same set of genotype and phenotype data $\mathbf{X}$ and $\mathbf{y}$, respectively. The joint distribution between the $N$-dimensional vectors $\mathbf{y}$, $\bm{f}$, and $\{\mathbf{g}^{(j)}\}_{j=1}^{J}$ can be specified via the following multivariate normal distribution \begin{align} \begin{bmatrix}\mathbf{y} \\ \bm{f} \\ \mathbf{g}^{(1)} \\ \vdots \\ \mathbf{g}^{(J)}\end{bmatrix} \sim \mathcal{N}\left(\begin{bmatrix} \bm{0} \\ \bm{0} \\ \bm{0} \\ \vdots \\ \bm{0} \end{bmatrix}, \begin{bmatrix} \mathbf{A} & \mathbf{K} & \mathbf{B}^{(1)} & \cdots & \mathbf{B}^{(J)} \\ \mathbf{K} & \mathbf{K} & \mathbf{B}^{(1)} & \cdots & \mathbf{B}^{(J)} \\ \mathbf{B}^{(1)} & \mathbf{B}^{(1)} & \mathbf{C}^{(1)} & \cdots & \mathbf{D}^{(1,J)} \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ \mathbf{B}^{(J)} & \mathbf{B}^{(J)} & \mathbf{D}^{(J,1)} & \cdots & \mathbf{C}^{(J)} \end{bmatrix} \right)\label{joint_dist} \end{align} where $\mathbf{A} = \mathbf{K} + \sigma^2\mathbf{I}$ is the marginal variance of the response vector $\mathbf{y}$; $\mathbf{K}$ is the variance of $\bm{f}$ using the original genotype matrix $\mathbf{X}$ (as in previous notation); $\mathbf{B}^{(j)}$ is the covariance between $\bm{f}$ and $\mathbf{g}^{(j)}$ using the original matrix $\mathbf{X}$ and the perturbed matrix $\mathbf{X}+\boldsymbol\Xi^{(j)}$; $\mathbf{C}^{(j)}$ is the variance of $\mathbf{g}^{(j)}$ using the perturbed matrix $\mathbf{X}+\boldsymbol\Xi^{(j)}$; and $\mathbf{D}^{(j,l)}$ is the covariance between $\mathbf{g}^{(j)}$ and $\mathbf{g}^{(l)}$ having perturbed the $j$-th and $l$-th feature, respectively. We can simplify the above by utilizing the fact that, when the variance function is the radial basis function, $\mathbf{C}^{(j)} = \mathbf{K}$ for all $j$. Using this, we can then derive the following joint distribution between $\bm{f}$ and $\{\mathbf{g}^{(j)}\}_{j=1}^{J}$, conditioned on the data \begin{align*} \resizebox{\hsize}{!}{$\begin{bmatrix}\bm{f} \\ \mathbf{g}^{(1)} \\ \vdots \\ \mathbf{g}^{(J)}\end{bmatrix} \bigg|\, \mathbf{y} \sim \mathcal{N}\left(\begin{bmatrix} \mathbf{K}\mathbf{A}^{-1}\mathbf{y} \\ \mathbf{B}^{(1)}\mathbf{A}^{-1}\mathbf{y} \\ \vdots \\ \mathbf{B}^{(J)}\mathbf{A}^{-1}\mathbf{y} \end{bmatrix}, \begin{bmatrix} \mathbf{K} - \mathbf{K}\mathbf{A}^{-1}\mathbf{K} & \mathbf{B}^{(1)} - \mathbf{K}\mathbf{A}^{-1}\mathbf{B}^{(1)} & \cdots & \mathbf{B}^{(J)} - \mathbf{K}\mathbf{A}^{-1}\mathbf{B}^{(J)} \\ \mathbf{B}^{(1)} - \mathbf{B}^{(1)}\mathbf{A}^{-1}\mathbf{K} & \mathbf{K} - \mathbf{B}^{(1)}\mathbf{A}^{-1}\mathbf{B}^{(1)} & \cdots & \mathbf{D}^{(1,J)} - \mathbf{B}^{(1)}\mathbf{A}^{-1}\mathbf{B}^{(J)} \\ \vdots & \vdots & \ddots & \vdots \\ \mathbf{B}^{(J)} - \mathbf{B}^{(J)}\mathbf{A}^{-1}\mathbf{K} & \mathbf{D}^{(1,J)} - \mathbf{B}^{(J)}\mathbf{A}^{-1}\mathbf{B}^{(1)} & \cdots & \mathbf{K} - \mathbf{B}^{(J)}\mathbf{A}^{-1}\mathbf{B}^{(J)} \end{bmatrix} \right)$.} \end{align*} Lastly, we can write joint distribution for the GOALS operator $\boldsymbol\delta^{(j)} = \bm{f} - \mathbf{g}^{(j)}$ in Eq.~\eq{GOALS} as the following \begin{align} \begin{bmatrix} \boldsymbol\delta^{(1)} \\ \vdots \\ \boldsymbol\delta^{(J)}\end{bmatrix} \bigg|\, \mathbf{y} \sim \mathcal{N}\left(\begin{bmatrix} \left(\mathbf{K} - \mathbf{B}^{(1)}\right)\mathbf{A}^{-1}\mathbf{y} \\ \vdots \\ \left(\mathbf{K} - \mathbf{B}^{(J)}\right)\mathbf{A}^{-1}\mathbf{y} \end{bmatrix}, \begin{bmatrix} \boldsymbol\Sigma^{(1)} & \cdots & \boldsymbol\Sigma^{(1,J)} \\ \vdots & \ddots & \vdots \\ \boldsymbol\Sigma^{(J,1)} & \cdots & \boldsymbol\Sigma^{(J)} \end{bmatrix} \right)\label{GOALS_dist} \end{align} where \begin{align*} \boldsymbol\Sigma^{(j)} &= \mathbf{K}\mathbf{A}^{-1}\mathbf{K} - \mathbf{B}^{(j)}\mathbf{A}^{-1}\mathbf{B}^{(j)}-\left[\mathbf{B}^{(j)}-\mathbf{B}^{(j)}\mathbf{A}^{-1}\mathbf{K}+\mathbf{B}^{(j)}-\mathbf{B}\mathbf{A}^{-1}\mathbf{B}^{(j)}\right]\\ \boldsymbol\Sigma^{(j,l)} &= \mathbf{K} - \mathbf{K}\mathbf{A}^{-1}\mathbf{K} + \mathbf{D}^{(j,l)} - \mathbf{B}^{(j)}\mathbf{A}^{-1}\mathbf{B}^{(l)} - \left[\mathbf{B}^{(j)} - \mathbf{B}^{(j)}\mathbf{A}^{-1}\mathbf{K}+\mathbf{B}^{(l)}-\mathbf{K}\mathbf{A}^{-1}\mathbf{B}^{(l)} \right]. \end{align*} Theoretically, this results in a joint conditional distribution from which to sample from the posterior distribution of each $\boldsymbol\delta^{(j)}$ and obtain local interpretability. As previously mentioned, to investigate the global interpretability of each variant, one can use the sample mean across the local explanations for all observations where $\bar{\delta}^{(j)} = \bm{1}^{\intercal}\boldsymbol\delta^{(j)}/N$ with $\bm{1}$ being an $N$-dimensional vector of ones and \begin{align} \begin{bmatrix} \bar\delta^{(1)} \\ \vdots \\ \bar\delta^{(J)}\end{bmatrix} \bigg|\, \mathbf{y} \sim \mathcal{N}\left(\begin{bmatrix} \bm{1}^{\intercal}\left(\mathbf{K} - \mathbf{B}^{(1)}\right)\mathbf{A}^{-1}\mathbf{y}/N \\ \vdots \\ \bm{1}^{\intercal}\left(\mathbf{K} - \mathbf{B}^{(J)}\right)\mathbf{A}^{-1}\mathbf{y}/N \end{bmatrix}, \begin{bmatrix} \bm{1}^{\intercal}\boldsymbol\Sigma^{(1)}\bm{1}/N^2 & \cdots & \bm{1}^{\intercal}\boldsymbol\Sigma^{(1,J)}\bm{1}/N^2 \\ \vdots & \ddots & \vdots \\ \bm{1}^{\intercal}\boldsymbol\Sigma^{(J,1)}\bm{1}/N^2 & \cdots & \bm{1}^{\intercal}\boldsymbol\Sigma^{(J)}\bm{1}/N^2 \end{bmatrix} \right). \end{align} Therefore, to simulate from the posterior distribution of the sample means, one simply needs to compute the following closed form equations for the first and second moments \begin{align} \begin{aligned} \mathbb{E}\left[\bar\delta^{(j)}\right] &= \bm{1}^{\intercal}\left(\mathbf{K} - \mathbf{B}^{(j)}\right)\mathbf{A}^{-1}\mathbf{y}/N\\ \mathbb{V}\left[\bar\delta^{(j)}\right] &= \left(\lambda + \alpha_{jj} - 2\psi_j\right)/N^2\\ \mathbb{V}\left[\bar\delta^{(j)},\bar\delta^{(l)}\right] &= \left(\lambda + \alpha_{jl} - \psi_j-\psi_l\right)/N^2\\ \end{aligned} \end{align} where $\lambda = \bm{1}^{\intercal}\mathbf{K}\bm{1}-\bm{1}^{\intercal}\mathbf{K}\mathbf{A}^{-1}\mathbf{K}\bm{1}$; $\alpha_{jl} = \bm{1}^{\intercal}\mathbf{D}^{(j,l)}\bm{1}-\bm{1}^{\intercal}\mathbf{B}^{(j)}\mathbf{A}^{-1}\mathbf{B}^{(l)}\bm{1}$; and $\psi_j = \bm{1}^{\intercal}\mathbf{B}^{(j)}\bm{1} -\bm{1}^{\intercal}\mathbf{K}\mathbf{A}^{-1}\mathbf{B}^{(j)}\bm{1}$, respectively. In current GWA applications, where datasets can include hundreds of thousands of individuals genotyped at millions of markers, it is often desirable to use a more straightforward and scalable computation than sampling estimates of the GOALS measure from the full joint distribution in Eq.~\eq{GOALS_dist}. To that end, in this work, we will consider the posterior mean in Eq.~\eq{GOALS_dist} as estimates of local importance and then take the sample means of these values to get a measurement of global importance. More specifically, these two respective values are taken as the following \begin{align} \widehat\boldsymbol\delta^{(j)} = \left(\mathbf{K} - \mathbf{B}^{(j)}\right)\mathbf{A}^{-1}\mathbf{y}, \quad \quad \bar{\delta}^{(j)} = \sum_i\widehat\delta^{(j)}_i/N.\label{sample_mean} \end{align} \subsection*{Scalable Computation} In practice, we can make use of a few additional matrix algebra properties to efficiently compute estimates from the otherwise computationally intensive distribution outlined in Eq.~\eq{GOALS_dist}. Here, we will continue to assume that the Gaussian process regression uses a radial basis covariance function. First, it is important to note that the only matrix that needs to be recomputed for each SNP $j$ is the matrix $\mathbf{B}^{(j)}$ which measures the covariance between the original $\mathbf{X}$ and the perturbed $\mathbf{X}+\boldsymbol\Xi^{(j)}$. When using the radial basis function, this matrix can be derived for the $j$-th SNP by making the following rank one updates \begin{align*} b_{ii^\prime}^{(j)} = k\left(\mathbf{x}_i,\mathbf{x}_{i^\prime}+\boldsymbol\xi^{(j)}\right) &= \exp\left\{-\theta\left\|\mathbf{x}_i-\left(\mathbf{x}_{i^\prime}+\boldsymbol\xi^{(j)}\right)\right\|^2\right\}\\ &= \exp\left\{-\theta\left[\left\|\mathbf{x}_i-\mathbf{x}_{i^\prime}\right\|^2 - 2\left(\mathbf{x}_i-\mathbf{x}_{i^\prime}\right)^{\intercal}\boldsymbol\xi^{(j)} + \left\|\boldsymbol\xi^{(j)}\right\|^2\right]\right\}\\ &= \exp\left\{-\theta\left\|\mathbf{x}_i-\mathbf{x}_{i^\prime}\right\|^2\right\}\exp\{-\theta\left[\xi^2- 2\xi\left(\mathbf{x}_i-\mathbf{x}_{i^\prime}\right)^{\intercal}\right]\}\\ &= k(\mathbf{x}_i,\mathbf{x}_{i^\prime})\exp\{-\theta\left[\xi^2- 2\xi\left(\mathbf{x}_i-\mathbf{x}_{i^\prime}\right)^{\intercal}\right]\} \end{align*} where, similar to previous notation, $\mathbf{x}_i$ and $\mathbf{x}_{i^\prime}$ are the $i$-th and $i^\prime$-th rows of the genotype matrix $\mathbf{X}$, and $\boldsymbol\xi^{(j)}$ is a row of the matrix $\boldsymbol\Xi^{(j)}$ where the $j$-th element is set to some positive constant $\xi$. We can restate the above in matrix notation as \begin{align} \mathbf{B}^{(j)} = \mathbf{K} \circ \exp\left\{-\theta\left[\xi^2 - 2\xi\left(\mathbf{x}_{\bullet j}\bm{1}^{\intercal}-\bm{1}\mathbf{x}_{\bullet j}^{\intercal}\right)\right]\right\} \end{align} where $\mathbf{x}_{\bullet j}$ is the $j$-th column in the matrix $\mathbf{X}$ and $\circ$ denotes element-wise multiplication. The main summary is that the computation of each $\mathbf{B}^{(j)}$ only relies on linear operations after the initial computation of the radial basis covariance matrix $\mathbf{K}$. These steps extend to other shift invariant covariance functions (e.g., Laplacian and Cauchy) and a similar rank one update procedure can also be shown for the linear gram matrix (see Supplementary Material). \subsection*{Theoretical Connection to Shapley Additive Explanations} The GOALS operator measures local importance by quantifying the change in function space that occurs when the $j$-th feature of interest is shifted by some nonzero factor. There is a theoretical connection between this strategy and Shapley Additive Explanations (SHAP) \citep{lundberg_unified_2017} which is a widely used \textit{post hoc} local interpretability metric in the machine learning literature \citep[e.g.,][]{chen2022explaining}. Briefly, Shapley values assign feature importance weights based on game theoretic principles~\citep{shapley1951notes, roth1988shapley} by essentially determining a payoff for all players when each player might have contributed more or less than the others when attempting to achieve the desired outcome. In genetics applications, this is done by considering all possible subsets of genotypes that do not include the $j$-th genotype $\mathcal{S} \subseteq \mathcal{J}\backslash \{j\}$ and then comparing their performance to the performance of a model trained on the same subset as well as the $j$-th genotype $\mathcal{S} \cup \left\{j\right\}$. This weighted average can be represented as the following formula \begin{align} \phi_j = \sum_{\mathcal{S}\subseteq \mathcal{J} \backslash \{j\}} \left[\frac{|\mathcal{S}|!(J-|\mathcal{S}|-1)!}{J!}\right]\left(\bm{f}_{\mathcal{S}\cup \{j\}} - \bm{f}_{\mathcal{S}}\right)\label{SHAP} \end{align} where $|\mathcal{S}|$ is number of genotypes in subset $\mathcal{S}$ and $|\mathcal{J}| = J$ is the total number of genotypes in the data. Keeping our notation consistent with previous sections, we say that $\bm{f}_{\mathcal{S}\cup \{j\}}$ and $\bm{f}_{\mathcal{S}}$ are the GP regression model fits with and without the $j$-th genotype added to the genotype subset $\mathcal{S}$, respectively. Rather than removing a given genotype from each subset and calculating model differences, GOALS perturbs each genotype and calculates the corresponding difference in model fit. However, we can relate SHAP to goals by considering the special case of a single individual $N = 1$. In this case, $g^{(j)} = \mathbb{E}[y\, | \,\mathbf{x}+\boldsymbol\xi^{(j)}]$ where $\boldsymbol\xi^{(j)}$ is an $1\times J$ vector of all zeros except for the $j$-th element which we set to be a vector of some positive constant $\xi$. Note that we can represent the ``shifting'' vector $\boldsymbol\xi^{(j)}$ as the following \begin{align} \boldsymbol\xi^{(j)} = \xi\begin{bmatrix} \mathbbm{1}\{j=1\} & \cdots & \mathbbm{1}\{j=J\}\\ \end{bmatrix} \end{align} where $\mathbbm{1}\{\bullet\}$ denotes an indicator function which is returns one for the $j$-th column and 0 otherwise. From this view, we can say that $\mathcal{J}^\prime$ is the set of $J$ indicator random variables which make up elements of $\boldsymbol\xi^{(j)}$. We can also therefore rewrite the GOALS operator as \begin{align} \delta^{(j)} = f - g^{(j)} = f_{\mathcal{J}} - f_{\mathcal{J}\cup\mathcal{J}^{\prime}}. \end{align} If we set $\xi = -x_{j}$, the GOALS operator behaves similarly to a SHAP value, as $\mathbf{g}^{(j)}$ represents the model fit where the $j$-th covariate is set to zero. In this case, GOALS could be seen as an approximation to SHAP where GOALS only considers the single subset of $J-1$ genotypes, excluding the $j$-th genotype, whereas SHAP which considers all every possible subsets of features that do not include the $j$-th genotype. Lastly, it is worth noting that there are scenarios where we would expect GOALS and SHAP to provide different local interpretability rankings for the $j$-th covariate. The factorial in the SHAP weight computation in Eq.~\eq{SHAP} favors both the smallest and largest subsets of $\mathcal{J}$ and penalizes subsets $\mathcal{S}$ of the size $|\mathcal{S}|\approx J/2$. In the GWA setting, this means that if the $j$-th SNP has an effect on the trait of interest via marginal effects, then both GOALS and SHAP are likely to give that SNP a high ranking. If the $j$-th SNP is only influential on a phenotype through a moderate number of interactions (i.e., within sets of size $J/2$), then GOALS may rank that SNP higher relative to other SNPs than SHAP will. However, on the other hand, if the $j$-th SNP is influential on trait architecture through pairwise interactions with nearly all other variants genome-wide, then SHAP may provide a higher relative rank for that SNP than GOALS. Furthermore, SHAP may rank SNPS that are highly correlated with each other lower than GOALS, because the difference in model fits $\bm{f}_{\mathcal{S}\cup \{j\}} - \bm{f}_{\mathcal{S}}$ may be small when genotype $j$ is highly correlated with genotypes in $\mathcal{S}$. We show that these expectations are supported empirically in the next section. \section*{Results} We now illustrate the benefits of our simple approach for global and local interpretability in extensive simulations and real data analyses. First, we conduct a proof-of-concept simulation study to help the reader build a stronger intuition for how GOALS prioritizes influential variables on both a local and global scale, simultaneously. To provide concrete points of reference, we will also show how the Shapley Additive Explanations (SHAP) \citep{lundberg_unified_2017} approach assigns feature importance weights locally and we will demonstrate how the distributional centrality framework using the effect size analog with RATE performs global interpretability \citep{crawford_bayesian_2018,crawford_variable_2019}. We also show that GOALS is much more scalable than both methods as both the number of observations and genetic markers increase. For the second analysis in this section, we implement a more realistic simulation scheme to assess how GOALS performs association mapping compared to various \textit{post hoc} variable importance, Bayesian shrinkage, and regularization modeling techniques. Lastly, we apply the GOALS operator to six quantitative traits assayed in a heterogenous stock of mice from Wellcome Trust Centre for Human Genetics \citep{valdar_simulating_2006, valdar_gwas_2006}. \subsection*{Simulation Studies} The general design of the following simulation studies is commonly used to explore the power of statistical methods for association mapping across different genetic architectures underlying complex traits. Here, we assume that we have some $N\times J$ genotype matrix $\mathbf{X}$ which is used to generate $N$-dimensional real-valued phenotypes $\mathbf{y}$ based on a combination of linear (additive), interaction (epistatic), and cryptic population stratification effects. We will assume that each synthetic trait has been standardized such that $\mathbb{V}[\mathbf{y}] = 1$. We will also assume that all observed genetic effects explain a fixed proportion of this variance (commonly referred to as the broad-sense heritability of the trait $H^2$). To explicitly generate data, we select a subset of causal SNPs $\mathcal{J}$ from the genotypic matrix and then use the following linear model \begin{align} \mathbf{y} = \mathbf{X}\boldsymbol\beta+\mathbf{W}\boldsymbol\vartheta+\mathbf{Z}\boldsymbol\omega+\boldsymbol\varepsilon, \quad \quad \boldsymbol\varepsilon\sim\mathcal{N}(\bm{0},\tau^2\mathbf{I}).\label{sim_model} \end{align} where $\mathbf{W}$ holds all pairwise interactions between the causal SNPs (i.e., the Hadamard or element-wise product between genotypic vectors of SNPs within $\mathcal{J}$) and $\mathbf{Z}$ contains covariates representing additional population structure in the data. In this study, we will consider $\mathbf{Z}$ to be the top ten principal components (PCs) from the genotype matrix. The additive and interaction effect sizes for the causal variants are assumed to follow normal distributions; while the effects for non-causal variable set to be zero. Using a parameter $\rho$, we scale both the additive and pairwise genetic effects so that collectively they explain a fixed proportion of the genetic variance. Namely, we assume that the additive effects detail $\mathbb{V}[\mathbf{X}\boldsymbol\beta] = \rho H^2$ (i.e., narrow-sense heritability of a trait $h^2$) and that the interaction effects make up the remaining $\mathbb{V}[\mathbf{W}\boldsymbol\vartheta] = (1-\rho)H^2$. In the simulations shown in this section, we will consider $\rho \in \{0.5, 1\}$, where the former assumes that additive and interaction effects contribute equally to the total phenotypic variance, and the latter assumes only additive effects contribute. Once we obtain the final effect sizes for all causal variants, we draw normally distributed random variables for the population structure coefficients and the random error term. In this scenario, one can think of the combined effect of $\mathbf{Z}\boldsymbol\omega$ as structured noise. To this end, we ensure that $\mathbb{V}[\mathbf{Z}\boldsymbol\omega]+\mathbb{V}[\boldsymbol\varepsilon] = (1-H^2)$. In all simulations, genotype PCs are not included in any of the assessed model fitting procedures, and no other preprocessing normalizations were carried out to account for the added population structure. \paragraph{Proof-of-Concept Simulations: Low-Dimensional Analysis.} In this subsection, we provide a low-dimensional proof-of-concept simulation study. To accomplish this, we generate a synthetic genotype matrix $\mathbf{X}$ with $N =$ 2000 individuals and $J = 25$ SNPs with allele frequencies randomly drawn from a uniform distribution such that we only consider common variants with a minor allele cutoff above 5\%. In these simulations, we generate synthetic traits using Eq.~\eq{sim_model} by fixing the broad-sense heritability $H^2 = 0.6$ and omitting population structure effects by setting $\boldsymbol\omega = \bm{0}$. Here, we assume some subset of the variants $\mathcal{J} = \{8,9,10,23,24,25\}$ to be causal. We then consider five different simulation scenarios: \begin{itemize} \item \textbf{Scenario I (Additive and Interaction Effects):} The subset $\{23,24,25\}\subseteq\mathcal{J}$ are causal SNPs, where all three have additive effects and variants \#23 and \#24 interact with \#25, respectively. \item \textbf{Scenario II (Additive and Interactions Effects from Different SNP-sets):} All SNPs in the set $\mathcal{J}$ are causal. SNPs \#8-10 only have interaction effects and SNPs \#23-25 only have additive effects. Specifically, variants \#8 and \#9 each interact with \#10, separately. \item \textbf{Scenario III (Overlapping Additive and Interaction Effects):} All SNPs in the set $\mathcal{J}$ are causal. SNPs \#23-25 each have additive effects; while, variant \#8 interacts with \#10 and \#9 interacts with \#25, respectively. \item \textbf{Scenario IV (Interaction Effects Only):} All SNPs in the set $\mathcal{J}$ are causal only through interaction effects. SNPs \#8 and \#9 each interact with \#10, separately; while, SNPs \#23 and \#24 each interact with \#25, separately. \item \textbf{Scenario V (Noise Only):} None of the SNPs in the data have an association with the trait. Represents the case when assumptions of the null model are met. \end{itemize} We want to point out that, while this is indeed a small proof-of-concept study, each of these cases highlight settings that we might experience with real data. For each scenario, we fit a standard GP regression model similar to Eq.~\eq{GPmodel} under a zero mean prior and a radial basis covariance function. Figure \ref{Fig1} contains the global variable importance results for GOALS and RATE on Scenarios I-VI for 100 simulated replicates. Here, we perform RATE on a GP model using effect size analogs computed with the linear projection as in Eqs.~\eq{ESA}-\eq{RATE}, while the GOALS operator is calculated on the GP model as in Eq.~\eq{sample_mean}. In Figure \ref{Fig1}, the known causal SNPs for each scenario are colored in blue. To compare the null hypotheses for the two approaches, we also display red dashed lines that are drawn at the level of relative equivalence (i.e., $1/J$) for RATE and at zero for GOALS, respectively. Overall, we see that both methods perform similarly in identifying causal SNPs that have both additive and interaction effects on the trait of interest (Figure \ref{Fig1}A). However, GOALS proves to be a better discriminator between causal and non-causal SNPs than RATE when interaction effects occur in isolation (i.e., SNPs are involved in an interactions without necessarily having an additive effect). Importantly, GOALS exhibits a more robust control of the false negative rate in exchange for a slight increase in false discovery for these scenarios (see how the RATE and GOALS operators relate to the null threshold lines in Figures \ref{Fig1}B-D). This result highlights the potential limitation of the linear projection that RATE uses to compute the effect size analog and demonstrates its potential to miss associations that stem from nonlinear interactions (especially when SNPs only have non-additive effects such as markers \#8 and \#9). Lastly, GOALS is better calibrated when traits are generated from complete noise (i.e., when there are no true associations between genotype and phenotype) (Figure \ref{Fig1}E). This is due to the fact that the GOALS operator assesses the global importance variables based on their individual contribution to the model fit. While the concept of relative centrality is intuitive, achieving a completely uniform distribution of RATE values at $1/J$ under the null model will rarely happen in practice (especially in applications where spurious associations between correlated input variables and the modeled response can occur). In other words, due to the stochastic nature of data, one variable will always appear relatively more important than another which can lead to ill-informed analyses during downstream tasks under the RATE framework. Another major contribution of GOALS is that it also provides local explanations of how variables affect model fit for each individual in the data. For example, in GWA applications, this can yield key insight in the event that a genetic variant is biomarker for only a specific subset a population. To demonstrate the utility of GOALS in this case, we consider a sixth simulation scenario where \begin{itemize} \item \textbf{Scenario VI (Population Specific Effects):} The subset $\{22, 23,24,25\}\subseteq\mathcal{J}$ are causal SNPs. SNPs \#23-25 have additive and interaction effects that are associated with all individuals; while, SNP \#22 has an additive effect for only half of the population. \end{itemize} Figure \ref{Fig2} shows the distribution of the local individual-level GOALS operator for SNPs \#8, \#22, and \#25 in this split scenario. As a baseline, we also show results from running a local analysis with SHAP. For clarity, SNP\#8 is a non-causal SNP in this scenario. There are a few key takeaways in this empirical illustration. First, when a SNP has a no effect on the trait of interest, the distribution of the local scores for both GOALS and SHAP are centered at 0. Conversely, SNPs with nonzero effects on the phenotype have GOALS and SHAP operators with magnitudes that are centered distinctly away from the origin. One difference here is that the GOALS values tend to have the same sign, while the SHAP metric can be positive or negative. In the case where a SNP has an effect on trait architecture for only a subset of the observed population, the local distribution of the SHAP and GOALS operators will be multimodal allowing for individualized summaries of marker effects on specific observations. In Figure \ref{Fig2}, this characteristic is more distinct with the GOALS operator where there is clearer separation in values for SNP \#22 in individuals where it has a nonzero effect. \paragraph{Method Comparisons: High-Dimensional Global Variable Importance.} We now assess the power of GOALS and its ability to effectively prioritize causal variables in high-dimensional data settings. In this analysis, we use data from the Wellcome Trust Case Control Consortium (WTCCC) 1 study which initially consisted of 2,938 shared controls with 458,868 SNPs after following the quality control procedures of previous studies \citep{WTCCC}. Missing genotypes were imputed by using the BIMBAM software \citep[\url{http://www.haplotype.org/bimbam.html};][]{Servin:2007aa}. In these simulations, we use all polymorphic SNPs with minor allele frequencies (MAFs) above 1\% on chromosome 22 to generate continuous phenotypes. Exclusively considering this group of individuals and SNPs resulted in a final dataset consisting of $N =$ 2,938 samples and $J =$ 5,747 markers. During each simulation run, we set the broad-sense heritability to be $H^2$ = 0.3 and consider two choices for the parameter $\rho \in \{0.5, 1\}$. Here, we randomly choose a set of 30 causal SNPs which we break up into two groups. The first group contains a small set of 5 variants, while the second group contains a larger set of 25 variants. All causal markers have additive effects and, when applicable (i.e., where $\rho =$ 0.5), there are intergroup pairwise interaction effects (e.g., SNPs in the first group interact with SNPs in the second group, but never with each other). We also consider simulations with and without population stratification effects by allowing the top ten genotype principal components (PCs) to make up to 10\% of the overall variation in the synthetic traits. In total, this resulted in four scenarios based on different parameter combinations: (\textit{i}) $\rho =$ 1 and $\mathbb{V}[\mathbf{Z}\boldsymbol\omega]$ = 0; (\textit{ii}) $\rho =$ 1 and $\mathbb{V}[\mathbf{Z}\boldsymbol\omega]$ = 0.1; (\textit{iii}) $\rho =$ 0.5 and $\mathbb{V}[\mathbf{Z}\boldsymbol\omega]$ = 0; and (\textit{iv}) $\rho =$ 0.5 and $\mathbb{V}[\mathbf{Z}\boldsymbol\omega]$ = 0.1. In other words, scenarios I and II consider traits with additive effects only; while, scenarios III and IV consider traits with both additive and interaction effects. Additionally, scenarios II and IV have the additional complexity of having nonzero population stratification effects contribute to the phenotypic variation which is not observed in scenarios I and III. We compare the global power of the GOALS measure to a list of association mapping modeling techniques. Specifically, these methods include: (a) the \textit{post hoc} framework of estimating effect size analogs for the input features of a GP regression model and determining their importance using distributional centrality via RATE \citep{crawford_variable_2019}; (b) a genome-wide scan with a single-SNP univariate linear model that is typically used in GWA applications (SCANONE) \citep{Yandell:2007aa}; (c) L1-regularized ``least absolute shrinkage and selection operator'' (LASSO) regression \citep{tibshirani1996lasso}; and (d) the combined regularization utilized by the Elastic Net \citep{zou2005regularization}. Note that SCANONE produces $P$-values, and the LASSO and the Elastic Net give magnitudes of regression coefficients. The regularization approaches were fit by first learning tuning parameter values via 10-fold cross validation. Indeed, the SHAP value framework can also be used for \textit{post hoc} assessment of global interpretability by taking the average of local scores across observations for each feature in the data. However, because the SHAP approach considers all possible subsets of genotypes when determining variable importance, it does not scale well to high-dimensional settings. For this reason, we do not consider it for comparison in this simulation study. Each method is evaluated based on its ability to effectively prioritize the causal SNPs in 100 different simulated datasets. The criteria we use compares the false positive rate (FPR) with the rate at which true variants are identified by each model (TPR). A depiction of these results can be found in Figure \ref{Fig3}, where the upper limit of the FPR on the x-axis has been truncated at 0.2. This is further quantified by assessing the entire area under the curve (AUC) in the legend for further comparison. Overall method performance varies depending on the two factors: (a) the presence of interaction effects, and (b) additional structure due to population stratification. For example, most methods perform best in the first simulation scenario where the broad-sense heritability of the synthetic traits is made up of only additive effects (e.g., Figure \ref{Fig3}A). This power generally decreases in the presence of structured noise (e.g., Figure \ref{Fig3}B) or when pairwise interactions between causal SNPs have nonzero effects on the phenotype (e.g., Figure \ref{Fig3}C and \ref{Fig3}D). GOALS outperforms LASSO and Elastic Net consistently in every scenario and performs competitively with SCANONE and RATE in every scenario. More specifically, GOALS is a top performer in scenarios with additional population stratification effects at lower false positive rates. In contrast, both RATE and SCANONE lose power when structured noise is added to the simulations. While RATE performs generally well in each of these scenarios, the algorithm often takes much longer than GOALS to run as the number features increases. For a dataset with $J$ = 500 features and $N$ = 1000 samples, RATE has an average runtime of 60 seconds on computing cluster with 30 nodes whereas GOALS takes only a second to complete. We argue that these simulations highlight GOALS as a reliable option for interpretability given its consistent performance across a wide range of scenarios and its scalability as data sizes increase. GOALS also has the additional benefit of allowing for local variable importance analyses which is something that RATE and SCANONE do not provide. \subsection*{Global and Local Association Mapping in Heterogenous Stock of Mice} In this section, we apply GOALS to individual-level genetic data from a heterogenous stock of mice collected by the Wellcome Trust Centre of Human Genetics (\url{http://mtweb.cs.ucl.ac.uk/mus/www/mouse/index.shtml}) \citep{valdar_simulating_2006, valdar_gwas_2006}. The genotypes from this study were downloaded directly using the \texttt{BGLR-R} package \citep{perez_bglr_2014}. This study contains $N =$ 1,814 heterogenous stock of mice from 85 families (all descending from eight inbred progenitor strains) and 131 quantitative traits that are classified into 6 broad categories including behavior, diabetes, asthma, immunology, haematology, and biochemistry. Phenotypic measurements for these mice can be found freely available online to download (details can be found at \url{http://mtweb.cs.ucl.ac.uk/mus/www/mouse/HS/index.shtml}). In this study, we focus on three of these complex traits: body weight, percentage of CD8+ cells, and high-density lipoprotein (HDL) content. Each of these phenotypes were previously corrected for sex, age, body weight, season, and year \citep{valdar_simulating_2006, valdar_gwas_2006}. For individuals with missing genotypes, we imputed values by the mean genotype of that SNP in their corresponding family. Only polymorphic SNPs with minor allele frequency above 5\% were kept for the analyses. This left a total of $J =$ 10,227 autosomal SNPs that were available for all mice. We chose to analyze this particular dataset for a few reasons. The first reason is that RATE has been previously applied to these same three traits to perform nonlinear \textit{post hoc} variable importance \citep{crawford_variable_2019} --- thus, it provides a methodological baseline for the performance of GOALS on the global level. The second reason is that common environmental effects caused by the mice sharing the same cage have been shown to have nonzero contribution to the overall variance observed in these traits \citep{crawford_bayesian_2018}. Therefore, it means that one might expect to observe varying local SNP effects between mice assigned to different cages. Lastly, the mice in this study are known to be genetically related and the measured have varying levels of broad-sense heritability with nonzero contributions from both additive and non-additive genetic effects \citep{valdar_gwas_2006, chen_number-of-X_2012}. As result, this dataset represents a realistic mixture of the simulation scenarios we detailed in the previous sections. For each trait, we fit a GP regression model. Figures \ref{Fig4}, \ref{Fig_S1}, and \ref{Fig_S2} display the variant-level mapping results after assessing \textit{post hoc} variable importance using GOALS and RATE in HDL content, body weight, and the percentage of CD8+ cells, respectively. In these plots, notable SNPs are annotated and color coded according to their nearest mapped gene(s) as cited by the Mouse Genome Informatics database (\url{http://www.informatics.jax.org/}) \citep{bult_mouse_2019}. We also provide summary tables which lists the corresponding GOALS and RATE values for all SNPs (see Tables \ref{Tab_S1}-\ref{Tab_S3} in the Supplementary Material). In general, GOALS identified genetic signal across more unique genes and chromosomal regions than RATE in all three traits that we studied. This was most apparent in HDL where the top 10 highest ranked SNPs by RATE were all located within two genes on chromosome 1; but, the top 10 highest ranked SNPs by GOALS included 13 relevant genes across five different chromosomes (see Figure \ref{Fig4}). In addition to moderate signal on chromosome 1, GOALS also found signal on chromosomes 3, 11, 12,15, and 17. Importantly, many of the candidate SNPs selected by GOALS (and their respective genes) have been previously discovered by past publications as having some functional relationship with HDL content. For example, \textit{Tcq12}, \textit{Hyplip2}, and \textit{Ddiab41} have all been shown to associated with fat, cholesterol, and metabolism \citep{Gu:1999aa, valdar_gwas_2006, Moen:2007aa, Lawson:2011aa, Ostergren:2015aa, bult_mouse_2019}. There was notable overlap in the findings for RATE and GOALS in the analysis of body weight and the percentage of CD8+ cells. Both methods identified strong signal on the X chromosome for body weight, a genomic region that was also validated by \citet{valdar_gwas_2006} in the original study (see Figure \ref{Fig_S1}). Here, GOALS and RATE detected several adiposity-related genes, including \textit{Obq6} \citep{taylor_gender-influenced_1999, chen_number-of-X_2012} and \textit{Dbts2} \citep{Cheverud:2004aa}. For the percentage of CD8+ cells, both methods identified many genes on chromosome 17 which are known to greatly determine the ratio of T-cells \citep{yalcin_commercially_2010}, and some have been suggested to modulate cell adhesion and motility in the immune system \citep{Kim:2006aa}. Overall, out of the top ten most prioritized variables ranked by GOALS and RATE, there was a 30\% overlap for body weight and a 90\% overlap for the percentage of CD8+ cells. For the latter, only GOALS prioritized a SNP on Chromosome 4 which harbors genes \textit{Lpq1} involved in pairwise interactions that are associated with lymphocyte percentage \citep{Miller:2020aa}. Once again, the additional benefit of GOALS is its ability to also perform local variable importance for individual samples. In this particular dataset from the Wellcome Trust Centre of Human Genetics, shared common environments between mice have been shown to contribute to the phenotypic variation of complex traits \citep{valdar_simulating_2006, valdar_gwas_2006,crawford_bayesian_2018}. For example, dietary and immunological phenotypes could depend heavily on the distribution of food and water in each cage. To that end, we assessed the local GOALS metrics for notable SNPs across mice according to the cages in which they were assigned during the study. In Figure \ref{Fig5}, we take the two SNPs with the greatest global GOALS value in each trait and plot the local values for the 4 cages with the greatest and least local means. Overall, our proposed measure does indeed seem to capture environmental variation. This is again most apparent in HDL where the top SNPs rs13459070 (chromosome 3) and rs3721166 (chromosome 15) have very different effects on mice in different cages (e.g., Figure \ref{Fig5}B and \ref{Fig5}E). Altogether, these sets of results would allow practitioners to perform deeper and more nuanced downstream analyses of phenotypic behavior in different populations. \section*{Discussion} In this paper, we proposed the “GlObal And Local Score” (GOALS) operator: a general approach for regression models that assesses variable importance for features at both the local and global levels of data, simultaneously. While this novel \textit{post hoc} interpretability measure can be used for any type of statistical model, we frame GOALS within the context of genome-wide association (GWA) studies where there is an goal to understand how both additive and non-additive sources of genetic variation contribute to disease progression and complex trait architecture. In the main text, we described the probabilistic properties of GOALS assuming we have fit a Gaussian process regression model with a shift-invariant covariance function. We also discussed its similarities to distributional centrality measures \citep{woo2015elucidating,piironen_projection_2016,piironen_comparison_2017,crawford_variable_2019,paananen2019variable,paananen2021uncertainty} and Shapley Additive Explanations (SHAP) \citep{lundberg_unified_2017,chen2022explaining} which are commonly used approaches for determining global and local feature importance in nonlinear statistical methods, respectively. Through extensive simulations, we showed that our new measure can be used for feature selection and gives comparable state-of-the-art performance even in the presence of population structure (Figures \ref{Fig1}-\ref{Fig3}). The added benefit of GOALS is its ability to also understand how features affect individual samples on the local level and its computational efficiency to reach conclusions with much improved runtime as the dimensions of data increase. In applications to a real GWA dataset from the Wellcome Trust Centre of Human Genetics \citep{valdar_simulating_2006, valdar_gwas_2006}, we showed that GOALS has the ability to identify a greater number of trait-relevant genomic loci in a heterogenous stock of mice that have also been detected in many previous publications (Figures \ref{Fig3} and \ref{Fig_S1}-\ref{Fig_S2} and Tables \ref{Tab_S1}-\ref{Tab_S3}). The first key part of this analysis was that the ability of GOALS to be incorporate non-additive information allowed it to find genetic signal that were missed by other \textit{post hoc} approaches based on linear approximations. The second main takeaway from the real data GWA analysis is that the GOALS providing local interpretability enables downstream analyses to investigate how and why specific biomarkers are enriched for specific subsets of a population (Figure \ref{Fig5}). In this study, we saw how SNPs associated with high density lipoprotein (HDL) content had varying local effects among mice assigned to different cages --- potentially, as a result of differing environments such as access to food and water. Ultimately, we hope that GOALS will encourage the continued development of probabilistic machine learning methods that can analyze complex data at the local and global levels. The current implementation of the GOALS framework offers many directions for future development. First, while GOALS is conceptually applicable to scientific domains outside of statistical genetics, further work is needed to fully assess the best way implement the approach elsewhere. Currently, when assessing variable importance, we fix the perturbation parameter for each feature to be $\xi = 1$. This is motivated by our application to GWA studies where the variables measured are often single nucleotide polymorphisms (SNPs) encoded as $\{0,1,2\}$ copies of a reference allele at each locus. Part of our future work will be to explore how to choose $\xi$ or allow for the $j$-th column of $\boldsymbol\Xi^{(j)}$ to take on multiple values such that GOALS is more widely generalizable to other applications. Additionally, for demonstrative purposes, we allowed our chosen value of $\xi$ to take values of $\Tilde{\mathbf{X}}^{(j)}$ outside of the SNP domain space. While we believe this did not impact the overall results, more exploration is needed for values of $\xi$ to respect the domain space and increase interpretability. Secondly, while GOALS provides a measure of general association for nonlinear methods, it cannot be used to directly identify the component (i.e., linear vs. nonlinear) that drives individual variable importance. Thus, despite being able to detect variants that are associated to a response in a nonlinear fashion, GOALS is unable to directly identify the detailed orders of interaction effects. This same limitation also exists with distributional centrality measure such as RATE. A key part of our future work is to continue learning how to disentangle this information \citep[e.g., very similar to the goals of][]{woody_model_2021, kowal_fast_2021}. We also note that we did not explicitly conduct experiments to assess the effect of collinearity on variable selection performance \citep{Wold:1984aa,gelman_hill_2006}, but we did conduct both simulations and data analyses using real genotypic data with various levels of linkage disequilibrium (LD) (i.e., correlation structure) between variants. Therefore, we did implicitly take collinearity into account. In our framework, as long as the nonlinear regression model is capturing the appropriate relationships between the data and the response, GOALS will be able to rank features effectively. As a third extension, GOALS does not enforce any sparsity or shrinkage when performing variable importance. Thus, while it has a natural null hypothesis (i.e., Eq.~\eq{GOALS}), it does not naturally produce a significance threshold for variable selection. Common examples in biomedicine include a Bonferroni-corrected threshold \citep{Gordon:2007aa} or selection based on a median probability model \citep{Barbieri:2004aa}. A natural solution could be to permute the phenotypic labels and refit the model a number of times to choose a GOALS-specific family-wise error rate (FWER) \citep[e.g.,][]{Hoti2006bayesianmapping,Stephens2009bayesianmethods}; however, this can be computationally intensive. One alternative could be to sample a collection of $\boldsymbol\delta^{(j)}$ from the posterior distribution as specified in Eq.~\eq{GOALS_dist} and select significant variables based on a metric like a local false sign rate \citep{stephens_false_2016}. Lastly, univariate variable importance methods have been shown to be underpowered in settings where there are many causal variables with small effects. In many GWA applications, recent methods have utilized prior knowledge to test groups of SNPs at a time for enrichment with a particular trait \citep{liu2010versatile,Wu:2010aa,Carbonetto:2013aa,Leeuw:2015aa,Lamparter:2016aa,Nakka:2016aa,Zhu:2018aa,Sun:2019aa,Cheng:2020aa,Demetci:2021aa,ish2019interpreting}. This same group hypothesis extension can also be extended to the GOALS framework by simply perturbing multiple variables at a time. \section*{Software Details} Code for implementing the ``GlObal And Local Score'' (GOALS) operator is freely available at \url{https://github.com/lcrawlab/GOALS}, and is written in a combination of \texttt{R} and \texttt{C++} commands. \section*{Acknowledgements} This research was conducted using computational resources and services at the Center for Computation and Visualization (CCV), Brown University. E.T.~Winn-Nu\~{n}ez was supported by the National Science Foundation Graduate Research Program under Grant No.~1644760. This research was supported by a David \& Lucile Packard Fellowship for Science and Engineering awarded to L.~Crawford. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of any of the funders. \section*{Author Contributions} All authors conceived the study and developed the methods. MG and LC supervised the project and provided resources. ETWN and LC developed the software. ETWN performed the analyses. All authors wrote and revised the manuscript. \section*{Competing Interests} The authors declare no competing interests. \newpage \section*{Figures} \begin{figure}[H] \centering \includegraphics[width = \textwidth]{Figures/Fig1} \caption{\textbf{Proof-of-concept simulations to demonstrate how GOALS and RATE globally prioritize associated variants with varying degrees of additive and interaction effects.} These simple simulations assume that synthetic traits have broad-sense heritability $H^2 = 0.6$ with interaction effects contributing to $(1-\rho)$ = 0\% to 50\% of the phenotypic variation. SNPs highlighted in blue have nonzero effects within each of the five different scenarios. To compare the null hypotheses for the two approaches, we also display red dashed lines that are drawn at the level of relative equivalence (i.e., $1/J$) for RATE (left column) and at zero for GOALS (right column), respectively. Note that the scales of the y-axes are different because RATE is theoretically bounded on the unit interval [0, 1]. Here, the main takeaway is that, because the GOALS operator measures variable importance in function space, it is more robust to identifying variants whose associations are driven primarily by interaction effects. All results shown in this figure are based on 100 replicates.} \label{Fig1} \end{figure} \begin{figure}[ht] \centering \includegraphics[width = 0.84\textwidth]{Figures/Fig2} \caption{\textbf{Proof-of-concept simulations to demonstrate how GOALS and SHAP locally prioritize associated variants that have varying level of effects on specific subsets of the population.} These simple simulations assume that synthetic traits have broad-sense heritability $H^2 = 0.6$ with interaction effects contributing to $(1-\rho)$ = 50\% of the phenotypic variation. Here, each point is an individual. We highlight the local variable importance metrics for three specific SNPs according \textbf{(A)} GOALS and \textbf{(B)} Shapley Additive Explanations (SHAP). In this simulation study, SNP \#8 is null feature and does not contribute to the phenotypic variation; SNP \#25 has additive and interaction effects that are associated with all individuals; and SNP \#22 has an additive effect for only half of the population. A point is blue if the corresponding labeled SNP has a nonzero effect for that individual. The main takeaway of this analysis is that, in the case where a SNP has an effect on trait architecture for only a subset of the observed population, the local distribution of the SHAP and GOALS operators will be multimodal allowing for individualized summaries of marker effects on specific observations. The black dashed line is drawn at zero to represent a threshold where a SNP has no effect for a given sample.} \label{Fig2} \end{figure} \begin{figure}[ht] \centering \includegraphics[width = \textwidth]{Figures/Fig3} \caption{\textbf{Receiving operating characteristic (ROC) curves comparing the performance of GOALS against other global variable importance approaches in simulations.} Here, synthetic traits are simulated with broad-sense heritability $H^2 = 0.3$ with only additive effects in panels \textbf{(A)} and \textbf{(B)}, and a combination of additive and pairwise interaction effects in panels \textbf{(C)} and \textbf{(D)}. This is controlled by a free parameter $\rho = \{0.5, 1\}$ which was used to determine the proportion of phenotypic variance that is contributed by additivity. The traits simulated in panels \textbf{(B)} and \textbf{(D)} also have the additional complexity of having population stratification effects. Competing approaches include: Gaussian process regression with GOALS (blue), Gaussian process regression with RATE (red), LASSO regularization (green), the Elastic Net (yellow), and the SCANONE method (pink). Note that the upper limit of the x-axis (i.e., false positive rate) has been truncated at 0.20. All results are based on 100 simulated replicates.} \label{Fig3} \end{figure} \begin{landscape} \begin{figure}[ht] \centering \vspace*{-0.7 in} \hspace*{-0.3 in} \includegraphics[scale = 0.65]{Figures/Fig4} \caption{\textbf{Manhattan plot of variant-level association mapping results for high-density lipoprotein (HDL) content in the heterogenous stock of mice dataset from the Wellcome Trust Centre of Human Genetics \citep{valdar_simulating_2006, valdar_gwas_2006}.} Panel \textbf{(A)} depicts the global GOALS measure of quality-control-positive SNPs plotted against their genomic positions after running a Bayesian Gaussian process (GP) regression on the quantitative trait. As a direct comparison, in panel \textbf{(B)}, we also include results after implementing RATE on the same fitted GP model. In this figure, chromosomes are shown in alternating colors for clarity. The top 10 highest ranked SNPs by GOALS and RATE, respectively, are labeled and color coded based on their nearest mapped gene(s) as cited by the Mouse Genome Informatics database (\url{http://www.informatics.jax.org/}) \citep{bult_mouse_2019}. These annotated genes are listed in the legends of each panel. A complete list of the GOALS and RATE values for all SNPs can be found in Table \ref{Tab_S1}.} \label{Fig4} \end{figure} \end{landscape} \begin{landscape} \begin{figure}[ht] \centering \includegraphics[scale = 0.75]{Figures/Fig5} \caption{\textbf{Plot of local variable importance according to GOALS as a function of cage for notable genetic variants in the analysis of the heterogenous stock of mice dataset from the Wellcome Trust Centre of Human Genetics \citep{valdar_simulating_2006, valdar_gwas_2006}} Here, we show how SNPs have varying levels of importance for individual mice depending on the cage they were assigned to in the study. The traits analyzed here include \textbf{(A, D)} body weight (BW); \textbf{(B, E)} high-density lipoprotein (HDL) content; and \textbf{(C, F)} percentage of CD8+ cells. The blue points are mean local GOALS value for each cage and the grey lines show the total distribution. In this plot, we take the two SNPs with the greatest global GOALS value in each trait and plot the local values for the 4 cages with the greatest and least local means. The black dashed line is drawn at zero to represent a threshold where a SNP has no effect for a given mouse.} \label{Fig5} \end{figure} \end{landscape} \clearpage \newpage
\section{Introduction} \label{sec:intro} Leptoquarks are predicted by various extensions of the Standard Model (SM), such as Technicolour \cite{Eb:1981axe,PhysRevD.44.2678}, models of quark-lepton unification \cite{PhysRevD.10.275,FileviezPerez:2013zmv,Blanke:2018sro,Aydemir:2018cbb,Heeck:2018ntp}, and grand unification theories (GUTs) based on $SU(5)$, $SO(10)$, $E_6$~\cite{Das:2016vkr,Marzocca:2018wcf,Becirevic:2018afm,Aydemir:2019ynb,Crivellin:2019dwb,Aydemir:2022lrq}, and etc. They are rather unique amongst the many new particles predicted in new physics frameworks beyond the SM for being colour-triplet bosons that carry both lepton and baryon numbers. Their other quantum numbers (i.e., spin, (fractional) electric charge, and weak isospin) can be different in different theories. Naturally, they were extensively searched for at the $ep$ colliders. In fact, at HERA, DESY, an excess was found in 1997 \cite{H1:1997utt} which would have been compatible with the so-called first-generation LQs (i.e., those coupling to first-generation leptons and quarks). However, further searches at HERA (and also at Tevatron, where most of the partonic processes were initiated by quarks inside the (anti-)proton) failed to confirm the anomaly. As a result, mass limits near 300 GeV \cite{PhysRevD.68.052004,H1:2011cqr} were set on first-generation LQs. Even weaker limits were placed on second-generation LQs. These (relatively) weak limits were owing to the fact that the partonic energy accessible at HERA and Tevatron was limited to the sub-TeV range. However, as colour triplets, LQs also interact with gluons. At the Large Hadron Collider (LHC), since the amount of gluons inside the proton can well exceed that of (both valence and sea) quarks, the availability of much higher centre-of-mass energy may enable the pair-production of third-generation LQs. The ATLAS and CMS experiments have both, therefore, analysed the datasets from the LHC Runs 1 and 2 to put exclusion limits on the mass of the third-generation LQs, based on their $t\bar t\tau\tau$, $t\bar b \tau\nu$, and $t\bar b \mu\nu$ decay channels, in the TeV range \cite{CMS:2018svy,CMS:2020wzx,ATLAS:2021oiz,ATLAS:2021jyv}. In this paper, for LQs having couplings solely with the third generation fermions, we revisit the $t\bar t\tau\tau$ search channel for LQs of the $S_1$ type, i.e., LQs with charge $- 1/3$ and spin zero. However, unlike the existing searches for this channel, which have relied on leptons in the final state, we investigate the scope of the fully hadronic final state. Following a sophisticated detector-level analysis tensioning the signal to the most relevant backgrounds, we show that such a complementary channel can offer sensitivities to this specific type of LQ comparable, if not better, than what has so far been achieved in their probes exploiting leptons. We then interpret the results of our analysis in the Exceptional Supersymmetric Standard Model (E$_6$SSM)~\cite{King:2005jy,King:2005my} (for a recent review, see Ref.~\cite{King:2020ldn}), as a theoretically well-motivated prototypical framework that naturally accommodates the $S_1$--type LQs. The plan of the paper is as follows. In the next section, we will describe our phenomenological setup in a model-independent way, which will then be subjected to a Monte-Carlo analysis in the following section. In Sec. \ref{sec:interp} we will discuss the E$_6$SSM and its possible scenarios that are amenable to experimental investigation by ATLAS and CMS, before concluding in Sec. \ref{sec:concl}. \section{\label{sec:model} Third-generation Scalar LQs} We consider a simple extension of the SM by adding one scalar $S_1$--type LQ, which is charged as $(3,1,-1/3)$ under its gauge group, $SU(3)_C\times SU(2)_L \times U(1)_Y$. We limit our discussion to LQs with the same quantum numbers as the coloured triplet of scalars, which, along with the Higgs doublet, constitutes the fundamental representation of $SU(5)$ \cite{FileviezPerez:2007bcw,Khalil:2013ixa}. LQs with such quantum numbers have been proposed as a solution to the $a_\mu$ and $B$-flavour anomalies (see, e.g., \cite{Cai:2017wry,Crivellin:2019qnh,Marzocca:2021azj}). We assume that our LQ, denoted by $D$ henceforth, couples only to the third-generation fermions, with the corresponding Lagrangian being \begin{equation} {\cal L} = \lambda \bar{Q}_L D \bar{\ell}_L + \lambda' \bar{t}_R D \bar{\tau}_R\,, \end{equation} where $Q_L = \left(t, b\right)_L^T$, and $\ell_L = ( \nu_\tau, \tau )_L^T$. This implies that the left-handed $t$ quark couples to the left-handed $\tau$ lepton, while the right-handed $t$ couples to the right-handed $\tau$. The mass of the $t$ quark at the one-loop level can thus cause the $\tau$ chirality to flip. Based on the above interaction terms, the $D$ can decay into $t\tau$ and $b\nu_\tau$ pairs. However, we assume $\lambda' \gg \lambda$, so that the decay to $t \tau$ is significantly enhanced. This LQ can be produced in pairs at the LHC through the processes shown in Fig.~\ref{FD}. \begin{figure}[t] \centering \subfloat[]{{\includegraphics[scale=0.45]{FD.pdf} }} \qquad \subfloat[]{{\includegraphics[scale=0.45]{FD1.pdf} }} \qquad \subfloat[]{{\includegraphics[scale=0.45]{FD2.pdf} }} \qquad \subfloat[]{{\includegraphics[scale=0.45]{FD3.pdf} }} \qquad \subfloat[]{{\includegraphics[scale=0.45]{FD4.pdf} }} \caption{Pair-production of scalar LQs at the LHC.} \label{FD} \end{figure} Given that the $D$ couples only to the third-generation fermions, the diagram (e) in Figure \ref{FD} is negligible (unless the corresponding $\lambda$ and $\lambda^{\prime}$ couplings are extremely large, which is never the case here). The cross section for the $D$ pair production is therefore almost completely determined by QCD, and can be considered to be model-independent.\footnote{The contribution from the model-dependent diagram (e) can, in fact, be distinguished from the others as one expects two $b$--tagged jets close to the beam direction.} We can write this in the form \begin{equation} \sigma(p p \to t\bar{t}\tau\tau) = \sigma(p p \to D \overline{D}) \times {\rm {\rm BR}}(D \to t \tau^-) \times {\rm {\rm BR}}(\overline{D} \to \bar{t} \tau^+)\,, \end{equation} where BR stands for branching ratio. In our setup, we have ${\rm {\rm BR}}(D \to t \tau^-) = {\rm {\rm BR}}(\overline{D} \to \bar{t}\tau^+)\simeq 1$, and the leading order (LO) partonic cross sections $ \sigma(g g \to D \overline{D})$ and $\sigma(q\bar{q}\to D\overline{D})$ are given by \cite{Kramer:1997hh} \begin{eqnarray} \sigma(g g \to D \overline{D}) & = & \frac{\alpha_s^2 \pi}{96 \hat{s}} \left[ \beta(41 -31 \beta^2) + (18 \beta^2 - \beta^4 -17) \log \frac{1+\beta}{1-\beta}\right]\,,~~{\rm and}\\ \sigma(q\bar{q}\to D \overline{D}) & = & \frac{2\alpha_{s}^{2}\pi}{27\hat{s}}\beta^{3}, \end{eqnarray} where $\beta= (1- 4 M_D^2/\hat{s})^{1/2}$, and $\sqrt{\hat{s}}$ is the partonic center of mass energy. In Tab. \ref{tb:xsecs} we show the LO and next-to-LO (NLO) pair-production cross sections, computed with \textsc{MadGraph5 v3.2.0} \cite{Alwall:2014hca} and \textsc{Prospino v2.1}\cite{Beenakker:1996ed}, using the NNPDF 3.1 parton distribution functions (PDFs) at LO \cite{NNPDF:2017mvq}. Note that our cross section values are somewhat smaller than those in \cite{ATLAS:2021oiz}, mainly due to the different PDF sets used, but they agree well with those in Ref. \cite{Borschensky:2020hot}, which also uses NNPDF 3.1. \begin{table}\centering \begin{tabular}{l|c c} $m_{D}$ (GeV) & $\sigma_{\rm LO}$ (fb) & $\sigma_{\rm NLO}$ (fb)\\ \hline $1000$ & $3.22$ & $5.73$\\ $1100$ & $1.57$ & $2.86$\\ $1200$ & $0.79$ & $1.50$\\ $1300$ & $0.42$ & $0.79$\\ $1400$ & $0.22$ & $0.44$\\ $1500$ & $0.12$ & $0.25$\\ $1600$ & $0.070$ & $0.146$ \end{tabular} \caption{The LO and NLO production cross sections for the $pp\rightarrow D\overline{D}$ process for a range of the $D$ mass at the $\sqrt{s}=13$~TeV LHC. The uncertainty related to the variation of the renormalisation and factorisation scales is $\pm 20\%$. \label{tb:xsecs}} \end{table} Our simplified extension of the SM with a $S_1$--type LQ can be considered an effective low-energy limit of some GUT framework. In the simplest GUTs, however, our $D$ would have non-zero quark-lepton as well as quark-quark couplings, which can lead to rapid proton decay. To ensure the model's phenomenological viability, all the couplings of the $D$ to quark pairs can be set to zero, implying the conservation of baryon and lepton numbers. Furthermore, GUT models have a large separation of scales, and to stabilise the ensuing hierarchy, supersymmetry is often preferred. If we supersymmetrise our model, we need to introduce two chiral superfields, one of which has $\lambda$--type and the other $\lambda^{\prime}$--type superpotential couplings. The `exotic' particle spectrum then consists of two scalars and one fermion. The scalar states may have non-zero mixing, and one of the resulting physical states decays dominantly to $t\tau$, while the other has nearly equal BRs in the $t\tau$ and $b\nu$ decay channels. The decay of their superpartner fermion LQ leads to third-generation fermions and missing transverse momentum. Such a low-energy effective model can be embedded in a supersymmetric (SUSY) GUT framework such as the E$_6$SSM, which is free from the severe constraints from proton stability noted above. \section{\label{sec:fullyhadronic} The fully hadronic $t\bar{t}\tau\tau$ final state at the LHC Run 2} \begin{table}[tbp]\centering \begin{tabular}{|c|c|c|} \hline Decay Mode & Mass Limit [GeV] & Experiment \\ \hline \hline \multirow{2}{*}{$t\bar{t}\tau\tau$} & 900 & CMS \cite{CMS:2018svy} \\ & 1400 & ATLAS \cite{ATLAS:2021oiz} \\ \hline \multirow{3}{*}{$tb\tau\nu$} & 950 & CMS \cite{CMS:2020wzx} \\ & 1250 & ATLAS \cite{ATLAS:2021jyv}\\ & 1220 & ATLAS \cite{ATLAS:2021oiz}\\ \hline \end{tabular} \caption{\label{TAB:limits}$95\%$ CL lower mass limits by the ATLAS and CMS Collaborations from pair-produced third-generation scalar LQs.} \end{table} The $S_1$--type LQ under consideration here is subject to stringent limits from the ATLAS and CMS collaborations, most recent ones of which are given in Table~\ref{TAB:limits}. These limits correspond to the BR$(t\tau)$ at the 95\% confidence level (CL), and are obtained either directly when $t\tau$ is the exclusive decay channel of the LQ, or translated from the measurements in the $b\nu$ decay channel, when it is additionally open, as $1-{\rm BR}(b\nu)$. For the $t\tau$ decays of the pair-produced scalar LQs, these searches have so far employed final states with $e$ and $\mu$ leptons as well as hadrons from the $\tau$ decays ~\cite{ATLAS:2021oiz,CMS:2022nty}. For collider analyses of some other possible LQ decay channels, see \cite{Vignaroli:2018lpq,Ghosh:2022vpb} and references therein. In this study, we propose to complement the ATLAS and CMS probes of the $t\bar{t}\tau\tau$ intermediate state with the fully hadronic topology emerging when the decays of both the $\tau$ leptons and both the $t$ quarks result in only jets in the final state. The analysis should select events with two $\tau_{\rm h}$ (i.e., $\tau$ decaying hadronically) and at least six jets, with two of them being $b$--tagged. The fully hadronic final state has two advantages compared with the semi-leptonic final state. First, it allows one to fully reconstruct the $D$ mass. Second, it increases the number of the signal events. We will show that the level of the background can be reduced to that of the expected signal using $\tau$-- and $b$--tagging techniques, and by exploiting the large mass of the $\tau_{\rm h}$ pair. To investigate the scope of the fully hadronic final state, we performed a signal-to-background analysis for the pair-production of LQs with a mass of 1\,TeV each. The signal and the dominant $t \bar{t} j j$ background cross sections were calculated with Madgraph\_aMC@NLO at the LO, with selections $\Delta R(jj)>0.4$, $p_{T}^{j}>20$\,GeV, and $|\eta^{j}|<2.4$ for the jet transverse momentum and pseudorapidity, respectively, at the parton level. $\tau$ leptons in the signal sample were forced to decay hadronically, $\tau^{\pm}\rightarrow\pi^{\pm}\pi^{0}\nu_{\tau}$. We used the efficiencies and fake rates for $\tau$-- and $b$--tagging, and the $\tau\tau$ mass resolution for the $Z$ and Higgs bosons from the CMS publications (cited in the following), implying \begin{itemize} \item $p_{1(2)}^{\tau}=0.7$ (0.5) efficiency of $\tau$--tagging for real $\tau$, with $p_{T}^{\tau_{\rm h}}>100$\,GeV ($<100$\,GeV), and $p_{\tau-{\rm fake}}=3\times10^{-3}$ mistagging rate for the jets (using the DeepTau algorithm~\cite{CMS:2022prd}); \item $p_{b}=0.8$ efficiency of $b$--tagging for real $b$--jets, and $p_{b-{\rm fake}}=10^{-2}$ mistagging rate for non--$b$--jets (using the DeepJet algorithm~\cite{Bols:2020bkb}); \item 15\% di--$\tau$ mass resolution for the $Z$ and Higgs bosons, i.e., 14\,GeV and 19\,GeV, respectively (using the SVFit algorithm~\cite{Bianchini:2014vza}). \end{itemize} Fig.~\ref{fig:DD} shows the distribution of $p_{T}^{\tau_{\rm h}}$ (left), and the $\tau\tau$ effective mass, $m_{\tau\tau}$, (right) for the signal. For the $t\bar{t}jj$ events, we show in the left panel of Fig.~\ref{fig:ttjj1} the distribution of the $p_T$ of the parton jets, i.e., the two partons in addition to $t\bar{t}$, and in the right panel the di--jet effective mass, $m_{jj}$, reconstructed from these parton jets. \begin{figure}[tbp] \begin{center} \resizebox{7cm}{!}{\includegraphics{E6SSM_pttau.pdf}} \hfill \resizebox{7cm}{!}{\includegraphics{E6SSM_mtautau.pdf}} \caption{$p_T$ of the $\tau_{\rm h}$ (left) and the di--tau effective mass (right) for the $D\overline{D}$ signal.} \label{fig:DD} \end{center} \end{figure} We exploit the difference between the $m_{\tau\tau}$ and $m_{jj}$ distributions to suppress the dominant $t\bar{t}jj$ background while preserving a high efficiency for the signal. The event selection strategy we propose is the following. Events must contain eight jets with two of them $b$--tagged. Six jets in the event, including the two $b$--tagged jets, must be associated with the two $t$ quarks. The remaining two jets have to be $\tau$--tagged, and their effective mass should be greater than 200\,GeV. In our estimate of the efficiency of the di--jet mass selection for the $t\bar{t}jj$ background we assume correct association of the jets with the $t$ quarks for 100\% of the events. It was shown, however, in~\cite{CMS:2019eih} that the fraction of the $t\bar{t}jj$ events with correct $j$--to--$t$ association is 60\%. It could thus potentially make the suppression factor of the di--jet mass selection used in our estimates weaker. For the estimation of the efficiency of the di--jet mass selection we used the generator-level $\tau_{\rm h}$ for the signal, and parton jets with $p_T>40$\,GeV and $|\eta|<2.4$ for the $t\bar{t}jj$ background. This corresponds to the CMS di--$\tau$ high-level trigger selections used for the Run 2~\cite{CMS:2022goy}. Table~\ref{tab:bkgs} shows the cut-flow for the signal and background cross sections before and after the selections, along with the selection efficiencies. The selections considered here are the double--$b$-- and double--$\tau$--tagging, and the constraint on the di--$\tau$ mass. For the signal cross section we have used two values. The cross section corresponding to the upper limit obtained in the ATLAS analysis~\cite{ATLAS:2021oiz} at $m_{D}$=1\,TeV, and (in parenthesis) the cross section of the $pp \rightarrow D\overline{D}$ process in the E$_6$SSM at the 13\,TeV LHC. The latter includes the NLO corrections calculated with Prospino~\cite{Beenakker:1996ed}. For the background, we have used the CMS measurements of the inclusive $t\bar{t}jj$ and $t\bar{t}b \bar{b}$ cross sections~\cite{CMS:2020grm,CMS:2019eih}, the inclusive cross sections for the $t\bar{t}Z(\rightarrow\tau\tau)$~\cite{CMS:2019too} and $t\bar{t}W (\rightarrow jj)$~\cite{CMS:2017ugv} processes, and the $Z(\rightarrow\tau\tau)+6j$~\cite{CMS:2018mdf} and $W(\rightarrow jj)+6j$~\cite{CMS:2017gbl} cross sections, as functions of the jet multiplicity. The cross section for the Higgs boson production, in association with two $t$ quarks, followed by its $\tau\tau$ decay was taken from Ref.~\cite{LHCHiggsCrossSectionWorkingGroup:2016ypw}. For two background processes, $t\bar{t}W$ and $W+6j$, we did not evaluate the efficiency of the di--$\tau$ mass selection, and therefore give the upper limit on the corresponding cross sections after the selections. Note that the di--$\tau$ mass selection cuts eliminates the $t\bar{t}Z$ and $Z+6j$ backgrounds due to more than 5$\sigma$ difference between the di--jet threshold and $m_Z$. It likewise eliminates the $t\bar{t}H$ background, since the $jj$ threshold is also about 4$\sigma$ above the $m_H$. \begin{figure}[tbp] \begin{center} \resizebox{7cm}{!}{\includegraphics{E6SSM_ttjj_pttau.pdf}} \hfill \resizebox{7cm}{!}{\includegraphics{E6SSM_ttjj_mtautau.pdf}} \caption{$p_T$ of the parton jet (left) and the di--jet effective mass (right) for the $t\bar{t}jj$ background.} \label{fig:ttjj1} \end{center} \end{figure} \begin{table}[tbp] \begin{center} {\footnotesize \begin{tabular}{|c|c|c|c|c|c|} \hline Process & $\sigma$ [fb] & $bb$--tagging & $\tau\tau$--tagging & $m_{\tau\tau}>200$\,GeV & $\sigma^{\rm sel}$[fb]\\ \hline\hline Signal & 0.5 (5.73) & $p_{b}^{2}$ & $(p_{1}^{\tau})^{2}$ & 0.97 & 0.15 (1.74) \\ \hline\hline $t\bar{t}jj$ & $275\times 10^{3}$& $p_{b}^{2}$ & $(p_{\tau-{\rm fake}})^{2}$ & 0.45 & 0.71 \\ \hline $t\bar{t}Z$ & $950\times{\rm BR}(Z\rightarrow\tau\tau)$ & $p_{b}^{2}$ & $(p_{2}^{\tau})^{2}$ & $<5.7\times10^{-7}$ & $<2.6\times 10^{-6}$ \\ \hline $t\bar{t}W$ & $770\times{\rm BR}(W\rightarrow q q^\prime)$ & $p_{b}^{2}$ & $(p_{\tau-{\rm fake}})^{2}$ & & $<3.1\times 10^{-3}$ \\ \hline $t\bar{t}H$ & 32 & $p_{b}^{2}$ & $(p_{2}^{\tau})^{2}$ & $6.3\times 10^{-5}$ & $3.2\times 10^{-4}$ \\ \hline $Z+6j$ & 50 & ${\rm C}_{6}^{2}p_{b-{\rm fake}}^{2}(1- p_{b-{\rm fake}})^{4}$ & $(p_{2}^{\tau})^{2}$ & $<5.7\times 10^{-7}$ & $<1.0\times 10^{-8}$ \\ \hline $W+6j$ & 600$\times\rm R^{q q^\prime}_{\mu\nu}$ & ${\rm C}_{8}^{2}p_{b-{\rm fake}}^{2}(1- p_{b-{\rm fake}})^{6}$ & $(p_{\tau-{\rm fake}})^{2}$ & & $<1.0\times 10^{-4}$ \\ \hline \end{tabular} } \caption{The signal and background cross sections before and after the selections, and the selection efficiencies. The $C^{k}_{n}$ are the binomial coefficients $\binom{n}{k}$. See text for details. \label{tab:bkgs} } \end{center} \end{table} As one can see from Table~\ref{tab:bkgs}, the selection cuts used eliminate all the backgrounds except the dominant $t\bar{t}jj$. Further suppression of this background can be done by exploiting the possibility of the full reconstruction of the $D$ mass as the effective mass of the $t\tau$ pair. The association of the two $\tau$'s and the two $t$ quarks to the $D\overline{D}$ pair can be done as follows. Out of the two $\tau_{\rm h}$ objects, we take the one which gives the $t\tau$ mass, $\rm m_{1}^{t\tau}$, closest to the $D$ mass (1\,TeV here). At this step, the $t$ quark out of the two is taken randomly. The other $\tau_{\rm h}$ and the other $t$ quark then give the mass of the second LQ, $m_{2}^{t\tau}$. Fig.~\ref{fig:ttjj2} shows the distribution of the $m_{1}^{t\tau}$ (left) and $m_{2}^{t\tau}$ (right) for the $t\bar{t}jj$ events after the selections $p_{T}^{j}>40$\,GeV, $|\eta^{j}|<2.4$, and $m_{jj}>200$\,GeV. One can see that selecting a large $m_{2}^{t\tau}$ can sufficiently suppress the $t\bar{t}jj$ background. The detector mass resolution of the $t$ quark in a fully hadronic decay mode is 14\,GeV (8\% of the $m_t$) at the CMS~\cite{CMS:2018tye}. We assume conservatively a detector resolution of 10\% for the $t\tau$ mass, so that $\sigma_D^{\rm exp}=100$\,GeV for $m_{D}=1$\,TeV, and the natural width of $D$ to be negligible compared to it. The efficiency of the selection $m_{2}^{t\tau}>m_{D}-2\sigma_{D}^{\rm exp}=800$\,GeV is 0.06 for the $t\bar{t}jj$ background, and 0.95 for the signal. It leads to cross sections of 0.14 (1.65) fb for the signal and 0.04 fb for the $t\bar{t}jj$ background after all the selections imposed so far. It corresponds to 20 (231.0) expected signal events and 6 background events for an integrated luminosity of 140 fb$^{-1}$, resulting in a signal significance, $2(\sqrt{S+B}-\sqrt{B})$~\cite{Bityukov:1998ju}, of 5.2 ($>5$). Moreover, the expected upper limit on the number of the signal events is 6.2 corresponding to the cross section of 0.16 fb, which is better than the 0.5 fb limit at $m_{S_1}=1$\,TeV from the ATLAS analysis~\cite{ATLAS:2021oiz}. Two factors related to the detector reconstruction effects can potentially weaken the performance of our analysed channel. First, as mentioned already, the association of the jets and $b$--jets to the $t$ quarks is not expected to be 100\% correct. And second, the jet energy smearing can reduce the impact of the $m_{jj}>200$\,GeV selection cut. Such effects can be estimated with a full detector simulation and reconstruction. We, however, do not expect our reported results to change drastically, and emphasise that the fully hadronic $t\bar{t} \tau \tau$ final state can nicely complement the current Run 2 analyses employing final states with leptons. \begin{figure}[tbp] \begin{center} \resizebox{7cm}{!}{\includegraphics{E6SSM_ttjj_tautop_1TeV.pdf}} \hfill \resizebox{7cm}{!}{\includegraphics{E6SSM_ttjj_tautop_other.pdf}} \caption{Distribution of the $m_{1}^{t\tau}$ (left) and $m_{2}^{t\tau}$ (right) for the $t\bar{t}jj$ events after the selections $p_{T}^{j}>40$\,GeV, $|\eta^{j}|<2.4$, and $m_{jj}>200$\,GeV.} \label{fig:ttjj2} \end{center} \end{figure} \section{\label{sec:interp} Interpretation in the E$_6$SSM} As an application of our analysis to a top-down framework, we look at how it constrains the parameter space of the E$_6$SSM, which is one of the best-motivated $E_6$-inspired SUSY models. The simple extension of the SM discussed in section \ref{sec:model} may be embedded in this model, with the sparticle mass scale lying in the few TeV range. In the E$_6$SSM, the $E_6$ group is broken down to the SM gauge group plus an extra $U(1)_{N}$ symmetry around the GUT scale $M_X$, where \begin{equation} U(1)_N=\dfrac{1}{4} U(1)_{\chi}+\dfrac{\sqrt{15}}{4} U(1)_{\psi}\,. \label{401} \end{equation} The $U(1)_\psi$ and $U(1)_\chi$ symmetries are associated with the subgroups $E_6 \supset SO(10) \times U(1)_\psi \supset SU(5) \times U(1)_\chi \times U(1)_\psi$. It is assumed that in the E$_6$SSM the matter parity $Z_{2}^{M}=(-1)^{3(B-L)}$ is also preserved. In this SUSY model the anomalies are automatically cancelled if the low-energy particle spectrum includes three complete $27$-dimensional representations of $E_6$ ($27_i$ with $i=1,2,3$). Each 27-plet contains one generation of ordinary matter, a SM singlet field $\Phi_i$ carrying non--zero $U(1)_{N}$ charge, up- and down-type Higgs doublets $H^{u}_{i}$ and $H^{d}_{i}$, as well as exotic scalar quarks (squarks) $D_i$ and $\overline{D}_i$ with electric charge $\pm 1/3$. In order to avoid rapid proton decay via these exotic states, one must impose some additional symmetry. The simplest options are a $Z_2^L$ symmetry, which implies that all supermultiplets except the lepton ones are even, or a $Z_2^B$ symmetry, under which exotic quark and lepton supermultiples are odd, whereas the others remain even~\cite{King:2005jy,King:2005my}. In the first case the $D_i$ and $\overline{D}_i$ are diquarks (Model I). In the second scenario the exotic squarks carry baryon ($B_{D}=1/3$ and $B_{\overline{D}}=-1/3$) and lepton ($L_{D}=1$ and $L_{\overline{D}}=-1$) numbers simultaneously so that they are LQs (Model II). The exotic states in the E$_6$SSM may also give rise to flavour changing processes. In particular, the scalar components of the supermultiplets $H^u_{i}$ and $H^d_{i}$ can interact with the SM fermions of different generations, thus contributing to the amplitude of $K^0$--$\overline{K}^0$ oscillations, and resulting in new channels of muon decay, such as $\mu\to e^{-}e^{+}e^{-}$. The non-diagonal flavour transitions can be suppressed by imposing $Z^{H}_2$ symmetry, under which all the matter supermultiplets except one SM singlet superfield ($\Phi\equiv \Phi_3$) and one pair of $H^u_{i}$ and $H^d_{i}$ (say $H_d\equiv H^d_{3}$ and $H_u\equiv H^u_{3}$) are odd~\cite{King:2005my,King:2005jy}. The discrete $Z^{H}_2$ symmetry can only be an approximate one because it forbids all operators that allow the lightest exotic quark or squark to decay. The appropriate suppression of the flavour-changing processes can be achieved when all $Z^{H}_2$ symmetry-violating couplings are less than $10^{-4}$. Within this original E$_6$SSM, only $H_u$, $H_d$, and $\Phi$ form the Higgs sector, whereas the Higgs-like doublets $H^d_{\alpha}$ and $H^u_{\alpha}$ as well as the SM singlets $\Phi_{\alpha}$ ($\alpha=1,2$) do not acquire vacuum expectation values (VEVs). The VEV of $\Phi=\varphi/\sqrt{2}$ breaks $U(1)_{N}$ gauge symmetry, generating the mass of the $Z'$ boson, \begin{equation} m_{Z'}\approx g^{\prime}_1 \tilde{Q}_{\Phi} \,\varphi\,\,, \label{4001} \end{equation} and the effective $\mu$--term. In Eq.~(\ref{4001}) $g^{\prime}_1$ and $\tilde{Q}_{\Phi} = \dfrac{5}{\sqrt{40}}$ are the $U(1)_{N}$ gauge coupling and the $U(1)_{N}$ charge of the superfield $\Phi$, respectively. The LHC constraints require the extra $U(1)_{N}$ gauge boson to be heavier than $4.5\,\mbox{TeV}$~\cite{CMS:2021ctt,ATLAS:2019erb}. To satisfy this constraint $\varphi$ should be larger than 12\,TeV. The conservation of the $Z_{2}^{M}$ symmetry and $R$-parity in the E$_6$SSM ensures that the lightest SUSY particle (LSP) is stable. In this case the LSP and the next-to-LSP (NLSP) are mostly composed of the fermion components of the superfields $\Phi_{\alpha}$. Using the approach discussed in~\cite{Hesselbach:2007te,Hesselbach:2007ta,Hesselbach:2008vt}, it was shown that the masses of the LSP and NLSP ($\tilde{H}^0_1$ and $\tilde{H}^0_2$) are smaller than 60--65\,GeV~\cite{Hall:2010ix}. The couplings of these fermions to the SM particles tend to be rather small. Nevertheless if the LSP had a mass close to $M_Z/2$, it could account for some of the observed cold dark matter (DM) relic density~\cite{Hall:2010ix}. In these scenarios, the lightest Higgs boson decays mainly into either $\tilde{H}^0_1$ or $\tilde{H}^0_2$, while all other {\rm BR}s are highly suppressed. Such scenarios have been already excluded by the LHC experiments. When the LSP and NLSP are considerably lighter than $M_Z$, the annihilation cross section of $\tilde{H}^0_1\tilde{H}^0_1\to \mbox{SM particles}$ becomes too small, resulting in a DM density which is substantially larger than its measured value. Since 2006 several modifications of the E$_6$SSM have been explored \cite{King:2005jy,King:2005my,Nevzorov:2012hs,Athron:2014pua,Howl:2007hq,Howl:2007zi,Howl:2008xz,Howl:2009ds, Athron:2010zz,Hall:2011zq,Callaghan:2012rv,Callaghan:2013kaa,King:2016wep,Khalil:2020syr,Nevzorov:2022zns}. The implications of the $U(1)_{N}$ extensions of the MSSM have been studied for the $Z$--$Z'$ mixing~\cite{Suematsu:1997au}, the neutralino sector~\cite{Suematsu:1997au,Keith:1997zb,Keith:1996fv}, leptogenesis~\cite{Hambye:2000bn,King:2008qb,Nevzorov:2017gir,Nevzorov:2018leq} and electroweak symmetry breaking~\cite{Keith:1997zb,Suematsu:1994qm,Daikoku:2000ep}, the renormalisation group (RG) flow of couplings~\cite{Keith:1997zb,King:2007uj}, the renormalisation of VEVs~\cite{Sperling:2013eva,Sperling:2013xqa}, non-standard neutrino models~\cite{Ma:1995xk}, the DM~\cite{Hall:2010ix,Khalil:2020syr,Nevzorov:2022zns,Hall:2009aj}, and the signatures associated with the inert neutralino states~\cite{Khalil:2021afa,Khalil:2021tpz}. Within the E$_6$SSM the upper bound on the lightest Higgs mass near the quasi-fixed point was examined in~\cite{Nevzorov:2013ixa,Nevzorov:2015iya}. The corresponding quasi-fixed point is an intersection of the invariant and quasi-fixed lines~\cite{Nevzorov:2001vj,Nevzorov:2002ub}. The particle spectrum in the constrained E$_6$SSM (cE$_6$SSM) and its modifications has been analysed in~\cite{Athron:2015vxg,Athron:2016gor,Athron:2011wu,Athron:2008np,Athron:2009ue,Athron:2009bs,Athron:2012sq}. The degree of the fine tuning and the threshold corrections were explored in~\cite{Athron:2013ipa,Athron:2015tsa} and \cite{Athron:2012pw}, respectively. The exotic matter in the E$_6$SSM may result in distinctive LHC signatures~\cite{King:2005jy,King:2005my,Howl:2007zi,Athron:2010zz,Athron:2011wu,King:2006vu,King:2006rh,Belyaev:2012si,Belyaev:2012jz}, and can give rise to non-standard Higgs decays~\cite{Hall:2010ix,Athron:2014pua,Nevzorov:2015iya,Nevzorov:2013tta,Hall:2010ny,Hall:2011au,Hall:2013bua,Nevzorov:2014sha,Athron:2016usd,Nevzorov:2020jdq}. In the E$_6$SSM with approximate $Z_2^H$ symmetry, one can also impose an exact $Z^S_2$ symmetry, which implies that only components of the $\Phi_{\alpha}$ superfields are odd~\cite{Hall:2011zq}. In this case the LSP and NLSP become massless and decouple. The presence of such massless fermions does not affect the Big Bang Nucleosynthesis if the $Z'$ boson is rather heavy~\cite{Hall:2011zq}. In this variant of the model, one of the lightest $R$-parity odd state is stable and may account for some of the observed DM matter relic abundance. Neglecting non-renormalisable interactions and all the $Z^{H}_2$ symmetry-violating couplings, the superpotential of this model can be written as \begin{equation} \begin{array}{rcl} W_{\rm{E}_6\rm{SSM}} & = & \lambda \Phi (H_u H_d) + \lambda_{\alpha} \Phi (H^d_{\alpha} H^u_{\alpha}) + \kappa_{i} \Phi (D_{i} \overline{D}_{i}) \\ & + & \dfrac{1}{2}M_{i}N_i^c N_i^c + h_{ij} N_i^c (H_u L_j) + W_{\rm MSSM}(\mu=0)\,, \end{array} \label{402} \end{equation} where $N^c_i$ and $L_j$ are supermultiplets of the right--handed neutrinos and left--handed leptons. In the case of Model II, the $Z^{H}_2$ symmetry-violating terms, that permit the lightest exotic quark or squark to decay, can be presented in the following form \begin{equation} W_2 = g_{ijk} e^c_i u^c_j D_k + \overline{g}_{ijk} (Q_i L_j) \overline{D}_k\ + g^{\prime}_{ijk}d^{c}_{i}N^{c}_{j}D_{k}\,. \label{403} \end{equation} Here $e^c_i$, $u^c_k$, $d^{c}_{i}$, and $Q_i$ are supermultiplets of the right-handed charged leptons, the right-handed up-type quarks, the right-handed down-type quarks, and the left-handed quark doublets, respectively. The VEV of the $\Phi$ induces the masses of the exotic fermions, which in the leading approximation are given by \begin{equation} \mu_{D_i}=\dfrac{\kappa_i}{\sqrt{2}}\,\varphi\,,\qquad\qquad \mu_{\tilde{H}_{\alpha}}=\dfrac{\lambda_{\alpha}}{\sqrt{2}}\,\varphi\,, \label{404} \end{equation} where $\mu_{D_i}$ are the exotic quark masses, while $\mu_{\tilde{H}_{\alpha}}$ are the masses of the states composed of the fermionic components of the $H^d_{\alpha}$ and $H^u_{\alpha}$. These masses are determined by the values of the Yukawa couplings $\kappa_i$ and $\lambda_{\alpha}$. The breakdown of the gauge symmetry in the E$_6$SSM may give rise to a substantial mixing between the scalar components of the supermultiplets $D_i$ and $\overline{D}_i$. Since we choose the field basis such that the Yukawa couplings of the $D_i$ and $\overline{D}_i$ to $\Phi$ are flavour diagonal, which leads to a mixing only between the exotic squarks from the same family. As a consequence, the calculation of the exotic squark masses reduces to the diagonalisation of three $2\times 2$ matrices \begin{equation} \begin{array}{c} M^2(i)=\left( \begin{array}{cc} M_{11}^2(i) + \Delta_{11}(i) & \mu_{D_i} X_{D_i} + \Delta_{12}(i) \\ \mu_{D_i} X_{D_i} + \Delta_{12}(i) & M_{22}^2(i) + \Delta_{22}(i) \end{array} \right)\,,\\ \\ {\rm with}\quad M_{11}^2(i)=m^2_{D_i}+\mu_{D_i}^2+ \Delta_{D}\,,\quad M_{22}^2(i)=m^2_{\overline{D}_i}+\mu_{D_i}^2+\Delta_{\overline{D}}\,,\\ X_{D_i}=A_{\kappa_i}-\dfrac{\lambda}{\sqrt{2}\varphi}v_1 v_2\,,\quad{\rm and}\quad \Delta_{\phi}=\dfrac{g^{'2}_1}{2} \biggl(\tilde{Q}_{\overline{D}} v_1^2 + \tilde{Q}_D v_2^2 + \tilde{Q}_{\Phi} \varphi^2\biggr) \tilde{Q}_{\phi}\,, \end{array} \label{405} \end{equation} where $i=1,2,3$, $v_1$ and $v_2$ are the VEVs of the Higgs doublets $H_d$ and $H_u$, $\tilde{Q}_{D} = -\dfrac{2}{\sqrt{40}}$ and $\tilde{Q}_{\overline{D}} = -\dfrac{3}{\sqrt{40}}$ are the $U(1)_{N}$ charges of the $D_i$ and $\overline{D}_i$, while $\Delta_{lm}(i)$ ($l,m=1,2$) are the contributions of loop corrections. $m^2_{D_i}$ and $m^2_{\overline{D}_i}$ in the above equation are the soft scalar masses of the $D_i$ and $\overline{D}_i$, whereas $A_{\kappa_i}$ are the trilinear scalar couplings associated with the Yukawa couplings $\kappa_i$. The parameters $m^2_{D_i}$, $m^2_{\overline{D}_i}$, and $A_{\kappa_i}$ break global SUSY. The $U(1)_N$ $D$--term contributions to the masses of the exotic squarks are set by $M_{Z'}^2$, i.e., \begin{equation} \Delta_{D}\approx -\dfrac{1}{5}M_{Z'}^2\,,\qquad \Delta_{\overline{D}}\approx -\dfrac{3}{10}M_{Z'}^2\,. \label{406} \end{equation} These contributions are negative because the $U(1)_N$ charge of the $\Phi$ and the $U(1)_N$ charges of the $D_i$ and $\overline{D}_i$ are opposite. On the other hand, the $U(1)_N$ $D$--term contributions to the masses of the ordinary squarks and sleptons are positive. As a result, in some parts of the E$_6$SSM parameter space the exotic squarks tend to be substantially lighter than the superpartners of the SM fermions. The magnitude of mixing in the exotic squark sector is governed by the mixing parameters $X_{D_i}$ as well as the masses $\mu_{D_i}$. If $\mu_{D_i}$ are sufficiently large, the mixing effects can be so substantial that the corresponding lightest exotic squarks may be among the lightest SUSY particles in the E$_6$SSM. In the Model II, the lightest scalar LQ, which we denote by $D$ in order to identify it with the $S_1$--type LQ in our low-energy SM extension discussed earlier, is a linear superposition of the scalar components of the $D_1$ and $\overline{D}_1$ supermultiplets. Its mass is given by \begin{equation} \begin{array}{rcl} m^2_{S_1}&=&\dfrac{1}{2}\Biggl[M_{11}^2(1) + \Delta_{11}(1) + M_{22}^2(1) + \Delta_{22}(1)\\[4mm] &-&\sqrt{\Biggl(M_{11}^2(1) + \Delta_{11}(1) - M_{22}^2(1) - \Delta_{22}(1)\Biggr)^2 + 4 \Biggl(\mu_{D_1} X_{D_1} + \Delta_{12}(1)\Biggr)^2} \Biggr]\,. \end{array} \label{407} \end{equation} To simplify our analysis of the $D$ in the E$_6$SSM, we set $A_{\kappa_1}=0$. Because of this the mixing between the scalar components of the $D_1$ and $\overline{D}_1$ is almost always small unless $M_{11}^2(1)\approx M_{22}^2(1)$. In this case, $D$ is almost entirely the scalar component of either $D_1$ or $\overline{D}_1$, and $m^2_{D}$ is defined by the smallest diagonal element of the mass matrix in Eq.~(\ref{405}), i.e., either by $M_{11}^2(1)$ or $M_{22}^2(1)$. Moreover, we focus on the part of the E$_6$SSM parameter space where $m_{D}$ is smaller than the mass of the lightest fermion LQ. Therefore, the decay modes of the $D$ are entirely determined by the Yukawa interactions in Eq.~(\ref{403}). We examine the BRs of the decays of the $D$ assuming that $Z_2^H$ is mainly broken by the operators involving quarks and leptons of the third generation. In other words, we ignore all the Yukawa couplings $g_{ij1}$ and $\overline{g}_{ij1}$, except $g_{331}$ and $\overline{g}_{331}$, so that the $D$ decays only into $t\tau$ and $b\nu$, and as a result $\mbox{{\rm BR}}(D \to b\nu)=1-{\rm BR}(D \to t\tau)$. To compute these BRs we incorporated the model in the Mathematica package SARAH v4.14.4~\cite{Staub:2008uz,Staub:2013tta,Goodsell:2014bna,Goodsell:2015ira,Staub:2015kfa,Goodsell:2016udb,Braathen:2017izn}, which evaluates the interaction vertices, and writes down model files for the FORTRAN code SPheno v4.0.5~\cite{Porod:2003um,Porod:2011nf} for performing phenomenological studies. \begin{figure}[tbp] \begin{center} \resizebox{12cm}{!}{\includegraphics{exclusion_lq.pdf}} \caption{The exclusion bound (blue) in the \{$m_{S_1}$,\,${\rm BR}(D \to t\tau)$\} plane. The area on the left hand side of the curves is excluded. The black and green lines are from the ATLAS analyses \cite{ATLAS:2021oiz} and \cite{ATLAS:2021jyv}, respectively. The red points correspond to some particular configurations of the E$_6$SSM parameter space, explained in the text.} \label{fig:excl} \end{center} \end{figure} In Fig. \ref{fig:excl}, we show the expected exclusion contour from our signal-to-background analysis in the \{$m_{S_1}$,\,${\rm BR}(D \to t\tau)$\} plane, together with those from two recent ATLAS results. Also plotted are a number of E$_6$SSM parameter space points, obtained for different values of $m^2_{D_1}$, $m^2_{\overline{D}_1}$, and $\kappa_1$. When the $D$ is predominantly the scalar component of the $\overline{D}_1$, it couples to the doublets and thus has ${\rm BR}(D \to t\tau)$ close to $50\%$. When it is mostly the $D_1$ it couples to singlets and decays solely to $t\tau$ if the right-handed neutrino is heavier than the $D$. Hence a lot of the points have the BR($D\to t\tau$) close to either $50\%$ or $100\%$. In the intermediate cases $M_{11}^2(1)\approx M_{22}^2(1)$ and there can be sizeable mixing between the scalar components of the $D_1$ and $\overline{D}_1$. We see in the figure that, when the $D$ is $\overline{D}_1$--like, our proposed analysis of the fully hadronic final state resulting from its pair-production can exclude its mass up to about 1340\,GeV. The exclusion bound is even stronger, close to 1580\,GeV, if the $D$ is predominantly the $D_1$ instead. \section{\label{sec:concl} Summary and Conclusions} LQs, being coloured, can be produced efficiently at the LHC, and are thus among the potential signatures of BSM physics. We have studied the possibility of searching third-generation LQs decaying to $t\tau$ in the fully hadronic channel. This analysis would complement the existing searches relying on the semi-leptonic channel, and has the advantage of larger statistics, as well as the possibility of reconstructing the mass of the LQ. In the fully hadronic channel, we expect larger backgrounds from QCD processes. But we have shown that, with suitable event selection, the noise from the $t\bar{t}jj$ background gets under control, while the other backgrounds are negligible. We have found that this channel has a large estimated sensitivity for the Run 2 data, leading to an expected exclusion limit of up to $1580$~GeV (assuming BR$(S_1\rightarrow t\tau)=1$) on the LQ mass, thereby besting the ATLAS result based on the semi-leptonic channel by about $150$~GeV. As an example of a model with such a signature, we have discussed a variant of the E$_{6}$SSM in which the fundamental representation contains scalar (and fermion) LQs. The $D$-term contributions to the scalar LQ masses are negative, unlike those to other sfermions, and they can hence be among the lightest BSM states of this SUSY scenario. If their couplings to the fermions of the first two generations are vanishing, one of the two lightest scalar LQs can decay dominantly to $t\tau$ and the other to $t\tau$ and $b\nu$, with nearly equal BR in each of these channels. We have then demonstrated how the fully hadronic channel is expected to improve the sensitivity of the LHC searches to the pair-production of the lightest LQ in this model. \section*{Acknowledgments} \noindent The work of SK is partially supported by STDF under grant number 37272. SM is supported in part through the NExT Institute and the STFC Consolidated Grant ST/L000296/1. HW is supported by the Carl Trygger Foundation under grant No. CTS18:164. MA acknowledges the receipt of the grant from the Abdus Salam International Centre for Theoretical Physics, Trieste, Italy. \input{E6SSM_v01.bbl} \end{document}
\section{Introduction} The former DAMA/NaI \cite{prop,allDM,Nim98,Sist,RNC,ijmd,ijma,epj06,ijma07,chan,wimpele,ldm,allRare,IDM96} and the present DAMA/LIBRA \cite{modlibra,perflibra,papep} experiments at the Gran Sasso National Laboratory have the main aim to investigate the presence of Dark Matter particles in the galactic halo by exploiting the model independent Dark Matter annual modulation signature originally suggested in the mid 80's in ref. \cite{Freese}. In fact, as a consequence of its annual revolution around the Sun, which is moving in the Galaxy travelling with respect to the Local Standard of Rest towards the star Vega near the constellation of Hercules, the Earth should be crossed by a larger flux of Dark Matter particles around $\sim$ 2 June (when the Earth orbital velocity is summed to the one of the solar system with respect to the Galaxy) and by a smaller one around $\sim$ 2 December (when the two velocities are subtracted). Thus, this signature has a different origin and peculiarities than the seasons on the Earth and than effects correlated with seasons (consider the expected value of the phase as well as the other requirements listed below). This annual modulation signature is very distinctive since the effect induced by DM particles must simultaneously satisfy all the following requirements: the rate must contain a component modulated according to a cosine function (1) with one year period (2) and a phase that peaks roughly around $\simeq$ 2$^{nd}$ June (3); this modulation must only be found in a well-defined low energy range, where DM particle induced events can be present (4); it must apply only to those events in which just one detector of many actually ``fires'' ({\it single-hit} events), since the DM particle multi-interaction probability is negligible (5); the modulation amplitude in the region of maximal sensitivity must be $\lsim$7$\%$ for usually adopted halo distributions (6), but it can be larger in case of some possible scenarios such as e.g. those in refs. \cite{Wei01,Fre04}. This offers an efficient DM model independent signature, able to test a large interval of cross sections and of halo densities; moreover, the use of highly radiopure NaI(Tl) scintillators as target-detectors assures sensitivity to wide ranges of DM candidates, of interaction types and of astrophysical scenarios. It is worth noting that only systematic effects or side reactions able to simultaneously fulfil all the 6 requirements given above (and no one has ever been suggested) and to account for the whole observed modulation amplitude might mimic this DM signature. \vspace{0.5cm} The DAMA/LIBRA set-up, whose description, radiopurity and main features are discussed in details in ref. \cite{perflibra} has firstly been upgraded in September/October 2008: i) one detector has been recovered by replacing a broken PMT (see ref. \cite{modlibra}); ii) a new optimization of some PMTs and HVs has been performed; iii) all the transient digitizers recording the shape of the pulse have been replaced with new ones, the U1063A Acqiris 8-bit 1GS/s DC270 High-Speed cPCI Digitizers; iv) a new DAQ with optical read-out has been installed. Also during this upgrade the operations involving the handling of the sensitive part of the setup and the shield have been performed in HP Nitrogen atmosphere. The upgrade has allowed to enlarge the sensitive mass and to improve general features. Here we just remind that the sensitive part of this set-up is made of 25 highly radiopure NaI(Tl) crystal scintillators (5-rows by 5-columns matrix) having 9.70 kg mass each one. In each detector two 10 cm long special quartz light guides act also as optical windows on the two end faces of the crystal and are coupled to two low background photomultipliers working in coincidence at single photoelectron level. The detectors are housed in a sealed low-radioactive copper box installed in the center of a low-radioactive Cu/Pb/Cd-foils/polyethylene/paraffin shield; moreover, about 1 m concrete (made from the Gran Sasso rock material) almost fully surrounds (mostly outside the barrack) this passive shield, acting as a further neutron moderator. A threefold-levels sealing system excludes the detectors from the environmental air of the underground laboratory \cite{perflibra}. A hardware/software system to monitor the running conditions is operative and self-controlled computer processes automatically control several parameters and manage alarms. Moreover: i) the light response ranges from 5.5 to 7.5 photoelectrons/keV, depending on the detector; ii) the hardware threshold of each PMT is at single photoelectron (each detector is equipped with two low background photomultipliers working in coincidence); iii) energy calibration with X-rays/$\gamma$ sources are regularly carried out down to few keV; iv) the software energy threshold of the experiment is 2 keV; v) both {\it single-hit} events (where just one of the detectors fires) and {\it multiple-hit} events (where more than one detector fires) are acquired; v) the data are collected up to the MeV region despite the optimization is performed for the lower one. For the radiopurity, the procedures and further details see ref. \cite{modlibra,perflibra}. The data of the former DAMA/NaI (0.29 ton $\times$ yr) and those of the first 4 annual cycles of DAMA/LIBRA (total exposure 0.53 ton$\times$yr) have already given positive model independent evidence for the presence of DM particles in the galactic halo with high confidence level on the basis of the DM annual modulation signature \cite{modlibra}. In this paper the model independent results with other two annual cycles DAMA/LIBRA-5,6 are presented. As mentioned, the data of the first cycle have been collected in the same conditions as DAMA/LIBRA-1,2,3,4 \cite{modlibra,perflibra}, while the data of DAMA/LIBRA-6 have been taken after the above mentioned 2008 upgrade. \section{The results} The updated exposures of the DAMA/LIBRA annual cycles and the cumulative one with the former DAMA/NaI are given in Table \ref{tb:years}. \begin{table}[ht] \caption{Exposures of the DAMA/LIBRA-5,6 annual cycles. Here $\alpha=\langle cos^2\omega (t-t_0) \rangle$ is the mean value of the squared cosine and $\beta=\langle cos \omega (t-t_0) \rangle$ is the mean value of the cosine (the averages are taken over the live time of the data taking and $t_0=152.5$ day, i.e. June 2$^{nd}$); thus, $(\alpha - \beta^2)$ indicates the variance of the cosine (i.e. it is 0.5 for a full year of data taking). The information on the previously published DAMA/LIBRA-1,2,3,4, are recalled as well as the cumulative exposure, when including the former DAMA/NaI.} \vspace{-0.5cm} \begin{center} \resizebox{\textwidth}{!}{ \begin{tabular}{|c|c|c|c|c|} \hline & Period & mass & Exposure & $(\alpha - \beta^2)$ \\ & & (kg)& (kg$\times$day) & \\ \hline DAMA/LIBRA-1,2,3,4 & Sept. 9, 2003 - July 17, 2007 & 232.8 & 192824 & 0.537 \\ & & & & \\ DAMA/LIBRA-5 & July 17, 2007 - Aug. 29, 2008 & 232.8 & 66105 & 0.468 \\ & & & & \\ DAMA/LIBRA-6 & Nov. 12,2008 - Sept. 1, 2009 & 242.5 &58768 & 0.519 \\ & & & & \\ \hline DAMA/LIBRA-1 to -6 & Sept. 9, 2003 - Sept. 1, 2009 & &317697$\simeq$ 0.87 ton$\times$yr & 0.519 \\ \hline \multicolumn{3}{|l}{DAMA/NaI + DAMA/LIBRA-1 to 6:} & \multicolumn{2}{c|}{1.17 ton$\times$yr} \\ \hline \hline \end{tabular}} \end{center} \label{tb:years} \end{table} The only data treatment, which is performed on the raw data, is to remove noise pulses (mainly PMT noise, Cherenkov light in the light guides and in the PMT windows, and afterglows) near the energy threshold in the {\it single-hit} events; for a description of the used procedure and details see ref. \cite{perflibra}. In the DAMA/LIBRA-1,2,3,4,5,6 annual cycles about $7.2 \times 10^7$ events have also been collected for energy calibrations and about $3 \times 10^6$ events/keV for the evaluation of the acceptance windows efficiency for noise rejection near energy threshold. The periodical calibrations and, in particular, those related with the acceptance windows efficiency mainly affect the duty cycle of the experiment. From Table \ref{tb:years} one can observe a significant improvement in the duty cycle of the sixth annual cycles with respect to the previous ones; this is mainly due to the new transient Digitizers and DAQ installed at fall 2008. Several analyses on the model-independent investigation of the DM annual modulation signature have been performed as previously done in ref. \cite{modlibra} and refs. therein. In particular, Fig. \ref{fg:res} shows the time behaviour of the experimental \begin{figure}[!ht] \begin{center} \includegraphics[width=0.9\textwidth] {fig1a.eps} \includegraphics[width=0.9\textwidth] {fig1b.eps} \includegraphics[width=0.9\textwidth] {fig1c.eps} \end{center} \vspace{-0.4cm} \caption{Experimental model-independent residual rate of the {\it single-hit} scintillation events, measured by DAMA/LIBRA,1,2,3,4,5,6 in the (2 -- 4), (2 -- 5) and (2 -- 6) keV energy intervals as a function of the time. The zero of the time scale is January 1$^{st}$ of the first year of data taking of the former DAMA/NaI experiment \cite{modlibra}. The experimental points present the errors as vertical bars and the associated time bin width as horizontal bars. The superimposed curves are the cosinusoidal functions behaviors $A \cos \omega(t-t_0)$ with a period $T = \frac{2\pi}{\omega} = 1$ yr, with a phase $t_0 = 152.5$ day (June 2$^{nd}$) and with modulation amplitudes, $A$, equal to the central values obtained by best fit over the whole data including also the exposure previously collected by the former DAMA/NaI experiment: cumulative exposure is 1.17 ton $\times$ yr (see also ref. \cite{modlibra} and refs. therein). The dashed vertical lines correspond to the maximum expected for the DM signal (June 2$^{nd}$), while the dotted vertical lines correspond to the minimum. See text.} \label{fg:res} \vspace{-0.2cm} \end{figure} residual rates for {\it single-hit} events in the (2--4), (2--5) and (2--6) keV energy intervals. These residual rates are calculated from the measured rate of the {\it single-hit} events (already corrected for the overall efficiency and for the acquisition dead time) after subtracting the constant part: $<r_{ijk}-flat_{jk}>_{jk}$. Here $r_{ijk}$ is the rate in the considered $i$-th time interval for the $j$-th detector in the $k$-th energy bin, while $flat_{jk}$ is the rate of the $j$-th detector in the $k$-th energy bin averaged over the cycles. The average is made on all the detectors ($j$ index) and on all the energy bins ($k$ index) which constitute the considered energy interval. The weighted mean of the residuals must obviously be zero over one cycle. For clarity in Fig. \ref{fg:res} only the DAMA/LIBRA data collected over six annual cycles (0.87 ton $\times$ yr) are shown; the DAMA/NaI data (0.29 ton $\times$ yr) and comparison with DAMA/LIBRA are available in ref. \cite{modlibra}. The hypothesis of absence of modulation in the data can be discarded (see Table \ref{tb:mod_0}). \begin{table}[ht] \caption{Test of absence of modulation in the data of the DAMA/LIBRA-1,2,3,4,5,6 and without/with also the data of the former DAMA/NaI. As it can be seen, a null modulation amplitude is discarded by the data.} \begin{center} \begin{tabular}{|c|c|c|} \hline Energy interval & DAMA/LIBRA & DAMA/NaI \& DAMA/LIBRA \\ (keV) & (6 annual cycles) & (7+6 annual cycles) \\ \hline 2-4 & $\chi^2$/d.o.f. = 90.0/43 & $\chi^2$/d.o.f. = 147.4/80 \\ & $\rightarrow$ P = 3.6 $\times$ 10$^{-5}$&$\rightarrow$ P = 6.8 $\times$ 10$^{-6}$ \\ \hline 2-5 & $\chi^2$/d.o.f. = 82.1/43 & $\chi^2$/d.o.f. = 135.2/80 \\ & $\rightarrow$ P = 3.1 $\times 10^{-4}$ & $\rightarrow$ P = 1.1 $\times$ 10$^{-4}$ \\ \hline 2-6 & $\chi^2$/d.o.f. = 68.9/43 & $\chi^2$/d.o.f. = 139.5/80 \\ & $\rightarrow$ P = 7.4 $\times$ 10$^{-3}$&$\rightarrow$ P = 4.3 $\times$ 10$^{-5}$ \\ \hline \hline \end{tabular} \end{center} \label{tb:mod_0} \end{table} The {\it single-hit} residual rate of DAMA/LIBRA-1,2,3,4,5,6 of Fig. \ref{fg:res} can be fitted with the formula: $A \cos \omega(t-t_0)$ considering a period $T = \frac{2\pi}{\omega} = 1$ yr and a phase $t_0 = 152.5$ day (June 2$^{nd}$), as expected by the DM annual modulation signature; this can be repeated for the total available exposure 1.17 ton $\times$ yr including the former DAMA/NaI data (see \cite{modlibra} and refs. therein). The results are shown in Table \ref{tb:ampff}. \begin{table}[ht] \caption{Modulation amplitude, A, obtained by fitting the {\it single-hit} residual rate of the six DAMA/LIBRA annual cycles (Fig. \ref{fg:res}), and including also the former DAMA/NaI data given elsewhere (see \cite{modlibra} and refs. therein) for a total cumulative exposure of 1.17 ton $\times$ yr. It has been obtained by fitting the data with the formula: $A \cos \omega(t-t_0)$ with $T = \frac{2\pi}{\omega} = 1$ yr and $t_0 = 152.5$ day (June 2$^{nd}$), as expected for a signal by the DM annual modulation signature. The corresponding $\chi^2$ value for each fit and the confidence level are also reported} \begin{center} \begin{tabular}{|c|c|c|} \hline Energy interval & DAMA/LIBRA & DAMA/NaI \& DAMA/LIBRA \\ (keV) & (cpd/kg/keV) & (cpd/kg/keV) \\ \hline 2-4 & A=(0.0170$\pm$0.0024) & A=(0.0183$\pm$0.0022) \\ & $\chi^2$/d.o.f. = 41.0/42 & $\chi^2$/d.o.f. = 75.7/79 \\ & & $\rightarrow$ 8.3 $\sigma$ C.L. \\ \hline 2-5 & A=(0.0129$\pm$0.0018) & A=(0.0144$\pm$0.0016) \\ & $\chi^2$/d.o.f. = 30.7/42 & $\chi^2$/d.o.f. = 56.6/79 \\ & & $\rightarrow$ 9.0 $\sigma$ C.L. \\ \hline 2-6 & A=(0.0097$\pm$0.0015) & A=(0.0114$\pm$0.0013) \\ & $\chi^2$/d.o.f. = 24.1/42 & $\chi^2$/d.o.f. = 64.7/79 \\ & & $\rightarrow$ 8.8 $\sigma$ C.L. \\ \hline \hline \end{tabular} \end{center} \label{tb:ampff} \end{table} The compatibility among the 13 annual cycles has been investigated. In particular, the modulation amplitudes measured in each annual cycle of the whole 1.17 ton $\times$ yr exposure have been analysed as in ref. \cite{modlibra}. Indeed these modulation amplitudes are normally distributed around their best fit value as pointed out by the $\chi^2$ test ($\chi^2 = 9.3$, 12.2 and 10.1 over 12 {\it d.o.f.} for the three energy intervals, respectively) and the {\it run test} (lower tail probabilities of 57\%, 47\% and 35\% for the three energy intervals, respectively). Moreover, the DAMA/LIBRA-5 and DAMA/LIBRA-6 (2--6) keV modulation amplitudes are $(0.0086\pm0.0032)$ cpd/kg/keV and $(0.0101\pm0.0031)$ cpd/kg/keV, respectively, in agreement with that of DAMA/LIBRA-1,2,3,4: $(0.0110\pm0.0019)$ cpd/kg/keV; we also recall that the statistical compatibility between the DAMA/NaI and DAMA/LIBRA-1,2,3,4 modulation amplitudes has been verified \cite{modlibra}. Thus, also when adding DAMA/LIBRA-5,6, the cumulative result from DAMA/NaI and DAMA/LIBRA can be adopted. Table \ref{tb:ampfv} shows the results obtained for the cumulative 1.17 ton $\times$ yr exposure when the period and phase parameters are kept free in the fitting procedure described above. \begin{table}[ht] \caption{Modulation amplitude ($A$), period ($T = \frac{2\pi}{\omega}$) and phase ($t_0$), obtained by fitting, with the formula: $A \cos \omega(t-t_0)$, the {\it single-hit} residual rate of the cumulative 1.17 ton $\times$ yr exposure. The results are well compatible with expectations for a signal in the DM annual modulation signature.} \begin{center} \begin{tabular}{|c|c|c|c|c|} \hline Energy interval & $A$ (cpd/kg/keV)& $T = \frac{2\pi}{\omega}$ (yr) & $t_0$ (days) & C. L. \\ \hline 2-4 & (0.0194$\pm$0.0022) & (0.996$\pm$0.002) & 136$\pm$7 & 8.8$\sigma$\\ 2-5 & (0.0149$\pm$0.0016) & (0.997$\pm$0.002) & 142$\pm$7 & 9.3$\sigma$\\ 2-6 & (0.0116$\pm$0.0013) & (0.999$\pm$0.002) & 146$\pm$7 & 8.9$\sigma$\\ \hline \hline \end{tabular} \end{center} \label{tb:ampfv} \end{table} The DAMA/LIBRA {\it single-hit} residuals of Fig.\ref{fg:res} and those of DAMA/NaI (see e.g. \cite{modlibra}) have also been investigated by a Fourier analysis, obtaining a clear peak corresponding to a period of 1 year (see Fig. \ref{fg:pwr}); the same analysis in other energy region shows instead only aliasing peaks. \begin{figure}[!tbh] \centering \vspace{-0.4cm} \includegraphics[width=6.cm] {fig2a.eps} \includegraphics[width=6.cm] {fig2b.eps} \vspace{-0.3cm} \caption{Power spectrum of the measured {\it single-hit} residuals in the (2--6) keV (solid lines) and (6--14) keV (dotted lines) energy intervals calculated according to ref. \cite{Lomb}, including also the treatment of the experimental errors and of the time binning. The data refer to: a) DAMA/LIBRA-1,2,3,4,5,6 (exposure of 0.87 ton $\times$ yr); b) the cumulative 1.17 ton $\times$ yr exposure (DAMA/NaI and DAMA/LIBRA-1,2,3,4,5,6). As it can be seen, the principal mode present in the (2--6) keV energy interval corresponds to a frequency of $2.697 \times 10^{-3}$ d$^{-1}$ and $2.735 \times 10^{-3}$ d$^{-1}$ (vertical lines), respectively in the a) and b) case. They correspond to a period of $\simeq$ 1 year. A similar peak is not present in the (6--14) keV energy interval just above.} \label{fg:pwr} \normalsize \end{figure} \vspace{0.3cm} The measured energy distribution has been investigated in other energy regions not of interest for Dark Matter, also verifying the absence of any significant background modulation \footnote{, In fact, the background in the lowest energy region is essentially due to ``Compton'' electrons, X-rays and/or Auger electrons, muon induced events, etc., which are strictly correlated with the events in the higher energy part of the spectrum. Thus, if a modulation detected in the lowest energy region would be due to a modulation of the background (rather than to a signal), an equal or larger modulation in the higher energy regions should be present.}. Following the procedures described in ref. \cite{modlibra} and ref. therein, the measured rate integrated above 90 keV, R$_{90}$, as a function of the time has been analysed. In particular, also for these two latter annual cycles the distribution of the percentage variations of R$_{90}$ with respect to the mean values for all the detectors has been considered; it shows a cumulative gaussian behaviour with $\sigma$ $\simeq$ 1\%, well accounted by the statistical spread expected from the used sampling time (see Fig. \ref{fig_r90}). \begin{figure}[!ht] \vspace{-0.5cm} \begin{center} \includegraphics[width=4.cm] {fig3.eps} \end{center} \vspace{-0.5cm} \caption{Distribution of the percentage variations of R$_{90}$ with respect to the mean values for all the detectors in the DAMA/LIBRA-5,6 annual cycles (histogram); the superimposed curve is a gaussian fit.} \label{fig_r90} \vspace{-0.2cm} \end{figure} Moreover, fitting the time behaviour of R$_{90}$ with phase and period as for DM particles, a modulation amplitude compatible with zero is also found in DAMA/LIBRA-5 and DAMA/LIBRA-6: $(0.20 \pm 0.18)$ cpd/kg and $(-0.20 \pm 0.16)$ cpd/kg, respectively. This also excludes the presence of any background modulation in the whole energy spectrum at a level much lower than the effect found in the lowest energy region for the {\it single-hit} events. In fact, otherwise -- considering the R$_{90}$ mean values -- a modulation amplitude of order of tens cpd/kg, that is $\simeq$ 100 $\sigma$ far away from the measured value, would be present. Similar result is obtained when comparing the {\it single-hit} residuals in the (2--6) keV with those in other energy intervals; see as an example Fig. \ref{fg:res1}. It is worth noting that the obtained results already account for whatever kind of background and, in addition, that no background process able to mimic the DM annual modulation signature (that is able to simultaneously satisfy all the peculiarities of the signature and to account for the measured modulation amplitude) is available (see also discussions e.g. in \cite{modlibra,scineghe09}). \begin{figure}[!bth] \vspace{-0.2cm} \centering a) \includegraphics[width=0.45\textwidth] {fig4a.eps} b) \includegraphics[width=0.45\textwidth] {fig4b.eps} \vspace{-0.2cm} \caption{Experimental residuals in the (2 -- 6) keV region and those in the (6 -- 14) keV energy region just above for the cumulative 1.17 ton $\times$ yr, considered as collected in a single annual cycle. The experimental points present the errors as vertical bars and the associated time bin width as horizontal bars. The initial time of the figure is taken at August 7$^{th}$. The clear modulation satisfying all the peculiarities of the DM annual modulation signature is present in the lowest energy interval, while it is absent just above; in fact, in the latter case the best fitted modulation amplitude is: (0.00007 $\pm$ 0.00077) cpd/kg/keV.} \label{fg:res1} \vspace{-0.4cm} \end{figure} A further relevant investigation has been performed by applying the same hardware and software procedures, used to acquire and to analyse the {\it single-hit} residual rate, to the {\it multiple-hit} one. In fact, since the probability that a DM particle interacts in more than one detector is negligible, a DM signal can be present just in the {\it single-hit} residual rate. Thus, the comparison of the results of the {\it single-hit} events with those of the {\it multiple-hit} ones corresponds practically to compare between them the cases of DM particles beam-on and beam-off. This procedure also allows an additional test of the background behaviour in the same energy interval where the positive effect is observed. In particular, in Fig. \ref{fig_mul} the residual rates of the {\it single-hit} events measured over the six DAMA/LIBRA annual cycles are reported, as collected in a single cycle, together with the residual rates of the {\it multiple-hit} events, in the considered energy intervals. While, as already observed, a clear modulation, satisfying all the peculiarities of the DM annual modulation signature, is present in the {\it single-hit} events, the fitted modulation amplitudes for the {\it multiple-hit} residual rate are well compatible with zero: $(-0.0011\pm0.0007)$ cpd/kg/keV, $(-0.0008\pm0.0005)$ cpd/kg/keV, and $(-0.0006\pm0.0004)$ cpd/kg/keV in the energy regions (2 -- 4), (2 -- 5) and (2 -- 6) keV, respectively. Thus, again evidence of annual modulation with proper features as required by the DM annual modulation signature is present in the {\it single-hit} residuals (events class to which the DM particle induced events belong), while it is absent in the {\it multiple-hit} residual rate (event class to which only background events belong). Similar results were also obtained for the last two annual cycles of the DAMA/NaI experiment \cite{ijmd}. Since the same identical hardware and the same identical software procedures have been used to analyse the two classes of events, the obtained result offers an additional strong support for the presence of a DM particle component in the galactic halo. \begin{figure}[!ht] \begin{center} \includegraphics[width=0.9\textwidth] {fig5a.eps} \includegraphics[width=0.9\textwidth] {fig5b.eps} \includegraphics[width=0.9\textwidth] {fig5c.eps} \end{center} \vspace{-0.5cm} \caption{Experimental residual rates over the six DAMA/LIBRA annual cycles for {\it single-hit} events (open circles) (class of events to which DM events belong) and for {\it multiple-hit} events (filled triangles) (class of events to which DM events do not belong). They have been obtained by considering for each class of events the data as collected in a single annual cycle and by using in both cases the same identical hardware and the same identical software procedures. The initial time of the figure is taken on August 7$^{th}$. The experimental points present the errors as vertical bars and the associated time bin width as horizontal bars. See text and ref. \cite{modlibra}. Analogous results were obtained for the DAMA/NaI data \cite{ijmd}.} \label{fig_mul} \vspace{-0.4cm} \end{figure} As in ref. \cite{modlibra}, the annual modulation present at low energy can also be shown by depicting -- as a function of the energy -- the modulation amplitude, $S_{m,k}$, obtained by maximum likelihood method over the data considering $T=$1 yr and $t_0=$ 152.5 day. For such purpose the likelihood function of the {\it single-hit} experimental data in the $k-$th energy bin is defined as: $ {\it\bf L_k} = {\bf \Pi}_{ij} e^{-\mu_{ijk}} {\mu_{ijk}^{N_{ijk}} \over N_{ijk}!}$, where $N_{ijk}$ is the number of events collected in the $i$-th time interval (hereafter 1 day), by the $j$-th detector and in the $k$-th energy bin. $N_{ijk}$ follows a Poisson's distribution with expectation value $\mu_{ijk} = \left[ b_{jk} + S_{ik} \right] M_j \Delta t_i \Delta E \epsilon_{jk}$. The b$_{jk}$ are the background contributions, $M_j$ is the mass of the $j-$th detector, $\Delta t_i$ is the detector running time during the $i$-th time interval, $\Delta E$ is the chosen energy bin, $\epsilon_{jk}$ is the overall efficiency. Moreover, the signal can be written as $S_{ik} = S_{0,k} + S_{m,k} \cdot \cos\omega(t_i-t_0)$, where $S_{0,k}$ is the constant part of the signal and $S_{m,k}$ is the modulation amplitude. The usual procedure is to minimize the function $y_k=-2ln({\it\bf L_k}) - const$ for each energy bin; the free parameters of the fit are the $(b_{jk} + S_{0,k})$ contributions and the $S_{m,k}$ parameter. Hereafter, the index $k$ is omitted when unnecessary. \begin{figure}[!ht] \vspace{-0.5cm} \begin{center} \includegraphics[width=\textwidth] {fig6.eps} \end{center} \vspace{-0.5cm} \caption{Energy distribution of the $S_{m}$ variable for the total cumulative exposure 1.17 ton$\times$yr. The energy bin is 0.5 keV. A clear modulation is present in the lowest energy region, while $S_{m}$ values compatible with zero are present just above. In fact, the $S_{m}$ values in the (6--20) keV energy interval have random fluctuations around zero with $\chi^2$ equal to 27.5 for 28 degrees of freedom.} \label{sme} \end{figure} In Fig. \ref{sme} the obtained $S_{m}$ are shown in each considered energy bin (there $\Delta E = 0.5$ keV). It can be inferred that positive signal is present in the (2--6) keV energy interval, while $S_{m}$ values compatible with zero are present just above. In fact, the $S_{m}$ values in the (6--20) keV energy interval have random fluctuations around zero with $\chi^2$ equal to 27.5 for 28 degrees of freedom. All this confirms the previous analyses. \vspace{0.5cm} The method also allows the extraction of the the $S_{m}$ values for each detector, for each annual cycle and for each energy bin. Thus, following the procedure described in ref. \cite{modlibra}, we have also verified that the S$_{m}$ are statistically well distributed in all the six DAMA/LIBRA annual cycles and in all the sixteen energy bins ($\Delta$E = 0.25 keV in the 2--6 keV energy interval) for each detector. Moreover, that procedure also allows the definition of a $\chi^2$ for each detector; the associated degree of freedom are 16 for the detector restored after the upgrade in 2008 and 96 for the others. The values of the $\chi^2$/d.o.f. range between 0.7 and 1.22 for twenty-four detectors, and the observed annual modulation effect is well distributed in all these detectors at 95\% C.L.. A particular mention is deserved to the remaining detector whose value is 1.28 exceeding the value corresponding to that C.L.; this also is statistically consistent, considering that the expected number of detector exceeding this value over twenty-five is 1.25. Moreover, the mean value of the 25 $\chi^2/d.o.f.$ is 1.066, slightly larger than expected. Although this can be still ascribed to statistical fluctuations (see before), let us ascribe it to a possible systematics. In this case, one would have an additional error of $\leq 4 \times 10^{-4}$ cpd/kg/keV, if quadratically combined, or $\leq 5 \times 10^{-5}$ cpd/kg/keV, if linearly combined, to the modulation amplitude measured in the (2 -- 6) keV energy interval. This possible additional error: $\leq 4\%$ or $\leq 0.5\%$, respectively, of the DAMA/LIBRA modulation amplitude is an upper limit of possible systematic effects. Among further additional tests, the analysis of the modulation amplitudes as a function of the energy separately for the nine inner detectors and the remaining external ones has been carried out including the DAMA/LIBRA-5,6 data to those already analysed in ref. \cite{modlibra}. The obtained values are fully in agreement; in fact, the hypothesis that the two sets of modulation amplitudes as a function of the energy belong to same distribution has been verified by $\chi^2$ test, obtaining: $\chi^2/d.o.f.$ = 3.1/4 and 7.1/8 for the energy intervals (2--4) and (2--6) keV, respectively ($\Delta$E = 0.5 keV). This shows that the effect is also well shared between inner and external detectors. Let us, finally, release the assumption of a phase $t_0=152.5$ day in the procedure to evaluate the modulation amplitudes from the data of the 1.17 ton $\times$ yr. In this case alternatively the signal has been written as: \begin{equation} S_{ik} = S_{0,k} + S_{m,k} \cos\omega(t_i-t_0) + Z_{m,k} \sin\omega(t_i-t_0) = S_{0,k} + Y_{m,k} \cos\omega(t_i-t^*), \label{eqn} \end{equation} \noindent For signals induced by DM particles one would expect: i) $Z_{m,k} \sim 0$ (because of the orthogonality between the cosine and the sine functions); ii) $S_{m,k} \simeq Y_{m,k}$; iii) $t^* \simeq t_0=152.5$ day. In fact, these conditions hold for most of the dark halo models; however, it is worth noting that slight differences can be expected in case of possible contributions from non-thermalized DM components, such as e.g. the SagDEG stream \cite{epj06} and the caustics \cite{caus}. \begin{figure*}[!ht] \begin{center} \vspace{-0.8cm} \includegraphics[width=0.45\textwidth] {fig7a.eps} \includegraphics[width=0.45\textwidth] {fig7b.eps} \end{center} \vspace{-0.7cm} \caption{$2\sigma$ contours in the plane $(S_m , Z_m)$ ({\it left}) and in the plane $(Y_m , t^*)$ ({\it right}) for the (2--6) keV and (6--14) keV energy intervals. The contours have been obtained by the maximum likelihood method, considering the cumulative exposure of 1.17 ton $\times$ yr. A modulation amplitude is present in the lower energy intervals and the phase agrees with that expected for DM induced signals.} \label{fg:bid} \end{figure*} Fig. \ref{fg:bid}{\it --left} shows the $2\sigma$ contours in the plane $(S_m , Z_m)$ for the (2--6) keV and (6--14) keV energy intervals and Fig. \ref{fg:bid}{\it --right} shows, instead, those in the plane $(Y_m , t^*)$. Table \ref{tb:bidbf} shows the best fit values for the (2--6) and (6--14) keV energy interval ($1\sigma$ errors) for S$_m$ versus Z$_m$ and $Y_m$ versus $t^*$. \begin{table}[ht] \vspace{-0.2cm} \caption{Best fit values for the (2--6) and (6--14) keV energy interval ($1\sigma$ errors) for S$_m$ versus Z$_m$ and $Y_m$ versus $t^*$, considering the cumulative exposure of 1.17 ton $\times$ yr. See also Fig. \ref{fg:bid}.} \vspace{-0.5cm} \begin{center} \resizebox{\textwidth}{!}{ \begin{tabular}{|c|c|c|c|c|} \hline E & S$_m$ & Z$_m$ & $Y_m$ & $t^*$ \\ (keV) & (cpd/kg/keV) & (cpd/kg/keV) & (cpd/kg/keV) & (day) \\ \hline 2--6 & (0.0111 $\pm$ 0.0013) & -(0.0004 $\pm$ 0.0014) & (0.0111 $\pm$ 0.0013) & (150.5 $\pm$ 7.0) \\ 6--14 & -(0.0001 $\pm$ 0.0008) & (0.0002 $\pm$ 0.0005) & -(0.0001 $\pm$ 0.0008) & undefined \\ \hline \hline \end{tabular}} \label{tb:bidbf} \vspace{-0.5cm} \end{center} \end{table} Finally, forcing to zero the contribution of the cosine function in eq. (\ref{eqn}), the $Z_{m}$ values as function of the energy have also been determined by using the same procedure. The values of $Z_{m}$ as a function of the energy is reported in Fig. \ref{fg:zm}. Obviously, such values are expected to be zero in case of presence of a DM signal with $t^* \simeq t_0 = 152.5$ day. By the fact, the $\chi^2$ test applied to the data supports the hypothesis that the $Z_{m}$ values are simply fluctuating around zero; in fact, for example in the (2--14) keV and (2--20) keV energy region the $\chi^2$/d.o.f. are equal to 21.6/24 and 47.1/36 (probability of 60\% and 10\%), respectively. \begin{figure*}[!ht] \begin{center} \vspace{-0.5cm} \includegraphics[width=0.85\textwidth] {fig8.eps} \end{center} \vspace{-0.8cm} \caption{Energy distribution of the $Z_{m}$ variable for the total exposure (1.17 ton $\times$ yr, DAMA/NaI\&DAMA/LIBRA), once forced to zero the contribution of the cosine function in eq. (\ref{eqn}). The energy bin is 0.5 keV. The $Z_{m}$ values are expected to be zero in case of presence of a DM particles' signal with $t^* \simeq t_0 = 152.5$ day. By the fact, the $\chi^2$ test applied to the data supports the hypothesis that the $Z_{m}$ values are simply fluctuating around zero; see text.} \label{fg:zm} \end{figure*} The behaviours of the $Y_{m}$ and of the phase $t^*$ variables as function of energy are shown in Fig. \ref{fg:ymts} for the total exposure (1.17 ton $\times$ yr, DAMA/NaI\&DAMA/LIBRA). The $Y_{m}$ are superimposed with the $S_{m}$ values with 1 keV energy bin (unlike Fig. \ref{sme} where the energy bin is 0.5 keV). As in the previous analyses, an annual modulation effect is present in the lower energy intervals and the phase agrees with that expected for DM induced signals. These results confirm those achieved by other kinds of analyses. \begin{figure*}[!ht] \begin{center} \includegraphics[width=0.85\textwidth] {fig9a.eps} \includegraphics[width=0.85\textwidth] {fig9b.eps} \end{center} \vspace{-0.5cm} \caption{{\em Top:} Energy distributions of the $Y_{m}$ variable (light data points; red colour online) and of the $S_{m}$ variable (solid data points) for the total exposure (1.17 ton $\times$ yr, DAMA/NaI\&DAMA/LIBRA). Here, unlike the data of Fig. \ref{sme}, the energy bin is 1 keV. {\em Bottom:} Energy distribution of the phase $t^*$ for the total exposure; here the errors are at $2\sigma$. An annual modulation effect is present in the lower energy intervals up to 6 keV and the phase agrees with that expected for DM induced signals. No modulation is present above 6 keV and the phase is undetermined.} \label{fg:ymts} \end{figure*} Sometimes naive statements were put forwards as the fact that in nature several phenomena may show some kind of periodicity. It is worth noting that the point is whether they might mimic the annual modulation signature in DAMA/LIBRA (and former DAMA/NaI), i.e. whether they might be not only quantitatively able to account for the observed modulation amplitude but also able to contemporaneously satisfy all the requirements of the DM annual modulation signature. The same is also for side reactions. This has already been deeply investigated in ref. \cite{modlibra,perflibra} and references therein; the arguments and the quantitative conclusions, presented there, also apply to the DAMA/LIBRA-5,6 data. Some additional arguments have also been recently addressed in \cite{scineghe09,taupnoz}. \section{Comments} The obtained model independent evidence -- at 8.9 $\sigma$ C.L. over 13 annual cycles -- is compatible with a wide set of scenarios regarding the nature of the DM candidate and related astrophysical, nuclear and particle Physics (see e.g. ref. \cite{RNC,ijmd,ijma,ijma07,chan,wimpele,ldm}, Appendix A of ref. \cite{modlibra} and in literature, for example see \cite{Wei01,Botdm,Foot}); and many other possibilities are open. Further future works are foreseen. It is worth recalling that no other experiment exists, whose result can be directly compared in a model-independent way with those by DAMA/NaI and DAMA/LIBRA, and that -- more in general -- results obtained with different target materials and/or different approaches cannot be directly compared among them in a model-independent way. This is in particular due to the existing experimental and theoretical uncertainties, not last e.g. how many kinds of dark matter particles can exist in the Universe\footnote{ In fact, it is worth noting that, considering the richness in particles of the visible matter which is less than 1\% of the Universe density, one could also expect that the particle part of the Dark Matter in the Universe may also be multicomponent.}, the nature, the interaction types, the different nuclear and/or atomic correlated aspects, the unknown right halo model, the right DM density, etc. as well as the uncertainties on the values of each one of the many involved experimental and theoretical parameter/assumption/approximation used in the calculations. Moreover, some experimental aspects of some techniques used in the field have also to be addressed \cite{RNC,paperliq,taupnoz}. Another relevant argument is the methodological robustness \cite{hudson}. In particular, the general considerations on comparisons reported in Appendix A of ref. \cite{modlibra} still hold. Hence, claims for contradiction have no scientific basis. On the other hand, whatever possible ``positive'' result has to be interpreted and a large room of compatibility with DAMA annual modulation evidence is present. Similar considerations can also be done for the indirect detection searches, since it does not exist a biunivocal correspondence between the observables in the direct and indirect experiments. However, if possible excesses in the positron to electron flux ratio and in the $\gamma$ rays flux with respect to a modeling of the background contribution, which is expected from the considered sources, might be interpreted -- under some assumptions -- in terms of Dark Matter, this would also be not in conflict with the effect observed by DAMA experiments. It is worth noting that different possibilities either considering different background modeling or accounting for other kinds of sources can also explain the indirect observations \cite{ind}. Finally, as regards the accelerator searches for new particles beyond the Standard Model of particle Physics, it is worth noting that they can demonstrate the existence of some of the possible DM candidates, but cannot credit that a certain particle is the DM solution or the "single" DM solution. Moreover, DM candidates and scenarios exist (even e.g. for the neutralino candidate) on which accelerators cannot give any information. It is also worth noting that for every candidate (including the neutralino) there exist various different possibilities for the theoretical aspects. Nevertheless, the results from accelerators will give outstanding and crucial complementary information in the field. \vspace{0.3cm} A new upgrade of DAMA/LIBRA is foreseen in 2010 with the replacement of all the low background PMTs with new ones having higher quantum efficiency; the main aim is to lower the software energy threshold and, thus, to increase the experimental sensitivity and to disentangle -- in the corollary investigation on the candidate particle(s) -- at least some of the many possible astrophysical, nuclear and particle Physics scenarios and related experimental and theoretical uncertainties.\\ \section{Conclusions} The new annual cycles DAMA/LIBRA-5,6 have further confirmed a peculiar annual modulation of the {\it single-hit} events in the (2--6) keV energy region satisfying the many requests of the DM annual modulation signature; the total exposure by former DAMA/NaI and present DAMA/LIBRA is 1.17 ton $\times$ yr. In fact, as required by the DM annual modulation signature: 1) the {\it single-hit} events show a clear cosine-like modulation as expected for the DM signal; 2) the measured period is equal to $(0.999\pm 0.002)$ yr well compatible with the 1 yr period as expected for the DM signal; 3) the measured phase $(146\pm7)$ days is well compatible with the roughly $\simeq$ 152.5 days expected for the DM signal; 4) the modulation is present only in the low energy (2--6) keV energy interval and not in other higher energy regions, consistently with expectation for the DM signal; 5) the modulation is present only in the {\it single-hit} events, while it is absent in the {\it multiple-hit} ones as expected for the DM signal; 6) the measured modulation amplitude in NaI(Tl) of the {\it single-hit} events in the (2--6) keV energy interval is: $(0.0116 \pm 0.0013)$ cpd/kg/keV (8.9 $\sigma$ C.L.). No systematic or side processes able to simultaneously satisfy all the many peculiarities of the signature and to account for the whole measured modulation amplitude is available. Further work is in progress.\\
\section{Introduction} Multiband observations \citep{gildepaz05, PT06, erwin08} show evidence of a large number of stars being present in the outer regions of spiral galaxy disks. However, current star formation theories do not support easily the idea of stars forming in those regions, because the environment is not dense enough to provide the conditions of star formation, e.g., gas surface mass density is too low ($\le10$\,M$_{\odot}$\,pc$^{-2}$, \citealt{Kennicutt89}). This fact creates a so-far not answered question: what is the origin of these stars? We approach this problem by means of investigating the structural and stellar population properties of the (outskirts) spiral galaxy disks. Early studies of the disks of spiral galaxies \citep{Patterson40, vauc58, freeman70} showed that this component generally follows an exponential radial surface-brightness profile, with a certain scale-length, usually taken as the characteristic size of the disk. \citet{freeman70} pointed out, though, that not all disks follow this simple exponential law. In fact, a repeatedly reported feature of disks for a representative fraction of the spiral galaxies is that of a truncation \citep{Kruit79} of the stellar population at large radii, typically 2--4 exponential scale-lengths \citep[see e.g., the review by][]{Pohlen04}. \begin{figure*}[t!] \plottwo{bakos_f02a.ps}{bakos_f02b.ps} \caption{\footnotesize Left: Break radius of `truncated' galaxies as a function of stellar mass, for 4 ranges of redshift. Local data are from \citet{PT06} ($g'$-band results). Right: Size evolution at a given stellar mass of the break radius as a function of redshift. We have found a growth of a factor $1.3\pm0.1$ between $z=1$ and $z=0$. The numbers below each point in the right panel indicate the size of the sample.} \label{figTrmass} \end{figure*} Several possible break-forming mechanisms have been investigated to explain the truncations. There have been ideas based on maximum angular momentum distribution: \citet{Kruit87} proposed that angular momentum conservation in a collapsing, uniformly rotating cloud naturally gives rise to disk breaks at roughly 4.5 scale radii. \citet{Bosch01} suggested that the breaks are due to angular momentum cut-offs of the cooled gas. On the other hand, breaks have also been attributed to a threshold for star formation, due to changes in the gas density \citep{Kennicutt89}, or to an absence of equilibrium in the cool interstellar medium phase \citep{ElmegreenParravano94, Schaye04}. Magnetic fields have been also considered \citep{Battaner2002} as responsible of the truncations. More recent models using collisionless N-body simulations, such as those by \citet{Debattista06}, demonstrated that the redistribution of angular momentum by spirals during bar formation also produces realistic breaks. In a further elaboration of this idea, \citet{Roskar08} have performed high resolution simulations of the formation of a galaxy embedded in a dark matter halo. In these models, breaks are the result of the interplay between a radial star formation cut-off and redistribution of stellar mass by secular processes. A natural prediction of these models is that the stellar populations present an age minimum in the break position. This prediction could be probed by exploring the color profiles of the galaxies. Furthermore, addressing the question of how the radial truncation evolves with $z$ is strongly linked to our understanding of how the galactic disks grow and where star formation takes place. \citet{Perez04} showed that it is possible to detect stellar truncations even out to $z\sim1$. Using the radial position of the truncation as a direct estimator of the size of the stellar disk, \citet{TP05} inferred a moderate ($\sim 25$\%) inside-out growth of disk galaxies since $z\sim1$. An important point, however was missing in the previous analyses: the evolution with redshift of the radial position of the break at a given stellar mass. The stellar mass is a much better parameter to explore the growth of galaxies, since the luminosity evolution of the stellar populations can mimic a size evolution \citep{Trujillo04, Trujillo06}. We present in this contribution a quick summary of our recent findings on the stellar disk truncation origin and its evolution with redshift. The results presented here are based on the following publications: \citet{Azzollini08a, Azzollini08b} and \citet{Bakos08}. Throughout, we assume a flat $\Lambda$-dominated cosmology ($\Omega_{\rm m} = 0.30$, $\Omega_{\Lambda} = 0.70$, and $H_{0} = 70$ km\,s$^{-1}$\,Mpc$^{-1}$). \section{Color profiles of local galaxies} In order to constrain the outer disk formation models, in \citet{Bakos08}, we have explored radial color and stellar surface mass density profiles for a sample of 85 late-type spiral galaxies with available deep (down to $\sim27$ mag\,arcsec$^{-2}$) SDSS $g'$- and $r'$-band surface brightness profiles \citep{PT06}. About $90$\% of the light profiles have been classified as broken exponentials, exhibiting either truncations (Type~II galaxies) or antitruncations (Type~III galaxies). Their associated color profiles show a significantly different behavior. For the truncated galaxies a radial inside-out bluing reaches a minimum of $(g'-r') = 0.47 \pm 0.02$ mag at the position of the break radius, this minimum is followed by a reddening outwards (see the middle panels in Fig.~\ref{colorbak}). The antitruncated galaxies reveal a different behavior. At the position of the break radius (obtained from the light profiles) now resides a plateau region of the color profile with a value about $(g'-r') = 0.57 \pm 0.02$. \subsection{Stellar surface mass density profiles} Using the $(g'-r')$ color \citep{Bell03} it is possible calculate mass-to-light ($M/L$) ratios along the radius of the disks. Converting the $(M/L)$ into stellar surface mass density reveals a surprising result. The breaks, well established in the light profiles of the Type~II galaxies, are almost gone (in case of several individual galaxies, e.g., NGC~5300, the break is completely gone). The mass profiles resembles now those of the pure exponential Type~I galaxies (see the bottom panels in Fig.~\ref{colorbak}). This result suggests that the origin of the break in Type~II galaxies is more likely due to a radial change in the ingredients of the stellar population than being associated to an actual drop in the distribution of mass. The antitruncated galaxies, on the other hand, show clear mass-excess in the outer regions on the stellar mass density profiles, which could have been accumulated from an external (possibly satellite) origin. There are other structural parameters that can be computed to constrain the different formation scenarios. Among these we have estimated the stellar surface mass density at the break for truncated (Type~II) galaxies ($13.6\pm1.6$ M$_{\odot}$\,pc$^{-2}$) and the same parameter for the antitruncated (Type~III) galaxies ($9.9\pm1.3$ M$_{\odot}$\,pc$^{-2}$). Finally, we have measured that \mbox{$\sim15$\%} of the total stellar mass in case of truncated galaxies and $\sim9$\% in case of antitruncated galaxies are to be found beyond the measured break radii in the light profiles. \section{Stellar disk truncation along the Hubble-time} In \citet{Azzollini08a}, we have conducted the largest systematic search so far for stellar disk truncations in disk-like galaxies at intermediate redshift ($z<1.1$), using the Great Observatories Origins Deep Survey South (GOODS-S) data from the Hubble Space Telescope/ACS. Focusing on Type II galaxies (i.e., downbending profiles) we explore whether the position of the break in the rest-frame $B$-band radial surface brightness profile (a direct estimator of the extent of the disk where most of the massive star formation is taking place), evolves with time. The number of galaxies under analysis (238 of a total of 505) is an order of magnitude larger than in previous studies. For the first time, we probe the evolution of the break radius for a given stellar mass (a parameter well suited to address evolutionary studies). Our results suggest that, for a given stellar mass, the radial position of the break has increased with cosmic time by a factor $1.3\pm0.1$ between $z\sim1$ and $z\sim0$ (see Fig.~\ref{figTrmass}). This is in agreement with a moderate inside-out growth of the disk galaxies in the last $\sim8$ Gyr. In the same period of time, the surface brightness level in the rest-frame $B$-band at which the break takes place has increased by $3.3\pm0.2$ mag\,arcsec$^{-2}$ (a decrease in brightness by a factor of $20.9\pm4.2$, see Fig.~\ref{figmu}). \begin{figure}[] \resizebox{\hsize}{!}{\includegraphics[clip=true]{bakos_f03.ps}} \caption{\footnotesize Evolution of the surface brightness at the break for Type II galaxies with redshift. We show the median surface brightness at the break for the distribution of our galaxies. The larger error bars represent the standard deviation of the distributions, while the shorter ones give the error in the median values. (The numbers below each point give the size of the sample at that redshift bin.)} \label{figmu} \end{figure} \begin{figure*}[t!] \resizebox{\hsize}{!}{\includegraphics[clip=true]{bakos_f04.ps}} \caption{\footnotesize Color profiles of the 415 galaxies under study in \citet{Azzollini08b}. The sample is divided in subsamples according to surface brightness profile type (I or pure exponential profiles, II or truncated galaxies, III or antitruncated, in columns, from left to right) and redshift range (low, mid, or high, in rows, from top to bottom). The colors ($B_{435}-V_{606}$, $V_{606}-i_{775}$, $V_{606}-z_{850}$) are chosen as the best proxies to the rest-frame $u-g$ color in each redshift bin. The radii are scaled to the scale radius, $R_{\rm s}$, whose definition depends on profile type: $R_{\rm s}=2h$ for type I, where $h$ is the scale-length of the disk, and it is equal to the break radius, $R_{\rm s}=R_{\rm B}$, for types II and III. Small points are individual color profiles. Large black dots are the median color profiles for each subsample, and the error bars give the error in those estimations. The red squares give the median color profile for objects with stellar mass $M_{\star}>10^{10}$ M$_{\odot}$, while the blue squares give the same for objects with $M_{\star}\leq10^{10}$ M$_{\odot}$.} \label{colorazzo} \end{figure*} In \citet{Azzollini08a} we also find that at a given stellar mass, the scale-lengths of the disk in the part inner to the `break' were on average somewhat larger in the past, and have remained more or less constant until recently. This phenomenon could be related to the spatial distribution of star formation, which seems to be rather spread over the disks in the images. So disk galaxies had profiles with a flatter brightness distribution in the inner part of the disk, which has grown in extension, while becoming fainter and `steeper' over time. This is consistent with at least some versions of the inside-out formation scenario for disks. \section{Color profiles in intermediate redshift galaxies} In addition to the evolution of the position of the break in spiral galaxies, it is important to explore how the color of the surface brightness profiles has evolved with time. This kind of analysis sheds light on when stars formed in different parts of the disk of galaxies, thus giving hints on the stellar mass buildup process. In \citet{Azzollini08b} we present deep color profiles for a sample of 415 disk galaxies within the redshift range $0.1 \leq z \leq 1.1$, and contained in HST/ACS imaging of the GOODS-South field. For each galaxy, passband combinations are chosen to obtain, at each redshift, the best possible approximation to the rest-frame $u-g$ color (see, Fig.~\ref{colorazzo}). We find that objects which show a truncation in their stellar disk (type II objects) usually show a minimum in their color profile at the break, or very near to it, with a maximum to minimum amplitude in color of $\leq0.2$ mag\,arcsec$^{-2}$, a feature which is persistent through the explored range of redshifts (i.e., in the last $\sim8$ Gyr and that it is also found in our local sample for comparison \citep{Bakos08}. This color structure is in qualitative agreement with recent model expectations where the break of the surface brightness profiles is the result of the interplay between a radial star formation cutoff and a redistribution of stellar mass by secular processes \citep{Roskar08}. \section{Discussion} Our results on the color profiles fit qualitatively with the particular prediction of \citet{Roskar08}, that the youngest stellar population should be found at the break radius, and older (redder) stars must be located beyond that radius. It is not easy to understand how `angular momentum' or `star formation threshold'/`ISM phases' models alone could explain our results. Thus they pose a difficult challenge for these models. However, it will also be necessary to check whether the \citet{Roskar08} models (as well as other available models in the literature like those of \citet{Bour07} and \citet{Foyle08}) are able to reproduce quantitatively the results shown here. Combining the results found in \citet{Azzollini08b} and \citet{Bakos08} one is tempted to claim that both the existence of the break in Type~II galaxies, as well as the shape of their color profiles, are long lived features in the galaxy evolution. Because it would be hard to imagine how the above features could be continuously destroyed and re-created maintaining the same properties over the last $\sim8$ Gyr. \bibliographystyle{aa}
\section{Introduction} Recent years have seen a proliferation of analytical models of star formation that provide prescriptions for star formation rates and initial mass functions based on physical properties of molecular clouds (Padoan \& Nordlund 2002; Krumholz \& McKee 2005; Elmegreen 2008; Hennebelle \& Chabrier 2008; Padoan \& Nordlund 2009; Hennebelle \& Chabrier 2009). While these models differ in their details, they are all fundamentally based on the same increasingly influential idea that has emerged from numerical models: that the density PDF is lognormal in form for isothermal gas (V\'{a}zquez-Semadeni 1994), with the normalized density variance increasing with the rms Mach number ($\sigma^{2}_{\rho/\rho_{0}} = b^{2}M^{2}$ where $\rho$ is the density, $\rho_{0}$ is the mean density, M is the 3D rms Mach number, and $b$ is a numerically determined parameter; Padoan, Nordlund, \& Jones 1997). There is some uncertainty on the value of $b$. Padoan et al (1997) propose $b = 0.5$ in 3D, while Passot \& V\'{a}zquez-Semadeni (1998) found $b = 1$ using 1D simulations. Federrath, Klessen, \& Schmidt (2008) suggested that $b = 1/3$ for solenoidal (divergence-free) forcing and $b = 1$ for compressive (curl-free) forcing in 3D. A value of $b = 0.25$ was recently found by Kritsuk et al (2007) in numerical simulations that employed a mixture of compressive and solenoidal forcing. Lemaster \& Stone (2008) found an non-linear relation between $\sigma^{2}_{\rho/\rho_{0}}$ and $M^{2}$, but it is very similar to a linear relation with $b = 1/3$ over the range of Mach numbers they analyzed. They also found that magnetic fields appear to have only a weak effect on the $\sigma^{2}_{\rho/\rho_{0}}$~--~$M^{2}$ relation, and noted that the relation may be different in conditions of decaying turbulence. Currently, observational information on the value of $b$, or the linearity of the $\sigma^{2}_{\rho/\rho_{0}}$~--~$M^{2}$ relation, is very sparse. A major obstacle is the inaccessibility of the 3D density field. Recently, Brunt, Federrath, \& Price (2009; BFP) have developed and tested a method of calculating $\sigma^{2}_{\rho/\rho_{0}}$ from information contained solely in the projected column density field, which we apply to the Taurus molecular cloud in this paper. Using a technique similar to that of BFP, Padoan, Jones, \& Nordlund (1997) have previously estimated a value of $b = 0.5$ ($M = 10$, $\sigma_{\rho/\rho_{0}} = 5$) for the IC~5146 molecular cloud. In sub-regions of the Perseus molecular cloud Goodman, Pineda, \& Schnee (2009) found no obvious relation between Mach number and normalized column density variance, $\sigma^{2}_{N/N_{0}}$. It has been suggested by Federrath et al (2008) that this could be due to differing levels of compressive forcing, but it may also be due to differing proportions of $\sigma^{2}_{\rho/\rho_{0}}$ projected into $\sigma^{2}_{N/N_{0}}$ (BFP). Alternatively, this may imply that there is no obvious relation between $\sigma^{2}_{\rho/\rho_{0}}$ and $M^{2}$. The aim of this paper is to constrain the $\sigma^{2}_{\rho/\rho_{0}}$~--~$M^{2}$ relation observationally. In Section~2, we briefly describe the BFP technique, and in Section~3 we apply it to spectral line imaging observations (Narayanan et al 2008; Goldsmith et al 2008) and dust extinction mapping (Froebrich et al 2007) of the Taurus molecular cloud to establish an observational estimate of $b$. Section~4 provides a summary. \section{Measuring the 3D Density Variance} We do not have access to the 3D density field, $\rho(x,y,z)$ in a molecular cloud to measure $\sigma^{2}_{\rho/\rho_{0}}$ directly, but must instead rely on information contained the projected 2D column density field, $N(x,y)$. One can use Parseval's Theorem to relate the observed variance in the normalized column density field, $\sigma^{2}_{N/N_{0}}$ to the sum of its power spectrum, $P_{N/N_{0}}(k_{x},k_{y})$. It can be shown that $P_{N/N_{0}}(k_{x},k_{y})$ is proportional to the $k_{z} = 0$ cut through the 3D power spectrum, $P_{\rho/\rho_{0}}(k_{x},k_{y},k_{z})$. Since $\sigma^{2}_{\rho/\rho_{0}}$ can in turn be related, again through Parseval's Theorem, to the sum of its power spectrum, $P_{\rho/\rho_{0}}$, it is possible, assuming an isotropic density field, to calculate the ratio, $R = \sigma^{2}_{N/N_{0}} / \sigma^{2}_{\rho/\rho_{0}}$ from measurements made on the column density field alone. It was shown by BFP that $R$ is given by: \begin{eqnarray} \lefteqn{ R = } \nonumber \\ \lefteqn{\frac{[\displaystyle\sum_{k_{x}=-\lambda/2+1}^{\lambda/2} \sum_{k_{y}=-\lambda/2+1}^{\lambda/2} \langle{P_{N/N_{0}}}\rangle (k) \tilde{B}^{2}(k) ] - P_{N/N_{0}}(0)\tilde{B}^{2}(0)}{[\displaystyle\sum_{k_{x}=-\lambda/2+1}^{\lambda/2} \sum_{k_{y}=-\lambda/2+1}^{\lambda/2} \sum_{k_{z}=-\lambda/2+1}^{\lambda/2} \langle{P_{N/N_{0}}}\rangle (k) \tilde{B}^{2}(k) ] - P_{N/N_{0}}(0)\tilde{B}^{2}(0)} ,} \label{eqno1} \end{eqnarray} where $\lambda$ is the number of pixels along each axis, $\langle{P_{N/N_{0}}}\rangle(k)$ is the azimuthally-averaged power spectrum of $N/N_{0}$, and $\tilde{B}^{2}(k)$ is the square of the Fourier space representation of the telescope beam pattern. In equation~\ref{eqno1}, it should be noted that $\langle{P_{N/N_{0}}}\rangle(k)$ is the power spectrum of the column density field in the absence of beam-smoothing and instrumental noise. \begin{figure} \includegraphics[width=84mm]{tf1.eps} \caption{ Integrated intensity map of the $^{13}$CO J=1--0 line over the velocity range $[0,12]$~km~s$^{-1}$ in the Taurus molecular cloud.} \label{fig:t1} \end{figure} An observational measurement of $\sigma^{2}_{N/N_{0}}$ and $R$ can then yield $\sigma^{2}_{\rho/\rho_{0}}$. To calculate the power spectrum in equation~\ref{eqno1}, zero-padding of the field may be necessary, to reduce edge discontinuities and to make the field square. If a field of size $\lambda_{x} \times \lambda_{y}$ is zero-padded to produce a square field of size $\lambda_{px} \times \lambda_{py}$ then $\sigma^{2}_{\rho/\rho_{0}}$ should be calculated via: \begin{equation} \sigma^{2}_{\rho/\rho_{0}} = \frac{1}{\eta^{3}} ( 1 + ((\sigma^{2}_{N/N_{0}} + 1)\eta^{2} -1 )/R_{p}) - 1 , \label{eqno2} \end{equation} where $\eta = (\lambda_{px}\lambda_{py}/\lambda_{x}\lambda_{y})^{\frac{1}{2}}$, and $R_{p}$ is the 2D-to-3D variance ratio calculated from the power spectrum of the padded field using equation~\ref{eqno1}. This assumes that the line-of-sight extent (in pixels) of the density field is $\lambda_{z} = (\lambda_{x}\lambda_{y})^{\frac{1}{2}}$. The BFP method assumes isotropy in the 3D density field, so equation~(\ref{eqno1}) must be applied with some caution. Using magnetohydrodynamic turbulence simulations, BFP show that the assumption of isotropy is valid if the turbulence is super-Alfv\'{e}nic ($M_{A} > 1$) or, failing this, is strongly supersonic ($M \gtrsim 10$). The BFP method can be used to derive $\sigma^{2}_{\rho/\rho_{0}}$ to around 10\% accuracy if these criteria are met, while up to a factor of 2 uncertainty may be expected in the sub-Alfv\'{e}nic, low sonic Mach number regime. It should also be noted that the variance calculated at finite resolution is necessarily a lower limit to the true variance. While this problem can only be addressed by higher resolution observations, estimates of the expected shortfall in the variance can be made from available information. \section{Application to the Taurus Molecular Cloud} \subsection{Measurement of $b$ using $^{13}$CO data only} We now apply the BFP method to $^{13}$CO (J=1--0) spectral line imaging observations of the Taurus molecular cloud. Figure~\ref{fig:t1} shows the $^{13}$CO emission integrated over the velocity range $[0,12]$~km~s$^{-1}$. In the construction of this map, we have removed the contribution of the error beam to the observed intensities and expressed the resulting intensities on the corrected main beam scale, $T_{MB,c}$ (Bensch, Stutzki, \& Heithausen 2001; Brunt et al in prep.; Mottram \& Brunt in prep.) The map is 2048~pixels~$\times$~1529~pixels across, corresponding to 28~pc~$\times$~21~pc at a distance of 140~pc (Elias 1978). Following the procedure described in Section~2, we first estimate the variance in the normalized projected field. For this initial analysis, we use the entire field as represented in Figure~\ref{fig:t1} with no thresholding of the intensities. We assume that the $^{13}$CO integrated intensity, $I_{13}$, is linearly proportional to the column density, $N$. The advantages and disadvantages of this assumption are discussed below in Section~3.2, along with an alternative estimate of $b$ using extinction data to calculate the normalized column density variance. Taking $I_{13} \propto N$, we calculate $\sigma_{N/N_{0}}^{2} = \sigma_{I_{13}/I_{0,13}}^{2}$, where $I_{0,13}$ is the mean intensity. The observed variance in the field is the sum of the signal variance, $\sigma_{I_{13}}^{2}$, and the noise variance, $\sigma_{noise}^{2}$. We measure $\sigma_{I_{13}}^{2} + \sigma_{noise}^{2} = 2.81$ and $\sigma_{noise}^{2} = 0.42$, giving $\sigma_{I_{13}}^{2} = 2.39$ (units are all (K~km~s$^{-1}$)$^{2}$). With a measured $I_{0,13} = 1.06$~K~km~s$^{-1}$, we then find $\sigma_{N/N_{0}}^{2} = 2.25$. \begin{figure} \includegraphics[width=84mm]{tf2.eps} \caption{ Central portion of the power spectrum of the Taurus $^{13}$CO J=1--0 integrated intensity map. The black/white contours (smoothed for clarity) show levels of equal power, while the red circles represent an isotropic power spectrum for reference.} \label{fig:t2} \end{figure} The power spectrum of the integrated intensity field is now calculated. We use a square field of size 2048~pixels~$\times$~2048~pixels in which the map is embedded, and compute the power spectrum using a Fast Fourier Transform. Application of tapers to smoothly roll-off the field edges had an insignificant effect on the result (see Brunt \& Mac Low 2004). We calculate the noise floor using the power spectrum of an integrated map made over signal-free channels in the data, and this is subtracted from the power spectrum of the field. The central portion of the power spectrum is shown in Figure~\ref{fig:t2} to demonstrate the level of anisotropy present. The black and white contours (as appropriate to the greyscale level) show levels of equal power, obtained from a smoothed version of the power spectrum for clarity, and the red circles are overlayed to show what would be expected for a fully isotropic power spectrum. While Taurus is often considered ``elongated'' or ``filamentary'', the power spectrum of $^{13}$CO emission is in fact reasonably isotropic over most spatial frequencies. There is some evidence of anisotropy at the larger spatial scales (lower $k$), and we further demonstrate this in Figure~\ref{fig:t3}, which shows a zoom in on the smaller $k$ range of the power spectrum. Figure~\ref{fig:t3} shows that there is a preferred range in $k$ for anisotropy to be present, occurring at spatial frequencies near $k = 20$. \begin{figure} \includegraphics[width=84mm]{tf3.eps} \caption{ Zoom in on the central portion of the power spectrum of Figure~\ref{fig:t3}. The white contours (smoothed for clarity) show levels of equal power, while the red circles represent an isotropic power spectrum for reference.} \label{fig:t3} \end{figure} Figure~\ref{fig:t4} shows the angular average of the power spectrum, $P_{N/N_{0}}(k)$, with the noise floor subtracted and the beam pattern divided out. The heavy lines in Figure~\ref{fig:t4} display fitted power law forms ($P_{N/N_{0}}(k) \propto k^{-\alpha}$) to two distinct $k$-ranges in the power spectrum. The dotted lines continue the fitted forms beyond their respective ranges for comparison. For $k < 21$, the best fitting spectral slope is $\alpha = 2.1$, while for $k > 21$ we find $\alpha = 3.1$. It is notable that the spectral break occurs at the preferred scale for anisotropy to be distinguishable in the power spectrum. The wavelength corresponding to a spatial frequency of $k = 21$ is $\sim$~0.5~degrees, or $\sim$~1.2~pc. Previously, Blitz \& Williams (1997), using $^{13}$CO data but not using the power spectrum, identified a characteristic scale of $\sim$~0.25--0.5~pc at which the structure of antenna temperature histograms changes notably. Hartmann (2002) also noted a characteristic separation scale of $\sim$~0.25~pc in the distribution of young low mass stars in Taurus. These scales are comparable to about $1/4$ the wavelength of the spectral break in the power spectrum. The orientation and scale of the anisotropy suggests that it arises from the repeated filament structure of Taurus, as suggested by Hartmann (2002). Figure~\ref{fig:t2} and Figure~\ref{fig:t3} show that the assumption of isotropy holds reasonably well in 2D, but this is not necessarily a guarantee of isotropy in 3D, which, nevertheless, we must assume. The presence of a break in the power spectrum can be accommodated by equation~(\ref{eqno1}) which makes no assumptions, other than isotropy, on the form of the power spectrum. Evaluating equation~(\ref{eqno1}), we find that $R_{p} = 0.029$, where the subscript $p$ reflects the fact that padding was employed in the power spectrum calculation. Evaluating equation~\ref{eqno2} with $\sigma_{N/N_{0}}^{2} = 2.25$ and $\eta = (\lambda_{px}\lambda_{py}/\lambda_{x}\lambda_{y})^{\frac{1}{2}} = 1.157$, we find that $\sigma^{2}_{\rho/\rho_{0}} = 74.23 $. The line-of-sight extent of the field assumed for this calculation is $\sqrt{28 \times 21}$~pc = 24.25~pc. Given the high estimated sonic Mach number in Taurus (see below) it is unlikely that large scale strong anisotropies like those seen in sub-Alfv\'{e}nic conditions will be present due to magnetic fields (BFP). Gravitational collapse along magnetic field lines could in principle generate anisotropy, and indeed the small anisotropy identified in the power spectrum is oriented as expected in this case (Heyer et al 1987). \begin{figure} \includegraphics[width=84mm]{tf4.eps} \caption{ Angular average of the $^{13}$CO J=1--0 integrated intensity power spectrum (histogram) corrected for the noise floor and beam pattern. The solid lines show the fitted power laws $P(k) \propto k^{-2.1}$ and $P(k) \propto k^{-3.1}$, for the ranges $k < 21$ and $k > 21$ respectively. The dashed lines show the continuation of the fitted power laws for reference.} \label{fig:t4} \end{figure} To estimate the rms Mach number in Taurus, we now conduct an analysis of the velocity field. Using the $^{13}$CO spectral line averaged over the field (Figure~\ref{fig:t5}), we measure the line-of-sight velocity dispersion, $\sigma_{v_{z}}^{2} = (1.02 \pm 0.06)$~(km~s$^{-1}$)$^{2}$ by fitting a Gaussian profile. The line-of-sight velocity dispersion includes contributions from all internal motions including those at the largest spatial scales arising from large scale turbulence (Ossenkopf \& Mac Low 2002; Brunt 2003; Brunt, Heyer, \& Mac Low 2009). Assuming isotropy, this implies a 3D velocity dispersion of $\sigma_{v}^{2} = 3\sigma_{v_{z}}^{2} = (3.06 \pm 0.18)$~(km~s$^{-1}$)$^{2}$. Taking the Taurus molecular gas to be at a temperature of 10~K (Goldsmith et al 2008), with a mean molecular weight of 2.72 (Hildebrand 1983), the rms sonic Mach number is $M = 17.6 \pm 1.8$, where the quoted error estimate is from spectral line fitting and uncertainties in the kinetic temperature (Goldsmith et al (2008) report kinetic temperatures for the majority of Taurus between 6 and 12~K; we have taken an uncertainty of $\pm$~2~K). Combining these results, our observational estimate of $b$ therefore is $b$~=~$\sigma_{\rho/\rho_{0}}/M$~=~0.49~$\pm$~0.06, where we have applied an uncertainty of 10\% to the estimated $\sigma^{2}_{\rho/\rho_{0}}$ (BFP 2009). The uncertainty arising from the assumption of isotropy is difficult to quantify, and further progress on constraining $b$ will require the analysis of many more molecular clouds. Extension of this analysis to a larger sample of clouds will allow a test of whether $\sigma^{2}_{\rho/\rho_{0}}$ is indeed proportional to $M^{2}$ and may also allow investigation of whether $b$ changes due to varying degrees of compressive forcing of the turbulence (Federrath et al 2008; Federrath et al 2009). The above estimate of the uncertainty in $b$ accounts for measurement errors on $M$ and known uncertainties in the calculation of $R$ from BFP. The true uncertainty is rather larger than this, as we discuss in the following sections. \begin{figure} \includegraphics[width=84mm]{tf5.eps} \caption{ Global mean spectral line profile for the Taurus $^{13}$CO data (histogram). The heavy solid line is a Gaussian fit, with dispersion $\sigma_{v_{z}}^{2} = (1.02 \pm 0.06)$~(km~s$^{-1}$)$^{2}$.} \label{fig:t5} \end{figure} \subsection{Measurement of $b$ using $^{13}$CO and extinction data} We now consider the consequences of the assumption of linear proportionality between the $^{13}$CO integrated intensity and the column density. Goodman et al (2009; see also Pineda et al 2008) have recently evaluated different methods of measuring column densities in the Perseus molecular clouds. Their findings may be simply summarised as follows: $^{13}$CO J=1--0 integrated intensity, $I_{13}$, is linearly proportional to $A_{V}$ estimated by dust extinction over a limited column density range (over about a decade or so in $I_{13}$), but is depressed by saturation and/or depletion in the high column density regime; in the low column density regime, $I_{13}$ is again depressed by lowered $^{13}$CO abundance and/or subthermal excitation, and is insensitive to column densities below some threshold, as evidenced by an offset term in the $I_{13}$--$A_{V}$ relation. While all these factors impact on the point-to-point reliability of using $I_{13}$ to derive $N$, their effects on $\sigma^{2}_{I_{13}/I_{0,13}}$ and therefore on the estimated $\sigma^{2}_{N/N_{0}}$ are of more relevance here. \begin{figure} \includegraphics[width=84mm]{tf6.eps} \caption{ Comparison of the $^{13}$CO integrated intensity map with the dust extinction map of Froebrich et al (2007).} \label{fig:t6} \end{figure} To empirically investigate the differences between using dust extinction and $^{13}$CO integrated intensity as a measure of column density, we re-derived $\sigma^{2}_{N/N_{0}}$ using the dust extinction map generated from 2MASS data by Froebrich et al (2007). In Figure~\ref{fig:t6} we compare, on the same coordinate grid, the the dust extinction map with the $^{13}$CO integrated intensity map convolved to the resolution of the extinction map (4 arcminutes). The greyscale limits of each field were chosen to represent the fitted relation between the $^{13}$CO integrated intensity, $I_{13}$, and the dust extinction, $A_{V}$, described below. While the overall spatial distributions of $I_{13}$ and $A_{V}$ are broadly similar, there are detailed differences in places, and column density traced by $A_{V}$ is present on the periphery of the cloud which is not traced by $I_{13}$. The quantitative relation between $I_{13}$ and $A_{V}$ is shown in Figure~\ref{fig:t7}. To these data, we fitted a linear relationship of the form $A_{V} = A_{V,D} + C I_{13}$, where $A_{V,D}$ and $C$ are constants. We use three different regression methods (Isobe et al 1990) and the fitted parameters, $A_{V,D}$ and $C$, are listed in Table~\ref{tab:1}, and the fitted lines are overlayed in Figure~\ref{fig:t7}. While the scatter around these relations is quite large there is only a small number of positions in which significant saturation in $I_{13}$ is obvious. \begin{figure} \includegraphics[width=84mm]{tf7.eps} \caption{ Plot of dust extinction versus $^{13}$CO integrated intensity, $I_{13}$, for the fields in Figure~\ref{fig:t6}. The solid lines are the fitted relations to $A_{V} = A_{V,D} + C I_{13}$ listed in Table~\ref{tab:1}.} \label{fig:t7} \end{figure} Using the measured $A_{V}$ field to calculate $\sigma^{2}_{N/N_{0}}$, under the assumption that $A_{V}$ is proportional to column density, $N$, and accounting for a noise variance of 0.04 (Froebrich et al 2007), we find that $\sigma^{2}_{N/N_{0}} = 0.70$. This is significantly lower than $\sigma^{2}_{N/N_{0}} = 2.25 $ estimated through the $^{13}$CO integrated intensities. There are two contributing factors to the lower value obtained using $A_{V}$. The first is simply that the fields shown in Figure~\ref{fig:t6} are of lower angular resolution than the field shown in Figure~\ref{fig:t1}. A calculation of the normalized column density variance using the lowered resolution $I_{13}$ map results in $\sigma^{2}_{N/N_{0}} = 1.98$, which is lower than that calculated from the higher resolution field, but still a factor of 2.83 greater than that calculated from the $A_{V}$ field at the same angular resolution. (Further discussion of the resolution dependence is given below and in Section~3.3). The second, and dominant, factor contributing to the lower $\sigma^{2}_{N/N_{0}}$ measured from the $A_{V}$ field is the presence of the offset term, $A_{V,D}$ in the $I_{13} - A_{V}$ relations given above. For reference, note that the addition of a constant positive offset to $N$ will raise $N_{0}$ but leave $\sigma^{2}_{N}$ unchanged, thereby lowering $\sigma^{2}_{N/N_{0}}$. The true situation is more complicated that this, since the low column density material is also structured (i.e. contributes variance) -- and it is possible that the column density variance scales with column density (Lada et al 1994). It is questionable whether this material should be included in the column density budget. The excess column density (roughly quantified by $A_{V,D}$) is associated with atomic gas and possibly also diffuse molecular gas ($H_{2}$) with little or no $^{13}$CO. Material in this regime does not contribute to the $^{13}$CO emission, and therefore also not to the mean spectral line profile, from which the Mach number is estimated. If the material is predominantly atomic with a possible contribution from diffuse $H_{2}$, it is likely to be physically warmer than the interior regions of the cloud traced by $^{13}$CO, thereby complicating the assumption of isothermality employed in most of the numerical models {\it and} in our calculation of the Mach number. Similarly, $^{13}$CO emission from the subthermally excited (but also likely physically warmer) envelope regions will contribute to both to $I_{13}$ and to the mean line profile, but at a reduced level in relation to its true column density. In addition, while the ``molecular cloud'' part of the extinction is confined to a small region of around 24~pc extent at a distance of 140~pc, how the ``diffuse'' part of the extinction is generated is rather less well defined, and may include contributions from all regions along the line-of-sight to Taurus (and beyond). Consequently, the extinction zero level is quite uncertain. We argue therefore that the selection of material by $^{13}$CO is in fact beneficial to our aims: it preferentially selects the interior regions of the molecular cloud, to which the assumption of isothermality is likely to apply, and it limits the extinction budget to a spatially-confined region at the distance of the cloud. Note also that material contributing to $I_{13}$ (and therefore $N$, by assumption) contributes in the same proportion to the mean line profile. Inclusion of opacity corrections, using $^{12}$CO data, also potentially cause as many problems as they solve. A spatially uniform opacity factor obviously has no impact on the calculated $\sigma^{2}_{N/N_{0}}$ due to the normalization. In principle, the compression of $I_{13}$ in the high column density regime can be alleviated, but this effect is likely to be small -- particularly since the strongly-saturated column densities account for a small fraction of the data. Goodman et al (2009) discuss numerous problems in the $^{12}$CO-based correction for opacity and excitation in the low column density regime; we also point out here that this is further complicated by the fact that $^{12}$CO and $^{13}$CO trace different material because of different levels of self-shielding and radiative trapping. If opacity corrections to $I_{13}$ are made, then for consistency, detailed (largely impractical) opacity corrections should be made to the line profiles from which the Mach number is calculated, although for this the point-of-diminishing-returns has certainly long since been reached. To investigate the effect of the inclusion of the diffuse component, we calculate $\sigma^{2}_{N/N_{0}}$ from the field $A_{V}^{'} = A_{V} - A_{V,D}$. For the first of the fitted relations in Table~\ref{tab:1} ($A_{V,D} = 0.579$) we find $\sigma^{2}_{N/N_{0}} = 2.73$; from the second ($A_{V,D} = 0.331$) we find $\sigma^{2}_{N/N_{0}} = 1.36$, and from the third, bisector method ($A_{V,D} = 0.462$) we find $\sigma^{2}_{N/N_{0}} = 1.91$. These values may be summarized in a combined measurement, with associated uncertainties, of $\sigma^{2}_{N/N_{0}} = 1.91^{+0.82}_{-0.55}$, which is more compatible with $\sigma^{2}_{N/N_{0}} = 1.98$ calculated from the $^{13}$CO field at the same angular resolution. This is not surprising, as $A_{V}^{'}$ is, to a good approximation, linearly correlated with $I_{13}$, and the value of the coefficient $C$ is irrelevant as we use normalized variances. \begin{table} \caption{Fitted parameters to $A_{V} = A_{V,D} + C I_{13}$} \label{tab:1} \centering \renewcommand{\footnoterule}{} \begin{tabular}{lccc} \hline \hline Regression method & $A_{V,D}$ (mag) & $C$ (mag/(K~km~s$^{-1}$))\\ \hline $A_{V}$ on $I_{13}$ & 0.579 $\pm$ 0.002 & 0.565 $\pm$ 0.003 \\ $I_{13}$ on $A_{V}$ & 0.331 $\pm$ 0.004 & 0.799 $\pm$ 0.004 \\ Bisector & 0.462 $\pm$ 0.003 & 0.676 $\pm$ 0.003 \\ \hline \end{tabular} \end{table} The dominant contribution to the uncertainty therefore comes from the choice made for the appropriate treatment of the diffuse component. We argue that the use of $^{13}$CO, or $A_{V}^{'}$, to calculate $\sigma^{2}_{N/N_{0}}$ is better-motivated, but we cannot resolve this issue further at present. We have noted above that the $\sigma^{2}_{N/N_{0}}$ calculated from $^{13}$CO is, naturally, lower in the reduced resolution field. Ideally, one should use the highest resolution data available from which to calculate $\sigma^{2}_{N/N_{0}}$, and this raises the question of how the $A_{V}$-calculated value of $\sigma^{2}_{N/N_{0}}$ may behave at increased resolution. To investigate this, we calculate the the power spectra of the $^{13}$CO and $A_{V}$ fields of Figure~\ref{fig:t6}, after scaling each to the same global variance of unity (the mean of the field is irrelevant). The angular averages of the power spectra are shown in Figure~\ref{fig:t8}. In these spectra, we have applied ``beam'' corrections, but have not attempted removal of the noise floor. \begin{figure} \includegraphics[width=84mm]{tf8.eps} \caption{Power spectra of the fields in Figure~\ref{fig:t6}. The light histogram is the power spectrum of $^{13}$CO integrated intensity; the heavy histogram is the power spectrum of dust extinction. Both fields were scaled to the same global variance of unity before calculating the power spectra. The power spectra were corrected for the beam pattern but not the noise floor, resulting in an upturn at high wavenumber. The straight and dashed lines are the fits from Figure~\ref{fig:t4}. } \label{fig:t8} \end{figure} It is remarkable that, despite detailed differences between the two maps, the power spectra are almost indistinguishable. The fitted power-laws from Figure~\ref{fig:t4} are overlayed for reference -- detailed correspondance between the two power spectra is notable all the way down to the noise floor(s) near $k \approx 100$. Comparison of the low resolution $^{13}$CO power spectrum to the fitted slope at high wavenumber from Figure~\ref{fig:t1} shows that the noise signature turns on very abruptly, and the power spectrum is very reliable up to this point -- this is a useful benchmark to gauge the equivalence of the two low resolution spectra. Previously, Padoan et al (2006) have reported differences between $^{13}$CO and extinction power spectra in Taurus, which is not seen in our analysis. The origin of this discrepancy may lie in the different extinction maps used by Padoan et al (those of Cambr\'{e}sy 2002), but may also arise from the influence of the effective ``beam'' size that is not corrected for in their power spectra as the resolution is varied. The effective equivalence of the $^{13}$CO and $A_{V}$ power spectra support our suggestion above that it is in the approximately uniform ``diffuse'' component that the principal statistical differences (at least those relevant to our analysis) between $^{13}$CO and $A_{V}$ are manifest. This, in turn, suggests that the $A_{V}$-derived value of $\sigma^{2}_{N/N_{0}}$ that would be obtained at the higher resolution afforded by the $^{13}$CO data will increase in a similar manner to that seen in the $^{13}$CO -- i.e. an increase from 1.98 to 2.25, or a factor of $\sim$~1.14. Applying this to the $A_{V}^{'}$-based measurements, our estimate for $\sigma^{2}_{N/N_{0}}$ at the highest resolution available is $\sigma^{2}_{N/N_{0}} = 2.18^{+0.93}_{-0.63}$. Converting this to the 3D variance using equation~\ref{eqno2} (with $\eta = 1.157$ and $R_{p} = 0.029$) we find that $\sigma^{2}_{\rho/\rho_{0}}$ = 72.1$^{+27.8}_{-18.7}$. Taking into account the measured Mach number, $M = 17.6 \pm 1.8$, and applying an additional 10\% uncertainty on the 3D variance arising from the calculation of $R$, we arrive at a measured $b = 0.48^{+0.15}_{-0.11}$. (For reference, if $\sigma^{2}_{N/N_{0}}$ is calculated from $A_{V}$ without subtraction of the diffuse component, we find $b = 0.32$.) \subsection{The effects of unresolved variance} As we have noted above, the measured variance of a field observed at finite resolution is necessarily a lower limit to the true variance of the field. An obvious question then arises: what about structure (variance) at scales below the best available resolution? If we assume that the observed slope of the power spectrum at high wavenumbers continues to a maximum wavenumber, $k_{c}$, beyond which no further structure is present, we can estimate the amount of variance not included in our calculation (see BFP). It has been suggested that $k_{c}$ may be determined by the sonic scale: turbulent motions are supersonic above this scale and subsonic below it (V\'{a}zquez-Semadeni, Ballesteros-Paredes, \& Klessen 2003; Federrath et al 2009). Taking $\sigma_{v} \propto L^{0.5}$ (Heyer \& Brunt 2004), we estimate the sonic scale in Taurus as $L_{s} = L_{0}/M^{2} \approx$~0.08~pc where $L_{0} \approx$~25~pc is the linear size of the cloud from Figure~1, and $M = 17.6$ is the Mach number from above. This is comparable to the spatial resolution of the data (0.03~pc), which suggests that our measurement of $\sigma^{2}_{\rho/\rho_{0}}$ does not significantly underestimate the true value if structure is suppressed below the sonic scale. Taking $k_{c} \longrightarrow \infty$ on the other hand would result in a factor of $\sim$~2 underestimation of $\sigma^{2}_{\rho/\rho_{0}}$ and therefore a factor of $\sim$~$\sqrt{2}$ underestimation of $b$. Our value of $b$ must therefore be considered as a lower limit: the power spectrum (Figure~\ref{fig:t4}) is not well measured near the estimated sonic scale ($k_{s} \sim 350$), and further high resolution investigations are needed to resolve this issue. \section{Summary} We have provided an estimate of the parameter $b$ in the proposed $\sigma^{2}_{\rho/\rho_{0}} = b^{2}M^{2}$ relation for supersonic turbulence in isothermal gas, using $^{13}$CO observations of the Taurus molecular cloud. Using $^{13}$CO and 2MASS extinction data, we find $b = 0.48^{+0.15}_{-0.11}$, which is consistent with the value originally proposed by Padoan et al (1997) and characteristic of turbulent forcing which includes a mixture of both solenoidal and compressive modes (Federrath et al 2009). Our value of $b$ is a lower limit if significant structure exists below the resolution of our observations (effectively, below the sonic scale). If diffuse material is included in the column density budget then we find a somewhat lower value of $b = 0.32$, although in this case there are some questions over the assumption of isothermality in the Mach number calculation. Our most conservative statement is therefore that $b$ is constrained to lie in the range $0.3 \lesssim b \lesssim 0.8$, which is comparable to the range of current numerical estimates. However, the $\sigma^{2}_{\rho/\rho_{0}} - M^{2}$ relation has been tested to only relatively low Mach numbers ($M \lesssim 7$) in comparison to that in Taurus, so further numerical exploration of the high Mach number regime should be carried out. In principle, gravitational amplification of turbulently-generated density enhancements could increase $\sigma^{2}_{\rho/\rho_{0}}$ at roughly constant Mach number, with gravity possibly acting analogously to compressive forcing. Numerical investigation of the role of gravity in the $\sigma^{2}_{\rho/\rho_{0}} - M^{2}$ would be worthwhile. Further analysis of a larger sample of molecular clouds is needed to investigate the linearity of the $\sigma^{2}_{\rho/\rho_{0}}$~--~$M^{2}$ relation and possible variations in $b$. As our main sources of uncertainty arise because of questions over how to treat the diffuse (likely atomic) regime and how to account for unresolved density variance, further progress on improving the accuracy of measuring $b$ ultimately must involve answering what is meant by ``a cloud'' (Ballesteros-Paredes, V\'{a}zquez-Semadeni, \& Scalo 1999) and down to what spatial scale is significant structure likely to be present? \begin{acknowledgements} I would like to thank Dan Price and Christoph Federrath for excellent encouragement, advice, and scientific insight. This work was supported by STFC Grant ST/F003277/1 to the University of Exeter, Marie Curie Re-Integration Grant MIRG-46555, and NSF grant AST 0838222 to the Five College Radio Astronomy Observatory. CB is supported by an RCUK fellowship at the University of Exeter, UK. The Five College Radio Astronomy Observatory was supported by NSF grant AST 0838222. This publication makes use of data products from 2MASS, which is a joint project of the University of Massachusetts and the Infrared Processing and Analysis Center/California Institute of Technology, funded by the National Aeronautics and Space Administration and the National Science \end{acknowledgements}
\section{Introduction} \label{sec:intro} Let $E$ be an elliptic curve defined over a number field $K$. It is known that $E(K)$ is a finitely generated abelian group. If we manage to find $E(K)/nE(K)$ for any integer $n\ge 2$, then a finite amount of computation will determine $E(K)$. The method of $n$-descent is one of the methods which enable us to get a bound on $E(K)/nE(K),\;n\ge2.$ Indeed, the $n$-descent computes the $n$-Selmer group of $E$ which contains $E(K)/nE(K)$ as a subgroup. The difference between the two groups is the $n$-torsion of the Tate-Shafarevich group. An element of the $n$-Selmer group can be represented as a geometric object, namely as an everywhere locally soluble curve defined by a {\em genus one equation of degree $n$} given as follows: If $n=1,$ a Weierstrass equation \begin{equation} y^2 + a_1 x y + a_3 y = x^3 + a_2 x^2 + a_4 x + a_6.\end{equation} Two genus one equations of degree $1$ with coefficients in a Dedekind domain $R$ are {\em $R$-equivalent} if they are related by the substitutions: $x' = u^2x + r$ and $y' = u^3y + su^2x + t,$ where $r,s,t\in R,\;u\in R^*.$ The group of transformations $[u;r,s,t]$ is called $\mathcal{G}_1(R)$. We set $\det([u;r,s,t])=u^{-1}.$ If $n=2,$ a (generalised) binary quartic \begin{equation}y^2 + (\alpha_0 x^2 + \alpha_1 xz + \alpha_2z^2) y = a x^4 + b x^3z + c x^2z^2 + d xz^3 + ez^4.\end{equation}Two genus one equations of degree $2$ with coefficients in $R$ are {\em $R$-equivalent} if they are related by the substitutions: $x'=m_{11}x+m_{21}z,\;z'=m_{12}x+m_{22}z$ and $y'=\mu^{-1}y+r_0x^2+r_1xz+r_2z^2,$ where $\mu\in R^*,\; r_i\in R$ and $M=(m_{ij})\in \operatorname{GL}_2(R)$. The group of transformations $[\mu,(r_i),M]$ is called $\mathcal{G}_2(R)$. We set $\det([\mu,(r_i),M])=\mu\det M.$ If $n=3,$ a ternary cubic \begin{equation}F(x,y,z)=a x^3 + b y^3 + c z^3 + a_2x^2 y + a_3x^2 z + b_1y^2x+ b_3 y^2z + c_1z^2x + c_2 z^2y + m x y z=0.\end{equation} Two genus one equations of degree $3$ with coefficients in $R$ are {\em $R$-equivalent} if they are related by multiplying by $\mu\in R^*$, then substituting $x'=m_{11}x+m_{21}y+m_{31}z,\;y'=m_{12}x+m_{22}y+m_{32}z$ and $z'=m_{13}x+m_{23}y+m_{33}z$, where $M=(m_{ij})\in \operatorname{GL}_3(R).$ The group of transformations $[\mu, M]$ is called $\mathcal{G}_3(R)$. Set $\det([\mu,M])=\mu\det M.$ If $n=4$, then $C$ is described by $2$ quadratic forms in $4$ variables. Two genus one equations of degree $4$ with coefficients in $R$ are {\em $R$-equivalent} if they are related by the substitutions: $F'_i=m_{i1}F_1+m_{i2}F_2$ for $M=(m_{ij})\in\operatorname{GL}_2(R),$ and then $x'_j=\sum_{i=1}^4n_{ij}x_i$ for $N=(n_{ij})\in\operatorname{GL}_4(R).$ The group of transformations $[M,N]$ is called $\mathcal{G}_4(R)$. Set $\det([M,N])=\det M\det N.$ For $n\le4$, we associate invariants $c_{4,\phi}$, $c_{6,\phi}$ and {\em discriminant} $\Delta_{\phi}$ to a genus one equation $\phi$ of degree $n$ where $\Delta_{\phi}=(c_{4,\phi}^3-c_{6,\phi}^2)/1728.$ Moreover, $\phi$ defines a smooth curve of genus one if and only if $\Delta_{\phi}\ne 0.$ The invariants $c_{4,\phi},c_{6,\phi}$ and $\Delta_{\phi}$ are of weights $r=4,6$ and $12$ respectively, in other words if $F\in\{c_{4,\phi},c_{6,\phi},\Delta_{\phi}\}$, then $F\circ g= (\det g)^rF$ for all $g\in\mathcal{G}_n$. For more details on these genus one equations and their classical invariants see \cite{AKMMMP}. We scale the above invariants according to \cite{FiInvariants} and \cite{FiStCr}. For using $n$-descent to search for points on an elliptic curve $E,$ we need the coefficients of the genus one equations described above to be small. That can be achieved by {\em Reduction} and {\em Minimisation}. By reducing genus one equations, we mean reducing the size of the coefficients by a unimodular linear change of coordinates, which does not change the invariants. To minimise genus one equations, we need to make the associated invariants smaller. For references see \cite{swinnerton} and \cite{CremonaStollMini} for $n=2,$ \cite{Fiminimise} for $n=3,$ and \cite{WomackThesis} for $n=4.$ An algorithmic approach to the minimisation problem can be found in \cite{FiStCr}. In this paper we will be concerned with the minimisation question. We work throughout over a perfect Henselian discrete valuation field $K$ with algebraic closure $\overline{K}$ and ring of integers ${\mathcal{O}_K}$. We fix a uniformiser $t$, a normalisation $\nu$ and write $k={\mathcal{O}_K}/t{\mathcal{O}_K}$. Set $S=\operatorname{Spec}{\mathcal{O}_K}$. \begin{Definition}\label{def:integral-minimal} A genus one equation $\phi$ of degree $n$, $n\le4$, with $\Delta_{\phi}\ne 0$ is \begin{myitemize} \item[(a)] {\em integral} if the defining polynomials have coefficients in ${\mathcal{O}_K}.$ \item[(b)] {\em minimal} if it is integral and $\nu(\Delta_{\phi})$ is minimal among all the valuations of the discriminants of the integral genus one equations $K$-equivalent to $\phi.$ \end{myitemize} \end{Definition} It has been shown in \cite{FiStCr} and \cite{SadekMinimal} that if $C$ is a soluble smooth curve defined by a genus one equation $\phi$ of degree $n$, then the minimal discriminant associated to $\phi$ has the same valuation as the minimal discriminant associated to the Jacobian elliptic curve. The $S$-scheme ${\mathcal C}$ defined by an integral genus one equation $\phi:y^2+g(x,z)y=f(x,z)$ of degree $2$ is the scheme obtained by glueing $ \{ y^2+g(x,1)y = f(x,1) \} \subset {\mathbb A}_S^2 $ and $ \{ v^2+g(1,u)v = f(1,u) \} \subset {\mathbb A}_S^2 $ via $x=1/u$ and $y=x^2v$. It comes with a natural morphism ${\mathcal C} \to {\mathbb P}^1_S$ given on these affine pieces by $(x,y) \mapsto (x:1)$ and $(u,v) \mapsto (1:u)$. The $S$-scheme defined by an integral genus one equation $\phi$ of degree $n$, $n=1$ or $n\ge3$, is the subscheme ${\mathcal C} \subset {\mathbb P}^{m}_S$ defined by $\phi$, where $m=2$ when $n=1$, and $m=n-1$ when $n\ge3$. In \cite{SadekMinimal}, we gave the following criterion for minimality. \begin{Theorem} \label{thm:minimality} Let $\phi$ be an integral genus one equation of degree $n,\;n\le4$. Assume moreover that $\phi$ defines a normal $S$-scheme ${\mathcal C}$, and that ${\mathcal C}_K$ is smooth with ${\mathcal C}_K(K)\ne\emptyset.$ Then $\phi$ is minimal if and only if the minimal desingularisation of ${\mathcal C}$ is isomorphic to the minimal proper regular model of the Jacobian of ${\mathcal C}_K$. \end{Theorem} Unlike elliptic curves, the minimisations of integral genus one equations of degree $n$ are not unique under the action of the group $\mathcal{G}_n({\mathcal{O}_K})$. In this paper we study the non-uniqueness of minimisation. In order to achieve this goal we generalise the scheme-theoretic terminology of minimal Weierstrass models for elliptic curves to {\em minimal degree-$n$-models} for genus one curves. \begin{Definition} \label{def:Weierstrass model} Let $\phi$ be a genus one equation of degree $n$. Let $C\to {\mathbb P}_K^{m}$ be the genus one curve over $K$ defined by $\phi,$ where $m=2$ when $n=1$ and $m=n-1$ otherwise. A {\em (minimal) degree-$n$-model} for $C\to{\mathbb P}^m_K$ is a pair $({\mathcal C},\alpha)$ where ${\mathcal C}\subset {\mathbb P}^m_S$ is an $S$-scheme defined by a (minimal) integral genus one equation of degree $n$, and $\alpha:{\mathcal C}_K \cong C$ is an isomorphism defined by a $K$-equivalence of genus one equations of degree $n,$ i.e., $\alpha$ is defined by an element of $\mathcal{G}_n(K)$. If there is no confusion, then we will omit mentioning $\alpha$ in $({\mathcal C},\alpha)$ and write ${\mathcal C}$ instead. {\em An isomorphism} $\beta:({\mathcal C}_1,\alpha_1) \cong ({\mathcal C}_2,\alpha_2)$ of degree-$n$-models is an isomorphism $\beta:{\mathcal C}_1 \cong {\mathcal C}_2$ of $S$-schemes defined by an ${\mathcal{O}_K}$-equivalence of genus one equations of degree $n,$ i.e., $\beta$ is defined by an element of $\mathcal{G}_n({\mathcal{O}_K}),$ with $\beta_K = \alpha_2^{-1} \alpha_1$. \end{Definition} Now we show why we insist on remembering the isomorphism $\alpha$ in our definition of a degree-$n$-model. In the case $C(K)\ne\emptyset$, we pick $P\in C(K)$. Then we identify $(C,P)$ with the Jacobian elliptic curve $E$. The automorphism group $\operatorname{Aut}(C)$ of $C$ fits in an exact sequence $$0\to E\to\operatorname{Aut}(C)\to\operatorname{Aut}(E,0)\to 0.$$ The first map is $Q\mapsto\tau_Q$, where $\tau_Q$ is the translation by $Q$. Let $H$ be a hyperplane section on $C$. We are interested in automorphisms $\lambda$ of $C$ such that $\lambda^*H\sim H$. But $\tau_Q^*H\sim H$ if and only if $nQ=0$. Hence the elements of $\operatorname{PGL}_n(K)$ that act fixed-point-free on $C$ correspond precisely to $E[n](K)$. Therefore, we can have more than one $K$-isomorphism between ${\mathcal C}_K$ and $C$ defined by elements in $\mathcal{G}_n(K)$. Liu proved that there is a bijection between minimal degree-$2$-models for $C\to{\mathbb P}^1_K$, up to isomorphism, and the multiplicity-$1$ irreducible components in the special fiber of the quotient of the minimal proper regular model by a hyperelliptic involution, see (\cite{LiuModeles}, Corollaire 5). In \S \ref{sec:computing in E min}, we perform explicit computations on the minimal proper regular model of an elliptic curve. In \S \ref{sec:counting minimal degree n models}, these computations are used to count minimal degree-$n$-models for a soluble smooth genus one curve $C\to{\mathbb P}^{n-1}_K$, $n\in\{2,3,4\}$, up to isomorphism. We relate the number of minimal degree-$n$-models for $C\to{\mathbb P}_{K}^{n-1}$, up to isomorphism, to the cardinality of a finite set which depends only on the Kodaira Symbol of the Jacobian of $C$ and on the divisor defining the morphism $C\to{\mathbb P}^{n-1}_K$, see Theorem \ref{thm:counting models}. Then, using strong approximation, we prove that the number of minimal global degree-$n$-models for $C\to{\mathbb P}^{n-1}_K$ over a number field $K$ of class number 1 is the product of minimal degree-$n$-models for $C\to{\mathbb P}^{n-1}_{K_{\nu}}$, where $K_{\nu}$ is the completion of $K$ at a finite place $\nu$ and $\nu$ runs over a finite set of bad primes of the Jacobian of $C$. We have to mention that over a Henselian discrete valuation field, our counting results work for any residue characteristic if the Jacobian has multiplicative reduction, while for additive reduction we assume $\operatorname{char} k\ne 2$ when $n=2$, and $\operatorname{char} k\ne 2,3$ when $n=3,4$. It seems to us that these conditions on the residue characteristic for the additive reduction case are not necessary, but we have not been able to eliminate them. \section{Isomorphisms of degree-$n$-models} \label{sec:isomorphisms of degree n models} Let $C$ be a smooth genus one curve over $K$. Assume that $C(K)\ne \emptyset$. Let $E$ be the Jacobian of $C$ with minimal proper regular model $E^{min}.$ We define an {\em $S$-model} for $C$ to be an integral, projective, flat, normal $S$-scheme $f:X\to S$ of dimension 2 such that its generic fiber ${\mathcal C}_K$ is isomorphic to $C$. The special fiber of ${\mathcal C}$ will be called ${\mathcal C}_k$. Let $P\in C(K).$ Fix an isomorphism $\beta:C\to E$ such that $\beta(P)=0_E.$ The isomorphism $\beta$ identifies $(C,P)$ with $(E,0_E).$ We observe that $\beta$ extends to an isomorphism between the minimal proper regular model of $C$ and $E^{min}.$ In \cite{SadekMinimal} we proved that a minimal degree-$n$-model ${\mathcal C}$ for a smooth genus one curve $C\to{\mathbb P}^{n-1}_K$ is normal, and hence is an $S$-model for $C$. Moreover, we proved that the minimal desingularisation of ${\mathcal C}$ is isomorphic to $E^{min}$, see Theorem \ref{thm:minimality}. Furthermore, we have $${\mathcal C}=\operatorname{Proj}(\bigoplus_{m=0}^{\infty}H^0(E^{min},\mathcal{O}_{E^{min}}(mD))),$$ where $D$ is a divisor on $E^{min}$ which intersects the irreducible components of the strict transform of ${\mathcal C}_k$ in $E^{min}_k$ and intersects no other components in $E^{min}_k$. The divisor $D|_E$ is linearly equivalent to the hyperplane section divisor defining $C$. Let $\Gamma$ be an irreducible component of ${\mathcal C}_k.$ By the {\em type} of $\Gamma$ we mean the ordered pair $(\operatorname{mult}_k(\Gamma),\deg_k(\Gamma))$, where $\operatorname{mult}_k(\Gamma)$ and $\deg_k(\Gamma)$ are the multiplicity and degree of $\Gamma$ respectively. \begin{Theorem} \label{thm:injectivity2} Let $C$ be a smooth genus one curve with $C(K)\ne\emptyset$. Let $({\mathcal C}_1,\alpha_1)$ and $({\mathcal C}_2,\alpha_2)$ be two minimal degree-$n$-models for $C\to{\mathbb P}^{n-1}_K$, $n=2,3,4$. Set $\alpha=\alpha_2^{-1}\alpha_1$ and denote its extension ${\mathcal C}_1\dashrightarrow{\mathcal C}_2$ by $\tilde{\alpha}.$ Then the following statements are equivalent. \begin{myitemize} \item[(i)] $({\mathcal C}_1,\alpha_1)$ and $({\mathcal C}_2,\alpha_2)$ are isomorphic as degree-$n$-models for $C\to{\mathbb P}^{n-1}_K.$ \item[(ii)] For every irreducible component $\Gamma$ of $({\mathcal C}_2)_k,$ $\tilde{\alpha}^*\Gamma$ is an irreducible component of $({\mathcal C}_1)_k$ with the same type as $\Gamma$. \end{myitemize} \end{Theorem} \begin{Proof} $(i)$ implies $(ii)$: Let $\alpha:=\alpha_2^{-1}\alpha_1:({\mathcal C}_1)_K\to({\mathcal C}_2)_K.$ By the definition of isomorphic degree-$n$-models, the map $\alpha$ extends to an $S$-isomorphism $\tilde{\alpha}:{\mathcal C}_1\to{\mathcal C}_2$ which is defined by an element in $\mathcal{G}_n({\mathcal{O}_K}).$ Therefore, if $\Gamma$ is an irreducible component of $({\mathcal C}_2)_k,$ then $\tilde{\alpha}^*\Gamma$ is an irreducible component of $({\mathcal C}_1)_k$ with the same type as $\Gamma.$ $(ii)\Rightarrow(i)$: We want to show that $\tilde{\alpha}$ is defined by an element in $\mathcal{G}_n({\mathcal{O}_K}).$ Since the minimal proper regular models of $({\mathcal C}_1)_K$ and $({\mathcal C}_2)_K$ are identified with $E^{min}$, statement $(ii)$ implies that both $({\mathcal C}_1)_k$ and $({\mathcal C}_2)_k$ have the same strict transform in $E^{min}_k.$ Let $D_i$ be a defining divisor of ${\mathcal C}_i$ as a contraction in $E^{min},$ i.e., $${\mathcal C}_i=\operatorname{Proj}(\bigoplus_{m\ge0}H^0(E^{min},\mathcal{O}_{E^{min}}(m D_i))).$$ Set $\mathcal{L}_i=\mathcal{O}_{E^{min}}(D_i)$ and $\mathcal{L}_{i,k}=\mathcal{L}_i|_{E^{min}_k}.$ Let $\Gamma$ be an irreducible component of $({\mathcal C}_2)_k.$ Consider the strict transform $\tilde{\Gamma}$ of the irreducible components $\Gamma$ and $\tilde{\alpha}^*\Gamma$ in $E^{min}_k.$ Since $\Gamma$ and $\tilde{\alpha}^*\Gamma$ have the same type, it follows that $\deg_k \mathcal{L}_{1,k}|_{\tilde{\Gamma}}=\deg_k \mathcal{L}_{2,k}|_{\tilde{\Gamma}}.$ For any irreducible component $\Lambda$ which is not a strict transform of a component of $({\mathcal C}_i)_k,$ we have $\deg_k \mathcal{L}_{i,k}|_{\Lambda}=0.$ Now since each irreducible component of $E^{min}_k$ is isomorphic to ${\mathbb P}^1_k$, we have $D_1|_{E^{min}_k}$ is linearly equivalent to $D_2|_{E^{min}_k}$ as they have the same degree on every irreducible component of $E^{min}_k$. It follows that $\mathcal{L}_{1,k} \cong \mathcal{L}_{2,k}.$ We are given that $C(K)\ne\emptyset$, $\mathcal{L}_1|_{({\mathcal C}_1)_K} \cong \mathcal{L}_2|_{({\mathcal C}_2)_K}$ and we established the isomorphism $\mathcal{L}_{1,k} \cong \mathcal{L}_{2,k}.$ These conditions imply that $\mathcal{L}_1 \cong \mathcal{L}_2,$ see (\cite{Liubook}, Exercise 9.1.13 (b)). Therefore, $H^0(E^{min},\mathcal{L}_1)$ and $H^0(E^{min},\mathcal{L}_2)$ are isomorphic as ${\mathcal{O}_K}$-modules, and $\tilde{\alpha}$ is a change of basis of a free ${\mathcal{O}_K}$-module of rank $n$. Hence $\tilde{\alpha}$ is defined by an element in $\mathcal{G}_n({\mathcal{O}_K}).$ \end{Proof} \begin{Corollary} \label{cor:unique model when IO or I1} Let $C$ be a smooth genus one curve. Assume that $C(K)\ne\emptyset$. Assume moreover that the Jacobian $E$ of $C$ has either reduction types ${\rm I_0}$ or ${\rm I_1}$. Then there is a unique minimal degree-$n$-model for $C\to{\mathbb P}^{n-1}_K$. \end{Corollary} \section{Computing in $E^{min}$} \label{sec:computing in E min} The following lemma will play an essential rule in the way we construct divisors on minimal proper regular models. \begin{Proposition} \label{prop:auxiliary divisors} Let $C/K$ be a smooth genus one curve with $C(K)\ne\emptyset$. Let $E$ be the Jacobian of $C$ with minimal proper regular model $E^{min}$. Fix a closed point $x\in E^{min}_k$ such that $x$ lies on one and only one irreducible component $\Gamma$ of $E^{min}_k$, of multiplicity $r\ge 1$. Then there exists a point $P\in C$ such that $\overline{\{P\}}\cap E^{min}_k=\{x\}$ and $[K(P):K]=r,$ where $\overline{\{P\}}$ is the Zariski closure of $\{P\}$ in $E^{min}$. \end{Proposition} \begin{Proof} See (\cite{Liubook}, Exercise 9.2.11 (c)). \end{Proof} It is easy to check that if $L$ is a totally ramified extension of $K$ with $[L:K]=m,\;m=2,3,4,$ then the maximal unramified extension $L^{un}$ of $L$ is a Galois extension of the maximal unramified extension $K^{un}$ of $K$ with $L^{un}=K^{un}(\sqrt[m]{t})$. Let $E$ be an elliptic curve over $K,$ with minimal proper regular model $E^{min}.$ Let $E^0(K)$ be the group of rational points of $E$ with non-singular reduction. In this section we define a map $\delta_m:\Phi_K^m(E)\to \Phi_K(E),$ where $\Phi_K^m(E)$ is the set of multiplicity-$m$ irreducible components of $E^{min}_k,$ and $\Phi_K(E):=\Phi_K^1(E)$ is the group of components $E(K)/E^0(K).$ In the remainder of this section we assume that the residue field $k$ is algebraically closed and hence every finite extension of $K$ is a totally ramified Galois extension, and the reduction type of $E$ is split. \subsection{The component group} \label{sec:the components group} The component group $\Phi_K(E)=E(K)/E^0(K)$ is finite. More precisely, if $E$ has multiplicative reduction, then $E(K)/E^0(K)$ is a cyclic group of order $\nu(\Delta);$ otherwise, $E(K)/E^0(K)$ has order $1,2,3,$ or $4$, see (\cite{Sil2}, Chapter IV, Corollary 9.2). If $E$ has reduction $I_n,\;n\ge0,$ then $E^{min}_{k}$ consists of an $n$-gon. There exists an isomorphism $\delta_1:\Phi_{K}(E) \cong \mathbb{Z}/n\mathbb{Z}$ such that if we number the irreducible components in $\Phi_K(E)$ consecutively from $0$ to $n-1$, then the image of the $i$th component in $\Phi_{K}(E)$ is $i\in{\mathbb Z}/n{\mathbb Z}$. If $E$ has additive reduction, then we fix an isomorphism $\delta_1:\Phi_{K}(E) \cong \mathbb{Z}/2\mathbb{Z}\times\mathbb{Z}/2\mathbb{Z}$ when $E$ has reduction of type ${\rm I}_{2m}^*,\;m\ge0,$ and $\delta_1:\Phi_K(E) \cong \mathbb{Z}/n\mathbb{Z}$ for some $n\in\{1,2,3,4\}$ for the other additive reduction types. From now on we will not distinguish between $\Phi_K(E)$ and its isomorphic image under $\delta_1$. We note that if $E$ has one of the reduction types ${\rm I}_n,n\ge0,{\rm II},{\rm III},$ or ${\rm IV},$ then $E^{min}_k$ consists only of multiplicity-$1$ components, hence $\Phi_K^m(E)=\emptyset$ when $m\ge2$. We define the map $\delta_m:\Phi_K^m(E)\to\Phi_K(E),\;m\ge2,$ as follows: Every irreducible component in $\Phi_K^m(E)$ is isomorphic to ${\mathbb P}_k^1$. Let $x$ be a $k$-point of $\Theta\in\Phi_K^m(E)$ which lies on no other component. Let $P\in E(\overline{K})$ be a point which reduces to $x$ such that $[K(P):K]=m,$ see Proposition \ref{prop:auxiliary divisors}. Let $\sigma$ be a generator of $\operatorname{Gal}(K(P)/K)$. The sum of the Galois orbit $P+\ldots+P^{\sigma^{m-1}}$ of $P$ is a point in $E(K).$ We set $\delta_m(\Theta)$ to be the image of this sum in $\Phi_K(E)=E(K)/E^0(K).$ It will be clear from the description of the map $\delta_m$ given below that $\delta_m(\Theta)$ does not depend on the choice of $x$ nor on the choice of $P.$ Since $K(P)/K$ is a totally ramified extension, the Galois group $\operatorname{Gal}(K(P)/K)$ is the inertia group of $K(P)/K.$ In other words, $\operatorname{Gal}(K(P)/K)$ fixes every irreducible component in $E^{min}_k.$ Hence if $P\in E(\overline{K})$ lies above an irreducible component $\Gamma$ of $E^{min}_k$, then every point in the Galois orbit of $P$ lies above $\Gamma$ as well. \subsection{Reduction type ${\rm I}_n^*,\;n\ge0$} \label{subsec:In*} Assume that $E/K$ has reduction of type ${\rm I}_n^*,\;n\ge0.$ The special fiber $E^{min}_k$ contains a sequence of $(n+1)$ multiplicity-$2$ components and no components of higher multiplicities. Tate's algorithm, see (\cite{Sil2}, Chapter IV, \S9), can be used to write down explicit equations for the components in $\Phi_K^2(E)$, hence we can determine conditions for a point in $E$ defined over $K(\sqrt{t})$ to lie above one of these multiplicity-$2$ components, and compute the sum of the Galois orbit of this point. We will write $a_{i,r}$ for $t^{-r}a_i,$ and $x_r,y_r$ for $t^{-r}x,t^{-r}y$ respectively. The proof of Tate's algorithm shows that if $E$ has additive reduction of one of the types ${\rm I}_n^*,\;n\ge0,\;{\rm IV}^*,\;{\rm III}^*$ or ${\rm II}^*$, then we can assume that there exists a minimal Weierstrass equation of the form $$y^2z+a_1xyz+a_3yz^2=x^3+a_2x^2z+a_4xz^2+a_6z^3,\;a_i\in{\mathcal{O}_K},$$ for $E/K,$ such that $t\mid a_1,a_2,t^2\mid a_3,a_4$ and $t^3\mid a_6.$ Moreover, the identity component is given by $\Gamma_0:z=0$ and is attached to a multiplicity-$2$ component $V_{-1}:y_1^2=0$. If $E$ has reduction of type ${\rm I}_n^*,\;n\ge0,$ then the non-identity multiplicity-$1$ component attached to $V_{-1}$ is $\Gamma:x_1+\tilde{a}_{2,1}=0$. The other multiplicity-$2$ components of $E^{min}$ are given by \begin{displaymath} V_l: \left\{ \begin{array}{ll} y_u^2+\tilde{a}_{3,u}y_u-\tilde{a}_{6,2u}=0 & \textrm{ if } l=2u-3\textrm{ is odd,}\\ \tilde{a}_{2,1}x_u^2+\tilde{a}_{4,u+1}x_u+\tilde{a}_{6,2u+1}=0& \textrm{ if }l=2u-2\textrm{ is even.} \end{array} \right. \end{displaymath} In addition, $V_l$ consists of two distinct lines precisely when $l=n=\nu(\Delta)-6.$ The special fiber $E^{min}_k$ is as in the following figure. \\ \setlength{\unitlength}{0.6cm}\linethickness{.3mm} \small \begin{picture}(18,5) \put(5,2){\line(1,0){6}}\put(8,2.2){$V_{-1}$} \put(6,1.5){\line(0,1){3}}\put(5.5,3){$1$} \put(7,1.5){\line(0,1){3}}\put(7.1,3){$1$} \put(10,1.5){\line(0,1){2.5}}\put(9.2,2.7){$V_0$} \put(9.8,3.5){$------$} \put(13,1.5){\line(0,1){2.5}}\put(13.2,2.7){$V_{n-2}$} \put(17,1.5){\line(0,1){3}}\put(17.2,3){1} \put(16,1.5){\line(0,1){3}}\put(15.5,3){1} \put(12,2){\line(1,0){6}}\put(14.6,2.2){$V_{n-1}$} \end{picture}\\ Let $K_2=K(\sqrt{t})$ be the unique quadratic tame Galois extension of $K.$ A point lying above a $k$-point on $V_l,$ where $l=2u-2$, and on no other component is a point in $ E(K_2)$ of the form $(\alpha t^{u+1}+\beta t^{u+1/2},y),$ where $y\in K_2,\;t^{u+1}\mid y$, $\alpha\in{\mathcal{O}_K}$ and $\beta\in \mathcal{O}_K^*$. We have $\beta\in \mathcal{O}^*_K,$ since otherwise this point would reduce to a point on $V_{l+1}.$ Similarly, a point lying above a $k$-point on $V_l,$ where $l=2u-3$, and on no other component is a point in $ E(K_2)$ of the form $(x,\alpha t^{u+1}+\beta t^{u+1/2}),$ where $x\in K_2,\;t^u\mid x$, $\alpha\in{\mathcal{O}_K}$ and $\beta\in \mathcal{O}_K^*$. We recall the addition formula on elliptic curves. Let $P_1,P_2\in E(\overline{K}).$ If $P_1\ne\pm P_2,$ then $$x(P_1+P_2)=\lambda^2+a_1\lambda-a_2-x(P_1)-x(P_2),\textrm{ and, } y(P_1+P_2)=-(\lambda+a_1) x(P_1+P_2)-\mu-a_3,$$ where $$\lambda=\frac{y(P_2)-y(P_1)}{x(P_2)-x(P_1)},\;\mu=\frac{y(P_1)x(P_2)-y(P_2)x(P_1)}{x(P_2)-x(P_1)}.$$ \begin{Lemma} \label{lem:y2=0, x3=0} Assume $E$ has one of the reduction types ${\rm I}_n^*,\;n\ge0,\;{\rm IV}^*,\;{\rm III}^*,$ or ${\rm II}^*$. Let $K_2=K(\sqrt{t})$ with $\operatorname{Gal}(K_2/K)=\langle\sigma\rangle$. Then a point $P\in E(K_2)$ lying above the component $y_1^2=0$ satisfies $P+P^{\sigma}\in E^0(K)$. \end{Lemma} \begin{Proof} If $P^{\sigma}=-P,$ then $P+P^{\sigma}=0\in E^0(K)$ and we are done. So, assume $x(P)\not\in K.$ Now $P=(\alpha't+\beta't^{3/2},\alpha t^{2}+\beta t^{3/2})$, where $\alpha',\beta'\in {\mathcal{O}_K}$, $\alpha\in{\mathcal{O}_K}$ and $\beta\in \mathcal{O}_K^*.$ In the addition formula given above, $\lambda=\beta/\beta'\in K.$ Since $\nu(\beta')\ge 0,$ it follows that $\nu(x(P+P^{\sigma}))\le0$ because $t\mid a_1,a_2$. Hence the reduction of $P+P^{\sigma}$ is not a singular point, i.e., $P+P^{\sigma}\in E^0(K).$ \end{Proof} \begin{Proposition} \label{prop:sum of points In*} Assume that $E/K$ has reduction type ${\rm I}_n^*,\;n\ge0.$ Let $K_2=K(\sqrt{t})$ with $\operatorname{Gal}(K_2/K)=\langle\sigma\rangle.$ \begin{myitemize} \item[(i)] The multiplicity-$1$ component $\Gamma:x_1+\tilde{a}_{2,1}=0$ is of order $2$ in $\Phi_K(E)$. \item[(ii)] Let $P\in E(K_2)$ be a point lying above $V_l$ where $l=2u-3$. Then $P+P^\sigma\in E^0(K).$ \item[(iii)] Let $P\in E(K_2)$ be a point lying above $V_l$ where $l=2u-2$. Then $P+P^\sigma$ reduces to a point on $\Gamma.$ \end{myitemize} \end{Proposition} \begin{Proof} $(i)$ If $P$ lies above $\Gamma:x_1+\tilde{a}_{2,1}=0,$ then $-P$ lies above $\Gamma$ as well. It follows that the inverse of $\Gamma$ when considered as an element of $\Phi_K(E)$ is itself. $(ii)$ If $P^{\sigma}=-P,$ then $P+P^{\sigma}=0\in E^0(K)$ and we are done. So, assume that $x(P)\not\in K$. We can assume that $P=(\alpha't^{u}+\beta't^{u+1/2},\alpha t^{u+1}+\beta t^{u+1/2})$, where $\alpha,\beta\in {\mathcal{O}_K}$ with $\nu(\beta)=0$ and $\alpha',\beta'\in {\mathcal{O}_K}$. We have $\lambda=\beta/\beta'$, hence $\nu(\lambda)\le 0$. Thus $\nu(x(P+P^{\sigma}))\le 0,$ and $P+P^{\sigma}\in E^0(K).$ $(iii)$ We can assume that $P=(\alpha t^{u+1}+\beta t^{u+1/2},y)$, where $y\in K_2,\;t^{u+1}\mid y$ and $\alpha,\beta\in {\mathcal{O}_K}$ with $\nu(\beta)= 0.$ Therefore, we have $\nu(\lambda)>0$ where $\lambda:=(y(P)-y(P^{\sigma}))/(x(P)-x(P^{\sigma})).$ Following the addition formula we have $x(P+P^{\sigma})=\lambda^2+a_1\lambda-a_2-x(P)-x(P^{\sigma}).$ Dividing by $t$ and using that $t\mid a_1,a_2$, we get that $x_1(P+P^{\sigma})=-\tilde{a}_{2,1}$ mod $t$. \end{Proof} In Proposition \ref{prop:sum of points In*}, since $\Gamma:x_1+\tilde{a}_{2,1}=0$ has order 2, we have $\delta_1(\Gamma)=2\in\Phi_K(E) \cong \mathbb{Z}/4\mathbb{Z},$ when $n$ is odd. When $n$ is even, we know that $\delta_1:\Phi_K(E) \cong \mathbb{Z}/2\mathbb{Z}\times \mathbb{Z}/2\mathbb{Z},$ therefore every non-identity irreducible component has order $2$. From now on, we will fix $\delta_1$ such that $\delta_1(\Gamma)=(1,1).$ \begin{Corollary} \label{cor:sum In*} Assume $E/K$ has reduction type ${\rm I}_n^*,\;n\ge0.$ Let $\Phi_K^2(E)=\{V_{-1},V_0,\ldots,V_{n-1}\}$ be as above. Then $\delta_2:\Phi_K^2(E)\to\Phi_K(E)$ is determined according to the following table. \begin{center} \begin{tabular}{|c|c|c|c|c|} \hline $(n,l)$&$(2m+1,2u-3)$&$(2m+1,2u-2)$&$(2m,2u-3)$&$(2m,2u-2)$\\ \hline $\delta_2(V_l)$&$0$&$2$&$(0,0)$&$(1,1)$\\ \hline \end{tabular} \end{center} \end{Corollary} \subsection{Reduction types ${\rm IV}^*,\;{\rm III}^*$ and ${\rm II}^*$} \label{subsec:red IV*,III*,II*} For reduction types ${\rm IV}^*$, ${\rm III}^*$ and ${\rm II}^*$, we will not use Tate's algorithm to write down explicit equations for the components in $\Phi_K^2(E)$ because the defining equations of the components in $\Phi_K^m(E),\;m\ge 2,$ are complicated. Instead, we make use of our knowledge of the reduction types of $E$ over totally ramified field extensions of $K$, and use the projection formula to exploit the symmetry of the graphs associated to $E^{min}_k$. \begin{Lemma} \label{lem:type over extensions} Let $E/K$ be an elliptic curve. Let $K_m=K(t^{1/m}).$ If $E/K$ has reduction type ${\rm IV}^*$, then $E/K_3$ has good reduction if $\operatorname{char} k\ne3$. If $E/K$ has reduction ${\rm III^*}$, then $E/K_2$ has reduction ${\rm I_0}^*$ and $E/K_3$ has reduction ${\rm III}$. \end{Lemma} \begin{Proof} Let $t_m=t^{1/m}$. We recall from (\cite{Sil2}, Chapter IV, \S9) that $E/K$ has a minimal Weierstrass equation \[y^2+a_1xy+a_3y=x^3+a_2x^2+a_4x+a_6\] with $\nu(a_1)\ge1,\nu(a_2)\ge 2,\nu(a_3)=2,\nu(a_4)\ge3,\nu(a_6)\ge5$ if the reduction is ${\rm IV}^*$, and $\nu(a_1)\ge1,\nu(a_2)\ge 2,\nu(a_3)\ge3,\nu(a_4)=3,\nu(a_6)\ge5$ if the reduction is ${\rm III}^*$. Making substitutions $x\mapsto t_m^{2(m-1)}x$ and $y\mapsto t_m^{3(m-1)}y$, we will have a minimal Weierstrass equation for $E/K_m$ of the form \[y^2+a_1 t_m^{-(m-1)}xy+t_m^{-3(m-1)}a_3y=x^3+a_2t_m^{-2(m-1)}x^2+t_m^{-4(m-1)}a_4x+t_m^{-6(m-1)}a_6\] with reduction type as specified in the statement of the lemma. \end{Proof} If $E$ has one of the reduction types ${\rm IV}^*$, ${\rm III}^*$ or ${\rm II}^*$, then $E^{min}_k$ is as in the figures below. Recall that the multiplicity-$1$ component $\Gamma_i$ corresponds to $i\in{\mathbb Z}/n{\mathbb Z}$ under the isomorphism $\delta_1$. The numbers on the irreducible components refer to the multiplicities. \\ \setlength{\unitlength}{0.6cm}\linethickness{.2mm} \begin{picture}(8,3) {\tiny \put(0,.7){\line(1,0){6}}\put(2,0.3){3}\put(2,0.8){$\Lambda_0$} \put(1,0.3){\line(0,1){2}}\put(0.6,1.2){2}\put(1.1,1.2){$\Theta_0$} \put(-0.5,2){\line(1,0){2}}\put(0.1,2.2){$\Gamma_0$} \put(3,0.3){\line(0,1){2}}\put(2.6,1.2){2}\put(3.1,1.2){$\Theta_1$} \put(2,2){\line(1,0){2}}\put(2.1,2.2){$\Gamma_1$} \put(5,0.3){\line(0,1){2}}\put(4.6,1.2){2}\put(5.1,1.2){$\Theta_2$} \put(4.5,2){\line(1,0){2}}\put(5.6,2.2){$\Gamma_2$}} \put(2.7,-0.5){${\rm IV}^*$} {\tiny \put(8,0.7){\line(1,0){6}}\put(10,0.3){4}\put(10,0.8){$\Psi$} \put(9,0.3){\line(0,1){1.8}}\put(9.1,1){$\Lambda_0$}\put(8.7,1){$3$} \put(7.5,1.8){\line(1,0){2}}\put(8.1,1.9){$\Theta_0$}\put(8.2,1.5){2} \put(7.8,1.4){\line(0,1){1}}\put(7.2,2.2){$\Gamma_0$} \put(11,0.3){\line(0,1){1.8}}\put(10.6,1.4){2}\put(11.1,1.4){$\Theta_2$} \put(13,0.3){\line(0,1){1.8}}\put(12.7,1){$3$}\put(13.1,1){$\Lambda_1$} \put(12.5,1.8){\line(1,0){2}}\put(13.4,1.9){$\Theta_1$}\put(13.5,1.5){2} \put(14.2,1.4){\line(0,1){1}}\put(14.4,2.2){$\Gamma_1$}} \put(10.7,-0.5){${\rm III}^*$} {\tiny \put(16,.7){\line(1,0){2}}\put(16.9,0.2){$2$} \put(16.5,0.3){\line(0,1){1.8}}\put(15.7,1.2){$\Gamma_0$} \put(17.5,0.3){\line(0,1){2}}\put(17.1,1.2){$3$} \put(17.2,2){\line(1,0){2.5}}\put(18.3,2.1){$4$} \put(19,.7){\line(1,0){4}}\put(20.5,0.2){$6$} \put(19.5,0.3){\line(0,1){2}}\put(19.1,1.2){$5$} \put(21,0.3){\line(0,1){1.8}}\put(20.6,1.2){$3$} \put(22.5,0.3){\line(0,1){2}}\put(22.1,1.2){$4$} \put(22,2){\line(1,0){2.5}}\put(23,2.1){$2$}} \put(19.7,-0.5){${\rm II}^*$} \end{picture}\\ \begin{Proposition} \label{prop:sum of points IV*, III*, II*} Let $E/K$ be an elliptic curve with minimal proper regular model $E^{min}$. Let $\Xi_m$ denote a component of multiplicity-$m$ in $E^{min}_k$. \begin{myitemize} \item[(i)] If $E/K$ has reduction ${\rm IV}^*$ and $\operatorname{char} k\ne 3$, then\\ \begin{center} \begin{tabular}{|c||c|c|c|c|} \hline $\Xi_m$& $\Theta_0$ & $\Theta_1$ & $\Theta_2$&$\Lambda_0$\\ \hline $\delta_m(\Xi_m)$ & $0$ & $2$ & $1$ & $0$\\ \hline \end{tabular} \end{center} \item[(ii)] If $E/K$ has reduction ${\rm III}^*$ and $\operatorname{char} k\ne2,3$, then \\ \begin{center} \begin{tabular}{|c||c|c|c|c|c|c|} \hline $\Xi_m$& $\Theta_0$ & $\Theta_1$ & $\Theta_2$&$\Lambda_0$&$\Lambda_1$&$\Psi$\\ \hline $\delta_m(\Xi_m)$ & $0$ & $0$ & $1$ & $0$& $1$ & $0$\\ \hline \end{tabular} \end{center} \item[(iii)] If $E/K$ has reduction ${\rm II}^*$, then $\delta_m(\Xi_m)=0$ for every irreducible component $\Xi_m$ in $E^{min}_k$. \end{myitemize} \end{Proposition} \begin{Proof} Let $K_m=K(t^{1/m}),\;m\in\{2,3,4\}.$ Let $\operatorname{Gal}(K_m/K)=\langle\sigma_m\rangle.$ We want to find $l\in\Phi_K(E)$ such that if $P\in E(K_m)$ reduces to a point on $\Xi_m$, then $\sum_{i=0}^{m-1}P^{\sigma_m^i}$ reduces to a point on $\Gamma_l$ and therefore $\delta_m(\Xi_m)=l.$ If $Q\in E(K)$, then we will denote the translation-by-$Q$ automorphism by $\tau_Q:E\to E.$ This $K$-automorphism extends to give an ${\mathcal{O}_K}$-automorphism $\tau'_Q:E^{min}\to E^{min},$ see e.g. (\cite{Sil2}, Chapter IV, Proposition 4.6). In $(i)$ and $(ii)$, we know that $\Theta_0: y_1^2=0$ and $\delta_2(\Theta_0)=0$, see Lemma \ref{lem:y2=0, x3=0}. $(i)$ Let $P\in E(K_2)$ be a point lying above $\Theta_i,\;i=1,2,$ and above no other component. Now let $Q\in E(K)$ be a point lying above $\Gamma_{2i}.$ We have $\tau'^*_Q(\Gamma_{i})=\Gamma_0,$ and the projection formula implies that $\tau'^*_Q(\Gamma_i).\tau'^*_Q(\Theta_i)=\Gamma_i.\Theta_i,$ see (\cite{Liubook}, Theorem 9.2.12), therefore $\tau'^*_Q(\Theta_i)=\Theta_0.$ Hence $\tau_Q(P)+\tau_Q(P)^{\sigma_2}\in E^0(K),$ because $\delta_2(\Theta_0)=0$, i.e., $(P+Q)+(P^{\sigma_2}+Q)\in E^0(K).$ In other words, $P+P^{\sigma_2}\in Q+E^0(K),$ i.e., $P+P^{\sigma_2}$ lies above $\Gamma_{2i}.$ Since $E/K_3$ has reduction type ${\rm I_0}$, see Lemma \ref{lem:type over extensions}, $\overline{k}=k$ and $\operatorname{char} k\ne3$, then $E(K_3)$ is divisible by $3$. For $P\in E(K_3)$ lying above $\Lambda_0$, there is $Q\in E(K_3)$ with $P=3Q$. Now $P+P^{\sigma_3}+P^{\sigma_3^2}=3(Q+Q^{\sigma_3}+Q^{\sigma_3^2})\in E^0(K)$ because $\Phi_E(K) \cong {\mathbb Z}/3{\mathbb Z}$. $(ii)$ Following the same argument as in $(i)$ with $\tau_Q$ and $Q\in E(K)\setminus E^0(K)$, and remembering that $\delta_2(\Theta_0)=0$, we have $\delta_2(\Theta_1)=0$. Let ${\mathcal E}_m$ be the minimal proper regular model of $E/K_m$, $m=2,3$. Indeed, there is a morphism $$ \psi_m:{\mathcal E}_m\to\operatorname{Norm}(E^{min}\times_{{\mathcal{O}_K}}\mathcal{O}_{K_m})\to E^{min},$$ where $\operatorname{Norm}(E^{min}\times_{{\mathcal{O}_K}}\mathcal{O}_{K_m})$ is the normalisation of $E^{min}\times_{{\mathcal{O}_K}}\mathcal{O}_{K_m}$, see for example (\cite{Liubook}, \S 10.4) and (\cite{Lorenzini}, pp. 10-11). The minimal proper regular model ${\mathcal E}_m$ is obtained from the latter normalisation by contracting $(-1)$-curves. By virtue of Lemma \ref{lem:type over extensions}, the reduction type of $E/K_2$ is ${\rm I}_0^*.$ There exists a minimal Weierstrass equation for $E/K_2$ $$y^2+a_1xy+a_3y=x^3+a_2x^2+a_4x+a_6,\;a_i\in\mathcal{O}_{K_2},$$ where $x^3+a_2x^2+a_4x+a_6=(x-t\alpha_1)(x-t\alpha_2)(x-t\alpha_3),\;\alpha_i\in\mathcal{O}_{K_2},$ such that $({\mathcal E}_2)_k$ consists of $\Gamma_0:z=0,$ $V_{-1}:y_1^2=0$ and the three distinct lines of $x_1^3+\tilde{a}_{2,1}x_1^2+\tilde{a}_{4,2}x_1+\tilde{a}_{6,3}=0.$ Let $P_i=(t\alpha_i,0).$ The reduction map $E(K_2)[2]=\{0,P_1,P_2,P_3\}\to \Phi_{K_2}(E)$ is surjective as each of these points lies on a different multiplicity-1 component. Now $\sigma_2$ fixes one of the $\alpha_i$'s and swaps the other two. It follows that $\sigma_2$ fixes two multiplicity-1 components $\Gamma_{(0,0)}$ and $\Gamma'$ of $({\mathcal E}_2)_k$ and swaps the other two multiplicity-1 components $\Gamma_*,\Gamma^{\sigma_2}_*$. Note that $\Gamma_{(0,0)}$ and $\Gamma'$ lie above $\Gamma_0$ and $\Gamma_1$ in $E^{min}_k$ respectively. Since $\operatorname{char} k\ne 2$ and $[K_2:K]$ divides the multiplicities of $\Theta_2$ and $\Psi,$ it is known that $\Gamma_*$ and $\Gamma^{\sigma_2}_*$ lie above $\Theta_2$ under the morphism $\psi_m$, see for example (\cite{Liubook}, Remark 10.4.8). Therefore, if $P$ lies above $\Theta_2$ in $E^{min},$ then it lies above either $\Gamma_*$ or $\Gamma^{\sigma_2}_*$ in ${\mathcal E}_2.$ Since $\Phi_{K_2}(E) \cong \mathbb{Z}/2\mathbb{Z}\times\mathbb{Z}/2\mathbb{Z},$ we have $P+P^{\sigma_2}$ lies above $\Gamma'$ in $({\mathcal E}_2)_k,$ and hence it lies above $\Gamma_1$ in $E^{min}_k.$ Furthermore, the multiplicity-$2$ irreducible component $V_{-1}$ of $({\mathcal E}_2)_k$ lies above $\Psi$. We notice that $K_2=K_4^G$ where $G=\{1,\sigma_4^2\}$. Therefore, if $P\in E(K_4)$ lies above $\Psi$, then $\sum_{i=0}^3P^{\sigma_4^i}=(P+P^{\sigma_4})+(P+P^{\sigma_4})^{\sigma_4^2}\in E^0(K_2)$, because $\delta_2(V_{-1})=(0,0)$, i.e., this sum lies above $\Gamma_{(0,0)}$ of $({\mathcal E}_2)_k$ which lies above the identity component $\Gamma_0$ of $E^{min}_k$. We know that $E/K_3$ has reduction type ${\rm III}$, see Lemma \ref{lem:type over extensions}. If $P\in E(K_3)$, then $P$ lies on a multiplicity-$1$ component of $({\mathcal E}_3)_k$. Moreover, since $\operatorname{char} k\ne 3$, according to the description of the morphism $\psi_3$ given in (\cite{Lorenzini}, pp. 10-11) if $P$ lies on $\Lambda_0$, then $P$ lies on the identity component of $({\mathcal E}_3)_k$, and if $P$ lies on $\Lambda_1$, then $P$ lies on the other multiplicity-$1$ component of $({\mathcal E}_3)_k$. Thus we are done by observing that $\Phi_{K_3}(E) \cong {\mathbb Z}/2{\mathbb Z}$. $(iii)$ This is straightforward because $\sum_{i=0}^{m-1}P^{\sigma^i_m}\in E(K),$ and $E(K)=E^0(K)$ for reduction type ${\rm II}^*.$ \end{Proof} \section{Counting minimal models} \label{sec:counting minimal degree n models} Let $K$ be a Henselian discrete valuation field with ring of integers ${\mathcal{O}_K}.$ We fix a uniformiser $t.$ We denote the normalised valuation on $K$ by $\nu.$ We assume that the residue field $k$ is perfect with algebraic closure $\overline{k}$. Let $C$ be a smooth genus one curve over $K$ such that $C(K)\ne\emptyset.$ Let $E$ be the Jacobian elliptic curve of $C$ with minimal proper regular model $E^{min}$. When $E$ has additive reduction, we will assume moreover that $\operatorname{char} k\ne 2$ for $n=2$, and $\operatorname{char} k\ne2,3$ for $n=3,4.$ Let $Q\in C(K)$. Again we fix an isomorphism $\beta:C\to E$ such that $\beta(Q)=0_E.$ So we can dispense with $C$ and write $E$ instead. If $D$ is an effective $K$-rational divisor of degree $n$ on $E,$ then the Riemann-Roch theorem implies that there exists a point $P\in E(K)$ such that $D\sim(n-1).0_E+P.$ Therefore, the equation defining $C\to{\mathbb P}^{n-1}_K$ is an equation for the double cover of the projective line $E\to {\mathbb P}_K^1$ given by the divisor class $[0_E+P]$ when $n=2,$ or the image of $E$ when it is embedded in $\mathbb{P}_K^{n-1}$ by the divisor class $[(n-1).0_E+P]$ when $n=3,4.$ Let $\psi_E$ be the surjective homomorphism in the following short exact sequence $$0\to E^0(K)\to E(K)\xrightarrow{\psi_E} \Phi_E(K)\to 0.$$ Let $S^n(P),\;n\le4$, be the set consisting of unordered tuples $(\Gamma_1,\ldots,\Gamma_l)$, where $\Gamma_i$ is an irreducible component of $E^{min}_{\overline{k}}$, satisfying the following conditions: \begin{myitemize} \item[(i)] $\sum_{i=1}^l\operatorname{mult}_{\overline{k}}(\Gamma_i)=n.$ \item[(ii)] $\sum_{i=1}^l\delta_{m_i}(\Gamma_i)=\psi_E(P)$, where $m_i=\operatorname{mult}_{\overline{k}}(\Gamma_i)$. \item[(iii)] $(\Gamma_1^{\sigma},\ldots,\Gamma_l^{\sigma})=(\Gamma_1,\ldots,\Gamma_l)$ for every $\sigma\in{\mathcal G}_k.$ \end{myitemize} We define the map $$\lambda_n:\{\textrm{minimal degree-$n$-models for $E\to{\mathbb P}^{n-1}_K$ up to isomorphism}\}\to S^n(P);\;({\mathcal C},\alpha)\mapsto (\Gamma_1,\ldots,\Gamma_l),$$ such that \begin{myitemize} \item[(i)] $(\Gamma_1,\ldots,\Gamma_l)$ consists of the irreducible components of the strict transform of ${\mathcal C}_{\overline{k}}$ in $E^{min}_{\overline{k}}.$ \item[(ii)] If $\Gamma$ is the strict transform of a component $\Gamma'$ in ${\mathcal C}_{\overline{k}}$, then $\Gamma$ appears in $(\Gamma_1,\ldots,\Gamma_l)$ as many times as $\deg_{\overline{k}}\Gamma'.$ In particular, we have $\sum_{i=1}^l\operatorname{mult}_{\overline{k}}(\Gamma_i)=n$. See \cite{Poonen1} and \cite{Bromwich} for the complete classification of the multiplicities and degrees of the irreducible components of ${\mathcal C}_k$ when $n=3,4$. The case $n=2$ is clear. \end{myitemize} \begin{Lemma} \label{lem:lambda is well defined} The map $\lambda_n$ is well-defined. \end{Lemma} \begin{Proof} To show that $\lambda_n$ is well-defined we need to prove (i) if ${\mathcal C}$ and ${\mathcal C}'$ are minimal isomorphic degree-$n$-models for $E\to{\mathbb P}^{n-1}_K$, then $\lambda_n({\mathcal C})=\lambda_n({\mathcal C}')$, and (ii) $\lambda_n({\mathcal C})\in S^n(P)$. To prove (i) we know that the special fibers of any two isomorphic degree-$n$-models for $E\to{\mathbb P}^{n-1}_K$ have the same irreducible components with the same types, therefore the corresponding tuples of both models are the same, see Theorem \ref{thm:injectivity2}. For (ii) we will show first that if $(\Gamma_1,\ldots,\Gamma_l)$ is the tuple associated to ${\mathcal C}$, then $\sum_{i=1}^l\delta_{m_i}(\Gamma_i)=\psi_E(P)$ where $m_i=\operatorname{mult}_k(\Gamma_i).$ Let $D$ be a divisor on $E^{min}$ such that ${\mathcal C}$ is obtained from $E^{min}$ by contraction using $D$, see Theorem \ref{thm:minimality}. The divisor $D$ intersects the $\Gamma_i$'s and no other components. Endowing the $\Gamma_j$'s with the reduced structure, we have $D. \Gamma_j=\deg_k\Gamma_j'$, where $\Gamma_j'$ is an irreducible component of ${\mathcal C}_k$ whose strict transform in $E^{min}_k$ is $\Gamma_j$. Let $(x_1,\ldots,x_l)$ be a tuple of all intersection points of $D$ with the irreducible components $(\Gamma_1,\ldots,\Gamma_l)$ where $x_i\in \Gamma_i$. Note that $x_i$ may be repeated in $(x_1,\ldots,x_l)$ if $\Gamma_i$ is the strict transform of a component whose degree is greater than $1$. We have $D|_E\sim (n-1).0+P.$ Let $m_r=\max\{m_j:1\le j\le l\}$. It is clear that for $\Gamma_j,\;j=1,\ldots,l,$ the multiplicity $m_j\in\{1,m_r\}$, since otherwise we will have $1<m_j<m_r$ which implies that $m_r\ge 3$, hence $m_r+m_j\ge 5$ which contradicts that $\sum_{i=1}^l m_i=n\le 4$. By virtue of Proposition \ref{prop:auxiliary divisors}, there exists a closed point $P_j\in E$ such that $[K(P_j):K]=m_j$ and $\overline{\{P_j\}}\cap\Gamma_j=\{x_j\}$. Let $K_j=K(P_j)$ and $\operatorname{Gal}(K_{j}^{un}/K^{un})=\langle\sigma_{j}\rangle.$ Let ${\mathcal E}$ be the minimal proper regular model of $E/K_{r}^{un}$. Since $x_j$ lies on one and only one component of $E^{min}_{\overline{k}}$, there are exactly $m_j$ points $\{y_1,\ldots,y_{m_j}\}$ of ${\mathcal E}$ lying above $x_j$, and each of these points lies on a multiplicity-$1$ component of ${\mathcal E}_{\overline{k}}$, see (\cite{Liubook}, Remark 10.4.8). Now we view $D$ as a divisor on ${\mathcal E}$. For $Q\in E$, $\tilde{Q}$ will denote its reduction. We have $$\tilde{P}=(\operatorname{sum} D|_E)^{\sim}=\operatorname{sum} D|_{{\mathcal E}_{\overline{k}}}=\sum_{j=1}^l\sum_{i=1}^{m_j}y_i=\sum_{j=1}^l\sum_{i=1}^{m_j}\tilde{P}_j^{\sigma_{j}^i}.$$ The second equality holds because $D$ intersects ${\mathcal E}_{\overline{k}}$ only in multiplicity-$1$ components. Therefore, we have $P-\sum_{j=1}^l\sum_{i=1}^{m_j}P_j^{\sigma_{j}^i}\in E^0(K)$. Applying the surjective group homomorphism $\psi_E:E(K)\to\Phi_K(E)$, we get $\psi_E(P)=\sum_{j=1}^l\psi_E(\sum_{i=1}^{m_j}P_j^{\sigma_{j}^i})= \sum_{j=1}^l\delta_{m_j}(\Gamma_j).$ To show that $\lambda_n({\mathcal C})$ is ${\mathcal G}_k$-invariant, we know that $D$ intersects the irreducible components of the strict transform of ${\mathcal C}_{\overline{k}}$ in $E^{min}_{\overline{k}}$ and no other components. If $\Gamma$ is the strict transform of an irreducible component in ${\mathcal C}_{\overline{k}}$, then there is an $x\in(D|_{E^{min}_{\overline{k}}})\cap\Gamma$. Moreover, $H^0(E^{min},\mathcal{O}_{E^{min}}(mD))$ is a free ${\mathcal{O}_K}$-module for every $m\ge0$. Therefore, $D|_{E^{min}_{\overline{K}}}$ and $D|_{E^{min}_{\overline{k}}}$ are $K$- and $k$-rational divisors respectively. Thus $x^{\sigma}\in(D|_{E^{min}_{\overline{k}}})^{\sigma}\cap\Gamma^{\sigma}=(D|_{E^{min}_{\overline{k}}})\cap\Gamma^{\sigma}$ for any $\sigma\in{\mathcal G}_k$. In particular, $\Gamma^{\sigma}$ is the strict transform of an irreducible component of ${\mathcal C}_{\overline{k}}$. \end{Proof} We will show that $\lambda_n$ is bijective, and so the set of isomorphism classes of minimal degree-$n$-models for $E\to{\mathbb P}^{n-1}_K$ is identified with $S^n(P)$. Consequently, we have the following theorem. \newtheorem{thm2}{Theorem}[section] \begin{Theorem} \label{thm:counting models} Let $E/K$ be an elliptic curve and $P \in E(K)$. Let $E \to {\mathbb P}^{n-1}_K$ be the morphism determined by the divisor class $[(n-1).0_E + P],\;n\in\{2,3,4\}$. Let $\delta_m : \Phi_K^m(E) \to \Phi_K(E)$ be the function defined in \S \ref{sec:computing in E min}. Then there is a bijection between the set of minimal degree-$n$-models for $E\to {\mathbb P}^{n-1}_K$ up to isomorphism and the disjoint union of the following ${\mathcal G}_k$-invariant sets. \begin{myitemize} \item[(i)] The set of unordered $n$-tuples \[ S_1(n,P) = \{ (a_1,\ldots,a_n) : a_i \in \Phi_K(E) \mid a_1 + \ldots + a_n = \psi_E(P)\}^{{\mathcal G}_k},\] \item[(ii)] the set $S_n(P) = \{ a \in \Phi_K^n(E) \mid \delta_n(a) = \psi_E(P) \}^{{\mathcal G}_k},$ \end{myitemize} and if $n\ge3$ \begin{myitemize} \item[(iii)] the set $S_{(n-1,1)}(P) = \{ (a,b) \in \Phi_K^{n-1}(E) \times \Phi_K(E) \mid \delta_{n-1}(a) + b = \psi_E(P) \}^{{\mathcal G}_k},$ \end{myitemize} and if $n=4$ \begin{myitemize} \item[(iv)] the set $S_{(2,1,1)}(P) = \{ (a,b,c) \in \Phi_K^{2}(E) \times \Phi_K(E)\times \Phi_K(E) \mid \delta_{2}(a) + b + c = \psi_E(P) \}^{{\mathcal G}_k},$ where the order of $b$ and $c$ is immaterial, \item[(v)] the set of unordered pairs $$S_{(2,2)}(P) = \{ (a,b) \in \Phi_K^{2}(E) \times \Phi_K^2(E) \mid \delta_{2}(a) + \delta_2(b) = \psi_E(P) \}^{{\mathcal G}_k}.$$ \end{myitemize} \end{Theorem} We will denote the number of multiplicity-1 irreducible components of $E^{min}_{\overline{k}}$ which are defined over $k$ by $c_k,$ this is the {\em Tamagawa number} of $E/K.$ Now we get the following corollary as a direct consequence of Theorem \ref{thm:counting models}. \begin{Corollary} \label{cor:counting reduced models} Let $E/K$ be an elliptic curve and let $P \in E(K)$. Let $E \to {\mathbb P}^{n-1}_K$ be the morphism determined by the divisor class $[(n-1).0_E + P]$. The number of minimal degree-$n$-models for $E\to{\mathbb P}^{n-1}_K$ is determined according to Table \ref{table1}. \\ \begin{sidewaystable} \caption{} \centering \footnotesize{ \begin{tabular}{|c|c||c|c|c|} \hline &$c_p$&$n=2$ & $n=3$ & $n=4$ \\ \hline \hline \multirow{2}{*}{${\rm I}_{2m}$} &\multirow{2}{*}{$2$}& $m+1$, if $P\in E^0(K)$ &\multirow{2}{*}{$m+1$}& $(m+1)(m+2)/2$, if $P\in E^0(K)$\\ && $1$, if $P\not\in E^0(K)$ & & $m+1$, if $P\not\in E^0(K)$ \\ \hline \multirow{3}{*}{$\rm{I}_{2m}$}&\multirow{3}{*}{$2m$}&$m+1$ if $\psi_E(P)\in2\Phi_K(E)$&$(m+1)(2m+1)/3$ if $3\nmid m$&$m(m+1)(m+2)/3$ if $2\nmid \psi_E(P)$\\ &&&$m(2m+3)/3+1$ if $3\mid\gcd(m,\psi_E(P))$&$m(m+1)(m+2)/3+1$ if $2\mid \psi_E(P)$\\ &&$m$ if $\psi_E(P)\not\in2\Phi_K(E)$&$m(2m+3)/3$ if $3\mid m$ and $3\nmid \psi_E(P)$&$m(m+1)(m+2)/3+2$ if $4\mid \psi_E(P)$\\ \hline ${\rm I}_{2m+1}$ &$1$& $m+1$ &$m+1$& $(m+1)(m+2)/2$ \\ \hline \multirow{3}{*}{${\rm I}_{2m+1}$}&\multirow{3}{*}{$2m+1$}&\multirow{3}{*}{$m+1$}&$(m+1)(2m+3)/3$ if $3\nmid 2m+1$&\multirow{3}{*}{$(m+1)(m+2)(2m+3)/6$}\\ &&&$(m+2)(2m+1)/3+1$ if $3\mid \gcd(2m+1,\psi_E(P))$&\\ &&&$(m+2)(2m+1)/3$ if $3\mid 2m+1$ and $3\nmid\psi_E(P)$&\\ \hline \hline ${\rm II}$&$1$&$1$&$1$&$1$\\ \hline ${\rm III}$&$1$&$1$ if $\psi_E(P)=1$, $2$ if $\psi_E(P)=0$&$2$&$2$ if $\psi_E(P)=1$, $3$ if $\psi_E(P)=0$\\ \hline \multirow{2}{*}{${\rm IV}$}&$1$&\multirow{2}{*}{$2$}&$2$&$3$\\ &$3$&&$4$ if $\psi_E(P)=0$, $3$ otherwise &$5$\\ \hline \hline $\rm{I}_0^*$&$1$&$2$&$3$&$4$\\ \hline \multirow{2}{*}{${\rm I}_{2m}^*$}&\multirow{2}{*}{$2$}&$m+3$ if $P\in E^0(K)$&\multirow{2}{*}{$2m+4$}&$(m+2)(m+4)$ if $P\in E^0(K)$\\ &&$m+2$ if $P\not\in E^0(K)$&&$(m+2)(m+3)$ if $P\not\in E^0(K)$\\ \hline \multirow{3}{*}{${\rm I}_{2m}^*$}&\multirow{3}{*}{$4$}&$m+5$ if $\psi_E(P)=(0,0)$&\multirow{3}{*}{$2m+6$}&$(m+4)^2$ if $\psi_E(P)=(0,0)$\\ &&$m+2$ if $\psi_E(P)=(1,1)$&&$(m+2)(m+5)$ if $\psi_E(P)=(1,1)$\\ &&$2$ otherwise&&$4m+10$ otherwise\\ \hline \multirow{2}{*}{${\rm I}_{2m+1}^*$}&\multirow{2}{*}{$2$}&$m+4$ if $P\in E^0(K)$&\multirow{2}{*}{$2m+5$}&$(m+3)(m+4)$ if $P\in E^0(K)$\\ &&$m+2$ if $P\not\in E^0(K)$&&$(m+2)(m+4)$ if $P\not\in E^0(K)$\\ \hline \multirow{3}{*}{${\rm I}_{2m+1}^*$}&\multirow{3}{*}{$4$}&$m+4$ if $2\mid\psi_E(P)$&\multirow{3}{*}{$2m+7$}&$(m+3)(m+6)$ if $\psi_E(P)=(0,0)$\\ &&&&$(m+4)^2$ if $\psi_E(P)=2$\\ &&$2$ otherwise&&$4m+12$ otherwise\\ \hline \hline \multirow{2}{*}{${\rm IV}^*$}&$1$&\multirow{2}{*}{$3$}&$4$&$8$\\ &$3$&&$8$ if $\psi_E(P)=0$, $6$ otherwise & $14$\\ \hline ${\rm III}^*$&$2$& $4$ if $\psi_E(P)=0$, $2$ otherwise & $6$ & $15$ if $\psi_E(P)=0$, $10$ otherwise\\ \hline ${\rm II}^*$&$1$& $3$ & $5$ & $10$\\ \hline \end{tabular}} \label{table1} \end{sidewaystable} \end{Corollary} \begin{Proof} For full details of the proof see \S\S 7,8 of \cite{SadekThesis}. \end{Proof} \section{Proof of Theorem \ref{thm:counting models}} \label{sec:counting models} We need a few lemmas before we proceed with the proof of Theorem \ref{thm:counting models}. \begin{Lemma} \label{lem:divisibility of E0} Let $E/K$ be an elliptic curve with additive reduction. Assume that $\gcd(d,\operatorname{char} k)=1$. Then the group $E^0(K)$ is divisible by $d$. \end{Lemma} \begin{Proof} Recall that $E^1(K)=\{P\in E(K):\tilde{P}=\tilde{0}_E\}.$ The group $E^0(K)/E^1(K)$ is isomorphic to $k^+$ because $E$ has additive reduction. In particular, $E^0(K)/E^1(K)$ is divisible by $d$ because $(d,\operatorname{char} k)=1.$ But by the theory of formal groups, the group $E^1(K)$ is uniquely divisible by $d$. Therefore, $E^0(K)$ is divisible by $d.$ \end{Proof} If $E/K$ has non-split reduction type, then there exists a smallest finite unramified extension $L/K$ of degree $d$ over which $E$ has split reduction. In fact, $d=2$ except possibly when $E$ has non-split reduction of type ${\rm I}_0^*$ then $d\in\{2,3\}$. We define the norm map $\operatorname{Norm}_{L/K}$ to be $\operatorname{Norm}_{L/K}: E(L)\to E(K);\;Q\mapsto\sum_{i=1}^d Q^{\sigma^i}$, where $\operatorname{Gal}(L/K)=\langle\sigma\rangle$. \begin{Lemma} \label{lem:trace is surjective} Let $L$ be the smallest unramified field over which $E$ has split reduction. Then $\operatorname{Norm}_{L/K}:E^0(L)\to E^0(K)$ is surjective. \end{Lemma} \begin{Proof} We first treat the additive case. So assume that $E$ has non-split additive reduction. Let $Q\in E^0(K).$ Since $E^0(K)$ is divisible by $d=[L:K]$, see Lemma \ref{lem:divisibility of E0}, there is $Q'\in E^0(K)$ with $dQ'=Q.$ Now we have $\operatorname{Norm}_{L/K}(Q')=dQ'=Q.$ Now assume $E$ has non-split multiplicative reduction. We always have $[L:K]=2$. The non-singular reduction of $E$ will be denoted by $\tilde{E}_{ns}.$ Let $\ell$ be the residue field of $L.$ We denote the image of $\sigma$ under the isomorphism $\operatorname{Gal}(L/K) \cong \operatorname{Gal}(\ell/k)$ by $\sigma$ again. Let $\operatorname{Norm}_{\ell/k}:\tilde{E}_{ns}(\ell)\to\tilde{E}_{ns}(k);\;Q\mapsto Q+Q^{\sigma}$. Consider the following diagram.\\ \begin{displaymath} \xymatrix{ 0\ar[r]&E^1(L)\ar[d]_{\operatorname{Norm}_{L/K}}\ar[r]&E^0(L)\ar[d]_{\operatorname{Norm}_{L/K}}\ar[r]&\tilde{E}_{ns}(\ell)\ar[d]_{\operatorname{Norm}_{\ell/k}}\ar[r]&0\\ 0\ar[r]&E^1(K)\ar[r]&E^0(K)\ar[r]&\tilde{E}_{ns}(k)\ar[r]&0 } \end{displaymath} To prove that $\operatorname{Norm}_{L/K}:E^0(L)\to E^0(K)$ is surjective, we only need to show the surjectivity of both $\operatorname{Norm}_{L/K}:E^1(L)\to E^1(K)$ and $\operatorname{Norm}_{\ell/k}:\tilde{E}_{ns}(\ell)\to\tilde{E}_{ns}(k)$. Let $Q\in E^1(K).$ Since $E^1(K)$ is divisible by $2,$ there is a $Q'\in E^1(K)$ such that $2Q'=Q.$ So, $\operatorname{Norm}_{L/K}(Q')=2Q'=Q.$ Now we will show the surjectivity of $\operatorname{Norm}_{\ell/k}.$ The isomorphism $f:\tilde{E}_{ns}(\ell) \cong \ell^*$ induces an isomorphism $\tilde{E}_{ns}(k) \cong U:=\{u\in \ell^*:\operatorname{Norm}_{\ell/k}(u)=1\}$. Moreover, the $\ell$-automorphism $\sigma^{-1}f\sigma f^{-1}:\ell^*\to \ell^*$ is $u\mapsto u^{-1},$ see (\cite{Liubook}, Exercise 10.2.7). Therefore, the map $\operatorname{Norm}_{\ell/k}$ induces the map $\ell^*\to U;\;v\mapsto v/v^{\sigma}.$ Now according to Hilbert's Theorem 90, for $u\in \ell^*$ we have $\operatorname{Norm}_{\ell/k}(u)=1$ if and only if $u=v/v^{\sigma}$ for some $v\in \ell^*.$ Therefore, $\operatorname{Norm}_{\ell/k}$ is surjective. \end{Proof} \begin{Lemma} \label{lem:constructing divisors} Let $E/K$ be an elliptic curve with minimal proper regular model $E^{min}.$ Let $P\in E(K)$ and $(\Gamma_1,\ldots,\Gamma_l)$ be an element of $S^n(P)$ endowed with the reduced structure. Then there exists a divisor $D$ on $E^{min}\to\operatorname{Spec}\mathcal{O}_{K^{un}}$ such that: \begin{myitemize} \item[(i)] $(D|_E)^{\sigma}=D|_E$ for every $\sigma\in\operatorname{Gal}(K^{un}/K).$ \item[(ii)] $D. \Gamma_i=d_i,$ where $d_i$ is the number of times $\Gamma_i$ appears in $(\Gamma_1,\ldots,\Gamma_l)$. \item[(iii)] $D|_E\sim(n-1).0+P.$ \end{myitemize} \end{Lemma} \begin{Proof} Assume first that $E$ has reduction of type ${\rm I}_m,m\ge0$. Then $E^{min}_{\overline{k}}$ contains only multiplicity-$1$ irreducible components and we have $l=n$. Let $\ell=k(\Gamma_1,\ldots,\Gamma_n)$. Let $L/K$ be the unramified extension with residue field $\ell/k$ and $\operatorname{Gal}(L/K)=\langle\sigma\rangle$. We have $[L:K]=[\ell:k]\le 2.$ Now we pick a point above each $\Gamma_i$. If $\Gamma_i$ is defined over $k$, then choose $Q_i\in E(K)$ above $\Gamma_i$. If $\Gamma_i$ is defined over $\ell$, then pick $Q_i\in E(L)$ lying above $\Gamma_i$. Since $(\Gamma_1,\ldots,\Gamma_n)$ is ${\mathcal G}_k$-invariant, then $\Gamma_i^{\sigma}=\Gamma_j$ for some $j\in\{1,\ldots,n\}$. We pick $Q_j:=Q_i^{\sigma}$ to be the point above $\Gamma_j$. Since $\sum_{i=1}^n\delta_{1}(\Gamma_i)=\psi_E(P)$, it follows that $P':=\sum_{i=1}^nQ_i-P\in E^0(K).$ If there exists $i$ such that $Q_i\in E(K)$, then replace $Q_i$ with $Q_i-P'$. Otherwise, there exists $i,j$ such that $Q_i\in E(L)\setminus E(K)$ and $Q_j=Q_i^{\sigma}$. According to Lemma \ref{lem:trace is surjective}, there is $Q'\in E^0(L)$ with $\operatorname{Norm}_{L/K}(Q')=P'$. Now replace $Q_i$ with $Q_i-Q'$, and $Q_j$ with $Q_j-Q'^{\sigma}$. We set our divisor to be $D=\sum_{i=1}^n\overline{\{Q_i\}}$. Now assume that $E$ has additive reduction. If $\Gamma_i$ is a multiplicity-$1$ component, then we pick $Q_i$ above $\Gamma_i$ as in the multiplicative case. We note that for non-split ${\rm I}_0^*$, $\Gamma_i$ might be defined over a cubic extension of $k$. In case $\Gamma_i$ is defined over $k$ and of multiplicity $m_i\ge2$, then we choose $Q_i\in E$ above $\Gamma_i$, where $K(Q_i)/K$ is a totally ramified extension with $[K(Q_i):K]=m_i$. In case of non-split reduction of type ${\rm IV}^*$ and $n=4$, we can have $l=2$ where $\Gamma_1$ is of multiplicity-$2$ and defined over a quadratic extension $\ell/k$. Then we pick $Q_1$ above $\Gamma_1$ where $[L(Q_1):L]=2$ and we choose $Q_2:=Q_1^{\sigma}$. Let $G(Q_i)=\sum_{j=1}^{m_i}Q_i^{\sigma_i^j}$ where $\operatorname{Gal}(K(Q_i)^{un}/K^{un})=\langle\sigma_i\rangle$. Since $\sum_{i=1}^l\delta_{m_i}(\Gamma_i)=\psi_E(P)$, it follows from the definition of $\delta_{m_i}$ that $P':=\sum_{i}G(Q_i)-P\in E^0(K).$ By virtue of Lemma \ref{lem:divisibility of E0}, there is $Q'\in E^0(K)$ with $nQ'=P'$. We set $Q'_i=Q_i-Q'$ for every $i$, and $D=\sum_{i}\overline{\{Q_i'\}}$. \end{Proof} \begin{ProofOf}{Theorem \ref{thm:counting models}} We need to prove that the well-defined map $$\lambda_n:\{\textrm{ minimal degree-}n\textrm{-models for }E\to{\mathbb P}^{n-1}_K\textrm{ up to isomorphism}\}\longrightarrow S^n(P)$$ is bijective. To prove that $\lambda_n$ is injective, let $({\mathcal C}_1,\alpha_1)$ and $({\mathcal C}_2,\alpha_2)$ be two minimal degree-$n$-models for $E\to{\mathbb P}^{n-1}_K$. Assume that $\lambda_n({\mathcal C}_1)=\lambda_n({\mathcal C}_2).$ We want to show that $({\mathcal C}_1,\alpha_1)$ and $({\mathcal C}_2,\alpha_2)$ are isomorphic. The fact that they have the same corresponding tuples implies that they have the same strict transform in $E^{min}_k$, therefore $({\mathcal C}_1,\alpha_1)$ and $({\mathcal C}_2,\alpha_2)$ are isomorphic, see Theorem \ref{thm:injectivity2}. Now we will prove that $\lambda_n$ is surjective. So assume that $(\Gamma_1,\ldots,\Gamma_l)\in S^n(P)$ and we want to construct a minimal degree-$n$-model $({\mathcal C},\alpha)$ whose image under $\lambda_n$ is $(\Gamma_1,\ldots,\Gamma_l)$. By virtue of Lemma \ref{lem:constructing divisors}, there exists a divisor $D$ on $E^{min}$ such that $D|_E$ is $K$-rational, $D$ intersects $\Gamma_i$ as many times as its occurrence in the tuple, and $D|_E\sim(n-1).0+P.$ Consider the following $S$-model for $E$ $${\mathcal C}:= \operatorname{Proj}(\bigoplus_{m=0}^{\infty}H^0(E^{min},\mathcal{O}_{E^{min}}(mD))).$$ The model ${\mathcal C}$ is a minimal degree-$n$-model for $E\to{\mathbb P}^{n-1}_K$, see \cite{SadekMinimal}. The special fiber ${\mathcal C}_k$ consists of the components in $(\Gamma_1,\ldots,\Gamma_l)$ because $D$ intersects these components in $E^{min}_k$ and intersects no other components. Moreover, each component of ${\mathcal C}_k$ has degree equal to the number of iterations of its strict transform in $(\Gamma_1,\ldots,\Gamma_l)$. We obtain $\alpha$ from the linear equivalence of $D|_E$ and $(n-1).0_E + P.$ \end{ProofOf} \section{Counting minimal global models} \label{sec:counting global models} In this section we will be interested in attacking the global question. Let $K$ be a number field of class number 1 with ring of integers ${\mathcal{O}_K}$. If ${\mathfrak {p}}$ is a prime in $K$, then we will denote the completion of $K$ at ${\mathfrak {p}}$ by $K_{{\mathfrak {p}}}$, and its ring of integers by $\mathcal{O}_{K_{{\mathfrak {p}}}}$. Let $C$ be a smooth genus one curve defined by an integral genus one equation of degree $n$ over $K$. We assume moreover that $C(K_{{\mathfrak {p}}})\ne\emptyset$ for every prime ${\mathfrak {p}}$ of $K$. A {\em minimal global degree-$n$-model $({\mathcal C},\alpha)$ for $C\to{\mathbb P}^{n-1}_{K}$} consists of an $\operatorname{Spec}{\mathcal{O}_K}$-scheme defined by an ${\mathcal{O}_K}$-integral genus one equation of degree $n$ which is $\mathcal{O}_{K_{{\mathfrak {p}}}}$-minimal at every prime ${\mathfrak {p}}$, and an isomorphism $\alpha:{\mathcal C}_K \cong C$ defined by an element in $\mathcal{G}_n(K)$. An {\em isomorphism} $\beta:({\mathcal C}_1,\alpha_1) \cong ({\mathcal C}_2,\alpha_2)$ of degree-$n$-models for $C\to{\mathbb P}^{n-1}_K$ is an isomorphism $\beta:{\mathcal C}_1 \cong {\mathcal C}_2$ of $\operatorname{Spec}{\mathcal{O}_K}$-schemes defined by an element in $\mathcal{G}_n({\mathcal{O}_K})$ with $\beta_K=\alpha_2^{-1}\alpha_1$. It is known that a minimal global degree-$1$-model for $C/K$, i.e., a Weierstrass model, exists and is unique up to isomorphism. A proof of the existence of a minimal global degree-$n$-model for $C/K$, where $C(K_{{\mathfrak {p}}})\ne\emptyset$ for every ${\mathfrak {p}}$, when $n\in\{2,3,4\}$ can be found in \cite{FiStCr}. The author gave a new proof in \cite{SadekMinimal}. The problem of counting minimal global degree-$n$-models up to ${\mathcal{O}_K}$-isomorphism can be tackled locally. We consider $C$ as a curve over $K_{{\mathfrak {p}}}$ and use the previous section to determine the number $N_{{\mathfrak {p}}}$ of minimal degree-$n$-models for $C\to{\mathbb P}_{K_{{\mathfrak {p}}}}^{n-1}$ up to $ \mathcal{O}_{K_{{\mathfrak {p}}}}$-isomorphism. It turns out that we need only to investigate a finite set of primes. Then we collect the local data at the finite places using strong approximation. If $m\in{\mathcal{O}_K},$ then we set $P(m)=\{{\mathfrak {p}}:{\mathfrak {p}}\textrm{ is prime, }\mathfrak{p}^2\mid m\}.$ The main result of this section is the following Theorem. \begin{Theorem} \label{thm:global models} Let $K$ be a number field of class number $1$. Let $C\to{\mathbb P}^{n-1}_{K}$ be a smooth curve defined by a genus one equation of degree $n,\;n=2,3,4.$ Assume that $C(K_{{\mathfrak {p}}})\ne\emptyset$ for every prime ${\mathfrak {p}}$. Let $E/K$ be the Jacobian elliptic curve of $C$ with minimal discriminant $\Delta$. Let $N$ and $N_{{\mathfrak {p}}}$ denote the numbers of minimal global degree-$n$-models for $C\to{\mathbb P}^{n-1}_{K},$ up to ${\mathcal{O}_K}$-isomorphism, and minimal degree-$n$-models for $C\to{\mathbb P}^{n-1}_{K_{{\mathfrak {p}}}},$ up to $\mathcal{O}_{K_{{\mathfrak {p}}}}$-isomorphism, respectively. Then $$N=\prod_{{\mathfrak {p}}\in P(\Delta)}N_{{\mathfrak {p}}}.$$ \end{Theorem} Theorem \ref{thm:global models} follows immediately from the bijectivity of the following map \begin{eqnarray} \{\textrm{minimal global degree-}n\textrm{-models for } C/K\}&\longrightarrow&\prod_{{\mathfrak {p}}\in P(\Delta)}\{\textrm{minimal degree-}n\textrm{-models for }C/K_{{\mathfrak {p}}}\}\nonumber\\ ({\mathcal C},\alpha)&\mapsto&(({\mathcal C},\alpha),\ldots,({\mathcal C},\alpha)).\nonumber \end{eqnarray} Notice that the above two sets of degree-$n$-models are defined up to isomorphism. Furthermore, our work always enables us to compute $N_{{\mathfrak {p}}}$ when ${\mathfrak {p}}$ lies above a prime $p\ge5.$ Before proceeding with the proof of Theorem \ref{thm:global models} we need the following Lemmas. \begin{Lemma} \label{lem:matrices} Let $A\in\operatorname{GL}_n(K_{{\mathfrak {p}}})\cap\operatorname{Mat}_n(\mathcal{O}_{K_{{\mathfrak {p}}}})$ have coprime entries. Assume that ${\mathfrak {p}}=\pi{\mathcal{O}_K}$. Then there exist matrices $U\in \operatorname{GL}_n({\mathcal{O}_K})$ and $V\in\operatorname{GL}_n(\mathcal{O}_{K_{{\mathfrak {p}}}})$ such that $A=VDU,$ where $D=\operatorname{diag}(\pi^{r_1},\ldots,\pi^{r_{n-1}},1)$ and $r_1\ge\ldots\ge r_{n-1}.$ \end{Lemma} \begin{Proof} We claim that there exists a matrix $B\in\operatorname{GL}_n(K)\cap\operatorname{Mat}_n({\mathcal{O}_K})$ such that $V':=BA^{-1}\in\operatorname{GL}_n(\mathcal{O}_{K_{{\mathfrak {p}}}}).$ Granted this claim we write the Smith Normal Form for the matrix $B,$ so we have $B=U'D'DU$ where $U,U'\in\operatorname{GL}_n({\mathcal{O}_K}),$ $D'$ is a diagonal matrix whose entries are not divisible by $\pi$, and $D=\operatorname{diag}(\pi^{r_1},\ldots,\pi^{r_{n-1}},1),\;r_1\ge\ldots\ge r_{n-1}.$ Then we set $V:=V'^{-1}U'D'\in\operatorname{GL}_n(\mathcal{O}_{K_{{\mathfrak {p}}}}),$ hence we are done. To prove the claim, assume that $A=(a_{ij})_{i,j}.$ Recall that every element in $\mathcal{O}_{K_{{\mathfrak {p}}}}$ can be written uniquely as $\sum_{i\ge0} a_i \pi^i,$ where $a_i\in{\mathcal{O}_K}$ lies in a set of representatives of $\mathcal{O}_{K}/{\mathfrak {p}}.$ By a continuity argument, there exists an integer $m>0$ such that the matrix $B=(a_{ij}\mod \pi^m)_{i,j}\in\operatorname{GL}_n(K)\cap\operatorname{Mat}_n({\mathcal{O}_K})$. Now we have $BA^{-1} \equiv \operatorname{id}_n\mod \pi^m$ and hence $BA^{-1}\in\operatorname{GL}_n(\mathcal{O}_{K_{{\mathfrak {p}}}})$. \end{Proof} \begin{Lemma} \label{lem:Zp isom Z} Let $\phi$ and $\phi'$ be two minimal $\mathcal{G}_n(K_{{\mathfrak {p}}})$-equivalent genus one equations of degree $n$ with coefficients in ${\mathcal{O}_K}$ and $\mathcal{O}_{K_{{\mathfrak {p}}}}$ respectively. Then $\phi'$ is $\mathcal{G}_n(\mathcal{O}_{K_{{\mathfrak {p}}}})$-equivalent to a minimal genus one equation of degree $n$ whose coefficients lie in ${\mathcal{O}_K}$. \end{Lemma} \begin{Proof} Assume that $\phi'$ is obtained from $\phi$ via $[\mu_n,A_n]$ in $\mathcal{G}_n(K_{{\mathfrak {p}}}).$ For $r\in K_{{\mathfrak {p}}}^*,$ the following transformations are identical: $$[\mu_n,A_n]=[r^{-2}\mu_n,rA_n]\textrm{ when }n=2,4,\textrm{ and } [\mu_3,A_3]=[r^{-3}\mu_3,rA_3].$$ Therefore, we can assume that $A_n$ has coprime entries in $\mathcal{O}_{K_{{\mathfrak {p}}}}.$ Lemma \ref{lem:matrices} allows us to write $A_n=V_nD_nU_n$ where $V_n\in\operatorname{GL}_n(\mathcal{O}_{K_{{\mathfrak {p}}}})$, $U_n\in\operatorname{GL}_n({\mathcal{O}_K})$, and $D_n=\operatorname{diag}(\pi^{r_1},\ldots,\pi^{r_{n-1}},1)$ where ${\mathfrak {p}}=\pi{\mathcal{O}_K}$. Similarly, we can write $\mu_4=\nu_4'\tau_4\nu_4$ where $\nu_4'\in\operatorname{GL}_2(\mathcal{O}_{K_{{\mathfrak {p}}}})$, $\nu_4\in\operatorname{GL}_2({\mathcal{O}_K})$ and $\tau_4=\operatorname{diag}(\pi^{-m_1},\pi^{-m_2}).$ Let $\psi$ be the ${\mathcal{O}_K}$-integral genus one equation obtained from $\phi$ via the transformation $[1,U_n]$ when $n=2,3$, and via $[\nu_4,U_4]$ when $n=4$. Then $\psi$ lies in the same $\mathcal{G}_n({\mathcal{O}_K})$-equivalence class as $\phi$. Let $\phi''$ be the genus one equation obtained from $\psi$ via the transformation $[\mu_n', D_n]$, where $\mu_2'=(\det D_2)^{-2}$, $\mu_3'=(\det D_3)^{-1}$ and $\mu_4'=\tau_4$. It is clear that $\phi''$ is $\mathcal{G}_n(\mathcal{O}_{K_{{\mathfrak {p}}}})$-equivalent to $\phi'.$ We claim that $\phi''$ has coefficients in ${\mathcal{O}_K}$. If it is not the case, then some of the coefficients of the polynomials defining $\phi''$ would lie in $\frac{1}{\pi^r}{\mathcal{O}_K}$ for some $r>0$. But $\phi''$ is obtained from $\phi'$ via $[\omega_n,V_n^{-1}]$, where $\omega_n\in\mathcal{O}_{K_{{\mathfrak {p}}}}^*$ when $n=2,3$, and $\omega_4\in\operatorname{GL}_2(\mathcal{O}_{K_{{\mathfrak {p}}}})$. Since $\phi'$ is $\mathcal{O}_{K_{{\mathfrak {p}}}}$-integral, it follows that $\phi''$ should be $\mathcal{O}_{K_{{\mathfrak {p}}}}$-integral, which is a contradiction. \end{Proof} The following lemma, (\cite{Sil2}, Chapter IV, Lemma 9.5), will be used to justify our choice of the set of prime numbers $P(\Delta).$ \begin{Lemma} \label{lem:P(Delta)} Let $E/K_{{\mathfrak {p}}}$ be an elliptic curve with discriminant $\Delta.$ If $\nu_{{\mathfrak {p}}}(\Delta)=1,$ then $E$ has reduction of type ${\rm I}_1.$ \end{Lemma} \begin{ProofOf}{Theorem \ref{thm:global models}} First we will show that the map $\lambda$ is well defined. Let $({\mathcal C}_1,\alpha_1)$ and $({\mathcal C}_2,\alpha_2)$ be two isomorphic minimal global degree-$n$-models for $C\to{\mathbb P}^{n-1}_{K}.$ Then $\alpha:=\alpha_2^{-1}\alpha_1:({\mathcal C}_1)_{K_{{\mathfrak {p}}}}\to ({\mathcal C}_2)_{K_{{\mathfrak {p}}}}$ is defined by an element in $\mathcal{G}_n({\mathcal{O}_K})\hookrightarrow\mathcal{G}_n(\mathcal{O}_{K_{{\mathfrak {p}}}})$ for every prime ${\mathfrak {p}},$ i.e., $({\mathcal C}_1,\alpha_1)$ and $({\mathcal C}_2,\alpha_2)$ have the same image under $\lambda.$ To show that $\lambda$ is injective, let $({\mathcal C}_1,\alpha_1)$ and $({\mathcal C}_2,\alpha_2)$ be two minimal global degree-$n$-models for $C\to{\mathbb P}^{n-1}_{K}$ with the same image under $\lambda.$ We need to show that $({\mathcal C}_1,\alpha_1)$ and $({\mathcal C}_2,\alpha_2)$ are isomorphic. Let $\alpha:=\alpha_2^{-1}\alpha_1.$ The map $\alpha$ is defined by an element $[\mu,A]\in\mathcal{G}_n(K).$ We can assume that $A\in\operatorname{Mat}_n({\mathcal{O}_K})$ has coprime entries. Since $({\mathcal C}_1,\alpha_1)$ and $({\mathcal C}_2,\alpha_2)$ have the same image under $\lambda,$ in particular they are $\mathcal{O}_{K_{{\mathfrak {p}}}}$-isomorphic for every ${\mathfrak {p}}\in P(\Delta)$, it follows that $A\in\operatorname{GL}_n(\mathcal{O}_{K_{{\mathfrak {p}}}}),$ and so ${\mathfrak {p}}\nmid \det A.$ If ${\mathfrak {p}}\not\in P(\Delta),$ then $E/K_{{\mathfrak {p}}}$ has either reduction types ${\rm I}_0$ or ${\rm I}_1,$ see Lemma \ref{lem:P(Delta)}. But according to Corollary \ref{cor:unique model when IO or I1}, when $E$ has either reduction types ${\rm I}_0$ or ${\rm I}_1,$ there is a unique degree-$n$-model for $C\to{\mathbb P}^{n-1}_{K_{{\mathfrak {p}}}}.$ That means that for ${\mathfrak {p}}\not\in P(\Delta),$ $({\mathcal C}_1,\alpha_1)$ and $({\mathcal C}_2,\alpha_2)$ are isomorphic as degree-$n$-models for $C\to{\mathbb P}^{n-1}_{K_{{\mathfrak {p}}}}.$ Hence $A\in \operatorname{GL}_n(\mathcal{O}_{K_{{\mathfrak {p}}}})$ for every prime ${\mathfrak {p}},$ in particular ${\mathfrak {p}}\nmid\det A.$ Thus $\det A\in\mathcal{O}_K^*$ and $A\in\operatorname{GL}_n({\mathcal{O}_K}).$ Now we will prove the surjectivity of $\lambda.$ We will assume without loss of generality that the defining genus one equation $\phi$ of $C$ has coefficients in ${\mathcal{O}_K}$ and that the associated discriminant is everywhere minimal. If $P(\Delta)=\emptyset$, then the scheme defined by $\phi$ is the unique minimal global degree-$n$-model for $C\to{\mathbb P}^{n-1}_K.$ So, assume $P(\Delta)=\{{\mathfrak {p}}_1,\ldots,{\mathfrak {p}}_m\},\;m\ge1$. Let $({\mathcal C}_i,\alpha_i),$ where $1\le i\le m,$ be a minimal degree-$n$-model for $C\to{\mathbb P}^{n-1}_{K_{{\mathfrak {p}}_i}}.$ We want to construct a minimal global degree-$n$-model $({\mathcal C},\alpha)$ for $C\to{\mathbb P}^{n-1}_{K}$ such that $\alpha^{-1}\alpha_i:({\mathcal C}_i)_K\to{\mathcal C}_K$ is defined by an element in $\mathcal{G}_n(\mathcal{O}_{K_{{\mathfrak {p}}_i}})$ for each $i.$ Let $\phi_i$ be the defining genus one equation of ${\mathcal C}_i$. By virtue of Lemma \ref{lem:Zp isom Z}, we can assume that $\phi_i$ has coefficients in ${\mathcal{O}_K}$ and is obtained from $\phi$ via $[\mu_i,D_iU_i]$ where $D_i=\operatorname{diag}(\pi_i^{r_{i,1}},\ldots,\pi_i^{r_{i,n-1}},1)$, where ${\mathfrak {p}}_i=\pi_i{\mathcal{O}_K}$, $U_i\in\operatorname{GL}_n({\mathcal{O}_K})$ and $\mu_i$ is a scaling element. In fact, we can assume that $U_i\in\operatorname{SL}_n({\mathcal{O}_K})$ by acting by a diagonal matrix whose entries lie in $\mathcal{O}_K^*$. Given integers $m_i>0$, there exists a matrix $U\in\operatorname{SL}_n({\mathcal{O}_K})$ such that $U\equiv U_i\mod \pi_i^{m_i}$ for every $i$, see (\cite{Fiminimise}, Lemma 3.2). We note that $\prod_{i=1}^m D_iUU_j^{-1}D_j^{-1}\equiv\prod_{i\ne j}D_i \mod \pi_j^{m_j}.$ Therefore, the genus one equation $\psi$ obtained from $\phi$ via the transformation $[\prod_{i=1}^m\mu_i,\prod_{i=1}^m D_iU]$ is $\mathcal{G}_n(\mathcal{O}_{K_{{\mathfrak {p}}_j}})$-equivalent to $\phi_j$ for every $j$. Now we want to show that $\psi$ is ${\mathcal{O}_K}$-integral. This will imply that $\psi$ defines a minimal global degree-$n$-model for $C\to{\mathbb P}^{n-1}_{K}$ which is $\mathcal{O}_{K_{{\mathfrak {p}}_j}}$-isomorphic to $({\mathcal C}_j,\alpha_j)$ for every $j$. Hence we will be done with the surjectivity. Assume on the contrary that $\psi$ is not ${\mathcal{O}_K}$-integral. Since $\psi$ is obtained from the ${\mathcal{O}_K}$-integral genus one equation $\phi$ via $[\prod_{i=1}^m\mu_i,\prod_{i=1}^m D_iU]$, it follows that some of the coefficients of the defining polynomials of $\psi$ lie in $\frac{1}{b}{\mathcal{O}_K},\;b=\pi_1^{l_1}\pi_2^{l_2}\ldots \pi_m^{l_m}$, where $l_i\ge 0$ and $l_j>0$ for some $j\in\{1,\ldots,m\}$. We have shown that $\psi$ is $\mathcal{G}_n(\mathcal{O}_{K_{{\mathfrak {p}}_j}})$-equivalent to the ${\mathcal{O}_K}$-integral genus one equation $\phi_j$. It follows that $\psi$ is $\mathcal{O}_{K_{{\mathfrak {p}}_j}}$-integral, which is a contradiction. \end{ProofOf} The calculations included in the following examples are performed using \textsf{MAGMA}, see \cite{magma}. $N_n(T)$ will denote the number of minimal degree-$n$-models when the reduction of the Jacobian is of type $T$. \begin{Example} Consider the elliptic curve $E:y^2+xy=x^3-x^2-617x+5916/{\mathbb Q}$. It has reduction of types ${\rm III}^*$ and ${\rm I}_2$ at its bad primes $5$ and $19$ respectively. The following minimal global genus one equation $\phi_3$ of degree $3$ defines an everywhere locally soluble element $C$ in the $3$-Selmer group of $E$. \begin{eqnarray} 21686353648850 x^3&+&234081254700017 x^2y+9338329782950x^2z+842219868972245xy^2+\nonumber\\ 67198263238095 xyz&+&1340388284750 xz^2+1010096983050575 y^3+120889031707155 y^2z+\nonumber\\ 4822691362750 yz^2&+&64131409475 z^3 =0. \nonumber \end{eqnarray} The number of minimal global degree-$3$-models for $C\to{\mathbb P}^2_K$ is $N_3({\rm III}^*)\times N_3({\rm I}_2)=6\times 2=12$, see Theorem \ref{thm:global models}. These models have defining genus one equations obtained from $\phi_3$ via the following transformations in $\mathcal{G}_3({\mathbb Q})$.\\ \begin{tabular}{cccc} $[1,\operatorname{id}_3]$, & $[1/5,\operatorname{diag}(5,1,1)]$, & $[1/5,\operatorname{diag}(1,5,1)]$, &$[1/25,\operatorname{diag}(5,5,1)]$,\\ $[1/25,\operatorname{diag}(5,1,5)]$, & $[1/25,\operatorname{diag}(1,25,1)]$, & $[1/19,\operatorname{diag}(1,1,19)]$, & $[1/95,\operatorname{diag}(5,1,19)]$,\\ $[1/95,\operatorname{diag}(1,5,19)]$,& $[1/475,\operatorname{diag}(5,5,19)]$, & $[1/475,\operatorname{diag}(5,1,95)]$, & $[1/475,\operatorname{diag}(1,25,19)]$. \end{tabular}\\ We notice that the genus one equations $\phi_3$ is not reduced in the sense of \cite{FiStCr}, but we preferred to write it in that way to make the transformations as simple as possible. \end{Example} \begin{Example} Let $E:y^2+xy+y=x^3-4x-3/{\mathbb Q}$. The curve $C:y^2=-3x^4+2x^3+7x^2-2x-3$ represents an element in the $2$-Selmer group of $E$. A second $2$-descent on $C$ gives the following minimal global genus one equation $\phi_4$ of degree $4$. \begin{eqnarray} x_1^2-x_1x_3-x_2^2+x_2x_4+x_3^2&=&0,\nonumber\\ x_1x_4+x_2^2+x_2x_3-x_2x_4+x_3^2-x_3x_4&=&0.\nonumber \end{eqnarray} The equation $\phi_4$ defines a smooth genus one curve $C_4/{\mathbb Q}$. The discriminant $\Delta$ of $E$ is $185$. Therefore, we have $P(\Delta)=\emptyset$. Hence the minimal global degree-$4$-model ${\mathcal C}$ defined by $\phi_4$ is unique, see Theorem \ref{thm:global models}. \end{Example} \hskip-18pt\emph{\bf{Acknowledgements.}} This paper is based on the author's Ph.D. thesis \cite{SadekThesis} at Cambridge University. The author would like to thank his supervisor Dr. Tom Fisher for all the encouragement and guidance through this work. \bibliographystyle{plain} \footnotesize
\section{Introduction} Recently, Verlinde has proposed the Newtonian law of gravity as an entropic force by using the holographic principle and the equipartition rule~\cite{Ver}. After released his work, the dynamics of apparent horizon in the Friedmann-Robertson-Walker universe~\cite{SG}, the Friedmann equations~\cite{Pad,CCO}, the connection in the loop quantum gravity~\cite{Smo}, holographic actions for black hole entropy~\cite{CM}, and application to holographic dark energy~\cite{LWh} were considered from the entropic force. Furthermore, cosmological implications were reported in \cite{Gao,ZGZ,Wang,WLW,LW,LKL}, and the extension to Coulomb force~\cite{WangT} and the symmetry aspect of entropy force~\cite{Zhao} were investigated. Explicitly, when a test particle with mass $m$ is located near a holographic screen with distance $\Delta x$, the change of entropy on the holographic screen takes the form \begin{equation} \label{eq1} \Delta S= 2\pi m \Delta x \end{equation} in the natural units of $\hbar=c=k_B=1$ and $G=l^2_{pl}$. Considering that the entropy of a system depends on the distance $\Delta x$, an entropic force $F$ could be arisen from the thermodynamical conjugate of the distance \begin{equation} \label{eq2} F \Delta x=T \Delta S \end{equation} which is regarded as an indication that the first law of thermodynamics is satisfied on the holographic screen. Plugging (\ref{eq1}) into (\ref{eq2}) leads to a connection between entropic force and temperature \begin{equation} \label{eq3} F=2\pi m T. \end{equation} Let us assume that the energy $E$ is distributed on the spherical shape of holographic screen with radius $R$, where the mass $M$ is located at the origin of coordinate. Then, we introduce the equipartition rule, the equality of energy and mass, and the holographic principle, respectively, as \begin{equation} \label{eq4} E=\frac{1}{2 }N T,~~E=M,~~N=\frac{A}{G}=4S \end{equation} with the area of the holographic screen $A=4\pi R^2$. These are combined to provide the temperature on the screen \begin{equation} \label{eq5} T=\frac{GM}{2\pi R^2}. \end{equation} Substituting (\ref{eq5}) into (\ref{eq3}), one obtains the Newtonian force law as the entropic force\begin{equation} \label{eq6} F=\frac{G m M}{R^2}. \end{equation} In this work, we will derive the entropic force by replacing the mass $M$ by the Schwarzschild black hole with mass $M$ as \begin{equation} \label{eq7} ds^2_{Sch}=g_{\mu\nu}dx^\mu dx^\nu=-\Big(1-\frac{2GM}{r}\Big)dt^2+\frac{dr^2}{\Big(1-\frac{2GM}{r}\Big)}+r^2d\Omega^2_2. \end{equation} Here the even horizon (EH) is located at $r=r_{EH}=2GM$ whose horizon area is given by $A_{EH}=4\pi r_{EH}^2$. \section{Entropic force in the presence of black hole} It is well known that in the presence of the black hole, we may introduce the local temperature (Tolman temperature) and the local energy on the holographic screen. Now let us first introduce the Tolman redshift transformation on the black hole system~\cite{GPP2}. In general, the local temperature observed by an observer at $r>r_{EH}$ outside the Schwarzschild black hole is defined by~\cite{York} \begin{equation} \label{eq8} T_L(r)= \frac{T_{\infty}}{\sqrt{-g_{tt}}}=\frac{1}{8\pi G M}\frac{1}{\sqrt{1-\frac{2GM}{r}}} \end{equation} where \begin{equation} \label{eq9} T_\infty=\frac{1}{8\pi G M}=\frac{1}{4 \pi r_{EH}}\equiv T_H \end{equation} is the Hawking temperature $T_H$ measured at infinity and the denominator of $\sqrt{-g_{tt}}$ is the red-shifted factor. On the holographic screen at $r=r_{EH}+l_{pl}^2/r_{EH}$ near the event horizon, this local temperature is given by $T=1/8 \pi l_{pl}$ which is independent of the black hole mass $M$~\cite{Myungent}. On the other hand, for $r \gg r_{EH}$, it reduces to the Hawking temperature $T_H$. Similarly, the local energy is given by \begin{equation} \label{loen} E_L(r)= \frac{E_{\infty}}{\sqrt{-g_{tt}}} \end{equation} where the energy observed at infinity is the ADM mass $M$ \begin{equation} \label{loeni} E_{\infty}=M=\frac{r_{EH}}{2G}.\end{equation} Eq.(\ref{loen}) states clearly the UV/IR scaling transformation (Tolman redshift transformation) of the energy between the bulk and the holographic screen. On the holographic screen near the horizon, we have $ E_L(r_{EH}+l_{pl}^2/r_{EH}) \propto A_{EH}$~\cite{MSeo}. However, it is very important to note that there is no difference between the local black hole entropy $S_{L}$ near the horizon and the entropy $S_{\infty}$ at infinity: \begin{equation} \label{entrop} S_{L}=\pi r_{EH}^2=S_\infty,\end{equation} which is surely the Bekenstein-Hawking entropy for the Schwarzschild black hole. That is, the black hole entropy is invariant under the UV/IR transformation. Now we are in a position to derive the entropic force on the holographic screen in the presence of Schwarzschild black hole. To this end, we propose the local equipartition rule \begin{equation} \label{eq11} E_L(r)=2S_{S}(r)T_S(r), \end{equation} where the entropy $S_S$ is defined on the holographic screen located at $r >r_{EH}$ \begin{equation} \label{eq12} S_{S}(r)= \frac{\pi r^2}{G}. \end{equation} Then, the temperature on the screen is given by \begin{equation} \label{eq13} T_S(r)=\frac{GM}{2\pi r^2 \sqrt{-g_{tt}}}. \end{equation} Plugging (\ref{eq13}) into (\ref{eq3}), we obtain the entropic force as \begin{equation} \label{eq14} F_{BH}= 2\pi m T_S(r)= \frac{1}{\sqrt{1-\frac{r_{EH}}{r}}} \frac{GmM}{ r^2} \end{equation} which shows that the mass $m$ feels an infinitely tidal force in the limit of $r \to r_{EH}$, while it takes the Newtonian force law at the large distance of $r\gg r_{EH}$. This is our main result. On the other hand, the temperature $T_S(r)$ on the screen becomes the local temperature $T_L(r)$ in (\ref{eq8}) when using the Bekenstein-Hawking entropy (\ref{entrop}) for (\ref{eq11}). In this case, Eq.(\ref{eq3}) takes a different form \begin{equation} F=2\pi m T_L(r)= \frac{m}{4GM} \frac{1}{\sqrt{1-\frac{r_{EH}}{r}}},\end{equation} which is nothing to do with the entropic force. \section{Discussions} We have obtained the entropic force in the presence of the Schwarzschild black hole by using the local equipartition rule and the holographic principle on the screen. In this case, the local energy $E_L$ together with the entropy $S_S$ on the screen was mainly used to derive the entropic force. When using the local (Tolman) temperature and the Bekenstein-Hawking entropy for the Schwarzschild black hole, we have failed to arrive at the Newtonian force law. At this stage, it is not clear why the latter approach is not suitable for deriving the entropic force. \section*{Acknowledgment} The author thanks Rong-Gen Cai for helpful discussions on entropic force. This work was supported by Basic Science Research Program through the National Research Foundation (NRF) of Korea funded by the Ministry of Education, Science and Technology (2009-0086861) and
\section{Introduction} There is no doubt that level sets of a polynomial function on $\bfR{3}$ are among the easiest surfaces to describe. These surfaces are called algebraic, and the degree of the polynomial defines the order of the algebraic surface. Some examples of surfaces with constant mean curvature (cmc) that are algebraic are planes, spheres, cylinders and Enneper surfaces with order 1, 2, 2 and 9 respectively. The planes and the Enneper surfaces are minimal, that is, they have mean curvature 0. It is known that any algebraic minimal surface in $\bfR{3}$ different from a plane must have order greater than 5, see page 162 of Nitsche book \cite{N}. Here we will be considering non-minimal algebraic surfaces with cmc. The only known examples are the cylinders and the spheres. In this paper we give a first step toward a proof that these surfaces may be the only ones. We prove that the level set of an irreducible polynomial of degree three cannot be a surface with constant mean curvature. The method used consists in finding equations for the coefficients of the polynomial whose level set have cmc. Theoretically, we can get as many equations as we want but the computations needed to get the equations get harder and harder as the number of equations increases as well as the complexity of the equations obtained. The author would like to express his gratitude to Professor William Adkins for giving him references and explanations on the real nullstellensatz theorem. \section{Main Result} Let us start this section with the following lemma, \begin{lem}\label{lemma 1} Let $f:\bfR{n}\to {\bf R}$ be a smooth function, $S=f^{-1}(0)$ and $S_r=\{x\in S:\nabla f(x)\, \ne\, {\bf 0}\}$. The mean curvature of $S_r$ is given by $$ H(x)= \frac{1}{2 (n-1)|\nabla f|^3}\, (2 |\nabla f|^2\Delta f-\<\nabla |\nabla f|^2,\nabla f\>) $$ \end{lem} \begin{proof} Since $-\frac{\nabla f}{|\nabla f|}$ defines a Gauss map on $S_r$, we get that the second fundamental form on $S_r$ is given by $$\hbox{II}(v,w)=\frac{1}{|\nabla f|} \<D^2 f(v),w\>\com{where $D^2f$ is the Hessian matrix of $f$ }$$ If follows that the mean curvature of $S_r$ at a point $x$ is given by $$H(x)=\frac{1}{(n-1)|\nabla f|} \sum_{i=1}^{n-1}\<D^2 f(v_i),v_i\>\com{where $\{v_1,\dots, v_{n-1}\}$ is any orthonormal basis of $T_xS_r$ }$$ The lemma follows by using the following two facts: $\Delta f(x)=\<D^2 f(\frac{\nabla f}{|\nabla f|}),\frac{\nabla f}{|\nabla f|}\>+\sum_{i=1}^{n-1}\<D^2 f(v_i),v_i\>$ and $\<\nabla |\nabla f|^2,\nabla f\>=\nabla f\<\nabla f,\nabla f\>=2 \<D^2f\, \nabla f,\nabla f\>$. \end{proof} \begin{lem}\label{lemma 2} Let $f:\bfR{n}\to {\bf R}$ be an irreducible polynomial. If $f^{-1}(0)$ has constant mean curvature $H$, then there exists a polynomial $p:\bfR{n}\to {\bf R}$ such that $$(2 |\nabla f|^2\Delta f-\<\nabla |\nabla f|^2,\nabla f\>)^2-4(n-1)^2H^2|\nabla f|^6=p\, f$$ \end{lem} \begin{proof} It follows from Lemma \ref{lemma 1} and the following variation of the Real Nullstellensatz Theorem that can be found in page 14 of Milnor's book \cite{M}: {\it Let $V$ be a real or complex algebraic set defined by a single polynomial equation $f(x) = 0$; with $f$ irreducible. In the real case make the additional hypothesis that $V$ contains a regular point of $f$. Then every polynomial which vanishes on $V$ is a multiple of $f$.} \end{proof} As a consequence of the previous lemma we have that the problem of finding algebraic hypersurfaces with constant mean curvature in $\bfR{n}$ reduces to the problem of solving a system of polynomial equations. \begin{thm} If $f:\bfR{3}\to {\bf R}$ is an irreducible polynomial, then $f^{-1}(0)$ cannot be an immersed surface with cmc. \end{thm} \begin{proof} Let us argue by contradiction. Let us assume that $S=f^{-1}(0)$ is a complete constant mean curvature surface different from a sphere or a cylinder. By considering a dilation of $S$ instead if needed, without loss of generality, we may assume that the mean curvature of $S$ is 1. By \cite{K}, we get that the Gauss curvature of $S$ must change sign. It follows that there must exist a non constant curve $\alpha$ in $S$ where the Gauss curvature vanishes. We will consider two cases: Case I when there is point in $\alpha$ where the gradient of $f$ is not the zero vector and Case II when the gradient of $f$ vanishes on $\alpha$. Let $S_r$ be the set of regular points in $S$, that is $$S_r=\{x\in S\subset \bfR{3}: \nabla f(x)\, \ne\, (0,0,0)\}$$ Notice that $S_r$ is not empty, otherwise $M$ will be contained in the quadric $\frac{\partial f}{\partial x_1}^{-1}(0)$. {\bf Case I:} Without loss of generality, we can assume that the origin ${\bf 0}=(0,0,0)$ is in $S_r$ and that the gradient of $f$ at ${\bf 0}$ is the vector $(0,0,1)$; that is, we may assume that $f$ takes the following form \begin{eqnarray*} f&=&a_1\text{ } x_1{}^3+a_2\text{ }x_2{}^3+a_3\text{ }x_3{}^3 +a_4\text{ }x_1{}^2 x_2 +a_5\text{ }x_1{}^2 x_3+a_6 x_2{}^2 x_1+a_7\text{ }x_2{}^2 x_3+a_8\text{ }x_3{}^2 x_1+\\ & &a_9 x_3{}^2 x_2+ a_{10}\text{ }x_1\text{ }x_2\text{ }x_3+b_1 x_1{}^2+b_2 x_2{}^2+b_3 x_3{}^2+b_4 x_1\text{ }x_2+b_5 x_1 x_3 + b_6 x_2\text{ }x_3+x_3 \end{eqnarray*} Since in this case we are assuming that there exists a regular point in $M$ where the Gauss curvature vanishes, we will also assume that the Gauss curvature at ${\bf 0}$ is $0$, and moreover, that $(1,0,0)$ defines a principal direction associated with the principal curvature $2$ and that $(0,1,0)$ defines a principal direction associated with the principal curvature $0$. These assumptions imply that \begin{eqnarray*}\label{set 1} b_1=1,\quad b_2=0\com{and} b_4=0 \end{eqnarray*} If we define the $g:\bfR{3}\to {\bf R}$ by $$ g=2 \nabla f \, \Delta f \, -\, \<\nabla|\nabla f|^2,\nabla f\>\, -\, 4|\nabla f|^3 $$ then, by Lemma \ref{lemma 1} we get that $g(x)=0$ anytime $f(x)=0$. It follows that the gradient of $g$ must be a multiple of the gradient of $f$ near the origin. Therefore the functions $$G_1=\frac{\partial g}{\partial x_1}\frac{\partial f}{\partial x_3}-\frac{\partial g}{\partial x_3}\frac{\partial f}{\partial x_1}\com{and} G_2=\frac{\partial g}{\partial x_2}\frac{\partial f}{\partial x_3}-\frac{\partial g}{\partial x_3}\frac{\partial f}{\partial x_2}$$ must vanish at every point where $f$ vanishes. Using the same argument we have that the functions $$G_{11}=\frac{\partial G_1}{\partial x_1}\frac{\partial f}{\partial x_3}-\frac{\partial G_1}{\partial x_3}\frac{\partial f}{\partial x_1},\, G_{12}=\frac{\partial G_1}{\partial x_2}\frac{\partial f}{\partial x_3}-\frac{\partial G_1}{\partial x_3}\frac{\partial f}{\partial x_2}\com{and} G_{22}=\frac{\partial G_2}{\partial x_2}\frac{\partial f}{\partial x_3}-\frac{\partial G_2}{\partial x_3}\frac{\partial f}{\partial x_2}$$ vanish at every point where $f$ vanishes. Likewise, we can keep using the same argument and define the functions $$G_{111},\, G_{112},\, G_{122},\, G_{222},\, G_{1111},\, G_{1112},\, G_{1122},\, G_{1222},\, G_{2222}$$ $$G_{11111},\, G_{11112},\, G_{11122},\, G_{11222},\, G_{12222}\com{and} G_{22222}$$ When we evaluate the functions above at {\bf 0} we get polynomial equations on the coefficients of $f$. They are of the form $$q_{i_1\dots i_k}=0\com{where} q_{i_1\dots i_k}=G_{i_1\dots i_k}(0,0,0)$$ A direct computation shows that $q_1$ and $q_2$ are given by $$q_1= 4 \left(3 a_1+a_6-3 b_5\right)\com{and} q_2=4 \left(3 a_2+a_4-b_6\right)$$ Therefore, from the equations $q_1 =0$ and $q_2=0$ we get that \begin{eqnarray*}\label{set 2} a_6=-3 a_1+3 b_5\com{and}a_4=-3 a_2+b_6 \end{eqnarray*} A direct computation shows that \noindent\(q_{11}\, =\, -8 \left(6 a_5+a_7-3 \left(-2+2 b_3-a_1 b_5+b_5^2+a_2 b_6\right)\right)\) \noindent\(q_{12}\, =\, -12 \left(a_{10}-2 \left(a_2 b_5+\left(a_1-b_5\right) b_6\right)\right)\) \noindent\(q_{22}\, =\, -8 \left(a_7+3 \left(-a_1 b_5+b_5^2+a_2 b_6\right)\right)\) Therefore, from the equations $q_{11} =0$, $q_{12}$ and $q_{22}=0$ we get that \begin{eqnarray*}\label{set 3} a_5&=& -1+b_3-a_1 b_5+b_5^2+a_2 b_6\\ a_{10} &=& 2 \left(a_2 b_5+\left(a_1-b_5\right) b_6\right)\\ a_7&=& 3 a_1 b_5-3 \left(b_5^2+a_2 b_6\right) \end{eqnarray*} A direct computation shows that \noindent\(q_{111}=24 \left(10 a_8+4 a_1^2 b_5+b_5 \left(13+6 a_2^2-7 b_3+4 b_5^2+a_2 b_6-3 b_6^2\right)+a_1 \left(-23+7 b_3-8 b_5^2+2 a_2 b_6+3 b_6^2\right)\right)\) \noindent\(q_{112}=-24 \left(-2 a_9+4 a_2^2 b_6+\left(2-2 a_1^2+a_1 b_5+b_5^2\right) b_6+a_2 \left(-11+5 b_3-6 a_1 b_5+7 b_5^2+4 b_6^2\right)\right)\) \noindent\(q_{122}=24 \left(12 a_1^2 b_5-a_1 \left(-3+3 b_3+24 b_5^2+10 a_2 b_6+3 b_6^2\right)+b_5 \left(2 a_2^2+7 a_2 b_6+3 \left(-1+b_3+4 b_5^2+b_6^2\right)\right)\right)\) \noindent\(q_{222}=24 \left(20 a_2^2 b_6+3 \left(2 a_1^2-5 a_1 b_5+3 b_5^2\right) b_6+a_2 \left(1+b_3-14 a_1 b_5+15 b_5^2+4 b_6^2\right)\right)\) Therefore, from the equations $q_{111} =0$ and $q_{112}=0$ we get that \begin{eqnarray*}\label{set 4} a_8&=&\frac{1}{10} \big{(}-4 a_1^2 b_5+a_1 \left(23-7 b_3+8 b_5^2-2 a_2 b_6-3 b_6^2\right)-b_5 \left(13+6 a_2^2-7 b_3+4 b_5^2+a_2 b_6-3 b_6^2\right)\big{)}\\ a_9&=&\frac{1}{2} \left(4 a_2^2 b_6+\left(2-2 a_1^2+a_1 b_5+b_5^2\right) b_6+a_2 \left(-11+5 b_3-6 a_1 b_5+7 b_5^2+4 b_6^2\right)\right) \end{eqnarray*} A direct computation shows that \begin{eqnarray*} q_{1111}&=& -\frac{48}{5} \big{(}96 a_1^3 b_5+120 a_2^3 b_6+3 a_1^2 \left(-19+26 b_3-86 b_5^2-4 a_2 b_6-6 b_6^2\right)+\\ & &3 a_1 b_5 \left(73-12 a_2^2-47b_3+76 b_5^2-38 a_2 b_6+12 b_6^2\right)+ \\ & &a_2 b_6 \left(-295+85 b_3+156 b_5^2+30 b_6^2\right)+a_2^2 \left(75+60 b_3+56 b_5^2+110 b_6^2\right)+\\ & & 3 \left(50+50 a_3-54 b_5^2-22 b_5^4+b_3 \left(-50+21 b_5^2\right)-6 b_5^2 b_6^2\right)\big{)}\\ q_{1112}&=&-\frac{24}{5} \big{(}10 a_1^3 b_6-3 a_1^2 b_5 \left(26 a_2+55 b_6\right)+\\ & &b_5\left(-162 a_2^3+223 a_2^2 b_6+a_2 \left(-421+169 b_3+67 b_5^2-139 b_6^2\right)-5 b_6 \left(-27+15 b_3+35 b_5^2+6 b_6^2\right)\right)+\\ & &a_1 \left(-74 a_2^2 b_6+15 b_6 \left(-9+5 b_3+22 b_5^2+2 b_6^2\right)+a_2 \left(496-214 b_3+b_5^2+129 b_6^2\right)\right)\big{)}\\ q_{1122}&=&\frac{24}{5} \big{(}48 a_1^3 b_5-160 a_2^3 b_6-2 a_2^2 \left(-85+70 b_3+181 b_5^2-70 b_6^2\right)+\\ & &2 a_1^2 \left(-183+72 b_3+108 b_5^2+52 a_2 b_6-12 b_6^2\right)+\\ & &3 b_5^2 \left(-117+63 b_3+104 b_5^2+17 b_6^2\right)+3 a_2 b_6 \left(-30+30 b_3+221 b_5^2+20 b_6^2\right)-\\ & &a_1 b_5 \left(-717-312 a_2^2+333 b_3+576 b_5^2+782 a_2 b_6+27 b_6^2\right)\big{)}\\ q_{1222}&=&\frac{24}{5} \big{(}90 a_1^3 b_6+3 a_1^2 b_5 \left(86 a_2+45 b_6\right)+\\ & &b_5 \left(-18 a_2^3+467 a_2^2 b_6+15 b_6 \left(-9+9 b_3+21 b_5^2+8 b_6^2\right)+a_2 \left(-339+231 b_3+513 b_5^2+259 b_6^2\right)\right)-\\ & &a_1 \left(186 a_2^2 b_6+15 b_6 \left(-9+9 b_3+36 b_5^2+8 b_6^2\right)+ a_2 \left(-384+246 b_3+771 b_5^2+379 b_6^2\right)\right)\big{)}\\ q_{2222}&=&48 \big{(}8 a_2^3 b_6+3 a_1 b_5 \left(18-4 a_2^2-12 b_3+12 b_5^2-25 b_6^2\right)+\\ & &9 b_5^2 \left(-3+2 b_3-2 b_5^2+5 b_6^2\right)+a_2 b_6 \left(9+5 b_3+7 b_5^2+18 b_6^2\right)+\\ & &a_1^2 \left(-27+18 b_3-18 b_5^2-4 a_2 b_6+30 b_6^2\right)+a_2^2 \left(-31+28 b_3+22 b_5^2+66 b_6^2\right)\big{)}\\ \end{eqnarray*} By a direct computation we also get that \begin{eqnarray*} q_{11111}&=&24 \big{(}-6 a_1^3 b_5 \left(82 a_2-195 b_6\right)-180 a_1^4 b_6+600 a_2^4 b_6+\\ & &2 a_2^3 \left(-1095+375 b_3+529 b_5^2-420 b_6^2\right)+45 b_5^2 b_6 \left(-14+8 b_3-34 b_5^2+13 b_6^2\right)+\\ & &2 a_2^2 b_6 \left(-345+150 b_3-891 b_5^2+50 b_6^2\right)+\\ & &2 a_1^2 \left(42 a_2^2 b_6+a_2 \left(-903+267 b_3+303 b_5^2-182 b_6^2\right)+15 b_6 \left(-21+12 b_3-111 b_5^2+13 b_6^2\right)\right)+\\ & &a_2 \left(-438 b_5^4+3 b_5^2 \left(-542+58 b_3-583 b_6^2\right)+5 b_6^2 \left(37+13 b_3+44 b_6^2\right)\right)+\\ & &a_1 b_5 \left(-828 a_2^3+1858 a_2^2 b_6-15 b_6 \left(-84+48 b_3-258 b_5^2+65 b_6^2\right)+a_2 \left(3432-708 b_3+324 b_5^2+2138 b_6^2\right)\right)\big{)}\\ q_{11112}&=&-\frac{72}{5} \big{(}72 a_1^4 b_5+2 a_1^3 \left(-477+63 b_3-744 b_5^2-82 a_2 b_6-183 b_6^2\right)+\\ & &2 a_1^2 b_5 \left(1056-250 a_2^2+51 b_3+2016 b_5^2+621 a_2 b_6+404 b_6^2\right)+\\ & &b_5 \big{(}-12 a_2^4+1272 b_5^4-78 a_2^3 b_6-25 b_6^2 \left(-11+11 b_3+9 b_6^2\right)+\\ & &b_5^2 \left(204+354 b_3+76 b_6^2\right)-\\ & &a_2 b_6 \left(-902+498 b_3+476 b_5^2+167 b_6^2\right)-2 a_2^2 \left(-732+253 b_3+150 b_5^2+745 b_6^2\right)\big{)}+\\ & &a_1 \big{(}-3888 b_5^4+396 a_2^3 b_6+25 b_6^2 \left(-11+11 b_3+9 b_6^2\right)+2 a_2^2 \left(-797+243 b_3+410 b_5^2+111 b_6^2\right)-\\ & &2 b_5^2 \left(681+291 b_3+259 b_6^2\right)+2 a_2 b_6 \left(274 b_3-7 \left(78+43 b_5^2-28 b_6^2\right)\right)\big{)}\big{)}\\ q_{11122}&=&-\frac{24}{5} \big{(}120 a_2^4 b_6-a_2^2 b_6 \left(2140+1020 a_1^2-1960 b_3+2720 a_1 b_5-4211 b_5^2+940 b_6^2\right)+\\ & &2 a_2^3 \left(-435+75 b_3+90 a_1 b_5-134 b_5^2+1420 b_6^2\right)+\\ & &3 \left(a_1-b_5\right) b_6 \big{(}180 a_1^3-672 a_1^2 b_5-3 a_1 \left(-418+122 b_3+67 b_5^2-42 b_6^2\right)+\\ & &b_5 \left(-1179+531 b_3+693 b_5^2+124 b_6^2\right)\big{)}+\\ & &a_2 \big{(}1860 a_1^3 b_5-2 a_1^2 \left(-525+465 b_3+2916 b_5^2+844 b_6^2\right)+a_1 b_5 \left(-3006+2364 b_3+6429 b_5^2+8525 b_6^2\right)+\\ & &3 \left(30+60 a_3-10 b_3^2+637 b_5^2-819 b_5^4+350 b_6^2-2249 b_5^2 b_6^2-220 b_6^4-b_3 \left(20+473 b_5^2+350 b_6^2\right)\right)\big{)}\big{)}\\ \end{eqnarray*} A direct computation using a computer program (Mathematica for example) shows that a Groebner Basis for the set of polynomials $$\{q_{122},q_{222},q_{1111},q_{1112},q_{1122},q_{1222},q_{2222},q_{11111},q_{11112},q_{11122}\}$$ with respect to the variables $\left\{a_1,a_2,b_5,b_6,b_3\right\}$ is \(\left\{-1-a_3+b_3,a_2,a_1-b_5\right\}\). Therefore it follows that $$a_2=0,\quad b_5=a_1\com{and} b_3=1+a_3$$ Replacing these and the previous equations for the coefficients of $f$ we get that $$f=\left(1+a_1 x_1+b_6 x_2+a_3 x_3\right) \left(x_1^2+x_3+x_3^2\right)$$ which is a contradiction because $f$ is irreducible. This finishes the proof of Case I. Let us prove case II. Let us assume that the curve $\alpha$ defined above contains the origin, it is parametrized by arc-length and its velocity at the origin is the vector $(1,0,0)$. The assumption made in case II implies that not only $f$ vanishes on the points in $\alpha$ but all the 3 partial derivatives of $f$ vanish on these points. Since we are assuming that the origin is in $S$ then, \begin{eqnarray*} f&=&a_1 x_1^3 + a_2 x_2^3 + a_3 x_3^3 + a_4 x_1^2x_2 + a_5 x_1^2x_3 + a_6x_2^2x_1 + a_7 x_2^2 x_3 + a_8 x_3^2 x_1 + \\ & &a_9 x_3^2 x_2 + a_{10} x_1 x_2 x_3 + b_1 x_1^2 + b_2 x_2^2 + b_3 x_3^2 + b_4 x_1 x_2 + b_5 x_1 x_3 + b_6 x_2 x_3 \end{eqnarray*} Since the functions $t\to \frac{\partial f}{\partial x_i}(\alpha(t))$ vanish, then their derivatives at zero are zero, that is, $\frac{\partial^2 f}{\partial x_i\partial x_1}(0)=0$; therefore $$b_{11}=0,\quad b_4=0 \com{and} b_5=0$$ A direct computation using the fact that $\<\alpha^{\prime\prime}(0),\alpha^{\prime}(0)\>=0$, shows that the second derivative of the function $t\to \frac{\partial f}{\partial x_1}(\alpha(t))$ at zero is $\frac{\partial^3 f}{\partial x_1^3}(0)$; therefore, we also have that $$a_1=0$$ These equations on the coefficients of $f$ imply that $f(x_1,0,0)=0$ for all $x_1\in {\bf R}$, that is, we have that the $x_1$-axis is contained in $S$. Let us define $$u=(2 |\nabla f|^2\Delta f-\<\nabla |\nabla f|^2,\nabla f\>)^2-4(n-1)^2 |\nabla f|^6$$ by either Lemma \ref{lemma 1} or Lemma \ref{lemma 2}, we have that the polynomial in the variable $x_1$, $p_1(x_1)=u(x_1,0,0)$ vanishes. A direct computation shows that the coefficient of $x_1^{12}$ is $-16 (a_4^2 + a_5^2)^3$; therefore, $$a_4=0\com{and} a_5=0$$ If we assume that $a_8\ne 0$, then, a direct computation shows that $f(-\frac{b_3+a_3 x_3}{a_8},0,x_3)=0$ for all $x_3$; therefore, we would have that $p_2(x_3)=u(-\frac{b_3+a_3 x_3}{a_8},0,x_3)$ must also vanish. A direct computation shows that the coefficient of $x_3^{12}$ is $-\frac{16((a10 a3 - a8 a9)^2 + a8^2 (a3^2 + a8^2))^3}{a_8^6}$; therefore, $a_8$ must be zero which contradict the initial assumption that $a_8\ne0$. Therefore $$a_8=0$$ If we assume that $a_6\ne 0$, then, a direct computation shows that $f(-\frac{b2 + a2 x2}{a6},x_2,0)=0$ for all $x_2$; therefore, we would have that $p_3(x_2)=u(-\frac{b2 + a2 x2}{a6},x_2,0)$ must also vanish. A direct computation shows that the coefficient of $x_2^{12}$ is $-\frac{16((a10 a2 - a6 a7)^2 + a6^2 (a2^2 + a6^2))^3}{a_6^6}$; therefore, $a_6$ must be zero which contradict the initial assumption that $a_6\ne0$. Therefore $$a_6=0$$ At this point we may assume that $a_{10}$ is not zero, otherwise $f$ would be independent of $x_1$ which is impossible since the only cylinder that has mean curvature 1 is a circular cylinder. Without loss of generality we may assume that $$a_{10}=1$$ A direct computation shows that for any nonzero $x_2$ and $x_3$ $$f\big{(}\,\frac{-b_2 x_2^2 - a_2 x_2^3 - b_6 x_2 x_3 - a_7 x_2^2 x_3 - b_3 x_3^2 - a_9 x_2 x_3^2 - a_3 x_3^3}{ x_2 x_3}\, ,\, x_2\, ,\, x_3\, \big{)}=0$$ Therefore the polynomial function $$p_4(x_2,x_3)=(x_2x_3)^6\, u\big{(}\,\frac{-b_2 x_2^2 - a_2 x_2^3 - b_6 x_2 x_3 - a_7 x_2^2 x_3 - b_3 x_3^2 - a_9 x_2 x_3^2 - a_3 x_3^3}{ x_2 x_3}\, ,\, x_2\, ,\, x_3\, \big{)}$$ must also vanish. A direct computation shows that the coefficient of the term $x_3^{18}$ of $p_4$ is $-16b_3^6$; therefore, $$b_3=0$$ A direct computation shows that the coefficient of the term $x_3^{24}$ of $p_4$ is $-16a_3^6$; therefore, $$a_3=0$$ Therefore the $f$ takes the following form: $x_2 (b_2 x_2 + a_2 x_2^2 + b_6 x_3 + x_1 x_3 + a_7 x_2 x_3 + a_9 x_3^2)$. This is a contradiction because we are assuming that $f$ is irreducible. This finishes the proof of the theorem. \eop \end{proof}
\section{Introduction} \subsection{Overview} Let $\mathbb{F}$ be a field and $(u,u_2)\in \mathbb{F}[x]^2$ not both zero. It is well-known that there are B\'{e}zout coefficients $(f,f_2)\in \mathbb{F}[x]^2$ such that $f\cdot u+f_2\cdot u_2=\gcd(u,u_2)$, known as a B\'{e}zout\footnote{Etienne B\'{e}zout (1730-1783); according to \cite[p. 115]{Tignol}, the integer case is due to Claude Bachet de M\'eziriac (1581-1638): "Probl\`{e}mes plaisans et d\'{e}lectables qui se font par les nombres", 1624.} identity. (Of course, it easy to check that if $(f,f_2)$ are B\'ezout coefficients for $(u,u_2)$, then so are $(f,f_2)+h\cdot(-u_2,u)/\gcd(u,u_2)$ for any $h\in \mathbb{F}[x]$.) As far as we know, B\'{e}zout coefficients are always computed using the extended Euclidean algorithm. In this paper, we are interested in the case when $(u,u_2)$ arises from a finite sequence. For example, this pair could be the pair of polynomials used to find a minimal one, the successive minimal polynomials or the rational function approximating the 'generating function' of the sequence. All of these are typically relatively prime polynomials. These pairs are all computed using the minimal polynomial algorithm due to the author \cite{N95b}, \cite{N99b}; for a succinct overview, see \cite{N09d}. A natural question is whether there are associated minimal polynomial identities. We answer this in the affirmative for each pair of polynomials and give some applications. Thus let $s=(s_1,\ldots,s_n)\in D^n$ denote a sequence of $n$ terms from a commutative unital integral domain $D$, a 'domain' for short. We prove theorems giving $n$ minimal polynomial identities (possibly with repetitions) associated to $s$, Theorems \ref{fg} and \ref{numu}. It turns out the right-hand sides are equal to the same recursively-defined 'product-of-discrepancies' $\nabla_n\in D\setminus\{0\}$ of Definition \ref{nabla}. There is an implied iterative algorithm of quadratic complexity, Algorithm \ref{MRplusmult}. (When the ground domain is factorial, the identities are in effect B\'ezout identities as the minimal polynomials are relatively prime.) We give a number of applications: the successive 'connection polynomials' of the Berlekamp-Massey algorithm (as developed in \cite{N10a}) either coincide or are relatively prime when $D$ is factorial, Corollary \ref{relprime} and a new (quadratic) algorithm to compute B\'ezout coefficients, which compares favourably with the extended Euclidean algorithm; see Section 7. Another application concerns sequences with perfect linear complexity profile. In Section 8 we give new characterisations of them in terms of minimal polynomials and a simpler proof of a theorem of Wang and Massey characterising binary sequences with perfect linear complexity, \cite{Wangpdf}. Section 9 gives applications to annihilating polynomials which do not vanish at zero. We simplify and extend to $D$ results of \cite{Salagean}, which used definitions of a linear recurring sequence, annihilating and minimal polynomial for finite sequences over $\mathbb{F}$ (with first term $s_0$) equivalent to the non-standard definitions of \cite{N95b}, \cite{N99b}\footnote{We note that \cite{N95b} and \cite{N99b} were cited in \cite{NS-key}.}. First we establish a lower bound lemma which was stated without proof in \cite{Salagean}. The resulting corollary and algorithm do not require any characterisations of minimal polynomials. In particular, the derivation of Algorithm \ref{rewrite2} is similar to \cite{Ma69} and \cite[Algorithm 4.2]{N95b}. Furthermore, our first identity allows us to eliminate a test used in \cite[Algorithm 3.2]{Salagean}. We also construct annihilators that do not vanish at zero by extending the given sequence by one term and give corresponding minimal polynomial identities, Theorem \ref{dge0}. We characterise these annihilators of minimal degree in Theorem \ref{char}; a version over $\mathbb{F}$ was stated without proof in \cite{Salagean}. In the Appendix (Section 10), we give an alternative proof of Lemma \ref{x|min} using reciprocal annihilators and apply it to the complexity of reverse sequences. This gives a new proof of \cite[Theorem 3, p. 149]{IY} on the linear complexity of reverse sequences, initially proved using Hankel matrices over a field and now valid when $D$ is factorial. A preliminary version of this work was presented in May 2010 at Equipe SECRET, Centre de Recherche, INRIA Paris-Rocquencourt, whom the author thanks for their hospitality. \subsection{In More Detail} Our approach is based on the recursive minimal polynomial theorem of \cite{N10a} which is relative to any $\varepsilon\in D$. This gives the next minimal polynomial $\mu^{(n)}$ using a previous one $\mu^{(n-1)}$ and a $\mu'^{(n-1)}$; informally, $\mu'^{(n-1)}$ is a 'prejump' polynomial of $(s_1,\ldots,s_{n-1})$, i.e. a minimal polynomial immediately preceding a jump in the linear complexity $\LC_{n-1}=\deg(\mu^{(n-1)})$ --- we are ignoring the initial cases. We prove inductively that $\mu^{(n)}$ and $\mu'^{(n)}$ are always relatively prime (when $D$ is factorial) and exhibit polynomials $f^{(n)}$ and $f_2^{(n)}$ such that for any domain $D$ $$f^{(n)}\cdot\mu^{(n)}+f_2^{(n)}\cdot\mu'^{(n)}=\nabla_n.$$ We apply this to obtain an identity for $\mu^{(n-1)}$ and $\mu^{(n)}$, Proposition \ref{nextid}. Before discussing our third identity, we need to define another polynomial $\mu_2^{(n)}$ derived from $\mu^{(n)}$ and ${s}$; $\mu_2^{(n)}\in D[x]$ is the {\em polynomial part of the Laurent product} $$\mu^{(n)}\cdot (s_nx^{-n}+\cdots +s_1x^{-1}).$$ In an earlier paper \cite{N95b}, we inductively constructed $\ol{\mu}^{(i)}=(\mu^{(i)},\mu_2^{(i)})\in D[x]^2$ for $1\leq i\leq n$ (possibly with repetitions) such that (i) $\deg(\mu_2^{(i)})<\deg(\mu^{(i)})$ (ii) $\mu^{(i)}\cdot (s_ix^{-i}+\cdots +s_1x^{-1})-\mu_2^{(i)} \equiv 0\bmod(x^{\deg(\mu^{(i)})-i-1})$ (iii) $\mu^{(i)}$ is a solution to (ii) of minimal degree. \noindent See Algorithm \ref{MRplusmult}, which does not use scalar or polynomial division. We called the pair $\ol{\mu}^{(n)}$ a 'minimal realisation' of $s$. If $\mu^{(n)}$ is monic, this gives a rational approximation of $s_1x^{-1}+\cdots +s_nx^{-n}$ with denominator of minimal degree. When $D$ is factorial, minimality easily implies that $\mu^{(n)}$ and $\mu_2^{(n)}$ are relatively prime, so it is natural to ask what their 'coefficients' are. Our third identity is $$-\mu_2'^{(n)}\cdot\mu^{(n)}+\mu'^{(n)}\cdot\mu_2^{(n)}=\nabla_n.$$ Algorithm \ref{MRplusmult} already computes these coefficients, so they can be read off at the end of the $n^{th}$ iteration at no extra cost. The degrees of the coefficients are bounded above by $\LC_{n-1}$. We also show that if $D$ is a field, these coeffients are valid for {\em any} minimal realisation of $s$, Corollary \ref{anyMR}. Secondly, our coefficients agree with the coefficients found by the extended Euclidean algorithm (up to a scalar), Proposition \ref{xea}. We conclude this Introduction by outlining our algorithm for obtaining the B\'{e}zout identity for $(u,u_2)\in D[x]^2$ where $0\leq \deg(u_2)\leq \deg(u)=d$, $u$ is monic and $D$ is a principal ideal domain. The steps are: (i) $2d$ subtractions in $D[x^{-1},x]$ to obtain $s=u_2/u (\bmod \ x^{-2d-1})$ (ii) Algorithm \ref{MRplusmult} for the B\'{e}zout coefficients associated to $s$ (iii) two multiplications in $D[x]$ to obtain $\nabla_{2d}\cdot\gcd(u,u_2)$. This means that we can use Algorithm \ref{MRplusmult} whenever the extended Euclidean algorithm is applied e.g. to compute B\'{e}zout coefficients in $\mathbb{F}[x,y]$ for example. B\'{e}zout identities also arise in the context of the key equation of Coding Theory, see e.g. \cite{McE02}, \cite{N95c}, \cite{NS-key} and it seems likely that the algorithm of \cite[Section 4]{AM} is closely related to the minimal realisation algorithm of \cite{N95b}; see also \cite[Section 8]{N99b}. \section{The Recursive Minimal Polynomial Theorem} \subsection{Notation} Our notation is continued from \cite{N10a}: $\mathbb{N}=\{1,2,\ldots\}$, $n\in\mathbb{N}$ and $D$ is a commutative, unital integral domain with $1\neq 0$, or 'domain' for short. For any set $S$ containing 0, $S^\times=S\setminus\{0\}$. We say that $f\in D[x]^\times$ is monic if its leading term is 1 and the constant term of $f$ is $f_0$. The reciprocal of 0 is 0 and for $f\in D[x]^\times$, its reciprocal is $f^\ast(x)=x^{\deg(f)}f(x^{-1})$. We often write $f=x^eg+h$ for $f(x)=x^eg(x)+h(x)$, where $e\in\mathbb{N}$ and $g,h\in D[x]$. For $f\in D[x]$, $\ol{f}$ denotes an element of $D[x]^2$ with first component $f$ and a certain component $f_2$ (depending on a sequence) to be specified. We regard $D[x]^2$ as a $D[x]$-module by multiplication on each component; e.g. for $e\in\mathbb{N}$, $\Delta\in D$ and $f,f'\in D[x]$ $$x^e\ol{f}+\Delta\cdot\ol{f}'=(x^ef+\Delta\cdot f',x^ef_2+\Delta \cdot f_2').$$ We will also extend $\deg$ to $D[x]^2$ via $\deg(\ol{f})=(\deg(f),\deg(f_2))$ and write $\gcd\ol{f}$ for $\gcd(f,f_2)$. If $\ol{f}=(f,f_2)$, we let $$\tilde{f}=(-f_2,f)$$ We also use $\cdot$ for the {\em inner product} $\ol{f}\cdot\ol{u}=(fu,f_2u_2)$. We write $:D[[x^{-1},x]$ for the domain of Laurent series in $x^{-1}$ over $D$ and let $\vv:D[[x^{-1},x]\ra \mathbb{Z}$ be the exponential valuation. We also use $\vv$ denote its restriction to $D[x^{-1},x]$. Thus $\vv:D[x^{-1},x]\ra \mathbb{Z}$ is $\vv(g)=\max\{i: g_i\neq 0\}$, which coincides with the degree function on $D[x]$. We have $\vv(gg')=\vv(g)+\vv(g')$, $\vv(g+g')\leq \max\{\vv(g),\vv(g')\}$ and $\vv(g+g')= \max\{\vv(g),\vv(g')\}$ if $\vv(g)\neq \vv(g)'$. \subsection{Sequences} Our non-standard approach to finite sequences was based on regarding linear recurring sequences $s:\mathbb{N}\rightarrow D$ as the torsion submodule of a natural $D[x]$-module, \cite[Section 2]{N95b}, \cite[Section 3]{N99b}. We begin with Laurent series in $x^{-1}$, $D[[x^{-1}]$ as standard $D[[x^{-1}]$-module i.e. acting on itself via multiplication. This also makes $D[[x^{-1}]$ into a $D[x]$-module. Let $\ul{s}=\sum_{j\geq 1}s_jx^{-j}$. Then for $f\in D[x]$, put $$f\circ \ul{s}=\sum_{j\geq 1}(f\cdot \ul{s})_{-j}\ x^{-j}.$$ One checks that $\circ$ makes $x^{-1}D[[x^{-1}]]$ into a $D[x]$-module. \begin{definition} (Cf. \cite{S05}, \cite{AS}, \cite{Salagean}) We say that $s$ satisfies a {\em linear recurrence relation} if it is a torsion element i.e. if $\Ann(s)=\{f\in D[x]:\ f\circ \ul{s}=0\}\neq \{0\}$ or if for some $f\in D[x]^\times$ $(f\cdot \ul{s})_{d-j}=0$ for $d-j\leq -1$ where $d=\deg(f)$ i.e. $$ f_0s_{j-d}+\cdots+f_ds_ {j}=0\mbox{ for } d+1\leq j. $$ \end {definition} When $f_d=1$, we can write $s_{j}=-(f_0s_{ j-d}+\cdots+ f_{ d-1}s_{ j-1})$ for $j\geq d+1$ and $s$ is a {\em linear recurring sequence}. Now for $n\in \mathbb{N}$ and $s=(s_1,\ldots,s_n)\in D^n$, let $\overline{s}\in D[x]$ be $\overline{s}(x)=s_1x+\cdots+s_nx^n.$ We will also abbreviate $\overline{s}(x^{-1})=s_1x^{-1}+\cdots+s_nx^{-n}$ to $\ul{s}$, so that $\ul{s}_j=s_{\ -j}$ for $-n\leq j\leq -1$. In the following definition, multiplication of $f\in D[x]$ and $\ul{s}\in D[x^{-1}]$ is in the domain of $D$-Laurent {\em polynomials} $D[x,x^{-1}]$. \begin{definition}[Annihilator, annihilating polynomial] \label{anndefn}(\cite[Definition 2.7, Proposition 2.8]{N95b}, Cf. \cite{AS}, \cite{Salagean})) If $s\in D^n$, then $f\in D[x]$ is an annihilator (or a characteristic polynomial) of $s$ if $f=0$ or $(f\cdot \ul{s})_{d-j}=0$ for $d-n\leq d-j\leq -1$ i.e. $$f_0s_{j-d}+\cdots+f_ds_ {j}=0\mbox{ for } d+1\leq j\leq n$$ where $d=\deg(f)\geq 0$, written $f\in \Ann(s)$. \end{definition} Any polynomial of degree at least $n$ annihilates $s$, vacuously. For $1\leq i\leq n$, we write $s^{(i)}$ for $(s_1,\ldots,s_i)$. The following definition is a functional version of \cite[Definition 2.10]{N95b}. \begin{definition} [Discrepancy Function] We define $\Delta: D[x]^\times\times D^n\ra D$ by $$\Delta(f,s)=(f\cdot\ul{s})_{\deg(f)-n}.$$ \end{definition} Thus $\Delta(f,s)=\sum_{k=0}^{d}f_k \ s_{n-d+k}$ where $d=\deg(f)$. Clearly for $n\geq 2$, $f\in\Ann(s)^\times$ if and only if $f\in\Ann(s^{(n-1)})^\times$ and $\Delta(s,f)=0$. If $s\in D^n$ is understood, we write $\Delta_n(f)$ for $\Delta(f,s)$; if $f$ is also understood, we simply write $\Delta_n$. It is elementary that if $1\leq i\leq n-1$, then $(f\cdot\ul{s^{(i)}})_{\deg(f)-i}=(f\cdot\ul{s})_{\deg(f)-i}$. \section{Minimal Polynomials}\label{mptheory} \begin{definition}[Minimal Polynomial] \label{mindefn} (\cite[Definition 3.1]{N95b}, Cf. \cite{AS}, \cite{Salagean}) We say that $f\in \Ann(s)$ is a minimal polynomial of $s\in D^n$ if $$\deg(f)=\min\{\deg(g):\ g\in \Ann(s)^\times\}$$ and let $\Min(s)$ denote the set of minimal polynomials of $s$. \end{definition} As any $f\in D[x]$ of degree at least $n$ annihilates $s\in D^n$, $\Min(s)\neq \emptyset$. We do not require minimal polynomials to be monic. For any $d\in D^\times$, $d\in \Min(0,\ldots,0)$; if $s_1\neq 0$ and $\deg(f)=1$ then $f\in \Min((s_1))$ since $D$ has no zero divisors. The {\bf linear complexity function} $\LC:D^n\ra\{0\}\cup \mathbb{N}$ is $$\LC(s)=\deg(f)\mbox{ where }f\in\Min(s).$$ We will also write $\LC_n$ for $\LC(s)$ when $s$ is understood and similarly $\LC_j=\LC(s^{(j)})$ for $1\leq j\leq n$. For fixed $s$, $\LC$ is clearly a non-decreasing function of $i$. \subsection{Exponents} \begin{definition}[Exponent Function] For $n\geq 1$, let the exponent function $\ee_n:D[x]^\times \times\mathbb{N}\ra \mathbb{Z}$ be given by $$\ee_n(f)=n+1-2\deg(f).$$ \end{definition} The following lemma is the annihilator analogue of \cite[Lemma 1]{Ma69}. \begin{lemma} \label{elegantproof}(\cite[Lemma 5.2]{N95b}) Let $n\geq 2$, $f\in\Ann(s^{(n-1)})^\times$ and $\Delta_n(f)\neq 0$. (i) For any $g\in\Ann(s)^\times$, $\deg(g)\geq n-\deg(f)= \ee_{n-1}(f)+\deg(f)$. (ii) If $h\in\Min(s)$ then $\deg(g)\geq\max\{\ee_{n-1}(h),0\}+\deg(h)$. \end{lemma} \section{A Recursive Minimal Polynomial Function} We will define a recursive minimal polynomial function $\mu:D^n \ra D[x]$. But first we need the following function (which assumes that $\mu:D^{n-1} \ra D[x]$ has been defined). We also set $\Delta_0=1$. \subsection{The Index Function} \begin{definition}[Index Function]\label{indices} Let $n\geq 1$ and $s\in D^n$. We set $\mu^{(0)}=1$ (so that $\Delta_{1}=\Delta_1(\mu^{(0)})=s_1$) and $\ee_0=1$. Suppose that for $1\leq j\leq n-1$, $\mu^{(j)}\in \Min(s^{(j)})$ has discrepancy $\Delta_{j+1}$ and exponent $\ee_j$. We define the index function $$':\{0,\ldots,n\}\rightarrow \{-1,n-1\}$$ by $0'=-1$ and for $1\leq j\leq n-1$ $$j'=\left \{\begin{array}{ll} (j-1)' &\mbox{ if }\Delta_{j}=0\mbox{ or }(\Delta_{j}\neq 0 \mbox{ and }\ee_{j-1}\leq 0)\\ j-1 & \mbox{ if } \Delta_{j}\neq 0\mbox{ and }\ee_{j-1}>0. \end{array} \right. $$ \end{definition} \subsection{The Recursive Theorem} We recall the recursive function $\mu:D^n\ra D[x]^\times$ of \cite{N10a}: for all $s\in D^n$, $\mu(s)\in\Min(s)$. When $s$ is understood, we will write $\mu^{(j)}$ for $\mu(s^{(j)})$. \begin{definition}[Basis of the Recursion]\label{initialvalues} Recall that $0'=-1$ and $\Delta_0=1$. Let $\varepsilon\in D$ be arbitrary but fixed and $s\in D^n$. We put $\mu^{(-1)}=\mu(s,-1)=\varepsilon$ and $\mu^{(0)}=\mu(s,0)=1$. \end{definition} Thus the exponent of $\mu^{(0)}$ is $\ee_0=1$ and $\Delta_{1}=s_1$. We also recall some notation from \cite{N10a}: (i) $\mu'=\mu\circ\ '$ (where $\circ$ denotes composition) (ii) $\LC'=\deg\circ \mu'$ (iii) $\Delta'=\Delta\circ (+1)\circ\ '\circ (-1)$, where $\pm 1$ have the obvious meanings. \noindent Thus $$\mu'^{(j)}=\mu^{(j')},\ \LC'_j=\LC_{j'}\mbox{ and }\Delta'_{j}=\Delta(\mu^{(k)},s^{(k+1)})=(\mu^{(k)}\cdot \ul{s})_{\LC_k-k-1}$$ where $k=(j-1)'$. \begin{theorem} (Cf. \cite{Ma69}) \label{bit} Let $n\geq 1$ and $s\in D^n$ and assume the initial values of Definition \ref{initialvalues}. Define $\mu^{(n)}$ recursively by$$\mu^{(n)}=\left\{\begin{array}{ll} \mu^{(n-1)}& \mbox{ if } \Delta_n=0\\\\ \Delta'_{n}\cdot x^{\max\{\ee_{n-1},0\}}\ \mu^{(n-1)}-\Delta_{n}\cdot x^{\max\{-\ee_{n-1},0\}}\ \mu'^{(n-1)} &\mbox{ otherwise.}\end{array}\right. $$ If $\Delta_n=0$, clearly $\mu^{(n)}\in \Min(s)$, $\LC_n=\LC_{n-1}$ and $\ee_n=\ee_{n-1}+1$. If $\Delta_{n}\neq 0$ then \begin{tabbing} \hspace{1cm}\=(i) $\deg(\mu^{(n)})=\max\{\ee_{n-1},0\}+\LC_{n-1}=n'+1-\LC'_{n}$\\ \>(ii) $\mu^{(n)}\in \Min(s)$\\ \>(iii) $\ee_n=-|\ee_{n-1}|+1$. \end{tabbing} \end{theorem} \begin{corollary}\label{LL'} (Cf. \cite{Ma69}) For any $s\in D^n$, $\LC_n=n'+1-\LC'_{n}$. \end{corollary} \begin{corollary}[Iterative Form of $\mu$]\label{noindices} Let $n\geq 1$, $s\in D^n$ and $\varepsilon\in D$. Assume the initial values of Definition \ref{initialvalues}. For $1\leq j\leq n$, let $$\mu^{(j)}=\left\{\begin{array}{ll} \mu^{(j-1)} &\mbox{ if } \Delta_{j}=0\\\\ \Delta'_{j} \cdot x^{\max\{\ee_{j-1},0\}} \mu^{(j-1)}- \Delta_{j} \cdot x^{\max\{-\ee_{j-1},0\}} \mu^{'({j-1})}&\mbox{ otherwise.} \end{array}\right. $$ Then $\mu^{(j)}\in\Min(s^{(j)})$. Further, if $\Delta_j=0$, then $\mu^{'(j)}=\mu^{'(j-1)}$, $\Delta'_{j+1}=\Delta'_{j}$ and $\ee_j=\ee_{j-1}+1$. If $\Delta_j\neq 0$ then \begin{tabbing}\hspace{1cm}\= (a) if $\ee_{j-1}\leq 0$ then $\mu^{'(j)}=\mu^{'(j-1)}$ and $\Delta'_{j+1} =\Delta'_{j}$ \\ \>(b) but if $\ee_{j-1}>0$ then $\mu^{'(j)}=\mu^{(j-1)}$ and $\Delta'_{j+1} =\Delta_{j}$ \\ \>(c) $\ee_j=-|\ee_{j-1}|+1$. \end{tabbing} \end{corollary} In other words, when $\Delta_{j}\neq 0$, $$\mu^{(j)}= \left\{\begin{array}{lll} \Delta'_j \cdot \mu^{(j-1)}- \Delta_{j} \cdot x^{-e} \mu'^{(j-1)} & \mbox{if } e=\ee_{j-1}\leq 0\\\\ \Delta'_j \cdot x^{+e}\mu^{(j-1)}- \Delta_{j} \cdot \mu'^{(j-1)} &\mbox{otherwise.} \end{array} \right. $$ See \cite{N10a} for the derivation of the following algorithm from Corollary \ref{noindices}. \begin{algorithm}[Iterative minimal polynomial] \label{rewrite}\ \begin{tabbing} \noindent Input: \ \ \=$n\geq 1$, $\varepsilon\in D$ and $s=(s_1,\ldots,s_{n})\in D^n$.\\ \noindent Output: \>$\mu\in\Min(s)$.\\\\ \{$e := 1$;\ $\mu':=\varepsilon$;\ $\Delta':=1$; $\mu := 1;\ $\\ {\tt FOR} \= $j = 1$ {\tt TO }$n$\\ \> \{$\Delta := \sum_{k=0}^{\frac{j-e}{2}} \mu_k \ s_{k+\frac{j+e}{2}};$ \\ \> {\tt IF } $\Delta \neq 0$ {\tt THEN }\{{\tt IF } $e\leq 0$ \= {\tt THEN } $\mu := \Delta'\cdot \mu-\Delta\cdot x^{-e} \mu'$;\\\\ \> \> {\tt ELSE} \{\=$t := \mu$;\\ \> \> \> $\mu := \Delta'\cdot x^e\mu-\Delta\cdot \mu'$;\\ \> \> \> $\mu':= t$; \ $\Delta':= \Delta$;\\ \> \> \>$e := -e$\}\}\\ \> $e := e+1$\}\\ {\tt RETURN}$(\mu)$\} \end{tabbing} \end{algorithm} \section{Minimal Realisations for $D^n$} We recall the definition of a minimal realisation from \cite{N95b}; when $\mu\in\Min(s)$ is monic, this amounts to rational approximation of $\ul{s}$ by a rational function $\mu_2/\mu$ for a certain $\mu_2\in D[x]$ with $\deg(\mu_2)<\deg(\mu)$ and $\deg(\mu)$ minimal. Recall that $\vv:D[x^{-1},x]\ra \mathbb{Z}$ is $\vv(g)=\max\{i: g_i\neq 0\}$. Let $f\in D[x]^\times$ and $d=\deg(f)$. Then for $s\in D^n$, $\vv(\ul{s})\leq -1$ and $$f\cdot \ul{s}=\sum_{j=-n}^{\vv(\ul{s})+d} (f\cdot \ul{s})_j\ x^j=\left(\sum_{j=-n}^{d-n-1} +\sum_{j=d-n}^{-1} +\sum_{j=0}^{\vv(\ul{s})+d}\right)(f\cdot \ul{s})_j\ x^j$$ \begin{definition} For fixed $s\in D^n$ and $f\in D[x]$, $f_2=f_2(s)\in D[x]$ is the $D[x]$-summand of $f\cdot\ul{s}$: $$f_2(x)= \sum_{j=0}^{\vv(\ul{s})+\deg(f)} (f\cdot \ul{s})_j\ x^j$$ and $\ol{f}=(f,f_2)\in D[x]^2$. \end {definition} Thus $f\cdot\ul{s}=(f\cdot\ul{s}-f_2)+f_2$, and $\deg(f_2)=\vv(\ul{s})+\deg(f)< \deg(f)$. If $f$ is monic, $\vv(f)\vv(f_2/f)=\vv(f_2)$ and $\vv(f_2/f)=\vv(f_2)-\vv(f)<0$ i.e. $\frac{f_2}{f}\in x^{-1}D[[x^{-1}]]$. The next result is immediate, by construction. \begin{proposition} If $s\in D^n$, $f\in \Ann(s)$ if and only if $f=0$ or $\vv(f\cdot \ul{s}-f_2)<\deg(f)-n$. \end{proposition} Thus if $f\in\Ann(s)$ is monic, $\vv(\ul{s}-f_2/f)=\vv(f\cdot\ul{s}-f_2)-\vv(f) \leq \vv(f\cdot\ul{s}-f_2)\leq \deg(f)-n-1$ and $$\ul{s}-\frac{f_2}{f}\equiv 0 \bmod (x^{\deg(f)-n-1}).$$ \begin{definition}[Minimal Realisation](\cite[Sections 2,3]{N95b}) We will say that $\ol{f}\in D[x]^2$ {\em realises} $s$ if either (i) $f=0$ or (ii) $f\neq 0$, $\deg(f_2)<\deg(f)$ and $\vv(f\cdot \ul{s}-f_2)< \deg(f)-n$. Further, $\ol{f}$ is a {\em minimal} {\em realisation} of $s$ if $\ol{f}$ realises $s$ and $f\in \Min(s)$, written $\ol{f}\in \mathrm{MR}(s)$. \end{definition} Then if $f\neq 0$, $\ol{f}\in \mathrm{MR}(s)$ if and only if $f\in\Min(s)$. For $\mu^{(n)}$ as in Theorem \ref{bit}, we write $\mu_2^{(n)}$ for the polynomial part of $\mu^{(n)}\cdot\ul{s}$ $$\mu_2^{(n)}(x)=\sum_{k=0}^{\vv(\ul{s})+d} (\mu^{(j)}\cdot \ul{s})_k\ x^k.$$ By definition, if $\mu_2^{(j)}\neq 0$, then $\deg(\mu_2^{(j)})=\vv(\ul{s^{(j)}})+\deg(\mu^{(j)})<\deg(\mu^{(j)})$ and it is easy to check that $\deg(\mu_2^{(j-1)})\leq \deg(\mu_2^{(j)})$, where $1\leq j\leq n$. If $\Delta_n=0$, then we obviously have $\mu_2^{(n)}=\mu_2^{(n-1)}$. It is convenient to separate out the following special case before extending Theorem \ref{bit} to minimal realisations. \begin{proposition} \label{mu2} Let $n\geq 1$, $s\in D^n$, $\LC_{n-1}=0$ and $\Delta_n\neq 0$. If $\mu_2^{(-1)}=-1$ and $\mu_2^{(0)}=0$, then \begin{eqnarray} \ol{\mu}^{(n)}= \Delta'_n\cdot x^{\max\{\ee_{n-1},0\}}\ \ol{\mu}^{(n-1)}-\Delta_{n}\cdot x^{\max\{-\ee_{n-1},0\}}\ \ol{\mu}'. \end{eqnarray} \end {proposition} \begin{proof} We have to show that the second components of both sides agree. It is clear that $s$ has precisely $n-1$ leading zeroes, which gives the following data: $\Delta_j=0$ for $1\leq j\leq n-1$, $\mu^{(j)}=1$ for $0\leq j\leq n-1$ and $\mu_2^{(n-1)}=0$, $\ee_{n-1}=n$, $(n-1)'=-1$ and $\Delta_n=s_n$, $\Delta'_n=1$. Substituting these gives\, $\mu_2^{(n)}=s_n=\Delta_n\cdot x^n\ \mu_2^{(n-1)}-\Delta_n\cdot\mu'^{(n-1)}_2$, as claimed. \end {proof} An iterative version of the following result (without the value of $\deg(\mu_2^{(n)})$) was proved in \cite{N95b}, \cite{N99b}. For completeness, we prove the recursive form. \begin{theorem} [Recursive MR] \label{bimrt}(Cf. \cite{N95b}) Let $n\geq 1$ and $s\in D^n$. Assume the initial values of Definition \ref{initialvalues} and set $\mu_2^{(-1)}=-1$ and $\mu_2^{(0)}=0$. Define $\ol{\mu}^{(n)}$ recursively by$$\ol{\mu}^{(n)}=\left\{\begin{array}{ll} \ol{\mu}^{(n-1)}& \mbox{ if } \Delta_n=0\\\\ \Delta'_{n}\cdot x^{\max\{\ee_{n-1},0\}}\ \ol{\mu}^{(n-1)}-\Delta_{n}\cdot x^{\max\{-\ee_{n-1},0\}}\ \ol{\mu}'^{(n-1)} &\mbox{ otherwise.}\end{array}\right. $$ If $\Delta_n=0$, clearly $\ol{\mu}^{(n)}\in \MR(s)$, $\LC_n=\LC_{n-1}$ and $\ee_n=\ee_{n-1}+1$. If $\Delta_{n}\neq 0$ then \begin{tabbing} \hspace{1cm}\=(i) $\deg(\mu^{(n)})=\max\{\ee_{n-1},0\}+\LC_{n-1}=n'+1-\LC'_{n}$\\ \> \hspace{0.6cm}and if $\mu_2^{(n)}\neq 0$ then $\deg(\mu_2^{(n)})=\max\{\ee_{n-1},0\}+\deg(\mu_2^{(n-1)})$\\ \> (ii) $\ol{\mu}^{(n)}\in \MR(s)$\\ \>(iii) $\ee_n=-|\ee_{n-1}|+1$.\\ \end{tabbing} \end{theorem} \begin{proof} Put $v=\vv(\ul{s})$, $\mu=\mu^{(n-1)}$, $\LC=\LC_{n-1}$, $e=\ee_{n-1}$, $\mu'=\mu'^{(n-1)}$, $\LC'=\LC'_{n-1}$, $\Delta'=\Delta'_n$ and $\Delta =\Delta_n$. From Theorem \ref{bit}, we have $${\mu}^{(n)}= \Delta'\cdot x^{\max\{e,0\}}\ {\mu}-\Delta\cdot x^{\max\{-e,0\}}\ {\mu'}.$$ First we show that ${\mu_2}^{(n)}= \Delta'\cdot x^{\max\{e,0\}}\ {\mu_2}-\Delta\cdot x^{\max\{-e,0\}}\ {\mu'_2}.$ For $e\leq 0$ \begin{eqnarray*} \mu_2^{(n)}&=&\sum_{j=0}^{v+\LC_n}(\mu^{(n)}\cdot\ul{s})_j\ x^j =\Delta'\cdot\mu_2-\Delta\cdot\sum_{j=0}^{v+\LC}(x^{-e}\mu'\cdot\ul{s})_j\ x^j\\ \end{eqnarray*} since $\LC_n=\LC$. The second summation is $\sum_{k=e}^{v+\LC+e}(\mu'\cdot\ul{s})_k\ x^{k-e}$ \ i.e. $$x^{-e}\left(\sum_e^{-1}+\sum_0^{v+\LC'}+\sum_{v+\LC'+1}^{v+\LC+e}\right)(\mu'\cdot\ul{s})_k\ x^k=A+x^{-e}\mu_2'+B$$ say. Now for $n\geq 1$, $(n-1)'\leq n-2\leq n-2+\LC'$. From Theorem \ref{bit}(i), $\LC=(n-1)'+1-\LC'$ which gives $\LC'-(n-1)'\leq e$ since $\LC\leq n-1$ and so $A=0$. Likewise, $\LC+e=n-\LC=n-1-(n-1)'+\LC'\geq \LC'+1$ and so $B=0$. Thus $\mu_2^{(n)}=\Delta'\cdot \mu_2-\Delta\cdot x^{-e}\ \mu'_2$ if $e\leq 0$. For $e<0$, we have \begin{eqnarray*} \mu_2^{(n)}&=&\sum_{j=0}^{v+n-\LC}\left(\Delta'\cdot x^e\mu\cdot\ul{s} -\Delta\cdot\mu'\cdot\ul{s}\right)_j\ x^j\\ &=&\Delta'\cdot\sum_{j=0}^{v+n-\LC}(x^e\mu\cdot\ul{s})_j\ x^j -\Delta\cdot\sum_{j=0}^{v+n-\LC}(\mu'\cdot\ul{s})_j\ x^j\\ &=&\Delta'\cdot x^e\left(\sum_{k=-e}^{-1}+\sum_{k=0}^{v+\LC}\right)(\mu\cdot\ul{s})_k\ x^k -\Delta_n\cdot\sum_{j=0}^{v+\LC'}(\mu'\cdot\ul{s})_j\ x^j\\ &=&\Delta'\cdot x^e\sum_{k=-e}^{-1}(\mu\cdot\ul{s})_k\ x^k+\Delta'\cdot x^e\mu_2 -\Delta\cdot\mu_2' \end{eqnarray*} since $v+n-\LC-e=v+\LC$ and $v+n-\LC>v+\LC\geq v+\LC'$. From Proposition \ref{mu2}, we can assume that $\LC\geq 1$. This implies that $\LC-(n-1)\leq -e$ and so the first summand vanishes, giving $\mu_2^{(n)}=\Delta'\cdot x^e\mu_2-\Delta\cdot\mu_2' $ if $e>0$.\\ Next we prove that if $\mu_2^{(n)}\neq 0$ then $\deg(\mu_2^{(n)})=\max\{e,0\}+\deg(\mu_2)$. Since $\mu_2\neq 0$, $s^{(n-1)}\neq (0,\ldots,0)$ and so $v'=\vv(s_{n-1}x^{1-n}+\cdots + s_1x^{-1})=v$. Thus $\deg(\mu_2^{(n)})=v+\LC_n=v'+\max\{\LC,n-\LC\} =v'+\LC=\deg(\mu_2)$ if $e\leq 0$. If $e>0$, then $\LC_n=n-\LC=\LC+e$ and $\deg(\mu_2^{(n)})=v+(\LC+e)=(v'+\LC)+e =\deg(\mu_2)+e$. \end {proof} \begin{corollary}[Iterative Form of $\ol{\mu}$]\label{olnoindices} Let $n\geq 1$, $s\in D^n$ and $\varepsilon\in D$. Assume the initial values of Definition \ref{initialvalues}. For $1\leq j\leq n$, let $$\ol{\mu}^{(j)}=\left\{\begin{array}{ll} \ol{\mu}^{(j-1)} &\mbox{ if } \Delta_{j}=0\\\\ \Delta'_{j} \cdot x^{\max\{\ee_{j-1},0\}}\ \ol{\mu}^{(j-1)}- \Delta_{j} \cdot x^{\max\{-\ee_{j-1},0\}}\ \ol{\mu}^{'({j-1})}&\mbox{ otherwise.} \end{array}\right. $$ Then $\ol{\mu}^{(j)}\in\MR(s^{(j)})$. Further, if $\Delta_j=0$, then $\ol{\mu}'^{(j)}=\ol{\mu}'^{(j-1)}$, $\Delta'_{j+1}=\Delta'_{j}$ and $\ee_j=\ee_{j-1}+1$. If $\Delta_j\neq 0$ then \begin{tabbing}\hspace{1cm}\= (a) if $\ee_{j-1}\leq 0$ then $\ol{\mu}'^{(j)}=\ol{\mu}'^{(j-1)}$ and $\Delta'_{j+1} =\Delta'_{j}$ \\ \>(b) but if $\ee_{j-1}>0$ then $\ol{\mu}'^{(j)}=\ol{\mu}^{(j-1)}$ and $\Delta'_{j+1} =\Delta_{j}$ \\ \>(c) $\ee_j=-|\ee_{j-1}|+1$. \end{tabbing} \end{corollary} For future use, we recall: \begin{lemma} \label{f2} Let $s\in D^n$. (i)(\cite[Proposition 2.3]{N95b}, \cite[Lemma 6.1]{N99b}) If $g\in D[x]$, $h\in\Ann(s)$ and $\deg(g)+\deg(h)\leq n$ then $(gh)_2=gh_2$. (ii) If $\deg(f)\leq n-\LC$ and $\deg(f')\leq\LC-\LC'$ then $$(f\cdot\mu+f'\cdot\mu')_2=f\cdot\mu_2+f'\cdot\ \sum_{j=0}^{\LC'-1}\ (\mu'\cdot \ul{s})_j\ x^j.$$ \end {lemma} \begin{proof} (i) Let $H=h\cdot\ul{s}-h_2$, $d=\deg(g)$ and $e=\deg(h)$. Since $h\in\Ann(s)$, $h\ul{s}=H+h_2$ and $(gh)\cdot\ul{s}=g(h\cdot\ul{s})=gH+gh_2$. As $\vv(gH)=\deg(g)+\vv(H)\leq d-n+e-1\leq -1$, $(gh)_2=gh_2$. (ii) Let $d=\deg(f)$. Then from Part (i), $$(f\cdot\mu+f'\cdot\mu')_2= (f\cdot\mu)_2+\sum_{j=0}^{d+\LC}(f'\mu'\cdot\ul{s})_j\ x^j=f\cdot\mu_2+\sum_{j=0}^{d+\LC}(f'\mu'\cdot\ul{s})_j\ x^j$$ and so it suffices to evaluate the second summand. We have $$\mu'\cdot \ul{s}=\left(\sum_{j=-n}^{-n+\LC'-1}+\sum_{j=-n+\LC'}^{-1}+\sum_{j=0}^{\LC'-1}\right)\ (\mu'\cdot \ul{s})_j\ x^j$$ Now $\deg(f')-n+\LC'-1\leq \LC-n-1\leq -1$ since $\LC\leq n$ and the middle summand is zero. Finally, if $\LC'\leq j\leq d+\LC$ then $(\mu\cdot\ul{s})_j=0$ since $\deg(\mu')=\LC'$ and $\ul{s}_{j-\LC'}=0$. \end {proof} \begin{proposition}\label{MRprop} (\cite[Proposition 4.13]{N95b}) Let $n\geq 1$, $s\in D^n$, $f'\in D[x]$ and $\deg(f')\leq -\ee_n$. Then $\ol{\mu}^{(n)}+f'\cdot \ol{\mu}'^{(n)}$ is a minimal realisation of $s$. \end{proposition} \begin{proof} For a proof that ${\mu}^{(n)}+f'\cdot {\mu}'^{(n)}\in\Min(s)$ using the index function, see \cite[Proposition 4.9]{N09d}. The proof that we have a minimal realisation now follows from Lemma \ref{f2}. \end{proof} \begin{theorem}\label{MRthm} (\cite[Theorem 4.16]{N95b}) Let $n\geq 1$, $D$ be a field and $s\in D^n$. If $\ol{f}\in\MR(s)$, then $\ol{f}=\ol{\mu}^{(n)}+f'\cdot \ol{\mu}'^{(n)}$ for some $f'\in D[x]$, where $f'=0$ or $\deg(f')\leq -\ee_n$. In particular, if $\ee_n>0$, then $\ol{\mu}^{(n)}$ is unique. \end{theorem} \subsection{The Iterative Algorithm} As for the minimal polynomial algorithm, we write $\ol{\mu}^{'(j)}$ for $\ol{\mu}^{(j')}$ and then suppress $j$. \begin{algorithm} \label{MRa}\ \begin{tabbing} Input: \ \ \=$n\geq 1$ and $s=(s_1,\ldots,s_{n})\in D^n$.\\ Output: \>$\ol{\mu}\in\MR(s)$ and its MR identity.\end{tabbing} \{$\Delta':=1$;\ $\ol{\mu}' :=(\varepsilon,-1)$;\ $e := 1$;\ $\ol{\mu} := (1,0)$; \begin{tabbing} {\bf for} \= $j = 1$ {\tt TO }$n$\\ \> \{$\Delta := \sum_{k=0}^{\frac{j-e}{2}} \mu_k \ s_{k+\frac{j+e}{2}};$ \\ \> {\tt IF} $\Delta \neq 0$ {\tt THEN }\{{\tt IF } $e\leq 0$ \= {\tt THEN} \=$\ol{\mu} := \Delta'\cdot \ol{\mu}-\Delta\cdot x^{-e}\ \ol{\mu}'$\\ \\ \> \> {\tt ELSE} \{\=$\ol{t}:=\ol{\mu}$;\\ \> \> \> $\ol{\mu}:= \Delta'\cdot x^e\ \ol{\mu}-\Delta\cdot \ol{\mu}'$;\\ \> \> \> $\ol{\mu}' :=\ol{t};\,\Delta':=\Delta$;\\ \> \> \> $e := -e$\}\}\\ \> $e := e+1$;\}\\ {\bf return} $(\ol{\mu})$\} \end{tabbing} \end{algorithm} \begin{table}\label{shortex} \caption{Algorithm \ref{MRa} with input $(0,1,1,0, 0,1,0,1)\in\mathbb{F}_2^8$.} \begin{center} \begin{tabular}{|c|r|r|l|l|l|l|l|l|}\hline $j$ & $\Delta_j$ & $e_{j-1}$ &$\mu^{(j)}$ &$\mu'^{(j)}$& $\mu_2^{(j)}$ & $\mu_2'^{(j)}$\\\hline\hline $0$ &$1$ &$ $ & $1$ & $0$ &$0$ &$1$ \\\hline $1$ &$0$ &$1$ & $1$ &$0$&$0$ &$1$ \\\hline $2$ & $1$ &$2$ & $x^2$ & $1$ &$1$ &$0$ \\\hline $3$ & $1$ &$-1$ & $x^2+x$ & $1$&$1$ &$0$ \\\hline $4$ &$1$ &$0$ & $x^2+x+1$ & $1$&$1$ &$0$ \\\hline $5$ & $1$ &$1$ & $x^3+x^2+x+1$ & $x^2+x+1$&$x$ &$1$ \\\hline $6$ &$0$ &$0$ & $x^3+x^2+x+1$ & $x^2+x+1$&$x$ &$1$ \\\hline $7$ & $1$ & $1$ & $x^4+x^3+1$ & $x^3+x^2+x+1$&$x^2+1$ &$x$ \\\hline $8$ &$1$ & $0$ & $x^4+x^2+x$ & $x^3+x^2+x+1$&$x^2+x+1$&$x$\\\hline \end{tabular} \end{center} \end{table} \begin{example} \label{mrex} (Cf. \cite[Table I]{Salagean}) Table \ref{shortex} gives the values of $\ol{\mu}^{(j)}$ and $\ol{\mu}'^{(j)}$. The reader may check that $\tilde{\mu}'^{(j)}\cdot\ol{\mu}^{(j)}=1$ for $1\leq j\leq 8$ as per Theorem \ref{numu}. \end{example} Over a field, we can produce a monic $\mu$ by dividing by $\Delta'$. We remark that $\mu$ and $\mu_2$ can even be computed in parallel. \section{Minimal Polynomial Identities} \subsection{An Identity for $\mu^{(n)}$ and $\mu'^{(n)}$} \label{gcds} Our first set of identities was suggested by the following result. \begin{proposition} \label{gcd} Let $D$ be a factorial domain and $s\in D^n$. For $1\leq j\leq n$, let $e=\ee_{j-1}$. Then (i) $\gcd(\mu^{(j)},\mu'^{(j)})=1$ (ii) if $\Delta_j\neq 0$ and $p_j\geq 0$ is the highest power of $x$ dividing $\mu^{(j)}$, then $$\gcd(\mu^{(j-1)},\mu^{(j)})=\left\{\begin{array}{ll} x^{\min\{p_{j-1},-e\}} & \mbox{ if } e\leq 0\\ 1 & \mbox{ if } e>0. \end{array} \right. $$ (iii) $\gcd(\mu^{(j)\ast},\mu^{(j-1)\ast})=1$. \end{proposition} \begin{proof} We prove this by induction on $j$, the case $j=0$ being trivial. Suppose inductively that $\gcd(\mu^{(j-1)},\mu'^{(j-1)})=1$. Then $$\mu^{(j)}= \left\{\begin{array}{ll} \Delta_j\cdot \mu^{(j-1)}- \Delta_j\cdot x^{-e} \mu'^{(j-1)} & \mbox{ if } e\leq 0\\ \Delta'_{j} \cdot x^{+e}\mu^{(j-1)}- \Delta_j\cdot \mu'^{(j-1)} &\mbox{ otherwise} \end{array} \right. $$ and $$\mu'^{(j)}= \left\{\begin{array}{ll} \mu'^{(j-1)} & \mbox{ if } e\leq 0\\ \mu^{(j-1)} &\mbox{ if } e>0. \end{array} \right. $$ Thus if $e\leq 0$, then $\gcd(\mu^{(j)},\mu'^{(j)})=\gcd(\mu^{(j)},\mu'^{(j-1)})=\gcd(\mu^{(j-1)},\mu'^{(j-1)})=1$ by the inductive hypothesis. If $e>0$, then $$\gcd(\mu^{(j)},\mu'^{(j)})=\gcd(\mu^{(j)},\mu^{(j-1)})=\gcd(\mu'^{(j-1)},\mu^{(j-1)})=1$$ by the inductive hypothesis. (ii) Suppose that $e\leq 0$. Then $\mu^{(j)}= \Delta'_{j}\cdot \mu^{(j-1)}- \Delta_j\cdot x^{-e}\mu'^{(j-1)}$ and so $\gcd(\mu^{(j-1)},\mu^{(j)})=\gcd(\mu^{(j-1)},x^{-e}\mu'^{(j-1)})= x^{\min\{p_{j-1},-e\}}$ by Part (i). For $e>0$, we have $\mu^{(j)}= \Delta'_j\cdot x^{e}\mu^{(j-1)}- \Delta_j\cdot \mu'^{(j-1)}$ and so $$\gcd(\mu^{(j-1)},\mu^{(j)})=\gcd(\mu^{(j-1)},\mu'^{(j-1)})=1.$$ (iii) Easy consequence of (ii). \end{proof} \begin{corollary} \label{relprime} Let $D$ be factorial and $s\in D^n$. The successive 'connection' polynomials of $s$ (obtained by the Berlekamp-Massey algorithm for $D$ of \cite[Algorithm 5.4]{N10a}) are relatively prime. \end {corollary} \begin{proof} For $1\leq j\leq n$, the successive connection polynomials of $s$ are $\mu^{(j)\ \ast}$ and $\mu^{(j-1)\ \ast}$ by \cite[Corollary 4.10]{N10a}. The result now follows from Proposition \ref{gcd}(iii). \end{proof} We will see that the following inductively defined scalar plays a key role: it turns out to be the right-hand side of all three identities. \begin{definition}\label{nabla} Let $s\in D^n$ and for $1\leq j\leq n$, let $\Delta_{j}$, and $e=\ee_{j-1}$ be as in Theorem \ref{bimrt}. Put $\nabla_0=1$ and for $1\leq j\leq n$, define $\nabla_{j}=\nabla_{j}(s)$ by (i) $\nabla_{j}=\nabla_{j-1}$ if $\Delta_{j}=0$ (ii) $$\nabla_{j}= \left\{\begin{array}{ll} \Delta'_{j}\cdot\nabla_{j-1} & \mbox{if } e\leq 0,\ \Delta_j\neq 0\\\\ \Delta_j\cdot\nabla_{j-1} & \mbox{if } e> 0,\ \Delta_j\neq 0. \end{array} \right. $$ \end{definition} We have $\nabla_1=\Delta_1$ since $e_0=1$. It is easy to see that the $\nabla_{j}$ are always non-zero. We now construct an identity for $\mu^{(n)}$ and $\mu'^{(n)}$. \begin{theorem}\label{fg} Let $D$ be a domain, $s\in D^n$ and for $1\leq j\leq n$, let $e=\ee_{j-1}$ be as in Theorem \ref{bit}. Put $\ol{f}^{(0)}=(1,0)$. Assume inductively that we have defined $\ol{f}^{(k)}$ for $0\leq k\leq j-1$. If $\Delta_j=\Delta_j(\mu^{(j-1)})=0$, put $\ol{f}^{(j)}=\ol{f}^{(j-1)}$. If $\Delta_j\neq 0$, put $$\ol{f}^{(j)}= \left\{\begin{array}{ll} (+f^{(j-1)},\Delta'_j\cdot f_2^{(j-1)}+{\Delta_j}\cdot x^{-e} f^{(j-1)}) & \mbox{ if } e\leq 0\\\\ (-f_2^{(j-1)},\Delta'_j\cdot x^{+e}f_2^{( j-1)}+ {\Delta_j}\cdot f^{( j-1)}) &\mbox{ if } e>0. \end{array} \right. $$ Then for $0\leq j\leq n$, we have $\ol{f}^{(j)}\cdot({\mu}^{(j)},\mu'^{(j)})=\nabla_j$. \end{theorem} \begin{proof} The case $n=0$ is a trivial verification. Suppose that $\ol{f}^{(j)}\cdot(\mu^{(j)},\mu'^{(j)})=1$ for $0\leq j\leq n-1$. Put $\mu=\mu^{(n-1)}$, $e=\ee_{n-1}$, $\Delta =\Delta_n$, $\mu'=\mu'^{(n-1)}$, $\Delta'=\Delta'_n$ and $\ol{f}=\ol{f}^{(n-1)}$. We can assume that $\Delta_n\neq 0$. If $e\leq 0$, we have $\mu'^{(n)}=\mu'$ and \begin{eqnarray*} f^{(n)}\mu^{(n)} &=&f(\Delta'\cdot \mu- \Delta\cdot x^{-e}\mu')=\Delta'\cdot f\mu -\Delta\cdot x^{-e}f\mu'\\ &=&\Delta'\cdot (\nabla_{n-1}-f_2\mu')- \Delta\cdot x^{-e}f\mu'\\ &=&\nabla_n-(\Delta'\cdot f_2+\Delta\cdot x^{-e}f)\mu'=\nabla_n-f_2^{( n)}\mu'^{(n)}. \end{eqnarray*} If $e>0$, we have $\mu'^{(n)}=\mu$. Thus \begin{eqnarray*} f^{(n)}\mu^{( n)}&=& -f_2(\Delta'\cdot x^{e}\mu- \Delta\cdot \mu')= -\Delta'\cdot x^{e}f_2\mu+\Delta\cdot f_2\mu'\\ &=& -\Delta'\cdot x^{e}f_2\mu+\Delta\cdot (\nabla_{n-1}-f\mu) = -(\Delta'\cdot x^{e}f_2+ \Delta\cdot f)\mu+\nabla_n\\ &=& -f_2^{(n)}\mu'^{(n)}+\nabla_n. \end{eqnarray*} \end{proof} When $D$ is a field, these amount to B\'ezout Identities for the $\mu^{(n)}$ and $\mu'^{(n)}$. We see again that $\gcd(\mu^{(n)},\mu'^{(n)})=1$ if $D$ is factorial. The general form of $f_2^{(n)}$ shows that we can compute it iteratively alongside $\mu^{(n)}$ in Algorithm \ref{MRa}. Our first application follows from Proposition \ref{gcd} when $D$ is factorial. \begin{corollary} \label{nonzero} Let $D$ be any domain and $s\in D^n$. If ${\mu}^{(n)}_0=0$ then ${\mu}'^{(n)}_0\neq 0$ and similarly for ${\mu}'^{(n)}_0$. \end {corollary} If needed, we can obtain $\deg(f_2^{(n)})$ from $\deg(f^{(n)})+\LC_n=\deg(f_2^{(n)})+\LC'_n$. \subsection{An Identity for ${\mu}^{(n-1)}$ and $\mu^{(n)}$} We give an identity for ${\mu}^{(n-1)}$ and $\mu^{(n)}$ when $\Delta_n\neq 0$ and $e_{n-1}>0$. When $\Delta_n\neq 0$, $\ee_{n-1}\leq 0$ and $D$ is factorial, there is a similar non-constructive identity (which does not explicitly involve $\nabla_n$). \begin{proposition}\label{nextid} Let $s\in D^n$, $\Delta_n\neq 0$ and $e=\ee_{n-1}$ be as in Theorem \ref{bimrt}. If $e> 0$ and $\ol{f}^{(n-1)}\cdot(\mu^{(n-1)},\mu'^{(n-1)})=\nabla_{n-1}$ then $$(\Delta\cdot f^{(n-1)}+\Delta'\cdot x^{e}f_2^{(n-1)},-f_2^{(n-1)})\cdot({\mu}^{(n-1)},\mu^{(n)})=\nabla_n.$$ \end{proposition} \begin{proof} Put $\mu=\mu^{(n-1)}$, $e=\ee_{n-1}$, $\Delta =\Delta_n$, $\mu'=\mu'^{(n-1)}$, $\Delta'=\Delta'_n$ and $\ol{f}=\ol{f}^{(n-1)}$. The identity is trivial if $n=1$. Suppose that $\ol{f}^{(n-1)}\cdot(\mu^{(n-1)},\mu'^{(n-1)})=1$. Then \begin{eqnarray*} (\Delta\cdot f+\Delta'\cdot x^{e}f_2,-f_2)\cdot({\mu},\mu^{(n)})&=&\Delta \cdot f\mu+\Delta'\cdot x^ef_2\mu-f_2\mu^{(n)}\\ &=&\Delta\cdot (\nabla_{n-1}-f_2\mu')+\Delta' \cdot x^e f_2\mu-f_2\mu^{(n)}\\ &=&\nabla_{n}-\Delta\cdot f_2\mu'+\Delta'\cdot f_2x^e\mu-f_2\mu^{(n)}\\ &=&\nabla_{n}+f_2(\Delta'\cdot x^e\mu-\Delta \cdot \mu')-f_2\mu^{(n)}=\nabla_{n}. \end{eqnarray*} \end{proof} The case $e_{n-1}\leq 0$ is complicated by $\gcd({\mu}^{(n-1)},x^{-e})=x^m$ say. If $m=-e$, one may check that $$(x^{-e}f^{(n-1)}+f_2^{(n-1)})\mu^{(n-1)}-f_2^{(n-1)}\mu^{(n-1)}=\nabla_{n-1}\cdot\gcd({\mu}^{(n)},{\mu}^{(n-1)}).$$ In general, we can apply the following result when $D$ is factorial. \begin{theorem} \label{FN} (\cite[Corollary 2.7]{FN95}) Let $D$ be factorial and $a,b\in D[x]$, not both zero. There are $u\in D$ and $f,g\in D[x]$ such that $fa+gb=u\gcd(a,b)$. \end {theorem} For a specific $s\in D^n$, we may even obtain $u$, $f$ and $g$ by applying algorithm XPRS of \cite{FN95} to ${\mu}^{(n-1)}$ and $\mu^{(n)}$. See also Theorem \ref{newBIt}. It would be useful to have an identity for general $D$ which involves $\nabla_n$ when $\Delta_n\neq 0$ and $e_{n-1}\leq 0$. \subsection{An Identity for $\mu^{(n)}$ and $\mu^{(n)}_2$} Recall that $\ol{\mu}^{(-1)}=(\varepsilon,-1)$, $\ol{\mu}^{(0)}=(1,0)$ and that if $\ol{f}=(f,f_2)$, then $\tilde{f}=(-f_2,f)$. \begin{theorem} \label{numu} For $0\leq j\leq n$, we have $\tilde{\mu}'^{({j})}\cdot\ol{\mu}^{(j)}=\nabla_{j}$. Hence if $ {\mu}^{({j})}_0=0$ then $({\mu}_2^{({j})})_0\neq 0$ and similarly for $({\mu}^{({j})}_2)_0$. \end{theorem} \begin{proof} For $j=0$, we have $(1,\varepsilon)\cdot(1,0)=1=\nabla_0$. Suppose $1\leq j\leq n$ and the result is true for $k\leq j-1$. If $\Delta_j=0$, there is nothing to prove. Otherwise, let $e=\ee_{j-1}$. If $e\leq 0$ then \begin{eqnarray*} \tilde{\mu}'^{(j)}\cdot\ol{\mu}^{(j)}&=&\tilde{\mu}'\cdot\ol{\mu}^{(j)}\\&=& -\mu_2' (\Delta'_{j} \cdot\mu-\Delta_j\cdot x^{-e}\mu') +\mu'(\Delta'_j \cdot\mu_2-\Delta_j\cdot x^{-e}\mu_2')\\ &=&\Delta'_j \cdot( -\mu_2'\mu+\mu'\mu_2) +\Delta_j\cdot x^{-e}(\mu_2'\mu'-\mu'\mu_2')\\ &=&\Delta'_j\cdot \tilde{\mu}'\cdot\ol{\mu}=\Delta'_j\cdot\nabla_{j-1}=\nabla_{j} \end{eqnarray*} and if $e>0$ then \begin{eqnarray*} \tilde{\mu}'^{(j)}\cdot\ol{\mu}^{(j)}&=&\tilde{\mu}\cdot\ol{\mu}^{(j)}\\ &=&-\mu_2 (\Delta'_j\cdot x^{e}\mu-\Delta_j\cdot \mu')+ \mu(\Delta'_j \cdot x^{e}\mu_2-\Delta_j\cdot \mu_2')\\ &=&\Delta'_j \cdot x^{e}(-\mu_2\mu+\mu\mu_2) +\Delta_j\cdot (-\mu_2'\mu+\mu'\mu_2)\\ &=&\Delta_j\cdot \tilde{\mu}'\cdot\ol{\mu}=\Delta_j\cdot \nabla_{j-1}=\nabla_{j} \end{eqnarray*} which completes the induction. \end{proof} When $D$ is a field, the identity for ${\mu}^{(n-1)}$ and $\mu^{(n)}$ of Theorem \ref{numu} amounts to a B\'ezout identity. The following result was proved differently in \cite[Corollary 3.24]{N95b}. \begin{corollary} Let $D$ be a factorial domain and $s\in D^n$. Then $\gcd(\ol{\mu}^{(j)})\in D$ for $1\leq j\leq n$. \end{corollary} \begin{corollary} \label{anyMR} Let $D$ be a field and $s\in D^n$. Then for $0\leq j\leq n$, $\tilde{\mu}'^{({j})}$ are {B\'{e}zout} coefficients of any minimal realization of $s$. \end{corollary} \begin{proof} Let $\ol{m}$ be a minimal realization of $s$. By Theorem \ref{MRthm}, $\ol{m}=\ol{\mu}^{(n)}+m'\ol{\mu}'^{(n)}=\ol{\mu}+m'\ol{\mu}'$ say, where $\deg(m')\leq -\ee_n$. Now $\tilde{\mu}'\cdot\ol{\mu}'=0$ gives $$\tilde{\mu}'\cdot\ol{m}=\tilde{\mu}'\cdot\ol{\mu}+m'\tilde{\mu}'\cdot\ol{\mu}'=\tilde{\mu}'\cdot\ol{\mu}=\nabla_{n}.$$ \end{proof} \begin{proposition} \label{xea} Let $D$ be a field, $s\in D^n$ and B\'ezout coefficients $\ol{a}$ be computed for $\ol{\mu}^{(n)}$ by the extended Euclidean algorithm. Then $\nabla_{n}\cdot\ol{a}=\tilde{\mu}'^{(n)}$. \end{proposition} \begin{proof} Put $\ol{a}=(a,a_2)$, $\ol{\mu}=\ol{\mu}^{(n)}$, $\ol{\mu}'=\ol{\mu}'^{(n)}$ and $\nabla=\nabla_{n}$. We have $\ol{a}\cdot\ol{\mu}=\gcd(\ol{\mu})=1=\nabla^{-1}\cdot\tilde{\mu}'\cdot\ol{\mu}$. Hence $(a+\nabla^{-1}\mu_2')\mu=- (a_2-\nabla^{-1}\mu')\mu_2$. If $a_2-\nabla^{-1}\mu_2=0$, we are done. Otherwise $\mu|(a_2-\nabla^{-1}\mu')$ since $\gcd(\ol{\mu})=1$. This is impossible since $\deg(a_2-\nabla^{-1}\mu')<\deg(\mu)$. Thus $\ol{a}=\nabla^{-1}\tilde{\mu}'$. \end{proof} We can also apply Theorem \ref{numu} to linear recurring sequences. \begin{proposition} \label{lrs} Let $D$ be a principal ideal domain and $s\in D^n$ be a linear recurring sequence with minimal polynomial $\mu$. There are explicit $\ol{f}\in D[x]^2$ and $\nabla\in D\setminus\{0\}$ such that $\ol{f}\cdot\ol{\mu}=\nabla$. \end{proposition} \begin{proof} Apply Theorem \ref{numu} to $s^{(2\deg(\mu))}$. \end{proof} \subsection{The Iterative Algorithm} The following extension of Algorithm \ref{MRa} is immediately implied by Theorem \ref{numu}. \begin{algorithm} \label{MRplusmult}\ \begin{tabbing} Input: \ \ \=$n\geq 1$ and $s=(s_1,\ldots,s_{n})\in D^n$.\\ Output: \>$\ol{\mu}\in\MR(s)$ and the MR identities of $s$.\\\\ \{$\ol{\mu}' :=(\varepsilon,-1)$;\ $\Delta':=1$;\ $e := 1;$\ $\ol{\mu} := (1,0)$;\\\\ $\nabla:= 1$;\\ {\tt FOR} \= $j = 1$ {\tt TO }$n$\\ \> \{$\Delta := \sum_{k=0}^{\frac{j-e}{2}} \mu_k\ s_{k+\frac{j+e}{2}};$ \\ \> {\tt IF} $\Delta \neq 0$ {\tt THEN }\{{\tt IF} $e\leq 0$ \= {\tt THEN} \{\=$\ol{\mu} := \Delta'\cdot \ol{\mu}-\Delta\cdot x^{-e}\ \ol{\mu}'$;\\ \> \> \> $\nabla:=\Delta'\cdot \nabla$\}\\ \> \> {\tt ELSE} \{\=$\ol{t}:=\ol{\mu}$;\\ \> \> \> $\ol{\mu}:= \Delta'\cdot x^e\ \ol{\mu}-\Delta\cdot \ol{\mu}'$;\\ \> \> \> $\ol{\mu}' :=\ol{t};\,\Delta':=\Delta$;\\ \> \> \> $\nabla:=\Delta\cdot\nabla;$\\ \> \> \> $e := -e$\}\}\\ \> $e := e+1$;\}\\ {\tt RETURN} $(\ol{\mu},\tilde{\mu}',\nabla)$;\} \end{tabbing} \end{algorithm} We could also compute $\nabla_j$ at the end of iteration as $\ol{f}\cdot\ol{\mu}^{(j)}$, but this would increase the complexity of the algorithm. \begin{table} \label{shortexM} \caption{Theorem \ref{numu} with $s=(1,0,1,1,0,1)\in \mathrm{GF}(2)^{6}$.} \begin{center} \begin{tabular}{|c|r|l|l|l|l|l|l|}\hline $j$ & $e$ & $\Delta$ &$\ol{\mu}$ & $\ol{\mu}'$ &$\tilde{\mu}'$ \\\hline\hline $1$ &$1$ &$1$ &$(x,1)$ & $(1,0)$ &$(0,1)$\\\hline $2$ & $0$ &$0$ &$(x,1)$& $(1,0)$ &$(0,1)$\\\hline $3$ & $1$ &$1$ &$(x^2+1,x)$ &$(x,1)$ &$(1,x)$ \\\hline $4$ &$0$ &$1$ &$(x^2+x+1,x+1)$ & $(x,1)$ &$(1,x)$\\\hline $5$ & $1$ &$0$ &$(x^2+x+1,x+1)$ &$(x,1)$ &$(1,x)$\\\hline $6$ & $2$ &$0$ &$(x^2+x+1,x+1)$& $(x,1)$ &$(1,x)$\\\hline \end{tabular} \end{center} \end{table} \begin{example} \label{Bezoutex} Let $s=(1,0,1,1,0,1)\in \mathrm{GF}(2)^{6}$. Then $$\ol{f}^{(3)}\cdot\ol{\mu}^{(3)}=1\cdot (x^2+1)+x\cdot x=1$$ $$\ol{f}^{(j)}\cdot\ol{\mu}^{(j)}=1\cdot (x^2+x+1)+x\cdot(x+1)=1\mbox{ for }4\leq j\leq 6.$$ \end{example} \section{Perfect Linear-Complexity Profile} The following generalisation of a definition from \cite{Rueppel} to any domain $D$ makes sense by Theorem \ref{bit}. \subsection{Basics} \begin{definition} A sequence $s\in D^n$ has a {\em perfect linear-complexity profile (PLCP)} if $\LC_j = \lfloor \frac{j+1}{2}\rfloor$ for $1\leq j\leq n$. \end {definition} It is easy to see that for $D=\mathbb{F}_2$, the sequences of length 1 to 4 with a PLCP are $(1)$, $(1,s_2)$, $(1,1,0), (1,0,1)$ and $(1,1,0,s_4), (1,0,1,s_4)$. See Table \ref{plcp}.2 for the corresponding $\ol{\mu}^{(j)}$, where $\Delta_j=\Delta(\mu^{(j-1)})$. Recall that for any sequence, $\mu^{(0)}=1$ and $e_0=1$. \begin{proposition} \label{basictfae}\tfae (i) $s$ has a PLCP (ii) for $1\leq j\leq n$ $$e_j= \left\{\begin{array}{rl} 1& \mbox{if } j \mbox{ is even}\\ 0 &\mbox{otherwise,} \end{array} \right. $$ (iii) $\Delta_{j}\neq 0$ for all odd $j$, $1\leq j\leq n$ (iv) $\ol{\mu}^{(1)}=(x+\varepsilon,1)$ and for $2\leq j\leq n$ $$\ol{\mu}^{(j)}= \left\{\begin{array}{ll} \Delta_{j-1}\cdot \ol{\mu}^{(j-1)}-\Delta_j\cdot\ol{\mu}^{(j-2)}&\mbox{ if } j \mbox{ is even}\\\\ \Delta_{j-2}\cdot x\ol{\mu}^{(j-1)}-\Delta_{j}\cdot\ol{\mu}^{(j-3)}& \mbox{ otherwise.} \end{array} \right. $$ \end {proposition} \begin{proof} (i) $\Leftrightarrow$ (ii): Easy consequence of the definitions. (i) $\Rightarrow$ (iii): If $j\leq n+1$ is odd then $\Delta_j\neq 0$, for otherwise $\frac{j-1}{2}+1=\frac{j+1}{2}=\LC_{j}=\LC_{j-1}=\frac{j-1}{2}$. (iii) $\Rightarrow$ (i): Let $\Delta_{j}\neq 0$ for all odd $j$, $1\leq j\leq n+1$. Then $s_1\neq 0$, $\LC_1=1$ and $\ee_1=0$. If $\Delta_2=0$, then $\LC_2=\LC_1=1$, otherwise $\LC_2=\max\{\ee_1,0\}+1=1$, so that $\LC_2$ is as required. Suppose that $j\leq n$ is odd and $\LC_{k}=\lfloor\frac{k+1}{2}\rfloor$ for all $k$, $1\leq k\leq j-1$. We have $\LC_j=j-\LC_{j-1}=j-\frac{j-1}{2}=\lfloor\frac{j+1}{2}\rfloor$. If $j=n+1$, we are done. Otherwise, if $\Delta_{j+1}=0$, we have $\LC_{j+1}=\LC_j=\lfloor\frac{j+1}{2}\rfloor=\lfloor\frac{j+2}{2}\rfloor$, whereas if $\Delta_{j+1}\neq 0$, $\LC_{j+1}=j+1-\LC_j=j+1-\lfloor\frac{j+1}{2}\rfloor=\lfloor\frac{j+2}{2}\rfloor$. (ii) $\Ra$ (iv): We have $$\ol{\mu}^{(j)}= \Delta'_{j}\cdot x^{\max\{\ee_{j-1},0\}}\ \ol{\mu}^{(j-1)}-\Delta_j\cdot x^{\max\{-\ee_{j-1},0\}}\ \ol{\mu}'^{(j-1)}$$ where $\Delta_j$ may be zero and $\ee_{j-1}$ is as usual. If $j$ is even then $\Delta_{j-1}\neq 0$ and $\ee_{j-2}=1$, so $i=j-2$; if $j$ is odd then $e_{j-2}=0$ and $e_{j-3}=1$ so $(j-2)'=j-3$. Inserting $\ee_{j-1}$ now gives the formulae for $\ol{\mu}$. (Note that $(j-1)'+1$ is always odd, so that $\Delta'_j\neq 0$.) (iv) $\Ra$ (ii): We have $\LC_1=1$, $\LC_j=\LC_{j-1}$ if $j$ is even and $\LC_j=\LC_{j-1}+1$ if $i$ is odd. Thus if $j$ is odd, $\ee_j=j+1-2\LC_j=j+1-2(\LC_{j-1}+1)=j+1-2\LC_{j-1}=\ee_{j-1}+1$. Applying this inductively gives (ii). \end {proof} \begin{remarks} (i) We applied Theorem \ref{bimrt} to $s\in D^n$, not to $(\Delta_1,\ldots,\Delta_{n})\in D^n$ as stated in \cite{Wangpdf}. (ii) If $s$ is an infinite linear recurring sequence [i.e. $\ul{s}\in D[[x^{-1}]]$ is a rational function $g/f$ with $\deg(g)<\deg(f)$] then $\lim_{n\ra\infty}\ee_{n}=\infty$ whereas if $s$ has a PLCP, trivially $\ul{\lim}_{n\ra\infty}\ee_{n}=0$, $\ol{\lim}_{n\ra\infty}\ee_{n}=1$ but $\lim_{n\ra\infty}\ee_{n}$ does not exist. So linear recurring sequences never have PLCP. (iii) For an infinite sequence $s$, Proposition \ref{basictfae} is consistent with \cite{Nied86b}. Let $$\mathrm{K}(\ul{s})=\sup_{n\geq 1}\{\deg(A_n)\}$$ as in \cite{Nied86b}. Then if $\ul{s}$ is not a rational function and has partial quotients $A_i$, Theorem 1 of \cite{Nied86b} implies that for all $n$, $1-\mathrm{K}(\ul{s})\leq \ee_n\leq \mathrm{K}(\ul{s})$ and $s$ has PLCP if and only if $\ul{s}$ is not a rational function and $\mathrm{K}(\ul{s})=1$ \cite[Theorem 3]{Nied86b}. \end{remarks} \begin{proposition} \label{count} If $D=\mathbb{F}_q$, then $|\{s\in D^n:\ s \mbox{ has PLCP}\}|= (q-1)^{\lceil \frac{n}{2}\rceil}q^{\lfloor \frac{n}{2}\rfloor}$, and if $|D|=\infty$ then $\{s\in D^n:\ s \mbox{ has PLCP}\}$ is infinite. \end {proposition} \begin{proof} A sequence $s$ determines $(\Delta_1,\ldots,\Delta_{n})\in D^n$ uniquely, and conversely. Thus the result follows from Proposition \ref{basictfae}(iii). \end {proof} \begin{table} \label{plcp} \caption{$\ol{\mu}^{(j)}$, ${\sigma}^{(j)}\in \mathbb{F}_2[x]$ for $0\leq i\leq 4$.} \begin{center} \begin{tabular}{|r|l|l|}\hline $j$ & $\ol{\mu}^{(j)}$&$\sigma^{(j)}$\\\hline\hline $0$ & $(1,0)$&$1$\\\hline $1$ & $(x,1)$&$x+1$\\\hline $2$ & $(x+\Delta_1,1)$&$(\Delta_1+1)x+1$\\\hline $3$ & $(x^2+\Delta_1 x+1,x)$&$(\Delta_1+1)x^3+x+1$\\\hline $4$ & $(x^2+(\Delta_1+\Delta_3)x+1,x+\Delta_3)$&$(\Delta_1+1)x^3+(\Delta_1\Delta_3+1)x+1$\\\hline \end{tabular} \end{center} \end{table} It follows that without loss of generality, we may assume that $n$ is odd. It is easy to see that for odd $n$, $\ol{\mu}^{(n)}+c\cdot \ol{\mu}'^{(n)}=\ol{\mu}^{(n)}+c\cdot \ol{\mu}^{(n-1)}\in \mathrm{MR}(s)$ for any $c\in D$. \begin{corollary} Let $D$ be a field and $\ol{\mu}^{(j)}$ and $\Delta_j=\Delta_j(\mu^{(j-1)})$ be as in Theorem \ref{MRthm} for $1\leq j\leq n$. If $s$ has PLCP, then $$\mathrm{MR}(s^{(j)})= \left\{\begin{array}{ll} \{\ol{\mu}^{(j-1)}-\frac{\Delta_j}{\Delta_{j-1}}\cdot\ol{\mu}^{(j-2)}\} & \mbox{ if } j \mbox{ is even}\\\\ \{(x+c)\cdot\ol{\mu}^{(j-1)}-\frac{\Delta_j}{\Delta_{j-2}}\cdot\ol{\mu}^{(j-3)}:\ c\in D\}&\mbox{ otherwise.} \end{array} \right. $$ \end {corollary} \begin{proof} If $j$ is even, then $s^{(j)}$ has a unique monic minimal realisation by Theorem \ref{MRthm}. Similarly if $j$ is odd, any monic minimal realisation of $s^{(j)}$ is $$\ol{\mu}^{(j)}+c\cdot\ol{\mu}'^{(j)} =(x\ol{\mu}^{(j-1)}-\frac{\Delta_j}{\Delta_{j-2}}\cdot\ol{\mu}^{(j-3)})+c\cdot\ol{\mu}^{(j-1)}=(x+c)\cdot\ol{\mu}^{(j-1)}-\frac{\Delta_j}{\Delta_{j-2}}\cdot\ol{\mu}^{(j-3)}$$ for some $c\in D$. \end {proof} \begin{corollary} \label{plcpcoeffs} If $s$ has PLCP then for $2\leq j\leq n$, then $\ol{g}^{(j)}\cdot\ol{\mu}^{(j)}=\nabla_{j}$ where $$\ol{g}^{(j)}=\left\{\begin{array}{ll} (-\mu_2^{(j-2)},\mu^{(j-2)}) & \mbox{if } j \mbox{ is even}\\\\ (-\mu_2^{(j-1)},\mu^{(j-1)}) &\mbox{otherwise} \end{array} \right. $$ and $$\nabla_{j}=\left\{\begin{array}{ll} (\Delta_{j-1}\cdot\Delta_{j-3}\cdots \Delta_1)^2 & \mbox{if } j \mbox{ is even}\\\\ \Delta_j\cdot (\Delta_{j-2}\cdot\Delta_{j-4}\cdots \Delta_1)^2 &\mbox{otherwise.} \end{array} \right. $$ \end {corollary} \begin{proof} We have $g^{(j)}=\tilde{\mu}'^{(j)}$ and $j'=j-2$ if $j$ is even and $j'=j-1$ if $j$ is odd. To verify the values for $\nabla_{j}$, we have $e_j=1$ if $j$ is even and $e_j=0$ if $j$ is odd. Thus if $j\geq 2$ is even, $\nabla_{j}=\Delta_{j-1}\cdot\nabla_{j-1}$ and if $j$ is odd, $\nabla_{j}=\Delta_{j}\cdot\nabla_{j-1}$, which easily yields the stated formulae. \end {proof} With $D=\mathbb{F}_2$ for example, $(0,1)\cdot(x+\Delta_1,1)=1$ and $(1,x+\Delta_1)\cdot(x^2+\Delta_1 x+1,x) =(x^2+\Delta_1 x+1) +x(x+\Delta_1 )=1$. \subsection{Binary Sequences} Here we give a simpler proof of a theorem of Wang and Massey \cite{Wangpdf} on binary sequences via B\'ezout coefficients. Thus $D=\mathbb{F}_2$ throughout this subsection. Let us call $s\in D^n$ {\em stable} if $s_1=1$ and for even $j$, $2\leq j\leq n$, $s_{j+1}=s_j+s_{\frac{j}{2}}$. It is convenient to use two auxiliary functions $$\ul{t}=\ul{t}(s)=\ul{s}^2+(x+1)\ul{s}+1$$ and $$\sigma^{(j)}=\nu^{(j)2}+(x+1)\nu^{(j)}\mu^{(j)}+\mu^{(j)2}$$ where $\ol{\mu}^{(j)}=(\mu^{(j)},\nu^{(j)})$ is as in Proposition \ref{basictfae}(iv); $\ul{t}$ is also used in the continued fraction treatment of this theorem in \cite{Nied87} (for infinite sequences). First we have the following simple consequence of the definitions. \begin{proposition} $\mu^{(n)2}\ \ul{t}=\sigma^{(n)}+F$ where $\vv(F)\leq 0$ if $n$ is even and $\vv(F)\leq 1$ if $n$ is odd. \end {proposition} \begin{lemma} \label{ult} Let $n$ be odd. \tfae (i) $s$ is stable (ii) $t_j=0$ for $j$ even, $0\leq j\leq n$. \end {lemma} \begin{proof} We have $t_0=s_1+1$ and for all even $j$, $2\leq j\leq {n-1}$, we have ${t}_j=s_j+s_{j+1}+s_{\frac{j}{2}}$. \end {proof} The innocuous-looking part (ii) of the following lemma is essential to our proof. \begin{lemma} (Cf. \cite[Lemma 1]{Wangpdf})\label{sigma} If $s$ has PLCP then (i) for $2\leq j\leq n$, $$\sigma^{(j)}=\left\{\begin{array}{ll} \sigma^{(j-1)}+\Delta_i\cdot \sigma^{(j-2)} +\Delta_j\cdot (x+1)& \mbox{if } j \mbox{ is even}\\\\ x^2\sigma^{(j-1)}+\sigma^{(j-3)}+x(x+1) &\mbox{otherwise} \end{array} \right. $$ (ii) for $0\leq j\leq n$, $\sigma^{(j)}_0=1$ and $\sigma^{(j)}_2=0$. \end {lemma} \begin{proof} Put $\nu=\mu_2$. If $j$ is odd, $\ol{\mu}^{(j)}=x\ol{\mu}^{(j-1)}+\ol{\mu}^{(j-3)}$, so \begin{eqnarray*}\sigma^{(i)}&=&[x^2\nu^{(j-1)2}+\nu^{(j-3)2}]+(x+1)[x\mu^{(j-1)}+\mu^{(j-3)}][x\nu^{(j-1)}+\nu^{(j-3)}]\\&&\ \ +[x^2\mu^{(j-1)2}+\mu^{(j-3)2}]\\ &=&x^2\sigma^{(j-1)}+[\nu^{(j-3)2}+\mu^{(j-3)2}]+(x+1)[x\mu^{(j-1)}\nu^{(j-3)}+x\mu^{(j-3)}\nu^{(j-1)}+\mu^{(j-3)}\nu^{(j-3)}]\\ &=&x^2\sigma^{(j-1)}+\sigma^{(j-3)}+x(x+1)[\nu^{(j-1)}\mu^{(j-3)}+\mu^{(j-1)}\nu^{(j-3)}]. \end{eqnarray*} We have $\ol{\mu}^{(j-1)}=\ol{\mu}^{(j-2)}+\Delta_{j-1}\cdot\ol{\mu}^{(j-3)}$, so \begin{eqnarray*}\nu^{(j-1)}\mu^{(j-3)}+\mu^{(j-1)}\nu^{(j-3)}&=&[\nu^{(j-2)}+\Delta_{j-1}\cdot\nu^{(j-3)}]\mu^{(j-3)} +[\mu^{(j-2)}+\Delta_{j-1}\cdot\mu^{(j-3)}]\nu^{(j-3)}\\ &=&\nu^{(j-2)}\mu^{(j-3)}+\mu^{(j-2)}\nu^{(j-3)} +2\Delta_{j-1}\cdot\nu^{(j-3)}\mu^{(j-3)}\\ &=&\nu^{(j-2)}\mu^{(j-3)}+\mu^{(j-2)}\nu^{(j-3)}=1 \end{eqnarray*} by Corollary \ref{plcpcoeffs} and so for $i$ odd, $\sigma^{(i)}=x^2\sigma^{(j-1)}+\sigma^{(j-3)}+x(x+1)$. If $i$ is even, $\ol{\mu}^{(i)}=\ol{\mu}^{(j-1)}+\Delta_i\cdot\ol{\mu}^{(j-2)}$ and Corollary \ref{plcpcoeffs} yields \begin{eqnarray*}\sigma^{(i)}&=&[\nu^{(j-1)2}+\Delta_i\cdot\nu^{(j-2)2}]+(x+1)[\nu^{(j-1)}+\Delta_i\cdot\nu^{(j-2)}][\mu^{(j-1)}+\Delta_i\cdot\mu^{(j-2)}]\\&&\ \ +[\mu^{(j-1)2}+\Delta_i\cdot\mu^{(j-2)2}]\\ &=&\sigma^{(j-1)}+\Delta_i\cdot\sigma^{(j-2)}+\Delta_i\cdot(x+1)[\nu^{(j-2)}\mu^{(j-1)}+\mu^{(j-2)}\nu^{(j-1)}]\\ &=&\sigma^{(j-1)}+\Delta_i\cdot\sigma^{(j-2)}+\Delta_i\cdot(x+1) \end{eqnarray*} by Corollary \ref{plcpcoeffs}. We omit the simple inductive proof of Part (ii). \end {proof} The reader may also check that $\deg(\sigma^{(j)})= j-1$ if $j$ is even and $j$ if $\deg(\sigma^{(j)})=j$ is odd, but we will not need this fact. \begin{theorem} \label{stable} Let $s\in D^n$. Then $s$ has PLCP if and only if $s$ is stable. \end {theorem} \begin{proof} It suffices to show that if $n$ is odd and $s$ has PLCP then ${t}_{j}=0$ for even $j$, $0\leq j\leq n-1$. Put $\mu=\mu^{(j)}$. Inductively, we have $$\mu^2\cdot(t_1x^{-1}+\cdots+ t_{n-2}x^{2-n}+t_{n-1}x^{1-n}+t_nx^{-n})=\mu^2\cdot\ul{t}=\sigma+F$$ where $\vv(F)\leq 1$. We want to show that $t_{n-1}=0$. The coefficient of $x^2$ in the left-hand side is $\mu_{\frac{n+1}{2}}\cdot t_{n-1}$ and $\sigma^{(n)}_2=0$ by Lemma \ref{sigma}(ii). Since $\mu_{\frac{n+1}{2}}$ is the leading coefficient of $\mu$, we must have $t_{n-1}=0$ . Conversely, as in noted in \cite{Wangpdf}, there are clearly $\lceil \frac{n}{2}\rceil$ stable sequences in $D^n$, so the result follows from Proposition \ref{count}. \end {proof} \section{An Algorithm for the Polynomial B\'{e}zout Identity.} \begin{theorem} \label{newBIt} (Cf. \cite[Corollary 2.7]{FN95}) Let $D$ be a principal ideal domain, $\ol{u}\in D[x]^2$, with $u$ monic and $0\leq \deg(u_2)\leq \deg(u)$. There are explicit $\ol{f}\in D[x]^2$ and $\nabla\in D\setminus\{0\}$ such that $\ol{f}\cdot\ol{u}=\nabla\cdot\gcd(\ol{u})$. \end{theorem} \begin{proof} If $\deg(u_2)=\deg(u)=d$, let $\ell,\ \ell_2$ be the leading coefficients of $u$ and $u_2$ respectively. We replace $u_2$ by $u_2'=\ell_2\cdot u-\ell\cdot u_2$. If $\ol{f}\cdot (u, u_2')=\nabla\cdot\gcd(\ol{u})$, one checks that $(f+\ell_2f_2,-\ell f_2)\cdot \ol{u}=\nabla\cdot\gcd(\ol{u})$. So we can assume that $\deg(u_2)<\deg(u)$. Let $t$ be the linear recurring sequence defined by $\ul{t}=\frac{v}{u}\in D[[x^{-1}]]$, $s=t^{(2d)}$ and $\ol{\mu}$ be the unique MR of $s$, with $\ol{f},\nabla$ as in Proposition \ref{lrs}, so that $\ol{f}\ol{\mu}=\nabla$. We know that $u\in\Ann(s)=\mu D[x]$ and so $u=w\mu$ for some $w\in D[x]$. We show that $w=\gcd(\ol{u})$. For $u_2=u t=(w\mu) t=w(\mu t)=w\mu_2$ i.e. $ \ol{u}=w\cdot \ol{\mu}$, so $\gcd(\ol{u})|w$. We also know that there exists $\ol{a}\in D[x]$ such that $\ol{a}\cdot\ol{u}=\gcd(\ol{u})$. Then $\gcd(\ol{u})= \ol{a}\cdot w\ol{\mu} =w \ol{a}\cdot \ol{\mu}$, so $w|\gcd(\ol{u})$. Finally, $\nabla\cdot\gcd(\ol{u})=\nabla \cdot w=w\cdot(\ol{f}\cdot \ol{\mu})=\ol{f}\cdot (w\ol{\mu})=\ol{f}\ol{u}$. \end{proof} As in Proposition \ref{xea}, a degree argument shows that $\nabla^{-1}\ol{f}$ agrees with the coefficients found by the extended Euclidean algorithm. Thus Algorithm \ref{newBezouta} will be widely applicable, not just to $\mathbb{F}[x]$, $\mathbb{F}$ a field, but also to $\mathbb{F}[x,y]$ for example, as $\mathbb{F}[x]$ is a principal ideal domain. \begin{algorithm} \label{newBezouta} (Cf. \cite[Algorithm 4.2]{FN95}) \begin{tabbing} Input:\ \ \ \= P.I.D. $D$, $\ol{u}\in D[x]^2$, with $u$ monic and $0\leq \deg(u_2)<\deg(u)=d$.\\ Output: \> $\ol{f}\in D[x]^2$ such that $\ol{f}\cdot\ol{u}=\nabla\cdot\gcd(\ol{u})$. \end{tabbing} 1. Compute $s=t^{(2d)}$ by $2d$ subtractions of $u$ from $u_2$ in $D[x^{-1},x]$, where $\ul{t}=\frac{u_2}{u}$. \noindent 2. Apply Algorithm \ref{MRplusmult} to $s$, giving $\ol{f}\in D[x]^2$ and $\nabla\in D$. \noindent 3. Compute $\ol{f}\cdot\ol{u}$, which is $\nabla\cdot\gcd(\ol{u})$. \end{algorithm} Note that step 2 requires at most $5d^2$ multiplications (and at most $3d^2$ multiplications if $D$ is a field). \begin{example} Let $D= \mathrm{GF}(2)$, $\ol{u}=(x^3+1,x^2+1)$ with $\gcd(\ol{u})=x+1$. Then $2d$ subtractions of $u$ from $u_2$ in $D[x^{-1},x]$ gives the generating function $x^{-1}+x^{-3}+x^{-4}+x^{-6}$ of $s$ i.e. $s=(1,0,1,1,0,1)$ as in Example \ref{Bezoutex}. We get $1\cdot(x^3+1)+x\cdot(x^2+1)=x+1$. \end{example} \section{Annihilators Which Do Not Vanish At Zero} First we establish a lower bound lemma which was stated without proof in \cite{Salagean}. The resulting easy corollary and algorithm do not require any characterisations of minimal polynomials. Theorem \ref{nonzero} (or Proposition \ref{gcd} if $D$ is factorial) allows us to remove a test on $\mu'$. We also generalise Proposition \ref{MRprop} and Theorem \ref{numu} to give another construction of these annihilators (by extending the original sequence by one term) and include minimal polynomial identities. In the final subsection, we prove a characterisation which was also stated without proof in \cite{Salagean}. \subsection{The Lower Bound Lemma} First of all, $s\in D^n$ and we can assume that $s$ is not the all-zero sequence, so that $\LC(s)\geq 1$. It is convenient to write $\Ann^\bullet(s)=\{f\in\Ann(s):\ f_0\neq 0\}$. We seek an $f\in\Ann^\bullet(s)$ such that $\deg(f)=\min\{\deg(g):\ g\in\Ann^\bullet(s)\}$. To simplify the notation, we write $\ol{\mu}=\ol{\mu}^{(n)}$, $e=\ee_n>0$ and $\LC=\LC_n$, each obtained as in Theorem \ref{bimrt}. We also write $\LC'=\LC_{n'}$, $e'=\ee_{n'}$, $\ol{\mu}'=\ol{\mu}^{(n')}$, $$ \MR^\bullet(s)=\{(f,f_2):\ f\in\Ann^\bullet(s), \deg(f)\mbox{ is minimal}\}, $$ $\LC^\bullet=\LC^\bullet(s)=\min\{\deg(f):\ f\in \Ann^\bullet(s)\}$ and for $n'\geq 1$, $s'=(s_1,\ldots,s_{n'})$. If $\mu_0\neq 0$, clearly $\ol{\mu}\in \MR^\bullet(s)$ and evidently $\MR^\bullet(s_1,\ldots,s_{n+1}) \subseteq\MR^\bullet(s_1,\ldots,s_{n})$. The case $e\leq 0$ is an easy consequence of Proposition \ref{MRprop}, but the case $e>0$ requires some preparation. We begin with the following easy result. \begin{proposition}\label{shift} Let $f\in\Ann(s)$ and $d=\deg(f)$. (i) If $1\leq k\leq d$ and $x^k|f$ then $f/x^k\in \Ann(s_{k+1},\ldots,s_n)$. (ii) If $2\leq k\leq n$ and $g\in \Ann(s_{k},\ldots,s_n)$, then for any $t\in D^{k-1}$, $x^{k-1}g\in \Ann(t_1,\ldots,t_{k-1},s_k,\ldots,s_n)$. \end{proposition} \begin{proof} (i) Let $f'=f/x$ and $s'=s_2x^{-1}+\cdots +s_nx^{1-n}$. For $d-n=(d-1)-(n-1)\leq j\leq -1$, $(f's')_j=(f\ul{s})_j-s_1f_{j+1}=0$ since $f\in\Ann(s)$ and $j+1\leq 0$. Now induct on $k$. (ii) If $g\in\Ann(s)$ then for any $t\in D$, $xg\in\Ann(t,s_1,\ldots,s_n)$: for $d+1-(n+1)=d-n\leq j\leq -1$, $\left(xg(tx^{-1}+s_1x^{-2}+\cdots+s_nx^{-n-1})\right)_j=g_jt+(g\ul{s})_j=0$ since $j\leq -1$ implies that $g_j=0$ and $g\in\Ann(s)$. The result now follows by induction on $k$. \end {proof} \begin{lemma} \label{noreciprocals} Let $n\geq 2$ and $g\in \Ann^\bullet(s)$. (i) If $h\in \Ann(s_2,\ldots,s_n)\setminus\Ann(s)$, then $\deg(g)\geq n-\deg(h)$. (ii) If $f\in\Ann(s)$, $x|f$ and $f/x\not\in\Ann(s^{(n-1)})$, then $\deg(g)\geq n+1-\deg(f)$. \end{lemma} \begin{proof} (i) Let $d=\deg(g)$. Then $(g\ul{s})_j=0$ for $d-n\leq j\leq -1$ and so we can write $g\ul{s}=G+cx^{d-n-1}+P$ where $G\in D[x^{-1}]$, $G_j=0$ for $d-n-1\leq j\leq -1$, $c\in D$ and $P\in D[x]$. Put $s'=(s_2,\ldots,s_n)$ and $e=\deg(h)$. Then we have $(h\ul{s'})_j=0$ for $e-n\leq j\leq -2$ and $a=(h\ul{s'})_{-1}\neq 0$. As $\ul{s}=x^{-1}\ul{s'}+s_1x^{-1}$, we get $$(h\ul{s})_j=\left\{ \begin{array}{ll} 0 & \mbox{ if } e-n-1\leq j\leq -3\\ a & \mbox{ if } j=-2\\ b=(h\ul{s'})_0+s_1f_0 & \mbox{ if }j=-1 \end{array} \right. $$ and so $h\ul{s}=H+ax^{-2}+bx^{-1}+Q$ where $H\in D[x^{-1}]$, $H_j=0$ for $e-n-1\leq j\leq -1$ and $Q\in D[x]$. This gives $hP-gQ=gH-hG+gax^{-2}+gbx^{-1}-hcx^{d-n-1}\in D[x]$ and $$0=(gH)_{-2}-(hG)_{-2}+g_0a+h_{n+1-d}c.$$ If $d+e-n-1\leq -2$, then $n+1-d> e$ and so this reduces to $0=ag_0$, for a contradiction. Hence $d+e-n-1\geq -1$, as required. (ii) Proposition \ref{shift}(i) implies that $h=f/x\in\Ann(s_2,\ldots,s_n)$ and as $\Ann(s)\subseteq \Ann(s^{(n-1)})$, $h\not\in\Ann(s)$. Part (i) now implies that $\deg(g)\geq n-\deg(h)=n+1-\deg(f)$. \end{proof} The next corollary was stated without proof in \cite[Proof of Theorem 3.7]{Salagean} when $D$ is a field using different notation. \begin{lemma} \label{x|min} Let $\mu_0=0$ and $e>0$. If $g\in\Ann^\bullet(s)$ then $\deg(g)\geq n+1-\LC$. \end {lemma} \begin{proof} We have $n+1-2\LC=e>0$. If $s$ is the all-zero sequence, $\mu=1$ and $\mu_0\neq 0$, so $s$ is not the all-zero sequence and $1\leq \LC\leq \frac{n}{2}$. Next we show that $\mu/x\not\in\Ann(s^{(n-1)})$. For suppose that $\mu/x\in\Ann(s^{(n-1)})$. Then $\LC_{n-1}\leq \LC-1=\max\{\LC_{n-1},n-\LC_{n-1}\}-1$, which implies that $\LC_{n-1}\leq \LC-1=n-\LC_{n-1}-1$ i.e. $\ee_{n-1}>0$. Now Theorem \ref{bit} implies that $e=-\ee_{n-1}+1\leq 0$, which is a contradiction. Thus $\mu/x\not\in\Ann(s^{(n-1)})$ and the result follows from Lemma \ref{noreciprocals}(ii). \end {proof} \subsection{Two Corollaries, an Algorithm and a Theorem} Recall that $e=\ee_n=n+1-2\LC$. \begin{corollary} \label{simple}(Cf. \cite[Theorem 3.8]{Salagean}) If $\mu_0=0$, let $q\in D[x],\ \deg(q)=e$, $a\in D^\times$ and $$\ol{\mu}^\bullet=\left\{ \begin{array}{ll} \ol{\mu}+a\cdot\ol{\mu}' & \mbox{ if } e\leq 0\\ q\cdot\ol{\mu}+a\cdot\ol{\mu}' & \mbox{ otherwise.} \end{array} \right. $$ Then (i) $\ol{\mu}^\bullet\in\MR^\bullet(s)$ and (ii) $\tilde\mu'\cdot\ol{\mu}^\bullet=\nabla_n$ if $e\leq 0$; $\ol{\mu}\cdot\ol{\mu}^\bullet=-a\cdot \nabla_n$ if $e<0$. \end {corollary} \begin{proof} Corollary \ref{nonzero} implies that $\mu'_0\neq 0$, so $\mu^\bullet_0\neq 0$. If $e\leq 0$, Part (i) follows from Proposition \ref{MRprop} with $f'=a$ and Part (ii) follows from Theorem \ref{numu}. Let $e>0$. We check that $\mu^\bullet\in \Ann(s)$ directly from the definition. Let $e+\LC-n=1-\LC\leq j\leq -1$. Then $$(\mu^\bullet\cdot\ul{s})_j=(q\cdot\mu\cdot\ul{s})_{j}+a\cdot(\mu'\cdot\ul{s})_j=0$$ since (i) $1-\LC\leq j$ implies that $\LC-n\leq j-e$ and $(q\cdot\mu\cdot\ul{s})_{j}=\sum_{k=0}^eq_k(\mu\cdot\ul{s})_{j-k}$, where $ j-e\leq j-k\leq j$ and (ii) $n'-\LC'\leq j$. We have $\deg(\mu^\bullet)=e+\LC$, which is minimal by Lemma \ref{x|min}. Finally, $\LC\geq 1$ implies that $e\leq n-\LC$ and hence by Lemma \ref{f2}(ii), $\mu^\bullet_2=q\mu_2+a\cdot\mu'_2$, so that $\ol{\mu}^\bullet=q\cdot\ol{\mu}+a\cdot\ol{\mu}'\in\MR^\bullet(s)$. For Part (ii), we easily get $\tilde{\mu}\cdot\ol{\mu}^\bullet=-a\cdot\tilde{\mu}'\cdot\ol{\mu}$ which is $-a\cdot\nabla_n$ by Theorem \ref{numu}. \end{proof} A trivial example of the first case is $n=1$ and $s_1\in D^\times$. We have $\ol{\mu}=(x,1)$, $\ol{\mu}'=(1,0)$ and $e=0$. According to the Corollary, we can take $\mu^\bullet=(x+a,1)$ where $a\in D^\times$. For the second case, let $n=4$ and $s=(0,1,0,0)$. Then $\ol{\mu}=(x^2,1)$, $\ol{\mu}'=(1,0)$ and $e=1$. According to the Corollary, $\mu^\bullet=x^e\ol{\mu}+a(1,0)=(x^3+a,x)$. Lemma \ref{x|min} now yields the following value of $\LC^\bullet$. Recall that if $e<0$ then $\mu\in\Min(s)$ is unique. \begin{corollary} \label{LCbullet} For $s\in D^n$, $$\LC^\bullet=\left\{ \begin{array}{ll} \LC & \mbox{ if } e\leq 0 \mbox{ or }(e>0\mbox{ and }\mu_0\neq 0)\\ n+1-\LC & \mbox{ otherwise.} \end{array} \right. $$ \end {corollary} We now have all the ingredients for an iterative algorithm for sequences over $D$ by taking $q=x^e$ and $a=1$ in Corollary \ref{simple}. \begin{algorithm}\label{rewrite2} (Cf. \cite[Algorithm 3.2]{Salagean}) \begin{tabbing} Input:\ integer $n\geq 1$ and $s=(s_1,\ldots,s_{n})\in D^n$.\\ Output:\ $\ol{\mu}^\bullet\in\MR^\bullet(s)$.\\\\ \{Algorithm \ref{MRa}\ $(\varepsilon=0,n,s,\ol{\mu},\ol{\mu}',e)$;\\\\ {\tt IF } $\mu_0\neq 0$\ \= \ {\tt THEN} $\ol{\mu}^\bullet:= \ol{\mu}$ \\ \> \ {\tt ELSE}\ \{{\tt IF}\ $e\leq 0$\= \ {\tt THEN}\= \ $\ol{\mu}^\bullet:= \ol {\mu}+\ol{\mu}'$ \ {\tt ELSE} $\ol{\mu}^\bullet:= x^{e}\cdot\ol{\mu}+\ol{\mu}'$\};\\ {\tt RETURN} (${\mu}^\bullet)$\}\\ \end{tabbing} \end{algorithm} \begin{remarks} (Cf. \cite[Section III]{Salagean}) (i) The correctness of Algorithm \ref{rewrite2} does not require us to characterise elements of $\Ann^\bullet(s)$ of minimal degree. (ii) Theorem \ref{bit} uses any ${\mu}^{(n-1)}$; in particular, if $1\leq j\leq n$, $\ee_{j-1}\leq 0$ and ${\mu}^{(j-1)}_0=0$, we can replace $\ol{\mu}^{(j-1)}$ by $\ol{\mu}^{(j-1)}+\ol{\mu}'^{(j-1)}$. (iii) Algorithm \ref{rewrite2} does not include any tests on $\mu'_0$. (iv) We can also use $\varepsilon =1$. \end{remarks} \begin{example} \label{bullet}We apply Algorithm \ref{rewrite2} to Example \ref{mrex}: $\ol{\mu}^{(8)}=(x^4+x^2+x,x^2+x+1)$, $\ol{\mu}'^{(8)}=(x^3+x^2+x+1,x)$ and $\ee_8=1$, so that $\ol{\mu}^{(8)\bullet}=x\ol{\mu}^{(8)}+\ol{\mu}^{(8')}=(x^5+x+1,x^3+x^2)$. \end{example} The following theorem is our analogue of Proposition \ref{MRprop} and Theorem \ref{numu}. \begin{theorem} \label{dge0} (Cf. \cite{Salagean}) Let $s\in D^n$ and $f'\in D[x]$. \begin{tabbing} (i) \= If $f'=0$ or $\deg(f')\leq -e$ and $\mu_0+ f'_0\cdot \mu'_0\neq 0$ then (a) $\ol{\mu}^\bullet=\ol{\mu}+f'\cdot \ol{\mu}'\in\MR^\bullet(s)$\\ \>and (b) $\tilde{\mu}'\cdot \ol{\mu}^{\bullet}=\nabla_n$.\\ (ii) \> If $e>0$ and $\mu_0=0$, let $s_{n+1}$ be such that $\Delta_{n+1}=\Delta_{n+1}(\mu,t)\neq 0$, where\\ \>$t=(s_1,\ldots,s_n,s_{n+1})$. If $f'=0$ or $\deg(f')\leq e-1$ then\\\\ \> (a) $\ol{\mu}^{\bullet}=\ol{\mu}^{(n+1)}+f'\cdot\ol{\mu}\in \MR^\bullet(t)\subseteq\MR^\bullet(s)$\\\\ \> (b) $\tilde{\mu}\cdot \ol{\mu}^{\bullet}=\nabla_{n+1}(t)$. \end{tabbing} \end{theorem} \begin{proof} As in Proposition \ref{simple}, we know that $\mu'_0\neq 0$ by Proposition \ref{fg}, so the first part of (i) is clear from Proposition \ref{MRprop} and Theorem \ref{numu}, and $\tilde{\mu}'\cdot \ol{\mu}^{\bullet}=\tilde{\mu}'\cdot \ol{\mu}$. To prove Part (ii), first note that by Theorem \ref{bit}, $\mu^{(n+1)}=\Delta'_{n+1}\cdot x^{e}\mu-\Delta_{n+1}\cdot\mu'\in \Min(t)$ with $\deg(\mu^{(n+1)})=n+1-\LC$ and $\Delta'_{n+1}=\Delta_{n'+1}$. Further, $\mu^{(n+1)}_0=\Delta_{n+1}\cdot\mu'_0\neq 0$ and $\Ann(t)\subseteq\Ann(s)$, so Lemma \ref{x|min} implies that $\ol{\mu}^{(n+1)}\in \MR(t)\cap\MR^\bullet(s)$. We have $\ee_{n+1}=-e+1\leq 0$, so $\ol{\mu}^{(n+1)}+f'\cdot\ol{\mu}'^{({n+1})}\in\MR(t)$ by Proposition \ref{MRprop}. Also, $(n+1)'=n$ since $e>0$. We conclude that ${\mu}^{\bullet}_0= {\mu}^{(n+1)}_0\neq 0$, $\ol{\mu}^{\bullet}=\ol{\mu}^{(n+1)}+f'\cdot\ol{\mu} \in\MR^\bullet(t)$ and $$\tilde{\mu}\cdot \ol{\mu}^{\bullet}=\tilde{\mu}'^{({n+1})}\cdot \ol{\mu}^{\bullet}=\tilde{\mu}'^{({n+1})}\cdot \ol{\mu}^{(n+1)} =\nabla_{n+1}.$$ \end {proof} In Example \ref{bullet}, $s_9=0$ forces $\Delta_9=1$. We obtain $\ol{\mu}^{(9)}=\ol{\mu}^{\bullet(8)}$ as before (with $f'=0$). However, since $e=1$, we may also take $f'=1$, and we obtain $\ol{\mu}^{(9)}+\ol{\mu}^{(8)}=\ol{\mu}^{(8)\bullet}+\ol{\mu}^{(8)}= (x^5+x^4+x^2+1,x^3+x+1)\in\MR^\bullet(s)$ too. This is equivalent to taking $f'=x+1$ in Corollary \ref{simple}. \begin{remarks} (i) We could replace $\mu'$ by any element of $\Min(s')$. (ii) By construction, $\mu^\bullet=q\mu-\Delta\cdot\mu'$ where $q=\Delta'\cdot x^e+f'$ and $\deg(q)=e$. \end{remarks} \subsection{A Characterisation} In this subsection, we give an analogue of Theorem \ref{MRthm} for $\Ann^\bullet(s)$ when $\mu$ is unique and $\mu_0=0$: we characterise $\{f\in\Ann^\bullet(s):\ \deg(f)\mbox{ is minimal}\}$ in this case. This was stated without proof for $D=\mathbb{F}$ in \cite[proof of Theorem 3.7(iii)]{Salagean}. We also describe $f_2(x)=\sum_{j=0}^{\deg(f)-1} (f\cdot\ul{s})_j\ x^j$. (The case $e\leq 0$ is an easy consequence of Theorem \ref{MRthm}.) First a simple but useful proposition. \begin{proposition} \label{converse} Let $f,r\in D[x]$ and $n-1\geq k=\deg(f)-\deg(r)\geq 1$. If $f, f+r\in \Ann(s)$ then $r\in\Ann(s^{(n-k)})$. \end {proposition} \begin{proof} As $n-k\geq 1$, $\Ann(s^{(n-k)})$ is well-defined. Let $d=\deg(f+r)=\deg(f)=\deg(r)+k$ and $j$ satisfy $\deg(r)-n+k\leq j\leq -1$. Also, $d-n= \deg(r)-(n-k)$ and so $(r\cdot\ul{s})_j=((f+r)\cdot\ul{s})_j-(f\cdot\ul{s})_j=0$ and hence $r\in\Ann(s^{(n-k)})$. \end{proof} It is convenient to have the notion of a 'jump point'. \begin{definition} [Jump point] Let $n\geq 2$, $s\in D^n$ and $2\leq j\leq n$. We say that $j$ is a jump point of $s$ if $\LC_j>\LC_{j-1}$ and write $\J(s)$ for the set of jump points of $s$. \end {definition} We do not assume that $\J(s)\neq \emptyset$. Evidently, the following are equivalent: (i) $j\in\J(s)$ (ii) $\Delta_j\neq 0$ and $\ee_{j-1}>0$ (iii) $j'=j-1$ (iv) $\LC_j=j-\LC_{j-1}>\LC_j$. In Theorem \ref{dge0}, $s_{n+1}$ was chosen so that $n+1$ is a jump point of $(s_1,\ldots,s_{n+1})$. \begin{theorem} \label{char} (Cf. \cite[Theorem 3.7(iii)]{Salagean}) Let $n\geq 2$, $s\in D^n$, $\mu_0=0$, $e>0$ and $\ell=\mu_\LC^{e+1}$. Then $f\in\Ann^\bullet(s)$ has minimal degree if and only if $$\deg(f)= n+1-\LC,\ n'\geq 1\mbox{ and }\ell\cdot\ol{f}=q\cdot \ol{\mu}+\ol{r}$$ where $ q=(\ell\cdot f)\mydiv\mu$, $r=(\ell\cdot f) \bmod \mu\in\Min(s')$ and $r_0\neq 0$. In particular, if $D$ is a field then ${f}=q\cdot {\mu}+{r}$ where $\deg(q)=e$ and ${r}=a\cdot\ol{\mu}'$ for some $a\in D^\times.$ \end {theorem} \begin{proof} Corollary \ref{simple} implies that $q\ol{\mu}+\ol{r}\in\MR^\bullet(s)$ and hence so is $\ol{f}$. Conversely, let $f$ be as stated. Then $\deg(f)= n+1-\LC_n$ by Corollary \ref{LCbullet}. Since $\mu_0=0$, $\LC\geq 1$ and $e>0$ implies that $\LC\leq \frac{n}{2}$. Pseudo-dividing $\ell\cdot{f}$ by $\mu$ (as in \cite[Algorithm R, p. 407]{K2}) gives $\ell\cdot f=q\mu+r$ with $\deg(q)=n+1-2\LC=e>0$ and $r=0$ or $\deg(r)<\LC$. Since $r_0=\ell f_0\neq 0$, $0\leq d=\deg(r)<\LC$. Let $k=\LC-d\geq 1$. Then $n-k\geq 1$ since $n\geq 2\LC>\LC\geq \LC-d=k$ and $s^{(n-k)}$ is well-defined. By Proposition \ref{converse}, $r\in\Ann(s^{(n-k)})$. First we show that $n-k=n'$. Since $d<\LC$ and $n'$ is maximal by \cite[Proposition 4.1]{N95b}, $n-k\leq n'$. In particular, $n'\geq 1$ and we are done if $n'=1$. Suppose that $n-k< n'$. If $\LC'\leq d+1$ then \begin{eqnarray}\label{firstcase} n-\LC+\LC'\leq n-\LC+d+1=n-k+1\leq n'=\LC+\LC'-1 \end{eqnarray} and $e\leq 0$. Similarly, $\LC'=d$ is impossible and so $d<\LC'$. To treat this case, we generalize (\ref{firstcase}) by partitioning $[\LC_1,\LC')$ into $[\LC_1,\LC_{j_1}),\ldots, [\LC_{j_{p-1}},\LC_{j_p})$ for some integer $p$. There is a unique integer $t\geq 2$ with $d\in[\LC_{j_{t-1}},\LC_{j_t})$, where $j_{t_1}=1$. Since $d<\LC_{j_t}$, we must have $n-k\leq j_t-1$ as before and therefore $$n-\LC+\LC_{j_{t-1}}\leq n-\LC+d=n-k\leq j_t-1=\LC_{j_{t}}+\LC_{j_{t-1}}-1\leq \LC+\LC_{j_{t-1}}-1$$ which implies that $e\leq 0$. We conclude that $n-k=n'$ and $\LC'\leq d$ as $r\in\Ann(s')$. If $\LC'<d$, then $(n-\LC)+\LC'+1\leq (n-\LC)+d=n-k= n'=\LC+\LC'-1$ and $e\leq -1$, so that $d=\LC'$. Finally, if $D$ is a field, we have shown that $f=q\cdot\mu+r$ where $r\in\Min(s')$ and $r_0\neq 0$. Moreover, $\LC'\leq \LC-1=n'-\LC'$ so that $\ee_{n'}=n'+1-2\LC'\geq 1$ and $\mu'$ is the unique monic minimal polynomial of $s'$ by \cite[Corollary 3.27 or Theorem 4.16]{N95b}. Hence $r=a\mu'$ for some $a\in D^\times$. \end {proof} \begin{remark} \label{MRchar} In Theorem \ref{char}, we have $\deg(q)+\deg(\mu)=n+1-\LC\leq n$ since $\LC\geq 1$ and it follows easily from \cite[Corollary 3.25]{N95b} (which does not require $D$ to be a field), that $\ell\cdot\ol{f}=(q\mu+r,(q\mu+r)_2)=q\ol{\mu}+\ol{r}$. \end{remark} \noindent {\bf Example \ref{mrex}(cont.)} From Theorem \ref{char} and Remark \ref{MRchar}, $$\MR^\bullet(s)=\{(x^5+x+1,x^3+x^2),(x^5+x^4+x^2+1,x^3+x+1)\}.$$ \begin{center} {\bf Appendix} \end{center} We give an alternative proof of Lemma \ref{noreciprocals} using reciprocals of annihilators and apply it to the complexity of reversed sequences. This generalises Theorem 3 of \cite[p. 149]{IY} (which was proved using using Hankel matrices over a field) to a factorial domain. Let $\tilde{s}$ denote the reverse of $s\in D^n$ and $\tilde{\LC}=\LC(\tilde{s})$. We assume that $\mu^{(n)}\in \Min(s)$. We begin with a basic result on annihilators and reciprocals. \begin{proposition} \label{haha} Let $f\in\Ann(s)$ and $d=\deg(f)$ and let $k\geq 0$ be the highest power of $x$ dividing $f$. Then $f^\ast\in \Ann(s_n,\ldots,s_{k+1})$. In particular, if $x\nmid f$ then $f^\ast\in \Ann(\tilde{s})$. \end{proposition} \begin{proof} First assume that $k=0$. For $d-n\leq j\leq -1$, $$(f^\ast\ul{\tilde{s}})_j =(f(x^{-1})\ul{\tilde{s}})_{j-d}=(f\cdot(s_nx+\cdots+s_1x^n))_{d-j}=(x^{n+1}f\ul{s})_{d-j}=(f\ul{s})_{d-j-n-1}=0$$ since $d-n\leq d-j-n-1\leq-1$. In general, let $f'=f/x^k$. Then $f'\in \Ann( s_{k+1},\ldots,s_n)$ by Proposition \ref{shift}(i) and $f^\ast=f'^\ast\in \Ann(s_n,\ldots,s_{k+1})$ by the case $k=0$. \end{proof} Next we give an alternative proof of Lemma \ref{noreciprocals} using reciprocals of annihilators. \begin{lemma} \label{Dbound} Let $n\geq 2$, $f,g\in\Ann(s)$. If $x|f$, $f/x\not\in\Ann(s^{(n-1)})$ and $x\nmid g$, then $\deg(g)\geq n+1-\deg(f)$. \end{lemma} \begin{proof} Since $g_0\neq 0$, $g\neq 0$ and $g^\ast\in\Ann(\tilde{s})$ by Proposition \ref{haha}(ii). Let $k$ be the highest power of $x$ dividing $f \in\Ann(s)$ and $\hat{f}=f/x^k$, so that $\deg(\hat{f}^\ast)=\deg(\hat{f})=\deg(f)-k$. Firstly, $\hat{f}\in\Ann(s_{k+1},\ldots,s_n)$ by Proposition \ref{haha}(i) and $x\nmid \hat{f}$, so $\hat{f}^\ast\in\Ann(s_n,\ldots, s_{k+1})$ by Proposition \ref{haha}(ii). But $\hat{f}^\ast\not\in\Ann(s_n,\ldots, s_{k})$, for otherwise $\hat{f}\in\Ann(s_k,\ldots,s_n)$ and hence $f/x=x^{k-1}\hat{f}\in\Ann(s)$ by Proposition \ref{haha}. This is impossible since $\Ann(s)\subseteq\Ann(s^{(n-1)})$. We can now apply Lemma \ref{elegantproof} to $\hat{f}^\ast$ and $g^\ast$, yielding $\deg(g^\ast)\geq n-k+1-\deg(\hat{f}^\ast)= n+1-\deg(f)$ i.e. $\deg(g)\geq n+1-\deg(f)$. \end{proof} \begin{lemma} \label{geewiz} (i) If $\mu_0\neq 0$ then $\tilde{\LC}\leq \LC$ and (ii) if $\mu_0=0$ then $\tilde{\LC}\geq n+1-\LC$. \end {lemma} \begin{proof} If $\mu_0\neq 0$ then $\mu^\ast\in \Ann(\tilde{s})$ by Proposition \ref{haha}(ii), so $\tilde{\LC}\leq \deg(\mu^\ast)=\deg(\mu)=\LC$. Suppose now that $\mu_0=0$ and let $x^k|\mu$ with $k\geq 1$ maximal and put $g=\mu/x^k$. Then $g_0\neq 0$, $\deg(g)=\LC-k$ and $g\in\Ann(s_{k+1},\ldots,s_n)$ by Proposition \ref{haha}(ii). Hence ${g}^\ast\in \Ann(s_n,\ldots,s_{k+1})$. However, $g^\ast\not\in \Ann(s_k,\ldots,s_n)$, for otherwise $g\in \Ann(s_k,\ldots,s_n)$ and $\mu/x=x^{k-1}g\in \Ann(s)$ which contradicts the minimality of $\mu$. We now apply Lemma \ref{elegantproof} to $g^\ast$: $$\tilde{\LC}\geq \tilde{\LC}_{n-k-1}\geq n-k+1-\deg({g}^\ast)=n+1-{\LC}.$$ \end {proof} \begin{example} Let $D=\mathbb{F}_2$ and $s=(1,1,0,0)$. One easily checks that $x^2$ is the unique minimal polynomial. By Lemma \ref{geewiz}, $\tilde{\LC}\geq 3$. In fact $\mu^{(3)}=x^3+x^2$ and so $\tilde{\LC}=3$. Thus the bound of Lemma \ref{geewiz} is tight. \end{example} We will now show that in the special case $n=2\LC$ that $\LC=\LC+1$ when $D$ is factorial and $\mu^{(n)}_0=0$. Recall that if $D$ is a factorial domain and $n\geq 2\LC$ then $s$ has a unique minimal polynomial. \begin{corollary} (Cf. \cite[Theorem 3]{IY}). Let $D$ be a factorial domain, $n=2\LC$ and $\mu$ be the unique minimal polynomial of $s$. Then $$\tilde{\LC}=\left\{ \begin{array}{ll} \LC & \mbox{ if } \mu_0\neq 0\\ \LC+1 & \mbox{ if } \mu_0=0. \end{array} \right. $$ \end {corollary} \begin{proof} (i) We have $\tilde{\LC}\leq \LC$ by Lemma \ref{geewiz}(i). Let $\tilde{\mu}\in \Min(\tilde{s})$. If $\tilde{\mu}_0\neq 0$, $\tilde{\mu}^\ast\in \Ann(s)$, $\LC=\tilde{\tilde{\LC}}\leq \tilde{\LC}$ and we are done. If $\tilde{\mu}_0=0$, Lemma \ref{geewiz}(ii) implies that $\LC\geq n+1-\tilde{\LC}=2\LC+1-\tilde{\LC}$. Hence $\tilde{\LC}\geq \LC+1\geq \LC$ and $\tilde{\LC}=\LC$. (ii) Suppose that $\mu_0=0$. Let $f$ be such that $f\in \Ann(s)$, $f_0\neq 0$ and $\deg(f)$ is minimal. Then $\deg(f)= n+1-\LC$ by Lemma \ref{noreciprocals} and $\tilde{\LC}\leq n+1-\LC\leq \LC+1$ by Proposition \ref{haha} and the fact that $n=2\LC$. We now show that $\tilde{\LC}\leq \LC$ is impossible. Let $\tilde{f}\in \Min(\tilde{s})$. If $\tilde{f}_0\neq 0$, then $\tilde{f}^\ast\in\Ann(s)$ and so $\LC\leq \deg(\tilde{f})=\tilde{\LC}$. We cannot have $\LC=\tilde{\LC}$, for then $\tilde{f}^\ast=\mu$ and $\mu_0\neq 0$. Hence $\LC< \tilde{\LC}$ and we cannot have $\tilde{\LC}\leq \LC$. By the first paragraph, $\tilde{\LC}=\LC+1$. On the other hand, if $\tilde{f}_0=0$, then by Lemma \ref{geewiz}, $\tilde{\LC}\geq n+1-{\LC}=\LC+1$. Thus in either case, $\tilde{\LC}\geq \LC+1$ and so $\tilde{\LC}= \LC+1$. \end {proof} \begin{center} {\bf Typographical Error} \end{center} In \cite{N10a}, immediately after Definition 3.3, $\Delta(f,s)=\sum_{k=0}^d f_k\ s_{n-d+k}$.
\section{Introduction} The formation of astrophysical jets is one of the frontiers in our understanding of physics of compact massive objects. Collimated outflows are observed in many types of objects: brown dwarfs, young stars, X-ray binary systems (\citeauthor{binary}), neutron stars (NS), GRBs, AGN (for a brief review see \citeauthor{jets1}), even galactic clusters, and observational data continue to surprise us with the universality of jet formation in the Universe. For example, according to \citeauthor{Fermi}, observations surprisingly hint for independence of AGN jet-formation from the type of their host galaxy. Despite the differences in the temporal and dimensional scales and the suggested emission mechanisms of the jets, evidences imply that there is some kind of common process serving as an engine for their formation. The true nature of this engine, however, remains elusive. An example of the difficulties in front of models of an engine like this, can be seen in GRB physics. GRBs are cosmic explosions whose jets are highly collimated ($\theta_{jet}\sim 2^\circ-5^\circ$), highly variable in time ($\sim$ seconds), extreme in their energy output ($\sim 10^{51} - 10^{56}$ erg) and appearing on different redshifts (currently observed up to $z^{obs}_{max}=8.2$) ( \citeauthor{Meszaros}, \citeauthor{Zhang}, \citeauthor{Burrows}, and for a review on the online GRB repository see \citeauthor{Evans} \citeyear{Evans}). Although there are already several hundred GRBs observed by current missions and a lot of details are well studied, the theory of GRBs remains essentially incomplete, since we lack both an undisputable model of their central engine and a mechanism of creation of the corresponding jets. Currently, GRBs are divided into two classes -- short and long -- based on their duration (with a limit $T_{90}\simeq 2s$, for details see \citeauthor{short_long}). This temporal division seemed to correlate with their origin and spectral characteristics, leading to the theory that short GRBs are likely products of binary mergers of compact objects (black hole (BH) and neutron star (NS) or NS and NS), while long GRBs are an outcome of the collapse of massive stars\footnote{The major evidence for the collapsar model, the connection of long GRBs with supernovae (SN) was confirmed by the observations of GRB 980425/SN 1998bw and GRB060218/SN2006aj (\citeauthor{Mirabal}) -- events that started as a GRB and then evolved spectrally into an SN. But the question remains why not every long GRB is accompanied by SN.}. This clear distinction, however, is questioned by observations of bursts with common for the two classes properties (for the latest observation of such GRB: \citeauthor{Antonelli}, for a review \citeauthor{short_long_b}) suggesting the existence of an intermediate, third class of GRBs and by statistical analysis suggesting that the two classes are not qualitatively different (\citeauthor{GRB_two}, \citeauthor{short_long_c} and \citeauthor{Lv}) -- both evidences of common producing mechanism for the two classes. Furthermore, the possibility to explain short GRBs by merger of binary systems of BH-NS or NS-NS was recently questioned by the lack of detection of gravitational waves in 22 cases of short GRBs (\citeauthor{LIGO}, \\ \citeauthor{Andromeda}). At present we are not able to explain definitely these observational results. Either we have no binary mergers of compact objects in sGRB's, or the very large distances to the observed events prevent observation of corresponding gravitational waves by the existing detectors. The absence of gravitational waves from merger of binaries, if confirmed by future careful investigations, may seriously challenge the current paradigm in the sGRB field. The dominating theoretical model in the GRB physics describing the evolution of {\em already formed} jet is the ''fireball model`` \hspace{0px} introduced by \citeauthor{Piran}. In this model series of shells of relativistic particles are accelerated by unknown massive object called the ''central engine``. The observed lightcurve is produced by internal collisions of the shells and by their propagation in the circumburst medium. This model, however, doesn't explain the process behind the formation of the shells or the collimation of the jet. The discrepancies between this model and the observational data were outlined recently in \citeauthor{Lyutikov}, most important of them -- the yet unexplained afterglow decay plateaus (and the sharp decay of the light curve afterwards) and the discovered by the mission SWIFT flares (additional sharp maxima superimposed over the decaying afterglow lightcurve) observed in different epochs of the burst and with different fluences (for a detailed study of flares see \citeauthor{Maxham}). Although both plateaus and flares imply energy injections by the central engine, the flares that may appear up to $10^6s$ after the trigger with fluences sometimes comparable with that of the prompt emission, question the very nature of these energy injections. Different theories and simulations are being explored to explain these problems (for recent studies see \citeauthor{jets}, \citeauthor{cannonball} , \citeauthor{Fan}, \citeauthor{jets_t} \citeyear{jets_t}, \citeauthor{jets_a} \citeyear{jets_a}), but the obvious conclusion is that we still lack clear understanding of the central engine of GRB. Theoretically, the most exploited models of central engines include a Kerr black hole (KBH) in super-radiant mode(\citeauthor{superradiance}\!,\! \citeauthor{superradiance4} \citeyear{superradiance4}) -- the wave analogue of the Penrose process or the Blandford-Znajek process (\citeauthor{Blandford-Znajek} \citeyear{Blandford-Znajek}, \citeauthor{Blandford}) based on electromagnetic extraction of energy from the KBH -- the electromagnetic analogue of Penrose process. Both processes have their strong and weak sides, but the main problem is that they cannot provide enough energy release in a very short time interval, typical of the GRB. The Penrose process seems to be not efficient enough (it offers significant acceleration only for already relativistic matter), as shown long time ago by Wald (\citeyear{superradiance7}). This problem is also discussed in \citeauthor{Bardeen}, who argue that the energy gap between a bound stable orbit around the KBH and an orbit plunging into the ergo region is so big, ''energy extraction cannot be achieved unless hydrodynamical forces or superstrong radiation reactions can accelerate fragments to speed more than $0.5c$ during the infall``. As for the Blandford-Znajek process which offers a good explanation of the collimation we observe, it requires extremely intensive magnetic fields to accelerates the jets to the energies observed in GRBs (theoretical estimations show that $B \sim 10^{15}\div 10^{16}$ G is needed for a jet with $E \geq 10^{51}$ erg ). Even when the magnetic fields are sufficiently strong ( as in \citeauthor{BZ_field} ), numerical simulations imply that the BZ process is not efficient enough (\citeauthor{BZ process}) for the formation of the powerful jets seen in GRBs (\citeauthor{Blandford-Znajek_b}, \citeauthor{Lee}, \citeauthor{Blandford-Znajek_d}, Barkov \& Komissarov: \citeyear{Barkov}, \citeyear{Barkov2} , \citeauthor{Lei} \citeyear{Lei},\\ \citeauthor{Krolik} \citeyear{Krolik},\! \citeauthor{Komissarov} \citeyear{Komissarov}). Furthermore, the most speculated in the theory GRB engines include a rotating black hole, but the observational data on GRBs do not provide definitive clarification on this assumption for now. The main problem is that we cannot observe the central engine directly not only because of the huge distance to the object and its small size. The usual techniques to study its strong gravitational field are not applicable for the GRB case, because of the properties of their physical progenitors and their highly non-trivial behavior: 1) We are not able to observe the motion of objects in the vicinity of the very central engine of GRB. 2) Instead of a quiet phase after the hypothetical formation of the KBH, we observe late time engine activity (flares) which is hardly compatible with the KBH model. 3) The visible jets are formed at a distance of 20-100 event horizon radii (\citeauthor{jets_d},\citeauthor{jets_b}, \citeauthor{jets_c}.) where one cannot distinguish the exterior field of a Kerr black hole from the exterior field of another rotating massive compact matter object solely by measuring the two parameters of the metric -- $M$ and $a$ (for a more detailed discussion see \citeauthor{Fiziev0902.1277}, \citeauthor{Fiziev2010a}). In this situation, the only way to reveal the true nature of the physical object behind the central engine is to study the spectra of perturbations of its gravitational field. This background field is either described exactly by the Kerr metric (\citeauthor{Kerr}), if the central engine is a KBH or a KNS, or at least approximately modeled by the Kerr metric with the same $M$ and $a$, if the central engine is some other object. In any case we can use the Kerr metric to study the jet problem in the above conditions. Different types of central engines yield different boundary conditions for the perturbations we intend to consider and these boundary conditions generate different spectra specific for the given object. Thus finding appropriate spectra to fit our observations enables us to uncover the true nature of the central engine. Similar method for discovering of the BH horizon was proposed for the first time in \citeauthor{Detweiler}, and studied more recently in \citeauthor{Dreyer}, \citeauthor{QNM9}, Chirenti \& Rezzolla \citeyear{Chirenti_a}, \citeyear{Chirenti_b}. In the present article we give a theoretical basis for application of the same ideas for studying the nature of the central engine of GRBs, AGN, etc., based on the spectra of their jets (\citeauthor{Fiziev0902.1277}). The main new hypotheses studied in the present article is that the central engine generates powerful {\em primary jets of radiation}: electromagnetic, gravitational and maybe neutrino primary jets. We investigate a simple mechanism of formation and collimation of such primary jets by the rotating gravitational field of the central engine, using a new class of solutions to the Teukolsky master equation. Further on, one can imagine that the primary jets, if powered enough, inject energy into the surrounding matter and start the process of shock waves and other well studied effects, investigated in the MHD models of jets, accelerating the existing particles, creating pairs of particles-antiparticles and so on. This way we are trying to make a new step toward filling the existing gap between modern detailed MHD numerical simulations of jet dynamics after the jets are created and possible mechanisms of the very jet creation. The present paper has to be considered as a first step in this new direction of investigation. Here we examine the electromagnetic-primary-jet spectra (see Section 2) of the KBH and the KNS supposing that the gravitational field of the central engine is described {\em exactly} by the Kerr metric. The study of the spectra of some types of perturbations of rotating black holes has already serious theoretical and numerical basis, particularly concerning the quasi-normal modes (QNM) of black holes. The QNM case examines linearized perturbations of the Kerr metric described by the Teukolsky angular and radial equations (the TAE and the TRE accordingly, see in Section 2) with two independent additional requirements as follows: A. Boundary condition on the solutions to the TRE: only ingoing waves in the horizon, only outgoing waves to radial infinity -- the so called {\em black hole boundary condition} (BHBC). B. Regularity condition is usually imposed on the solutions to the TAE (see in \citeauthor{Teukolsky2} and also in \citeauthor{Chandrasekhar}). The complex frequencies obtained in the case of QNM are the solutions of the eigenvalue problem corresponding to these two conditions. They represent the ''ringing`` which governs the behavior of the black hole in late epochs and they depend only on the two metric parameters $M$ and $a$. A major technical difficulty when searching for QNM is that one solves connected problem with two complex spectral parameters -- the separation constants $E$ and $\omega$. This was first done by \citeauthor{Teukolsky_Press} and later developed through the method of continued fractions by \citeauthor{QNM1}. For more recent results, see also \citeauthor{QNM8}. In the recent articles (\citeauthor{FS1},\\ \citeauthor{FS2}), we illustrate the strength of purely gravitational effects in the formation of primary jets of radiation. The idea of such physical interpretation is derived from the visualization of the singular solutions to the TAE which shows collimated outflows. Our toy model is based on linearized electromagnetic (spin-one) perturbations of the Kerr black holes with modified additional conditions: While we keep the BHBC imposed on the TRE, we drop the regularity condition on the TAE and we work with specific {\em singular} solutions of the TAE instead. To achieve this, we impose a polynomial condition on the solutions of the TAE. This new angular condition reflects the change of the physical problem at hand: now we describe a primary jet of radiation as a solution to the TAE with an angular singularity on one of the poles of the KBH or KNS. It is easy to impose the polynomial condition using the properties of the confluent Heun functions, which enter in the exact analytical solutions of the Teukolsky equations (for more on the use of confluent Heun functions in Teukolsky equations see: \citeauthor{Fiziev0902.1277}, \citeauthor{Fiziev0906.5108} and \citeauthor{Fiziev0908.4234}). Here we focus on the case of electromagnetic perturbations ($\mid s \mid=1 $ ) which seems to be more relevant to the GRB theory, since their observation is due to electromagnetic waves of different frequencies -- from optical to gamma-rays at high energies. Similar situation exists for jets from other astrophysical objects. For them radio frequencies may be also relevant, say for jets from AGNs. In this paper, we elaborate our theoretical basis and we report our latest numerical results and their theoretical implications. Analogous results can be obtained for gravitational and neutrino primary jets. Since such jets are still not observed in the Nature, we will not include them in the present article and we will discuss only {\em electromagnetic primary jets}. For brevity, from now on we will omit ``electromagnetic'' from electromagnetic primary jets, where it doesn't lead to confusion. We study in detail the {\em complex} spectra of primary-jet frequencies and their dependence over the rotational parameter of the Kerr metric, $a$. The parameter $a$ in our calculations varies from $a=0$ to $a=M$ and then from $a=M$ to $a>>M$. The case $a\in(0,M)$ corresponds to the {\em normally spinning} Kerr spacetime; and the case $a\in(M,\infty)$, to the {\em overspinning} Kerr spacetime. \begin{figure*}[htb] \begin{center} $\begin{array}{lcl} a) \epsfxsize=50mm \epsffile{Staicova_fig1.eps} & b) \epsfxsize=50mm \epsffile{Staicova_fig2.eps} & c) \epsfxsize=50mm \epsffile{Staicova_fig3.eps} \\ \end{array}$ \end{center} \caption{A plot of the ergo surfaces for a) KBH: $a<M$, b) extremal case: $a=M$ and c) KNS: $a>M$. One can clearly see the ring singularity of the Kerr metric and the change of topology due to the transition from ergospheres to ergo torus} \label{ergo} \end{figure*} Much like in flat spacetime, we can consider different physical problems in the Kerr spacetime. Imposing BHBC for $0<a<M$ we obtain the well studied case of the KBH. Under proper boundary conditions which have to be specified for $a\in(M,\infty)$, we obtain different physical problems related with the Kerr naked singularity (KNS). The case $a=M$ under BHBC corresponds to the extremal KBH. This case is beyond the scope of the present article since it requires a slightly different mathematical treatment. Our main result is the description of the qualitative change of the behavior of the primary jet frequencies under the transition from the KBH to the KNS. Moreover, we discover for the first time that the stability condition in our primary jet spectra (positive imaginary part ensuring damping of the perturbations with time) remains fulfilled even in the KNS regime ($a>M$). This happens even though, the imaginary part of those frequencies tends to zero as $a\rightarrow M$ -- after this critical point, with the increase of $a$, the imaginary part of the frequencies stay positive and grows until it reaches a proper constant value for $a>>M$. In our numerical study of primary jet spectra, there exist two \textit{special} frequencies ($n= 0,1$) which have real parts that coincide with the critical frequency of superradiance in the QNM case. In our case, the frequencies, however, are complex, and the imaginary part of one of them is of the same order of amplitude as the real part, yielding an exponential damping of the maybe superradiance-like emission of primary jets, created by the KBH or the KNS. The other frequency has a very small (but positive) imaginary part (for $a < M$). We track the non-trivial change of this special superradiance-like frequency with the change of $a$. The relation $\omega_{n=0,1,m}(a)$ is best fitted by formula (3.4a) in \citeauthor{Fiziev0908.4234} for $n = N = 0,1$, $m = 0, \pm 1, \pm 2$ in the whole range of $a$ (except for a few points for small $a$). This provides an analytical formula for these modes of the spectra. As for the other frequencies, they possibly form an infinite set as in the case of QNM. We show that the primary-jet frequencies differ from the QNM ones due to the different condition imposed on the solutions to the TAE. The dependence of the primary-jet frequencies on the parameter $a$ is also presented here for the first time. The results are discussed in comparison with the case of QNM. The article is organized as follows: Section 2 develops the mathematical theory behind our spectra, Section 3 presents the numerical results we obtained, in Section 4 we summarize our results and we discuss their possible physical implications. \section{ A toy mathematical model of formation of electromagnetic primary jets by the central engine} The main problem of most GRB models is that they do not address the formation of the collimated outflow itself, but instead they model the propagation of the jet afterwards. The propagation of relativistic jets made of particles can be best understood by full 3-d general relativistic MHD simulations. In numbers of MHD simulations, however, the energy and/or the angle of collimation of the matter accelerated by the central engine are just initial parameters (some recent examples \citeauthor{1008.4899}, \citeauthor{1009.1224}). While this approach can bring information about the environment of the burst or the properties of the jet, it doesn't allow us to study the origin of the jet i.e. the central engine. More and more studies try to obtain those parameters by evolving real initial conditions like the mass of the accretion disk/torus around the central object(s) or the masses of the binaries in the merger (see for example \citeauthor{1007.4203}, \citeauthor{1001.3074}, \citeauthor{1009.0161} ), but there are still many problems. The powerful late flares and the huge energies of some GRBs, so hard to be fit by the models, force us to rethink our understanding of the physics of compact massive objects. What is clear, however, is that precisely such object and its strong gravitational field should play a definite role in the central engine of powerful events like GRBs. Only extreme objects of that kind are able to accelerate and collimate matter to the observed high energies in so short interval of time, using the physics we know. Trying to uncover possible mechanism able to work as a central engine, we wanted to get back to the basics -- finding the purely gravitational effects that one can observe due to a compact massive object. Such effects should be intrinsic properties of those objects, independent of their environment and they are general enough to eventually describe {\em the origin} of variety of astrophysical jets. We started examining the electromagnetic perturbations of the metric of such object under boundary conditions different than the already studied in the QNM case. Although the full physics of the relativistic jets may be outside the scope of the linear perturbation theory, understanding the outcome from manipulating the boundary conditions in that regime may give us important clues about the real picture. Besides, it is clear that in the domain of formation of astrophysical jets (i.e. 20-100 gravitational radii far from the central engine), the gravitational field is weak enough and its small perturbations can be described by linear perturbation theory. Hence, this physics could be at least partially unveiled by studying the spectra of radiation of that engine in the frame of linear perturbation theory. Thus, in our toy model for formation of primary jets of radiation we use a compact massive rotating object -- a KBH or KNS under appropriate boundary conditions. Sufficiently far from the horizon its gravitational field is described exactly or at least approximately by the Kerr metric. The only quantities on which this metric depends are the mass $M$ and the rotational parameter $a$ related to the angular momentum $J$, by $a=J/M$ (everywhere in the article $c=G=1$). For $a<M$, the Kerr metric has two {\em real} horizons (\citeauthor{Kerr}) defined by $r_{_\pm\!}\!=\!M \pm \sqrt{M^2\!-\!a^2}$. In our studies we will focus on the outer region $r>r_{+}$ which is known to be linearly stable with respect to QNM. This picture holds for $a<M$ (the normally spinning Kerr spacetime). For the overspinning Kerr spacetime $a>M$ and $r{_\pm}$ are complex. When black hole boundary conditions are imposed for $a<M$ the Kerr metric describes a rotating black hole. The extremal limit is reached when $a=M$ and in this case $r_{+}=r_{-}=M$. Under proper boundary conditions for $a>M$ the Kerr metric describes a rotating KNS. In our work, we will discuss only electromagnetic primary jets from the KBH or the KNS ($s=-1$). The change of the metric due to the change of the parameter $a$ can be seen also in the change of the topology of ergo-surfaces of the Kerr metric (Fig. \ref{ergo}). The ergo-surfaces are defined by $g_{tt}=1-\frac{2Mr}{r^2+a^2\cos^2(\theta)}=0$ which gives the stationary limit surfaces $r^\pm_E$, where $r^{\pm}_E=M\pm\sqrt{M^2-a^2\cos(\theta)^2}$. As seen on Fig. \ref{ergo}, for $a$ from $a<M$ to $a>M$ we observe a clear transition form two ergo-spheres to an ergo-torus. From a mathematical point of view, it is more natural to work with the dimensionless parameter $b=M/a \in [0,\infty)$. Obviously the point $b=1$ is a {\em bifurcation} point for the family of the Kerr ergo-surfaces. When the bifurcation parameter $b$ increases from $0$ to $\infty$, the ergo-torus ($b\in(0,1)$) bifurcates at the point $b=1$ to two ergo-spheres ($b=(1,\infty)$). The point $b=0$ corresponds to the ring singularity. At the point $b=\infty$ the outer ergo-sphere transforms to the Schwarzschild event horizon and the inner ergo-sphere degenerates to the well-known singularity $r=0$ of the Schwarzschild metric. The evolution of linear perturbations with different spin ($\mid s \mid=0, 1/2, 1, 3/2, 2$) on the background of the Kerr metric was pioneered by Teukolsky in the 70s and led to the famous Teukolsky Master Equation (TME). This differential equation unifies all physically interesting perturbations ${}_{s}\Psi(t,r,\theta,\phi)$ written in terms of Newman-Penrose scalars and is able to describe completely multitude of physical phenomena (\citeauthor{Teukolsky}). The TME in the Boyer-Lindquist coordinates is separable under the substitution: $\Psi=e^{i(\omega t+m\phi)}S(\theta)R(r)$ where $m=0,\pm 1,\pm 2\dots$ for integer spins and $\omega=\omega_R+i\omega_I$ is complex frequency (note that in this article we use the Chandrasekhar notation in which the sign of $\omega$ is opposite to the one Teukolsky used). This frequency and the parameter $E$ are the two complex constants of the separation. The stability condition requires $\omega_I>0$ ensuring that the initial perturbation will damp with time. Making the separation, we obtain the Teukolsky angular (TAE) and the Teukolsky radial (TRE) equations which govern the angular and the radial evolutions of the perturbation, respectively. The key property of those equations is the fact that they both can be solved in terms of the confluent Heun function as first written in detail in \citeauthor{Fiziev0902.1277}. Explicitly, the TAE and the TRE are: \begin{multline} \Big(\left(1\!-\!u^2\right)S_{lm,u}\Big)_{,u}+\\ \left((a\omega u)^2+2a\omega su\!+\!{}_sE_{lm}\!-\!s^2-\frac{(m\!+\!su)^2}{1\!-\!u^2}\right)S_{lm}=0, \label{TAE} \end{multline} and \begin{multline} {\frac {d^{2}R_{\omega,E,m}}{d{r}^{2}}} + (1+s) \left( {\frac{1}{r-{\it r_{+}}}}+ {\frac{1}{r-{\it r_{-}}}} \right){\frac {dR_{\omega,E,m}}{dr}} + \\ +\Biggl( {\frac { K ^{2}}{ \left( r-r_{+} \right) \left( r-r_{-} \right) }}- is \left( {\frac{1}{r-{\it r_{+}}}}+ {\frac{1}{r-{\it r_{-}}}} \right) K- \\ -\lambda - 4\,i s \omega r \Biggr) {\frac {R_{\omega,E,m}} {( r-r_{+})( r-r_{-})}}=0 \label{TRE} \end{multline} \noindent where $\Delta=r^2-2Mr+a^2=(r-r{_-})(r-r{_+})$, $K=-\omega(r^2+a^2)-ma$, $\lambda=E-s(s+1)+a^2\omega^2+2am\omega$ and $u=\cos(\theta)$. In general, these equations are ordinary linear second-order differential equations with 3 singularities, two of which regular, while $r=\infty$ is irregular singularity obtained via confluence of two regular singular points. For the TRE, the regular singularities $r_\pm$ are different when $a\neq M$. At the bifurcation point, $a=M$, $r_+=r_-$ and the TRE has another irregular singularity ($r=M$) instead of the two regular ones. Hence this is a biconfluent case. Note that the ring singularity $r=0,\, \theta=\pi/2$ is not a singularity of the TME and does not play any role in its solutions (as easily seen from Eq. \eqref{TAE} and Eq. \eqref{TRE}). When $a\neq M$, these equations can be reduced to the confluent Heun equation and they can be solved in terms of confluent Heun's function defined as the unique particular solution of following differential equation: \begin{multline} {\frac {d^{2}}{d{z}^{2}}}H \left( z \right) + \left( \alpha+{\frac { \beta\!+\!1}{z}}+{\frac {\gamma+1}{z\!-\!1}} \right) {\frac {d}{dz}}H \left( z \right) \! \\ +\! \left(\frac{\mu}{z}\!+\!\frac{\nu}{z\!-\!1}\right) H \left( z \right)\!=\!0. \label{Heun} \end{multline} The solution called the Heun function is regular in the vicinity of the regular singular point $z=0$ and is normalized to be equal to $1$ at this point, see the monograph \citeauthor{slav} and some additional references in \citeauthor{Fiziev0902.1277}, \citeauthor{Fiziev0904.0245}. From the properties of the confluent Heun function follows that the general solutions of Eq. \eqref{Heun} can be written, using the \textsc{maple} notation, as \begin{multline} H \left( z \right) ={\it C_1}\,\text{HeunC} \left( \alpha,\beta,\gamma ,\delta,\eta,z \right) + \\ {\it C_2}\,{z}^{-\beta}\text{HeunC} \left( \alpha,-\beta,\gamma,\delta,\eta,z \right) \label{HeunSol}, \end{multline} where $\delta=\mu+\nu-\alpha\frac{\beta+\gamma+2}{2}$ and $\eta=\frac{\alpha(\beta+1)}{2}-\mu-\frac{\beta+\gamma+\beta\gamma}{2}$. According to articles Fiziev (\citeyear{Fiziev0902.1277},\! \citeyear{Fiziev0906.5108},\! \citeyear{Fiziev0908.4234}), Fiziev \& Staicova (\citeyear{FS1}, \citeyear{FS2}) and \citeauthor{RBPF} \citeyear{RBPF}) the solutions of the TAE and the TRE for the electromagnetic case $s=\!-1$ can be written in the form: \begin{align*} R_1 \left( r \right) ={\it C_1}{{ e}^{i\omega\,r}}\text{HeunC} \left( \alpha,\beta,\gamma,\delta ,\eta,-{\frac {r-{\it r_{_+}}}{{\it r_{_+}}-{\it r_{_-}}}} \right)\times\\ \left( r\!-\!{\it r_{_+}} \right) ^{{-i\frac { \omega\,({a}^{2} + {{\it r_{_+}}}^{ 2})+am }{{\it r_{_+}}-{\it r_{_-}}}}} \left( r\!-\!{\it r_{_-}} \right) ^{{ i\frac {\omega\,({a}^{2}+{{\it r_{_-}}}^{2})+am}{ {\it r_{_+}}-{\it r_{_-}}}}} \end{align*} and \begin{align*} R_2 \left( r \right) ={ \it C_2}{{ e}^{i\omega\,r}}\text{HeunC} \left( \alpha, -\beta,\gamma,\delta ,\eta,{ -\frac {r-{\it r_{_+}}}{{\it r_{_+}}-{\it r_{_-}}}} \right)\times\\ \left( r\!-\!{\it r_{_+}} \right) ^{{i\frac {\omega\,({a }^{2}+{{\it r_{_+}}}^{2})+am}{{\it r_{_+}}-{\it r_{_-} }}+1}} \left( r\!-\!{\it r_{_-}} \right) ^{{ i\frac{\omega\,({a}^{2}+{{\it r_{_-}}}^{2})+am}{{\it r_{_+}}-{\it r_{_-}}}}} \end{align*} in the case, $r>r_{+}$, where:\\ $\alpha =-2\,i \left( {\it r_{_+}}-{\it r_{_-}} \right) \omega$, $\beta =-{\frac {2\,i(\omega\,({a}^{2}+{{\it r_{_+}}}^{2})+am)}{{\it r_{_+}}-{\it r_{_-}}}}-1$,\\ $\gamma ={\frac {2\,i(\omega\,({a}^{2}+{{\it r_{_-}}}^{2})+am)}{{\it r_{_+}}-{\it r_{_-}}}}-1$,\\ $\delta =-2i\!\left({\it r_{_+}}-{\it r_{_-}} \right)\!\omega\!\left(1-i \left( {\it r_{_-}}+{\it r_{_+}} \right) \omega \right)$,\\ $\eta =\!\frac{1}{2}\frac{1}{{ \left({\it r_{_+}}\!-\!{\it r_{_-}} \right) ^{2}}}\times\\ \Big( 4{\omega}^{2}{{\it r_{_+}}}^{\!\!4}\!+ 4\left(i \omega \!-\!2{\omega}^{2}{\it r_{_-}}\right) {{\it r_{_+}}}^{\!\!3}\!+\! \left( 1\!-\!4a\omega\,m\!-\!2{\omega}^{2}{ a}^{2}\!-\!2E \right) \times \\ \left( {{\it r_{_+}}}^{\!\!2}\!+\!{{\it r_{_-}}}^{\!\!2} \right) \!+\! \\ 4\left(i\omega\,{\it r_{_-}} \!-\!2i\omega\,{\it r_{_+}}\!+\!E\!-\!{\omega}^ {2}{a}^{2}\!-\!\frac{1}{2} \right) {\it r_{_-}}\,{\it r_{_+}}\!-4{a}^{2} \left( m\!+\!\omega\,a \right) ^{2} \Big).$ For the angular function $S(\theta)$, we obtain the following solutions: \begin{align*} S_{{\pm},s,m}(\theta)={\text{e}^{\alpha\, z_{\pm}(\theta) }} \left(z_{\pm}(\theta)\right)^{\beta/2} \left( z_{\mp}(\theta)\right) ^{\gamma/2}\times\\ \text{HeunC} \left(\alpha,\beta,\gamma,\delta,\eta,z_{\pm}(\theta)\right) \label{S1} \end{align*} \noindent where \begin{align*} &\alpha=\pm 4\,a\omega,\beta=s\!\mp \!m\!, \gamma=\! s\!\pm \!m,\delta=\mp 4\,a\omega s,\\ &\eta=\frac{{m}^{2}-{s}^{2}}{2}\!\pm\!2\,a\omega s\!-\!{(a\omega)}^{2}\!-\!E\!+\!s^2,\\ &z_{+}(\theta)=\cos^2\left(\frac{\theta}{2}\right),z_{-} (\theta)=\sin^2\left(\frac{\theta}{2}\right)=1-z_{+}(\theta). \end{align*} Note, the confluent Heun function depends on 5 parameters (here $\alpha,\beta,\gamma$, $\delta$ and $ \eta$ ) but the values of those parameters differ for the TAE and the TRE. To fix the physical problem we want to study, we impose appropriate boundary conditions on the solutions to the TRE and the TAE. These boundary conditions yield the spectrum of the separation constants $E$ and $\omega$. For the solutions of the the TAE, we use the new requirement that the confluent Heun functions should be polynomial. The polynomiality condition reads: \begin{align*} &\frac{\delta}{\alpha}+\frac{\beta+\gamma}{2} + N + 1=0. &\Delta_{N+1}(\mu)=0 . \end{align*} It yields a collimated singular solutions \citeauthor{Fiziev0902.1277}. Here, the integer $N\geq0$ is the degree of the polynomial and $\Delta_{N+1}(\mu)$ is three-diagonal determinant specified in \citeauthor{Fiziev0902.1277}, \citeauthor{Fiziev0904.0245}. The polynomial requirement for the angular solutions fixes the following relation between $E$ and $\omega$: \begin{equation} {}_{s=-1}E_{m}^{\pm}(\omega)\!=\!-{(a\omega)}^{2}-2\,a\omega\,m\!\pm\!2\,\sqrt {{(a\omega)}^{2}\!+\!a\omega\,m}. \label{E} \end{equation} This simple {\em exact} relation leads to a significant technical advantage. Instead of working with a complicated connected system of spectral equations (as in the QNM case), by imposing the polynomial requirement we have to solve only {\em one} spectral equation for the variable $\omega$. Thus we essentially simplify the calculations and we obtain interesting from physical point of view new results. Just examining this simple form of the relation $E(\omega)$ and using the polynomial solutions, we plotted $S(\theta)$ which controls the angular behavior of the solution and we were able to obtain different types of collimated outflows, generated by electromagnetic perturbations of the Kerr metric for different values of $\omega$ which not necessarily belong to the jet spectrum (\citeauthor{FS1}). The existence of such collimation in our results justifies the names ''jet`` solution and ''jet`` spectra that we use. Unlike the QNM case, the considered here "jet" case naturally generates a collimated electromagnetic radiation outflow from KBH and KNS. In the present article we confirm the above preliminary results obtaining numerically the primary-jet spectrum of $\omega$ defined by the KBH and the KNS jet-boundary-conditions. It is important to emphasize that in the case of the angular equation we work with the {\em singular} solutions of the differential equation. The question of the possible physics behind the use of such singularity is answered in \citeauthor{Fiziev0908.4234}. By looking for solution in a specific factorized form $\Psi=e^{i(\omega t+m\phi)}S(\theta)R(r)$, the function we obtain in general is not a physical quantity. Instead it defines a factorized kernel ${}_{s}K_{E,\omega,m}(t,r,\theta,\phi)\sim e^{i(\omega t+m\phi)}{}_{s}S_{E,\omega,m}(\theta){}_{s}R_{E,\omega,m}(r)$ of the general integral representation for the physical solutions of the TME: \begin{multline} {}_{s}\Psi(t,r,\theta,\phi)=\\ \sum _{m=\!-\!\infty}^{\infty}\!\frac{1}{2\pi}\int\!{d\omega}\! \int\!{dE}\, {}_{s}A_{\omega,E,m}\,{}_{s}K_{E,\omega,m}(t,r,\theta,\phi). \label{Kernel} \end{multline} This form of the mathematical representation of the physical solution is written as the most general superposition of all particular solutions of the TME and it assumes summation over all admissible values of $E$ and $\omega$. If one wants to work with the solutions corresponding to certain boundary conditions, then one has to account for the specific admissible spectra of $E$ and $\omega$ in those cases. For example, if we have obtained discrete spectra for $\omega$, this leads to the use of singular kernel proportional to $\sum_{n}^{}\delta(\omega-\omega_{n})$, where $\delta$ is the Dirac function. This reduces the integral over $\omega$ to summation over $\omega_{n}$. Similarly, for solutions with definite total angular momentum we have $E=l(l+1)$ and the integral over $E$ is replaced by summation over $l$--integer (or half integer), because of singular factor $\sum_{l}^{}\delta(E-l(l+1))$ in Eq. \eqref{Kernel}. From Eq. \eqref{Kernel} it becomes clear that the singular solutions of the angular equation do not cause physical difficulties, only if we are able to find appropriate amplitudes ${}_{s}A_{\omega,E,m}$ that will make the physical solution ${}_{s}\Psi(t,r,\theta,\phi)$ regular. Examples of finding such amplitudes are being developed. It is clear that this formula justifies the use of singular solutions of the TAE (for $s=-1$ the singularity is on one of the poles of the sphere, for $s=1$ -- on the other one). Knowing $E(\omega)$, we can find numerically the frequencies $\omega$ by imposing boundary condition on the solutions to the radial equation. The Kerr spacetime can be considered as a background for different physical problems. As in flat spacetimes, one has to fix the physics imposing the corresponding boundary conditions. A specific peculiarity of Kerr spacetime is that in general the TRE (Eq. \eqref{TRE}) has 3 different singular points: $r_+$, $r_-$ and $\infty$. To fix the correct physical problem, we have to specify the boundary conditions on two of them (the asymptotic behavior of the solution at these singular points). This represents the so-called {\em central two-point connection problem} (as described in \citeauthor{slav}). In principle, we can impose boundary conditions on different pairs of singular points: on $r_-$ and $r_+$; on $r_-$ and $+\infty$; on $r_-$ and $-\infty$; on $r_+$ and $+\infty$; on $r_+$ and $-\infty$; and on $-\infty$ and $+\infty$. Each of these choices will fix a specific type of physical problem posed in the complex domain of variables. Obviously, these different problems may have different physical properties, especially, with respect to their linear stability. Note that choosing a specific central two-point connection problem we fix the physical problem independently of the values of bifurcation parameter $b$. This way, we are able to study the bifurcation phenomenon for the given physical problem in the whole range of the parameter $b$. Since we want to study primary jets from the KBH and the KNS, we start by imposing BHBC on the solutions to the TRE at the points $r_+$ and $\infty$ for the first case ($a<M$), where the regular singularities are {\em real}. These boundary conditions are physically well motivated (\citeauthor{Teukolsky}, \citeauthor{Chandrasekhar}) and the central two-point connection problem for the KBH has a clear physical meaning. The same central two-point connection problem exists in the overspinning case, in spite of the fact that its two regular singularities $r_{\pm}$ are {\em complex}. We use the same boundary conditions for the case of primary jets from the KNS, since the physics of the problem is defined by them. Thus, we transform the BHBC to naked singularity boundary conditions using an analytical continuation of the central two-point connection problem. BHBC can be summarized to: 1. On the horizon ($r \rightarrow r_{+}$), we require only ingoing (in the horizon) waves. This specifies which of the two solutions of the TRE ($R_{1}$ or $R_{2}$) works in each interval for the frequency $\omega$. In our case, for any integer $m$, $R_1$ is valid for $\Re(\omega) \in (- m\Omega_{+}, 0)$, $R_2$ is valid in the complimentary set $\Re(\omega)\in(-\infty,+\infty) \setminus (- m \Omega_{+},0)$ where $\Omega_{+}=a/2Mr_{+}$. For $m=0$, the only valid ingoing solution in the whole range $\Re(\omega)\in(-\infty,+\infty)$ is $R_{2}$. 2. At infinity ($r \rightarrow \infty$) we allow only outgoing waves. Explicitly, at infinity we have a linear combination of an ingoing ($R_{\leftarrow}$) and an outgoing ($R_{\rightarrow}$) wave: \begin{equation*} R=C_{\leftarrow}\,R_{\leftarrow}+C_{\rightarrow}\,R_{\rightarrow} \end{equation*} where $C_{\leftarrow}$, $C_{\rightarrow}$ are unknown constants. In order to have only outgoing waves, we need to have $C_{\leftarrow}=0$. Since this constant is unknown, we find it indirectly from: \begin{equation} C_{\leftarrow}=\frac{R}{R_{\leftarrow}}-C_{\rightarrow}\frac{R_{\rightarrow}}{R_ {\leftarrow}}. \label{C} \end{equation} If in this equation we set $\lim\limits_{r\to\infty}\frac{R_{\rightarrow}}{R_{\leftarrow}}= 0$, this will eliminate the second term in Eq. \eqref{C}. To do this, we complexify $r$ and $\omega$ and choose the direction in the complex plane $\mathbb{C}_r$ in which this limit tends to zero most quickly. This direction turns out to be $arg(r)=3\pi/2 - arg(\omega)$, i.e., $r=\mid r \mid e^{3/2i\pi-i\,arg(\omega)}$ connecting the arguments of the complexified $r$ and $\omega$ (\citeauthor{QNM9}). Having fixed that, it is enough to solve the spectral condition in the form \begin{equation} C_{\leftarrow}=\lim\limits_{\mid r\mid\to\infty}\frac{R}{R_{\leftarrow}}=0 \label{Rbc} \end{equation} in order to completely specify the primary jet spectra ${}_{s}\omega^{jet}_{n,m}$. For primary jets from the KNS we use the same spectral condition in the complex domain (see above). Since in this paper we calculate only the case $s=-1$, for primary jets from the KBH and the KNS, we will omit the prefix $s=-1$ in front of $\omega_{n,m}$ and also the index ''jet``. \section{Numerical results} In Fiziev \& Staicova (\citeyear{FS1}, \citeyear{FS2}), we presented some preliminary results for the solutions of the TAE. They showed that the polynomial angular solutions describe collimated structures from various types for arbitrary $\omega$, even if the BHBC (Eq. \eqref{Rbc}) is not fulfilled. In this article we will focus on the solutions of the radial equations, thus fixing the specific spectrum $\omega_{n,m}$ for primary jets from the KBH and the KNS from Eq. \eqref{Rbc}. \begin{figure}[!h] \begin{center} \includegraphics[scale=0.3]{Staicova_fig4.eps} \caption{Complex plot of the frequencies $\omega_{n}$ for $a = 0$. The index $n = 0, 1, . . .$ increases with the distance to the origin. For every $n > 0$, there is a pair of 2 roots $\omega^{1,2}_n$ symmetrical with respect to the imaginary axis. In the case $a=0$, the frequencies are independent of $m$} \label{fig:m0_all} \end{center} \end{figure} \subsection{Numerical methods} To find the zeros of Eq. \eqref{Rbc}, we use the software package \textsc{maple} which currently is the only one able to work with Heun's functions. The roots presented here are found with modified by the team M\"uller algorithm, with precision to 13 digits. Although the results for different versions of \textsc{maple} may vary in some cases due to improvements in the numerical algorithm, key values were checked to have at least 6 stable digits, in most cases -- more than 8 stable digits. \begin{figure}[!hb] \vspace{0.0in} \begin{center} \includegraphics[trim=5mm 0mm 3mm 3mm,clip, scale=0.3,keepaspectratio]{Staicova_fig5.eps} \includegraphics[trim=5mm 0mm 3mm 3mm,clip,scale=0.3,keepaspectratio]{Staicova_fig6.eps} \includegraphics[trim=5mm 0mm 3mm 3mm,clip,scale=0.3,keepaspectratio]{Staicova_fig7.eps} \vspace{-0.2cm} \caption{Complex plot of the two lowest modes $\omega^{\pm}_{n=0,1;m}(a)$ for $m\!=\!0,1,2$. With red circles we plot $\omega^{+}_{n=0,1,m}$, with blue crosses -- $\omega^{-}_{n=0,1,m}$; on the curve we mark some values of $a$. It is clear that for $m\!>\!0$, $\omega^{+}_{1,m}$ and $\omega^{-}_{1,m}$ coincide almost everywhere. For $m\neq0$, $a<M$, the symmetry with respect to the imaginary axis breaks} \label{cp} \end{center} \vspace{-0.35cm} \end{figure} The parameters are fixed as follows : $s=-1$, $M=1/2$, $r=110$. This value for the radial variable $r$ is chosen so that it represents the actual numerical infinity -- the closest point at which the frequencies found by our numerical method stop changing significantly for further increase of $r$ (for fixed $a,m,n$). In study of the dependence on $a$, the step for the rotational parameter is $\delta a=0.01$ for $a<M$ and becomes adaptive for $a>M$. In our work, we have studied in detail cases with $m=0, \pm 1, 2 $, covering the cases $\mid m\mid<\mid s\mid$, $\mid m\mid=\mid s\mid$, $\mid m\mid>\mid s\mid$. The complete set of our numerical results is available by request. \subsection{Summary of the results} Graphical representation of our results can be seen in figures 2-11. In the case $a=0$ when no rotation of metric is present we find a set of pairs of frequencies $\omega^{1,2}_{n}$ with equal imaginary parts and real parts symmetrical with respect to the imaginary axis ($\Re(\omega^1_n)=-\Re(\omega^2_n)$ and $\Im(\omega^1_n)=\Im(\omega^2_n)$). This set (Fig. \ref{fig:m0_all}) is maybe infinite if the yet unknown next frequencies follow the same line as in Fig. \ref{fig:m0_all}. The set is independent of azimuthal number $m$ as it should be for $a=0$. Frequencies are numbered with $n$ according to their distance from the origin $\mid \omega_n\mid$, starting with $n=0$ for the lowest. Although Fig. \ref{fig:m0_all} shows the case without rotation, it drastically differs from the results obtained by solving the Regge-Wheeler Equation for the Schwarzschild metric in the QNM case (\! \citeauthor{QNM}\!\!\citeyear{QNM},\! \citeauthor{Chandrasekhar},\! \citeauthor{QNM1},\! \citeauthor{QNM2} \!\!\citeyear{QNM2},\! \\ \citeauthor{QNM3}, \citeauthor{QNM4}, \citeauthor{QNM5} \citeyear{QNM5}, \citeauthor{QNM6}, \citeauthor{QNM7}, \citeauthor{QNM9}, \citeauthor{QNM10}, \citeauthor{QNM11}, \citeauthor{Berti09} \citeyear{Berti09}), because of the change of the conditions for the solutions of the TAE. Using the so found initial frequencies, we track their evolution with the change of the rotational parameter $a$. We work with both frequencies in the pairs for each $n$ ($\omega^{1,2}_{n,m}$) and we consider both signs in front of the square root in ${}_{s=-1}E_{m}^{\pm}(\omega)$ (Eq. (\ref{E})), which we denote $\omega^{\pm}_{n,m}$, respectively. On the figures, the number of points we present is limited by the abilities of the \textsc{maple} numerical procedures evaluating the confluent Heun function. The relation $\omega_{n,m}(a)$ is nontrivial as can easily be seen on Fig. \ref{cp} and Fig. \ref{m:Re_Im}. \begin{figure*}[thb] \begin{center} $\begin{array}{lcr} a) \includegraphics[scale=0.25,keepaspectratio]{Staicova_fig8.eps} & b) \includegraphics[scale=0.25,keepaspectratio]{Staicova_fig9.eps} & c) \includegraphics[scale=0.25,keepaspectratio]{Staicova_fig10.eps}\\ d) \includegraphics[scale=0.25,keepaspectratio]{Staicova_fig11.eps} & e) \includegraphics[scale=0.25,keepaspectratio]{Staicova_fig12.eps} & f) \includegraphics[scale=0.25,keepaspectratio]{Staicova_fig13.eps} \\ \end{array}$ \end{center} \caption{Dependence of the real and the imaginary part of two lowest modes ($n=0,1$) on $a$ for $m=0,1,2$. At the bifurcation point $b=1$ ($a=M=0.5$), $\Im(\omega^{\pm}_{n=0,1;m}) \rightarrow 0$ implying a critical event at this point. Also $\Re(\omega^{\pm}_{n=0,1;m}) \equiv m \Omega_{+}$ for $a<M$, $m\neq0$. On the plots $\omega^{+}_{0,m}$ is marked with the dashed line, $\omega^{-}_{0,m}$ has been ommited. The solid lines and the crosses correspond to $\omega^{\pm}_{1,m}$ -- they mostly coincide for $m\neq0$} \label{m:Re_Im} \end{figure*} \begin{figure*}[htbp] \begin{center} $\begin{array}{lccccr} a) \hspace{-15px} \includegraphics[scale=0.27,keepaspectratio]{Staicova_fig14.eps} & b) \hspace{-15px}\includegraphics[scale=0.27,keepaspectratio]{Staicova_fig15.eps} & c) \hspace{-15px} \includegraphics[scale=0.27,keepaspectratio]{Staicova_fig16.eps} \\ \end{array}$ \end{center} \caption{Complex plot of some of the frequencies with different $n$ obtained in the case $m=0$, a) $\omega^{+}_{n,0}$, $n=2-7$, b) $\omega^{-}_{n,0}$, $n=2-7$, c) $\omega^{+}_{n,0}$ for $n=2-18$ (the black dot stays for $a=0$, green diamond -- the last $a$ where a root was found). The modes $n=0,1$ are not plotted. For $m=0$, there is interesting symmetry between figs. a) and b) with respect to the vertical axis (see the text for details) } \label{m0_loops} \end{figure*} The results we obtained can be summarized as follows: \begin{itemize} \item The two lowest modes $n=0,1$ we call \textit{special} and they are the only ones we could trace to $a>M$. \item For the special modes, for $a<M$ we observe $\Re(\omega^{+}_{0,m})\approx \Re(\omega^{\pm}_{1,m})$ (for $m \neq 0$ and $a>0.1$) while $\Im(\omega^{+}_{0,m})<< \Im(\omega^{\pm}_{1,m})$ (for $m\neq0$, $a>0.1$, $\Im(\omega^{\pm}_{0,m})<10^{-7}$; in the case $m=0$, $\Im(\omega^{\pm}_{0,0})$ decreases more slowly). Since the real parts of the two modes are almost equal for $a<M$ and the imaginary part of the $n=0$ mode is negligible, in our figures in that range, we emphasize only the complex frequencies $\omega^{\pm}_{1,m}$. It's important to note that $\omega^{-}_{0,m}$ (for $m>0$, $a<M$) has different behavior from $\omega^{+}_{0,m}$ -- it has very small real and imaginary parts (compared to all the other modes), and since our numerical precision for it is low, we would not discuss that mode. For $m<0$ the situation reverses and $\Re(\omega^{-}_{0,m})\approx \Re(\omega^{\pm}_{1,m})$, while $\omega^{+}_{0,m}$ becomes the peculiar one. \item For $m>0$ the real part of the special frequencies $\Re(\omega_{n=0,1,m})$ decreases steadily with the increase of $a$, until one of the modes has a minimum at the point $a = M$, the other -- at $a > M$, but close to it -- see Fig. \ref{m:Re_Im} c), e). In the case $m=0$, $\Re(\omega_{1,0})$ has a maximum for $a<M$ and then has a minimum for $a>M$ (Fig. \ref{m:Re_Im} a) ). \item The imaginary part of the special frequencies $\Im(\omega_{1,m})$ (Fig. \ref{m:Re_Im} b), d), f)) for all the cases stays positive, it decreases for $a<M$ and it tends to zero for $a=M$. For $a=M$, the solutions of the TRE can no longer be expressed in terms of confluent Heun functions. In this case, one has to use biconfluent Heun function (\citeauthor{Fiziev0908.4234}). We didn't calculate at this point. When $a>M$, $\Im(\omega_{n,m})$ increases again until it reaches almost constant value at high $a$. \item In the range $a>M$ , $m \neq 0$ we obtain two modes with different values of the real and imaginary parts, but similar behavior. The real parts of the modes both have minima, but at different points. The imaginary part of both modes tends to zero as $a\rightarrow M$, but for $a>>M$ they reach different constants with $\Im(\omega_{1,m})-\Im(\omega_{0,m})\approx 1$. These two modes appear for $m=\pm1,\pm2,\pm3$ (Fig. \ref{cp} and Fig. \ref{m:Re_Im}). We couldn't find other modes for $a>M$ using our numerical methods. \item Modes with $n>1$ demonstrate highly non trivial behavior and strong dependence of the parameter $a$, even though numerically they cannot be traced to $a>M$ and in some cases we are able to fix a very limited number of points. For $m=0$, those modes persistently demonstrate signs of loops, (see Fig.\ref{m0_loops} and Fig.\ref{m0n1ed}), which seem to disappear for $m\neq0$ (see Fig. \ref{m1_loops}, Fig. \ref{m1sn}). The real parts of the modes with $n>1$ seem to form a surface whose physical meaning is yet unknown, while their imaginary parts split in two with increasing of the rotational parameter (Fig.\ref{m0ed}, Fig.\ref{m1sn}). Note that the BHBC requires frequencies with $\Re(\omega_{n,m})>-m\Omega_{+}$ or $\Re(\omega_{n,m})<0$ (for $m<0$!) to be obtained using the solution $R_{2}(r)$, while frequencies with $0<\Re(\omega_{n,m})<-m\Omega_{+}$ to be obtained using the solution $R_{1}(r)$. Since working numerically with the solution $R_{1}(r)$ so far has been challenging, we present here only frequencies obtained with the solution $R_{2}(r)$. Thus, on Fig. \ref{m1sn}, only frequencies whose real part is above the $n=1$ mode plotted in magenta (or below $\Re(\omega)=0$) satisfy BHBC. This, however, is the case only for $m\neq0$. For $m=0$, according to the BHBC the solution $R_{2}(r)$ can be used in the whole range $\Re(\omega_{n,0})\in (-\infty,+\infty)$ and all the frequencies we obtained represent ingoing in the horizon modes. \item The frequencies $\omega^{+}_{n,m}$ and $\omega^{-}_{n,m}$ are symmetric for $m=0$ (Fig. \ref{fig_05}) for $n>0$, and they coincide in the cases $m\neq0$, $n=1$ for $a\geq a_{m}$, where $a_{m}$ tends to zero for sufficiently big $m$ (for $m=1$, $a_{m}=0.1$, for $m=2$, $a_{m}=0.04$, for $m=5$, $a_{m}=0.02$, for $m=10$, $a_{m}=0$). For $n>1$, $\omega^{+}_{n,m}$ and $\omega^{-}_{n,m}$ do not coincide. \begin{figure}[htb] \begin{center} $\begin{array}{lr} \multicolumn{1}{l}{\mbox{\bf (a)}} & \multicolumn{1}{l}{\mbox{\bf (b)}}\\ \\ \hspace{-0.25in} \includegraphics[scale=0.2,keepaspectratio]{Staicova_fig17.eps} &\hspace{-0.15in} \includegraphics[scale=0.2,keepaspectratio]{Staicova_fig18.eps} \hspace{-0.15in} \\ \end{array}$ \end{center} \caption{A particular case of the symmetry observed in the frequencies $\omega^{\pm}_{1,0}$ for $a<M$. When $m \neq 0$ $\omega^{+}_{n,m}$ and $\omega^{-}_{n,m}$ coincide for $a>a_{m}$} \label{fig_05} \end{figure} \item There is symmetry in our spectra, which is confirmed for $m=\pm 0, 1, 2$ for all of the modes with $n>0$ (except at some points): \begin{align*} \Re(\omega^{1,2}_{n,m})=-\Re(\omega^{2,1}_{n,-m}),\, \Im(\omega^{1,2}_{n,m})=\Im(\omega^{2,1}_{n,-m}), \end{align*} \noindent where $\omega^{1,2}$ correspond to the two frequencies from the pairs observed for $a=0$ (frequencies with positive and negative real part for each $m,n$ on Fig. \ref{fig:m0_all}). This symmetry allows us to study, for example, only the case $m>0$ if or when it works numerically better. \end{itemize} From the figures, one can clearly see that, for every $m$, the relation $\omega_{1,m}(a)$ demonstrates systematic behavior characterized by some kind of critical event at the bifurcation point $b=M/a=1$, where the damping of the perturbation tends to zero ($\Im(\omega_{n,m})\to 0$). Physically, this transition corresponds to the change of the topology of the ergo-surface visualized on Fig. \ref{ergo}. \begin{figure*}[htb] \begin{center} $\begin{array}{lcccr} \hspace{-0.3in}\epsfxsize=1.65in \epsffile{Staicova_fig19.eps} &\hspace{-0.1in} \epsfxsize=1.65in \epsffile{Staicova_fig20.eps} &\hspace{-0.1in} \epsfxsize=1.65in \epsffile{Staicova_fig21.eps} &\hspace{-0.1in} \epsfxsize=1.65in \epsffile{Staicova_fig22.eps} \hspace{-0.3in} \\ a)&b)&c)&d)\\ \end{array}$ \end{center} \caption{Two cases showing the detailed behavior of modes with $n\!>\!1$ for $m\!=\!0$. a), b) correspond to $n\!=\!2$; c), d) to $n\!=\!6$ } \label{m0n1ed} \end{figure*} \begin{figure*}[htb] \begin{center} $\begin{array}{clclc} \hspace{-0.3in} \epsfxsize=1.65in \epsffile{Staicova_fig23.eps} & \hspace{-0.1in} \epsfxsize=1.65in \epsffile{Staicova_fig24.eps} & \hspace{-0.1in} \epsfxsize=1.65in \epsffile{Staicova_fig25.eps} & \hspace{-0.1in} \epsfxsize=1.65in \epsffile{Staicova_fig26.eps} \hspace{-0.3in}\\ a) & b) & c) & d)\\ \end{array}$ \end{center} \caption{The case $m=0$, modes with $n>1$ a), b): $\Re(\omega^{+}_{n,0})$ and $\Im(\omega^{+}_{n,0})$, $n=2-5$ c), d): $\Re(\omega^{+}_{n,0})$ and $\Im(\omega^{+}_{n,0})$, $n=1-18$. On c) and d) we plotted the conjugate roots $\omega^{1,2}_{n,0}$ on one plot. The magenta lines correspond to the special mode $n=1$} \label{m0ed} \end{figure*} \begin{figure*}[htb] \begin{center} $\begin{array}{lcr} a) \epsfxsize=2in \epsffile{Staicova_fig27.eps} & b) \epsfxsize=2in \epsffile{Staicova_fig28.eps} & c) \epsfxsize=2in \epsffile{Staicova_fig29.eps}\\ \end{array}$ \end{center} \caption{Complex plots in the case $m\!=\!-\!1$: a) $\omega^{+}_{n,-1}$, $n\!=\!3\!-\!14$ , b) $\omega^{+}_{n,-1}$, $n\!=\!2\!-\!16$, c) $\omega^{-}_{n,-1}$, $n\!=\!2\!-\!18$ . There are no loops for $\mid\! m \!\mid \!=\!1$} \label{m1_loops} \end{figure*} \begin{figure*}[htb] \begin{center} $\begin{array}{lccr} \hspace{-0.3in} \epsfxsize=1.89in \epsffile{Staicova_fig30.eps} & \hspace{-0.4in} \epsfxsize=1.89in \epsffile{Staicova_fig31.eps} & \hspace{-0.4in} \epsfxsize=1.89in \epsffile{Staicova_fig32.eps} & \hspace{-0.4in} \epsfxsize=1.89in \epsffile{Staicova_fig33.eps}\hspace{-0.4in}\\ a)&b)&c)&d)\\ \end{array}$ \end{center} \caption{The case $m=-1$, $n>0$: a) $\Re(\omega^{+}_{n,-1})$, b) $\Im(\omega^{+}_{n,-1})$, c) $\Re(\omega^{-}_{n,-1})$, d) $\Im(\omega^{-}_{n,-1})$. The magenta line marks the \textit{special} mode $n=1$ } \label{m1sn} \end{figure*} \subsection{Analysis of the results} The spectra we presented demonstrates a clear transition at the bifurcation point $a=M$, matching the transition from a rotating black hole to an extremal black hole demanded by the theory of black holes. Since we can approach the point $a=M$ from both directions, it seems natural to speak also of extremal naked singularity, for $a\rightarrow M$ but $a>M$. From our figures it is clear that the behavior of the spectra when $a\rightarrow M$ from both sides is similar -- the imaginary part of the critical frequency tends to zero at those points and quickly rises to a (different) constant for $a\neq M$. We couldn't find any frequencies with negative imaginary parts in this case; thus, it seems that the primary jets from the KBH and the KNS are stable even in the regime of naked singularities. This differs from the QNM case, in which QNM from naked singularities are unstable (\citeauthor{Press_Teukolsky}). Another example of unstable spectra can be found in \citeauthor{Dotti} where completely different boundary conditions for the overspinning Kerr space-time are considered. There, the authors analyzed the central two-point connection problem on the singular interval $r \in (-\infty, \infty)$. As we see, in our case the primary jets are stable. There is no contradiction since we study a completely different physical problem. Besides, the discrete levels of the spectra of the primary jets from the KBH and the KNS appear to be smooth in the whole interval of the bifurcation parameter $b$, except for the bifurcation point $b=1$. Another surprise is that numerically $\Re(\omega_{n,m}) \equiv - m \Omega_{+}$ for $a<M$ for modes $n=0,1$. Here $\Omega_{+}=a/2Mr_{_+}$ is the angular velocity of the event horizon. It is curious that we can represent the same relation in the form $\Re(\omega_{n,m})=-m\omega_{cr}$, for $n=0,1$, where $\omega_{cr}$ is the critical frequency of superradiance for QNM \citeauthor{superradiance}, \citeauthor{superradiance2}, \citeauthor{superradiance3}, \\ \citeauthor{superradiance5}, \citeauthor{superradiance6}, \\ \citeauthor{Teukolsky2}, \citeauthor{superradiance7}, \citeauthor{superradiance9},\\ \citeauthor{superradiance8}). The complexity of the frequency $\omega_{1,m}$ whose real part equals $-m\omega_{cr}$ may show another essential physical difference between our primary jets-from-KBH and jets-from-KNS solutions and standard QNM, obtained using regular solutions of the angular equation Eq. \eqref{TAE}. In our case, we observe two (lowest) modes ($\omega^{+}_{0,m}$, $\omega^{\pm}_{1,m}$ for $m>0$) whose real parts coincide with the critical frequency of QNM-superradiance. However, only $\omega^{+}_{0,m}$ is almost real, having a very small imaginary part. The magnitude of the imaginary parts of the other two, $\omega^{\pm}_{1,m}$, is of the same order as that of their real parts. To the best of our knowledge this is the first time that an imaginary part of such quantity, somehow related with the critical QNM-superradiance frequency, is discovered solving BH boundary conditions in pure vacuum (i.e. without any mirrors, additional fields, etc). Note that while for $a<M$ the small imaginary part of $\omega^{+}_{0,m}$ speaks of slow damping, for $a>M$ the imaginary part seems to grow quickly to become comparable with the real part value, thus ensuring stability. The two lowest modes in our primary jet spectra are the only ones, which we can trace from $a < M$ to $a > M$. Although the lack of the higher modes ($n>1$) for $a>M$ could be due to problems with the numerical routines we use, its persistence for every $m$ implies that there may be a possible deeper physical meaning behind it. It is interesting to investigate in detail the relation of our results with the superradiance phenomenon. Although the considered primary jet-perturbations to the Kerr metric in general damp quickly for $b\neq 1$ ($a\neq M)$, this situation changes in the limit $b\rightarrow 1$ -- the imaginary part of $\omega$ then tends to zero near the bifurcation point, both for $b\rightarrow 1-0$ and $b\rightarrow 1+0$. In this case, the perturbation will damp very slowly with time while oscillating violently, opening the possibility for interesting new primary jet-phenomena which deserve additional detailed consideration. The best fit for our numerical data for the lowest modes ($n=0,1$) turns out to be the exact formula $(3.4a)$ in \citeauthor{Fiziev0908.4234}: \begin{equation} \hspace{15px} \omega_{n=0,1,m}=(-m + iN\sqrt{b^2-1}\,)\,\Omega_{+}, \,\,\,\,N=0,1. \label{omega} \end{equation} \begin{figure*}[htbp] $\begin{array}{lr} \includegraphics[scale=0.35,keepaspectratio]{Staicova_fig34.eps} & \includegraphics[scale=0.35,keepaspectratio]{Staicova_fig35.eps} \end{array}$ \caption{Comparison between our numerical results plotted with blue (red) crosses and the analytical formula (violet lines) in the cases $N=0,1$. The excellent fit is spoiled only for $m=0$, $a<0.5$} \label{a:all} \end{figure*} Here, the formula is written in terms of angular velocity $\Omega_{+}$ and bifurcation parameter $b=M/a$ since these are more relevant to the problem at hand. The fit can be seen on Fig. \ref{a:all}. Clearly this formula offers a very good fit to the data, except for the case $m = 0$, $b > 1$ where it gives zeros, differing from our numerical results. If we compare all other relevant points produced in our numerical evaluations (i.e., the points for the two lowest $n = 0, 1$ modes for $b > 1$ corresponding to $N = 0, 1$ in Eq. \eqref{omega} and points for the only two modes available for $b < 1$, which corresponds to $N = 0, 1$ in Eq. \eqref{omega}, for $m = 0, \pm 1 , \pm 2$) with the values calculated according to formula Eq. \eqref{omega} for the corresponding $a$ and $M$, the two sets coincide with precision of at least 5 digits in the worst few cases, and with at least 10 digits for most of the points. Usually, there are some deviations for small $a$ ($b>>1$). The case $n=0$ for $a<M$ is not plotted, because numerically the real parts of $n=0$ and $n=1$ coincide for $0.1<a<M$ , while the imaginary part of $n=0$ is very small -- thus, the $n=0$ mode clearly obeys Eq. \eqref{omega} for $N=0$. Taking into account that: 1) This exact formula is analytically obtained from the properties of the confluent Heun functions in the case of polynomial condition imposed on the {\em the TRE} and not on the TAE; and 2) The routines with which \textsc{maple} evaluates the Heun function, as well as their precision are unknown, this match is extremely encouraging. Besides, it poses once more the question about the physics behind Eq. \eqref{omega}. Eq. \eqref{omega} appears without derivation also in \\ \citeauthor{Berti03} and \citeauthor{Berti_Kokkotas}, where the authors imposed QNM boundary conditions meaning they worked with the {\em regular} solutions of the TAE. In their paper, Eq. \eqref{omega} was considered as a linear approximation to some unknown nonlinear with respect to $\Omega_{+}$ relation. It is written in terms of the temperature of the horizon, and according to the authors, it fits very well the frequencies they obtained for the QNM case $l=m=2 \quad (=\mid s \mid)$ and also it matches the imaginary parts of the QNM ($n=1,2,3...$) when $m>0$ (for the other cases it does not work). In contrast, in our numerical results, Eq. \eqref{omega} describes the lowest modes ($n = 0,1$) for all values of $m$ equally well (except $m = 0, a < M$), while it fails to describe the modes with $n > 1$ -- Eq.\eqref{omega}, for $N =n$ or $N = n + 1$ matches only the relative magnitude of the modes and has no resemblance to their highly non-trivial behavior. The fit does not improve even for the highest mode ($n = 20$) we were able to obtain. Surprising similarity between the two cases (primary jets and QNM) is that the real parts of the higher modes ($n > 1$) in our results also seem to tend to the lowest mode $\Re(\omega_{0,m})=\Re(\omega_{1,m}) = -m\Omega_{+}$ . However, since in our case the frequencies come in pairs, the frequencies with opposite to $\Omega_{+}$ sign do not tend to $\Omega_{+}$ but they still seem to have a definite limit. Despite the differences, the appearance of Eq. \eqref{omega} in the two cases corresponding to different physical problems is interesting and raises questions about the underlying physics it represents. It also contributes to the validity of our approach, since our results are comparable in some points with \citeauthor{Berti03} who use a completely different but well established in QNM calculations numerical approach (Leaver's method of continued fractions). Finally, it is worth recalling that only part of the modes with $n>1$, $m\neq0$ presented here satisfy BHBC and represent perturbations ingoing into the outer horizon $r_{+}$, thus describing a perturbation of the KBH. The modes that violate BHBC (on Fig. \ref{m1sn} between $\Re(\omega)=0$ and $\Re(\omega_{1,-1})$ -- the magenta line) describe perturbations outgoing from the horizon, thus describing a perturbation of \textit{white hole}. It is clearly interesting that the solutions of the equation $R_2(r)$ evolve with the rotation $a$ in a way that they first describe ingoing waves and later describe outgoing waves, with some hints that they will tend to $\Omega_{+}$, but it is impossible to make a conclusion based on current numerical algorithms and without further study of the whole white hole case. Although this is beyond the scope of current article, it clearly demonstrates the complexity of our approach and the richness of the possible results. \section{Conclusion} In this article, we presented new results of the numerical studies of our model of primary jets of radiation from the central engine inspired by the properties of GRB. We have already showed that the polynomial requirement imposed on the solutions to the TAE leads to collimated jet-like shapes observed in the angular part of the solution, thus clearly offering a natural mechanism for collimation due to purely gravitational effects (\citeauthor{Fiziev2010a}). Continuing with the TRE, we imposed standard black hole boundary conditions and we obtained highly nontrivial spectra $\omega_{n,m}(a)$ for a collimated electromagnetic outflow from both the KBH and the KNS. These novel spectra give a new theoretical basis for examination of the presence of the Kerr black hole or the Kerr naked singularity in the central engine of different observed astrophysical objects. We gave a detailed description of the qualitative change of the behavior of primary jet spectra under the transition from the KBH to the KNS and showed that this transition can be considered as bifurcation of the family of ergo-surfaces of the Kerr metric. Numerical investigation of the dependence of these primary jet spectra on the rotation of the Kerr metric is presented and discussed for the first time. It is based on the study of the corresponding novel primary jet-boundary-problem formulated in the present article. Here we use the exact solutions of the Teukolsky Master Equation for electromagnetic perturbations of the Kerr metric in terms of confluent Heun's function. The numerical spectra for the two lowest modes $n = 0,1$ (with some exceptions) is best described by the exact analytical formula in \citeauthor{Fiziev0908.4234}, though derived by imposing the polynomial conditions on the solutions to the TRE instead to the TAE. Although unexpected, this fit serves as confirmation of both our numerical approach and the analytical result, and it is a hint for deeper physics at work in those cases. Interestingly, the formula in question, Eq. \eqref{omega}, works only for the lowest modes ($n = 0,1$) for {\em each} $m$ and correctly describes two frequencies with coinciding for $a < M$ real parts and different imaginary parts (zero and comparable to the real part, respectively). The modes with higher $n$ are not described by it and have highly non-trivial behavior -- they seem to have a definite limit which numerically coincides with the angular velocity of the event horizon (and critical frequency of QNM superradiance) in some of the cases. The obtained primary jet spectra seem to describe linearly stable electromagnetic primary jets from both the KBH and the KNS. Indeed, the imaginary part of the complex primary jet frequencies in our numerical calculations remains positive, ensuring stability of the solutions in direction of time-future infinity and indicating an explosion in the direction of time-past infinity. This is surprising, since according to the theory of QNM of the KNS, the naked-singularity regime should be unstable in time future. There is no contradiction. The different conditions on the solutions to the TAE we use, define a different physical situation -- we work with primary jets from the KBH or the KNS, not with QNM, and our numerical results suggest that these primary jets are stable even for the KNS. We showed that the value $b=M/a=1$ describes bifurcation of ergo-surfaces of the Kerr metric. Around this bifurcation point the imaginary part of the primary jet frequency decreases to zero suggesting slower damping with time. This could have interesting implications (including the loss of primary jet stability) for rotating black holes or naked singularities close to the extremal regime. Besides, for $a>>M$ (i.e. $b\to 0$), or $a<<M$ (i.e. $b\to\infty$) the imaginary part of the primary jet frequencies remains approximately constant with respect to the bifurcation parameter $b$, being positive in both directions. Although very simple, our model was able to produce interesting results whose physical interpretation and applications require additional consideration. It also demonstrates the advantage of the use of confluent Heun functions and their properties in the physical problem at hand. Whether this mechanism of collimation is working in GRBs, AGNs, quazars and other objects can be understood only trough comparing the spectra of their real jets and our "primary jet spectra" taking into account also the interference from the jet environment and from the different emission mechanisms. For the real observation of the predicted here spectra is important the intensity of their lines. It depends on the power of the primary jet, created by the central engine, which is still an open problem. If there exist a natural gravitational mechanism of creation of very powerful primary jets, that jets may play the main role in observed astrophysical jets. Otherwise one can expect to see some traces of these primary jet spectra in the spectra of astrophysical jets, similar to the traces of standard QNM spectra in the exact numerical solutions of Einstein equations. It is remarkable that similar effects of specific collimation of flows of matter particles, described by geodesics in rotating metrics like Kerr one are discovered independently of our study of specific jet-like solutions of Teukolsky Master Equation. See the recent articles: \citeauthor{geodesics1} \citeyear{geodesics1}, \citeauthor{geodesics2} \citeyear{geodesics2} and the references therein. The proper combination of these novel effects of collimation for both radiation and matter outflows from compact objects may be important ingredient of the future theory of real astrophysical jets. The approach based on the Teukolsky Master Equation seems to give more general picture of the collimation phenomena, at least in the framework of perturbation theory of wave fields of different spin in Kerr metric. In addition, our approach gives direct suggestions for observations, since the frequencies, we have discussed in the present paper, in principle may be found in spectra of the real objects like jets from GRBs, AGNs, quazars, e.t.c. Their observation will present indisputable direct evidences for the real nature of the central engine, since the corresponding spectra can be considered as fingerprints of that still mysterious object. \section{Acknowledgements} This article was supported by the Foundation "Theoretical and Computational Physics and Astrophysics" and by the Bulgarian National Scientific Fund under contracts DO-1-872, DO-1-895 and DO-02-136. The authors are thankful to the Bogolubov Laboratory of Theoretical Physics, JINR, Dubna, Russia for the hospitality and good working conditions. Essential part of the results was reported and discussed there during the stay of the authors in the summer of 2009. D.S. is deeply indebted to the leadership of JINR, for invaluable help to overcome consequences of the incident during the School on Modern Mathematical Physics, July 20-29, 2009, Dubna, Russia. \section{Author Contributions} P.F. posed the problem, supervised the project and is responsible for the new theoretical developments and interpretations of the results. D.S. is responsible for the highly nontrivial and time consuming numerical calculations and production of the numerous computer graphs, as well as for the analysis of the results and their interpretation. Both authors discussed the results and their implications and commented at all stages. The manuscript was prepared by D.S. and edited and expanded by P.F.. Both authors developed numerical methods and their improvements, including testing of the new versions of the \textsc{maple} package in collaboration with Maplesoft Company. \makeatletter \let\clear@thebibliography@page=\relax \makeatother \section{\@startsection {section}{1}{\z@}% {-\bigskipamount}% {\medskipamount}% {\normalsize\bfseries\mathversion{bold}\raggedright\pretolerance=\@M \tolerance=\@M \hyphenpenalty=\@M \exhyphenpenalty=\@M}} \renewcommand\subsection{\@startsection {subsection}{2}{\z@}% {-\medskipamount}% {\medskipamount}% {\normalsize\pretolerance=\@M \tolerance=\@M \hyphenpenalty=\@M \exhyphenpenalty=\@M\raggedright\pretolerance=\@M \tolerance=\@M \hyphenpenalty=\@M \exhyphenpenalty=\@M}} \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% {-\medskipamount}% {\medskipamount}% {\itshape\raggedright}} \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% {\medskipamount}% {-10pt}% {\itshape}} \renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}% {0.1pt}% {-1em}% {\itshape}} \def\section@numbersep{} \def\subsection@numbersep{} \def\subsubsection@numbersep{} \def\paragraph@numbersep{.} \def\subparagraph@numbersep{.} \def\@seccntformat#1{{\csname #1@prefix\endcsname\csname the#1\endcsname\csname#1@numbersep\endcsname\enspace}} \overfullrule=5pt \long\def\slugcomment#1{\begin{flushleft}#1\par\end{flushleft}\smallskip} \def\raggedrightmargin#1{% \let\\\@centercr\@rightskip #1 plus 1fil \rightskip\@rightskip \leftskip\z@skip \parindent\z@\pretolerance=\@M \tolerance=\@M \hyphenpenalty=\@M \exhyphenpenalty=\@M} \let\@@@title\relax \def\@@@title@fmt#1{\raggedrightmargin{15mm}\vskip21\p@\bgroup\fontsize{18}{18}\bfseries\raggedright#1\par\egroup} \def\title#1{\markright{#1}\gdef\@@@title{\@@@title@fmt{#1}}} \def\runningtitle#1{\markright{#1}}% \let\shorttitle\runningtitle \let\@@@author\relax \def\@@@author@fmt#1{\raggedrightmargin{84mm}\vskip17\p@\bgroup\normalsize\bfseries#1 \egroup% } \let\@@@author\relax \def\author#1{% \freefootnotetext[]{#1}% \advance\n@author by\@ne \ifnum\n@author=1 \add@xtok@rh{#1}\else% \add@xtok@rh{\space\raise1.5pt\hbox{\tiny\textbullet}\space\allowbreak\hbox{#1}}% \fi% } \def\@@@author{\the\rh@authors@list} \newtoks\rh@authors@list \newcount\n@author\n@author=0 \def\n@author@{0} \def\no@harm{\let\thanks=\@gobble\let\thanksref=\@gobble\let~\space \let\\=\space \def\noexpand\protect\noexpand}{\noexpand\noexpand\protect\noexpand}\noexpand}} \def\add@xtok@rh#1{\begingroup \no@harm \def\altaffilmark##1{\textsuperscript{##1}}% \xdef\@act{\global\noexpand\rh@authors@list{\the\rh@authors@list#1}}\@act \endgroup} \def\shortauthor#1{\markboth{#1}{#1}} \newdimen\@@@firstpageskip \newdimen\@@@topboxheight \@@@topboxheight=68mm \@@@firstpageskip=\@@@topboxheight\relax\advance\@@@firstpageskip by-.5\baselineskip \AtBeginDocument{\enlargethispage{-\@@@firstpageskip}} \def\@texttop{{\thispagestyle{copyright}\twocolumn[\vtop to\@@@topboxheight{\@@@title\par\@@@author@fmt{\expandafter\@@@author}\par\@@@copyright}]}\relax\global\let\@texttop\relax} \def\vskip0pt{\vskip0pt} \def\make@author#1 {\topsep\z@\normalsize#1 \def\freefootnotetext[#1]{% \begingroup\unrestored@protected@xdef\@thefnmark{#1}\endgroup\@footnotetext} \def\freefootnotetext[]{\freefootnotetext[]} \def\normalfont\normalsize{\normalfont\normalsize} \def\abstract@style{\normalfont\normalsize} \def\abstract@size{\normalsize} \def\abstract@skip{\z@} \defAbstract@size{\bfseries} \defAbstract{Abstract} \def\abstract{% \leavevmode \setbox\z@=\lastbox \abstract@style% \abstract@size% \noindent{Abstract@sizeAbstract}\enskip\ignorespaces} \def\par{\par} \def\keyword@skip{\medskipamount} \def\keyword@style{\normalfont\normalsize\raggedright} \def\keyword@size{\normalsize\raggedright} \def\keyword@postfix{\unskip.} \def\keywordname@size{\bfseries} \def\keyword@name{Keywords} \def\keywords#1{% \bgroup \vskip\keyword@skip \keyword@style% \keyword@size% \noindent{\keywordname@size\keyword@name}\enspace#1\egroup\par} \def\footnoterule@width{\columnwidth} \def\footnoterule{\kern-3\p@ \hrule \@width \footnoterule@width \kern 2.6\p@} \let\maketitle@runin\relax \let\maketitle\relax \def\altaffiltext#1#2{\freefootnotetext[#1]{#2}} \def\fnum@figure{{\bfseries Fig.~\thefigure\enskip}} \def\figure@size{\small} \let\caption@size\figure@size \long\def\@makecaption#1#2{\bgroup\csname caption@size\endcsname\vskip 2ex\noindent#1\ #2\par\egroup\expandafter\csname \@captype captionskip\endcsname}% \long\def\@maketablecaption#1#2{\bgroup\csname caption@size\endcsname\vskip 2ex\noindent#1\ #2\par\egroup \expandafter\csname \caption@type captionskip\endcsname}% \def\vskip4pt{\vskip4pt} \def\vskip0pt{\vskip0pt} \def\fnum@table{{\bfseries Table \thetable}\enskip} \def\fnum@ptable@aj{{\bfseries Table \thetable}\enskip}% \def\fnum@ptable{{\bfseries Table \thetable}\enskip}% \def\fnum@ptablecont{{\bfseries Table \thetable}---{\rmfamily Continued}}% \long\def\@make@caption@text#1#2{% \center\rmfamily#1\enskip#2\endcenter }% \def\@tablenotetext#1#2{% \vspace{.5ex}% {\noindent{$^{#1}$}#2\par}% }% \def\@tablenotes#1{% \par \vspace{4.5ex}\@gobble{\footnoterule\vspace{.5ex}}% {\footnotesize#1}% }% \def\@tablenotes@pptt#1{% \par \vspace{3.2ex}\@gobble{\footnoterule\vspace{.4ex}}% {\footnotesize#1}% }% \renewcommand\tablecomments[1]{\ifdim\@abovenoteskip=0pt\global\@abovenoteskip=10pt\fi \appgdef\tblnote@list{\hsize\pt@width\leftskip\z@\rightskip\z@% \@tablecom{\parfillskip\z@ plus1fil#1\endgraf}}}% \def\@tablecom#1{% \par \vspace*{3ex}% {\hskip0em\rmfamily\textit{Note}:\enskip\enskip #1}\par}% }% \def\@tableref@pptt#1{% \par \vspace*{3ex}% {\hskip0em{\textit{References}:\enskip\enskip #1}\par}% }% \def\@tablecom@pptt#1{% \vspace*{3ex}{% {\hskip1em{\textit{Note}:\enskip\enskip #1\par}% }% }} } \IfFileExists{amsmath.sty}{\RequirePackage[fleqn]{amsmath}% \setlength\mathindent\z@}% \setlength\mathindent\z@ \def\mathtrivlist{\parsep\parskip\topsep\abovedisplayskip \ifnum\@listdepth>0 \advance\mathindent by-\leftmargin\fi% \@trivlist \labelwidth\z@ \leftmargin\z@ \itemindent\z@ \def\makelabel##1{##1}} \def\endtrivlist{\endtrivlist} \renewcommand\[{\relax \ifmmode\@badmath \else \begin{mathtrivlist}% \@beginparpenalty\predisplaypenalty \@endparpenalty\postdisplaypenalty \item[]\leavevmode \hb@xt@\linewidth\bgroup $\m@th\displaystyle \hskip\mathindent\bgroup \fi} \renewcommand\]{\relax \ifmmode \egroup $\hfi \egroup \end{mathtrivlist}% \else \@badmath \fi} \renewenvironment{eqnarray}{% \stepcounter{equation}% \def\@currentlabel{\p@equation\theequation}% \global\@eqnswtrue\m@th \global\@eqcnt\z@ \tabskip\mathindent \let\\=\@eqncr \setlength\belowdisplayshortskip{\abovedisplayskip}% \setlength\abovedisplayshortskip{\abovedisplayskip}% $$\everycr{}\halign to\linewidt \bgroup \hskip\@centering $\displaystyle\tabskip\z@skip{##}$\@eqnsel&% \global\@eqcnt\@ne \hskip \tw@\arraycolsep \hfil${##}$\hfil&% \global\@eqcnt\tw@ \hskip \tw@\arraycolsep $\displaystyle{##}$\hfil \tabskip\@centering&% \global\@eqcnt\thr@@ \hb@xt@\z@\bgroup\hss##\egroup\tabskip\z@skip\cr}% {\@@eqncr \egroup \global\advance\c@equation\m@ne$ \@ignoretrue } \def\list@parindent{1pc} \def\@ifnextchar[{\@enumerate}{\@enumerate[]}@indent{\z@} \def\@ifnextchar[{\@enumerate}{\@enumerate[]}@parindent{\list@parindent} \def\@ifnextchar[{\@enumerate}{\@enumerate[]}@labelsep{.5em} \def\@ifnextchar[{\@enumerate}{\@enumerate[]}@firsttopsep{\smallskipamount} \def\@ifnextchar[{\@enumerate}{\@enumerate[]}@topsep{\z@} \def\@ifnextchar[{\@enumerate}{\@enumerate[]}@rightskip{\z@ \let\@ifnextchar[{\@enumerate}{\@enumerate[]}@hook\relax \def\description@indent{\list@parindent} \let\description@topsep\smallskipamount \let\description@hook\relax \let\quotation@size\footnotesize \def\quotation@itemindent{\list@parindent} \def\quotation@parindent{\list@parindent} \def\quotation@leftmargin{\list@parindent} \def\quotation@rightmargin{\z@} \let\quotation@topsep\smallskipamount \let\quote@size\footnotesize \def\quote@indent{\z@} \def\quote@leftmargin{0pc} \def\quote@rightmargin{0pc} \let\quote@topsep\smallskipamount \@lowpenalty 51 \@medpenalty 151 \@highpenalty 301 \@beginparpenalty -\@lowpenalty \@endparpenalty -\@lowpenalty \@itempenalty -\@lowpenalty \parsep\z@ \topsep\z@ \partopsep\z@ \itemsep\z@ \labelsep.5em \def\@listi {\leftmargin\leftmargini} \def\@listii {\leftmargin\leftmarginii% \labelwidth\leftmarginii% \advance\labelwidth-\labelsep}% \def\@listiii{\leftmargin\leftmarginiii \labelwidth\leftmarginiii \advance\labelwidth-\labelsep} \def\@listiv {\leftmargin\leftmarginiv \labelwidth\leftmarginiv \advance\labelwidth-\labelsep} \def\@listvi {\leftmargin\leftmarginvi \labelwidth\leftmarginvi \advance\labelwidth-\labelsep} \setlength\leftmargini {2em} \setlength\leftmarginii {2.2em} \setlength\leftmarginiii {1.87em} \setlength\leftmarginiv {1.7em} \setlength\leftmarginv {1em} \setlength\leftmarginvi {1em} \@listi \def\@ifnextchar[{\@enumerate}{\@enumerate[]}{\@ifnextchar[{\@enumerate}{\@enumerate[]}} \def\@enumerate[#1]{% \ifnum \@enumdepth >\thr@@ \@toodeep\else \advance\@enumdepth \@ne \edef\@enumctr{enum\romannumeral\the\@enumdepth}% \list {\csname label\@enumctr\endcsname}% {\usecounter{\@enumctr} \def\makelabel##1{{\hfill\normalfont ##1}} \ifx.#1.% \setcounter{\@enumctr}{3 \expandafter\settowidth\expandafter\labelwidth\expandafter{\csname label\@enumctr\endcsname}% \setcounter{\@enumctr}{0}% \else% \settowidth{\labelwidth}{#1} \fi% \labelsep=\@ifnextchar[{\@enumerate}{\@enumerate[]}@labelsep% \itemindent=\labelwidth \advance\itemindent\labelsep% \ifnum \@enumdepth=1\advance\itemindent by\@ifnextchar[{\@enumerate}{\@enumerate[]}@indent\fi% \leftmargin=\the\itemindent% \itemindent\z@% \partopsep\z@ \parsep\z@ \itemsep\z@ \rightmargin\z@ \ifnum \@enumdepth=1 \topsep\@ifnextchar[{\@enumerate}{\@enumerate[]}@firsttopsep \else \topsep\@ifnextchar[{\@enumerate}{\@enumerate[]}@topsep\fi% \listparindent\@ifnextchar[{\@enumerate}{\@enumerate[]}@parinden \@rightskip\@ifnextchar[{\@enumerate}{\@enumerate[]}@rightskip% \@ifnextchar[{\@enumerate}{\@enumerate[]}@hoo }\fi} \let\endenumerate =\endlist \def\@ifnextchar[{\@itemize}{\@itemize[]}@indent{\z@} \def\@ifnextchar[{\@itemize}{\@itemize[]}@parindent{\list@parindent} \def\@ifnextchar[{\@itemize}{\@itemize[]}@labelsep{.5em} \def\@ifnextchar[{\@itemize}{\@itemize[]}@firsttopsep{\smallskipamount} \def\@ifnextchar[{\@itemize}{\@itemize[]}@topsep{\z@} \def\@ifnextchar[{\@itemize}{\@itemize[]}@rightskip{\z@ \let\@ifnextchar[{\@itemize}{\@itemize[]}@hook\relax \def\textbullet {\textbullet} \def\textendash {\textendash} \def\labelitemiii{\textasteriskcentered} \def{\footnotesize +} {{\footnotesize +}} \def\@ifnextchar[{\@itemize}{\@itemize[]}{\@ifnextchar[{\@itemize}{\@itemize[]}} \def\@itemize[#1]{% \ifnum \@itemdepth >\thr@@ \@toodeep\else \advance\@itemdepth \@ne \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}% \list {\csname\@itemitem\endcsname}% {\def\makelabel##1{{\hfill\normalfont ##1}} \ifx.#1.% \settowidth\labelwidth{\csname\@itemitem\endcsname}% \else% \settowidth{\labelwidth}{#1} \fi% \labelsep=\@ifnextchar[{\@itemize}{\@itemize[]}@labelsep% \itemindent=\labelwidth \advance\itemindent\labelsep% \ifnum \@itemdepth=1\advance\itemindent by\@ifnextchar[{\@itemize}{\@itemize[]}@indent\fi% \leftmargin=\the\itemindent% \itemindent\z@% \partopsep\z@ \parsep\z@ \itemsep\z@ \rightmargin\z@ \ifnum \@itemdepth=1 \topsep\@ifnextchar[{\@itemize}{\@itemize[]}@firsttopsep \else \topsep\@ifnextchar[{\@itemize}{\@itemize[]}@topsep\fi% \listparindent\@ifnextchar[{\@itemize}{\@itemize[]}@parinden \@rightskip\@ifnextchar[{\@itemize}{\@itemize[]}@rightskip% \@ifnextchar[{\@itemize}{\@itemize[]}@hoo }\fi} \let\enditemize =\endlist \def\description{% \list{}{\labelwidth\z@ \labelsep\z@ \rightmargin\z@ \leftmargin\z@ \advance\leftmargin by\description@indent \itemindent-\description@indent \partopsep\z@ \topsep\description@topsep \parsep\z@ \itemsep\z@ \listparindent\z@ \description@hook% \let\makelabel\descriptionlabel}} \def\endlist{\endlist} \def\descriptionlabel#1{\if.#1.\else\bfseries #1\hskip.5em\fi} \def\quotation{% \list{}{\quotation@size% \listparindent\quotation@parindent% \itemindent \quotation@itemindent% \rightmargin\quotation@rightmargin \leftmargin\quotation@leftmargin% \setlength\rightmargin{0pt} \partopsep\z@ \topsep\quotation@topsep \parsep\z@% \itemsep\z@ }% \item[\Q@strut]\relax} \def\endlist{\endlist} \def\Q@strut{\leavevmode\hbox{\vrule height9pt depth1pt width0pt}} \def\quote{% \list{}{\quote@size% \listparindent\quote@indent% \itemindent \listparindent% \rightmargin\quote@rightmargin \leftmargin\quote@leftmargin% \partopsep\z@ \topsep\quote@topsep \parsep\z@% }% \item\relax} \def\endlist{\endlist} \def\medskip\noindent\bgroup\bfseries Acknowledgements\egroup\quad\ignorespaces{\medskip\noindent\bgroup\bfseries Acknowledgements\egroup\quad\ignorespaces} \def\medskip\noindent\bgroup\bfseries Acknowledgement\egroup\quad\ignorespaces{\medskip\noindent\bgroup\bfseries Acknowledgement\egroup\quad\ignorespaces} \let\headline@hook\relax \def\rh@rule{\leavevmode\lower6pt\hbox to0pt{\vrule height1pt width\textwidth\hss}} \def\rh@rule@{\leavevmode\lower18pt\hbox to0pt{\vrule height1pt width\textwidth\hss}} \def\thepage@fmt#1{#1} \def\runninghead@size {\footnotesize} \def\pagenumber@size {\footnotesize} \def\ps@headings{% \def\@evenfoot{\@empty}% \def\@oddfoot{\@empty}% \def\@evenhead{\headline@hook\rh@rule\runninghead@size\rlap{\pagenumber@size\thepage@fmt{\thepage}}\hfill\leftmark}% \def\@oddhead{\headline@hook\rh@rule\runninghead@size\rightmark\hfill\llap{\pagenumber@size\thepage@fmt{\thepage}}}% } \def\cp@text{\parbox[t]{\textwidth}} \def\ps@copyright{% \def\@evenfoot{\@empty}% \def\@oddfoot{\@empty}% \def\@evenhead{\headline@hook\rh@rule@\runninghead@size\rlap{\pagenumber@size\thepage@fmt{\@gobble\thepage}}\hfill\leftmark}% \def\@oddhead{\headline@hook\rh@rule@\runninghead@size\hfill\cp@text\llap{\pagenumber@size\thepage@fmt{\@gobble\thepage}}}% } \pagestyle{headings} \def\@jname{} \def\@doi{\@doihead \@thedoi} \def\@doihead{DOI:\space} \def\@thedoi{10.1007/\textbullet\textbullet\textbullet\textbullet\textbullet-\textbullet\textbullet\textbullet-\textbullet\textbullet\textbullet-\textbullet\textbullet\textbullet\textbullet-\textbullet} \defReferences{References} \renewenvironment{thebibliography}[1] \clear@thebibliography@page \section*{References \thebib@list \def\refpar{\relax \def\newblock{\hskip .11em\@plus.33em\@minus.07em \clubpenalty4000 \widowpenalty4000 \sfcode`\.=1000\relax } \endlist \revtex@pageid \def\thebib@list \list{\null} \small \leftmargin 1em\labelwidth\z@\labelsep\z@\itemindent-\leftmargin \global\setlength\bibsep\z@ \global\itemsep=\z@ \@plus1\p@ \@minus1\p@ \global\parsep=\z@ \@plus1\p@ \@minus1\p@ \usecounter{enumi \def\@coprtyear{\textbullet\textbullet\textbullet\textbullet} \def\@volume{0} \def\@@firstpage{\textbullet} \def\@@lastpage{\textbullet} \def\@jname\@gobble{\ (\@coprtyear) \@volume:\@firstpage--\@lastpage}{\@jname\@gobble{\ (\@coprtyear) \@volume:\@firstpage--\@lastpage}} \@twosidetrue\@mparswitchtrue \twocolumn \renewcommand\aj{\ref@jnl{Astron.~J.}}% \renewcommand\actaa{\ref@jnl{Acta Astron.}}% \renewcommand\araa{\ref@jnl{Annu. Rev. Astron. Astrophys.}}% \renewcommand\apj{\ref@jnl{Astrophys.~J.}}% \renewcommand\apjl{\ref@jnl{Astrophys. J. Lett.}}% \renewcommand\apjs{\ref@jnl{Astrophys. J. Suppl. Ser.}}% \renewcommand\ao{\ref@jnl{Appl. Opt.}}% \renewcommand\apss{\ref@jnl{Astrophys. Space Sci.}}% \renewcommand\aap{\ref@jnl{Astron. Astrophys.}}% \renewcommand\aapr{\ref@jnl{Astron. Astrophys. Rev.}}% \renewcommand\aaps{\ref@jnl{Astron. Astrophys. Suppl. Ser.}}% \renewcommand\azh{\ref@jnl{Astron. Zh.}}% \renewcommand\baas{\ref@jnl{Bull. Am. Astron. Soc.}}% \renewcommand\caa{\ref@jnl{Chin. Astron. Astrophys.}}% \renewcommand\cjaa{\ref@jnl{Chin. J. Astron. Astrophys.}}% \renewcommand\icarus{\ref@jnl{Icarus}}% \renewcommand\jcap{\ref@jnl{J. Cosmol. Astropart. Phys.}}% \renewcommand\jrasc{\ref@jnl{J.~R. Astron. Soc. Can.}}% \renewcommand\memras{\ref@jnl{Mem. R. Astron. Soc.}}% \renewcommand\mnras{\ref@jnl{Mon. Not. R. Astron. Soc.}}% \renewcommand\na{\ref@jnl{New Astron.}}% \renewcommand\nar{\ref@jnl{New Astron. Rev.}}% \renewcommand\pra{\ref@jnl{Phys. Rev.~A}}% \renewcommand\prb{\ref@jnl{Phys. Rev.~B}}% \renewcommand\prc{\ref@jnl{Phys. Rev.~C}}% \renewcommand\prd{\ref@jnl{Phys. Rev.~D}}% \renewcommand\pre{\ref@jnl{Phys. Rev.~E}}% \renewcommand\prl{\ref@jnl{Phys. Rev. Lett.}}% \renewcommand\pasa{\ref@jnl{Proc. Astron. Soc. Aust.}}% \renewcommand\pasp{\ref@jnl{Publ. Astron. Soc. Pac.}}% \renewcommand\pasj{\ref@jnl{Publ. Astron. Soc. Jpn.}}% \renewcommand\qjras{\ref@jnl{Q. J. R. Astron. Soc.}}% \renewcommand\rmxaa{\ref@jnl{Rev. Mexicana Astron. Astrofis.}}% \renewcommand\skytel{\ref@jnl{Sky Telesc.}}% \renewcommand\solphys{\ref@jnl{Sol. Phys.}}% \renewcommand\sovast{\ref@jnl{Soviet Astron.}}% \renewcommand\ssr{\ref@jnl{Space Sci. Rev.}}% \renewcommand\zap{\ref@jnl{Z. Astrophys.}}% \renewcommand\nat{\ref@jnl{Nature}}% \renewcommand\iaucirc{\ref@jnl{IAU Circ.}}% \renewcommand\aplett{\ref@jnl{Astrophys. Lett.}}% \renewcommand\apspr{\ref@jnl{Astrophys. Space Phys. Res.}}% \renewcommand\bain{\ref@jnl{Bull. Astron. Inst. Neth.}}% \renewcommand\fcp{\ref@jnl{Fundam. Cosmic Phys.}}% \renewcommand\gca{\ref@jnl{Geochim. Cosmochim. Acta}}% \renewcommand\grl{\ref@jnl{Geophys. Res. Lett.}}% \renewcommand\jcp{\ref@jnl{J. Chem. Phys.}}% \renewcommand\jgr{\ref@jnl{J. Geophys. Res.}}% \renewcommand\jqsrt{\ref@jnl{J. Quant. Spec. Radiat. Transf.}}% \renewcommand\memsai{\ref@jnl{Mem. Soc. Astron. Italiana}}% \renewcommand\nphysa{\ref@jnl{Nucl. Phys.~A}}% \renewcommand\physrep{\ref@jnl{Phys. Rep.}}% \renewcommand\physscr{\ref@jnl{Phys. Scr.}}% \renewcommand\planss{\ref@jnl{Planet. Space Sci.}}% \renewcommand\procspie{\ref@jnl{Proc. SPIE}}% \let\astap=\aap \let\apjlett=\apjl \let\apjsupp=\apjs \let\applopt=\ao \DeclareFontShape{OMS}{cmsy}{b}{n}{% <-6> cmbsy5 <6-8> cmbsy7 <8-> cmbsy10% }{} \endinput
\section{Introduction} The largest financial crisis since the great depression started in 2007 with an initially well-defined epicenter focused on mortgage backed securities (MBS). It has since been cascading into a global economic recession, whose increasing severity and uncertain duration has led and is continuing to lead to massive losses and damage for billions of people. This crisis has brought to the attention of everyone the concept that risk can be endogenous and can cascade as a growing avalanche through the financial and economic system. This is the opposite of the assumption held previously by many regulators, credit agencies and bankers that risks can be managed by using models essentially focusing on the risk of each single institution, and by combining them using assumptions of inter-dependencies calibrated in good times. The unveiled systemic nature of financial risks makes now clear the need for global approaches including economic and financial networks and modeling the collective behaviors that results from the coupling between institutions, firms, financial products and so on. During the development of the crisis in 2008, a succession of problems unfolded, the most prominent ones being associated with names such as Bear Stearns, Fannie, Freddie, AIG, Washington Mutual, and Wachovia. Except for the famous bankruptcy of Lehman Brothers Holding Inc., all the other ``too-big-to-fail'' financial institutions and insurance companies were bailed out, while thousands of smaller banks have been left alone to undergo bankruptcy. We propose here a minimalist framework to account for the observed cascade of defaults, which incorporates the impact of changes of beliefs in credit worthiness of a given firm, resulting from the change of credit worthiness of other institutions in the same economic network. In this way, we are able to account for the cascade phenomenon, and explain how small changes can lead to dramatic consequences, all the more so, the more coupled is the economic network and the larger is the number of firms. Our framework allows us to also analyze the so-called ``Lehman Brothers'' effect, i.e., the crash on the stock market and the subsequent panic among financial institutions, following its filling for bankruptcy on 15 September 2008. We account for this aftermath by introducing a global field influencing every firm by enlarging the probability of rating downgrade, which embodies the psychological impact of the destruction of trust among institutions, which suddenly realized that, after all, the US Treasury and the Federal Reserve might not bail them out. The abrupt drop in confidence led to a drop in credit supply and to the major recession. Finally, we investigate, within our set-up, the effect of a simple bail-out policy consisting of accepting to rescue a certain number of defaulting firms. We find that this rescue policy is the most efficient when the economy is functioning at its most vulnerable state of critical coupling between its constituting firms. Many models have been proposed to investigate the effects of credit contagion on the default probability of individual firms. Motivated by the accounting scandals at Enron, Worldcom and Tyco, Giesecke \cite{Giesecke04} developed a structural model of correlated multi-firm default, in which investors update their belief on the liabilities of remaining firms after each firm default, which leads to contagious jumps in credit spreads of business partners. Eisenberg and Noe created a model of contagion in a network of liabilities \cite{EisenbergNoe}. When an agent cannot fulfill its obligation, it defaults and the loss propagates along the network. Propagation of this distress can trigger off another defaults by contagion. Battiston et al. \cite{Battistonetal07} studied a simple model of a production network in which firms are linked by supply-customer relationships involving extension of trade-credit. They recover some stylized facts of industrial demography and the correlation, over time and across firms, of output, growth and bankruptcies. Delli Gatti et al. \cite{Delligattietal} studied the properties of a credit-network economy characterized by credit relationship connecting downstream and upstream firm through trade credit and firms and banks through bank credit. They included a change in the network topology over time due to an endogenous process of partner selection in an imperfect information decisional context, which leads to an interplay between network evolution and business fluctuations and bankruptcy propagation. The bankruptcy of one entity can bring about the bankruptcy of one or more other agents possibly leading to avalanches of bankruptcies. Azizpour et al. \cite{Azizpour} developed a self-excited model of correlated event timing to estimate the price of correlated corporate default risk. Sakata et al. \cite{Sakata06} introduced an infectious default and recovery model of a large set of firms coupled through credit-debit contracts and determined the default probability of $k$ defaults. Ikeda et al. \cite{Ikeda07} have developed an agent-based simulation of chain bankruptcy, in which a decrease of revenue by the loss of accounts payable is modeled by an interaction term, and bankruptcy is defined as a capital deficit. Lorentz et al. \cite{Lorenzetal09} have introduced a general framework for models of cascade and contagion processes on networks using the concept of the fragility of a firm, including the bundle model, the voter model, and models of epidemic spreading as special cases. Ormerod and Colbaugh \cite{Ormerod-Colbaugh} developed a model of heterogeneous agents interacting in an network evolving according to the formation of alliances based on the decisions of self-interested fitness optimizers. In the presence of external negative shocks, they find that increasing the number of connections causes an increase in the average fitness of agents, and at the same time makes the system as whole more vulnerable to catastrophic failure/extinction events on an near-global scale. Schafer et al. \cite{Schaferretal07} set up a structural model of credit risk for correlated portfolios containing many credit contracts exposed to risk factors which undergo jump-diffusion processes and derive the full loss distribution of the credit portfolios. Neu and K\"{u}hn \cite{Neu-Kuhn2004} generalized existing structural models for credit risk in terms of credit contagion with feedbacks, using the analogy to a lattice gas model from physics. Already for moderate micro-economic dependencies, they find that, for stronger mutually supportive relationship between the firms, collective phenomena such as bursts and avalanches of defaults can be observed in their model. Hatchett and K\"{u}hn \cite{Hatchett-Kuehn} studied the model of \cite{Neu-Kuhn2004} and found it to be solvable for the loss distributions of large loan portfolios with fat tails. Anand and K\"{u}hn \cite{AnandKuhn07} extend these analyzes by studying the functional correlation approach to operational risk and discover the coexistence of operational and nonoperational phases, such that their credit risk systems are susceptible to discontinuous phase transitions from the operational to nonoperational phase via catastrophic breakdown. Their model is also relevant to understand the cascades of unprecedented losses suffered in August 6, 2007, by a number of high-profile and highly successful quantitative long/short equity hedge funds \cite{Khandani-Lo}. The organization of the paper is as follows. Section 2 describes the model, with the definition of the key variable, the ``effective credit rating grade'' (ECRG), its dynamics, and how we take into account the interdependencies between firms through the changes of their ECRGs. Section 3 presents the main results of how a global crisis occurs in our model, and the relevance of a phase transition in the presence of the ``panic'' effect. Section 4 examines the sensitivity of the paths of defaulting economies as a function of the average coupling strength between firms, the panic field and the initial probabilities of ECRG changes. Section 5 presents some results on the impact of a simple rescue policy consisting in preventing the first few defaults to occur. Section 6 concludes. \section{Description of the model} Our model is adapted from Sieczka and Hołyst \cite{Sieczka}, who introduced a stylized model of financial contagion among interacting companies. \subsection{Definition of the key variable: ``effective credit rating grade'' (ECRG) $R$} Since we wish to focus on the possible contagion and cascade of defaults among the firms in a network, we abstract from the multidimensional complexity of all the variables impacting a firm's financial health. We propose to capture the solvability of a given firm $i$ by a single variable $R_i$ that we refer to as the ``effective credit rating grade'' (ECRG). In our simulations, we will consider a rather small number of effective credit rating grades, that is, we assume that the $R_i$'s take discrete values: $0, 1, ..., R_{\rm max}$, with $R_{\rm max}=7$. When $R_i(t) = 7$, investors (who are international to the networked economy) consider agent $i$ to be a safe investment. As the grade decreases, the risk perception of the investors on agent $i$'s future profitability (and viability) increases. In other words, investors are more skeptical of agent $i$ and hence less likely to lend to agent $i$ in the future. For $R_i(t) = 0$, agent $i$ has defaulted on at least one of its obligations to the lenders. This defaulted state is assumed to be an absorbing state in that, once an agent has defaulted in the economy, it remains so for the remainder of time. The effective credit rating grade $R_i$ associated with each firm provide an integrated, low dimensional and effective indicator of the investors' subjective perception of the creditworthiness of firm $i$. We conjecture that the effective credit rating grade $R_i$ can be obtained as the end result of a Mori-Zwanzig projection technique applied to a full behavioral model, after integrating over all degrees of freedom except these effective ratings degrees of freedom, similarly to the approach of Neu and Kuhn on market risks \cite{KuhnNeu08}. The term ``effective credit rating grade'' derives obviously from the standard credit rating which is provided by credit rating agencies such as Fitch Ratings, Moody's Investors Service or Standard \& Poor's in the U.S. Indeed, it is well-known that there is a strong correlation between credit quality and default remoteness: the higher the rating, the lower the probability of default, and the lower ratings always correspond to higher default ratios \cite{BrandBahar2001}. With default as our target, our model can also be thought of as a description of the world of financial instruments and their interactions. Thus, our model can also be taken as a description of a network of various financial instruments, including collateral debt obligations and structured asset-backed security, which formed the substrate on which the 2007 crisis developed. Note that the choice of the discrete values, $0, 1, ..., R_{\rm max}$, with $R_{\rm max}=7$, for $R_i$ is motivated by the principal grades (AAA, AA, A, BBB, BB, B, CCC) used by rating agencies. We associate deterministically the eighth lowest level $R=0$ to the state of default. This corresponds to a stylized representation of the well-known abrupt increase of default rates as credit rating deteriorates. For instance, for the period from 1981 to 1999, Standard \& Poor's reported a $0.00\%$ probability of default per year for AAA-rated firms, compared with a value of $5.3\%$ per year for B-rated firms and a value of $22\%$ for CCC-rated firms \cite{BrandBahar2001}. In the same vein, the probability of a default over a 15 year period is $0.5\%$ for AAA-rated firms, compared with $30\%$ for B-rated firms and of $48.3\%$ for CCC-rated firms. Our aim is to account for the many complexities associated with the default hazard of each firm by focusing on the dynamics of a single variable for each firm. Then, the question arises as whether the dynamics of the standard credit ratings are faithful indicators of the evolution of firm default hazards. The answer is probably negative, in view of the wave of defaults that started in 2007 and accelerated in 2008, in which many financial instruments, special vehicles as well as major insurance companies and investment banks that were rated AAA turned out to default. This is the principal reason for our proposal to think of each $R_i$, as not being the official published credit rating grade but, as an ``effective credit rating grade'', which can be interpreted in several ways. It could be the real internal credit worthiness, that credit agencies should strive to uncover. Another way to think about the effective credit rating grade is that it is the rating that the rating agency has produced internally but not yet published due to their well documented conflict of interest leading to patently misleading published ratings. Indeed, it is now well-recognized that the rating grade provided by rating agencies are imperfect, as shown by the development of the financial crisis since 2007: (i) credit rating agencies do not downgrade companies promptly enough; (ii) credit rating agencies have made significant errors of judgment in rating structured products, particularly in assigning AAA ratings to structured debt, which in a large number of cases has subsequently been downgraded or defaulted. The ``effective credit rating grade'' of a given firm can be also interpreted as quantifying the risk perception of the market concerning that firm. \subsection{Dynamical evolution of the $R_i$'s, for $i=1,...,N$ in a network of $N$ firms} We consider a network of $N$ firms operating in a common economic environment. We assume that the dynamics of the financial health of firms can be captured by that of their effective credit rating grades (ECRG) $R_i(t)$'s. We assume the simple discrete correlated random walk with constraints, \begin{equation} R_i(t)=R_i(t-1)+s_i(t), \label{eq:R} \end{equation} where $s_i(t)$ is a stochastic variable taking only three possible values $s_i(t)=-1, 0, 1$. This means that the ECRG of a given firm can change by no more than one level over one time step, i.e., $|R_i(t)-R_i(t-1)|\leq 1$. Since a value of the ECRG of a firm equal to $7$ corresponds to the maximum possible level, if $R_i(t-1)=7$, then $R_i(t)$ can only either remain at the same level or decrease by $1$. This means that the one--time-step ECRG change $s_i(t)$ of a firm can only take values $0$ or $-1$ if $R_i(t-1)=7$. This corresponds to a ``reflecting'' condition of the discrete correlated random walk (\ref{eq:R}). We assume that, when a firm or a financial product defaults, it does not recover and remains at the default state $R_i=0$. This corresponds to $s_i$ remaining equal to $0$ for all subsequent time steps and this is an ``absorbing'' condition for the discrete correlated random walk (\ref{eq:R}). Because we are describing a short time span of just a few years in our simulations, we do not include a firm entry process. Neglecting the creation of new banks seems to be a reasonable assumption when thinking of the economy of banks during the financial crisis. \subsection{Interdependencies between firms in the changes of their effective credit rating grades} There is rich literature on networks of firms, including credit and corporate ownership networks, as well as production, trade, supply chain and innovation networks (see e.g. \cite{SchweitzerScience09,SchweitzerACS09} and references therein). These links between firms are concrete and quantifiable through cash flows or control structures (such as voting rights). But, many of these links, forming complex networks of creditor/obligor relationships, revolving credit agreements and so on, are largely unmapped \cite{Lo08}. This supports considering another type of networks, a network of more intangible but nonetheless essential relationships of how the credit rating grades of different firms interact. This idea is also suggested by the cases of the Asian crises of 1997 and the more recent subprime crisis of 2007-2008. Consider first the case of the Asian crises in 1997 and the remarkable fact emphasized by Krugman \cite{Krugman_depressioneconomics08} that the traditional measures of vulnerability did not forecast the crisis. One possible explanation is that the problem was off the government's balance sheet, and not part of the governments' visible liabilities until after the fact. The crisis developed as a self-fulfilling generated downward spiral of asset deflation and disintermediation. Post-mortem analyses have generally concluded that the key ingredient was that many of the Asian countries at that time had either pegged their currency to the dollar or operated in a narrow exchange rate band. In addition, asset price bubbles were growing in these countries, catalyzed by an influx of foreign funds. With deteriorating economic conditions, these economies became ripe for speculative attacks and bank runs. The sequence of events was one of speculative attacks on the currency pegs in Thailand and Malaysia followed by flight of capital away from these and surrounding economies, a process sometimes referred to as twin-crisis \cite{Goldsteintwincrises05}. This all looks clear in hindsight, but the notion of ripeness to speculative attacks and bank runs is a matter of debate. For instance, no bank, however sound its capital and liability structure, can survive a bank run, by construction. Krugman \cite{Krugman_depressioneconomics08} emphasizes another important effect, what we could call a ``virtual'' network effect: while the real economic and financial links between the strongest Asian tigers (South Korea and Hong-Kong) and the others were weak on a relative GDP measure, foreign investors lumped them in their mental framework as part of the same ``Asian'' portfolio. Starting in Malaysia in July 1997, the contagion of the crisis to the other Asian countries was actually strongly amplified by the misperception by foreign investors that these different economies (Thailand, Malaysia, South Korea, Hong Kong...) were strongly linked. According to this mental framing \cite{Ariely09}, the problem of Thailand was not just a one-country happenance due to a localized over-indebtness, but it was thought that this was the problem of the whole economic Asian zone. While the vulnerability of South Korea and Hong Kong has been disputed, the incorrect geographical emphasis made the links become self-created by the western investors and banks pulling out from all these countries simultaneously in a process analogously to a bank run (see the argument developed in some details in \cite{Krugman_depressioneconomics08}). The causes of the financial and economic crisis initiated by the subprime crisis starting in 2007 are multiple and intertwined. The following elements have been documented and argued to be important contributors: (i) Real-estate loans and MBS (morgage backed securities) as fraction of bank assets, leading to feedback loops in leverage and ultimately in fragility; (ii) Managers' greed and poor corporate governance problems; (iii) Deregulation and lack of oversight; (iv) Bad quantitative risk models in banks (Basel II); (v) Lowering of lending standards; (vi) Securitization of finance; (vii) Leverage; (viii) Rating agency failures; (ix) Under-estimating aggregate risks; (x) Growth of over-capacity; (xi) the agenda of several successive US administration to promote accession to house ownership to the middle-class and poor; (xii) Government sponsored entities such as Freddy Mac and Fanny Mae with unfair access to liquidity and mispriced returns due to the implicit Government put option. There is an enormous contemporary literature, which is growing everyday and which analyzes these different factors and suggests new solutions and new designs. However, Sornette and Woodard argued recently \cite{SorWood10} that these elements were part of and contributed to a more global process, dubbed ``the illusion of the perpetual money machine,'' that developed over the last twenty years. During its development, the shadow banking (with a capital value peak of \$2.2 trillions in early 2007) constituted a large network of inter-dependencies between financial instruments and between investment houses including banks, that became apparent only after the crisis started to unfold \cite{Krugman_depressioneconomics08}. This shadow banking system included such financial instruments as the auction rate preferred securities, asset-backed commercial paper, structured investment vehicles, tender option bonds and variable rate demand notes. These different instruments are indeed interacting directly through their overlapping collaterals and underlying assets, and indirectly through their impacts onto investment portfolios, through the joint impact of economic and/or financial shocks and, very importantly through the psychological contagion of investors. These elements motivate us in modeling the direct as well as indirect couplings between firms through the effective credit rating grade changes $s_i$'s. This provides us with a coarse-grained description that has the advantage of lumping together many coupled mechanisms. Following the theory of multinomial choice \cite{McFadden74,McFadden78}, we formulate the conditional probability for the ECRG change $s_i(t)$ of a given firm $i$ under the form \begin{equation} \label{eq:Ps} \begin{split} P&(s_i \vert s_1, ..., s_{i-1}, s_{i+1}, ..., s_N, R_1,..., R_N)\\ &=\frac{1}{Z}\exp\left(\sum_{j\neq i}J_{ij}\delta_{s_i s_j}+ H(R_1,..., R_N)\delta_{s_i -1}\right)~, \end{split} \end{equation} where $\delta_{s_i s_j}$ is the Kronecker delta and $Z$ ensures a proper normalization. Here, the $s_i$ on the left side of $\vert$ is realized at time $t$, while the conditioning variables on the right side of $\vert$ are realized at time $t-1$. Expression (\ref{eq:Ps}) gives the dependence of the probability that the ECRG change $s_i(t)$ of a firm $i$ takes a value $+1$, $0$ or $-1$, given the previous ECRG changes $s_j(t-1), j \neq i$ at $t-1$, and given the ECRG level $R_1(t-1), ..., R_N(t-1)$ at time $t-1$. The probability of a rating change does not depend on a rating history. It is an assumption that agrees with a behavior of the Merton model in which a value of a firm's asset evolves as a geometric Brownian motion and rating classes can be translated into thresholds of the firm's asset value. This Ising-like expression (\ref{eq:Ps}) is also motivated by the demonstration that finite-size long-range Ising model turns out to be an adequate model for the description of homogeneous credit portfolios and the computation of credit risk when default correlations between the borrowers are included \cite{MolinsVives}. This probability (\ref{eq:Ps}) is controlled by two contributions. \begin{enumerate} \item The term $\sum_{j\neq i}J_{ij}\delta_{s_i s_j}$ describes a mimetic or contagion effect, as well as a persistence mechanism: the larger the number of firms which have seen their grading updated upward (respectively unchanged or downward), the more new firms will have their grading updated upward (respectively unchanged or downward) in the next time step. The strength of the influence of firm $i$ on firm $j$ and vice-versa (as we assume for simplicity symmetric couplings) is quantified by the $N \times N$ symmetric interaction matrix $\{J_{ij}\}$. The elements $J_{ij}$ can take zero, negative, or positive values. For $J_{ij}=0$, the two firms do not influence each other through the contagion effect. A positive $J_{ij}$ corresponds to two dependent firms in the same industry branch, such that an improving (respectively worsening) condition in one of them tends to improve (respectively worsen) the situation of the other firm. In contrast, a negative $J_{ij}$ may describe anti-correlations, such that one firm might profit at the expanse of the other one. As there is clear evidence of a strong bias toward positive correlations among firms, we assume that the $J_{ij}$'s are normally distributed with a positive mean $J_0$ and standard deviation $\sigma_J$: \begin{equation} \label{ghy3bg} P(J_{ij})=\frac{1}{\sqrt{2\pi \sigma_J^2}}\exp \left(-\frac{(J_{ij}-J_0)^2}{2\sigma_J^2}\right)~. \end{equation} \item The term $H(R_1,..., R_N)\delta_{s_i,-1}$ embodies the sentiment of panic, which was triggered when Lehman Brothers Holding Inc., a global financial-services firm, declared bankruptcy on 15 September 2008. The field $H(R_1,..., R_N)\delta_{s_i,-1}$ is equal to zero until the first ban\-krupt\-cy occurs in the network of firms, after which it remains fixed to $H\delta_{s_i, -1}$: after the first bankruptcy occurs in our network, all credit rating grades are biased towards deteriorating, where $H$ is the strength of this bias. Formally, \begin{equation} \label{eq:H} H(R_1,..., R_N)=H\cdot (1-\prod_j (1-\delta_{R_j, 0})), \end{equation} which is equal to $H$ when at least one firm defaulted ($R_i=0$), otherwise the field is equal to $0$. The field $H\delta_{s_i, -1}$ models a global shock which appears after the default of a first company. The ``panic'' field $H$ captures the psychological impact of the destruction of trust among institutions. Its structural impact is reasonable in the interpretation of the ``effective credit rating grade'' of a given firm as quantifying the risk perception of the market concerning that firm. The activation of $H$ describes the contagion effect of the increased risk perception. The activation of $H$ can also be justified as describing a genuine loss of real internal credit worthiness following a shock on one of the firms, due to the inter-connected liabilities in the bank balance sheets. Finally, the panic term in equation (\ref{eq:Ps}) is either $H$ (if there is at least one bankrupted firm) or $0$ (if there is none). It could be argued to be more realistic to make the panic term depending on the number of bankrupted firms. Our simplifying framework consists in considering only the systemically important institutions such as Bear Stearns, Fannie, Freddie, AIG, Washington Mutual, Wachovia and so on, which are considered consensually to be ``too-big-to-fail'' financial institutions and insurance companies. Just one of them going to bankruptcy is arguably sufficient to trigger the Lehman Brothers type of panics that we model here. \end{enumerate} Our goal is to study what is the effect on the global firm network of the change in psychological attitude of investors following the first bankruptcy. \section{Global crisis as a phase transition in the presence of the ``panic effect''} \subsection{Description of the numerical simulation procedure \label{th3bw}} We simulated a system of $N=1000$ firms. The standard deviation of the coupling coefficients $J_{ij}$ defined by (\ref{ghy3bg}) is set to $\sigma_J=0.001$. We fix the average value $J_0$ of the coupling coefficients and the value $H$ of the ``panic field.'' \begin{enumerate} \item We generate a given realization of a randomly initialized matrix $J_{ij}$; \item The initial sets of $\{s_i\}$ and $\{R_i\}$ are generated from uniform distributions (with exclusion of $R=0$); \item A randomly selected spin $s_i$ is updated according to (\ref{eq:Ps}), followed by $R_i$ which is updated according to (\ref{eq:R}); \item We repeat the previous step $N$ times in total, so as to update the rating of $N$ firms, which defines one complete time step; \item We then go back to steps 3 and 4 and iterate them $8$ times, which corresponds to a total lifetime of $8$ time steps; \item We count the number of defaults ($ND$) that have occurred over these $8$ time steps; \item The whole procedure starting from step 1 to step 6 is repeated 1000 times to generate 1000 different realizations over which we can average over the random realizations of the matrix $\{J_{ij}\}$ and over the initial values of $\{s_i\}$ and $\{R_i\}$. \end{enumerate} In the following, we analyze different properties of the systems of $N$ firms as a function of $J_0$ and $H$. \subsection{Critical point and susceptibility} \subsubsection{Absence of the global ``panic'' field ($H=0$) \label{thnbw}} In the absence of the panic field ($H=0$), the dynamics of the $s_i$'s defined by model (\ref{eq:Ps}) with the updating rules described in subsection \ref{th3bw} is nothing but the implementation of the Glauber algorithm \cite{Glauber63} applied to the Potts model for a fully connected Potts model with random couplings $\{J_{ij}\}$ with strictly positive average ${\rm E}[J_{ij}] := J_0 >0$. For such a system, it is known \cite{SherringtonKirkpatrick,GabayToulouse,Nishimori} that, in the limit $N \to +\infty$, a phase transition separates a (so-called paramagnetic) phase at $J_0 < J_{0c}$ where the $s_i$'s on the average occupy all three states in equal numbers, from a (so-called ferromagnetic) phase at $J_0 > J_{0c}$ where one state of the $s_i$'s dominates over the remaining two. If we define $p$ and $q$ as the relative numbers of $s_i$'s in states $-1$ and $1$ respectively, we can describe the system using the pair $(p,q)$. The system in the paramagnetic phase is characterized by $(1/3, 1/3)$. In case of a ferromagnetic phase, three equi-probable pairs $(p_i(J_0, \sigma_J), q_i(J_0, \sigma_J))$ with $p_i\neq 1/3$, $q_i\neq1/3$ are possible and the system selects one of them randomly according to the influence of initial conditions and its noisy dynamics. This is the phenomenon of ``spontaneous symmetry breaking'', defined as the situation in which the solution selected by the dynamics has a lower symmetry than its equation. The concept of spontaneous symmetry breaking has many important applications in many fields of science \cite{Aravind,Consoli,Drugowich,Goldenfeld92,Sivardiere1,Sivardiere2,Weinberg}, with deep implications that span the creation of the universe, the fundamental interactions in physics, the emergence of particle masses to the emergence of stock market speculation \cite{Sornettespec2000}. When the average coupling strength $J_0$ is equal to the critical value $J_{0c}$, the system is at its critical point at which its susceptibility diverges for $N \to \infty$ (and grows as a positive power of $N$ for finite $N$). The numerical value of $J_{0c}$ in the limit $N \to +\infty$ is a well-defined function of $\sigma_J$ \cite{Nishimori}. \begin{figure} \centering \includegraphics[scale=0.5, angle=-90]{fig1.eps} \caption{Relative number of defaults (ND/N) as a function of $J_0$ for different values of the ``panic'' field amplitude $H$.} \label{fig:1} \end{figure} For $H=0$, we thus expect each ECRG $R_i$ to follow a kind of correlated {\it unbiased} random walk for $J_0 < J_{0c}$. In contrast, for $J_0 > J_{0c}$, the spontaneous symmetry breaking of the average of the $s_i$'s translates into a non-zero bias. With probability $1/3$, this bias is positive, tending to push the credit ratings upwards. With probability $1/3$, the bias is negative, pushing the firms inexorably towards the default state $R=0$. And with probability $1/3$, the bias is neutral, keeping the credit rating in its position. Figure \ref{fig:1} presents the average cumulative number of defaults observed in our simulations over $8$ time steps, averaged over 1000 realizations, as a function of $J_0$ for different field amplitudes $H$. For $H=0$, we observe that the fraction of firms that have defaulted in the time span of $8$ time steps jumps from $\simeq 0.2$ to $\simeq 0.3$ as $J_0$ passes through a critical value $J_{0c} \approx 0.0045$. This is the signature of the bias just mentioned above associated with the spontaneous symmetry breaking occurring above the critical point at $J_{0c}$. \begin{figure} \centering \includegraphics[angle=-90, scale=0.7]{fig2.eps} \caption{Susceptibility $\chi(J_0)$ defined by (\protect\ref{yhy3ybr}) for $N=1000$ with errorbars corresponding to a standard deviation.} \label{fig:2} \end{figure} \subsubsection{Effect of the global ``panic'' field ($H>0$)} For $H>0$, the number of defaults $ND$ develops a maximum for $J_0$ in the vicinity of the critical point $J_{0c}$ and the value of the maximum is higher for higher values of the panic field $H$. This peak is due to the phenomenon mentioned above that the neighborhood of the critical point is associated with an increased susceptibility of the system to external perturbations. In the present context, the susceptibility (or we should rather say the vulnerability to panic) can be defined as \begin{equation} \chi=\frac{\partial ND}{\partial H}\Big | _{H=0}~. \label{yhy3ybr} \end{equation} A numerical estimation of the susceptibility for the system of $N=1000$ nodes and different $J_0$ is presented in Fig. \ref{fig:2}. A maximum of $\chi$ near the critical point is clearly visible. The peak is expected to diverge as the system size $N$ goes to infinity. \begin{figure} \centering \includegraphics[scale=0.45, angle=-90]{fig3.eps} \caption{Dependence of $ND$ scaled by the system size $N$ versus $J_0$ in the absence of the field ($H=0$) for different system sizes $N$. } \label{fig:3} \end{figure} \begin{figure} \centering \includegraphics[scale=0.45, angle=-90]{fig4.eps} \caption{Same as Figure \protect\ref{fig:3} for $H=0.08$.} \label{fig:4} \end{figure} \subsubsection{Critical susceptibility and non-monotonous nonlinear amplification of negative shocks} The interplay between the panic field $H$ and the collective phenomenon of defaults is well illustrated by comparing Figure \ref{fig:3} and Figure \ref{fig:4}. Figure \ref{fig:3} for $H=0$ shows that the number of defaults scaled by the size $N$ of the economy is independent of $N$. In other words, for all values of the average coupling strength $J_0$, the number of defaults is simply proportional to the size of the economy all along the nonlinear path as a function of $J_0$. This result illustrates that the severity of the crisis which, in an economy where firms are coupled to each other, does not remain localized to a few firms but scales with the size of the economy. Figure \ref{fig:4} shows that, in the presence of the panic field $H$, the simple scaling of Figure \ref{fig:3} does not hold anymore. It is replaced by a strong nonlinear amplification of the number of defaults with the size of the economy: the scaled variable $ND/N$ grows with growing $N$ at the peak occurring close at the critical point $J_{0c}$. Far away from the critical point, one can observe again a good collapse of the curves for different economy sizes. Thus, the nonlinear amplification as a function of system size $N$ is specifically associated with the behavior of the susceptibility which tends to diverge at $J_{0c}$ as the system size $N$ increases. Figures \ref{fig:1}-\ref{fig:4} carry two vivid messages. \begin{itemize} \item Even in the absence of panic ($H=0$), as the strength of the interactions between firms increases, represented by a rising $J_0$, the severity of the crisis quantified by the fraction of firms defaulting on their obligations exhibits an abrupt nonlinear jump around a critical value $J_{0c}$. \item In the presence of the panic field ($H>0$), the situation worsens considerably, with nonlinear and non-monotonous responses as a function of the average coupling strength $J_0$. The observed maximum susceptibility to a panic effect is associated with a very strong dependence on the size of the system: as shown in Figure \ref{fig:4}, the larger the number of interacting firms and of coupled financial instruments in the economy, the much larger is the amplitude of the crisis as measured by the fraction of default. \end{itemize} Students of collective phenomena will not be surprised by these strong nonlinearities that emerge endogenously from the interactions between the $N$ firms and might even take advantage of the existence of precursors associated with the approach to the critical point (see chapter 10 on ``Transitions, bifurcations and precursors'' of \cite{SornetteCritbook06}). In other words, while the severity of the crisis is many times amplified in the presence of a panic field in a neighborhood of the critical point, making them akin to so-called predictable ``dragon-king'' \cite{SornetteDragon09}, the good news is that such behavior can be anticipated \cite{Sornettepredic2002,Scheffer-Nature09}. The analysis presented by Sornette and Woodard \cite{SorWood10} supports this claim, based on the realization that the fundamental cause of the unfolding financial and economic crisis stems from the accumulation of five bubbles and their interplay and mutual reinforcement. In this vein, one of us and his group at ETH Zurich has started the ``financial bubble experiment'' to test systematically and rigorously the hypothesis that financial crises can be diagnosed in advance \cite{FCO-FBE}. The present model provides a possible supporting mechanism. \section{Sensitivity study of the paths of defaulting economies} The evolution of firms depends on the initial condition of the economy, represented by the set of $\{s_i\}$ and $\{R_i\}$ values at the initial time. In the simulations whose results have been presented in Figures \ref{fig:1}-\ref{fig:4}, we used initial conditions for which the $3$ states $s$ and the $7$ non-zero rating level $R$ are equally populated. Defining $p(t)$ and $q(t)$ as the probabilities for $s=-1$ and $s=1$ respectively at time $t$, this corresponds to $p(0)=q(0)=1/3$. We now study how the evolution of the economy depends on different initial conditions for $p(0)$ and $q(0)$. \subsection{Evolution of the ECRG changes by homogenized equations} First, we study the evolution of the ECRG change $s_i(t)$ via their probabilities. The evolution of the probability of the different states $\{s_i\}$, in absence of default, can be described by the following equations \cite{Sieczka} \begin{equation} \begin{split} &p(t+1)=\\ &\frac{\exp(\tilde J_0p(t)+H)}{\exp(\tilde J_0p(t)+H)+\exp(\tilde J_0q(t))+\exp(\tilde J_0(1-p(t)-q(t)))}, \end{split} \label{eq:mf_p} \end{equation} \begin{equation} \begin{split} & q(t+1)=\\ &\frac{\exp(\tilde J_0q(t))}{\exp(\tilde J_0p(t)+H)+\exp(\tilde J_0q(t))+\exp(\tilde J_0(1-p(t)-q(t)))}~, \end{split} \label{eq:mf_q} \end{equation} where ${\tilde J_0} =J_0 N$. Of course, the probability that the ECRG change is $0$ at time $t$ is simply $1-p(t)-q(t)$. These equations (\ref{eq:mf_p}-\ref{eq:mf_q}) are obtained by using a representative firm approach, known in mathematics as an homogenization procedure, and in physics as a mean-field approximation. \begin{figure*} \begin{center} \includegraphics[angle=-90, scale=0.4]{fig5a.eps} \includegraphics[angle=-90, scale=0.4]{fig5b.eps}\\ \includegraphics[angle=-90, scale=0.4]{fig5c.eps} \includegraphics[angle=-90, scale=0.4]{fig5d.eps} \end{center} \caption{Color coding of the long-time probability $p(\infty)$ for the ECRG change of a firm in absence of default to take the value $s=-1$. The initial state $(p(0),q(0))$ is represented by a point on a $x, y$ plane, while the final state $p(\infty)$ is visualized by a specific color, whose value is read from the code-bar on the right of the panels. Upper left panel: a biased paramagnetic phase (${\tilde J_0}=0.1$, $H=0.5$); upper right panel: a ferromagnetic phase with slightly broken symmetry (${\tilde J_0}=3.5$, $H=0.1$); lower left panel: a ferromagnetic phase with completely broken symmetry (${\tilde J_0}=3.5$, $H=1.0$); lower right panel: a ferromagnetic phase with broken symmetry (${\tilde J_0}=5.0$ $H=1.0$).} \label{fig:mf_iter} \end{figure*} Starting with an initial condition $(p(0), q(0))$, the equations (\ref{eq:mf_p}-\ref{eq:mf_q}) were iterated to obtain an asymptotic value $p(\infty)$ at long times. The results are presented in Fig. \ref{fig:mf_iter}. The initial state $(p(0),q(0))$ is represented by a point on a $x, y$ plane, while the final state $p(\infty)$ is visualized by a specific color. It can be seen that the effect of initial initial conditions is different for different parameters $J_0$ and $H$. In a paramagnetic phase (${\tilde J_0} =0.1$, $H=0.5$), all initial conditions lead to the same final state, which is biased by the field $H$. A ferromagnetic phase (${\tilde J_0} =3.5$, $H=0.1$) breaks into two final states of a complete ordering which depends on the initial condition. In the illustrated case, the symmetry is broken by the field and, as a consequence, the state $p(\infty)\simeq0.93$ is favored. In the ferromagnetic phase with a strong field (${\tilde J_0} =3.5$, $H=1.0$), the symmetry is completely broken and all initial conditions lead to $p(\infty)\simeq 0.98$. For higher interaction strength (${\tilde J_0} =5.0$, $H=1.0$), the system is back to a two-state competition with $p(\infty)\simeq1$ state preferred more often, due to the effect of the field. In the cases (${\tilde J_0} =3.5$, $H=0.1$) and (${\tilde J_0} =5.0$, $H=1.0$), the bottom dark regions correspond to states ordered along the neutral axis with zero average magnetization. This rating status quo could result from economic stagnation with no firm default but no improvement in credit ratings. A mean field approach for an infinite range model provides the exact solution. However, applying a mean field approach to our model constitutes an approximation for two reasons. First, we assume in equations (\ref{eq:mf_p}-\ref{eq:mf_q}) that the field H is nonzero from the beginning of the iteration which is not true in the simulations where the field appears after the first default happens. Second, the simulations run over a finite time, so that the asymptotic state $p(\infty)$ can only be an approximation. Results of the iteration presented in Fig. \ref{fig:mf_iter} play an illustrative role and show areas of initial conditions that lead to common asymptotic solution. \subsection{Sensitivity of defaults on initial conditions} Is the development of a financial crisis through a cascade of default ineluctable? What is the role of the initial conditions and of random shocks during its development? We can address these questions by using our model and study the impact of different values $p(0), q(0)$ of the probabilities of the initial ECRG changes $-1$ and $+1$ for various $J_0$ and $H$. In the paramagnetic phase ($J_0< J_{0c}$), the initial values $p(0), q(0)$ have only a small effect on the number of defaults and a small difference between them leads to negligible consequences as shown in Figure \ref{fig:ew_p}. This figure presents the evolution of $ND(t)$ for four different starting points $(p(0), q(0))$ in the paramagnetic phase with zero panic field ($H=0)$. In both cases, the number of defaults grows linearly in time with similar rate. \begin{figure} \centering \includegraphics[scale=0.4, angle=-90]{fig6.eps} \caption{Evolution of the cumulative number $ND(t)$ of defaults as a function of time for 8 time steps of simulations for $J_0=0.0005$, $\sigma_J=0.001$, corresponding to the ``paramagnetic'' phase in which the average ECRG changes is zero. One can observe that different initial conditions lead to similar evolutions. The curves are obtained by averaging over 1000 different realizations with the same parameters.} \label{fig:ew_p} \end{figure} \begin{figure} \centering \includegraphics[scale=0.4, angle=-90]{fig7.eps} \caption{Same as Figure \protect\ref{fig:ew_p} for $J_0=0.005$, $\sigma_J=0.001$ corresponding to the ``ferromagnetic'' phase in which collective effects are enhanced.} \label{fig:ew_f} \end{figure} In contrast, for $J_0 \geq J_{0c}$ corresponding to the ferromagnetic phase with $H=0$, initial conditions play a strong role in determining the subsequence evolution. Fig. \ref{fig:ew_f} illustrates the typical situation in which two very different scenarios develop for the cumulative number of defaults for systems starting with different initial conditions. The upper curves in Fig. \ref{fig:ew_f} favors $s=-1$. This slight breaking of symmetry in the initial probability condition is sufficient to accelerate tremendously the rate of default, compared to the situation shown in Figure \ref{fig:ew_p}. In the case $p(0)=0.3, q(0)=0.4$ corresponding to a small bias towards the ECRG change $s=+1$, the cooperative ferromagnetic phase has the effect of actually quenching the crisis, i.e., making it less severe with a rapid saturation to a total number of defaults more than half that obtained for the same initial conditions in the paramagnetic phase shown in Figure \ref{fig:ew_p}. \begin{figure} \centering \includegraphics[scale=0.4, angle=-90]{fig8.eps} \caption{Cumulative number $ND$ of defaults as a function of the average coupling strength $J_0$ for pairs of different initial conditions ($p=0.1$, $q=0.1$) and ($p=0.6$, $q=0.1$) and two values of the panic field indicated in the figure ($H=0.04$ and $H=0.3$).} \label{fig:atr1} \end{figure} \begin{figure} \centering \includegraphics[scale=0.4, angle=-90]{fig9.eps} \caption{Same as Figure \protect\ref{fig:atr1} except for the two values of the panic field here equal to $H=0.7$ and $H=1.0$.} \label{fig:atr2} \end{figure} Figures \ref{fig:atr1} and \ref{fig:atr2} illustrate further the drastically increased sensitivity to different initial conditions, as the average coupling strength $J_0$ crosses the critical region $J \simeq J_{0c}$, in the presence of a non-zero panic field $H$. As shown in these Figures, different starting points may lead to opposite default scenarios, seen as a pair of two branches. As the panic field increases to rather large values, an interesting effect is visualized in Fig. \ref{fig:atr2}: in the absence of bias in the initial conditions ($p(0)=q(0)=0.1$), the number of defaults is maximum close to the critical point $J_{0c}$ while going to zero for large $J_0$'s. In contrast, when a bias is present ($p(0)=0.6, q(0)=0.1$) in favor of $s=-1$, the number of defaults increases rapidly to an almost complete collapse of the economy as the coupling strength increases. \subsection{Direct impact of the phenomenon of ``spontaneous symmetry breaking''} \begin{figure} \centering \includegraphics[scale=0.4, angle=-90]{fig10.eps} \caption{Time evolution of an ensemble of 100 realizations of an economy with the same parameters $J_0=0.006$ with symmetric initial conditions $p(0)=q(0)=1/3$.} \label{fig_ssb} \end{figure} These effects described in the previous subsection are in essence all the children of the ``spontaneous symmetry breaking'' occurring for $J_0 > J_{0c}$ mentioned in subsection \ref{thnbw}, amplified by two additional symmetry breaking in the initial conditions and in the presence of the panic field. To make the point clearer, Figure \ref{fig_ssb} shows the time evolution of an ensemble of 100 realizations of an economy with the same parameters $J_0=0.006$, with symmetric initial conditions $p(0)=q(0)=1/3$. We can observe that about 40\% of the economies bifurcate to a large number of defaults while the other 60\% exhibit a much milder crisis. Nothing but the phenomenon of spontaneous symmetry breaking differentiates these different realizations. The conclusion is that, for systems functioning close to and above a critical point, a large variability can be observed with, under the same conditions, either a very severe or a very mild crisis unfolding. The later would not doubt be hailed as the success of better regulations or better policy or risk management, while this huge difference is inherent to the dynamics of systems driven by collective effects. The pattern of time evolutions shown in figure \ref{fig_ssb} can be interpreted from the diagrams of figure \ref{fig:mf_iter}, specifically the cases (${\tilde J_0} =3.5$, $H=0.1$) and (${\tilde J_0} =5.0$, $H=1.0$) in which the dark regions correspond to states ordered along the positive or the neutral axis. In such regimes, the number of up-going trajectories leading to a large occurrence of firm defaults is about 40\% of all trajectories. This 40\% fraction consists of a fraction of 33\% of trajectories associated with the negative ordered phase and of a number of trajectories that run first in the paramagnetic phase until they become ordered in the neutral phase. Since the paramagnetic phase allows stochastic movements of firm rating to $R=0$, a number of firms are subjected to this effect. \section{Impact of rescue policy} Until now, our model has implemented the negative psychological effect of defaults occurring in the economy via a ``panic'' field, which tends to enhance the downgrading of firms and the probability of default. We have shown that the negative sentiment, modeled by the panic field $H$ which appears when the first default happens, has the effect of destabilizing the economy and of increasing significantly the number of defaults. As discussed in the introduction, the inspiration of our model and subsequent analysis was the occurrence of Lehman Brothers bankruptcy and the controversial decision by the US Treasury and the Federal Reserve to let Lehman Brothers fail. Our model provides a simple playground to test what would be the effect of a policy bailing out defaulting firms in the hope of regaining stability. We thus implemented a rescue policy in our simulations by resetting the first $B$ firms that default when their rating reach $R=0$ with an effective credit rating grade (ECRG) $R$ randomly chosen between $1$ and $7$ and with ECRG changes $s$ randomly set between $-1, 0$ and $+1$ with the same probabilities. Because the rescue occurs before the information that $R=0$ can spread within the network, it corresponds to a bail-out action just before an agent defaults. \begin{figure} \centering \includegraphics[scale=0.4, angle=-90]{fig11.eps} \caption{Cumulative number $ND(J_0)$ of defaults as a function of the average coupling strength $J_0$, for $H=0.08$ and different rescue parameter $B$.} \label{fig:rat1} \end{figure} \begin{figure} \centering \includegraphics[scale=0.4, angle=-90]{fig12.eps} \caption{Dependence as a function of $J_0$ of $\Delta ND /N = (ND(B=0)-ND(B))/N$, defined as the fraction of firms that avoid bankruptcy as a consequence of the policy to bail out the first $B$ first defaulting firms. The panic field is set to $H=0.08$ and three different rescue parameter $B$ are investigated. } \label{fig:rozner} \end{figure} \begin{figure} \centering \includegraphics[scale=0.4, angle=-90]{fig13.eps} \caption{Same as Figure \protect\ref{fig:rozner} for a fixed rescue parameter $B=5$ and three different panic fields.} \label{fig:rozneh} \end{figure} Fig. \ref{fig:rat1} shows that the bailing out policy can significantly reduce the scale of collective bankruptcies, however it cannot prevent them. Again, the impact of the rescue policy is strongest close to the critical point where is the economy is the most susceptible to shocks, either negative or positive. The impact of the rescue policy is quantified in Figures \ref{fig:rozner} and \ref{fig:rozneh}, which presents the dependence as a function of $J_0$ of the fraction $\Delta ND /N = (ND(B=0)-ND(B))/N$ of firms that avoid bankruptcy as a consequence of the policy to bail out the first $B$ first defaulting firms. For a fixed moderate panic field $H=0.08$, Figure \ref{fig:rozneh} shows that just bailing out one firm reduces by about 2\% the relative number of defaulting firms. While seemingly not much, for our economy of 1000 firms, this amounts to save endogenously about 20 firms by the spill-over effect of the collective interactions in the network of firms at the cost of just bailing out one firm. Bailing out the first 10 defaulting firms lead to a maximum salvation of 16\% of the firms in the economy (or 160 out of the 1000). While the (gain / cost) ratio $= 16\%/ 10$) for $B=10$ is smaller than the (gain / cost) ratio $= 2\%/ 1$) for $B=1$, the effect remains significant. Figure \ref{fig:rozneh} shows that the impact of the rescue policy is stronger for larger panic fields, as would be hoped for. \section{Conclusions} Johnson \cite{SimonJohnson} summarizes the three main events that triggered the severe global phase of the crisis as follows: ``On the weekend of September 13-14, 2008, the U.S. government declined to bailout Lehman. The firm subsequently failed, i.e., did not open for business on Monday, September 15. Creditors suffered major losses, and these had a particularly negative effect on the markets given that through the end of the previous week the Federal Reserve had been encouraging people to continue to do business with Lehman... On Tuesday, September 16, the government agreed to provide an emergency loan to the major insurance company, AIG. This loan was structured so as to become the company's most senior debt and, in this fashion, implied losses for AIG's previously senior creditors; the value of their investments in this AAA bastion of capitalism dropped 40\% overnight... By Wednesday, September 17, it was clear that the world's financial markets - not just the US markets, but particularly US money market funds - were in cardiac arrest. The Secretary of the Treasury immediately approached Congress for an emergency budgetary appropriation of \$700bn (about 5\% of GDP), to be used to buy up distressed assets and thus relieve pressure on the financial system...'' Inspired by these events, we have developed a simple model of the ``Lehman Brothers effect'' in which the Lehman default event is quantified as having an almost immediate effect in worsening the credit worthiness of all financial institutions in the economic network. This effect embodies (i) the direct consequences of the Lehman default on its creditors as well as (ii) the psychological impact of the realization that the US Treasury and Federal Reserve was ready to let fail a major financial institution so that no one felt protected anymore and (iii) the valuation effect that the worthiness of financial derivatives was much less than previously estimated, leading to a global realization that the problem was much more severe that imagined before. We have offered a stylized description in which all properties of a given firm can be captured by its effective credit rating. We have specified simple dynamics of co-evolution of the effective credit ratings of coupled firms, that show the existence of a global phase transition around which the susceptibility of the system is strongly enhanced. In this context, we show that bailing out the first few defaulting firms does not solve the problem, but does alleviate considerably the global shock, as measured by the fraction of firms that are not defaulting as a consequence. We quantify a more than ten-fold effect: bailing out the first (respectively the first ten) defaulting firm(s) saves 20 (respectively 160) more firms in an economy of 1000 firms. This amplification effect is the direct consequence of the collective linkage between the firm credit ratings in our economic network which is organized endogenously. An idea to generalize the model would be to introduce heterogeneity in size of the firms and in their economic connections in order to make them more realistic. That could be done by introducing a different, non symmetric interaction matrix $J_{ij}$ in which one node would have a greater impact on its partners than the opposite. We leave this issue for a further studies. \section*{Acknowledgements} The authors acknowledge helpful discussions and exchanges with H. Gersbach, Y. Malevergne, M. Marsili and R. Woodard. All remaining errors are ours. PS and JAH were supported by European COST Action MP0801 (Physics of Competition and Conflicts) and by the Polish Ministry of Science and Education, Grant No 578/N-COST/2009/0. DS acknowledges financial support from the ETH Competence Center ``Coping with Crises in Complex Socio-Economic Systems" (CCSS) through ETH Research Grant CH1-01-08-2 and from ETH Zurich Foundation.
\section{Introduction} Due to its clean environment an $e^+e^-$ linear collider in the ${\unskip\,\text{TeV}}$ range is an ideal machine to probe in detail and with precision the inner working of the electroweak structure, in particular the mechansim of symmetry breaking. From this perspective the study of $e^+e^-\to W^+W^- Z \;$ and $e^+e^-\to ZZZ\;$ may be very instructive and would play a role similar to $e^+e^- \to W^+W^-$ at lower energies. Indeed it has been stressed that $e^+e^-\to W^+W^- Z \;$ and $e^+e^-\to ZZZ\;$ are prime processes for probing the quartic vector boson couplings \cite{Belanger:1992qh}. In particular deviations from the gauge value in the quartic $W^+W^-ZZ$ and $ZZZZ$ couplings that are accessible in these reactions might be the residual effect of physics intimately related to electroweak symmetry breaking. Since these effects can be small and subtle, knowing these cross sections with high precision is mandatory. This calls for theoretical predictions taking into account loop corrections. Radiative corrections to $e^+e^-\to ZZZ\;$ have appeared recently in \cite{JiJuan:2008nn} and those to $e^+e^-\to W^+W^- Z \;$ in \cite{Wei:2009hq}. We have made an independent calculation of the electroweak corrections to $e^+e^-\to W^+W^- Z \;$ and $e^+e^-\to ZZZ$, see \cite{Boudjema:2009pw}. Our preliminary results, eventually confirmed, have been presented in this workshop \cite{ninh-corfu} prior to \cite{Wei:2009hq}. A detailed comparison between our results and the ones of Refs.~\cite{JiJuan:2008nn, Wei:2009hq} has been done in \cite{Boudjema:2009pw}. In this report we summarize our results and make a further study on some distributions for $W^+W^-Z$ production. \section{Calculational details} \label{sect-code} Our calculations are done in the framework of the SM. At leading order the process $e^+e^-\to ZZZ$ contains two types of couplings $eeZ$ and $ZZH$. This process could probe the effect of a quartic $ZZZZ$ coupling which is absent at tree-level, in the SM. The process $e^+e^-\to W^+W^- Z$ is much more complicated with the involvement of trilinear and quartic gauge couplings in addition to the similar couplings as in $ZZZ$ production. Compared to the well-tested process $e^+e^-\to W^+W^- \;$ the new ingredients here are the two quartic gauge couplings $WWZ\gamma$ and $WWZZ$. Thus, this $WWZ$ production at the ILC will be an excellent channel for studying these couplings. We have performed the calculation in at least two independent ways both for the virtual and the real corrections leading to two independent numerical codes (one code is written in Fortran 77, the other in C++). A comparison of both codes has shown full agreement at the level of the integrated cross sections as well as all the distributions that we have studied.\\ \noindent {\bf Input parameters and renormalisation scheme:}\\ We follow closely the on-shell renormalisation scheme as detailed in Refs.~\cite{grace, Denner:1991kt}. To make the final results independent of the light quark masses we adopt a variant of the $G_\mu$ scheme. At tree level, the electromagnetic coupling constant is calculated as $\alpha_{G_\mu}=\sqrt{2}G_\mu M_W^2s_W^2/\pi$. This absorbs some universal $m_t^2$ corrections and also the large logarithmic universal corrections proportional to $\ln(q^2/m_f^2)$ where $q$ is some typical energy scale and $m_f$ a fermion mass. To avoid double counting we have to subtract the one-loop part of the universal correction from the explicit ${\cal O}(\alpha)$ corrections by using the counterterm $\delta Z_e^{G_\mu}=\delta Z_e-\Delta r/2$, the expression for $\Delta r$ can be found in \cite{Denner:1991kt}. For one-loop corrections we use the coupling $\alpha(0)$ for both virtual and real photons. Thus the NLO corrections are of order $\alpha_{G_\mu}^3\alpha(0)$. Further details and the complete set of input parameters are given in \cite{Boudjema:2009pw}.\\ \noindent {\bf Virtual corrections:}\\ The virtual corrections have been evaluated using a conventional Feynman-diagram based approach using standard techniques. We use the packages {\texttt{FeynArts}}\ and {\texttt{FormCalc-6.0}}\ to generate all Feynman diagrams and helicity amplitude expressions \cite{fafc}. We also use {\texttt{SloopS}}\ to check the correctness of the amplitudes by checking non-linear gauge invariance (see \cite{sloops} and references therein). The total number of diagrams in the 't~Hooft-Feynman gauge is about 2700 including 109 pentagon diagrams for $e^+e^-\to W^+W^- Z$ and about 1800 including 64 pentagons for $e^+e^-\to ZZZ$. This already shows that $e^+e^-\to W^+W^- Z$ with as many as 109 pentagons is more challenging than $e^+e^-\to ZZZ$. Indeed getting stable results for all scalar and tensor (up to rank 4) box integrals in the process $e^+e^-\to W^+W^- Z$ is a highly nontrivial task. An efficient way to solve this problem is by using higher precision arithmetic in part of the calculation. Further details related to loop integrals and the references for useful public codes are given in \cite{Boudjema:2009pw}.\\ \noindent {\bf Real corrections:}\\ In addition to the virtual corrections we also have to consider real photon emission, {\it i.e.} the processes $e^+e^-\to W^+W^- Z\gamma$ and $e^+e^-\to ZZZ\gamma$. The corresponding amplitudes are divergent in the soft and collinear limits. The soft singularities cancel against the ones in the virtual corrections while the collinear singularities are regularized by the physical electron mass. To extract the singularities from the real corrections and combine them with the virtual contribution we apply both the dipole subtraction scheme and a phase space slicing method. The former is used to produce the final results since it yields smaller integration errors. Further details are given in \cite{Boudjema:2009pw}. \\ \begin{comment} \begin{figure}[t] \centering \includegraphics[width=0.6\textwidth]{psfig/soft_dipole_slicing_real_MH120_WWZ.eps} \caption{{\em Dependence of $\sigma_\text{real}^{e^+e^-\to W^+W^- Z\gamma}$ on the soft cutoff $\delta_s$ in phase space slicing with fixed $\delta_c = 7 \cdot 10^{-4}$. Only the non-singular part is shown, i.e. the IR singular $\ln(m_\gamma^2)$ terms are set to zero. The result using dipole subtraction is shown for comparison with the error given by the width of the band.}} \label{fig:dipslicmp} \end{figure} \end{comment} \noindent {\bf Defining the weak corrections:}\\ It is well-known that the collinear QED correction related to initial state radiation in $e^{+}e^{-}$-processes is large. In order to see the effect of the weak corrections, one should separate this large QED correction from the full result. It means that we can define the weak correction as an infrared and collinear finite quantity. The definition we adopt in this paper is based on the dipole subtraction formalism. In this approach, the sum of the virtual and the so-called "endpoint" (see \cite{Dittmaier:1999mb} for the definition) contributions satisfies the above conditions and can be chosen as a definition for the weak correction \begin{eqnarray} \sigma_\text{weak} = \sigma_\text{virt} + \sigma_\text{endpoint}. \end{eqnarray} For the numerical results shown in the next section, we will make use of this definition. \section{Numerical results} \label{sect-results} \begin{figure}[t] \begin{center} \mbox{\includegraphics[width=0.47\textwidth]{psfig/rs_born_nlo_MH120_ZZZ} \hspace*{0.01\textwidth} \includegraphics[width=0.47\textwidth]{psfig/rs_born_nlo_MH120_WWZ}} \caption{\label{ourvvzsigma}{\em Left: the total cross section for $e^+e^-\to ZZZ$ as a function of $\sqrt{s}$ for the Born, full ${\cal O}(\alpha)$ and genuine weak correction. Right: the same for $e^+e^-\to W^+W^- Z$.}} \end{center} \end{figure} \noindent {\underline{$e^+e^-\to ZZZ$:}}\\ As shown in Fig.~\ref{ourvvzsigma} the tree-level cross section rises sharply once the threshold for production opens, reaches a peak of about $1.1{\unskip\,\text{fb}}$ around a centre-of-mass energy of $600{\unskip\,\text{GeV}}$ before very slowly decreasing with a value of about $0.9{\unskip\,\text{fb}}$ at 1{\unskip\,\text{TeV}}. The full NLO corrections are quite large and negative around threshold, $-35\%$, decreasing sharply to stabilise at a plateau around $\sqrt{s}=600{\unskip\,\text{GeV}}$ with $-16\%$ correction. The sharp rise and negative corrections at low energies are easily understood. They are essentially due to initial state radiation (ISR) and the behaviour of the tree-level cross section. The photon radiation reduces the effective centre-of-mass energy and therefore explains what is observed in the figure. On the other hand the genuine weak corrections, in the $G_\mu$ scheme, are relatively small at threshold, $-7\%$. They however increase steadily with a correction as large as $-18\%$ at $\sqrt{s}=1{\unskip\,\text{TeV}}$.\\ \noindent {\underline{$e^+e^-\to W^+W^- Z$:}}\\ Compared to $ZZZ$ production, the cross section for $e^+e^-\to W^+W^- Z \;$ is almost 2 orders of magnitudes larger for the same centre-of-mass energy. For example at $500{\unskip\,\text{GeV}}$ it is about $40{\unskip\,\text{fb}}$ at tree level, compared to $1{\unskip\,\text{fb}}$ for the $e^+e^-\to ZZZ\;$ cross section. For an anticipated luminosity of $1 {\rm ab}^{-1}$, this means that the cross section should be known at the per-mil level. The behaviour of the total cross section as a function of energy resembles that of $e^+e^-\to ZZZ$. It rises sharply once the threshold for production opens, reaches a peak before very slowly decreasing as shown in Fig.~\ref{ourvvzsigma}. However as already discussed the value of the peak is much larger, $\sim 50{\unskip\,\text{fb}}$ at NLO, moreover the peak is reached around $\sqrt{s}=1{\unskip\,\text{TeV}}$, much higher than in $ZZZ$. This explains the bulk of the NLO corrections at lower energies which are dominated by the QED correction, large and negative around threshold and smaller at higher energies. As the energy increases the weak corrections get larger reaching about $-18\%$ at $\sqrt{s}=1.5{\unskip\,\text{TeV}}$. \begin{figure}[htb] \begin{center} \mbox{\includegraphics[width=0.45\textwidth ]{psfig/yW+_born_nlo_MH120_WWZ} \hspace*{0.01\textwidth} \includegraphics[width=0.45\textwidth]{psfig/yW+_delta_nlo_MH120_WWZ}} \mbox{\includegraphics[width=0.45\textwidth ]{psfig/pTW_born_nlo_MH120_WWZ} \hspace*{0.01\textwidth} \includegraphics[width=0.45\textwidth]{psfig/pTW_delta_nlo_MH120_WWZ}} \caption{\label{ourwwzdist}{\em From top to bottom: distributions for the rapidity and the transverse momentum of the $W^+$ for $e^+e^-\to W^+W^- Z \;$ . The panels on the left show the tree-level, the full NLO and the weak correction. The panels on the right show the corresponding relative (to the tree-level) percentage corrections. }} \end{center} \end{figure} In Fig.~\ref{ourwwzdist} we show the distributions in the rapidity and the transverse momentum of the $W^+$. First, due to photon radiation, in the full NLO corrections some large corrections do show up at the edges of phase space. However when the QED corrections are subtracted, the weak corrections cannot be parameterized by an overall scale factor, for all the distributions that we have studied. This feature together with possible normal/anomalous thresholds make it clear that calculating explicitly one-loop EW corrections is needed for a precise comparison with experimental data.
\section{Introduction}\label{Introduction} Light plays an essential role in quantum communication and is indispensable in most practical applications, for example quantum cryptography. Photons are attractive carriers of quantum information because the interactions of light with the surroundings are normally weak, but for the same reason it is generally difficult to prepare, manipulate, and measure quantum states of light in a nondestructive way. Repeated interactions provide a method to increase the effective coupling strength between light and matter, and the backreflection of light in a cavity thus constitutes an interesting tool, in particular, because experiments are currently moving into the strong coupling regime \cite{strongcoupling1,strongcoupling2,strongcoupling3,strongcoupling4}, where coherent dynamics takes place on a faster time scale than dissipative dynamics. In this paper we propose a versatile setup consisting of an array of cavities and passive optical elements (beam splitters and phase shifters), which allows for quantum state engineering, quantum state purification, and non-destructive number resolving photon detection. The setup builds on two basic ingredients: The Hong-Ou-Mandel interference effect \cite{HongOuMandel} generalized to input pulses containing an arbitrary number of photons and the possibility of projection onto the subspace of even or the subspace of odd photon-number states by use of cavity quantum electrodynamics in the strong coupling regime. Regarding quantum state engineering, the basic setup provides a possibility to conditionally generate photon-number correlated states. More specifically, the setup allows us to project an arbitrary photonic two-mode input state onto the subspace spanned by the state vectors $|n\rangle|n\rangle$ with $n=0,1,2,\ldots$. We denote this subspace by $S$. The scheme is probabilistic as it is conditioned on a specific measurement outcome. The success probability equals the norm of the projection of the input state onto $S$ and is thus unity if the input state already lies in $S$. In other words, the setup may be viewed as a filter \cite{EntanglementFilter}, which removes all undesired components of the quantum state but leaves the desired components unchanged. We may, for example, use two independent coherent states as input and obtain a photon-number correlated state as output. Photon-number correlated states, for example Einstein-Podolsky-Rosen (EPR) entangled states \cite{EPR}, are an important resource for quantum teleportation \cite{Teleportation1, Teleportation2, Teleportation3, Teleportation4, Teleportation5}, entanglement swapping \cite{Swapping1, Swapping2, Swapping3}, quantum key distribution \cite{QKD1, QKD2}, and Bell tests \cite{Bell1, Bell2}. In practice, however, the applicability of these states is hampered by noise effects such as photon losses. Real-world applications require therefore entanglement purification. The proposed setup is very attractive for detection of losses and can in particular be used to purify photon-number entangled states on site. If a photon-number correlated state, for example an EPR state, is used as input, the desired state passes the setup with a certificate, while states which suffered from photon losses are detected and can be rejected. Photon losses are an especially serious problem in quantum communication over long distances. It is not only a very common source of decoherence which is hard to avoid, but also typically hard to overcome. The on-site purification protocol mentioned above can easily be adopted to a communication scenario such that it allows for the purification of a photon-number correlated state after transmission to two distant parties. Purification of two mode entangled states has been shown experimentally for qubits \cite{Purification1,Purification2} and in the continuous variable (CV) regime \cite{Purification3, Purification4}. (CV-entanglement purification is especially challenging \cite{GaussianImp1,GaussianImp2,GaussianImp3}. Nevertheless, several proposals have been made to accomplish this task \cite{PurificationProp1,PurificationProp2,PurificationProp3, PurificationProp4,PurificationProp5,PurificationProp6}, and very recently Takahashi {\it et al.}\ succeeded in an experimental demonstration \cite{jonas}.) A special advantage of our scheme lies in the fact that it does not only allow for detection of arbitrary photon losses, but is also applicable to many modes such that entanglement can be distributed and purified in a network. With a small modification, the basic setup can be used for number resolved photon detection. The ability to detect photons in a number resolved fashion is highly desirable in the fields of quantum computing and quantum communication. For example, linear optics quantum computation relies crucially on photon number resolving detectors \cite{KLM,Kok07,Obrian07}. Moreover, the possibility to distinguish different photon-number states allows for conditional state preparation of nonclassical quantum states \cite{Prep1,Prep2,Prep3}, and plays a role in Bell experiments \cite{Zukowski93} and the security in quantum cryptographic schemes \cite{Crypto1,Crypto2}. Other applications include interferometry \cite{Interferometry} and the characterization of quantum light sources \cite{LightSources1,LightSources2}. Existing technologies for photon counting \cite{APD,Silberhorn04,Banzek03,Cryo1,Cryo2,Cryo3,Others1,Others2,Others3,QuantumDots1,QuantumDots2,QuantumJumps, QND1, QND2} such as avalanche photodiodes, cryogenic devices, and quantum dots typically have scalability problems and cannot reliably distinguish high photon numbers, destroy the quantum state of light in the detection process, or do not work for optical photons. Here, we present a non-destructive number resolving photo detection scheme in the optical regime. This quantum-non-demolition measurement of the photon number allows for subsequent use of the measured quantum state of light. An advantage of the counting device put forward in this work compared to other theoretical proposals for QND measurements of photon numbers \cite{QNDprop1,QNDprop2,QNDprop3,QNDprop4,QNDprop5,QNDprop6} is the ability to detect arbitrarily high photon numbers with arbitrary resolution. The scheme is based on testing successively all possible prime factors and powers of primes and the resources needed therefore scale moderately with (width and mean of the) photon number distribution. In particular, a very precise photon number measurement can be made even for very high photon numbers by testing only few factors if the approximate photon number is known. The paper is structured as follows. We start with a brief overview of the main results in Sec.~\ref{Overview}. In Sec.~\ref{Filter}, we explain how the conditional projection onto $S$ can be achieved and discuss some properties of the proposed setup in the ideal limit, where the atom-cavity coupling is infinitely strong and the input pulses are infinitely long. In Sec.~\ref{Detector}, we show that a modified version of the setup can act as a non-destructive photon number resolving detector, and in Sec.~\ref{Purification}, we investigate the possibility to use the setup to detect, and thereby filter out, losses. In Sec.~\ref{Nonideal}, we consider the significance of finite input pulse length and finite coupling strength, and we obtain a simple analytical expression for the optimal choice of input mode function for coherent state input fields. Section~\ref{Conclusion} concludes the paper. \section{Overview and main results}\label{Overview} The most important ingredient of the proposed setup is the possibility to use the internal state of a single atom to control whether the phase of a light field is changed by $\pi$ or not \cite{interaction}. The basic mechanism, which is explained in Fig.~\ref{cavity}, has several possible applications, including preparation of superpositions of coherent states \cite{cat}, continuous two-qubit parity measurements in a cavity quantum electrodynamics network \cite{parity}, and low energy switches \cite{switch}. Concerning the experimental realization, basic ingredients of the scheme such as trapping of a single atom in a strongly coupled cavity and preparing of the initial atomic state have been demonstrated experimentally in \cite{reichelreadout}, where the decrease in cavity field intensity for an atom in the state $|{\uparrow}\rangle$ compared to the case of an atom in the state $|{\downarrow}\rangle$ is used to subsequently measure the state of the atom. State preparation and readout for a single atom in a cavity have also been demonstrated in \cite{rempereadout}. Another promising candidate for an experimental realization is circuit quantum electrodynamics. See, for instance, \cite{circuitQED} for a review. \begin{figure} \includegraphics[width=\columnwidth]{figure1} \caption{\label{cavity}(Color online) A single atom with level structure as shown in (a) is placed in a cavity in the strong coupling regime. The light field, which is on resonance with the cavity, couples the ground state level $|{\uparrow}\rangle$ resonantly to the excited state $|e\rangle$, and the state $|e\rangle$ decays to the state $|{\uparrow}\rangle$ through spontaneous emission at a rate $\Gamma$. (b) If the atom is in the state $|{\downarrow}\rangle$, the incident field is not affected by the presence of the atom, and for a sufficiently slowly varying input pulse, the interaction with the resonant cavity changes the phase of the light field by $\pi$. (c) If the atom is initially in the state $|{\uparrow}\rangle$, the possibility of spontaneous emission prevents the light field from building up inside the cavity (provided the photon flux of the input beam is not too high), and the incoming field is reflected from the input mirror without acquiring a phase shift. This transformation is insensitive to the precise values of $g$, $\Gamma$, and the cavity decay rate as long as the system is in the strong coupling and weak driving regime.} \end{figure} The generation of quantum superposition states can be achieved as follows. The atom is initially prepared in the state $(|{\uparrow}\rangle+|{\downarrow}\rangle)/\sqrt{2}$, and the input field is chosen to be a coherent state $|\alpha\rangle$. After the interaction, the combined state of the atom and the light field is proportional to $|\alpha\rangle|{\uparrow}\rangle+|-\alpha\rangle|{\downarrow}\rangle\propto (|\alpha\rangle+|-\alpha\rangle)(|{\uparrow}\rangle+|{\downarrow}\rangle) +(|\alpha\rangle-|-\alpha\rangle)(|{\uparrow}\rangle-|{\downarrow}\rangle)$, and a measurement of the atomic state in the basis $\ket{\pm}=(|{\uparrow}\rangle\pm|{\downarrow}\rangle)/\sqrt{2}$ projects the state of the light field onto the even $|\alpha\rangle+|-\alpha\rangle$ or the odd $|\alpha\rangle-|-\alpha\rangle$ superposition state. More generally, the input state $\sum_nc_n|n\rangle$, where $|n\rangle$ is an $n$-photon Fock state, is transformed into the output state $\sum_n(1/2\pm(-1)^n/2)c_n|n\rangle$, i.e., the input state is conditionally projected onto either the subspace spanned by all even photon-number states or the subspace spanned by all odd photon-number states without destroying the state. With this tool at hand, we can project an arbitrary two-mode input state onto the subspace $S=\textrm{span}(\ket{n}\ket{n})$, $n=0,1,2,\ldots$. If two modes interfere at a 50:50 beam splitter, a state of form $|n\rangle|n\rangle$ is transformed into a superposition of products of even photon-number states. If we apply a 50:50 beam splitter operation to the input state, project both of the resulting modes conditionally on the subspace of even photon-number states, and apply a second 50:50 beam splitter operation, the input state is thus unchanged if it already lies in $S$, but most other states will not pass the measurement test. To remove the final unwanted components, we apply opposite phase shifts to the two modes (which again leaves $\ket{n}\ket{n}$ unchanged) and repeat the procedure (as shown in Fig.~\ref{setup}). For an appropriate choice of phase shifts, the desired state is obtained after infinitely many repetitions. In practice, however, a quite small number is typically sufficient. If, for instance, the input state is a product of two coherent states $|\alpha\rangle|\alpha\rangle$ with $|\alpha|^2=4$, the fidelity of the projection is $0.573$ for one unit, $0.962$ for two units, and $0.999998$ for three units. The scheme is easily generalized to an $M$ mode input state. In this case, we first project modes 1 and 2 on $S$, modes 3 and 4 on $S$, etc, and then project modes 2 and 3 on $S$, modes 4 and 5 on $S$, etc. The setup can also be used as a device for photon number resolving measurements if the phases applied between the light-cavity interactions are chosen according to the new task. Each photon-number state $|n\rangle$ sent through the array leads to a characteristic pattern of atomic states. As explained in section \ref{DestructiveScheme}, one can determine the photon number of an unknown state by testing the prime factors and powers of primes in the range of interest in subsequent parts of the array. The scheme scales thereby moderately in the resources. Three cavity pairs suffice for example for detecting any state which is not a multiple of three with a probability of $93.75\%$. However, in this basic version of the counting scheme, the tested photon state may leave each port of the last beam splitter with equal probability. Deterministic emission of the unchanged quantum state of light into a single spatial mode is rendered possible if we allow atoms in different cavities to be entangled before the interaction with the field (see section \ref{QNDScheme}). More generally, the proposed scheme allows to determine the difference in photon numbers of two input beams without changing the photonic state. The correlations in photon number between the two modes of states in $S$ facilitate an interesting possibility to detect photon losses. To this end the state is projected onto $S$ a second time. If photon loss has occurred, the state is most likely orthogonal to $S$, in which case we obtain a measurement outcome, which is not the one we require in order to accept the projection as successful. On the other hand, if photon loss has not occurred, we are sure to get the desired measurement outcome. We note that loss of a single photon can always be detected by this method, and the state can thus be conditionally recovered with almost perfect fidelity if the loss is sufficiently small. We can improve the robustness even further, if we use an $M$-mode state. It is then possible to detect all losses of up to $M-1$ photons, and even though it is $M$ times more likely to lose one photon, the probability to lose one photon from each mode is approximately $(Mp)^M$, where $p$ is the probability to lose one photon from one mode and we assume $Mp\ll1$. In a situation where many photon losses are to be expected, this procedure allows one to obtain photon-number correlated states with high fidelity, although with small probability. We can also distribute the modes of a photon-number correlated state to distant parties, while still checking for loss, provided we send at least two modes to each party. As the proposed scheme can be used as a filter prior to the actual protocol it has an important advantage compared to postselective schemes. If the tested entangled state is for example intended to be used for teleportation, the state to be teleported is not destroyed in the course of testing the photon-number correlated resource state. The dynamics in Fig.~\ref{cavity} requires strong coupling, a sufficiently slowly varying mode function of the input field, and a sufficiently low flux of photons. To quantify these requirements, we provide a full multi-mode description of the interaction of the light with the cavity for the case of a coherent state input field in the last part of the paper. We find that the single atom cooperativity parameter should be much larger than unity, the mode function of the input field should be long compared to the inverse of the decay rate of the cavity, and the flux of photons in the input beam should not significantly exceed the rate of spontaneous emission events from an atom having an average probability of one half to be in the excited state. We also derive the optimal shape of the mode function of the input field (Eq.~\eqref{mode}), when the mode function is only allowed to be nonzero in a finite time interval. \section{Nondestructive projection onto photon-number correlated states}\label{Filter} \begin{figure*} \includegraphics[width=\textwidth]{figure2} \caption{\label{setup}(Color online) The first three units of the proposed setup to conditionally project an arbitrary two-mode input state onto the subspace spanned by the state vectors $|n\rangle|n\rangle$, $n=0,1,2,\ldots$. All atoms are prepared in the state $(|{\uparrow}\rangle+|{\downarrow}\rangle)/\sqrt{2}$ before the interaction with the field, and the desired projection occurs in the limit of infinitely many units conditioned on all atoms being in the state $(|{\uparrow}\rangle+|{\downarrow}\rangle)/\sqrt{2}$ after the interaction. As explained in the text, a small number of units will typically suffice in practice. For later reference we label the beam splitters as BS$_i$ and the cavities as C$_i$.} \end{figure*} The proposed setup for projection of an arbitrary two-mode input state onto $S$ is sketched in Fig.~\ref{setup}. We denote the field annihilation operators of the two input modes by $\hat{a}$ and $\hat{b}$, respectively. The total transformation corresponding to one of the units consisting of a beam splitter, a set of cavities, and a second beam splitter, conditioned on both atoms being measured in the state $|+\rangle$ after the interaction, is given by the operator $U^\dag PU$, where \begin{equation}\label{UBS} U=\exp\left[\frac{\pi}{4}\left(\hat{a}^\dag\hat{b}-\hat{a}\hat{b}^\dag\right)\right] \end{equation} and \begin{equation} P=\sum_{n=0}^\infty\sum_{m=0}^\infty|2n\rangle\langle2n|\otimes|2m\rangle\langle2m|. \end{equation} As explained above, the Hong-Ou-Mandel effect ensures that $U^\dag PU|n\rangle|n\rangle=|n\rangle|n\rangle$, while most other possible components of the input state are removed through the conditioning, for instance all components $|n\rangle|m\rangle$ with $n+m$ odd. There are, however, a few exceptions, since all states of the form $U^\dag|2n\rangle|2m\rangle$, $n=0,1,2,\ldots$, $m=0,1,2,\ldots$, are accepted. The phase shifts between the $U^\dag PU$ units are represented by the operator \begin{equation}\label{Uphi} U_\phi=\exp\left[i\phi\left(\hat{a}^\dag\hat{a}-\hat{b}^\dag\hat{b}\right)\right], \end{equation} which leaves states of the form $|n\rangle|n\rangle$ unchanged, while states of the form $|n\rangle|m\rangle$ with $n\neq m$ acquire a phase shift. For a setup containing $N+1$ units, the complete conditional transformation is thus represented by the operator \begin{eqnarray} \hat{O}_N&=&U^\dag PUU_{\phi_N}U^\dag PU\cdots U_{\phi_2}U^\dag PU U_{\phi_1}U^\dag PU\\ &=&U^\dag PU\prod_{i=1}^N\cos[\phi_i(\hat{a}^\dag\hat{a}-\hat{b}^\dag\hat{b})]\label{ON}, \end{eqnarray} where $U^\dag PU$ in the last line commutes with the product of cosines. For $N \rightarrow \infty$, the product of cosines vanishes for all components of the input state with different numbers of photons in the two modes if, for instance, all the $\phi_i$'s are chosen as an irrational number times $\pi$. We note that even though we here apply the two-mode operators one after the other to the input state corresponding to successive interactions of the light with the different components of the setup, the result is exactly the same if the input pulses are longer than the distance between the components such that different parts of the pulses interact with different components at the same time. The only important point is that the state of the atoms is not measured before the interaction with the light field is completed. The setup using an array of cavities as in Fig.~\ref{setup} may thus be very compact even though the pulses are required to be long. (Note that it would also be possible to use a single pair of cavities and atoms repeatedly in a fold-on type of experiment; however in that case the compactness would be lost due to the need for long delay lines necessary to measure and re-prepare the atoms before they are reused.) A natural question is how one should optimally choose the angles $\phi_i$ to approximately achieve the projection with a small number of units. To this end we define the fidelity of the projection \begin{equation}\label{FN} F_N=\frac{|\langle\psi_N|\psi_\infty\rangle|^2} {\langle\psi_N|\psi_N\rangle\langle\psi_\infty|\psi_\infty\rangle} =\frac{\langle\psi_\infty|\psi_\infty\rangle} {\langle\psi_N|\psi_N\rangle} \end{equation} as the overlap between the unnormalized output state $|\psi_N\rangle=\hat{O}_N|\psi_{\textrm{in}}\rangle$ after $N+1$ units and the projection $|\psi_\infty\rangle$ of the input state $|\psi_{\textrm{in}}\rangle$ onto the subspace $S$. The last equality follows from the fact that $|\psi_N\rangle=|\psi_\infty\rangle+|\psi_\bot\rangle$, where $|\psi_\bot\rangle$ lies in the orthogonal complement of $S$. Maximizing $F_N$ for a given $|\psi_{\textrm{in}}\rangle=\sum_n\sum_mc_{nm}|n\rangle|m\rangle$ thus corresponds to minimizing \begin{multline} \langle\psi_N|\psi_N\rangle=\sum_{n=0}^\infty\sum_{m=0}^\infty c_{nm} \prod_{i=1}^N\cos^2[\phi_i(n-m)]\\ \times\langle\psi_{\textrm{in}}|U^\dag PU|n\rangle|m\rangle, \end{multline} i.e., we would like to find the optimal solution of \begin{multline} \frac{\partial\langle\psi_N|\psi_N\rangle}{\partial\phi_j}= -\sum_{n=0}^\infty\sum_{m=0}^\infty c_{nm}\sin[2\phi_j(n-m)](n-m)\\ \times\prod_{\substack{i=1\\i\neq j}}^N\cos^2[\phi_i(n-m)] \langle\psi_{\textrm{in}}|U^\dag PU|n\rangle|m\rangle=0. \end{multline} A set of solutions valid for any input state can be obtained by requiring $\sin[2\phi_j(n-m)]\prod_{i\neq j}\cos^2[\phi_i(n-m)]=0$ for all even values of $n-m$ (note that $U^\dag PU|n\rangle|m\rangle=0$ for $n+m$ odd). Within this set the optimal solution is $\phi_j=2^{-j}\times\pi/2$. It is interesting to note that choosing one of the angles to be $2^{-j}\times\pi/2$, $j\in\{1,2,\ldots,N\}$, all terms with $n-m=2^j\times(\pm1,\pm3,\pm5,\ldots)$ are removed from the input state according to \eqref{ON}. When all angles are chosen according to $\phi_j=2^{-j}\times\pi/2$, it follows that $|\psi_N\rangle$ only contains terms with $n-m=q2^{(N+1)}$, $q=0,\pm1,\pm2,\ldots$, which may be a useful property in practical applications of the scheme. Even though this is not necessarily optimal with respect to maximizing $F$ for a particular choice of input state, we thus use the angles $\phi_j=2^{-j}\times\pi/2$ in the following, except for one important point: If the input state satisfies the symmetry relations $c_{nm}=c_{mn}$, it turns out that the operator $U^\dag PU$ by itself removes all terms with $n-m=\pm2,\pm6,\pm10,\ldots$, i.e., we can choose the angles as $\phi_j=2^{-j}\times\pi/4$, and $|\psi_N\rangle$ only contains terms with $n-m=q2^{(N+2)}$, $q=0,\pm1,\pm2,\ldots$. For $N=2$, for instance, only terms with $n-m=0,\pm16,\pm32,\ldots$ contribute. In Fig.~\ref{fidelity}, we have chosen the input state to be a product of two coherent states with amplitude $\alpha$ and plotted the fidelity \eqref{FN} as a function of $|\alpha|^2$ for different numbers of units of the setup. Even for $|\alpha|^2$ as large as 10, the fidelity is still as high as 0.9961 for $N=2$, and the required number of units is thus quite small in practice. The figure also shows the success probability \begin{equation} P_N=\langle\psi_N|\psi_N\rangle \end{equation} for $N\rightarrow\infty$. For $|\alpha|^2=10$, for instance, one should repeat the experiment about 11 times on average before the desired measurement outcome is observed. \begin{figure} \includegraphics[width=\columnwidth]{figure3} \caption{\label{fidelity}(Color online) Fidelity (Eq.~\eqref{FN}) as a function of the expectation value of the number of photons in one of the input modes for $|\psi_{\textrm{in}}\rangle=|\alpha\rangle|\alpha\rangle$ and setups with one, two, three, and infinitely many units. The angles are chosen as $\phi_j=2^{-j}\times\pi/4$. The dotted line labeled $P_{\infty}$ is the probability in the limit of infinitely many units to actually obtain the required measurement outcome, i.e., all atoms in $(|{\uparrow}\rangle+|{\downarrow}\rangle)/\sqrt{2}$ after the interaction with the field.} \end{figure} \section{Photon number resolving measurement}\label{Detector} In this section, we show how a photon number measurement can be implemented using a modified version of the setup introduced in the previous section. The key idea is explained in subsection \ref{DestructiveScheme} where we describe the basic photo-counting scheme. In subsection \ref{QNDScheme}, this protocol is extended to allow for a QND measurement of photon numbers. \subsection{Number resolving detection scheme}\label{DestructiveScheme} In the following, we analyze the setup shown in Fig.~\ref{setup} when the input is a product of an $n$-photon Fock state in the lower input beam and a vacuum state in the upper input beam. Since the setup contains a series of beam splitters, it will be useful to define $\hat{A}=(\hat{a}^\dag-\hat{b}^\dag)/\sqrt{2}$ and $\hat{B}=(\hat{a}^\dag+\hat{b}^\dag)/\sqrt{2}$, such that $\hat{a}^\dag\ket{0}\rightarrow\hat{A}\ket{0}$ and $\hat{b}^\dag\ket{0}\rightarrow\hat{B}\ket{0}$ at beam splitters BS$_1$, BS$_3$, BS$_5$, $\ldots$, and $\hat{A}\ket{0}\rightarrow\hat{a}^\dag\ket{0}$ and $\hat{B}\ket{0}\rightarrow\hat{b}^\dag\ket{0}$ at beam splitters BS$_2$, BS$_4$, BS$_6$, $\ldots$. As before, all atoms are initially prepared in the state $\ket{+}$ and will after the interaction with the field be measured in the $\ket{\pm}$ basis. When we start with an $n$ photon state, there are only two possible outcomes of the measurement of the atoms in the cavities labeled C$_1$ and C$_2$ in Fig.~\ref{setup} dependent on whether $n$ is even or odd. In the even case, the two atoms can only be in $\ket{++}$ or $\ket{--}$ and in the odd case $\ket{-+}$ or $\ket{+-}$. To handle the odd and even case at the same time we denote $\ket{++},\ket{-+}$ as $\ket{B_+}$ and $\ket{--},\ket{+-}$ as $\ket{B_-}$. A measurement of $\ket{B_+}$ indicates an even number of photons in the $\hat{b}$-beam, resp., $\ket{B_-}$ an odd number of photons in the $\hat{b}$-beam. We start with the state $\ket{n}\ket{0}=\frac{1}{\sqrt{n!}}(\hat{a}^\dag)^n\ket{0}\ket{0}$ as input. After the beam splitter BS$_1$, the state has changed into $\frac{1}{\sqrt{n!}}\left(\frac{\hat{a}^\dag-\hat{b}^\dag}{\sqrt{2}}\right)^n\ket{0}\ket{0}$ and interacts with the two atoms in the cavities C$_1$ and C$_2$. By measuring the atoms in the $\ket{\pm}$ basis, the state is projected into the subspace of an even or odd number of photons in the $\hat{b}$ path. The photon state after the measurement can be written as $\ket{b_\pm}:=\frac{1}{\sqrt{2\ n!}}\left[\left(\frac{\hat{a}^\dag-\hat{b}^\dag} {\sqrt{2}}\right)^n \pm\left(\frac{\hat{a}^\dag+\hat{b}^\dag} {\sqrt{2}}\right)^n\right]\ket{0}\ket{0}=\frac{1}{\sqrt{2\ n!}}(\hat{A}^n \pm\hat{B}^n)\ket{0}\ket{0}$, where $\ket{b_+}$($\ket{b_-}$) is the state with an even (odd) number of $\hat{b}$ photons and corresponds to the measurement result $\ket{B_+}$ ($\ket{B_-}$). Note that this first measurement result is completely random. After BS$_2$ the state simplifies to $\frac{1}{\sqrt{2\ n!}}[(\hat{a}^\dag)^n \pm(\hat{b}^\dag)^n]\ket{0}\ket{0}$. Now due to the phase shifters the two modes pick up a relative phase of $2 \phi_1 n$ so that the state is given by $\frac{1}{\sqrt{2\ n!}}[e^{i \phi_1 n}(\hat{a}^\dag)^n \pm e^{-i \phi_1 n}(\hat{b}^\dag)^n]\ket{0}\ket{0}$. Finally, after BS$_3$ we have the state $\frac{1}{\sqrt{2\ n!}} (e^{i\phi_1 n}\hat{A}^n \pm e^{-i\phi_1 n}\hat{B}^n)\ket{0}\ket{0}$, which is equal to $\frac{1}{2\sqrt{2\ n!}}(e^{i\phi_1 n} \pm e^{-i\phi_1 n})(\hat{A}^n + \hat{B}^n)\ket{0}\ket{0}+\frac{1}{2\sqrt{2\ n!}}(e^{i\phi_1 n} \mp e^{-i \phi_1 n})(\hat{A}^n - \hat{B}^n)\ket{0}\ket{0}$. This can also be rewritten as $(e^{i\phi_1 n}\pm e^{-i\phi_1 n})/2\ket{b_+}+(e^{i \phi_1 n} \mp e^{-i \phi_1 n})/2\ket{b_-}$. So the result of measuring the state of the atoms in cavities C$_3$ and C$_4$ will be $\ket{B_\pm}$ with probability $p_+=\cos(\phi_1n)^2$ and $\ket{B_\mp}$ with probability $p_-=\sin(\phi_1n)^2$. Since the state is again projected into one of the two states $\ket{b_\pm}$ we can repeat exactly the same calculations for all following steps. Whereas the first measurement result was completely random, all following measurement results depend on $n$ and the previous measurement outcome, i.e., with probability $p_i=\cos(\phi_i n)^2$ the $(i+1)$-th measurement result is the same as the $i$-th result, and with probability $\sin(\phi_i n)^2$ the measurement result changes and the state changes from $\ket{b_\pm}$ to $\ket{b_\mp}$. If the number of units is infinite (or sufficiently large) and we have chosen all phases equal as $\phi$, then we can guess from the relative frequency with which the measurement result has switched between $\ket{B_+}$ and $\ket{B_-}$ the number of photons with arbitrary precision for all photon numbers $n<\frac{\pi}{\phi}$. $n\approx \arccos(\sqrt{f})/\phi$, where $f=N_\textrm{same}/(N_\textrm{same}+N_\textrm{different})$ and $N_\textrm{same}$ ($N_\textrm{different}$) is the number of cases, where the measurement outcome is the same (not the same) as the previous measurement outcome. Measuring this relative frequency with a fixed small phase is not the optimal way to get the photon number. We propose instead the following. Let us use a setup with a total of $N+1$ units and choose the phases to be $\phi_i=2^{i-1} \pi/n_0$, $i=1,2,\ldots,N$, for an arbitrarily chosen value of $n_0 \in \mathbb{N}$ and let us calculate the probability $p(n)$ that the measurement results are all the same, \begin{equation}\label{pn} p(n)=\prod_{i=1}^N p_i=\prod_{i=0}^{N-1} \cos\left(\frac{2^i\pi}{n_0}n\right)^2. \end{equation} This probability is equal to one for all photon numbers that are a multiple of $n_0$ and goes to zero otherwise in the limit of infinitely many units of the setup. This way we can measure whether the photon number is a multiple of $n_0$. For example, for $n_0=3$ and $N+1=3$ we detect any state which is not a multiple of three with a probability of at least $q=93.75\%$, resp., $q=99.61\%$ for $N+1=5$, where \begin{equation}\label{q} q:=1-\max_{n\neq0,n_0,2n_0,\ldots}p(n). \end{equation} For $n_0=4$, already $N+1=3$ is sufficient to achieve $q=100\%$. For $n_0=5$ and $N+1=3$ we have $q=93.75\%$, which increases to $q=99.61\%$ for $N+1=5$. In Fig.~\ref{20photo} and \ref{100photo} we have shown $p(n)$ for $n_0=20$ and $n_0=100$. The number $N$ needed to get a good result typically scales logarithmical with $n_0$, e.g. for $n_0=1000$ already $N+1=11$ is enough to reach $q=99.95\%$. \begin{figure} \includegraphics[width=\columnwidth]{figure4} \caption{\label{20photo}(Color online) Probabilities $p(n)$ (Eq.~\eqref{pn}) for $n_0=20$ and $N+1=5$ resulting in $q=94.49\%$ (Eq.~\eqref{q}). For $N+1=7$, $q=99.66\%$.} \end{figure} \begin{figure} \includegraphics[width=\columnwidth]{figure5} \caption{\label{100photo}(Color online) Probabilities $p(n)$ for $n_0=100$ and $N+1=8$ resulting in $q=96.33\%$. For $N+1=10$, $q=99.95\%$.} \end{figure} Given an unknown state we can test all possible prime factors and powers of primes to identify the exact photon number. If, e.g., we have a state consisting of $0$ to $10$ photons the following factors have to be tested $n_0=2,3,4,5,7,8,9$ (where 2 does not need to be checked separately). 24 measurement results are sufficient to test all factors with a probability over $99\%$. If we require reliable photon number counting for $n$ ranging from $0$ to $n_\textrm{max}$, for large $n_\textrm{max}$, all primes and power of primes that are smaller than $n_\textrm{max}$ need to be tested. This number can be bounded from above by $n_\textrm{max}$. All $n_\textrm{max}$ tests are required to work with high probability. To this end each single test needs to succeed with a probability better than $q\geq 1-1/n_\textrm{max}$. It can be checked numerically that this is the case if $N=2 \log(n_\textrm{max})$, leading to a photon counting device with reliable photon detection up to $n_\textrm{max}$ using an array consisting of less than $2 n_\textrm{max} \log(n_\textrm{max})$ basic units. Note that this setup does not destroy the photonic input state but changes $\ket{n}\ket{0}$ randomly into $\frac{1}{\sqrt{2}}[\ket{n}\ket{0}\pm\ket{0}\ket{n}]$, i.e., the photons leave the setup in a superposition of all photons taking either the $\hat{a}$-beam or the $\hat{b}$-beam. This can not be changed back into $\ket{n}\ket{0}$ by means of passive optical elements. The output state - a so-called $N00N$ state - is, however, a very valuable resource for applications in quantum information protocols and quantum metrology \cite{NOON}. \subsection{Non-destructive number resolving detection scheme}\label{QNDScheme} For a non-demolition version of the photon number measurement we use the basic building block depicted in Fig.~\ref{block}. The atoms in the two upper cavities are initially prepared in an entangled state $\ket{\phi_+}=(\ket{{\uparrow}{\uparrow}}+\ket{{\downarrow}{\downarrow}})/\sqrt{2}$, and the atoms in the lower cavities are also prepared in the state $\ket{\phi_+}$. This can, for instance, be achieved via the parity measurement scheme suggested in \cite{parity}. During the interaction the upper and the lower atoms will stay in the subspace spanned by $\ket{\phi_\pm}=(\ket{{\uparrow}{\uparrow}} \pm \ket{{\downarrow}{\downarrow}})/\sqrt{2}$. The state changes between $\ket{\phi_+}$ and $\ket{\phi_-}$ each time one of the two entangled cavities interacts with an odd number of photons. As in the previous subsection we define $\ket{B_\pm}$ to handle the even and the odd case at the same time. For $n$ even, $\ket{B_+}=\ket{\phi_+}\ket{\phi_+}$ and $\ket{B_-}=\ket{\phi_-}\ket{\phi_-}$, while in the odd case we define $\ket{B_+}=\ket{\phi_-}\ket{\phi_+}$ and $\ket{B_-}=\ket{\phi_+}\ket{\phi_-}$. \begin{figure} \includegraphics[width=\columnwidth]{figure6} \caption{(Color online) Basic building block of the non-demolition photon number resolving detection scheme. The dashed circles and the wavy lines indicate the entanglement between the atoms in cavities C$_1$ and C$_3$ and between the atoms in cavities C$_2$ and C$_4$. The gray box is either a cavity or a mirror. (In the latter case, we may as well send the light directly from the cavities C$_3$ and C$_4$ to the first two cavities of the next block.)} \label{block} \end{figure} Using the same notation as before, the state is transformed as follows, when we go through the setup from left to right. The initial state is \begin{equation*} \ket{\psi_1}=\frac{1}{\sqrt{n!}} (\hat{a}^\dag)^n\ket{0}\ket{0}\ket{\phi_+}\ket{\phi_+}, \end{equation*} and after the first beam splitter we have the state \begin{equation*} \ket{\psi_2}=\frac{1}{\sqrt{n!}}\hat{A}^n\ket{0}\ket{0}\ket{\phi_+}\ket{\phi_+} =\frac{1}{\sqrt{2}}(\ket{b_+}+\ket{b_-})\ket{\phi_+}\ket{\phi_+}. \end{equation*} The interaction with the first two cavities leads to the state \begin{multline*} \ket{\psi_3}=\frac{1}{\sqrt{2}}\ket{b_+}\ket{B_+}+\frac{1}{\sqrt{2}}\ket{b_-}\ket{B_-}\\ =\frac{1}{2\sqrt{n!}}(\hat{A}^n+\hat{B}^n)\ket{0}\ket{0}\ket{B_+}\\ +\frac{1}{2\sqrt{n!}}(\hat{A}^n-\hat{B}^n)\ket{0}\ket{0}\ket{B_-}. \end{multline*} The second beam splitter transforms the state into \begin{multline*} \ket{\psi_4}=\frac{1}{2\sqrt{n!}}\big\{[(\hat{a}^\dag)^n+(\hat{b}^\dag)^n]\ket{0}\ket{0}\ket{B_+}\\ +[(\hat{a}^\dag)^n-(\hat{b}^\dag)^n]\ket{0}\ket{0}\ket{B_-}\big\}. \end{multline*} The two modes pick up a relative phase shift of $2 \phi_i n$ at the phase shifters so that \begin{multline*} \ket{\psi_5}=\frac{1}{2\sqrt{n!}} \big\{[e^{i\phi_i n}(\hat{a}^\dag)^n +e^{-i\phi_in}(\hat{b}^\dag)^n]\ket{0}\ket{0}\ket{B_+}\\ +[e^{i\phi_i n}(\hat{a}^\dag)^n -e^{-i\phi_i n}(\hat{b}^\dag)^n]\ket{0}\ket{0}\ket{B_-}\big\}. \end{multline*} After the third beam splitter we get \begin{multline*} \ket{\psi_6}=\frac{1}{2\sqrt{n!}}\big[(e^{i\phi_i n}\hat{A}^n+e^{-i\phi_i n}\hat{B}^n)\ket{0}\ket{0}\ket{B_+}\\ +(e^{i\phi_i n}\hat{A}^n-e^{-i\phi_i n}\hat{B}^n)\ket{0}\ket{0}\ket{B_-}\big]\\ =\frac{1}{\sqrt{2}}\cos(\phi_i n)\ket{b_+}\ket{B_+} +\frac{i}{\sqrt{2}}\sin(\phi_i n)\ket{b_-}\ket{B_+}\\ +\frac{i}{\sqrt{2}}\sin(\phi_i n)\ket{b_+}\ket{B_-} +\frac{1}{\sqrt{2}}\cos(\phi_i n)\ket{b_-}\ket{B_-}. \end{multline*} Note now that independent of whether $n$ is even or odd, the interaction with the last two cavities turns the states $\ket{b_\pm}\ket{B_\pm}$ into $\ket{b_\pm}\ket{\phi_+}\ket{\phi_+}$ and the states $\ket{b_\pm}\ket{B_\mp}$ into $\ket{b_\pm}\ket{\phi_-}\ket{\phi_-}$. The state is thus changed to \begin{multline*} \ket{\psi_7}= \frac{1}{\sqrt{2}}\cos(\phi_i n)\left(\ket{b_+}+\ket{b_-}\right)\ket{\phi_+}\ket{\phi_+}\\ +\frac{i}{\sqrt{2}}\sin(\phi_i n)\left(\ket{b_+}+\ket{b_-}\right)\ket{\phi_-}\ket{\phi_-}\\ =\frac{1}{\sqrt{n!}}\hat{A}^n\ket{0}\ket{0} \left[\cos(\phi_i n)\ket{\phi_+}\ket{\phi_+}+i\sin(\phi_i n)\ket{\phi_-}\ket{\phi_-}\right], \end{multline*} and after the last beam splitter we have \begin{multline*} \ket{\psi_8}=\frac{1}{\sqrt{n}}(\hat{a}^\dag)^n\ket{0}\ket{0}\\ \otimes\left[\cos(\phi_i n)\ket{\phi_+}\ket{\phi_+} +i\sin(\phi_i n)\ket{\phi_-}\ket{\phi_-}\right]. \end{multline*} Note that the photonic modes are now decoupled from the state of the atoms. The photons will continue after the final beam splitter unchanged in $\ket{n}\ket{0}$ while the atoms still contain some information about the photon number. Note that $\ket{\phi_+}=(\ket{++}+\ket{--})/\sqrt{2}$ and $\ket{\phi_-}=(\ket{+-}+\ket{-+})/\sqrt{2}$. By measuring all atoms in the $\ket{\pm}$ basis we can easily distinguish between $\ket{\phi_\pm}$ by the parity of the measurements. The probability to obtain $\ket{\phi_+}\ket{\phi_+}$ is $\cos(\phi n)^2$, and the probability to get $\ket{\phi_-}\ket{\phi_-}$ is $\sin(\phi n)^2$. After the measurement, all photons are found in the $\hat{a}$ beam for both outcomes. The probability for measuring $\ket{\phi_+}\ket{\phi_+}$ is the same as the changing probability in the previous setup such that we can do the same with a chain of the demolition free block. If we prefer also to get the parity information in each step, we can add an additional cavity at the end of each block as shown in Fig.~\ref{block}. More generally, the demolition free element leaves photonic input states $\ket{\psi}=\frac{1}{\sqrt{n!q!} } (\hat{a}^\dag)^n(\hat{b}^\dag)^q \ket{0}\ket{0}$, where $n$ photons enter through the lower and $q$ photons enter through the upper port, unchanged. A calculation analogous to the previous one shows that one obtains the atomic states $\ket{\phi_+}\ket{\phi_+}$ and $\ket{\phi_-}\ket{\phi_-}$ with probabilities $ \cos(\phi_i (n-q))^2$ and $\sin(\phi_i (n-q))^2$ respectively. This way, we can test for photon number differences $n-q$ in two input states in the same fashion as for photon numbers in a single input beam described above. Similarly, one can project two coherent input states $\ket{\alpha}\ket{\alpha}$ onto generalized photon-number correlated states $\sum_n c_n\ket{n}\ket{n-d}$ with fixed photon number difference $d=0,1,2$.... In a realistic scenario we may be faced with photon losses. Both setups have a built-in possibility to detect loss of one photon. In the first case we get the parity of the total number of photons in every single measurement of a pair of atoms. If this parity changes at some place in the chain then we know that we lost at least one photon. In the demolition free setup the valid measurement results are restricted to $\ket{\phi_+}\ket{\phi_+}$ and $\ket{\phi_-}\ket{\phi_-}$. If we measure $\ket{\phi_-}\ket{\phi_+}$ or $\ket{\phi_+}\ket{\phi_-}$ we know that we lost a photon in between the two pairs of cavities. In addition, the optional cavity at the end of each block provides an extra check for photon loss. \section{Filtering out losses}\label{Purification} We next investigate the possibility to use a comparison of the number of photons in the two modes to detect a loss. As in Sec.~\ref{Filter}, we start with the input state $|\psi_{\textrm{in}}\rangle=|\alpha\rangle|\alpha\rangle$ and use the proposed setup to project it onto the subspace $S$. We then use two beam splitters with reflectivity $R$ to model a fractional loss in both modes. After tracing out the reflected field, we finally use the proposed setup once more to project the state onto $S$. In Fig.~\ref{recover}, we plot the fidelity between the state obtained after the first projection onto $S$ and the state obtained after the second projection onto $S$, the probability that the second projection is successful given that the first is successful, and the purity of the state after the second projection. The second projection is seen to recover the state obtained after the first projection with a fidelity close to unity even for losses of a few percent. This is the case because a loss of only one photon will always lead to a failure of the second conditional projection. The main contribution to the fidelity decrease for small $R$ is thus a simultaneous loss of one photon from both modes. It is also interesting to note that the final state is actually pure for all values of $R$, which is a consequence of the particular choice of input state. Finally, we note that a single unit is sufficient to detect loss of a single photon, and for small $R$ we thus only need to use one unit for the second projection in practice. \begin{figure} \includegraphics[width=\columnwidth]{figure7} \caption{\label{recover}(Color online) Projecting the input state $|\psi_{\textrm{in}}\rangle=|\alpha\rangle|\alpha\rangle$ onto the subspace $S$ followed by a fractional loss $R$ in both modes and a second projection onto $S$, the figure shows the fidelity between the states obtained after the first and the second projection onto $S$, the probability that the second projection is successful given that the first is successful, and the purity of the state after the second projection for two different values of $|\alpha|^2$.} \end{figure} Let us also consider a four mode input state $|\psi_{\textrm{in}}\rangle=|\alpha\rangle|\alpha\rangle|\alpha\rangle|\alpha\rangle$. As before we use the setup to project this state onto the subspace spanned by the state vectors $|n\rangle|n\rangle|n\rangle|n\rangle$, $n=0,1,2,\ldots$. We then imagine a fractional loss of $R$ to take place in all modes. If two of the modes are on their way to Alice and the two other modes are on their way to Bob, we can only try to recover the original projection by projecting the former two modes onto $S$ and the latter two modes onto $S$. The results are shown in Fig.~\ref{loss}, and again the curves showing the fidelity and the purity are seen to be very flat and close to unity for small losses. This scheme allows one to distribute entanglement with high fidelity, but reduced success probability. \begin{figure} \includegraphics[width=\columnwidth]{figure8} \caption{\label{loss}(Color online) Projecting the input state $|\psi_{\textrm{in}}\rangle=|\alpha\rangle|\alpha\rangle|\alpha\rangle|\alpha\rangle$ onto the subspace spanned by the vectors $|n\rangle|n\rangle|n\rangle|n\rangle$, $n=0,1,2,\ldots$, followed by a fractional loss $R$ in all four modes and a projection of modes 1 and 2 onto $S$ and of modes 3 and 4 onto $S$, the figure shows the fidelity between the states obtained after the first and the second set of projections, the probability that the projections onto $S$ are successful given that the first projection is successful, and the purity of the state after the projections onto $S$ for two different values of $|\alpha|^2$.} \end{figure} \section{Deviations from ideal behavior}\label{Nonideal} So far we have considered the ideal limit of infinitely long pulses and an infinitely strong coupling. In this section, we use a more detailed model of the interaction of the light field with an atom in a cavity to investigate how long the input pulses need to be and how large the single atom cooperativity parameter should be to approximately achieve this limit. \subsection{Optimal input mode function} The backreflection of light in a cavity leads to a state dependent distortion of the shape of the mode function of the input field, and to study this effect in more detail we concentrate on a single cavity as shown in Fig.~\ref{cavity} in the following. For simplicity, we assume the input field to be a continuous coherent state \cite{blow} \begin{equation}\label{cont} |\{\alpha_{\textrm{in}}(t)\}\rangle=\exp\left[\int\alpha_{\textrm{in}}(t)\hat{a}^\dag(t)dt -\int\alpha_{\textrm{in}}^*(t)\hat{a}(t)dt\right]|0\rangle \end{equation} with mode function $f_{\textrm{in}}(t)=\alpha_{\textrm{in}}(t)/\alpha$, where $|\alpha|^2=\int|\alpha_{\textrm{in}}(t)|^2dt$ is the expectation value of the total number of photons in the input beam. The light-atom interaction is governed by the Hamiltonian \begin{equation} H=\hbar g(\hat{c}^\dag\sigma+\sigma^\dag\hat{c}), \quad\sigma:=|{\uparrow}\rangle\langle e| \end{equation} and the decay term \begin{equation} \mathcal{L}\rho=\frac{\Gamma}{2}(2\sigma\rho\sigma^\dag-\sigma^\dag\sigma\rho-\rho\sigma^\dag\sigma), \end{equation} where $g$ is the light-atom coupling strength, $\hat{c}$ is the annihilation operator of the cavity field, $\Gamma$ is the decay rate of the excited state of the atom due to spontaneous emission, and $\rho$ is the density operator representing the state of the atom and the cavity field. For $g^2\textrm{Tr}(\hat{c}^\dag\hat{c}\langle{\uparrow}|\rho|{\uparrow}\rangle)\ll(\Gamma/2)^2$, where $\textrm{Tr}$ denotes the trace, the population in the excited state of the atom is very small, and we may eliminate this state adiabatically. This reduces the effective light-atom interaction dynamics to a single decay term \begin{equation} \frac{2g^2}{\Gamma}\left(2\hat{c}|{\uparrow}\rangle \langle{\uparrow}|\rho|{\uparrow}\rangle\langle{\uparrow}|\hat{c}^\dag -\hat{c}^\dag\hat{c}|{\uparrow}\rangle\langle{\uparrow}|\rho -\rho|{\uparrow}\rangle\langle{\uparrow}|\hat{c}^\dag\hat{c}\right), \end{equation} i.e., the atom is equivalent to a beam splitter which reflects photons out of the cavity at the rate $4g^2/\Gamma$ if the atom is in the state $|{\uparrow}\rangle$ and does not affect the light field if the atom is in the state $|{\downarrow}\rangle$. Assume the atom to be in the state $|j\rangle$, $j\in\{{\downarrow},{\uparrow}\}$. Since the input mirror of the cavity may be regarded as a beam splitter with high reflectivity, all components of the setup transform field operators linearly. For a coherent state input field, the cavity field and the output field are hence also coherent states. We may divide the time axis into small segments of width $\tau$ and approximate the integrals in \eqref{cont} by sums. The input state is then a direct product of single mode coherent states with amplitudes $\alpha_{\textrm{in}}(t_k)\sqrt{\tau}$ and annihilation operators $\hat{a}(t_k)\sqrt{\tau}$, where $t_k=k\tau$, $k=0,\pm1,\pm2,\ldots$. In the following, we choose $\tau$ to be equal to the round trip time of light in the cavity, which requires $\alpha_{\textrm{in}}(t)$ to vary slowly on that time scale. Denoting the coherent state amplitude of the cavity field at time $t$ by $\gamma_j(t)$, we use the beam splitter transformation \begin{eqnarray}\label{bst} \bigg[\textrm{out}\bigg]=\bigg[\begin{array}{cc}t_c&-r_c\\r_c&t_c\end{array}\bigg] \bigg[\textrm{in}\bigg] \end{eqnarray} for the input mirror of the cavity to derive \begin{eqnarray} \gamma_j(t)&=&t_c\sqrt{\tau}\alpha_{\textrm{in}}(t)+r_ct_j\gamma_j(t-\tau),\label{gamma}\\ \sqrt{\tau}\alpha^{(j)}_{\textrm{out}}(t)&=&r_c\sqrt{\tau} \alpha_{\textrm{in}}(t)-t_ct_j\gamma_j(t-\tau)\label{out}, \end{eqnarray} where $r_c^2=1-t_c^2$ is the reflectivity of the input mirror of the cavity, $t_j^2$ is the transmissivity of the beam splitter, which models the loss due spontaneous emission, i.e., $t_j^2=1-4g^2\tau\delta_{j{\uparrow}}/\Gamma$, and $\alpha^{(j)}_{\textrm{out}}(t)$ denotes the output field from the cavity. We have here included an additional phase shift of $\pi$ per round trip in the cavity to ensure the input field to be on resonance with the cavity, i.e., the second element of the input vector in \eqref{bst} is $-t_j\gamma(t-\tau)$. Taking the limit $\tau\rightarrow0$ and $t_c^2\rightarrow0$ for fixed cavity decay rate $\kappa:=t_c^2/\tau$, \eqref{gamma} and \eqref{out} reduce to \begin{eqnarray} \frac{d\gamma_j(t)}{dt}&=&-\left(1+2C\delta_{j{\uparrow}}\right)\frac{\kappa}{2}\gamma_j(t) +\sqrt{\kappa}\alpha_{\textrm{in}}(t),\label{gammaeq}\\ \alpha^{(j)}_{\textrm{out}}(t)&=&\alpha_{\textrm{in}}(t)-\sqrt{\kappa}\gamma_j(t)\label{inout}, \end{eqnarray} where $C:=2g^2/(\kappa\Gamma)$ is the single atom cooperativity parameter. According to the steady state solution of \eqref{gammaeq} \begin{equation}\label{ss} \gamma_j(t)=\frac{1}{1+2C\delta_{j{\uparrow}}}\frac{2\alpha_{\textrm{in}}(t)}{\sqrt{\kappa}}, \end{equation} we need $C\gg1$ to efficiently expel the light field from the cavity for $j={\uparrow}$. We should also remember the criterion for the validity of the adiabatic elimination, which by use of \eqref{ss} takes the form \begin{equation} 1\gg\frac{4C}{(1+2C)^2}\frac{2|\alpha_{\textrm{in}}(t)|^2}{\Gamma} \approx\frac{\kappa|\alpha_{\textrm{in}}(t)|^2}{g^2}, \end{equation} i.e., for $C\gg1$ the average flux of photons in the input beam should not significantly exceed the average number of photons emitted spontaneously per unit time from an atom, which has an average probability of one half to be in the excited state. Solving \eqref{gammaeq}, \begin{equation}\label{gammat} \gamma_j(t)=\sqrt{\kappa}\int_{-\infty}^te^{-(1+2C\delta_{j{\uparrow}}) \kappa(t-t')/2}\alpha_{\textrm{in}}(t')dt', \end{equation} we obtain the output field $\alpha^{(j)}_{\textrm{out}}(t)=\alpha f^{(j)}_{\textrm{out}}(t)$ with \begin{equation}\label{fout} f^{(j)}_{\textrm{out}}(t)=f_{\textrm{in}}(t)- \kappa\int_{-\infty}^te^{-(1+2C\delta_{j{\uparrow}})\kappa(t-t')/2}f_{\textrm{in}}(t')dt'. \end{equation} Note that $f^{(j)}_{\textrm{out}}(t)$ is not necessarily normalized due to the possibility of spontaneous emission. The ideal situation is $f^{(\uparrow)}_{\textrm{out}}(t)=f_{\textrm{in}}(t)$ and $f^{(\downarrow)}_{\textrm{out}}(t)=-f_{\textrm{in}}(t)$, and we would thus like the norm of \begin{equation} E_j:=1+(-1)^{\delta_{j{\uparrow}}}\int_{-\infty}^{\infty}f^*_{\textrm{in}}(t) f^{(j)}_{\textrm{out}}(t)dt \end{equation} to be as small as possible. For $j={\uparrow}$ and $C\gg1$, the exponential function in \eqref{fout} is practically zero unless $\kappa(t-t')\ll1$, and as long as $f_{\textrm{in}}(t)$ changes slowly on the time scale $(C\kappa)^{-1}$, we may take $f_{\textrm{in}}(t)$ outside the integral to obtain $f^{(\uparrow)}_{\textrm{out}}(t)=(1-2/(1+2C))f_{\textrm{in}}(t)$ and $E_{\uparrow}=2/(1+2C)\approx C^{-1}$. As this result is independent of $f_{\textrm{in}}(t)$, a natural criterion for the optimal choice of input mode function is to minimize \begin{equation} |E_{\downarrow}|=\left|2-\kappa\int_{-\infty}^{\infty}\int_{-\infty}^t e^{-\kappa(t-t')/2}f^*_{\textrm{in}}(t)f_{\textrm{in}}(t')dt'dt\right| \end{equation} under the constraint $\int_{-\infty}^{\infty}f^*_{\textrm{in}}(t)f_{\textrm{in}}(t)dt=1$. We also restrict $f_{\textrm{in}}(t)$ to be zero everywhere outside the time interval $[-T/2,T/2]$. Since we would like the double integral to be as close to 2 as possible, we should choose $f^*_{\textrm{in}}(t)=f_{\textrm{in}}(t)$. A variational calculation then provides the optimal solution \begin{equation}\label{mode} f_{\textrm{in}}(t)=\left\{\begin{array}{cl} A\cos(\omega_0t)&\textrm{for }t\in[-T/2,T/2]\\ 0&\textrm{otherwise} \end{array} \right., \end{equation} where \begin{equation} A=\left(\frac{2}{T+\sin(\omega_0T)/\omega_0}\right)^{1/2}, \end{equation} \begin{equation} \frac{2\omega_0}{\kappa}\tan\left(\frac{\omega_0T}{2}\right)=1, \end{equation} and $\omega_0T\in[0,\pi[$. \begin{figure} \includegraphics[width=\columnwidth]{figure9} \caption{\label{optmode}Deviation $E_j=1+(-1)^{\delta_{j\uparrow}}\int f^*_{\textrm{in}}(t)f^{(j)}_{\textrm{out}}(t)dt$ of the overlap between the output mode function and the input mode function from the ideal value when the atom is in the state $|j\rangle$. Note that $f^{(j)}_{\textrm{out}}(t)$ is defined such that the norm is less than unity if a loss occurs during the interaction. The single atom cooperativity parameter is assumed to be $C=10^3$. Solid lines are for the optimal input mode function given in \eqref{mode}, and dashed lines are for an input mode function, which is constant in the interval $t\in[-T/2,T/2]$ and zero otherwise. The inset illustrates these functions for $\kappa T=300$. For $j=\uparrow$, the shape of the output mode function is almost the same as the shape of the input mode function as long as $\kappa T\gg C^{-1}$, but the norm is slightly decreased due to spontaneous emission from the atom such that $E_{\uparrow}\approx C^{-1}$. This result is independent of the actual shape of the input mode function, and the solid and dashed lines for $E_{\uparrow}$ are hence indistinguishable in the figure. The results for $E_{\downarrow}$ are independent of $C$, because the light field does not interact with the atom in this case. Nonzero values of $E_{\downarrow}$ only occur due to distortion of the shape of the mode function. For $\kappa T\gg1$, $E_{\downarrow}\approx8\pi^2/(\kappa T)^2$ for the optimal input mode function and $E_{\downarrow}\approx4/(\kappa T)$ for the constant mode function.} \end{figure} This solution gives \begin{equation} E_{\downarrow}=\frac{2x^2}{1+x^2}=2\cos^2\left(\frac{\omega_0T}{2}\right),\quad x:=\frac{2\omega_0}{\kappa}. \end{equation} For fixed $\kappa$, $\omega_0$ is a decreasing function of $T$, and for $\kappa T\gg2\pi$, $\omega_0\approx\pi/T$ and $E_{\downarrow}\approx8\pi^2/(\kappa T)^2$. Distortion of the input mode function can thus be avoided by choosing a sufficiently long input pulse. This may be understood by considering the Fourier transform of the input mode function. For a very short pulse the frequency distribution is very broad and only a small part of the field is actually on resonance with the cavity, i.e., most of the field is reflected without entering into the cavity. For a very long pulse, on the other hand, the frequency distribution is very narrow and centered at the resonance frequency of the cavity. $E_j$ is plotted in Fig.~\ref{optmode} as a function of $T$ both for the optimal input mode function and an input mode function, which is constant in the interval $[-T/2,T/2]$. The optimal input mode function is seen to provide a significant improvement. In fact, for the constant input mode function $E_{\downarrow}=4[1-\exp(-\kappa T/2)]/(\kappa T)$, and hence $E_{\downarrow}$ scales only as $(\kappa T)^{-1}$ for large $\kappa T$. Finally, we note that $\tau=t_c^2/\kappa<\kappa^{-1}$, and $\kappa T\gg1$ thus also ensures $\tau/T\ll1$, which justifies the approximation in Eqs.~\ref{gammaeq} and \ref{inout}. \subsection{Single atom cooperativity parameter}\label{cooperativity} We would like to determine how a single unit of the setup transforms the state of the field, when we use the full multi-mode description. For this purpose it is simpler to work in frequency space, and we thus use the definition of the Fourier transform $f(\omega)=\int f(t)\exp(-i\omega t)dt/\sqrt{2\pi}$ on Eqs.~\eqref{gammat} and \eqref{fout} to obtain \begin{eqnarray} \gamma_j(\omega)&=&\frac{\sqrt{\kappa}}{(1+2C\delta_{j{\uparrow}})\kappa/2+i\omega} \alpha_{\textrm{in}}(\omega),\label{gammao}\\ \alpha^{(j)}_{\textrm{out}}(\omega)&=&K_j(\omega)\alpha_{\textrm{in}}(\omega),\label{tfield} \end{eqnarray} where \begin{equation}\label{Kj} K_j(\omega):=-\frac{(1-2C\delta_{j{\uparrow}})\kappa/2-i\omega} {(1+2C\delta_{j{\uparrow}})\kappa/2+i\omega}. \end{equation} Assume now that the density operator of the two-beam input field to the unit may be written on the form \begin{multline}\label{rhoin} \rho_{\textrm{in}}=\sum_n\sum_mc_{nm}|\{\alpha_n(\omega)\}\rangle\langle\{\alpha_m(\omega)\}|\\ \otimes|\{\beta_n(\omega)\}\rangle\langle\{\beta_m(\omega)\}|, \end{multline} where $n$ and $m$ are summed over the same set of numbers and $|\{\alpha_n(\omega)\}\rangle$ and $|\{\beta_n(\omega)\}\rangle$ are continuous coherent states in frequency space, i.e., \begin{multline}\label{ccs} |\{\alpha_n(\omega)\}\rangle=\exp\bigg[\int\alpha_n(\omega)\hat{a}^\dag(\omega)d\omega\\ -\int\alpha_n^*(\omega)\hat{a}(\omega)d\omega\bigg]|0\rangle \end{multline} and similarly for $|\{\beta_n(\omega)\}\rangle$. Note that \eqref{ccs} and \eqref{cont} are consistent when $\alpha_n(\omega)$ and $\alpha_n(t)$ as well as $\hat{a}(\omega)$ and $\hat{a}(t)$ are related through a Fourier transform \cite{blow}. After the first 50:50 beam splitter, the input state is transformed into \begin{multline} \rho'=\sum_n\sum_mc_{nm} \left|\left\{(\alpha_n(\omega)+\beta_n(\omega))/\sqrt{2}\right\}\right\rangle\\ \left\langle\left\{(\alpha_m(\omega)+\beta_m(\omega))/\sqrt{2}\right\}\right|\\ \otimes\left|\left\{(\beta_n(\omega)-\alpha_n(\omega))/\sqrt{2}\right\}\right\rangle\\ \left\langle\left\{(\beta_m(\omega)-\alpha_m(\omega))/\sqrt{2}\right\}\right|, \end{multline} and this is the input state to the two cavities. The initial state of the two atoms is \begin{equation} \rho_{\textrm{at}}=\frac{1}{4}\sum_{i\in\{\downarrow,\uparrow\}} \sum_{j\in\{\downarrow,\uparrow\}}\sum_{p\in\{\downarrow,\uparrow\}} \sum_{q\in\{\downarrow,\uparrow\}} |i\rangle\langle p|\otimes|j\rangle\langle q|. \end{equation} We thus need to know how one of the cavities transforms a term like $|\alpha_{\textrm{in},n}(\omega)\rangle\langle\alpha_{\textrm{in},m}(\omega)|\otimes|i\rangle\langle p|$. We saw in the last subsection that a cavity is equivalent to an infinite number of beam splitter operations applied to the cavity mode and the input field modes. To take the possibility of spontaneous emission into account, we also apply a beam splitter operation to the cavity mode and a vacuum mode in each time step and subsequently trace out the vacuum mode. As the beam splitters are unitary operators acting from the left and the right on the density operator, the field amplitudes are transformed according to \eqref{tfield} as before, but when the ket and the bra are different, the trace operations lead to a scalar factor. Since the reflectivity of the beam splitter modeling the loss is $2C\kappa\tau\delta_{j\uparrow}$ for an atom in the state $|j\rangle$, this factor is \begin{multline} d_{ip}[\alpha_{\textrm{in},n}(\omega),\alpha_{\textrm{in},m}(\omega)]\\ =\prod_{k=-\infty}^\infty\langle\sqrt{2C\kappa\tau}\gamma_{m,p}(k\tau)\delta_{p\uparrow}| \sqrt{2C\kappa\tau}\gamma_{n,i}(\kappa\tau)\delta_{i\uparrow}\rangle\\ =\exp\bigg\{-\int_{-\infty}^{\infty}\frac{C\kappa^2}{(1+2C)^2(\kappa/2)^2+\omega^2} \big[|\alpha_{\textrm{in},n}(\omega)|^2\delta_{i\uparrow}\\ +|\alpha_{\textrm{in},m}(\omega)|^2\delta_{p\uparrow} -2\alpha_{\textrm{in},n}(\omega)\alpha^*_{\textrm{in},m} (\omega)\delta_{i\uparrow}\delta_{p\uparrow}\big]d\omega\bigg\}, \end{multline} where $\gamma_{n,i}(t)$ is the amplitude of the cavity field corresponding to the input field $\alpha_{\textrm{in},n}(t)$ and the atomic state $|i\rangle$ as given in Eq.~\eqref{gammat}. Altogether, $|\alpha_{\textrm{in},n}(\omega)\rangle\langle\alpha_{\textrm{in},m}(\omega)| \otimes|i\rangle\langle p|$ is thus transformed into $d_{ip}[\alpha_{\textrm{in},n}(\omega),\alpha_{\textrm{in},m}(\omega)] |K_i(\omega)\alpha_{\textrm{in},n}(\omega)\rangle \langle K_p(\omega)\alpha_{\textrm{in},m}(\omega)| \otimes|i\rangle\langle p|$. Projecting both atoms onto $(|{\uparrow}\rangle+|{\downarrow}\rangle)/2$ and taking the final 50:50 beam splitter into account, we obtain the output state after one unit \begin{widetext} \begin{multline}\label{rhoout} \rho_{\textrm{out}}=\sum_n\sum_m\sum_{i\in\{\downarrow,\uparrow\}}\sum_{j\in\{\downarrow,\uparrow\}} \sum_{p\in\{\downarrow,\uparrow\}}\sum_{q\in\{\downarrow,\uparrow\}}\frac{1}{16}c_{nm} d_{ip}[(\alpha_n(\omega)+\beta_n(\omega))/\sqrt{2},(\alpha_m(\omega)+\beta_m(\omega))/\sqrt{2}]\\ \times d_{jq}[(\beta_n(\omega)-\alpha_n(\omega))/\sqrt{2},(\beta_m(\omega)-\alpha_m(\omega))/\sqrt{2}]\\ \times\left|\left\{\frac{1}{2}(K_i+K_j)\alpha_n(\omega) +\frac{1}{2}(K_i-K_j)\beta_n(\omega)\right\}\right\rangle \left\langle\left\{\frac{1}{2}(K_p+K_q)\alpha_m(\omega) +\frac{1}{2}(K_p-K_q)\beta_m(\omega)\right\}\right|\\ \otimes\left|\left\{\frac{1}{2}(K_i+K_j)\beta_n(\omega) +\frac{1}{2}(K_i-K_j)\alpha_n(\omega)\right\}\right\rangle \left\langle\left\{\frac{1}{2}(K_p+K_q)\beta_m(\omega) +\frac{1}{2}(K_p-K_q)\alpha_m(\omega)\right\}\right|, \end{multline} \end{widetext} where we have written $K_i=K_i(\omega)$ for brevity. A subsequent phase shifter is easily taken into account by multiplying the coherent state amplitudes by the appropriate phase factors. We note that the result has the same form as the input state \eqref{rhoin} if we collect $n$, $i$, and $j$ into one index and $m$, $p$, and $q$ into another index. We can thus apply the transformation repeatedly to obtain the output state after $N+1$ units of the setup. \begin{figure}[b] \hspace{0.15\textwidth} \includegraphics[width=\columnwidth]{figure10} \caption{\label{finiteC}(Color online) Fidelity as defined in \eqref{FN} as a function of the single atom cooperativity parameter $C$ for different values of the expectation value of the number of photons in one of the input modes and different numbers of units of the setup, assuming $\kappa T\gg1$ and $\rho_{\textrm{in}}=|\alpha\rangle\langle\alpha|\otimes|\alpha\rangle\langle\alpha|$. The dotted lines are the asymptotes for $C\rightarrow\infty$.} \end{figure} If we assume $\alpha_n(\omega)$ and $\beta_m(\omega)$ to have the same shape for all $n$ and $m$, the output field simplifies to a two-mode state for $\kappa T\gg1$ as expected. This may be seen as follows. When $T$ is much larger than $\kappa^{-1}$, the width of the distribution $\alpha_n(\omega)$ in frequency space is much smaller than $\kappa$. For the relevant frequencies we thus have $\omega\ll\kappa/2$, and in this case the right hand side of \eqref{Kj} reduces to $-(1-2C\delta_{j{\uparrow}})/(1+2C\delta_{j{\uparrow}})$, i.e., $K_j$ is independent of frequency, and the amplitudes of all the continuous coherent states of the output density operator are proportional to $\alpha_n(\omega)$. In Fig.~\ref{finiteC}, we have used \eqref{rhoout} in the limit $\kappa T\gg1$ to compute the fidelity \eqref{FN} as a function of the single atom cooperativity parameter for $\rho_{\textrm{in}}=|\alpha\rangle\langle\alpha|\otimes|\alpha\rangle\langle\alpha|$. The ideal values for $C\rightarrow\infty$ are also shown, and the deviations are seen to be very small for $C$ larger than about $10^3$. Current experiments have demonstrated single atom cooperativity parameters on the order of $10^2$ \cite{strongcoupling1,strongcoupling2,strongcoupling3}, and high fidelities can also be achieved for this value. When $C$ is finite, there is a relative photon loss of $1-\int|f^{({\uparrow})}_\textrm{out}(t)|^2dt\approx2/C$ due to spontaneous emission each time the field interacts with a cavity containing an atom in the state $|{\uparrow}\rangle$. We note, however, that the setup is partially robust against such losses because the next unit of the setup removes all components of the state for which a single photon has been lost. \section{Conclusion}\label{Conclusion} The setup put forward and studied in this article acts in many respects like a photon number filter and has several attractive applications for quantum technologies. Based on the ability to distinguish even and odd photon numbers using the interaction of the light field with a high finesse optical cavity, photonic two mode input states can be projected onto photon-number correlated states. Naturally, this protocol is very well suited to detect losses and can in particular be adapted to purify photon-number entangled states in quantum communication. We studied deviations from ideal behavior such as finite length of the input pulses and limited coupling to estimate for which parameters the idealized description is valid. The setup can be modified such that it is capable to perform a quantum-non-demolition measurement of photon numbers in the optical regime. The non-destructive photon counting device completes the versatile toolbox provided by the proposed scheme. \begin{acknowledgments} We acknowledge valuable discussions with Ignacio Cirac and Stefan Kuhr and support from the Danish Ministry of Science, Technology, and Innovation, the Elite Network of Bavaria (ENB) project QCCC, the EU projects SCALA, QAP, COMPAS, the DFG-Forschungsgruppe 635, and the DFG Excellence Cluster MAP. \end{acknowledgments}
\section{Figures} \begin{figure}[hbt] \begin{center}\includegraphics[scale=0.7, angle=0]{Figure1.eps} \caption{The current stability diagram at 300 mK. The energy $E_G$ consists of the gate voltage $V_G$ times the coupling constant $\alpha=1.428$. The n-MOSFET manifests a quantum dot behaviour, which reveals the formation of an electron island in the Silicon channel starting from the $N_{QD}=0$ state.} \label{fig:Figure1} \end{center} \end{figure} \begin{figure}[hbt] \begin{center}\includegraphics[scale=0.5, angle=0]{Figure2.eps} \caption{Model of a n-MOSFET at cryogenic temperature with a paramegnatic trap close to the $Si/SiO_2$ interface: the current flows by sequential tunelling through the island formed in the Silicon channel. The current fluctuates between two levels according to the charge occupation of the interface defect which captures and emits an electron at one of the two separated two-dimensional systems between the central island and the corresponding contact. } \label{fig:Figure2} \end{center} \end{figure} \begin{figure}[hbt] \begin{center}\includegraphics[scale=0.8, angle=0]{Figure3.eps} \caption{The relative occupation $\tau_e / \tau_c$ versus the inverse of the nominal temperature $1/T$. We demonstrate that in our sample the detailed balance holds down to the nominal value of 600 mK. The sample was operated at $V_G$=495.4 mV and $V_d$=-9 mV and it carried a current of about 15 nA. Inlet: the current switching as function of time at the lowest temperature. The current shift $\Delta I$ is 0.9 nA. } \label{fig:Figure3} \end{center} \end{figure} \begin{figure}[hbt] \begin{center}\includegraphics[scale=0.8, angle=0]{Figure4.eps} \caption{Magnetic field dependence of $\tau_c/\tau_e$. The deviation from a pure exponential trend reveals the formation of a triplet state at sufficiently high field. The generalized temperature extracted from the experimental data is $T_{fit}=0.80(1)$ K. } \label{fig:Figure4} \end{center} \end{figure} \end{document}
\section{Introduction} It is now well established that the intracluster medium (ICM) of galaxy clusters is not only composed of thermal gas emitting in the X-ray energy band, but also of magnetic fields permeating the entire cluster volume (see Ferrari et al., 2008 for a recent review). This is directly demonstrated by the detection of large, diffuse synchrotron radio sources such as radio halos and radio relics, in an increasing number of galaxy clusters (see e. g. Venturi et al. 2008, Giovannini et al. 2009). In these clusters it is possible to estimate the average ICM magnetic field under the minimum energy hypothesis (which is very close to equipartition conditions) or by studying the Inverse Compton hard X-ray emission (e.g. Fusco Femiano et al. 2004).\\ The ICM magnetic field is also revealed by the analysis of polarized emission of radio sources located at different projected distances with respect to the cluster center. The interaction of the ICM, a magneto-ionic medium, with the linearly polarized synchrotron emission results in a rotation of the wave polarization plane (Faraday Rotation), so that the observed polarization angle, $\Psi_{obs}$ at a wavelength $\lambda$ differs from the intrinsic one, $\Psi_{int}$ according to: \begin{equation} \label{eq:psiRM} \Psi_{obs}(\lambda) = \Psi_{int}+\lambda^2 \times RM, \end{equation} where RM is the Faraday Rotation Measure. This is related to the magnetic field component along the line-of-sight ($B_{//}$) weighted by the thermal gas density ($n_e$) according to: \begin{equation} \label{eq:RM} RM \propto \int_{los}n_e(l) B_{//}(l) dl. \end{equation} Therefore, once the thermal gas density distribution is inferred from X-ray observations, RM studies give an additional set of information about the cluster magnetic field. This is the only way, so far, to study the intracluster magnetic field in clusters where diffuse radio emission sources are not directly observed.\\ The Coma cluster magnetic field has been studied in the past using all three approaches mentioned above. The first investigation of the magnetic field was performed by Kim et al. (1990). They analyzed 18 bright radio-sources in the Coma cluster region, obtaining RM maps at $\sim 20 ''$ ($\sim$ 9.2 kpc) resolution and found a significant enhancement of the RM in the inner parts of the cluster. Assuming a simple model for the magnetic field reversal length, they derived a field strength of $\sim$ 2 $\,mu$G. A complimentary study was performed by Feretti et al. (1995) studying the polarization properties of the extended radio galaxy NGC 4869. From the average value of RM and its dispersion across the source, they deduced a magnetic field of $\sim$6 $\mu$G tangled on scales of $\sim$ 1 kpc, in addition to a weaker magnetic field component of $\sim$0.2 $\mu$G , uniform on a cluster core radius scale.\\ From the Coma radio halo, assuming equipartition, a magnetic field estimate of $\sim 0.7-1.9$ $\mu$G is derived (Thierbach et al. 2003), while from the Inverse Compton hard X-ray emission a value of $\sim$0.2 $\mu$G has been derived by Fusco Femiano et al. (2004), although new hard X-ray observations performed with a new generation of satellites did not find such evidence of non-thermal emission (Wik et al. 2009 using XMM and Suzaku data, Lutovinov et al. 2008 using ROSAT, RXTE and INTEGRAL data, Ajello et al. 2009 using XMM-Newton, Swift/XRT, Chandra and BAT data; see Sec. \ref{sec:comparison}). \\ However, the discrepancy between these values is not surprising: equipartition and IC estimates, in fact, rely on several assumptions, and are cluster volume averaged estimates, while the RM is sensitive to the local structures of both the thermal plasma and the cluster magnetic field component that is parallel to the line of sight. Furthermore, the equipartition estimate should be used with caution, given the number of underlying assumptions. For example, it depends on the poorly known particle energy distribution, and in particular on the low energy cut-off of the emitting electrons (see e. g. Beck \& Krause 2005).\\ These different estimates provide direct evidence of the complex structure of the cluster magnetic field and show that magnetic field models where both small and large scale structure coexist must be considered. The intracluster magnetic field power spectrum has been investigated in several works (Vogt \& Ensslin 2003, 2005; Murgia et al., 2004; Govoni et al. 2006, Guidetti et al. 2008, Laing et al. 2008). In addition, a radial decline of the magnetic field strength is expected from magneto-hydrodynamical simulations performed with different codes (Dolag et al. 1999, 2005; Brueggen et al. 2005, Dubois et al. 2008, Collins et al. 2009, Dolag \& Stasyszyn 2008, Donnert et al. 2009a), as a result of the compression of thermal plasma during the cluster gravitational collapse.\\ In this paper we present a new study of the Coma cluster magnetic field. We analyzed new Very Large Array (VLA) polarimetric observations of seven sources in the Coma cluster field, and used the FARADAY code developed by Murgia et al. (2004) to derive the magnetic field model that best represents our data through numerical simulations.\\ The Coma cluster is an important target for a detailed study of cluster magnetic fields. It is a nearby cluster (z=0.023), it hosts large scale radio emission (radio halo, radio relic, bridge) and a wealth of data are available at different energy bands, from radio to hard X-rays.\\ The paper is organized as follows: in Sec. \ref{sec:X} the properties of the X-ray emitting gas are described, in Sec. \ref{sec:Obs} radio observations are presented, and the radio properties of the sources are analyzed. RM analysis is presented in Sec. \ref{sec:RMobs} while in Sec.\ref{sec:Sim_setup} the adopted magnetic field model is described. The method we adopted to compare simulations and observations is reported in Sec. \ref{sec:errors}, numerical simulations are presented in Sec. \ref{sec:Sim} and results are discussed in Sec. \ref{sec:comparison}. Finally, conclusions are reported in Sec. \ref{sec:concl}. \\ A $\Lambda$CDM cosmological model is assumed throughout the paper, with $H_0=71$ km/s/Mpc, $\Omega_M$=0.27, $\Omega_{\Lambda}$=0.73. This means that 1 arcsec corresponds to 0.460 kpc at z=0.023.\\ \section{Thermal component from X-ray observations} \label{sec:X} \begin{figure*}[ht] \centering \includegraphics[width=\textwidth]{./coma_xnew.ps} \caption{Colors: Coma X-ray emission from the ROSAT All Sky Survey in the energy band [0.1, 2.4] kev. Contours: Coma radio emission at 1.4 GHz from the NVSS. The beam FWHM is 45$''\times$45$''$, contours start from 1.5 mJy/beam and are spaced by a factor of 2. The observed sources are labelled.} \label{fig:comaX} \end{figure*} The study of the magnetic field through the Faraday RM requires knowledge of the properties of the thermal gas (see Eq. \ref{eq:RM}). This information can be derived from X-ray observations. In Fig. \ref{fig:comaX} the X-ray emission of the Coma cluster is shown in colors. X-ray observations in the energy band $0.1-2.4$ keV have been retrieved from the ROSAT All Sky Survey data archive. After background subtraction the image has been divided by the exposure map and smoothed with a Gaussian of $\sigma=60''$.\\ The radio contours of the NVSS (NRAO VLA Sky Survey) at 1.4 GHz are overlaid onto the X-ray emission in Fig. \ref{fig:comaX}. The location of the sources studied in this paper are marked with their names. Note that the extended radio emission of the radio halo, relic and bridge are completely resolved out in the NVSS image due to the lack of extremely short baselines. \\ The X-ray emission is from thermal bremsstrahlung, and can be used to trace the thermal particle distribution in the ICM. The distribution of the gas is well reproduced by the so-called $``\beta$-model'' (Cavaliere \& Fusco Femiano, 1976), reported in Eq. \ref{eq:betaModel}: \begin{equation} n_e(r)=n_0 \left(1+\frac{r^2}{r^2_c}\right)^{-\frac{3}{2}\beta}, \label{eq:betaModel} \end{equation} where $r$ indicates the radial distance from the cluster center, $r_c$ is the cluster core radius, $n_0$ is the cluster central gas density. The cluster center is RA $=$ 12h 59m 41.5s; DEC $=$ 27$^{\circ}$ 56$'$ 20$''$. We use the values derived by Briel et al. (1992), corrected for the cosmology adopted in this paper. They found : \begin{itemize} \item $\beta=$0.75$\pm$0.03; \item $r_c=$291$\pm$17 kpc; \item $n_0=$3.44$\pm$0.04 10$^{-3}$ $cm^{-3}$. \end{itemize} \section{Radio observations and images} \label{sec:Obs} \subsection{VLA observations and data reduction} We selected from NVSS a sample of sources having a peak flux density larger than 45 mJy, located in a radius of $1^{o}$ from the cluster X-ray center center ($\simeq 5 r_{c}$), and which have indication of polarization from Kim et al. (1990). A further selection was performed on the basis of the position of the sources. Observations have been performed at the VLA on 7 sources: 5C4.85 (NGC 4874), 5C4.81 (NGC 4869), 5C4.74, 5C4.114, 5C4.127, 5C4.42, and 5C4.152. Radio observations were performed using the 6 cm and 3.6 cm bands for all of the source except 5C4.114. This source being weaker, was observed at 20 cm and 6 cm. The sources were observed at two frequencies within each band, in order to have 4 frequency observations: 4.535 GHz, 4.935 GHz, 8.085 GHz, and 8.465 GHz. In addition 4.735 GHz observations were performed on sources 5C4.85 and 5C4.74. Due to technical issues the observing time for the source 5C4.152 was reduced, and it was necessary to increase the signal-to-noise ratio in the 3.6 cm band. To increase the signal-to-noise ratio, the data at 8.085 and 8.465 GHz were averaged together and a single image at 8.275 GHz was obtained. For the source 5C4.114 we have observations at 1.365 GHz, 1.516 GHz, 4.535 GHz and 4.935 GHz. Details of the observations are reported in Table \ref{tab:radioobs}. The source 3C286 was used as both primary flux density calibrator\footnote{we refer to the flux density scale by Baars et al. (1990)} and as absolute reference for the electric vector polarization angle. The source 1310+323 was observed as both a phase and parallactic angle calibrator. \\ We performed standard calibration and imaging using the NRAO Astronomical Imaging Processing Systems (AIPS). Cycles of phase self-calibration were performed to refine antenna phase solutions on target sources, followed by a final amplitude and gain self-calibration cycle in order to remove minor residual gain variations. Total intensity, I, and Stokes parameter Q and U images have been obtained for each frequency separately. After cleaning, radio images were restored with a naturally weighted beam. The final images were then convolved with a Gaussian beam having FWHM $=$ 1.5$''\times$1.5$''$ ($\sim$ 0.7$\times$0.7 kpc). Polarization intensity $P=\sqrt{U^2+Q^2}$, Polarization angle $\Psi=\frac{1}{2}atan(U,Q)$ and fractional polarization $FPOL=\frac{P}{I}$ images were obtained from the I, Q and U images. Polarization intensity images have been corrected for a positive bias. The calibration errors on the measured fluxes are $\sim$ 5\%. \\ \begin{table*} \caption{VLA observations of radio galaxies in the Coma cluster field.} \label{tab:radioobs} \centering \begin{tabular}{|c c c c c c c c|} \hline\hline Source & RA & DEC & $\nu$ & Bandwidth & Config. & Date & Time on Source \\ & (J2000) & (J2000) & (GHz) & (MHz) & & & (Hours) \\\hline 5C4.85 & 12 59 35.3 & +27 57 36 & 8.085 - 8.465 & 50 & B & Jul 06 & 2.6 \\ & & & 4.535 - 4.935 & 50 & B & Oct 07 & 2.6 \\ & & & 4.735 & 50 & B & May 09 & 2.6 \\ & & & & & & & \\ 5C4.81 & 12 59 22.8 & +27 54 40 & 8.085 - 8.465 & 50 & B & Jul 06 & 2.6 \\ & & & 4.535 - 4.935 & 50 & B & Jul 06 & 2.7 \\ & & & 8.465 & 50 & C & Nov 90 & 3.8 \\ & & & & & & & \\ 5C4.74 & 12 58 59.4 & +27 46 46 & 8.085 - 8.465 & 50 & B & Jul 06 & 2.7 \\ & & & 8.085 - 8.465 & 50 & C & Apr 08 & 5.4 \\ & & & 4.535 - 4.935 & 50 & B & Jul 06 & 2.7 \\ & & & 4.735 & 50 & B & May 09 & 2.6 \\ & & & & & & & \\ 5C4.114& 13 00 50.6 & +28 08 03 & 1.365 - 1.515 & 25 & A & Dec 08 & 4.6 \\ & & & 4.535 - 4.935 & 50 & B & Apr 09 & 5.1 \\ & & & & & & & \\ 5C4.127& 13 01 20.1 & +28 21 38 & 8.085 - 8.465 & 50 & B & Jul 06 & 2.6 \\ & & & 4.535 - 4.935 & 50 & B & Oct 07 & 2.9 \\ & & & & & & & \\ 5C4.42 & 12 56 38.2 & +28 16 43 & 8.085 - 8.465 & 50 & B & Jul 06 & 2.5 \\ & & & 4.535 - 4.935 & 50 & B & Jul 06 & 2.6 \\ & & & & & & & \\ 5C4.152& 13 03 14.4 & +27 30 06 & 8.085 - 8.465 & 50 & B & Aug 06 & 1.2 \\ & & & 4.535 - 4.935 & 50 & B & Aug 06 & 1.5 \\ \hline \multicolumn{8}{l}{\scriptsize Col. 1: Source name; Col. 2, Col. 3: Pointing position (RA, DEC); Col. 4: Observing frequency;}\\ \multicolumn{8}{l}{\scriptsize Col 5: Observing bandwidth; Col. 6: VLA configuration; Col. 7: Dates of observation;}\\ \multicolumn{8}{l}{\scriptsize Col. 8: Time on source (flags taken into account).}\\ \end{tabular} \end{table*} \begin{table*} \caption{ Total and polarization intensity radio images. Images are restored with a beam of 1.5$''\times$1.5$''$ } \label{tab:radiomaps} \centering \begin{tabular} {|c c c c c c c c|} \hline\hline Source name & $\nu $ & $\sigma$(I) & $\sigma$(Q) & $\sigma$(U) & Peak brightness &Flux density & Pol. flux \\ & (GHz) & (mJy/beam) & (mJy/beam) & (mJy/beam) & (mJy/beam) & (mJy) & (mJy) \\ \hline 5C4.85 & 4.535 & 0.018 & 0.015 & 0.015 & 5.8 & 75.7 & 7.5 \\ & 4.735 & 0.017 & 0.016 & 0.016 & 5.7 & 75.6 & 7.6 \\ & 4.935 & 0.019 & 0.017 & 0.017 & 5.8 & 75.2 & 7.5 \\ & 8.085 & 0.032 & 0.021 & 0.023 & 3.3 & 38.6 & 4.2 \\ & 8.465 & 0.034 & 0.022 & 0.022 & 3.1 & 36.4 & 4.0\\ \hline 5C4.81 & 4.535 & 0.025 & 0.022 & 0.024 & 2.7 & 66.7 & 12.1 \\ & 4.935 & 0.025 & 0.022 & 0.022 & 2.7 & 58.2 & 10.5 \\ & 8.085 & 0.022 & 0.019 & 0.021 & 2.4 & 25.2 & 5.5 \\ & 8.465 & 0.015 & 0.014 & 0.014 & 2.3 & 54.0* & 11.3 \\ \hline 5C4.74 & 4.535 & 0.025 & 0.023 & 0.023 & 2.7 & 17.0 & 3.4 \\ & 4.735 & 0.019 & 0.016 & 0.016 & 2.3 & 13.4 & 2.7\\ & 4.935 & 0.023 & 0.021 & 0.021 & 2.6 & 15.6 & 3.1\\ & 8.085 & 0.015 & 0.013 & 0.013 & 1.7 & 9.1 & 2.2\\ & 8.465 & 0.014 & 0.013 & 0.013 & 1.6 & 8.6 & 2.1 \\ \hline 5C4.114 & 1.365 & 0.040 & 0.027 & 0.027 & 11.3 & 47.0& 5.9\\ & 1.516 & 0.034 & 0.021 & 0.022 & 10.4 & 42.6 &5.5\\ & 4.535 & 0.014 & 0.013 & 0.013 & 4.2 & 16.4 &3.0\\ & 4.935 & 0.014 & 0.013& 0.013 & 3.8 & 14.9 &2.8\\ \hline 5C4.127 & 4.535 & 0.028 & 0.019 & 0.017 & 56.3 & 72.5 & 3.9 \\ & 4.935 & 0.024 & 0.020 & 0.017 & 56.4 & 72.9 & 3.9\\ & 8.085 & 0.023 & 0.021 & 0.022 & 52.2 & 62.3 & 3.4\\ & 8.465 & 0.025 & 0.021 & 0.023 & 51.6 & 61.4 & 3.3 \\ \hline 5C4.42 & 4.535 & 0.023 & 0.022 & 0.022 & 7.2 & 63.2 & 8.0 \\ & 4.935 & 0.023 & 0.022 & 0.022 & 6.5 & 57.8 & 7.3 \\ & 8.085 & 0.022 & 0.020 & 0.020 & 3.8 & 33.2 & 4.1 \\ & 8.465 & 0.021 & 0.020 & 0.019 & 3.6 & 31.0 & 4.0 \\ \hline 5C4.152 & 4.535 & 0.026 & 0.024 & 0.025 & 7.0 & 22.7 & 2.9 \\ & 4.935 & 0.026 & 0.025 & 0.025 & 6.4 & 20.3 & 2.4 \\ & 8.275 & 0.021 & 0.019 & 0.019 & 4.1 & 12.3 & 1.8\\ \hline \multicolumn{8}{l}{\scriptsize Col. 1: Source name; Col. 2: Observation frequency; Col. 3, 4, 5: RMS noise of the I, Q, U images; }\\ \multicolumn{8}{l}{\scriptsize Col. 7: Peak brightness; Col. 8: Flux density; Col. 9: Polarized flux density.}\\ \multicolumn{8}{l}{\scriptsize *The higher flux measured at 8.465 GHz is derived by combining together B and C array observations. } \end{tabular} \end{table*} \begin{figure*}[htb] \centering \includegraphics[width=0.9\textwidth]{./combo85_pol.ps} \caption{Source 5C4.85. Total intensity radio contours and polarization vectors at 4.535 GHz (left) and 8.465 GHz (right). The bottom contour corresponds to a 3$\sigma$ noise level, contours are then spaced by a factor of 2. E vectors are superimposed: the orientation indicates the direction of the E field, while the line length is proportional to the fractional polarization intensity (1$''$ corresponding to 10\%).} \label{fig:85_pol} \end{figure*} \begin{figure*}[htb] \centering\includegraphics[width=0.9\textwidth]{./combo81_pol.ps} \caption{Source 5C4.81. Total intensity radio contours and polarization vectors at 4.535 GHz (left) and 8.465 GHz (right). The bottom contour corresponds to a 3$\sigma$ noise level, and contours are then spaced by a factor of 2. E vectors are superimposed: orientation indicates the direction of the E field, while line length is proportional to the fractional polarization intensity (1$''$ corresponding to 10\%). } \label{fig:81_pol} \end{figure*} \begin{figure*}[htb] \centering\includegraphics[width=0.9\textwidth]{./combo74_pol.ps} \caption{Source 5C4.74. Total intensity radio contours and polarization vectors at 4.535 GHz (left) and 8.465 GHz (right). The bottom contour corresponds to a 3$\sigma$ noise level, contours are then spaced by a factor of 2. E vectors are superimposed: the orientation indicates the direction of the E field, while the line length is proportional to the fractional polarization intensity (1$''$ corresponding to 10\%). } \label{fig:74_pol} \end{figure*} \begin{figure*}[htb] \centering\includegraphics[width=0.9\textwidth]{./combo114_pol.ps} \caption{Source 5C4.114. Total intensity radio contours and polarization vectors at 1.365 GHz (left) and 4.935 GHz (right). The bottom contour corresponds to a 3$\sigma$ noise level, contours are then spaced by a factor of 2. E vectors are superimposed: the orientation indicates the direction of the E field, while the line length is proportional to the fractional polarization intensity (1$''$ corresponding to 10\%). } \label{fig:114_pol} \end{figure*} \begin{figure*}[htb] \centering\includegraphics[width=0.9\textwidth]{./combo127_pol.ps} \caption{Source 5C4.127. Total intensity radio contours and polarization vectors at 4.535 GHz (left) and 8.465 GHz (right). The bottom contour corresponds to a 3$\sigma$ noise level, contours are then spaced by a factor of 2. E vectors are superimposed: the orientation indicates the direction of the E field, while the line length is proportional to the fractional polarization intensity (1$''$ corresponding to 10\%). } \label{fig:127_pol} \end{figure*} \begin{figure*}[htb] \centering\includegraphics[width=0.9\textwidth]{./combo42_pol.ps} \caption{Source 5C4.42. Total intensity radio contours and polarization vectors at 4.535 GHz (left) and 8.465 GHz (right). The bottom contour corresponds to a 3$\sigma$ noise level, contours are then spaced by a factor of 2. E vectors are superimposed: the orientation indicates the direction of the E field, while the line length is proportional to the fractional polarization intensity (1$''$ corresponding to 10\%). } \label{fig:42_pol} \end{figure*} \begin{figure*}[htb] \centering \includegraphics[width=0.8\textwidth]{./combo152_pol.ps} \caption{Source 5C4.152. Total intensity radio contours and polarization vectors at 4.535 GHz (left) and 8.465 GHz (right). The bottom contour corresponds to a 3$\sigma$ noise level, contours are then spaced by a factor of 2. E vectors are superimposed: the orientation indicates the direction of the E field, while the line length is proportional to the fractional polarization intensity (1$''$ corresponding to 10\%). } \label{fig:152_pol} \end{figure*} \subsection{Radio properties of the observed sources} \label{sec:radioSou} In this section the radio properties of the observed sources are briefly presented. Further details are given in Table \ref{tab:radiomaps}.\\ Redshift information is available for three out of the seven observed radio sources. Two of them (5C4.85 and 5C4.81) are well studied Coma cluster members, while the third one (5C4.127) is associated with a background source. Although the redshift is not known for the other four radio sources, they have not been identified with any cluster member down to very faint optical magnitudes: M$_r \geq$ -15 (see Miller et al. 2009). This indicates that they are background radio sources, seen in projection through the cluster. In the following the radio emission arising from the selected sample of sources is described together with their main polarization properties. In the fractional polarization images (from Fig. \ref{fig:85_pol} to \ref{fig:152_pol}) pixels with errors larger than 10\% were blanked.\\ \smallskip\\{\bf 5C4.85 - NGC 4874}\\ This a cluster source, optically identified with the Coma central cD galaxy NGC 4874 (see {\it e.g.} Mehlert et al. 2000). It is a Wide Angle Tail radio galaxy, whose maximum angular extension is $\sim$ 30$''$, corresponding to $\sim$ 15 kpc. The angular extension of the two lobes individually is larger at the lowest frequency. The northern lobe shows a mean fractional polarization of 10\% and 11\% at 4.535 and 8.465 GHz respectively, while the western lobe is less polarized ( $\sim$7\% at both frequencies). In Fig. \ref{fig:85_pol} the radio emission is shown at 4.535 and 8.465 GHz. \\ \smallskip\\ {\bf 5C4.81 - NGC 4869}\\ This source has been studied in detail by Dallacasa et al. (1989) and Feretti et al. (1995). It is associated with the giant elliptical galaxy NGC4869. 5C4.81 has a Narrow Angle Tail radio morphology, and its angular size in the images obtained here is 55$''$ (25 kpc). The mean fractional polarization in the tail is $18$\% at 4.535 GHz and $21$\% at 8.465 GHz. In Fig. \ref{fig:81_pol} the radio emission is shown at 4.535 and 8.465 GHz.\\ \smallskip\\ {\bf 5C4.74}\\ The source 5C4.74 consists of 5C4.74a and 5C4.74b, the two radio lobes of a FRII radio source. Its redshift is unknown, and no optical identification has been found, either with a Coma cluster member (Miller et al. 2009) nor with a background radio source. From this we conclude that it is a distant background source. The northeastern lobe has a fractional polarization of $\sim$28\% and 35\% respectively at 4.535 and 8.465 GHz, while the southwestern lobe is less polarized ($\sim$ 19\% at 4.535 GHz and $\sim$ 23\% at 8.465 GHz).\\ In Fig. \ref{fig:74_pol} the radio emission is shown at 4.535 and 8.465 GHz.\\ \smallskip\\ {\bf 5C4.114}\\ 5C4.114 is a FRI radio source, with angular size of $\sim$ 15$''$. Its redshift is unknown, and no optical identification either with a Coma cluster galaxy (Miller et al. 2009) nor with a background galaxy has been found, indicating that 5C4.114 has a redshift greater than 0.023. The southern lobe appears brighter than the northern one. The source fractional polarization is $\sim$ 13\% at 1.365 GHz and $\sim$ 19\% at 4.935 GHz. \\ In Fig. \ref{fig:114_pol} the radio emission is shown at 1.365 and 4.935 GHz.\\ \smallskip\\ {\bf 5C4.127}\\ 5C4.127 is a QSO located at z=1.374 (Veron-Cetty \& Veron, 2001). Observations presented here show that in addition to a bright nucleus the source has a weak extension in the E-W direction of $\sim$ 16 $''$ ($\sim$ 136 kpc) at both of the observing frequency bands. The extended component has a mean fractional polarization of $13$\% at 4.535 GHz and $14$\% at 8.465 GHz, while the nucleus is polarized at the $3$\% level. In Fig. \ref{fig:127_pol} radio contours of the source and polarization vector images are shown.\\ \smallskip\\ {\bf 5C4.42}\\ 5C4.42 is a FRII-type radio source. Redshift information is not available in the literature and no optical identification has been found. The same arguments explained above for the source 5C4.74 let us conclude that it is a background radio source. The source is composed by a weakly polarized core and two lobes that extend for $\sim$ 25$''$ in the southwest and northeast directions. The lobes show a mean fractional polarization of $\sim$ 13\% at both 4.535 GHz and 8.465 GHz. In Fig. \ref{fig:42_pol} radio contours and vector polarization images of the source are shown. \smallskip\\ {\bf 5C4.152}\\ 5C4.152 is a FRII type Radio Galaxy. No redshift is available in the literature for this source. The same arguments explained above for the source 5C4.74 let us conclude that it is a background radio source. It is composed of a core having a fractional polarization of a few percent and two lobes that extend for $\sim$ 28$''$ north-south. The lobes show a mean fractional polarization of $\sim$ $\sim$ 13\% 4.535 GHz and 15\% at 8.275 GHz. In Fig. \ref{fig:152_pol} radio contours and vector polarization images of the source are shown. \section{RM: fits and errors} \label{sec:RMobs} In this section the procedure used to derive the RM from the radio observations is explained. We used the PACERMAN algorithm (Polarization Angle CorrEcting Rotation Measure ANalysis) developed by Dolag et al. (2005). The algorithm solves the n$\pi$ ambiguity in low signal-to-noise regions by exploiting the information of nearby reference pixels, under the assumption that the reference pixel is connected to the nearby areas as far as the polarization angle gradient is below a certain threshold in all of the observed frequency maps simultaneously.\\ We considered as reference pixel those with a polarization angle uncertainty less than 7 degrees, and fixed the gradient threshold to 15 degrees. An error of 7 degrees in the polarization angle corresponds to 3$\sigma$ level in both U and Q polarization maps simultaneously. We allowed PACERMAN to perform the RM fit if at least in 3 frequency maps the above mentioned conditions were satisfied. The resulting RM images are shown in Fig. \ref{fig:85_RM}, \ref{fig:81_RM}, \ref{fig:74_RM}, \ref{fig:114_RM}, \ref{fig:127_RM}, \ref{fig:42_RM} and \ref{fig:152_RM} overlaid on the total intensity contours at 4.935 GHz. In the same figures we also provide the RM distribution histograms and the RM fits for selected pixels in the map. The linear trend of $\Psi$ versus $\lambda^2$ and the good fits obtained clearly indicate that the Faraday rotation is occurring in an external screen.\\ From the RM images we computed the RM mean ($\langle RM\rangle$) and its dispersion ($\sigma_{RM,obs}$). There are two different types of errors that we have to account for: the statistical error and the fit error. The statistical errors for $\langle RM\rangle$ and for $\sigma_{RM,obs}$ is given by $\sigma_{RM,obs}/ \sqrt{n_b}$ and $\sigma_{RM,obs}/ \sqrt{2n_b}$ respectively, where $n_B$ is the number of beams over which the RM has been computed. The statistical error is the dominant one, while the error of the fit has the effect of increasing the {\it real} $\sigma_{RM}$. Thus, in order to recover the {\it real} standard deviation of the observed RM distribution we have computed the $\sigma_{RM,dec}$ as $\sqrt{\sigma^2_{RM,obs}-Median(Err_{fit})^2}$. with $Median(Err_{fit})$ being the median of the error distribution. The fit error has been estimated with Monte Carlo simulations. We have extracted $n_B$ values, from a random Gaussian distribution having $\sigma=\sigma_{RM,obs}$ and mean $=\langle RM \rangle$, we have then added to the extracted values a Gaussian noise having $\sigma_{noise}=Err_{fit}$, in order to mimic the effect of the noise in the observed RM images. We have computed the mean and the dispersion ($\sigma_{sim}$) of these simulated quantities and then subtracted the noise from the dispersion obtaining $\sigma_{sim,dec}=\sqrt{\sigma_{sim}^2-\sigma_{noise}^2}$. We have thus obtained a distribution of $\sigma_{sim,dec}$ and means. The standard deviation of the $\sigma_{sim,dec}$ distribution is then the fit error on $\sigma_{RM,dec}$ while the standard deviation of the mean distribution is the fit error on $\langle RM\rangle$. We checked that the mean of both distributions recover the corresponding observed values. In Table \ref{tab:rm1} we report the RM mean, the observed RM dispersion ($\sigma_{RM,obs}$), the value of $\sigma_{RM,dec}$ (hereafter simply $\sigma_{RM}$), with the respective errors, the average fit error ($Err_{fit}$), and the number of beam over which the RM statistic is computed ($n_b$). \subsubsection{The source 5C4.74} \label{sec:74} The value of $\langle RM \rangle$ that we have derived for the source 5C4.74 is quite high compared with the values found for the other sources in this cluster and it is also higher than the values obtained in other clusters for sources at similar distances from the cluster center ({\it e.g.} Clarke et al. 2004). The level of polarization of this source is also quite high compared to the other sources (see Sec. \ref{sec:radioSou}). We note its position southwest of the cluster core, in the direction of the sub-group NGC4839 that is currently merging with the Coma cluster (Feretti \& Neumann 2006). One possibility is that the magnetic field and/or the thermal gas has been compressed and ordered in this region, increasing the observed polarization flux and making $\langle RM \rangle$ peculiar in this position. This might imply that more sophisticated models, that include deviations from a spherical symmetry could give a better representation of the gas density profile. We note however that the X-ray analysis performed in the literature by Briel et al. (1992) shows that the spherical $\beta-$model is a good representation of the cluster X-ray surface brightness, indicating that deviations from spherical symmetry are small. The $\sigma_{RM}$ value is fully compatible with the trend suggested by the other sources. This could be explained in the proposed scenario, if the magnetic field has been compressed and ordered. In the following analysis we will use mainly the $\sigma_{RM}$ to infer the magnetic field strength and structure. Nonetheless, results will also be presented excluding this source from our analysis. \begin{figure*}[htb] \centering \includegraphics[width=0.8\textwidth]{./comboRM85.eps} \caption{{\bf 5C4.85:} {\it Top left:} The RM fit is shown in color along with total intensity radio contours 4.935 GHz. The bottom contour correspond to the 3$\sigma$ noise level and contours are then spaced by a factor of 2.{\it Top right} distribution histogram of the RM values. {\it Bottom:} fits of polarization angle versus $\lambda^2$ in four representative pixels. } \label{fig:85_RM} \end{figure*} \begin{figure*}[htb] \centering \includegraphics[width=0.8\textwidth]{./comboRM81.eps} \caption{{\bf 5C4.81:}{\it Top left:} The RM image is shown in color along with total intensity radio contours at 4.935 GHz. Contours start at 3$\sigma$ and increase by factors of 2. {\it Top right} distribution histogram of the RM values. {\it Bottom:} fits of polarization angle versus $\lambda^2$ in four representative pixels. } \label{fig:81_RM} \end{figure*} \begin{figure*}[htb] \centering \includegraphics[width=0.8\textwidth]{./comboRM74.eps} \caption{{\bf 5C4.74:}{\it Top left:} The RM image is shown in color along with total intensity radio contours at 4.935 GHz. Contours start at 3$\sigma$ and increase by factors of 2. {\it Top right} distribution histogram of the RM values. {\it Bottom:} fits of polarization angle versus $\lambda^2$ in four representative pixels. } \label{fig:74_RM} \end{figure*} \begin{figure*}[htb] \centering \includegraphics[width=0.8\textwidth]{./comboRM114.eps} \caption{{\bf 5C4.114:}{\it Top left:} The RM image is shown in colors along with total intensity radio contours at 4.935 GHz. Contours start at 3$\sigma$ and increase by factors of 2. {\it Top right} distribution histogram of the RM values. {\it Bottom:} fits of polarization angle versus $\lambda^2$ in four representative pixels. } \label{fig:114_RM} \end{figure*} \begin{figure*}[htb] \centering \includegraphics[width=0.8\textwidth]{./comboRM127.eps} \caption{{\bf 5C4.127:}{\it Top left:} The RM image is shown in color along with total intensity radio contours at 4.935 GHz. Contours start at 3$\sigma$ and increase by factors of 2. The circle indicates the area masked in the RM analysis.{\it Top right} distribution histogram of the RM values. {\it Bottom:} fits of polarization angle versus $\lambda^2$ in four representative pixels. } \label{fig:127_RM} \end{figure*} \begin{figure*}[htb] \centering \includegraphics[width=0.8\textwidth]{./comboRM42.eps} \caption{{\bf 5C4.42:}{\it Top left:} The RM image is shown in color along with total intensity radio contours at 4.935 GHz. Contours start at 3$\sigma$ and increase by factors of 2. {\it Top right} distribution histogram of the RM values. {\it Bottom:} fits of polarization angle versus $\lambda^2$ in four representative pixels. } \label{fig:42_RM} \end{figure*} \begin{figure*}[htb] \centering \includegraphics[width=0.8\textwidth]{./comboRM152.eps} \caption{{\bf 5C4.152:}{\it Top left:} The RM image is shown in color along with total intensity radio contours at 4.935 GHz. Contours start at 3$\sigma$ and increase by factors of 2. {\it Top right} distribution histogram of the RM values. {\it Bottom:} fits of polarization angle versus $\lambda^2$ in four representative pixels. } \label{fig:152_RM} \end{figure*} \subsection{Galactic contribution} The contribution to the Faraday RM from our Galaxy may introduce an offset in the Faraday rotation that must be removed. This contribution depends on the galactic positions of the observed sources. The Coma cluster Galactic coordinates are $l=58^{\circ}$ and $b=88^{\circ}$. The cluster is close to the galactic north pole, so that Galactic contribution to the observed RM is likely negligible. However, in order to estimate this contribution the average RM for extragalactic sources located in projection nearby the Coma cluster region has been computed using the catalogue by Simard-Normadin et al. (1981). The sources have been weighted by the inverse of the distance from the Coma cluster center, and the results in a region of 25$\times$25 degrees$^2$ centered on the cluster gives a Galactic contribution of -0.15 rad/m$^2$. This small contribution is thus completely negligible and has been ignored in the following analysis. \\ \begin{table*}[htb] \caption{Rotation Measures values of the observed sources} \label{tab:rm1} \centering \begin{tabular}{|c c c c c c c|} \hline \hline Source & Projected distance & n. of beams &$\langle RM\rangle$ &$\sigma_{RM,obs}$& Err$_{fit}$& $\sigma_{RM}$ \\ & kpc & & rad/m$^2$ & rad/m$^2$ & rad/m$^2$ & rad/m$^2$ \\ \hline 5C4.85 & 51 & 35 &-256$\pm$50 & 303 & 46 & 299$\pm$36 \\ 5C4.81 & 124 & 56 &-120$\pm$22 & 166 & 48 & 159$\pm$17 \\ 5C4.74 & 372 & 10 &372$\pm$51 & 154 & 44 & 148$\pm$41 \\ 5C4.114 & 532 & 16 & 51$\pm$4 & 16 & 2 & 16$\pm$3 \\ 5C4.127 & 919 & 7 & 21$\pm$30 & 65 & 36 & 54$\pm$26 \\ 5C4.42 & 1250 & 33 & 6$\pm$12 & 56 & 43 & 36$\pm$11 \\ 5C4.152 & 1489 & 4 & 32$\pm$27 & 37 & 28 & 24$\pm$21 \\ \hline \multicolumn{7}{l}{\scriptsize Col. 1: Source name Col. 2: Source projected distance from the X-ray cluster center;}\\ \multicolumn{7}{l}{\scriptsize Col. 3: number of beams over which RMs are computed;}\\ \multicolumn{7}{l}{\scriptsize Col. 4: Mean value of the observed RM distribution;}\\ \multicolumn{7}{l}{\scriptsize Col. 5: Dispersion of the observed RM distribution; }\\ \multicolumn{7}{l}{\scriptsize Col. 6: Median of the RM fit error; Col 7: Dispersion of the RM distribution after noise deconvolution.} \end{tabular} \end{table*} \subsection{RM local contribution} \label{sec:RMlocal} We discuss here the possibility that the RM observed in radio galaxies are not associated with the foreground ICM but may arise locally to the radio source (Bicknell et al. 1990, Rudnick \& Blundell 2003), either in a thin layer of dense warm gas mixed along the edge of the radio emitting plasma, or in its immediate surroundings. There are several arguments against this interpretation: \begin{itemize} \item{the trend of RM versus the cluster impact parameter in both statistical studies and individual cluster investigations (Clarke et al. 2001, 2004; Feretti et al. 1999; Govoni et al. 2005);}\\ \item{the Laing-Garrington effect (Laing 1988, Garrington et al. 1988, Garrington \& Conway 1991). This effect consists of an asymmetry in the polarization properties of the lobes of bright radio sources with one-sided, large scale jets. The lobe associated with the jet that is beamed toward the observer is more polarized than the one associated with the counter-jet that points away from the observer. This effect can be explained if we assume that the radio emission from the two lobes cross different distances through the ICM, and therefore the emission from the counter-lobe is seen through a greater Faraday depth, causing greater depolarization. This means also that the observed polarization properties of the source are strongly influenced by the ICM.}\\ \item{statistical tests on the scatter plot of RM versus polarization angle for the radio galaxy PKS1246-410 (Ensslin et al. 2003);}\\ \item{the relation between the RM and the cooling flow rate in relaxed clusters (Taylor et al. 2002).}\\ \end{itemize} This observational evidence allows us to conclude that the main contribution to the RM occurs in a Faraday screen located outside the radio sources. The only contribution that could contaminate the cluster Faraday screen is the contribution from the disturbed ISM in the central parsecs of the host elliptical galaxy where the inner jet has been found to have RMs up to thousands of radians per square meter (Zavala \& Taylor 2004). We removed the core from the RM analysis in order to avoid any contribution of this kind (out to a distance of $\sim$5$''$ from the core). \\ The ICM origin of the observed RM is also confirmed by the data presented here (Tab. \ref{tab:rm1}): the trend of $\sigma_{RM}$ exhibits a decrease with increasing cluster impact parameter. Values of $\langle RM\rangle \neq$0 and different among sources located at different projected distances to the cluster center indicate that the magnetic field substantially changes on scales larger than the source size, while small RM fluctuation can be explained by magnetic field fluctuation on scales smaller than the source size. Thus in order to interpret correctly the RM data we have to take into account magnetic field fluctuations over a range of spatial scales, {\it i.e.}, we have to model the magnetic field power spectrum. \section{The magnetic field model} In this section the magnetic field model adopted to simulate RM images is described. We used the approach suggested by Murgia et al. (2004), where the magnetic field is modelled as a 3-dimensional multi-scale model and its intensity scales with radius, following the gas distribution. \label{sec:Sim_setup} \subsection{The magnetic field power spectrum} \label{sec:pssim} In order to study the magnetic field of the Coma cluster, we considered a 3D vectorial magnetic field model. \\ Simulations start considering a power spectrum for the vector potential ${\bf A}$ in the Fourier domain: \begin{equation} |A_k|^2 \propto k^{-\zeta} \end{equation} and extract random values of its amplitude $A$ and phase $\phi$. $A$ is randomly extracted from a Rayleigh distribution (in order to obtain a Gaussian distribution for the real magnetic field components, as frequently observed), while $\phi$ varies randomly from 0 to 2$\pi$. The magnetic field components in the Fourier space are then obtained by: \begin{equation} {\tilde B}(k) =ik\times {\tilde A}(k). \end{equation} The field components $B_i$ in the real space are then derived using 3D Fast Fourier Transform. The resulting magnetic field is a multi-scale model with the following properties:\\ 1)$$\nabla \cdot {\bf B}=0,$$ \\ 2) the magnetic field energy density associated with each component $B_k$ is:$$|B_k|^2 = C^2_n k^{-n},$$ $n= \zeta -2$, where $C^2_n$ is the power spectrum normalization,\\ 3)$B_i$ has a Gaussian distribution, with $\langle B_i\rangle=0$, $\sigma_{B_i}=\langle B^2_i\rangle$,\\ 4) $B$ has a Maxwellian distribution.\\ The magnetic field model scales with the radius as described in Sec. \ref{sec:radialB}. \\ We define $\Lambda=\frac{2\pi}{k}$ as the physical scale of the magnetic field fluctuations in the real space. Thus in order to determine the magnetic field power spectrum in the cluster, we have to determine three parameters: $\Lambda_{min}$, $\Lambda_{max}$ and $n$. It is worth noting that a degeneracy arises between $\Lambda_{max}$ and $n$ (the higher $n$ is, the lower $\Lambda_{max}$ is, in order to produce the same RM, see also Sec. \ref{sec:PWsim}). \subsection{The magnetic field radial profile} \label{sec:radialB} There are several indications that the magnetic field intensity decreases going from the center to the periphery of a cluster. This is expected by magneto-hydrodynamical simulations (see e.g. Dolag et al. 2008) and by spatial correlations found in some clusters between thermal and non-thermal energy densities (Govoni et al. 2001). \\ We assume that the cluster magnetic field follows the thermal component radial distribution according to: \begin{equation} \langle {\bf B}\rangle(r)= \langle {\bf B}_0\rangle \left( \frac{n_e(r)}{n_0} \right)^{\eta} \label{eq:BProfile} \end{equation} where $\langle {\bf B}_0\rangle$ is the mean magnetic field strength at the cluster center. \\ In order to obtain the desired magnetic field radial profile we have operated directly in the real space. Strictly, this operation should be performed in the Fourier space, by convolving the spectral potential components with the shaping profile. It has been proved that these two approaches give negligible differences (see Murgia et al. 2004).\\ When the magnetic field profile is considered, two more parameters have to be determined: $\eta$ and $\langle {\bf B}_0\rangle$. These two parameters are degenerate (the higher is $\langle {\bf B}_0\rangle$ the higher is $\eta$). In fact higher central value of the field require a steeper spectrum in order to produce the same RM.\\ \smallskip The adopted magnetic field model has then {\it a total of 5 free parameters: $\Lambda_{min}$, $\Lambda_{max}$, n, $\eta$ and $\langle B_0\rangle$, and is subject to two degeneracies: $\Lambda_{max}$- n and $\eta$ and $\langle B_0\rangle$}. \\ Fitting all of these five parameters simultaneously would be the best way to proceed, but it is not feasible here, due to the computational burden caused by the Fourier Transform inversion. Indeed we have to simulate a large volume $\sim 3^3$ Mpc$^3$ with a sub-kiloparsec pixel-size. \\ The aim of this work is to constrain the magnetic field radial profile, and for this reason the sources were selected in order to sample different regions at different impact parameters. This allows us to reach a good sensitivity to the RM at different distances from the cluster center.\\ We proceed as follows: we perform 2D simulations with different magnetic field power spectra in order to recover the RM statistical indicator that are sensitive to the magnetic field power spectrum (Sec. \ref{sec:PWsim}). From this analysis we derive the power spectrum that best reproduces the observations. We then perform 3D magnetic field simulations varying the values of $B_{0}$ and $\eta$ and derive the magnetic field profile that best reproduces the RM observations (Sec. \ref{sec:Bprof_sim}). \begin{figure}[h] \centering \includegraphics[width=8cm]{./lambda_n.eps} \caption{The RM ratio $|\langle RM \rangle| / \sigma_{RM}$ as a function of $n$ and $\Lambda_{max}$ computed on simulated RM images. The line refers to the mean values obtained by averaging the ratio of the sources.} \label{fig:lambdan} \end{figure} \section{Comparing observations and simulations} \label{sec:errors} A tricky point when observations and simulations are compared is the correct evaluations of the errors and uncertainties that this process is subject to. The simulations we present in this paper start from a random seed and generate 2D and 3D magnetic fields. From these fields simulated RM images are obtained, and then compared with those observed in order to constrain the magnetic field properties. It is worth noting that for a given magnetic field model, the RM in a given position of the cluster varies depending on the initial seed of the simulation, so that different realizations of the same model will correspond to different values of $\langle RM \rangle$ and $\sigma_{RM}$ at that position. Given the limited area covered by RM observations, the random nature of the field cannot be neglected in our analysis. \\ We adopt the following approach to compare observations and simulations: once the simulated RM image is obtained for a source, it is convolved with a Gaussian function having $FWHM$ equal to the beam $FWHM$ of the observed image. The simulated RM image is then blanked in the same way as the observed RM image. This ensures that simulations are subject to the same sampling bias that we have to deal with when obtaining the RM from observations. The comparison between the observed RM images and those simulated is performed with the $\chi^2$ distribution, by computing: \begin{equation} \label{eq:chi2} \chi^2 = \sum^7_{i=1}{\frac{(C_{i,obs} - \langle C_{i,sim} \rangle)^2}{Err^2_{C_{i,obs}}}} \end{equation} where i indicates the source, $C_{obs}$ refers to a generic observed quantity, while $\langle C_{i,sim}\rangle $ is the same quantity averaged over the different equivalent numerical simulation that start with different random seeds, and $Err^2_{C_{i,obs}}$ refers to the error of $C_{obs}$. \\ \begin{figure*}[htb] \centering \includegraphics[width=\textwidth]{./comboPS_MSS.ps} \caption{Fits to the RM images for the Kolmogorov power spectrum that best reproduces the observed RM (n=11/3, $\Lambda_{min}=$2 kpc, $\Lambda_{max}=$34 kpc) globally for the sources used in the 2D analysis (see Sec. \ref{sec:PWsim}). From top to bottom: fit to the $\sigma_{RM}$ and $\langle RM \rangle$. Red diamonds represent the observed statistic, the cyan line represents the mean taken over ten different realizations of the same magnetic field power spectrum, and the blue lines represent the scatter in the simulations.} \label{fig:PS_MSS} \end{figure*} \begin{figure*}[htb] \centering \includegraphics[width=\textwidth]{./comboPS_SFUNC.ps} \caption{Fits to the RM images for the Kolmogorov power spectrum that best reproduces the observed RM ($n$=11/3, $\Lambda_{min}=$2 kpc, $\Lambda_{max}=$34 kpc) globally for the sources used in the 2D analysis (see Sec. \ref{sec:PWsim}). Fit to the $S(r)$ (top) and $A(r)$ (bottom). Red diamonds represent the observed statistic, the cyan line represents the mean taken over ten different realizations of the same magnetic field power spectrum, and the blue lines represent the scatter in the simulations.} \label{fig:PS_SFUNC} \end{figure*} \section{Determining the magnetic field from RM observations} Here we describe how the magnetic field power spectrum has been investigated. \label{sec:Sim} \subsection{{\bf Constraining the magnetic field power spectrum}} \label{sec:PWsim} Several observational quantities can be useful to constrain some properties of the magnetic field power spectrum. In particular: \begin{itemize} \item{Both $\langle RM \rangle$ and $\sigma_{RM}$ scale linearly with the magnetic field strength, while they have different trends with $n$ and $\Lambda_{max}$, which are degenerate parameters. The ratio $|\langle RM \rangle|/\sigma_{RM}$ can thus be used to investigate the magnetic field power spectrum (see also Fig. 3 in Murgia et al. 2004).} \item{The minimum scale of the magnetic field fluctuation, $\Lambda_{min}$, affects the depolarization ratio (DP ratio) at two different frequencies (i.e. $DP=\frac{P_{\nu_1}/I_{\nu_1}}{P_{\nu_2}/I_{\nu_2}}$) and the $\sigma_{RM}$. Both $DP$ and $\sigma_{RM}$ are in fact determined by the magnetic power on the small spatial scales. This parameter can be thus be derived by studying high resolution polarization images.} \item{It has been demonstrated that the magnetic field auto-correlation function is proportional to the RM auto-correlation function (Ensslin \& Vogt 2003). Since the power spectrum is the Fourier transform of the auto-correlation function, it is possible to study the 3D magnetic field power spectrum starting from the power spectrum of the RM images.} \end{itemize} We simulated 2D magnetic field models with different power spectra and compared simulated RM images and DP with the corresponding observable quantities. In these simulations the power spectrum normalization is set independently for each source\footnote{In these 2D RM simulations the radial profile of the magnetic field is not accounted for. This implicitly assumes that the mean magnetic field strength is not dramatically varying over the scale of the source. This is a reasonable assumption since the linear sizes of the sources at the Coma redshift are in fact much smaller that the cluster core radius.}. The computational grid is $512 \times 512$ pixel$^2$ and the pixel-size was fixed to 0.2 kpc. This guarantees that each beam is represented by three pixels in the grid. The resulting field of view is then $\sim$ 100$\times$100 kpc$^2$, that is enough to recover the projected size of the sources and to properly sample the large power spectrum scales. Simulations were convolved with a Gaussian function having FMHM equal to the beam of the observations. \subsubsection{\bf The $\Lambda_{max}$-n plane} \label{sec:lambdan} In order to illustrate the degeneracy existing between $\Lambda_{max}$ and $n$, 2D magnetic field models with different power spectra have been simulated. We allowed the parameter $n$ to vary in the range $[0.5;4.5]$ and $\Lambda_{max}$ in the range $[5;600]$ kpc, with steps of 0.06 and 9.3 kpc respectively. We derived simulated RM images for each combination of these parameters and calculated the RM ratio as: \begin{equation} RM ratio=\frac{|\langle RM \rangle| } {\sigma_{RM} } \end{equation} in a region of $15\times15$ kpc$^2$, comparable to the regions where RM has been observed. In Fig. \ref{fig:lambdan} the values of the RM ratio for the simulated RM images is shown in colors, as a function of both $n$ and $\Lambda_{max}$. The RM ratio was computed for the observed source that have a RM signal-to noise ratio $>$3 both for $\sigma_{RM}$ and $\langle RM \rangle$, i.e for the sources 5C4.85, 5C4.81, 5C4.74 and 5C4.114. The resulting values are shown in Fig. \ref{fig:lambdan} (black line).\\ The plot shown in Fig.\ref{fig:lambdan} shows what $\Lambda_{max}-n$ degeneracy means: the same value of the RM ratio can be explained with different power spectra. There are, as expected, two asymptotic trends. In fact, if the magnetic field power spectrum is flat (e. g. $n\leq$2), the bulk of the magnetic field energy is on the small scales, and thus the effect of increasing $\Lambda_{max}$ is negligible after a certain threshold, that in this case is achieved for $\Lambda_{max}\sim $300 kpc. As the power spectrum steepens the bulk of the energy moves to large scales, and thus as $\Lambda_{max}$ increases, the energy content also increases sharply. This is the reason of the second asymptotic trend that is shown in the plot: as $n$ increases $\Lambda_{max}$ decreases faster and faster. As $n$ approaches the value of $\sim$ 11/3 (Kolmogorov power spectrum), the observed data constrain $\Lambda_{max}$ to be $\sim$20 - 40 kpc.\\ \begin{figure}[h] \centering \includegraphics[width=9cm]{./114_kburn.ps} \caption{Fits to the Burn law. Points refer to observed data, while the red line is the fit obtained from observations. Dashed lines refer to the fits obtained from three different models, with different values of $\Lambda_{min}$, as reported in the bottom left corner of the plot.} \label{fig:114kburn} \end{figure} \subsection{Structure function, auto-correlation function and Multi-Scale-Statistic} In order to constrain more precisely the estimate of the magnetic field power spectrum parameters indicated by the previous analysis we have investigated the statistical properties of the RM images individually. We have fixed $n=11/3$, corresponding to the Kolmogorov power law for turbulent fields. This choice is motivated by both observational and theoretical works. Schuecker et al. (2004) analyzed spatially-resolved gas pseudo-pressure maps of the Coma galaxy cluster deriving that pressure fluctuations in the cluster center are consistent with a Kolmogorov-like power spectrum. Furthermore, cosmological numerical simulations have recently demonstrated that 3D power spectrum of the velocity field is well described by a single power law out to at least one virial radius, with a slope very close to the Kolmogorov power law (Vazza et al. 2009a, b). \\ The range of values of $\Lambda_{max}$ is suggested by the previous analysis (see Fig. \ref{fig:lambdan}). In order to choose the best parameters in that range, and to find the best value for $\Lambda_{min}$, we simulated RM images and used two different statistical methods to compare the observed RM images to the simulated ones: \begin{enumerate} \item{ We calculated the auto-correlation function and the structure function of the observed RM image, and then compared them with the simulated RM image. The RM structure function is defined as follows. \begin{equation} S(dx,dy)=\langle [RM(x,y)-RM(x+dx,y+dy)]^2\rangle_{(x,y)}, \end{equation} where $=\langle \rangle_{(x,y)}$ indicates that the average is taken over all the positions $(x,y)$ in the RM image. Blank pixels were not considered in the statistics. The structure function $S(r)$ is then computed by radially averaging $S(dx,dy)$ over regions of increasing size of radius $r=\sqrt{dx^2+dy^2}$. $S(r)$ is thus sensitive to the observable quantity $\sigma_{RM}$ over different scales. The auto-correlation function is defined as: \begin{equation} A(dx,dy)=\langle [RM(x,y) RM(x+dx,y+dy)]\rangle_{(x,y)} \end{equation} Since $A(0)=\langle RM^2 \rangle=\sigma^2_{RM}+\langle RM \rangle^2$, the auto-correlation function is sensitive to both $\langle RM \rangle$ and the $\sigma_{RM}$.} \item{We computed a Multi-Scale Statistic, namely we computed $\langle RM \rangle$ and $\sigma_{RM}$ over regions of increasing size in the observed RM images and compared them with the same values obtained in the simulated images. The smallest region over which $\langle RM \rangle$ and $\sigma_{RM}$ are computed corresponds to a box of 0.4 $\times$ 0.4 kpc size. The box side is then increased by a factor two until the full source size is reached. We note that this approach is sensitive to both $\langle RM \rangle$ and $\sigma_{RM}$ over different spatial scales, and is thus a useful tool to discriminate among different power spectra. This indicator differs from the $S(r)$ and $A(r)$ in that as $r$ increases, the number of pixels useful for computing the Multi-Scale Statistic increases, giving a robust statistical estimate on large scales. } \end{enumerate} For each source we simulated different power spectra varying $\Lambda_{min}$ from 1 kpc to 5 kpc and $\Lambda_{max}$ from 20 to 40 kpc. For every power spectrum and for each source we realized ten different 2D RM images, and compared the statistics ($S(r)$, $A(r)$ and Multi-Scale Statistic) with the observed ones by computing Eq. \ref{eq:chi2}. This approach makes it possible to discriminate the best power spectrum model compatible with our data. In this 2D analysis we focused on the sources 5C4.85, 5C4.81, 5C4.74 and 5C4.114, whose RM images have signal-to-noise ratio $>$3. Each source was fitted separately. The total $\chi^2$ was then computed by summing the individual values obtained for each source. The minimum value of the total $\chi^2_{tot}$ corresponds to the power spectrum model characterized by $\Lambda_{max}=34$ kpc and $\Lambda_{min}=2$ kpc. We show in Figs. \ref{fig:PS_MSS} and \ref{fig:PS_SFUNC} the Kolmogorov power spectrum model that best reproduces the observed RM images. In Appendix \ref{sec:app} similar Figures obtained with other power spectrum models are shown. \subsubsection{\bf $\Lambda_{min}$ and Fractional polarization} It has been demonstrated (Burn 1966, see also Laing 2008) that when Faraday Rotation occurs the fractional polarization $FPOL$ can be related to the fourth power of the observing wavelength $\lambda$ according to the Burn law: \begin{equation} \label{eq:kburn} FPOL=\frac{P_{\lambda}}{I_{\lambda}}\propto exp(-k \lambda^4). \end{equation} Since$FPOL$ is sensitive to the minimum scale of the power spectrum, $\Lambda_{min}$, Eq. \ref{eq:kburn} can be used to constrain it. We fitted Eq. \ref{eq:kburn} to our observations and to our simulations, performed with different values of $\Lambda_{min}$. These fits indicate that a Kolmogorov power spectrum with the best agreement with observations is achieved for $\Lambda_{min}\sim2$ kpc, confirming the result from the previous analysis. As an example, we show in Fig. \ref{fig:114kburn} these fits performed on the source 5C4.114, where the effect of depolarization is more appreciable, thanks to the 20 cm observations. \subsection{The magnetic field profile} \label{sec:Bprof_sim} The results obtained from the previous section indicate the power spectrum that is able to best reproduce the observed RM images. In order to investigate the magnetic field radial profile we simulated 3D Kolmogorov power spectra, with $\Lambda_{max}=$ 34 kpc and $\Lambda_{min}=$ 2 kpc, as derived from the 2D analysis (Sec. \ref{sec:PWsim}). A computational grid of 2048$^3$ pixels was used, and the pixel-size was fixed to 0.5 kpc. This guarantees that the Nyquist criteria is satisfied for $\Lambda_{min}$ and that fluctuations on scales $\sim \Lambda_{max}$ are also well represented in the cube. For each of these simulations Eq. \ref{eq:RM} was integrated numerically, with a step of 0.5 kpc along the line of sight. The limits of the integral in Eq. \ref{eq:RM} were $[0; 10 r_c]$ for the cluster's sources 5C4.85 and 5C4.81 and $[-10 r_c; 10 r_c]$ for the other sources in the background of the cluster. The simulated field of view covers an area of 1024$\times$1024 kpc$^2$, thus the cube has been replicated to achieve a field of view that is large enough to reach the farthest source (5C4.152).\\ The integration was repeated by varying the parameter $B_0$ in the range [0.1; 11] $\mu$G, with a step of $\sim$ 0.17 $\mu$G, and $\eta$ in the range[-0.2; 2.5] with a step of 0.04. For each combination of $B_0$ and $\eta$ a RM simulated image was thus obtained covering the full cluster area.\\ We extracted from this RM image seven fields, each lying in the plane of the sky in the same position of the observed sources, and having the same size of the observed RM images. The simulated RM images were convolved with a Gaussian beam having FWHM$=$0.7$\times$0.7 kpc, in order to have the same resolution of the observations. Finally the simulated RM fields were blanked in the same way as the corresponding RM source.\\ The result of this integration is, for each combination of ($B_{0}$;$\eta$), a set of seven simulated RM images, that are subject to the same statistical biases of the observed images.\\ This process was repeated 50 times, each starting from a different random seed to generate the magnetic field power spectrum model.\\ For each source and for each value of ($B_{0}$;$\eta$) a simulated RM image was obtained for every realization of the same power spectrum model. The mean and the standard deviation of the $\sigma_{RM,sim}(B_0,\eta)$ was computed from the simulated RM images, and then the $\chi^2$ was obtained (Eq. \ref{eq:chi2}). The resulting $\chi^2$ plane is shown in Fig. \ref{fig:chi2plane}. The minimum value is achieved for $B_{0}=$4.7 $\mu$G and $\eta=0.5$, but the 1-$\sigma$ confidence level of the $\chi^2$ indicates that values going from $B_{0}=$3.9 $\mu$G and $\eta=0.4$, to $B_{0}=$5.4 $\mu$G and $\eta=0.7$, are equally representative of the magnetic field profile, according to the degeneracy between the two parameters. Magnetic field models with a profile flatter than $\eta < 0.2$ and steeper than $\eta > 1.0$ are excluded at 99\% confidence level, for any value of $\langle B_0 \rangle$. Also magnetic field models with $\langle B_0 \rangle < 3.1 \mu$G and $\langle B_0 \rangle >$ 6.5 $\mu$G are excluded at the 99\% confidence level for any value of $\eta$. It is interesting to note that the best models include $\eta=0.5$, the value expected in the case of a magnetic field energy density decreasing in proportion to the gas energy density (assuming a constant average gas temperature), and $\eta=0.67$, expected in the case of a magnetic field frozen into the gas. In the latter case the corresponding value of $B_0$ is $\sim$5.2 $\mu$G. \\ The knowledge of the magnetic field strength and structure in the ICM has strong implications for models explaining the formation of diffuse radio sources like radio halos. Testing the different models proposed in the literature is beyond the scope of this paper. We point out, however, that cosmological simulations recently performed by Donnert et al. (2009b) have shown that it is possible to test a class of these models once the magnetic field profile is known.\\ \subsection{Results excluding the source 5C4.74} The same procedure described above has been repeated excluding the source 5C4.74 (see Sec. \ref{sec:74}). The minimum value for the $\chi^2$ is again achieved with a model characterized by $B_0=$4.7 $\mu$G and $\eta=0.5$. This is not surprising since the fit is computed based on $\sigma_{RM}$, and the source is sampled with only 10 beams. In order to investigate possible effects arising from the interaction of the Coma cluster with the NGC4839 group RM images of more sources in this region would be required. \begin{figure*}[ht] \includegraphics[width=\textwidth]{./combo_profile.ps} \caption{{\it Left}: $\chi^2$ plane obtained by comparing simulated and observed $\sigma_{RM}$.{\it Right}: Profile of the best magnetic field model. magenta line refers to the analytic profile (Eq. \ref{eq:BProfile}), while the blue line refers to a slice extracted from the simulated magnetic field numerical model. Power spectrum fluctuations on the profile are shown.} \label{fig:chi2plane} \end{figure*} \section{Comparison with other estimates} \label{sec:comparison} In the literature there is a long-standing debate on the magnetic field strength derived from the RM analysis compared to the equipartition estimate and to the Inverse Compton hard X-ray emission. The discrepancy may arise from the different (but not incompatible) assumptions, and, moreover, are sensitive to the magnetic field on different spatial scales. Assuming the magnetic field models derived in the previous section, it is possible to derive an estimate that is comparable with equipartition values, and with the Inverse-Compton detection as well as with the upper limits derived from new hard X-ray observations. In order to obtain a value that is directly comparable with the equipartition magnetic field estimate, we have to derive the average magnetic field strength resulting from our RM analysis over the same volume assumed in the equipartition analysis, that is $\sim$1 Mpc$^3$. The magnetic field model resulting from our RM analysis gives an average magnetic field strength of $\sim$ 2 $\mu$G, consistent with the equipartition estimate derived from the radio halo emission ( 0.7 - 1.9 $\mu$G Thierbach et al. 2003), despite the different assumptions that these two methods require.\\ The Inverse Compton hard X-ray emission has been observed with the {\it Beppo Sax} satellite. Its field of view is $\sim1.3^{\circ}$, corresponding to $\sim 2.2 \times 2.2$ Mpc$^2$ at the Coma redshift. We computed the average value of the magnetic field over the same volume sampled by {\it Beppo Sax}. We obtained $\sim$0.75 $\mu$G when the best model is assumed, that is a factor four higher than the value derived from Hard-X ray observations (Fusco Femiano et al. 2004). We note however that models compatible with our data within 1-$\sigma$ of the $\chi^2$ give values slightly different, going from 0.9 to 0.5 $\mu$G. The steepest magnetic field model that is compatible with our data at 99\% confidence level ($B_{0}\sim 6.4$ $\mu$G, $\eta=0.95$) gives 0.2 $\mu$G when averaged over the volume corresponding to the {\it Beppo Sax} field of view. Deeper Hard-X ray observations would be required to better compare the two estimates. The values computed here indicate however that they can be reconciled. Recently, new hard X-ray observations of the Coma cluster have been performed with the new generation of satellites (see the work by Wik et al. 2009 using XMM and Suzaku data, Lutovinov et al. 2008 using ROSAT, RXTE and INTEGRAL data, Ajello et al. 2009 using XMM-Newton, Swift/XRT, Chandra and BAT data). These observations failed to find statistically significant evidence for non-thermal emission in the hard X-ray spectrum of the ICM, which is better described by a single or multi-temperature model. Given the large angular size of the Coma cluster, if the non-thermal hard X-ray emission is more spatially extended than the observed radio halo, both Suzaku HXD-PIN and BAT Swift may miss some fraction of the emission. These efforts have thus derived lower limits for the magnetic field strength, over areas smaller than the radio halo. The lower limit reported by Wik et al. (2009) is e.g. $\langle B \rangle >$ 0.2 $\mu$G, that is compatible with our results. \begin{figure}[h] \includegraphics[width=0.45\textwidth]{./best_profile_tot.ps} \caption{$\sigma_{RM}$ and $\langle RM \rangle$ for the best model (cyan continuous line) and its dispersion (cyan dotted lines), given by the rms of the different random realizations. Observed points are shown in red. } \label{fig:bestfit} \end{figure} \section{Conclusions} \label{sec:concl} We have presented new VLA observations of seven sources in the Coma cluster field at multiple frequencies in the range 1.365 -- 8.465 GHz. The high resolution of these observations has allowed us to obtained detailed RM images with 0.7 kpc resolution. The sources were chosen in order to sample different lines-of-sight in the Coma cluster in order to constrain the magnetic field profile. We used the numerical approach proposed by Murgia et al. (2004) to realize 3D magnetic field models with different central intensities and radial slopes, and derived several realizations of the same magnetic field model in order to account for any possible effect deriving from the random nature of the magnetic field. Simulated RM images were obtained, and observational biases such as noise, beam convolution and limited sampled regions were all considered in comparing models with the data. We found that $\sigma_{RM}$ and $\langle RM \rangle$ decrease with increasing distance from the cluster center, except for the source 5C4.74, that shows a high value of $\langle RM \rangle$. We argue that this may arise from its peculiar position southwest of the Coma cluster core, toward the NGC4839 group that is currently merging with the Coma cluster.\\ Our results can be summarized as follows: \begin{itemize} \item{the RM ratio and the DP ratio were used to analyze the magnetic field power spectrum. Once a Kolmogorov index is assumed, the structure-function, the auto-correlation function and the multi-scale statistic of the RM images are best reproduced by a model with $\Lambda_{max}=$ 34 kpc and $\Lambda_{min}=$ 2 kpc. We performed a further check to investigate the best value of $\Lambda_{min}$ by fitting the Burn law (Burn 1966). This confirmed the result obtained from the previous analysis.} \item{The magnetic field radial profile was investigated through a series of 3D simulations. By comparing the observed and simulated $\sigma_{RM}$ values we find that the best models are in the range ($B_0=$3.9 $\mu$G;$\eta=$0.4) and ($B_0=$5.4 $\mu$G;$\eta=$0.7). It is interesting to note that the values $\eta=$0.5 and 0.67 lie in this range. They correspond to models where the magnetic field energy density scales as the gas energy density, or the magnetic field is frozen into the gas, respectively. This is expected from a theoretical point-of-view since the energy in the magnetic component of the intracluster medium is a tiny fraction of the thermal energy. Values of $B_{0}>$7 $\mu$G and $<$3 $\mu$G as well as $\eta < 0.2$ and $\eta > 1.0$ are incompatible with RM data at the 99\% confidence level. } \item{The average magnetic field intensity over a volume of $\sim$ 1 Mpc$^3$ is $\sim$ 2 $\mu$G, and can be compared with the equipartition estimate derived from the radio halo emission. Although based on different assumptions, and although the many uncertainties relying under the equipartition estimate, the model derived from RM analysis gives an average estimate that is compatible with the equipartition estimate. A direct comparison with the magnetic field estimate derived from the IC emission is more difficult, since the Hard-X detection is debated, and depending on the particle energy spectrum, the region over which the IC emission arises may change. The model derived from RM analysis gives a magnetic field estimate that is consistent with the present lower limits obtained from hard X-ray observations. The values we obtain for our best models are still a bit higher when compared with the estimate given by Fusco Femiano et al. (2004). It is worth to remind, as noted by several authors (see Sec. \ref{sec:comparison}), that the IC estimate derived from Hard X-ray observations could be dominated by the outer part of the cluster volume, where the magnetic field intensity is lower, depending on the spatial and energy distribution of the emitting particles. Future Hard-X ray missions could help in clarifying this issue.} \end{itemize} \bigskip {\bf Acknowledgements} A.B. is grateful to the people at the Osservatorio Astronomico di Cagliari for their kind hospitality. We thank R. Fusco Femiano and G. Brunetti for useful discussions. This work is part of the ``Cybersar'' Project, which is managed by the COSMOLAB Regional Consortium with the financial support of the Italian Ministry of University and Research (MUR), in the context of the ''Piano Operativo Nazionale Ricerca Scientifica, Sviluppo Tecnologico, Alta Formazione (PON 2000-2006)''. K.~D.~acknowledges the supported by the DFG Priority Programme 117. NRAO is a facility of the National Science Fundation, operated under cooperative agreement by Associated Universities. This work was partly supported by the Italian Space Agency (ASI), and by the Italian Ministry for University and research (MIUR). This research has made use of the NASA/IPAC Extragalactic Data Base (NED) which is operated by the JPL, California institute of Technology, under contract with the National Aeronautics and Space Administration.
\section{Introduction} Suppose $H$ is a group and $L$ is an $n$-dimensional integral lattice. In \cite{CharlapVasquez}, L. Charlap and A. Vasquez defined characteristic classes for the second page of the Lyndon-Hochschild-Serre spectral sequence associated to the extension \begin{equation}\label{eq: intro1}0 \rightarrow L \rightarrow L \rtimes H \rightarrow H \rightarrow 0 \end{equation} and showed that these classes can be seen as obstructions for the vanishing of differentials on the second page of the spectral sequence. In \cite{Sah}, C.-H. Sah generalized their results by defining characteristic classes with the same properties on every page of the spectral sequence. In this paper, we aim to expand this theory to split short exact sequences of Hopf algebras. The reason we use Hopf algebras and not just algebras in general is because the existence of a cup product on cohomology is vital to the theory. We now give a brief outline of the paper. In Section \ref{sec: pre}, we introduce some notation and state a few preliminary definitions and results concerning semi-direct products of Hopf algebras. This section is largely based on R. Molnar's paper \cite{Molnar}. We merely include it here for the reader's convenience. In Section \ref{sec: cohom}, we recall some basic facts concerning the cohomology of Hopf algebras and introduce the spectral sequence we will be studying. Then, in Section \ref{sec: char classes}, we define characteristic classes for the spectral sequence associated to a split short exact sequence of Hopf algebras. \begin{definition} \rm Let $t\geq 0, r\geq 2$. Suppose we have a split short exact sequence of Hopf algebras $A \rightarrow B \rightarrow C,$ and let $(E_{\ast}(M),d_{\ast})$ be the spectral sequence associated to this extension. We define $\mathscr{M}^t_r(A,B)$ to be the subclass in $C\mbox{-mod}=\{ M \in B\mbox{-mod} \ | \ M^A=M \}$ consisting of the $B$-modules $M$ for which the differentials $d_p^{s,t}$, with source $E^{s,t}_{p}(M)$, are zero for all $s$ and all $2\leq p \leq r-1$. We say (\ref{eq: intro1}) is \emph{$(t,r)$-trivial} if $\mathrm{H}_{t}(A,k)$ is in $\mathscr{M}^t_r(A,B)$. Assuming the split short exact sequence is $(t,r)$-trivial, a \emph{characteristic class $v_r^t$} of the spectral sequence $(E_{\ast}(\mathrm{H}_t(A,k)),d_{\ast})$ is defined as $d^{0,t}_r([id^t])$ where $[id^t]$ is the class in $E^{0,t}_r(\mathrm{H}_t(A,k))\cong \mathrm{Hom}_C(\mathrm{H}_t(A,k),\mathrm{H}_t(A,k))$ corresponding to the identity map under the isomorphism. \end{definition} Also, in Section \ref{sec: char classes}, we give a generalization of a theorem of Sah (see Theorem 3 of \cite{Sah}) which shows that characteristic classes can be seen as obstructions for the vanishing of differentials in the spectral sequence. \begin{theorem} \label{th: intro} Let $t\geq 0, r\geq 2$ and suppose we have a $(t,r)$-trivial split short exact sequence of Hopf algebras $A \rightarrow B \rightarrow C$. Then the following holds. \begin{itemize} \item[(a)] For all $s\geq0$ and for all $M \in C\mbox{-mod} $, there is a canonical surjective homomorphism \[ \theta: E_r^{s,0}(\mathrm{H}^t(A,M)) \rightarrow E_r^{s,t}(M).\] \item[(b)] The characteristic class $v_r^t \in E_r^{r,t-r+1}(\mathrm{H}_t(A,k))$ has the property \[ d_r^{s,t}(x)= (-1)^s y \cdot v_r^t \] $\forall s \geq 0, \forall x \in E_r^{s,t}(M),\forall M \in C\mbox{-mod} \ \mbox{and} \ \forall y \in E_r^{s,0}(\mathrm{H}^t(A,M)) \ \mbox{with} \ \theta(y)=x.$ \item[(c)] $v_r^t$ is completely determined by the previous property. \item[] \item[(d)] Suppose we have a Hopf algebra $D$ together with a Hopf algebra map $\rho: D \rightarrow C$ that turns $A$ into a $D$-module bialgebra. Assume that $A \rtimes D$, given the standard coalgebra structure, is a Hopf algebra and that the split short exact sequence associated to $A \rtimes D$ is also $(t,r)$-trivial (denote its characteristic classes by $w_r^t)$. Then $v_r^t$ maps to $w_r^t$ under the map induced by $\rho$ on the spectral sequences. In particular, $v_2^t$ maps to $w_2^t$. \end{itemize} \end{theorem} In Section \ref{sec: decomp}, we consider a split short exact sequence of Hopf algebras whose kernel $A$ decomposes into a tensor product of Hopf algebras $A_1 \otimes A_2$ such that the action of the quotient factors over this tensor product. For this type of extensions we prove the following decomposition theorem, which is a generalization of Petrosyan's work in \cite{Petrosyan}. \begin{theorem}\label{intro: decomp} Let $t\geq 0$ and $r\geq 2$. Suppose the characteristic classes ${}^{1}v_p^i$ and ${}^{2}v_p^j$, of ${}^{1}E_{\ast}(\mathrm{H}_i(A_1,k))$ and ${}^{2}E_{\ast}(\mathrm{H}_j(A_2,k))$ respectively, are zero for all $i,j\leq t$ and $2\leq p\leq r-1$. Then the split short exact sequence $A \rightarrow A \rtimes C \rightarrow C$ is $(t,r)$-trivial. Furthermore, we have a decomposition formula \[ v_r^t=\sum_{i+j=m} \Big( P_{i,j}({}^{1}v_r^i\otimes [{}^{2}id^j])+ (-1)^i P_{i,j}([{}^{1}id^i]\otimes {}^{2}v_r^j)\Big). \] \end{theorem} \noindent Here, $P_{i,j}: {}^{1}E_r(\mathrm{H}_i(A_1,k)) \otimes_k {}^{2}E_r(\mathrm{H}_j(A_2,k)) \rightarrow E_r(\mathrm{H}_{i+j}(A,k))$ is a morphism induced by a spectral sequence pairing and $[{}^{l}id^s]$ is the element in ${}^{l}E^{0,s}_r(\mathrm{H}_s(A_l,k))$ corresponding to the identity map in $\mathrm{Hom}_C(\mathrm{H}_s(A_l,k),\mathrm{H}_s(A_l,k))$. The following is a useful corollary. \begin{corollary}\label{cor:intro} Suppose the spectral sequences associated to $A_1 \rtimes C$ and $A_2 \rtimes C$ collapse at the second page, in coefficients $\mathrm{H}_t(A_1,k)$ and $\mathrm{H}_t(A_2,k)$ respectively, for each $t\geq 0$. Then the spectral sequence associated to $A \rtimes C$ will collapse at the second page, for all coefficients $M$ for which $M^A=M$. \end{corollary} In Sections \ref{sec: lie algebra} and \ref{sec: group}, we specialize to the cases of split Lie algebra and group extensions. Since the universal enveloping algebra functor and the group ring functor respectively map split Lie algebra extensions and split group extensions to split short exact sequences of Hopf algebras, our general theory of characteristic classes applies. In these special cases, the spectral sequence under consideration is the well-known (Lyndon-)Hochschild-Serre spectral sequence. Using Theorem \ref{th: intro} in the context of split Lie algebra extensions, we obtain the following results concerning their collapse. \begin{corollary} Let $k$ be a field of characteristic zero and suppose $ 0 \rightarrow \mathfrak{n} \rightarrow \mathfrak{n} \rtimes_{\varphi} \mathfrak{h} \rightarrow \mathfrak{h}$ is a split extension of finite dimensional Lie algebras. Assume that $\mathrm{Der}(\mathfrak{n})$ has a semi-simple Lie subalgebra $\mathfrak{s}$ such that $\varphi$ factors through $\mathfrak{s}$, i.e. $\varphi: \mathfrak{h} \rightarrow \mathfrak{s} \subseteq \mathrm{Der}(\mathfrak{n})$. Then, the Hochschild-Serre spectral sequence $(E_{\ast}(M),d_{\ast})$ associated to the split extension will collapse at the second page for any $\mathfrak{h}$-module $M$. \end{corollary} \begin{corollary} If $0 \rightarrow \mathfrak{n} \rightarrow \mathfrak{n} \rtimes_{\varphi} \mathfrak{h} \rightarrow \mathfrak{h} \rightarrow 0$ is a split extension of Lie algebras such that $\varphi(\mathfrak{h})$ is one-dimensional, then the Hochschild-Serre spectral sequence associated to this extension will collapse at page two for all coefficients in $\mathfrak{h}$-mod. \end{corollary} A theorem of Barnes (see \cite[Th. 3]{Barnes1}) asserts that the Hochschild-Serre spectral sequence collapses at page two for all $\mathfrak{h}$-module coefficients when the kernel $\mathfrak{n}$ is finite dimensional and abelian. If the base field has characteristic zero, using Corollary \ref{cor:intro}, we can expand this result to extensions with reductive kernels. \begin{theorem} Suppose $k$ is a field of characteristic zero. Consider the split extension of finite dimensional Lie algebras $0 \rightarrow \mathfrak{n} \rightarrow \mathfrak{g} \rightarrow \mathfrak{h} \rightarrow 0,$ and suppose that $\mathfrak{n}$ is a reductive Lie algebra. Then the Hochschild-Serre spectral sequence associated to this extension will collapse at the second page for all $M \in \mathfrak{h}\mbox{-mod}$. \end{theorem} It turns out that in the group case, for the split group extensions of type (\ref{eq: intro1}), all characteristic classes have finite order. In Section \ref{sec: group}, we expand several results of Sah from \cite{Sah} about the order of characteristic classes. Because of the technical formulations we omit the statements here and give a corollary instead. \begin{corollary}The Lyndon-Hochschild-Serre spectral sequence associated to (\ref{eq: intro1}) collapses at the second page for all $H$-modules $M$ if and only if the characteristic classes $v_r^{p^n}$ are zero for all primes $p$ with $(p-1)| (r-1)$, for all $n \in \mathbb{N}_0$ and all $r\geq 2$. \end{corollary} We would like to thank the referee for the thorough, constructive and quite valuable comments and suggestions. They led to many improvements and corrections of the manuscript for which we are indebted. \section{Preliminaries on semi-direct products of Hopf algebras} \label{sec: pre} We assume the reader is familiar with the basic concepts from the theory of Hopf algebras. A good introduction can, for example, be found in \cite{Cartier}, \cite{Milnor} and \cite{SweedlerBook}. Throughout the paper, we also assume a working knowledge of homological algebra, spectral sequences (see \cite{CartanEilenberg}, \cite{McClearly}, and \cite{Weibel}), and some introductory notions from the cohomology theories of groups and Lie algebras (see \cite{Brown}, \cite{Knapp} and \cite{Weibel}). Let us now establish some notation. Suppose $A$ is a Hopf algebra over the field $k$. With $A \otimes A$ we mean the tensor product over the ground field $k$. Moreover, when there is no subscript present, the tensor product will always be over the ground field $k$. Multiplication in $A$ will be denoted by \[ m_A : A \otimes A \rightarrow A : a\otimes b \mapsto ab. \] For the comultiplication, we will use the standard Sweedler notation \[ \Delta_A: A \rightarrow A \otimes A : a \mapsto \sum a_{(1)}\otimes a_{(2)}. \] So by coassociativity, we may unambiguously write \[ (\Delta_A \otimes \mathrm{Id})\circ \Delta_A (b)=(\mathrm{Id} \otimes \Delta_A)\circ \Delta_A (b)=\sum b_{(1)}\otimes b_{(2)}\otimes b_{(3)}.\] The unit and counit of $A$ are respectively denoted by $\eta_A : k \rightarrow A$ and $\varepsilon_{A}: A \rightarrow k$. $A$ also has an antipode $S_A: A \rightarrow A$. The augmentation ideal $A^{+}$ of $A$ is by definition the kernel of $\varepsilon_A$. Suppose $A,B$ and $H$ are Hopf algebras (in fact, we only need them to be (bi)algebras here) such that $A$ and $B$ are $H$-modules, that is, we have an $H$-module structure map \[ \tau_A: H \otimes A \rightarrow A : h \otimes a \mapsto h \cdot a\] and similarly a structure map $\tau_B$ for $B$. By $\mathrm{Alg}(A,B)$, we mean the set of algebra maps from $A$ to $B$, and by $\mathrm{Alg}_H(A,B)$, the set of algebra maps from $A$ to $B$ that are also $H$-module maps. We say $A$ is an $H$-module algebra if $m_A$ and $\eta_A$ are $H$-module maps. Dually, we say $A$ is an $H$-module coalgebra if $\Delta_A$ and $\varepsilon_A$ are $H$-module maps (here $k$ becomes an $H$-module via $\varepsilon_H$ and $A\otimes A$ becomes an $H$-module via $\Delta_H$). Combining these two, we say $A$ is an $H$-module bialgebra if it is both an $H$-module algebra and an $H$-module coalgebra. Starting with bialgebras that are $H$-comodules, one can define the notion of $H$-comodule (co/bi)algebra in a similar way. \\ \indent Next, we recall the notion of (split) short exact sequences of Hopf algebras. Let $\mathscr{H}$ be the category of Hopf algebras over the field $k$. It is well-known that kernels and cokernels exist in this category. If $u: H \rightarrow L$ is a map of Hopf algebras, following Molnar's notation in \cite{Molnar}, we will denote the categorical kernel and cokernel of $u$ in $\mathscr{H}$ by KER(u) and COK(u), respectively. One can check that the kernel and cokernel of $u$ are given by \begin{itemize} \item[-] $\mathrm{KER}(u)= (\mathscr{K}(\mathrm{Ker}(u)),j)$ \item[-] $\mathrm{COK}(u)= (L/ \mathscr{J}(\mathrm{Im}(u)),p)$, \end{itemize} where $j$ is the canonical inclusion, $p$ the canonical projection and \begin{itemize} \item[-] $\mathscr{K}(\mathrm{Ker}(u)) = \mbox{the largest Hopf subalgebra of $H$ contained in $\mathrm{Ker}(u)+k$}$ \item[-] $\mathscr{J}(\mathrm{Im}(u)) = \mbox{the smallest Hopf ideal of $L$ containing $\mathrm{Im}(u)^{+}$.}$ \end{itemize} \begin{definition} \rm Let $H$ be a Hopf algebra. The \emph{left adjoint action} of $H$ is defined by \[ \mathrm{ad}^l_H : H \otimes H \rightarrow H : g \otimes h \mapsto \sum g_{(1)}h S_{H}(g_{(2)}), \] and \emph{right adjoint action} of $H$ is defined as \[ \mathrm{ad}^r_H : H \otimes H \rightarrow H : h \otimes g \mapsto \sum S_H(g_{(1)})h g_{(2)}. \] Dually, the \emph{left adjoint coaction} of $H$ is defined by \[ \mathrm{co}^l_H : H \rightarrow H \otimes H : g \mapsto \sum g_{(1)}S_H(g_{(3)})\otimes g_{(2)}, \] and the \emph{right adjoint coaction} of $H$ is defined as \[ \mathrm{co}^r_H : H \rightarrow H \otimes H : g \mapsto \sum g_{(2)}\otimes S_H(g_{(1)})g_{(3)}. \] \end{definition} In \cite{Molnar}, it is shown that $\mathrm{ad}^l_H$ turns $H$ into an $H$-module algebra and $\mathrm{co}^l_H$ turns $H$ into a $H$-comodule coalgebra. \begin{definition} \rm Let $u: H \rightarrow L$ be a map of Hopf algebras. We say $u$ is \emph{normal} if $u(H)$ is stable under the left and right adjoint actions of $L$. We say $u$ is \emph{conormal} if $ker(u)$ is a left and right $H$-cosubmodule of $H$ under the left and right adjoint coactions of $H$, respectively. \end{definition} The following lemma is proven in \cite{Molnar}. \begin{lemma}\label{lemma: normal} If $u: H \rightarrow L$ is a normal map between Hopf algebras $H$ and $L$, then \[ u(H^{+})L=Lu(H^{+}). \] \end{lemma} We are now ready to explain what we mean by``a short exact sequence of Hopf algebras''. \begin{definition}\rm Let $A \xrightarrow{i} B \xrightarrow{\pi} C,$ be a sequence of Hopf algebra maps. We say this sequence is \emph{exact} if $i$ is normal, $\pi$ is conormal, $(A,i)=\mathrm{KER}(\pi)$ and $(C,\pi)=\mathrm{COK}(i)$. We say an exact sequence is \emph{split} if there is a Hopf algebra map $\sigma: C \rightarrow B$, called a section, such that $\pi \circ \sigma = \mathrm{Id_C}$. \end{definition} Now, let us define the semi-direct product of two Hopf algebras. \begin{definition} \label{def: smash}\rm Let $A$ and $C$ be two Hopf algebras such that $A$ is a $C$-module bialgebra. The semi-direct product (or smash product) $A \rtimes C$ of $A$ and $C$ is an algebra with the underlying vector space structure of $A \otimes C$ and the multiplication in $A \rtimes C$ given by \[ (a \otimes g)(b \otimes h)= \sum a(g_{(1)}\cdot b)\otimes g_{(2)}h. \] \end{definition} There are algebra injections $i: A \rightarrow A \rtimes C$ and $j: C \rightarrow A \rtimes C$, defined in the obvious way, that give the semi-direct product the following universal property: if $B$ is any algebra then for any $g \in \mathrm{Alg}(C,B)$ and any $f \in \mathrm{Alg}_C(A,B)$, the map \[ f \rtimes g: A \rtimes C \rightarrow B : a \otimes c \mapsto f(a)g(c) \] is the unique algebra map such that $(f \rtimes g )\circ i =f$ and $(f \rtimes g )\circ j =g$. Here, $B$ becomes a $C$-module via the adjoint action of $C$ on $B$ associated to $g$, i.e. via the following structure map \[ C \otimes B \rightarrow B : c \otimes b \mapsto \sum g(c_{(1)})b g(S_{C}(c_{(2)})). \] \indent Note that given two coalgebras $A$ and $C$, we can always give $A\otimes C$ the structure of a coalgebra by defining the coproduct as $\Delta(a \otimes g)= \sum a_{(1)}\otimes g_{(1)} \otimes a_{(2)}\otimes g_{(2)}.$ While the counit is given by $\varepsilon: A \otimes C \rightarrow k : a \otimes g \mapsto \varepsilon_A(a)\varepsilon_C(g).$ One can easily check that these operations turn $A\otimes C$ into a coalgebra. We call this the standard coalgebra structure on $A \otimes B$. It is also important to note that the algebra structure on $A \rtimes C$ need not be compatible with the standard coalgebra structure we have just defined. So, in general, $A \rtimes C$ is not a Hopf algebra. However, in \cite{Molnar}, R. Molnar shows that if $C$ is a cocommutative Hopf algebra then $A \rtimes C$ is a Hopf algebra with the standard coalgebra structure. Also, in \cite{Radford}, D. Radford gives explicit, necessary and sufficient conditions for $A \rtimes C$ to be a Hopf algebra with the standard coalgebra structure. Actually, Radford considers the more general case where $A$ is also a $C$-comodule coalgebra and the coalgebra structure on $A \otimes C$ is induced by this comodule structure. But our situation can be seen as a special case of this. The following theorem shows that split short exact sequences of Hopf algebras entail semi-direct products of Hopf algebras that are a fortiori Hopf algebras. \begin{theorem}{\normalfont(Molnar, \cite{Molnar})} Suppose $A \xrightarrow{i} B \xrightarrow{\pi} C$ is a split short exact sequence of Hopf algebras with a section $\sigma: C \rightarrow B$. Then $A$ has a structure of a $C$-module bialgebra such that $i \in \mathrm{Alg}_C(A,B)$ and for which the universal property of the semi-direct product entails a Hopf algebra isomorphism $i \rtimes \sigma: A \rtimes C \xrightarrow{\cong} B,$ where $A \rtimes C$ is given the standard coalgebra structure. \end{theorem} \begin{remark}\label{remark: some remarks} \rm \begin{itemize}\item[] \item[-] If $A \rightarrow B \rightarrow C$ is a split short exact sequence of Hopf algebras then $B$ is a free $A$-module via the inclusion of $A$ into $B$. Indeed, by the theorem we may assume that $B=A \rtimes C$. So we need to show that $A \rtimes C$ is a free $A$-module via the inclusion $A \rightarrow A \rtimes C : a \mapsto a \otimes 1$. But this is clear, since if $\{c_{\alpha}\}_{\alpha \in I}$ is a vector space basis for $C$, then $\{1 \otimes c_{\alpha}\}_{\alpha \in I}$ is an $A$-module basis for $A \rtimes C$. \item[-] The $C$-module structure on $A$ is obtained as follows: by normality, $A$ can be seen as a $B$-module via the adjoint action of $B$, then $\sigma: C \rightarrow B$ gives $A$ a $C$-module structure. \smallskip \item[-] Let $A$ and $C$ be two Hopf algebras such that $A$ is a $C$-module bialgebra. If $A \rtimes C$ equipped with the standard coalgebra structure is a Hopf algebra, then $A \xrightarrow{i} A \rtimes C \xrightarrow{\pi} C$ is a split short exact sequence of Hopf algebras, with a section equal to the canonical inclusion $j: C \rightarrow A \rtimes C$ and $\pi$ defined by $\pi: A \rtimes C \rightarrow C : a \otimes c \mapsto \varepsilon_A(a)c.$ \smallskip \item[-] If in Definition \ref{def: smash}, $A$ is a trivial $C$-module, meaning $c\cdot a=\varepsilon_C(c)a$ for all $c \in C$ and $a \in A$, then the product on $A\rtimes C$ is just the ordinary tensor algebra structure (then we just write $A \otimes C $ instead of $A \rtimes C$). In this case, the algebra structure is compatible with the standard coalgebra structure and thus, $A \otimes C$ is a Hopf algebra. \end{itemize} \end{remark} \section{(Co)homology of Hopf algebras}\label{sec: cohom} Let $A$ be a Hopf algebra over the field $k$. Given $A$-modules $M$ and $N$, we turn $M \otimes_k N$ into an $A$-module by defining $a(m \otimes n)= \sum a_{(1)}m \otimes a_{(2)}n.$ Also, we turn $\mathrm{Hom}_k(M,N)$ into an $A$-module via $(af)(m)=\sum a_{(1)}f(S(a_{(2)})m).$ Furthermore, these $A$-module structures are compatible with each other in the following sense. For $A$-modules $M$, $N$ and $K$, there is a natural isomorphism \begin{equation} \label{eq: comp hom tensor mod}\Psi: \mathrm{Hom}_A (M \otimes_k N, K) \xrightarrow{\cong} \mathrm{Hom}_A(M,\mathrm{Hom}_k(N,K)) \end{equation} where $\Psi(f)(m)(n)=f(m \otimes n)$. \begin{definition}\rm Let $M$ be an $A$-module. The \emph{invariants} of $M$ is defined as the submodule $M^{A}= \{ m \in M \ | \ A^{+}m=0 \}$ and the \emph{coinvariants} of $M$, as the quotient $M_{A}= M/A^{+}M.$ \end{definition} One can easily check that $-^{A}$ and $-_{A}$ are functors from $A$-mod to $k$-mod. Furthermore, we have the natural isomorphisms $\mathrm{Hom}_A(k,-) \cong -^{A}$ and $k\otimes_A - \cong -_{A}.$ Note that the isomorphism (\ref{eq: comp hom tensor mod}) implies that $\mathrm{Hom}_A(N,K) \xrightarrow{\cong} \mathrm{Hom}_k(N,K)^A$ for all $A$-modules $N$ and $K$. \begin{definition}\rm Let $M$ be an $A$-module. The $n$-th homology of $A$ with coefficients in $M$ is defined as \[ \mathrm{H}_n(A,M):= \mathrm{Tor}^A_n(k,M)=\mathrm{L}_n(-_{A})(M). \] The $n$-th cohomology of $A$ with coefficients in $M$ is defined as \[ \mathrm{H}^n(A,M):= \mathrm{Ext}_A^n(k,M)=\mathrm{R}^n(-^{A})(M). \] \end{definition} \begin{remark}\rm It is well-known that this definition of (co)homology is isomorphic to the Hochschild (co)homology of $A$ with coefficients in $M$, where $M$ is turned into a bimodule via the augmentation map $\varepsilon$. (see \cite{CartanEilenberg}). \end{remark} Now, suppose we have a split short exact sequence of Hopf algebras $A \xrightarrow{i} B \xrightarrow{\pi} C.$ When $M$ is a $B$-module, one can verify using Lemma \ref{lemma: normal} that $M^{A}$ and $M_{A}$ are also $B$-modules. Because $A$ acts trivially on $M^A$ and $M_{A}$, it follows that we can give these spaces a $C$-module structure. \begin{lemma}\label{prop: pairing} If $M$ is a $B$-module such that $M^A=M$, then we have an isomorphism of $C$-modules \[ \mathrm{H}^n(A,M) \xrightarrow{\cong} \mathrm{Hom}_k(\mathrm{H}_n(A,k),M)\] \end{lemma} \begin{proof} This follows directly from the Universal Coefficient Theorem. \end{proof} Let $\mathscr{T}$ be the exact functor that turns $C$-modules into $B$-modules via the map $\pi$. \begin{lemma} If $N$ is a $B$-module and $M$ is a $C$-module, then we have a natural isomorphism \[ \mathrm{Hom}_B(\mathscr{T}(M),N) \xrightarrow{\cong} \mathrm{Hom}_C(M,N^A), \] which implies that the functor $\mathscr{T}$ is left adjoint to the functor $-^A$, and that $-^B \cong -^C \circ -^A.$ \end{lemma} Since the functor $-^A: B\mbox{-mod} \rightarrow C\mbox{-mod}$ is right adjoint to an exact functor, it follows that $-^A$ preserves injective modules. Furthermore, because $B$ is a free $A$-module (see Remark \ref{remark: some remarks}), $B$-resolutions can be used to compute the right derived functors of $-^A: A\mbox{-mod} \rightarrow k\mbox{-mod}$. This implies that we have natural isomorphisms of $C$-modules $\mathrm{R}^{\ast}(-^{A})(M)\cong \mathrm{H}^{\ast}(A,M)$ for every $B$-module $M$. These facts, together with the composition $-^B \cong -^C \circ -^A$, give us a convergent first quadrant cohomological Grothendieck spectral sequence for every $B$-module $M$ \begin{equation}\label{eq: spec seq} E_2^{p,q}(M)= \mathrm{H}^p(C,\mathrm{H}^q(A,M)) \Rightarrow \mathrm{H}^{p+q}(B,M). \end{equation} \begin{lemma} If $A \xrightarrow{i} B \xrightarrow{\pi} C$ is a split short exact sequence of Hopf algebras and $M$ is a $B$-module such that $M^A=M$, then the differentials $d_r^{\ast,r-1}$ from $E^{\ast,r-1}_r(M)$, are zero for all $r\geq2$. \end{lemma} \begin{proof} The section is a Hopf algebra map $\sigma: C \rightarrow B$, such that $\pi \circ \sigma=\mathrm{Id}$. Factoriality then entails that the induced maps $ \mathrm{H}^n(C,M) \rightarrow \mathrm{H}^n(B,M)$ are injective for all $n$. Since these maps are given by the composition \[ \mathrm{H}^n(C,M) = E_2^{n,0}(M) \twoheadrightarrow E_3^{n,0}(M) \twoheadrightarrow \ldots \twoheadrightarrow E_{\infty}^{n,0}(M) \hookrightarrow \mathrm{H}^n(B,M), \] we conclude that $d_r^{\ast,r-1}=0$ for all $r\geq2$. \end{proof} Since $A,B$ and $C$ are Hopf algebras, their cohomology is endowed with a cup product. Now, let us suppose that there is a pairing of $B$-modules $M \otimes_k N \rightarrow K.$ Then this, together with the cup product, induces a pairing of spectral sequences \[ E_r^{p,q}(M)\otimes_k E_r^{l,m}(N) \rightarrow E_r^{p+l,q+m}(K): a\otimes b \mapsto a\cdot b. \] Moreover, this pairing will satisfy \[ d^{p+l,q+m}_r(ab)= d^{p,q}_r(a)\cdot b+ (-1)^{p+q}a \cdot d^{l,m}_r(b). \] \section{Characteristic Classes} \label{sec: char classes} Suppose $A \xrightarrow{i} B \xrightarrow{\pi} C$ is a split short exact sequence of Hopf algebras and consider the spectral sequence (\ref{eq: spec seq}). \begin{definition} \rm Let $t\geq 0, r\geq 2$. We define $\mathscr{M}^t_r(A,B)$ to be the class of $B$-modules $M$ such that $M^A=M$ and for which the differentials $d_p^{s,t}$ with source $E^{s,t}_{p}(M)$ are zero for all $s$ and all $2\leq p \leq r-1$. We say that the split extension is \emph{$(t,r)$-trivial} if $\mathrm{H}_{t}(A,k) \in \mathscr{M}^t_r(A,B)$. \end{definition} Now, suppose $M$ is a $B$-module such that $M^A=M$ and assume that the extension is $(t,r)$-trivial. Then, by lemma \ref{prop: pairing}, we have a non-degenerate $C$-pairing \[ \mathrm{H}^t(A,M)\otimes_k \mathrm{H}_t(A,k) \rightarrow M. \] As stated earlier, this induces a spectral sequence pairing \[ E_r^{p,q}(\mathrm{H}^t(A,M))\otimes_k E_r^{l,m}(\mathrm{H}_t(A,k)) \rightarrow E_r^{p+l,q+m}(M) \ . \] We also have isomorphisms \begin{eqnarray*} E^{0,t}_r(\mathrm{H}_t(A,k)) & = & E^{0,t}_2(\mathrm{H}_t(A,k)) \\ & = & \mathrm{H}^0(C,\mathrm{H}^t(A,\mathrm{H}_t(A,k))) \\ & \cong & \mathrm{H}^0(C,\mathrm{Hom}_k(\mathrm{H}_t(A,k),\mathrm{H}_t(A,k))) \\ & \cong & \mathrm{Hom}_k(\mathrm{H}_t(A,k),\mathrm{H}_t(A,k))^C \\ & \cong & \mathrm{Hom}_C(\mathrm{H}_t(A,k),\mathrm{H}_t(A,k)). \end{eqnarray*} \begin{definition}\rm Let $t\geq 0, r\geq 2$ and suppose that the extension is $(t,r)$-trivial. A \emph{characteristic class} of the spectral sequence $(E_{\ast}(\mathrm{H}_t(A,k)),d_{\ast})$ is defined as \[ v_r^t(A):= d^{0,t}_r([id^t]), \] where $[id^t]$ is the image in $E^{0,t}_r(\mathrm{H}_t(A,k))$ of the identity map in $\mathrm{Hom}_C(\mathrm{H}_t(A,k),\mathrm{H}_t(A,k))$ under the isomorphisms above. \end{definition} If $M$ is a $B$-module such that $M^A=M$, it turns out that these characteristic classes can be seen as obstructions to the vanishing of differentials in $(E_{\ast}(M),d_{\ast})$. \begin{theorem}\label{th: sah} Let $t\geq 0, r\geq 2$ and suppose we have a $(t,r)$-trivial split short exact sequence of Hopf algebras $A \rightarrow B \rightarrow C.$ Then the following holds. \begin{itemize} \item[(a)] For all $s\geq0$ and for all $M \in \mathscr{M}^t_r(A,B)$, there is a canonical surjective homomorphism \[ \theta: E_r^{s,0}(\mathrm{H}^t(A,M)) \rightarrow E_r^{s,t}(M).\] \item[(b)] The characteristic class $v_r^t \in E_r^{r,t-r+1}(\mathrm{H}_t(A,k))$ has the property \[ d_r^{s,t}(x)= (-1)^s y\cdot v_r^t \] $\forall s \geq 0, \forall x \in E_r^{s,t}(M),\forall M \in \mathscr{M}^t_r(A,B) \ \mbox{and} \ \forall y \in E_r^{s,0}(\mathrm{H}^t(A,M)) \ \mbox{with} \ \theta(y)=x.$ \item[(c)] $v_r^t$ is completely determined by the previous property. \item[] \item[(d)] Suppose we have a Hopf algebra $D$ together with a Hopf algebra map $\rho: D \rightarrow C$ that turns $A$ into a $D$-module bialgebra. Assume that $A \rtimes D$, given the standard coalgebra structure, is a Hopf algebra and that the split short exact sequence associated to $A \rtimes D$ is also $(t,r)$-trivial (denote its characteristic classes by $w_r^t)$. Then $v_r^t$ maps to $w_r^t$ under the map induced by $\rho$ on the spectral sequences. In particular, $v_2^t$ maps to $w_2^t$. \end{itemize} \end{theorem} \begin{proof} Since $\mathrm{H}^{t}(A,M)^A=\mathrm{H}^{t}(A,M)$, we have a canonical isomorphism \begin{eqnarray*} E^{s,0}_2(\mathrm{H}^t(A,M)) & \cong & \mathrm{H}^s(C,\mathrm{H}^t(A,M)) \\ & \cong & E^{s,t}_2(M). \end{eqnarray*} The splitting guarantees that $E^{s,0}_r(\mathrm{H}^t(A,M))=E^{s,0}_2(\mathrm{H}^t(A,M))$. In addition, if $M \in \mathscr{M}^t_r(A,B)$, then it follows that $E^{s,t}_r(M)$ is a quotient module of $E^{s,t}_2(M)$. Combining these observations, we find a canonical surjection \[ \theta: E_r^{s,0}(\mathrm{H}^t(A,M)) \rightarrow E_r^{s,t}(M),\] proving (a). \\ \indent To prove (b), we fix $s\geq0$, $M \in \mathscr{M}^t_r(A,C)$ and $x \in E_r^{s,t}(M)$. We have the following commutative diagram \[ \xymatrix{ E_r^{s,0}(\mathrm{H}^t(A,M)) \otimes_k E_r^{0,t}(\mathrm{H}_t(A,k)) \ar[r] & E_r^{s,t}(M) \\ E_2^{s,0}(\mathrm{H}^t(A,M)) \otimes_k E_2^{0,t}(\mathrm{H}_t(A,k))\ar[u]^{\cong} \ar[r] & E_2^{s,t}(M) \ar@{->>}[u] }\] Recall that we can take $[id^t] \in E_2^{0,t}(\mathrm{H}_t(A,k))$. We have that $z \cdot [id^t]=z$ for all $z \in E_2^{s,0}(\mathrm{H}^t(A,M))= E_2^{s,t}(M)$. Indeed, if we fix $[id^t] \in E_2^{0,t}(\mathrm{H}_t(A,k))$, then the map $p:E_2^{s,0}(\mathrm{H}^t(A,M))=\mathrm{H}^s(C,\mathrm{H}^t(A,M)) \rightarrow E_2^{s,t}(M)=\mathrm{H}^s(C,\mathrm{H}^t(A,M)): z \mapsto z \cdot [id^t]$ is a map induced by the $C$-module homomorphism $\mathrm{H}^t(A,M)=\mathrm{Hom}_k(\mathrm{H}_t(A,k),M) \rightarrow \mathrm{H}^t(A,M)=\mathrm{Hom}_k(\mathrm{H}_t(A,k),M): f \mapsto f \circ id^t $ where $id^t$ is the identity morphism in $\mathrm{Hom}_k(\mathrm{H}_t(A,k),\mathrm{H}_t(A,k))$. Since this $C$-module homomorphism is clearly the identity morphism, the induced map $p$ on cohomology is also the identity map. Now, since $\theta$ is surjective, there is an element $y \in E_r^{s,0}(\mathrm{H}^t(A,M))$ such that $\theta(y)=x$. The commutativity of the diagram then implies that $y \cdot [id^t] = x$. Now, by using the product formula, we find \begin{eqnarray*} d_r^{s,t}(x) & = & d_r^{s,t}(y \cdot [id^t]) \\ & = & d_r^{s,0}(y)\cdot[id^t] + (-1)^sy \cdot d_r^{0,t}([id^t]) \\ & = & (-1)^s y \cdot v_r^t \ , \end{eqnarray*} which proves (b). This last equality follows from the definition of $v_r^t$ and the fact that $d_r^{s,0}$ lands in $E_r^{s+r,1-r}(M)$, which is zero. To prove (c), we consider the special case $s=0$ and $M=\mathrm{H}_t(A,k)$. Notice that $\theta$ becomes the identity map (under identifications). Now, suppose $u_r^t$ also satisfies property (b) and set $x=[id^t] \in E_r^{0,t}(M)$. It follows that \[ v_r^t = d_r^{0,t}(x)= \theta^{-1}(x) \cdot u_r^t=[id^t] \cdot u_r^t. \] Furthermore, since our multiplication amounts to composition with the identity map in $\mathrm{Hom}_C(\mathrm{H}_t(A,k),\mathrm{H}_t(A,k))$ we find $v_r^t = u_r^t$, proving (c). Finally, to prove (d), we let $({'E}_{\ast}, {'d}_{\ast})$ be the spectral sequence associated to $A \rtimes D$. Note that the map induced by $\rho$ on the spectral sequences maps $[id^t] \in E_2^{0,t}(\mathrm{H}_t(A,k))=\mathrm{Hom}_C(\mathrm{H}_t(A,k),\mathrm{H}_t(A,k))$ to $[id^t] \in {'E}_2^{0,t}(\mathrm{H}_t(A,k))=\mathrm{Hom}_D(\mathrm{H}_t(A,k),\mathrm{H}_t(A,k))$. Since the map induced by $\rho$ on the spectral sequences commutes with the differentials and $v_r^t= d^{0,t}_r([id^t]), w_r^t= {'d}^{0,t}_r([id^t])$, we conclude that $v_r^t$ is mapped to $w_r^t$. \end{proof} Using this theorem inductively, one can easily see that $\mathscr{M}_r^t(A,B)=C\mbox{-mod}$ if and only if the extension is $(t,r)$-trivial. \begin{corollary} Let $t\geq 0, r\geq 2$. Then $\mathscr{M}_r^t(A,B)=C\mbox{-mod}$ if and only if the edge differentials \[ d_m^{0,t}: E_m^{0,t}(\mathrm{H}_t(A,k)) \rightarrow E_m^{m,t-m+1}(\mathrm{H}_t(A,k)) \] are zero for all $2 \leq m < r$. So, $\mathscr{M}_r^t(A,B)=C\mbox{-mod}$ if and only if $A \rtimes C$ is $(t,r)$-trivial. \end{corollary} \begin{corollary} The spectral sequence $(E_{\ast}(M),d_{\ast})$ collapses at the second page for all coefficients $M \in C\mbox{-mod}$ if and only if the edge differentials \[ d_m^{0,t}: E_m^{0,t}(\mathrm{H}_t(A,k)) \rightarrow E_m^{m,t-m+1}(\mathrm{H}_t(A,k)) \] are zero for all $t\geq 0$ and $m \geq 2$. Said differently, the spectral sequence will collapse at the second page for all coefficients $M \in C\mbox{-mod}$ if and only if it collapses with coefficients $\mathrm{H}_t(A,k)$, for all $t\geq 0$. \end{corollary} \section{A decomposition Theorem} \label{sec: decomp} Let $A_1,A_2$ and $C$ be Hopf algebras such that $A_1$ and $A_2$ are $C$-module bialgebras and assume that $A_1 \rtimes C$ and $A_2 \rtimes C$ are Hopf algebras with the standard coalgebra structure. Then $A= A_1 \otimes A_2$ naturally becomes a $C$-module bialgebra and one can check that $A \rtimes C$ is also a Hopf algebra with the standard coalgebra structure. It follows that we have three split short exact sequence of Hopf algebras; namely \begin{equation} \label{eq: decomp_i} A_i \rightarrow A_i \rtimes C \rightarrow C \end{equation} for $i=1,2$ and \begin{equation} \label{eq: decomp} A \rightarrow A \rtimes C \rightarrow C . \end{equation} We denote the spectral sequence associated to (\ref{eq: decomp_i}) by $({}^{i}E_{\ast},{}^{i}d_{\ast})$, and the spectral sequence associated to (\ref{eq: decomp}) by $(E_{\ast},d_{\ast})$. It follows from the K\"{u}nneth formula that, for all $i$ and $j$, we have a $C$-pairing \[ \mathrm{H}_i(A_1,k)\otimes \mathrm{H}_j(A_2,k) \rightarrow \mathrm{H}_{i+j}(A,k). \] This induces a spectral sequence pairing \[ E^{p,q}_r(\mathrm{H}_i(A_1,k)) \otimes_k E^{l,m}_r(\mathrm{H}_j(A_2,k)) \rightarrow E^{p+l,q+m}_r(\mathrm{H}_{i+j}(A,k)).\] Note that the natural maps of $A$ onto $A_1$ and $A_2$ induce two homomorphisms of spectral sequences \begin{align*} {}^{1}\Phi &: {}^{1}E_r(\mathrm{H}_i(A_1,k)) \rightarrow E_r(\mathrm{H}_i(A_1,k)), \\ {}^{2}\Phi &: {}^{2}E_r(\mathrm{H}_j(A_2,k)) \rightarrow E_r(\mathrm{H}_j(A_2,k)). \end{align*} Together with the pairing, these entail the morphism \[ P_{i,j}: {}^{1}E^{p,q}_r(\mathrm{H}_i(A_1,k)) \otimes_k {}^{2}E^{l,m}_r(\mathrm{H}_j(A_2,k)) \rightarrow E^{p+l,q+m}_r(\mathrm{H}_{i+j}(A,k)): x\otimes y \mapsto {}^{1}\Phi(x){}^{2}\Phi(y)\] for all $i$ and $j$. \begin{lemma}\label{lemma: product formula} Let $x \in {}^{1}E^{p,q}_r(\mathrm{H}_i(A_1,k))$ and $y \in {}^{2}E^{l,m}_r(\mathrm{H}_j(A_2,k))$. Then \[ d_r^{p+l,q+m}(P_{i,j}(x\otimes y)) = P_{i,j}({}^{1}d_r^{p,q}(x)\otimes y)+ (-1)^{p+q} P_{i,j}(x\otimes {}^{2}d_r^{l,m}(y)). \] \end{lemma} \begin{proof} This follows immediately from the product formula for pairings and the fact that ${}^{1}\Phi$ and ${}^{2}\Phi$ commute with the differentials. \end{proof} We can now derive the following. \begin{theorem}\label{th: decomp} Let $t\geq 0$ and $r\geq 2$. Suppose the respective characteristic classes ${}^{1}v_p^i$ and ${}^{2}v_p^j$, of ${}^{1}E_{\ast}(\mathrm{H}_i(A_1,k))$ and ${}^{2}E_{\ast}(\mathrm{H}_j(A_2,k))$, are zero for all $i,j\leq t$ and $2\leq p\leq r-1$. Then the split short exact sequence $A \rightarrow A \rtimes C \rightarrow C$ is $(t,r)$-trivial. Moreover, we have a decomposition formula \[ v_r^t=\sum_{i+j=m} \Big( P_{i,j}({}^{1}v_r^i\otimes [{}^{2}id^j])+ (-1)^i P_{i,j}([{}^{1}id^i]\otimes {}^{2}v_r^j)\Big). \] \end{theorem} \begin{proof} Proceeding by induction, let $2 \leq p \leq r-1$ and suppose that \begin{equation}\label{eq: decompext} A \rightarrow A \rtimes C \rightarrow C \end{equation} is $(t,p)$-trivial. So, $v_p^t$ is defined and equal to $d_p^{0,t}([id^t])$, where $id^t$ is the identity map in $\mathrm{Hom}_{C}(\mathrm{H}_t(A,k),\mathrm{H}_t(A,k))$. Similarly, we have ${}^{1}v_p^i={}^{1}d_p^{0,i}([{}^{1}id^i])$ and ${}^{2}v_p^j={}^{2}d_p^{0,j}([{}^{2}id^j])$. Since \[ \mathrm{H}_t(A,k)= \bigoplus_{i+j=t}\mathrm{H}_i(A_1,k)\otimes_k \mathrm{H}_j(A_2,k), \] we have a decomposition $id^t=\sum_{i+j=t}id_{ij}$, with $id_{ij} \in \mathrm{Hom}_{C}(\mathrm{H}_t(A,k),\mathrm{H}_t(A,k))$ defined by \[ id_{ij}(x\otimes y) = \big\{ \begin{array}{cc} x \otimes y & \mbox{if} \ x \in \mathrm{H}_i(A_1,k) \ \mbox{and} \ y \in \mathrm{H}_j(A_2,k) \\ 0 & \mbox{otherwise}. \end{array}\] Under the appropriate identifications one can consider $id_{ij}$ as an element of $E^{0,t}_p(\mathrm{H}_t(A,k))$ and denote it by $[id_{ij}]$. We then have $[id^t]=\sum_{i+j=t}[id_{ij}]$. \\ Now, consider the map \[ P_{i,j}: {}^{1}E^{0,i}_r(\mathrm{H}_i(A_1,k)) \otimes_k {}^{2}E^{0,j}_r(\mathrm{H}_j(A_2,k)) \rightarrow E^{0,t}_r(\mathrm{H}_{t}(A,k)). \] One can check that $P_{i,j}([{}^{1}id^i]\otimes [{}^{2}id^j])=[id_{ij}]$ for all $i+j=t$, so the sum formula for the identity implies \[ [id^t] = \sum_{i+j=t} P_{i,j}([{}^{1}id^i]\otimes [{}^{2}id^j]). \] It then follows from Lemma \ref{lemma: product formula} and the definition of characteristic classes that, \begin{eqnarray*} v_p^t & = & d_p^{0,t}\Big( \sum_{i+j=t} P_{i,j}([{}^{1}id^i]\otimes [{}^{2}id^j])\Big) \\ & = & \sum_{i+j=t} d_p^{0,t}\Big( P_{i,j}([{}^{1}id^i]\otimes [{}^{2}id^j])\Big) \\ & = & \sum_{i+j=t} \Big( P_{i,j}({}^{1}d_p^{0,i}([{}^{1}id^i])\otimes [{}^{2}id^j])+ (-1)^i P_{i,j}([{}^{1}id^i]\otimes {}^{2}d_p^{0,j}([{}^{2}id^j)])\Big) \\ & = & \sum_{i+j=t} \Big( P_{i,j}({}^{1}v_p^i\otimes [{}^{2}id^j])+ (-1)^i P_{i,j}([{}^{1}id^i]\otimes {}^{2}v_p^j)\Big). \end{eqnarray*} Since ${}^{1}v_p^i$ and ${}^{2}v_p^j$ are zero for all $i,j\leq t$, we have $v_p^t=0$. It now follows from Theorem \ref{th: sah} that $d_p^{s,t}=0$ for all $s$ and all $B$-modules $M$ with $M^A=M$. We conclude that (\ref{eq: decompext}) is $(t,p+1)$-trivial and this finishes the induction. Thus, the extension is $(t,r)$-trivial, and \[ v_r^t=\sum_{i+j=m} \Big( P_{i,j}({}^{1}v_r^i\otimes [{}^{2}id^j])+ (-1)^i P_{i,j}([{}^{1}id^i]\otimes {}^{2}v_r^j)\Big).\] \end{proof} The following corollary is immediate. \begin{corollary} Suppose the spectral sequences associated to $A_1 \rtimes C$ and $A_2 \rtimes C$ collapse at the second page, in coefficients $\mathrm{H}_t(A_1,k)$ and $\mathrm{H}_t(A_2,k)$ respectively, for each $t\geq 0$. Then the spectral sequence associated to $A \rtimes C$ will collapse at the second page, for all coefficients $M$ for which $M^A=M$. \end{corollary} \section{The Lie algebra case} \label{sec: lie algebra} It is a well-known fact that the universal enveloping algebra $U(\mathfrak{g})$ of a Lie algebra $\mathfrak{g}$ over a field $k$ is a Hopf algebra and that its (co)homology coincides with the ordinary (Chevalley) (co)homology of $\mathfrak{g}$. One can also verify that the universal enveloping algebra functor $U$ maps a (split) extension of Lie algebras to a (split) short exact sequence of Hopf algebras. Now, let us consider a split Lie algebra extension \begin{equation}\label{eq: splitextension}\xymatrix {&0 \ar[r] &\mathfrak{n}\ar[r] &\mathfrak{g} \ar[r]^{\pi} &\mathfrak{h} \ar@/_1.5pc/[l]\ar[r] &0}. \end{equation} There is a Lie algebra homomorphism $\varphi: \mathfrak{h} \rightarrow \mathrm{Der}(\mathfrak{n})$, such that $\mathfrak{g}$ is isomorphic to the semi-direct product $\mathfrak{g}\cong \mathfrak{n} \rtimes_{\varphi} \mathfrak{h}$. Also, this extension has the associated Hochschild-Serre spectral sequence \[ E^{p,q}_2(M)= \mathrm{H}^p(\mathfrak{h},\mathrm{H}^q(\mathfrak{n},M)) \Rightarrow \mathrm{H}^{p+q}(\mathfrak{g},M) \] for all $M \in \mathfrak{g}$-mod. Throughout this section, we will identify $\mathfrak{h}\mbox{-mod}$ with $\{ M \in \mathfrak{g}\mbox{-mod} \ | \ M^{\mathfrak{n}}=M \}.$ \begin{definition}\rm Let $t\geq0$ and $r\geq2$. A split Lie algebra extensions is called \emph{$(t,r)$-trivial} if the associated split short exact sequence of universal enveloping algebras is $(t,r)$-trivial. \end{definition} We can now reformulate the results of the two previous sections in terms of split Lie algebra extensions. \begin{theorem}\label{th: sah lie} Let $t\geq0$ and $r\geq2$. Suppose (\ref{eq: splitextension}) is $(t,r)$-trivial, then the following holds. \begin{itemize} \item[(a)] For all $s\geq0$ and for all $M \in \mathfrak{h}\mbox{-mod}$, there is a canonical surjective homomorphism \[ \theta: E_r^{s,0}(\mathrm{H}^t(\mathfrak{n},M)) \rightarrow E_r^{s,t}(M).\] \item[(b)] The characteristic class $v_r^t \in E_r^{r,t-r+1}(\mathrm{H}_t(\mathfrak{n},k))$ has the property \[ d_r^{s,t}(x)= (-1)^s y \cdot v_r^t \] $\forall s\geq0, \forall M \in \mathfrak{h}\mbox{-mod} , \forall x \in E_r^{s,t}(M) \mbox{and} \ \forall y \in E_r^{s,0}(\mathrm{H}^t(\mathfrak{n},M)) \ \mbox{with} \ \theta(y)=x $. \item[(c)] $v_r^t$ is completely determined by the previous property. \item[] \item[(d)] Let $\sigma: \mathfrak{d} \rightarrow \mathfrak{h}$ be a homomorphism of Lie algebras and set $\varphi'= \varphi\circ \sigma$. Suppose the split extension associated to $\mathfrak{n} \rtimes_{\varphi'} \mathfrak{d} $ is $(t,r)$-trivial and denote its characteristic classes by $w_r^t$. Then $v_r^t$ maps to $w_r^t$ under the map induced by $\sigma$ on the spectral sequences. In particular, $v_2^t$ maps to $w_2^t$. \end{itemize} \end{theorem} \begin{corollary} The Hochschild-Serre spectral sequence of (\ref{eq: splitextension}) collapses at the second page for all coefficients $M \in \mathfrak{h}\mbox{-mod}$ if and only if the edge differentials \[ d_m^{0,t}: E_m^{0,t}(\mathrm{H}_t(\mathfrak{n},k)) \rightarrow E_m^{m,t-m+1}(\mathrm{H}_t(\mathfrak{n},k)) \] are zero for all $t\geq 0$ and $m \geq 2$. In particular, the spectral sequence will collapse at the second page for all coefficients $M \in \mathfrak{h}\mbox{-mod}$ if and only if it collapses with coefficients $\mathrm{H}_t(\mathfrak{n},k)$, for all $t\geq 0$. \end{corollary} Next, let us suppose that $\mathfrak{n}$ is a direct sum of two Lie algebras $\mathfrak{n} = \mathfrak{n}_1 \oplus \mathfrak{n}_2$, and that we have two Lie algebra homomorphisms $\varphi_1 : \mathfrak{h} \rightarrow \mathrm{Der}(\mathfrak{n}_1)$ and $\varphi_2 : \mathfrak{h} \rightarrow \mathrm{Der}(\mathfrak{n}_2)$. Because $\mathrm{Der}(\mathfrak{n}_1) \oplus \mathrm{Der}(\mathfrak{n}_2)$ embeds in $\mathrm{Der}(\mathfrak{n})$, we can use $\varphi_1$ and $\varphi_2$ to obtain a Lie algebra homomorphism $\varphi: \mathfrak{h} \rightarrow \mathrm{Der}(\mathfrak{n})$. We then have three split Lie algebra extensions; namely, $0 \rightarrow \mathfrak{n}_i \rightarrow \mathfrak{n}_i\rtimes_{\varphi_i} \mathfrak{h} \rightarrow \mathfrak{h} \rightarrow 0$ for $i=1,$ $2$, and $0 \rightarrow \mathfrak{n} \rightarrow \mathfrak{n}\rtimes_{\varphi} \mathfrak{h} \rightarrow \mathfrak{h} \rightarrow 0.$ By translating this situation to the universal enveloping algebras, we find ourselves in the set-up of section \ref{sec: decomp}. We are ready to reformulate Theorem \ref{th: decomp} for Lie algebra extensions. \begin{theorem}\label{th: decomplie} Let $t\geq 0$ and $r\geq 2$. Suppose the characteristic classes ${}^{1}v_p^i$ and ${}^{2}v_p^j$, of ${}^{1}E_{\ast}(\mathrm{H}_i(\mathfrak{n}_1,k))$ and ${}^{2}E_{\ast}(\mathrm{H}_j(\mathfrak{n}_2,k))$ respectively, are zero for all $i,j\leq t$ and $2\leq p\leq r-1$. Then the split extension $0 \rightarrow \mathfrak{n} \rightarrow \mathfrak{g} \rightarrow \mathfrak{h} \rightarrow 0$ is $(t,r)$-trivial. Furthermore, we have a decomposition formula \[ v_r^t=\sum_{i+j=m} \Big( P_{i,j}({}^{1}v_r^i\otimes [{}^{2}id^j])+ (-1)^i P_{i,j}([{}^{1}id^i]\otimes {}^{2}v_r^j)\Big). \] \end{theorem} We will now discuss some corollaries of theorems \ref{th: sah lie} and \ref{th: decomplie}. \begin{corollary} \label{cor: factor}Suppose the Hochschild-Serre spectral sequences of $\mathfrak{n}_1 \rtimes_{\varphi_1} \mathfrak{h}$ and $\mathfrak{n}_2 \rtimes_{\varphi_2} \mathfrak{h}$ collapse at the second page, in coefficients $\mathrm{H}_t(\mathfrak{n}_1,k)$ and $\mathrm{H}_t(\mathfrak{n}_2,k)$ respectively, for each $t\geq 0$. Then the Hochschild-Serre spectral sequence of $\mathfrak{n} \rtimes_{\varphi} \mathfrak{h}$ will collapse at the second page, for all coefficients $M$ in $\mathfrak{h}\mbox{-mod}$. \end{corollary} \begin{proof} This is immediate from Theorem \ref{th: decomplie}. \end{proof} \begin{corollary}\label{cor: der} Let $k$ be a field of characteristic zero and suppose $ 0 \rightarrow \mathfrak{n} \rightarrow \mathfrak{n} \rtimes_{\varphi} \mathfrak{h} \rightarrow \mathfrak{h}$ is a split extension of finite dimensional Lie algebras. Assume that $\mathrm{Der}(\mathfrak{n})$ has a semi-simple Lie subalgebra $\mathfrak{s}$ such that $\varphi$ factors through $\mathfrak{s}$, i.e. $\varphi: \mathfrak{h} \rightarrow \mathfrak{s} \subseteq \mathrm{Der}(\mathfrak{n})$. Then, the Hochschild-Serre spectral sequence $(E_{\ast}(M),d_{\ast})$ associated to the split extension will collapse at the second page for any $\mathfrak{h}$-module $M$. \end{corollary} \begin{proof} The Lie algebra homomorphism $\varphi: \mathfrak{h} \rightarrow \mathfrak{s}$ induces a commutative diagram \[ \xymatrix{ 0 \ar[r] & \mathfrak{n} \ar[r] & \mathfrak{n} \rtimes_{i} \mathfrak{s} \ar[r] & \mathfrak{s} \ar[r] & 0 \\ 0 \ar[r] & \mathfrak{n} \ar[r] \ar[u]^{\mathrm{Id}} & \mathfrak{n} \rtimes_{\varphi} \mathfrak{h} \ar[u] \ar[r] & \mathfrak{h} \ar[r] \ar[u]^{\varphi}& 0, } \] where $i: \mathfrak{s} \rightarrow \mathrm{Der}(\mathfrak{n})$ is just the inclusion. It is well-known fact that the Hochschild-Serre spectral sequence for an extension with semi-simple quotient, in finite dimensional coefficients, will collapse at the second page. This implies that all its characteristic classes are defined and equal zero. If we now use Theorem \ref{th: sah lie}(d) iteratively, starting from $r=2$, we find that all the characteristic classes of the extension in the bottom row are defined and equal to zero for all $t\geq 0, r\geq 2$. It then follows from Theorem \ref{th: sah lie}(b) that $d_r=0$ for all $r\geq 2$ and all $M \in \mathfrak{h}\mbox{-mod}$. \end{proof} \begin{remark} \rm Let $p\geq 3$ and $\mathfrak{s}$ be an arbitrary finite dimensional semi-simple Lie algebra over a field of characteristic zero. It can be shown (see \cite{Benoist}, \cite{Bajo}) that there exists a $p$-step nilpotent Lie algebra $\mathfrak{n}_1$ and a $p$-step solvable non-nilpotent Lie algebra $\mathfrak{n}_2$ such that $\mathfrak{s}$ is isomorphic to the Levi factor of $\mathrm{Der}(\mathfrak{n}_i)$. \end{remark} \begin{corollary} If $\varphi(\mathfrak{h})$ is one-dimensional, then the Hochschild-Serre spectral sequence will collapse at $E_2$ for all coefficients in $\mathfrak{h}$-mod. \end{corollary} \begin{proof} This follows from Theorem \ref{th: sah lie}(d), by an analogous argument as in the proof of Corollary \ref{cor: der} and by observing that extensions with one-dimensional quotients always collapse at the second page. \end{proof} \begin{definition} \rm Suppose $k$ is a field of characteristic zero. A finite dimensional Lie algebra $\mathfrak{n}$ is called \emph{reductive} if $\mathfrak{n}$ decomposes as a direct sum of simple $\mathfrak{n}$-modules via the adjoint representation. \end{definition} It is a standard fact that when $\mathfrak{n}$ is reductive, there is an isomorphism $ \mathfrak{n}\cong \mathfrak{a}\oplus \mathfrak{s}$, where $\mathfrak{a}$ is the center of $\mathfrak{n}$ and $\mathfrak{s}$ is semi-simple. Also, one has that $\mathrm{Der}(\mathfrak{n})\cong \mathrm{Der}(\mathfrak{a})\oplus \mathrm{Der}(\mathfrak{s}) $. \begin{theorem} \label{cor: reduc} Suppose $k$ is a field of characteristic zero. Consider the split extension $0 \rightarrow \mathfrak{n} \rightarrow \mathfrak{g} \rightarrow \mathfrak{h} \rightarrow 0,$ and suppose that $\mathfrak{n}$ is a reductive Lie algebra. Then the Hochschild-Serre spectral sequence associated to this extension will collapse at the second page for all $M \in \mathfrak{h}\mbox{-mod}$. \end{theorem} \begin{proof} Let $ \mathfrak{n}\cong \mathfrak{a}\oplus \mathfrak{s}$, where $\mathfrak{a}$ is the center and $\mathfrak{s}$ is semi-simple. By a result of Barnes (see \cite{Barnes1}), it follows that the spectral sequence associated to a finite dimensional split Lie algebra extension with abelian kernel always collapses at the second page. For the semi-simple Lie algebra $\mathfrak{s}$, one has $\mathfrak{s}\cong \mathrm{Der}(\mathfrak{s})$. So, the collapse of the spectral sequence of the extension $0 \rightarrow \mathfrak{s} \rightarrow \mathfrak{s}\rtimes \mathrm{Der}(\mathfrak{s}) \rightarrow \mathrm{Der}(\mathfrak{s}) \rightarrow 0$ follows immediately. Combining these results with Corollary \ref{cor: factor}, shows that the Hochschild-Serre spectral sequence associated to the extension $0 \rightarrow \mathfrak{n} \rightarrow\mathfrak{n}\rtimes \mathrm{Der}(\mathfrak{n}) \rightarrow \mathrm{Der}(\mathfrak{n}) \rightarrow 0$ collapses at the second page. Applying Theorem \ref{th: sah lie}(d) finishes the proof. \end{proof} \section{The group case} \label{sec: group} Recall that the integral group ring $\mathbb{Z}[G]$ of a group $G$ is a Hopf algebra and that the group ring functor maps (split) group extensions to (split) short exact sequences of Hopf algebras. Note that all the necessary definitions and results from sections \ref{sec: pre} and \ref{sec: cohom} remain valid if we work over a principal ideal domain. Now, consider the split group extension \begin{equation}\label{eq: splitgroupextension}\xymatrix {&0 \ar[r] &N\ar[r] & G \ar[r]^{\pi} & H \ar@/_1.5pc/[l]\ar[r] &0}. \end{equation} The extension induces a group homomorphism $\varphi: H \rightarrow \mathrm{Aut}(N)$, such that $G$ is isomorphic to the semi-direct product $G\cong N \rtimes_{\varphi} H$. Also, to this group extension we associate the {Lyndon-Hochschild-Serre spectral sequence} for every $M \in G\mbox{-mod}$. Just as in the case of Lie algebras, we will identify $H\mbox{-mod}$ with $\{ M \in G\mbox{-mod} \ | \ M^{N}=M \}$, when considering extensions as the one above. Next, we explain what we mean by a $(t,r)$-trivial split group extension. \begin{definition}\rm Let $t\geq 0, r\geq 2$. We call a split group extension \emph{$(t,r)$-trivial} if the associated split short exact sequence of group rings is $(t,r)$-trivial and if $\mathrm{H}_{t-1}(N,\mathbb{Z})$ is $\mathbb{Z}$-free. \end{definition} Now, let $M$ be an $H$-module and assume that (\ref{eq: splitgroupextension}) is a $(t,r)$-trivial extension for given $t\geq 0$ and $r\geq 2$. Since $\mathrm{H}_{t-1}(N,\mathbb{Z})$ is $\mathbb{Z}$-free, the Universal Coefficient Theorem entails an isomorphism of $H$-modules $\mathrm{H}^t(N,M) \cong \mathrm{Hom}_{\mathbb{Z}}(\mathrm{H}_t(N,\mathbb{Z}),M)$. This isomorphism gives us a non-degenerate $H$-pairing \[ \mathrm{H}^t(N,M)\otimes_\mathbb{Z} \mathrm{H}_t(N,\mathbb{Z}) \rightarrow M. \] Hence, Theorem \ref{th: sah} remains valid in this setting. \begin{theorem}\label{th: sahgroup} Let $t\geq0$ and $r\geq2$ and suppose (\ref{eq: splitgroupextension}) is $(t,r)$-trivial split extension, then the following holds. \begin{itemize} \item[(a)] For all $s\geq 0$ and for all $M \in H\mbox{-mod}$, there is a canonical surjective homomorphism \[ \theta: E_r^{s,0}(\mathrm{H}^t(N,M)) \rightarrow E_r^{s,t}(M).\] \item[(b)] The characteristic class $v_r^t \in E_r^{r,t-r+1}(\mathrm{H}_t(N,\mathbb{Z}))$ has the property \[ d_r^{s,t}(x)= (-1)^s y \cdot v_r^t \] $\forall s\geq0, \forall M \in H\mbox{-mod}, \forall x \in E_r^{s,t}(M) \mbox{and} \ \forall y \in E_r^{s,0}(\mathrm{H}^t(N,M)) \ \mbox{with} \ \theta(y)=x $. \item[(c)] $v_r^t$ is completely determined by the previous property. \item[] \item[(d)] Let $\sigma: P \rightarrow H$ be a group homomorphism and set $\varphi'= \varphi\circ \sigma$. Assume the split extension associated to $N \rtimes_{\varphi'} P $ is $(t,r)$-trivial and denote its characteristic classes by $w_r^t$. Then $v_r^t$ maps to $w_r^t$ under the map induced by $\sigma$ on the spectral sequences. In particular, $v_2^t$ maps to $w_2^t$. \end{itemize} \end{theorem} This is essentially the statement of Theorem 3 of Sah in \cite{Sah}. The only difference is that we expand to split extensions where the kernel is no longer required to be an integral lattice, but just to have a $\mathbb{Z}$-free integral homology group in a specific dimension. \begin{corollary} Let $N$ be a group with $\mathbb{Z}$-free integral homology. Then the Lyndon-Hochschild-Serre spectral sequence of the split extension (\ref{eq: splitgroupextension}) collapses at the second page for all coefficients $M \in H\mbox{-mod}$ if and only if the edge differentials \[ d_m^{0,t}: E_m^{0,t}(\mathrm{H}_t(N,\mathbb{Z})) \rightarrow E_m^{m,t-m+1}(\mathrm{H}_t(N,\mathbb{Z})) \] are zero for all $t\geq 0$ and $m \geq 2$. In particular, the spectral sequence will collapse at the second page for all coefficients $M \in H\mbox{-mod}$ if and only if it collapses with coefficients $\mathrm{H}_t(N,\mathbb{Z})$, for all $t\geq 0$. \end{corollary} From now on, let us assume that $N$ is a product of two groups $N_1$ and $N_2$, both with $\mathbb{Z}$-free integral homology, and that we have two group homomorphisms $\varphi_1 : H \rightarrow \mathrm{Aut}(N_1)$ and $\varphi_2 : H \rightarrow \mathrm{Aut}(N_2)$, which give rise to a group homomorphism $\varphi: H \rightarrow \mathrm{Aut}(N)$. We obtain the split group extensions \[ 0 \rightarrow N_i \rightarrow N_i\rtimes_{\varphi_i} H \rightarrow H \rightarrow 0 \] for $i=1,2$, and \[ 0 \rightarrow N \rightarrow N \rtimes_{\varphi} H \rightarrow H \rightarrow 0. \] By applying the group ring functor to these extensions and by noting that the K\"{u}nneth formula for homology remains valid, we can reformulate the decomposition theorem in terms of split group extensions. This is a generalization of the result obtained in \cite{Petrosyan}. \begin{theorem}\label{th: decompgroup} Let $t\geq 0$ and $r\geq 2$. Suppose the characteristic classes ${}^{1}v_p^i$ and ${}^{2}v_p^j$, of ${}^{1}E_{\ast}(\mathrm{H}_i(N_1,\mathbb{Z}))$ and ${}^{2}E_{\ast}(\mathrm{H}_j(N_2,\mathbb{Z}))$ respectively, are zero for all $i,j\leq t$ and $2\leq p\leq r-1$. Then the split extension $0 \rightarrow N \rightarrow G \rightarrow H \rightarrow 0$ is $(t,r)$-trivial. Furthermore, we have a decomposition formula \[ v_r^t=\sum_{i+j=m} \Big( P_{i,j}({}^{1}v_r^i\otimes [{}^{2}id^j])+ (-1)^i P_{i,j}([{}^{1}id^i]\otimes {}^{2}v_r^j)\Big). \] \end{theorem} \begin{corollary} \label{cor: factorgroup}Suppose the Lyndon-Hochschild-Serre spectral sequences of $N_1 \rtimes_{\varphi_1} H$ and $N_2 \rtimes_{\varphi_2} H$ collapse at the second page, in coefficients $\mathrm{H}_t(N_1,\mathbb{Z})$ and $\mathrm{H}_t(N_2,\mathbb{Z})$ respectively, for each $t\geq 0$. Then the Lyndon-Hochschild-Serre spectral sequence of $N \rtimes_{\varphi} H$ will collapse at the second page, for all coefficients $M \in H\mbox{-mod}$. \end{corollary} \begin{proof} This is immediate from Theorem \ref{th: decompgroup}. \end{proof} \begin{remark} \rm Note that the preceding results remain valid when $\mathbb{Z}$ is replaced by any principal ideal domain. For example, if we work over a field $F$, the split group extension $0\rightarrow N \rightarrow G \rightarrow H \rightarrow 0$ is \emph{$(t,r)$-trivial} if the associated split short exact sequence of group rings $F[N] \rightarrow F[G] \rightarrow F[H]$ is $(t,r)$-trivial. \end{remark} From now on, we restrict to the extension \begin{equation}\label{eq: splitgroupextensionlattice}0 \rightarrow L \rightarrow G=L \rtimes_{\varphi}H \rightarrow H \rightarrow 0, \end{equation} where $L$ is an $n$-dimensional integral lattice, and $\varphi: H \rightarrow \mathrm{GL}(n,\mathbb{Z})$ is an integral representation of $H$. Since $\mathrm{H}_t(L,\mathbb{Z})\cong\Lambda^t(L)$ for all $t$, $L$ has $\mathbb{Z}$-free homology. Hence, as before, we can define the characteristic classes. It turns out that all characteristic classes will have finite order. \begin{lemma}{\normalfont(Liebermann,\cite{Sah})} Let $t\geq r\geq2$. Consider the extension (\ref{eq: splitgroupextensionlattice}), let $M$ be a finite dimensional $\mathbb{Z}$-free $H$-module and denote the associated Lyndon-Hochschild-Serre spectral sequence by $(E_{\ast}(M),d_{\ast})$. Then, for each $s\geq 0$, the image of $d_r^{s,t}$ is a torsion group annihilated by the integers $m^{t-r+1}(m^{r-1}-1)$, for all $m \in \mathbb{Z}$ (when $t<r$, $d_r^{s,t}=0$). \end{lemma} Using this fact, Sah proves the following result about the order of the characteristic classes $v_r^t$ associated to (\ref{eq: splitgroupextensionlattice}). \begin{proposition}\label{lemma: sah}{\normalfont(Sah,\cite{Sah})} Let $t\geq r\geq2$, then the order of $v_r^t$ is a divisor of $B_r^t$, where $B_r^t=2$ when $r$ is even and $B_r^t=\prod p^{\lambda_r^t(p)}$ when $r$ is odd, where $p$ ranges over primes such that $(p-1)| (r-1)$ and $\lambda_r^t(p)=\min(t-r+1,\varepsilon(p)+\mathrm{ord}_p(\frac{r-1}{p-1})$), where $\varepsilon(p)=1$ for odd $p$ and $\varepsilon(2)=2$. \end{proposition} In what follows, we intend to improve this result. \begin{definition} \rm Let $t\geq r\geq2$. If $p$ is a prime such that $p-1$ divides $r-1$, then we define \[ \xi_r(p)= \left\{ \begin{array}{ccc} \lambda_r^t(p) & \mbox{if} & \mbox{$r$ is odd} \\ 1 & & \mbox{otherwise.} \end{array}\right. \] Now, suppose that (\ref{eq: splitgroupextensionlattice}) is $(k,r)$-trivial for all $2 \leq k\leq t$. We define the following numbers iteratively from $k=r$ to $k=t$ \begin{eqnarray*} \chi^r_r &=& \left\{ \begin{array}{ccc} p & \mbox{if} & v_r^r\neq 0 \ \mbox{and} \ r=p^n \ \mbox{for some prime $p$ with $(p-1)| (r-1)$} \\ 1 & & \mbox{otherwise} \end{array}\right. \\ \chi^k_r &=& \left\{ \begin{array}{ccc} p & \mbox{if} & v_r^k\neq 0 \ \mbox{and} \ k=p^n \ \mbox{for some prime $p$ with $(p-1)| (r-1)$} \\ & & \mbox{and $\mathrm{ord}_p(\prod_{i=r}^{k-1} \chi_r^i)< \xi_r(p)$} \\ 1 & & \mbox{otherwise.} \end{array}\right. \end{eqnarray*} \end{definition} We will use the following well-known property of the binomial coefficients, which can be seen as a consequence of Lucas' Lemma. \begin{lemma} \label{lemma: lucas}Let $k\geq2$ be an integer, then \[ \gcd\Big( {k \choose i} \ | \ i \in \{ 1, \ldots, k-1 \} \Big) = \left\{ \begin{array}{ccc} p \ & \mbox{if $k=p^n$ for some prime $p$ and some $n \in \mathbb{N}$} \\ 1 & \mbox{otherwise.} \end{array}\right. \] \end{lemma} \begin{theorem}\label{th: prime order char} Let $t\geq r\geq2$. Suppose that (\ref{eq: splitgroupextensionlattice}) is $(k,r)$-trivial for all $2 \leq k\leq t$. Then, the order of $v_r^t$ is a divisor of $\prod_{k=r}^t \chi_r^k$. \end{theorem} \begin{proof} Since $\mathrm{H}_i(L,\mathbb{Z})=\Lambda^i(L)$, we have an $H$-pairing \[\mathrm{H}_i(L,\mathbb{Z})\otimes_{\mathbb{Z}} \mathrm{H}_j(L,\mathbb{Z}) \rightarrow \mathrm{H}_{i+j}(L,\mathbb{Z}) \] for all $i,j\geq 0$. We will use the multiplicative structure of the Lyndon-Hochschild-Serre spectral sequence associated to (\ref{eq: splitgroupextensionlattice}) induced by this pairing to prove the theorem by induction on $t\geq r$. First, suppose that $t=r$. If $v_r^r=0$ then we are done, otherwise take $[id^i] \in \mathrm{H}^0(H,\mathrm{H}^i(L,\mathrm{H}_i(L,\mathbb{Z})))$ and $[id^j] \in \mathrm{H}^0(H,\mathrm{H}^j(L,\mathrm{H}_j(L,\mathbb{Z})))$ for all $i,j\geq 1$ such that $i+j=r$. Then one can check that $[id^i]\cdot[id^j] = {r \choose i}[id^r]$. Applying the differential $d_r^{0,r}$ and using the product rule, we find \[ {r \choose i}v_r^r= {r \choose i}d_r^{0,r}([id^r])= d_r^{0,i}([id^i])\cdot [id^j] + (-1)^i[id^i]\cdot d_r^{0,j}([id^j]). \] Since $d_r^{p,q}=0$ for all $q<r$, we see that ${r \choose i}v_r^r=0$, and this is for all $i \in \{1, \ldots, r-1\}$. Hence, Proposition \ref{lemma: sah} and Lemma \ref{lemma: lucas} imply that $\chi^r_r v_r^r=0$. Now, assume that $v_r^{s}$ has order dividing $\prod_{k=r}^{s} \chi_r^k$ for all $s \in \{r,r+1,\ldots,t-1\}$. If $v_r^t=0$, then we are done, otherwise using again the pairing and applying the product rule, we obtain \begin{eqnarray*} {t \choose i}v_r^t & = & d_r^{0,i}([id^i])\cdot [id^j] + (-1)^i[id^i]\cdot d_r^{0,j}([id^j]) \\ & = & v_r^i \cdot [id^j] + (-1)^i[id^i] \cdot [v_r^j] \end{eqnarray*} for all $i,j\geq 1$ such that $i+j=t$. It now follows that $\prod_{k=r}^{t-1} \chi_r^k {t \choose i} v_r^t = 0$ for all $i \in \{1, \ldots, t-1\}$. Since \[\gcd\Big( \prod_{k=r}^{t-1} \chi_r^k{t \choose i} \ | \ i \in \{ 1, \ldots, t-1 \} \Big)= \prod_{k=r}^{t-1} \chi_r^k\gcd\Big( {t \choose i} \ | \ i \in \{ 1, \ldots, t-1 \} \Big),\] Proposition \ref{lemma: sah} and Lemma \ref{lemma: lucas} imply that $v_r^t$ has order dividing $\prod_{k=r}^{t} \chi_r^k$. \end{proof} \begin{remark} \rm Note that $\prod_{k=r}^{t} \chi_r^k$ is a divisor of $B_r^t$. \end{remark} \begin{corollary}If $v_r^{p^n}=0$ for all primes $p$ with $(p-1)| (r-1)$, for all $n \in \mathbb{N}_0$ and all $r\geq 2$. Then the Lyndon-Hochschild-Serre spectral sequence associated to (\ref{eq: splitgroupextensionlattice}) collapses at the second page for all $H$-modules $M$. \end{corollary} \begin{proof} We will use induction on $r$ to show that all differentials $d_r$ for $r\geq 2$ are zero for all coefficients in $H$-mod. Suppose $r=2$. By assumption, we have $\chi_2^t=1$ for all relevant $t$. So, Theorem \ref{th: prime order char} implies that $v_2^t=0$ for all $t$. It then follows from Theorem \ref{th: sahgroup}(b) that $d_2^{s,t}=0$ for all $s,t$ and all coefficients in $H$-mod. Now, assume $d_{k}^{s,t}=0$ for all $k \in \{2,\ldots r-1\}$, all $s,t$ and all coefficients in $H$-mod. In particular, (\ref{eq: splitgroupextensionlattice}) is $(t,r)$-trivial for all $t$. It again follows that $\chi_r^t=1$ for all relevant $t$. Therefore, Theorem \ref{th: prime order char} shows that $v_r^t=0$ for all $t$. Using Theorem \ref{th: sahgroup}(b), we conclude $d_r^{s,t}=0$ for all $s,t\geq 0$ and all coefficients in $H$-mod. \end{proof} Next, we show how the indexes of subgroups of $H$ can be useful in determining the order of the characteristic classes of (\ref{eq: splitgroupextensionlattice}). \begin{corollary} \label{th: subgroups}Let $t\geq r\geq2$ and suppose the extension (\ref{eq: splitgroupextensionlattice}) is $(t,r)$-trivial. If $K$ is a subgroup of $H$, then the extension restricted to $K$ is also $(t,r)$-trivial. Denoting its characteristic class by $w_r^t$ and assuming $[H:K]<\infty$, we have that $v_r^t$ has order dividing $[H:K]\mathrm{ord}(w_r^t)$. \end{corollary} \begin{proof} We have the following commutative diagram \[ \xymatrix{ 0 \ar[r] & L \ar[r] \ar[d]^{id} & L \rtimes_{\varphi'} K \ar[r] \ar[d] & K \ar[r]\ar[d]^{i} & 0 \\ 0 \ar[r] & L \ar[r] & L\rtimes_{\varphi} H \ar[r] & H \ar[r] & 0 ,} \] where $i$ is the inclusion of $K$ into $H$, and $\varphi'=\varphi \circ i$. The fact that the extension in the top row is also $(t,r)$-trivial follows directly from Theorem \ref{th: sahgroup}(d). It also shows that $i^{\ast}(v_r^t)=w_r^t$, where \[ i^{\ast}: \mathrm{H}^r(H,\mathrm{H}^{t-r+1}(L,\mathrm{H}_t(L,\mathbb{Z}))) \rightarrow \mathrm{H}^r(K,\mathrm{H}^{t-r+1}(L,\mathrm{H}_t(L,\mathbb{Z}))) \] is the restriction map induced by $i$. If $K$ is a finite index subgroup of $H$, we also have a transfer map \[ \mathrm{tr}^{\ast}: \mathrm{H}^r(K,\mathrm{H}^{t-r+1}(L,\mathrm{H}_t(L,\mathbb{Z}))) \rightarrow \mathrm{H}^r(H,\mathrm{H}^{t-r+1}(L,\mathrm{H}_t(L,\mathbb{Z}))), \] with the property that $\mathrm{tr}^{\ast} \circ i^{\ast} = [H:K]id. $ This gives $[H:K]v_r^t= \mathrm{tr}^{\ast}(w_r^t)$ which implies that $[H:K]\mathrm{ord}(w_r^t)v_r^t=0$. \end{proof}
\section{Introduction}\label{section:intro} In the problem \textsc{Max Lin}, we are given a system $Az=b$ of $m$ linear equations in $n$ variables over $\mathbb{F}_2$ in which each equation is assigned a positive weight and we wish to find an assignment of values to the variables in order to maximize the total weight of satisfied equations. A special case of \textsc{Max Lin} when each equation has at most $r$ variables is called {\sc Max $r$-Lin}. Various algorithmic aspects of \textsc{Max Lin} have been well-studied (cf. \cite{AGK04,Hastad,HastadVenkatesh02}). Perhaps, the best known result on \textsc{Max Lin} is the following inapproximability theorem of H{\aa}stad \cite{Hastad}: unless P=NP, for each $\epsilon >0$ there is no polynomial time algorithm for distinguishing instances of \textsc{Max 3-Lin} in which at least $(1-\epsilon)m$ equations can be simultaneously satisfied from instances in which less than $(1/2 + \epsilon)m$ equations can be simultaneously satisfied. Notice that maximizing the total weight of satisfied equations is equivalent to maximizing the {\em excess}, which is the total weight of satisfied equations minus the total weight of falsified equations. In Section \ref{CSPsec}, we investigate lower bounds for the maximum excess. Using an algebraic approach, we prove the following main result: Let $Az=b$ be a \textsc{Max Lin} system such that ${\rm rank} A = n$ and no pair of equations has the same left-hand side, let $w_{\min}$ be the minimum weight of an equation in $Az=b$, and let $k\ge 2.$ If $k\le m\le 2^{n/(k-1)}-2$, then the maximum excess of $Az=b$ is at least $k\cdot w_{\min}$. Moreover, we can find an assignment that achieves an excess of at least $k\cdot w_{\min}$ in time $m^{O(1)}$. Using this and other results of Section \ref{CSPsec} we prove parameterized complexity results of Section \ref{LBsec}. To describe these results we need the following notions, most of which can be found in monographs \cite{DowneyFellows99,FlumGrohe06,Niedermeier06}. A \emph{parameterized problem} is a subset $L\subseteq \Sigma^* \times \mathbb{N}$ over a finite alphabet $\Sigma$. $L$ is \emph{fixed-parameter tractable} if the membership of an instance $(x,k)$ in $\Sigma^* \times \mathbb{N}$ can be decided in time $f(k)|x|^{O(1)},$ where $f$ is a computable function of the parameter $k$. When the decision time is replaced by the much more powerful $|x|^{O(f(k))},$ we obtain the class XP, where each problem is polynomial-time solvable for any fixed value of $k.$ There is an infinite number of parameterized complexity classes between FPT and XP (for each integer $t\ge 1$, there is a class W[$t$]) and they form the following tower: $$FPT \subseteq W[1] \subseteq W[2] \subseteq \cdots \subseteq W[P] \subseteq XP.$$ Here W[P] is the class of all parameterized problems $(x,k)$ that can be decided in $f(k)|x|^{O(1)}$ time by a nondeterministic Turing machine that makes at most $f(k)\log |x|$ nondeterministic steps for some computable function $f$. For the definition of classes W[$t$], see, e.g., \cite{FlumGrohe06} (we do not use these classes in the rest of the paper). Given a pair $L,L'$ of parameterized problems, a \emph{bikernelization from $L$ to $L'$} is a polynomial-time algorithm that maps an instance $(x,k)$ to an instance $(x',k')$ (the \emph{bikernel}) such that (i)~$(x,k)\in L$ if and only if $(x',k')\in L'$, (ii)~ $k'\leq f(k)$, and (iii)~$|x'|\leq g(k)$ for some functions $f$ and $g$. The function $g(k)$ is called the {\em size} of the bikernel. The notion of a bikernelization was introduced in \cite{AlonSODA2010}, where it was observed that a parameterized problem $L$ is fixed-parameter tractable if and only if it is decidable and admits a bikernelization from itself to a parameterized problem $L'$. A {\em kernelization} of a parameterized problem $L$ is simply a bikernelization from $L$ to itself; the bikernel is the {\em kernel}, and $g(k)$ is the {\em size} of the kernel. Due to applications, low degree polynomial size kernels are of main interest. Note that $W/2$ is a tight lower bound on the maximum weight of satisfiable equations in a {\sc Max Lin} system $Az=b$. Indeed, $W/2$ is the average weight of satisfied equations (as the probability of each equation to be satisfied is $1/2$) and, thus, is a lower bound; to see the tightness consider a system of pairs of equations of the form $\sum_{i\in I}z_i=0,\ \sum_{i\in I}z_i=1$ of weight 1. Mahajan et al. \cite{MahajanRamanSikdar06,MahajanRamanSikdar09} parameterized \textsc{Max Lin} as follows: given a {\sc Max Lin} system $Az=b$, decide whether the total weight of satisfied equations minus $W/2$ is at least $k'$, where $W$ is the total weight of all equations and $k'$ is the parameter. This is equivalent to asking whether the maximum excess is at least $k$, where $k=2k'$ is the parameter. (Note that since $k=2k'$, these two questions are equivalent from the complexity point of view.) Since $W/2$ is the average weight of satisfied equations, we will call the parameterized \textsc{Max Lin} problem \textsc{Max Lin Above Average} or \textsc{Max Lin AA}. Since the parameter $k$ is more convenient for us to use, in what follows we use the version of \textsc{Max Lin AA} parameterized by $k.$ Mahajan et al. \cite{MahajanRamanSikdar06,MahajanRamanSikdar09} raised the question of determining the parameterized complexity of \textsc{Max Lin AA}. It is not hard to see (we explain it in detail in Section \ref{CSPsec}) that we may assume that no two equations in $Az=b$ have the same left-hand side and $n={\rm rank A}$. Using our maximum excess results, we prove that, under these assumptions, (a) \textsc{Max Lin AA} is fixed-parameter tractable if $m\le 2^{p(n)}$ for an arbitrary fixed function $p(n)=o(n)$, and (b) \textsc{Max Lin AA} has a polynomial-size kernel if $m\le 2^{n^a}$ for an arbitrary $a<1$. We conjecture that under the two assumptions if $m<2^{an}$ for some constant $a>0$, then \textsc{Max Lin AA} is W[1]-hard, i.e., result (a) is best possible in a sense. In addition, we prove that \textsc{Max Lin AA} is in XP (thus, \textsc{Max Lin AA} is polynomial-time solvable for every fixed $k$), and, moreover, it is in W[P]. Recall that {\sc Max $r$-Lin AA} is a special case of {\sc Max Lin AA}, where each equation has at most $r$ variables. In {\sc Max Exact $r$-SAT AA} we are given a multiset of $m$ clauses on $n$ variables such that each clause has $r$ variables and asked whether there is a truth assignment to the $n$ variables that satisfies at least $(1-2^{-r})m + k2^{-r}$ clauses. Using our maximum excess results, we prove that for each fixed $r\ge 2$ Max $r$-Lin AA has a kernel with $O(k \log k)$ variables and, thus, it can be solved in time $2^{O(k \log k)}+m^{O(1)}.$ This improves a kernel with $O(k^2)$ variables for Max $r$-Lin AA obtained by Gutin et al. \cite{GutinKimSzeiderYeo09a}. Similarly, we prove that for each $r\ge 2$ {\sc Max Exact $r$-SAT AA} has a kernel with $O(k \log k)$ variables and it can be solved in time $2^{O(k \log k)}+m^{O(1)}$ improving a kernel with $O(k^2)$ variables for {\sc Max Exact $r$-SAT AA} obtained by Alon et al. \cite{AlonSODA2010}. Note that while the kernels with $O(k^2)$ variables were obtained using a probabilistic approach, our results are obtained using an algebraic approach. Using a graph-theoretical approach Alon et al. \cite{AlonSODA2010} obtained a kernel of {\sc Max Exact 2-SAT AA} with $O(k)$ variables, but it is unlikely that their approach can be extended beyond $r=2$. Fourier analysis of pseudo-boolean functions, i.e., functions $f:\ \{-1,+1\}^n\rightarrow \mathbb{R}$, has been used in many areas of computer science(cf. \cite{AlonSODA2010,odonn,deWolf}). In Fourier analysis, the Boolean domain is often assumed to be $\{-1,+1\}^n$ rather than more usual $\{0,1\}^n$ and we will follow this assumption in our paper. Here we use the following well-known and easy to prove fact \cite{odonn} that each function $f:\ \{-1,+1\}^n\rightarrow \mathbb{R}$ can be uniquely written as \begin{equation}\label{eq1}f(x)=\sum_{S\subseteq [n]}c_S\prod_{i\in S}x_i,\end{equation} where $[n]=\{1,2,\ldots ,n\}$ and each $c_S$ is a real. Formula (\ref{eq1}) is the Fourier expansion $f$, $c_S$ are the Fourier coefficients of $f$ (in the literature, these coefficients are often denoted by $\hat{f}(S)$ and we will use both $c_S$ and $\hat{f}(S)$ interchangeably), and the monomials $\prod_{i\in S}x_i$ form an orthogonal basis of (\ref{eq1}) (thus, the monomials are often written as $\chi_S(x)$ but we will use only $\prod_{i\in S}x_i$ as it is more transparent). Optimization of pseudo-boolean functions is useful in many areas including computer science, discrete mathematics, operations research, statistical mechanics and manufacturing; for many results and applications of pseudo-boolean function optimization, see a well-cited survey \cite{BH02}. In classical analysis, there is a large number of lower bounds on the maxima of trigonometric Fourier expansions, cf. \cite{Borwein}. In Section \ref{LBsec}, we prove a sharp lower bound on the maximum of a pseudo-boolean function using its Fourier expansion. The bound can be used in algorithmics, e.g., for approximation algorithms. \section{Results on Maximum Excess}\label{CSPsec} Consider two reduction rules for {\sc Max Lin} introduced in \cite{GutinKimSzeiderYeo09a} for {\textsc{Max Lin AA}}. These rules are of interest due to Lemma \ref{mGEn}. \begin{krule}\label{rulerank} Let $t={\rm rank} A$ and let columns $a^{i_1},\ldots ,a^{i_t}$ of $A$ be linearly independent. Then delete all variables not in $\{z_{i_1},\ldots ,z_{i_t}\}$ from the equations of $Az=b$. \end{krule} \begin{krule}\label{rule1} If we have, for a subset $S$ of $[n]$, an equation $\sum_{i \in S} z_i =b'$ with weight $w'$, and an equation $\sum_{i \in S} z_i =b''$ with weight $w''$, then we replace this pair by one of these equations with weight $w'+w''$ if $b'=b''$ and, otherwise, by the equation whose weight is bigger, modifying its new weight to be the difference of the two old ones. If the resulting weight is~0, we delete the equation from the system. \end{krule} \begin{lemma}\label{mGEn} Let $A'z=b'$ be obtained from $Az=b$ by Rule~\ref{rulerank} or \ref{rule1}. Then the maximum excess of $A'z=b'$ is equal to the maximum excess of $Az=b$. Moreover, $A'z=b'$ can be obtained from $Az=b$ in time polynomial in $n$ and $m$. \end{lemma} To see the validity of Rule~\ref{rulerank}, consider an independent set $I$ of columns of $A$ of cardinality ${\rm rank} A$ and a column $a^{j}\not\in I$. Observe that $a^j=\sum_{i\in I'}a^i,$ where $I'\subseteq I$. Consider an assignment $z=z^0$. If $z^0_j=1$ then for each $i\in I'\cup \{j\}$ replace $z^0_i$ by $z^0_i+1$. The new assignment satisfies exactly the same equations as the initial assignment. Thus, we may assume that $z_j = 0$ and remove $z_j$ from the system. For a different proof, see \cite{GutinKimSzeiderYeo09a}. If we cannot change a weighted system $Az=b$ using Rules~\ref{rulerank} and \ref{rule1}, we call it {\em irreducible}. \vspace{3mm} Consider the following algorithm that tries to maximize the total weight of satisfied equations of $Az=b$. We assume that, in the beginning, no equation or variable in $Az=b$ is marked. \begin{center} \fbox{~\begin{minipage}{11cm} \textsc{Algorithm $\cal H$} \smallskip While the system $Az=b$ is nonempty do the following: \begin{enumerate} \item Choose an arbitrary equation $\sum_{i \in S} z_i =b$ and mark $z_l$, where $l= \min\{i:\ i\in S\}.$ \item Mark this equation and delete it from the system. \item Replace every equation $\sum_{i \in S'} z_i =b'$ in the system containing $z_l$ by $\sum_{i \in S} z_i + \sum_{i \in S'} z_i = b+b'$. \item Apply Reduction Rule \ref{rule1} to the system. \end{enumerate} \smallskip \end{minipage}~} \end{center} Note that algorithm ${\cal H}$ replaces $Az=b$ with an \emph{equivalent} system under the assumption that the marked equations are satisfied; that is, for every assignment of values to the variables $z_1, \dots, z_n$ that satisfies the marked equations, both systems have the same excess. The {\em maximum ${\cal H}$-excess} of $Az=b$ is the maximum possible total weight of equations marked by ${\cal H}$ for $Az=b$ taken over all possible choices in Step 1 of $\cal H$. \begin{lemma}\label{lemH} The maximum excess of $Az=b$ equals its maximum ${\cal H}$-excess. \end{lemma} \begin{proof} We first prove that the maximum excess of $Az=b$ is not smaller than its maximum ${\cal H}$-excess. Let $K$ be the set of equations marked by $\cal H$. A method first described in \cite{CGJ} can find an assignment of values to the variables such that the equations in $K$ are satisfied and, in the remainder of the system, the total weight of satisfied equations is not smaller than the total weight of falsified equations. For the sake of completeness, we repeat the description here. By construction, for any assignment that satisfies all the marked equations, exactly half of the non-marked equations are satisfied. Therefore it suffices to find an assignment to the variables such that all marked equations are satisfied. This is possible if we find an assignment that satisfies the last marked equation, then find an assignment satisfying the equation marked before the last, etc. Indeed, the equation marked before the last contains a (marked) variable $z_l$ not appearing in the last equation, etc. This proves the first part of our lemma. Now we prove that the maximum ${\cal H}$-excess of $Az=b$ is not smaller than its maximum excess. Let $z = (z_1,\ldots ,z_n)$ be an assignment that achieves the maximum excess, $t$. Observe that if at each iteration of $\cal H$ we mark an equation that is satisfied by $z$, then $\cal H$ will mark equations of total weight $t$. \end{proof} \begin{remark}\label{rem1} {\rm It follows from Lemma \ref{lemH} that the maximum excess of a (nonempty) irreducible system $Az=b$ with smallest weight $w_{\min}$ is at least $w_{\min}$. If all weights are integral, then the maximum excess of $Az=b$ is at least 1.} \end{remark} Clearly, the total weight of equations marked by $\cal H$ depends on the choice of equations to mark in Step 1. Below we consider one such choice based on the following theorem. The theorem allows us to find a set of equations such that we can mark each equation in the set in successive iterations of $\cal H$. This means we can run $\cal H$ a guaranteed number of times, which we can use to get a lower bound on the ${\cal H}$-excess. \begin{theorem}\label{thmKcon} Let $M$ be a set in $\mathbb{F}^n_2$ such that $M$ contains a basis of $\mathbb{F}^n_2$, the zero vector is in $M$ and $|M|<2^n$. If $k$ is a positive integer and $k+1\le |M|\le 2^{n/k}$ then, in time $|M|^{O(1)}$, we can find a subset $K$ of $M$ of $k+1$ vectors such that no sum of two or more vectors of $K$ is in $M$. \end{theorem} \begin{proof} We first consider the case when $k = 1$. Since $|M|<2^n$ and the zero vector is in $M$, there is a non-zero vector $v\not\in M$. Since $M$ contains a basis for $\mathbb{F}^n_2$, $v$ can be written as a sum of vectors in $M$ and consider such a sum with the minimum number of summands: $v=u_1+\cdots + u_{\ell}$, $\ell \ge 2$. Since $u_1+u_2\not\in M$, we may set $K=\{u_1,u_2\}.$ We can find such a set $K$ in polynomial time by looking at every pair in $M\times M$. We now assume that $k>1$. Since $k+1\le |M|\le 2^{n/k}$ we have $n\ge k+1.$ We proceed with a greedy algorithm that tries to find $K$. Suppose we have a set $L = \{a_1,\ldots ,a_l\}$ of vectors in $M$, $l \le k$, such that no sum of two or more elements of $L$ is in $M$. We can extend this set to a basis, so $a_1=(1,0,0,\ldots ,0),\ a_2=(0,1,0,\ldots ,0)$ and so on. For every $a \in M \backslash L$ we check whether $M \backslash \{a_1,\ldots, a_l, a\}$ has an element that agrees with $a$ in all co-ordinates $l+1, \ldots, n$. If no such element exists, then we add $a$ to the set $L$, as no element in $M$ can be expressed as a sum of $a$ and a subset of $L$. If our greedy algorithm finds a set $L$ of size at least $k+1$, we are done and $L$ is our set $K$. Otherwise, we have stopped at $l \le k$. In this case, we do the next iteration as follows. Recall that $L$ is part of a basis of $M$ such that $a_1 = (1,0,0, \ldots, 0),\ a_2 = (0,1,0, \dots , 0), \ldots .$ We create a new set $M'$ in $\mathbb{F}^{n'}_2$, where $n' = n-l$. We do this\footnote{For the reader familiar with vector space terminology: $\mathbb{F}^{n'}_2$ is $\mathbb{F}^n_2$ modulo ${\rm span}(L)$, the subspace of $\mathbb{F}^n_2$ spanned by $L$, and $M'$ is the image of $M$ in $\mathbb{F}^{n'}_2$.} by removing the first $l$ co-ordinates from $M$, and then identifying together any vectors that agree in the remaining $n'$ co-ordinates. We are in effect identifying together any vectors that only differ by a sum of some elements in $L$. It follows that every element of $M'$ was created by identifying together at least two elements of $M$, since otherwise we would have had an element in $M\backslash L$ that should have been added to $L$ by our greedy algorithm. Therefore it follows that $|M'| \le |M|/2 \le 2^{n/k -1}$. From this inequality and the fact that $n' \ge n - k$, we get that $|M'| \le 2^{n'/k}.$ It also follows by construction of $M'$ that $M'$ has a basis for $\mathbb{F}^{n'}_2$, and that the zero vector is in $M'$. (Thus, we have $|M'|\ge n'+1$.) If $n'\ge k+1$ we complete this iteration by running the algorithm on the set $M'$ as in the first iteration. Otherwise ($n'\le k$), the algorithm stops. Since each iteration of the algorithm decreases $n'$, the algorithm terminates. Now we prove that at some iteration, the algorithm will actually find a set $K$ of $k+1$ vectors. To show this it suffices to prove that we will never reach the point when $n' \le k$. Suppose this is not true and we obtained $n' \le k$. Observe that $n'\geq 1$ (before that we had $n'\geq k+1$ and we decreased $n'$ by at most $k$) and $|M'|\geq n'+1$. Since $|M'|\leq 2^{n'/k}$, we have $n'+1\leq 2^{n'/k}$, which is impossible due to $n'\leq k$ unless $n'=1$ and $k=1$, a contradiction with the assumption that $k>1$. It is easy to check that the running time of the algorithm is polynomial in $|M|.$ \end{proof} \begin{remark} {\rm It is much easier to prove a non-constructive version of the above result. In fact we can give a non-constructive proof that $k+1\le |M|\le 2^{n/k}$ can be replaced by $2k<|M|<2^{n/k}((k-1)!)^{1/k}$. We will extend our proof above for the case $k=1$. We may assume that $k\ge 2$. Observe that the number of vectors of $\mathbb{F}^n_2$ that can be expressed as the sum of at most $k$ vectors of $M$ is at most $$\binom{|M|}{k} + \binom{|M|}{k-1} + \dots + \binom{|M|}{1} + 1 \le {|M|^k}/{(k-1)!} \text{ for }|M|> 2k.$$ Since $|M|<2^{n/k}((k-1)!)^{1/k}$ we have $|\mathbb{F}^n_2|>{|M|^k}/{(k-1)!}$ and, thus, at least for one vector $a$ of $\mathbb{F}^n_2$ we have $a=m_1+\cdots + m_{\ell}$, where $\ell$ is minimum and $\ell>k.$ Note that, by the minimality of $\ell$, no sum of two or more summands of the sum for $a$ is in $M$ and all summands are distinct. Thus, we can set $K=\{m_1,\ldots ,m_{k+1}\}.$ } \end{remark} \begin{theorem}\label{lemYes} Let $Az=b$ be an irreducible system, let $w_{\min}$ be the minimum weight of an equation in $Az=b$, and let $k\ge 2.$ If $k\le m\le 2^{n/(k-1)}-2$, then the maximum excess of $Az=b$ is at least $k\cdot w_{\min}$. Moreover, we can find an assignment that achieves an excess of at least $k\cdot w_{\min}$ in time $m^{O(1)}$. \end{theorem} \begin{proof} Consider a set $M$ of vectors in $\mathbb{F}_2^n$ corresponding to equations in $Az=b$ as follows: for each $\sum_{i \in S} z_i =b_S$ in $Az=b$, the vector $v=(v_1,\ldots ,v_{n})\in M$, where $v_i=1$ if $i\in S$ and $v_i=0$, otherwise. Add the zero vector to $M$. As $Az=b$ is reduced by Rule \ref{rulerank} and $k\le m\le 2^{n/(k-1)}-2$, we have that $M$ contains a basis for $\mathbb{F}^n_2$ and $k\le |M| \le 2^{n/(k-1)}-1$. Therefore, using Theorem \ref{thmKcon} we can find a set $K$ of $k$ vectors such that no sum of two or more vectors in $K$ belongs to $M.$ Now run Algorithm $\cal H$ choosing at each Step 1 an equation of $Az=b$ corresponding to a member of $K$, then equations picked at random until the algorithm terminates. Algorithm $\cal H$ will run at least $k$ iterations as no equation corresponding to a vector in $K$ will be deleted before it has been marked. Indeed, suppose that this is not true. Then there are vectors $w\in K$ and $v\in M$ and a pair of nonintersecting subsets $K'$ and $K''$ of $K\setminus \{v,w\}$ such that $w+\sum_{u\in K'}u=v+\sum_{u\in K''}u$. Thus, $v=w+\sum_{u\in K'\cup K''}u$, a contradiction with the definition of $K.$ In fact, the above argument shows that no equation of $Az=b$ corresponding to a member of $K$ will change its weight during the first $k$ iterations of $\cal H$. Thus, by Lemma \ref{lemH}, the maximum excess of $Az=b$ is at least $k\cdot w_{\min}$. It remains to observe that we can once again use the algorithm given in the proof of Lemma \ref{lemH} to find an assignment that gives an excess of at least $k\cdot w_{\min}$. \end{proof} We now provide a useful association between weighted systems of linear equations on $\mathbb{F}^n_2$ and Fourier expansions of functions $f:\ \{-1,+1\} \rightarrow \mathbb{R}$. Let us rewrite (\ref{eq1}), the Fourier expansion of such a function, as \begin{equation}\label{eq2}f(x)=\hat{f}(\emptyset)+\sum_{S\in {\cal F}}c_S\prod_{i\in S}x_i,\end{equation} where ${\cal F}=\{\emptyset\neq S\subseteq [n]:\ c_S\neq 0\}.$ Now associate the polynomial $\sum_{S\in {\cal F}}c_S\prod_{i\in S}x_i$ in (\ref{eq2}) with a weighted system $Az=b$ of linear equations on $\mathbb{F}^n_2$: for each $S\in {\cal F}$, we have an equation $\sum_{i\in S}z_i=b_S$ with weight $|c_S|$, where $b_S=0$ if $c_S$ is positive and $b_S=1$, otherwise. Conversely, suppose we have a system $Az=b$ of linear equations on $\mathbb{F}^n_2$ in which each equation $\sum_{i \in S} z_i =b_S$ is assigned a weight $w_S>0$ and no pair of equations have the same left-hand side. This system can be associated with the polynomial $\sum_{S\in {\cal F}}c_S\prod_{i\in S}x_i,$ where $c_S=w_S$, if $b_S=0$, and $c_S=-w_S$, otherwise. The above associations provide a bijection between Fourier expansions of functions $f:\ \{-1,+1\} \rightarrow \mathbb{R}$ with $\hat{f}(\emptyset)=0$ and weighted systems of linear equations on $\mathbb{F}^n_2$. This bijection is of interest due to the following: \begin{proposition}\label{lemFS} An assignment $z^{(0)}=(z^{(0)}_1,\ldots ,z^{(0)}_n)$ of values to the variables of $Az=b$ maximizes the total weight of satisfied equations of $Az=b$ if and only if $x^{(0)}=((-1)^{z^{(0)}_1},\ldots ,(-1)^{z^{(0)}_n})$ maximizes $f(x).$ Moreover, $\max_{x\in \{-1,+1\}^n}f(x)- \hat{f}(\emptyset)$ equals the maximum excess of $Az=b.$ \end{proposition} \begin{proof} The claims of this lemma easily follow from the fact that an equation $\sum_{i\in S}z_i=0$ is satisfied if and only if $\prod_{i\in S}x_i>0,$ where $x_i=(-1)^{z_i}.$ \end{proof} \section{Corollaries} \label{LBsec} This section contains a collection of corollaries of Theorem \ref{lemYes} establishing parameterized complexity of special cases of {\sc Max Lin AA}, of {\sc Max Exact $r$-SAT}, and of a wide class of constraint satisfaction problems. In addition, we will prove that {\sc Max Lin AA} is in X[P] and obtain a sharp lower bound on the maximum of a pseudo-boolean function. \subsection{Parameterized Complexity of Max Lin AA} \begin{corollary}\label{fptT} Let $p(n)$ be a fixed function such that $p(n)=o(n)$. If $m\le 2^{p(n)}$ then {\textsc{Max Lin AA}} is fixed-parameter tractable. Moreover, a satisfying assignment can be found in time $g(k)m^{O(1)}$ for some computable function $g$. \end{corollary} \begin{proof} We may assume that $m \ge n > k > 1.$ Observe that $m\le 2^{n/k}$ implies $m\le 2^{n/(k-1)}-2$. Thus, by Theorem \ref{lemYes}, if $p(n)\le n/k$, the answer to {\textsc{Max Lin AA}} is {\sc yes}, and there is a polynomial algorithm to find a suitable assignment. Otherwise, $n\le f(k)$ for some function dependent on $k$ only and {\textsc{Max Lin AA}} can be solved in time $2^{f(k)}m^{O(1)}$ by checking every possible assignment. \end{proof} Let $\rho_i$ be the number of equations in $Az=b$ containing $z_i$, $i=1,\ldots ,n$. Let $\rho=\max_{i\in [n]}\rho_i$ and let $r$ be the maximum number of variables in an equation of $Az=b$. Crowston et al. \cite{CGJ} proved that {\textsc{Max Lin AA}} is fixed-parameter tractable if either $r\le r(n)$ for some fixed function $r(n)=o(n)$ or $\rho\le \rho(m)$ for some fixed function $\rho(m)=o(m)$. For a given $r=r(n)$, we have $m\le \sum_{i=1}^r{n \choose i}$. By Corollary 23.6 in \cite{jukna}, $m\le 2^{nH(r/n)}$, where $H(y)=-y \log_2 y - (1-y) \log_2 (1- y)$, the entropy of $y.$ It is easy to see that if $y=o(n)/n$, then $H(y)=o(n)/n.$ Hence, if $r(n)=o(n)$, then $m\le 2^{o(n)}.$ By Corollary 23.5 in \cite{jukna} (this result was first proved by Kleitman et al. \cite{kleitman}), for a given $\rho=\rho(m)$ we have $m\le 2^{nH(\rho/m)}.$ Therefore, if $\rho(m)=o(m)$ then $m\le 2^{n\cdot o(m)/m}$ and, thus, $m\le 2^{o(n)}$ (as $n\le m$, if $n\rightarrow \infty$ then $m\rightarrow \infty$ and $o(m)/m\rightarrow 0$). Thus, both results of Crowston et al. \cite{CGJ} follow from corollary \ref{fptT}. \vspace{3mm} Similarly to Corollary \ref{fptT} it is easy to prove the following: \begin{corollary} Let $0<a<1$ be a constant. If $m<2^{O(n^{a})}$ then {\textsc{Max Lin AA}} has a kernel with $O(k^{1/(1-a)})$ variables. \end{corollary} By Corollary \ref{fptT} it is easy to show that {\textsc{Max Lin AA}} is in XP. \begin{proposition} {\textsc{Max Lin AA}} can be solved in time $O(m^{k+O(1)}).$ \end{proposition} \begin{proof} We may again assume $m \ge n > k>1.$ As in the proof of Corollary \ref{fptT}, if $m\le 2^{n/k}$ then the answer to {\textsc{Max Lin AA}} is {\sc yes} and a solution can be found in time $m^{O(1)}$. Otherwise, $2^n<m^k$ and {\textsc{Max Lin AA}} can be solved in time $O(m^{k+2}).$ \end{proof} In fact, it is possible to improve this result, as the next theorem shows. \begin{theorem} \label{thmWP} {\textsc{Max Lin AA}} is in W[P]. \end{theorem} To prove this theorem we make use of the following lemma from \cite{FlumGrohe06} (Lemma 3.8, p. 48). Here $k(x)$ is the value of the parameter on an instance $x\in \Sigma^{\ast}.$ \begin{lemma} \label{lemWP} A parameterized problem $(Q,k)$ over the alphabet $\Sigma$ is in W[P] if and only if there are computable functions $f,h: \mathbb{N} \rightarrow \mathbb{N}$, a polynomial $p(X)$, and a $Y \subseteq \Sigma^{\ast} \times \{ 0,1 \}^{\ast}$ such that: \begin{description} \item[(i)] For all $(x,y) \in \Sigma^{\ast}\times \{ 0,1 \}^{\ast}$, it is decidable in time $f(k(x))\cdot p(|x|)$ whether $(x,y) \in Y$. \item[(ii)] For all $(x,y) \in \Sigma^{\ast}\times \{ 0,1 \}^{\ast}$, if $(x,y) \in Y$ then $|y| = h(k(x)) \cdot \lfloor \log_2|x| \rfloor.$ \item[(iii)] For every $x \in \Sigma^{\ast}$ $$x \in Q \Longleftrightarrow \text{there exists a } y \in \{ 0,1 \}^{\ast} \text{such that } (x,y) \in Y.$$ \end{description} \end{lemma} \begin{proof}[Proof of Theorem \ref{thmWP}] Recall from Lemma \ref{lemH} that the maximum excess of $Az=b$ is at least $k$ if and only if we can run algorithm $\cal H$ a number of times and get a total weight of marked equations at least $k$. Suppose we are given a sequence $e_1, \ldots, e_l$ of equations to mark in each iteration of $\cal H$. We can, at the $i$'th iteration of $\cal H$, mark equation $e_i$ as long as $e_i$ is still in the system. If we are able to mark all the equations $e_1, \ldots e_l$, we can then check that the total weight of these marked equations is at least $k$. If it is, then we know we have a {\sc yes}-instance. Conversely, if the system has a maximum excess of at least $k$, then there will be some sequence $e_1, \ldots, e_l$ that gives us a total weight of marked equations at least $k$. Furthermore, by integrality of the weights, we may assume that $l \le k$. We use this idea to construct a set $Y$ that satisfies the conditions of Lemma \ref{lemWP}. Firstly we show that a sequence of $l \le k$ equations can be encoded as a string $y \in \{ 0,1 \}^{\ast}$ of length $2k \cdot \lfloor \log_2|x| \rfloor$, where $x$ is an instance of {\textsc{Max Lin AA}}. Let the equations be numbered from $1$ to $m$, then we can express a sequence of equations $e_1, \ldots e_l$, as a sequence of $k$ integers between $0$ and $m$ (if $l < k$ then we end the sequence with $k-l$ zeroes). Each integer between $0$ and $m$ can be expressed by a string in $\{ 0,1 \}^{\ast}$ of length at most $\lceil \log_2m \rceil \le \lceil \log_2|x| \rceil$, so certainly it can be expressed by a string of length $2 \lfloor \log_2|x| \rfloor$. Therefore we can express the $k$ integers as a string of length $2k \cdot \lfloor \log_2|x| \rfloor$. For an instance $x$ of {\textsc{Max Lin AA}} and a string $y \in \{ 0,1 \}^{\ast}$, let us call $y$ a \emph{certificate for $x$} if $|y| = 2k \cdot \lfloor \log_2|x| \rfloor$ and $y$ encodes a sequence of $k$ integers corresponding to a sequence of equations $e_1, \ldots, e_l$ in $x$, such that by marking each equation in turn in iterations of $\cal H$, we get a set of marked equations of weight at least $k$. It follows that $x$ is a {\sc yes}-instance if and only if there exists a certificate for $x$. Furthermore we can check in polynomial time whether $y$ is a certificate of $x$ by trying to convert $y$ into a sequence of equations and running algorithm $\cal H$ marking those equations. (This is in fact a stronger result than we require for this proof - we only need that the algorithm is fixed-parameter tractable rather than polynomial.) We now let $$Y = \{ (x,y) \in \Sigma^{\ast}\times \{ 0,1 \}^{\ast} | x \text{ is a {\sc yes}-instance of {\textsc{Max Lin AA}} and } y \text{ is a certificate of } x \}$$ and let $Q$ be the set of all {\sc yes}-instances of {\textsc{Max Lin AA}}. By definition of $Y$ and the definition of a certificate, conditions (ii) and (iii) of Lemma \ref{lemWP} are satisfied. As we can determine in polynomial time whether $y$ is a certificate for $x$, condition (i) is also satisfied. Therefore, by Lemma \ref{lemWP}, {\textsc{Max Lin AA}} is in W[P]. \end{proof} \subsection{Max $r$-Lin AA, Max Exact $r$-SAT AA and Max $r$-CSP AA} Using Theorem \ref{lemYes} we can prove the following two results. \begin{corollary}\label{cor1} Let $r\ge 2$ be a fixed integer. Then {\sc Max $r$-Lin AA} has a kernel with $O(k \log k)$ variables and can be solved in time $2^{O(k \log k)} + m^{O(1)}$. \end{corollary} \begin{proof} Observe that $m\le n^r$ and $n^r\le 2^{n/(k-1)}-2$ if $n\ge c(r)k\log_2 k$ provided $c(r)$ is large enough ($c(r)$ depends only on $r$). Thus, by Theorem \ref{lemYes}, if $n\ge c(r)k\log_2 k$ then the answer to {\sc Max $r$-Lin AA} is {\sc yes}. Hence, we obtain a problem kernel with at most $c(r)k\log_2 k=O(k \log k)$ variables and, therefore, can solve {\sc Max $r$-Lin AA} in time $2^{O(k \log k)} + m^{O(1)}$. \end{proof} \begin{corollary}\label{cor2} Let $r\ge 2$ be a fixed integer. Then there is a bikernel from {\sc Max Exact $r$-SAT} to {\sc Max $r$-Lin AA} with $O(k \log k)$ variables. Moreover, {\sc Max Exact $r$-SAT} has a kernel with $O(k \log k)$ variables and can be solved in time $2^{O(k \log k)} + m^{O(1)}$. \end{corollary} \begin{proof} Let $F$ be an $r$-CNF formula with clauses $C_1,\ldots ,C_m$ in the variables $x_1, x_2, \ldots ,x_n$. We may assume that $x_i \in \{-1,1\}$, where $-1$ corresponds to {\sc true}. For $F$, following \cite{AlonSODA2010} consider \[ g(x)=\sum_{C\in F}[1-\prod_{x_i\in {\rm var}(C)}(1+\epsilon_ix_i)], \] where ${\rm var}(C)$ is the set of variables of $C$, $\epsilon_i\in \{-1,1\}$ and $\epsilon_i=1$ if and only if $x_i$ is in~$C$. It is shown in \cite{AlonSODA2010} that the answer to {\sc Max Exact $r$-SAT} is {\sc yes} if and only if there is a truth assignment $x^0$ such that $g(x^0)\ge k.$ Algebraic simplification of $g(x)$ will lead us to Fourier expansion of $g(x)$: \begin{equation}g(x)=\sum_{S\in {\cal F}}c_S\prod_{i\in S}x_i,\end{equation} where ${\cal F}=\{\emptyset\neq S\subseteq [n]:\ c_S\neq 0, |S|\le r \}$. Thus, $|{\cal F}|\le n^r$. By Proposition \ref{lemFS}, $\sum_{S\in {\cal F}}c_S\prod_{i\in S}x_i$ can be viewed as an instance of {\sc Max $r$-Lin} and, thus, we can reduce {\sc Max Exact $r$-SAT} into {\sc Max $r$-Lin} in polynomial time (the algebraic simplification can be done in polynomial time as $r$ is fixed). By Corollary \ref{cor1}, {\sc Max $r$-Lin} has a kernel with $O(k \log k)$ variables. This kernel is a bikernel from {\sc Max Exact $r$-SAT} to {\sc Max $r$-Lin}. Using this bikernel, we can solve {\sc Max Exact $r$-SAT} in time $2^{O(k \log k)} + m^{O(1)}$. It remains to use the transformation described in \cite{AlonSODA2010} of a bikernel from {\sc Max Exact $r$-SAT} to {\sc Max $r$-Lin} into a kernel of {\sc Max Exact $r$-SAT}. This transformation gives us a kernel with $O(k \log k)$ variables. \end{proof} In the Boolean Max-$r$-Constraint Satisfaction Problem ({\sc Max-$r$-CSP}), we are given a collection of Boolean functions, each involving at most $r$ variables, and asked to find a truth assignment that satisfies as many functions as possible. We will consider the following parameterized version of {\sc Max-$r$-CSP}. We are given a set $\Phi$ of Boolean functions, each involving at most $r$ variables, and a collection ${\cal F}$ of $m$ Boolean functions, each $f \in \cal F$ being a member of $\Phi$, and each acting on some subset of the $n$ Boolean variables $x_1,x_2, \ldots ,x_n$ (each $x_i\in \{-1,1\}$). We are to decide whether there is a truth assignment to the $n$ variables such that the total number of satisfied functions is at least $E+k2^{-r}$, where $E$ is the average value of the number of satisfied functions. \begin{corollary}\label{cor3} Let $r\ge 2$ be a fixed integer. Then there is a bikernel from {\sc Max $r$-CSP} to {\sc Max $r$-Lin AA} with $O(k \log k)$ variables. {\sc Max $r$-CSP} can be solved in time $2^{O(k \log k)} + m^{O(1)}$. \end{corollary} \begin{proof} Following \cite{AGK04} for a boolean function $f$ of $r(f)\le r$ boolean variables $ x_{i_1}, \ldots , x_{i_{r(f)}}, $ introduce a polynomial $h_f(x),\ x=(x_1, x_2, \ldots ,x_n)$ as follows. Let $V_f \subset \{-1,1\}^{r(f)}$ denote the set of all satisfying assignments of $f$. Then $$ h_f(x) = 2^{r-r(f)}\sum_{(v_1, \ldots ,v_{r(f)}) \in V_f} [\prod_{j=1}^{r(f)} (1+x_{i_j} v_j) - 1]. $$ Let $h(x)=\sum_{f \in \cal F} h_f(x).$ It is easy to see (cf. \cite{AlonSODA2010}) that the value of $h(x)$ at $x^0$ is precisely $2^r(s-E)$, where $s$ is the number of the functions satisfied by the truth assignment $x^0$, and $E$ is the average value of the number of satisfied functions. Thus, the answer to {\sc Max-$r$-CSP} is {\sc yes} if and only if there is a truth assignment $x^0$ such that $h(x^0)\ge k.$ The rest of the proof is similar to that of Corollary \ref{cor2}. \end{proof} \subsection{Lower Bound on Maxima of Pseudo-boolean Functions}\label{PBsec} \begin{corollary}\label{CLBT} We have $\max_{x\in \{-1,+1\}^n}f(x) \ge \hat{f}(\emptyset) + (1+\lfloor \frac{{\rm rank} A}{\log_2 (|{\cal F}|+2)} \rfloor) \cdot \min_{S\in {\cal F}}|\hat{f}(S)|.$ \end{corollary} \begin{proof} Consider the system $Az=b$ associated with the Fourier expansion of $f$ according to the bijection described before Proposition \ref{lemFS}. We may assume that the weighted system $Az=b$ has been simplified using Rule~\ref{rulerank} and, thus, its number $n'$ of variables equals ${\rm rank} A$. Note that $n'\le m$, where $m$ is the number of equations in $Az=b$. By Theorem \ref{lemYes}, Proposition \ref{lemFS} and the fact that $\min_{S\in {\cal F}}|\hat{f}(S)| = \min_jw_j$, it follows that if $k\le m\leq 2^{n'/(k-1)}-2$ then $$\max_{x\in \{-1,+1\}^n}f(x) - \hat{f}(\emptyset) \ge k\min_{S\in {\cal F}}|\hat{f}(S)|.$$ To complete the proof, recall that $n'={\rm rank} A$, $m=|{\cal F}|$ and observe that the maximum possible (integral) value of $k$ satisfying $m\leq 2^{n'/(k-1)}-2$ is $1+\lfloor \frac{{\rm rank} A}{\log_2 (|{\cal F}|+2)} \rfloor$. \end{proof} This bound is tight. Indeed, consider the function $f(x)=-\sum_{\emptyset\neq S\subseteq [n]}\prod_{i\in S}x_i.$ Observe that $n={\rm rank} A$, $|{\cal F}|=2^n-1$ and, thus, $\max_{x\in \{-1,+1\}^n}f(x)\ge 1+\lfloor \frac{{\rm rank} A}{\log_2 (|{\cal F}|+2)} \rfloor = 1.$ If $x=(1,1,\ldots ,1)$ then $f(x)=-|{\cal F}|$ and if we set some $x_i=-1$ then after canceling out of monomials we see that $f(x)=1$. Therefore, $\max_{x\in \{-1,+1\}^n}f(x)=1,$ and, thus, the bound of corollary \ref{CLBT} is tight. It is easy to see that the bound remains tight if we delete one monomial from $f(x)$. A sightly more complicated function showing that the bound is tight is as follows: $g(x)=-\sum_{\emptyset\neq S\subseteq [n_1]}\prod_{i\in S}x_i - \sum_{S\in {\cal G}}\prod_{i\in S}x_i,$ where $n_1<n$ and ${\cal G}=\{S:\ \emptyset\neq S\subseteq [n], [n_1]\cap S = \emptyset\}.$ \begin{remark} {\rm Consider {\sc Max Lin} with irreducible system $Az=b$ in which every equation is of weight 1. Then the bound of Theorem \ref{CLBT} gives an $(1/2 + (1+\delta)/m)$-approximation for {\sc Max Lin}, where $\delta=\lfloor n/\log_2 (m +2) \rfloor$. This is of interest since by the result of H{\aa}stad mentioned in Section \ref{section:intro}, $(1/2+\epsilon)$-approximation is impossible for any constant $\epsilon >0$ unless P=NP. }\end{remark} \vspace{3mm} \medskip \paragraph{Acknowledgments} Gutin is thankful to Ilia Krasikov and Daniel Marx for discussions on the topic of the paper. Research of Gutin, Jones and Kim was supported in part by an EPSRC grant. Research of Gutin was also supported in part by the IST Programme of the European Community, under the PASCAL 2 Network of Excellence. Research of Ruzsa was supported by ERC--AdG Grant No. 228005 and Hungarian National Foundation for Scientific Research (OTKA), Grants No. 61908. \urlstyle{rm}
\section{Introduction} Thin magnetic films have been the subject of intense attention over the last two decades \cite{mac95,wu05,vater00}. Most studies have been motivated mainly by the technological applications of these structures \cite{bader06}. But, they also faced statistical physicists with the challenge of trying to answer many foundational questions regarding the role of microscopic interactions in the macroscopic behavior of a large system. These quasi two-dimensional structures show a large variety of ordering effects including formation of striped states, reorientation transitions, bubbles formation in presence of magnetic fields and hysteresis \cite{all92,kash93,mar07}. At the origins of these phenomena is the competition between a short-ranged interaction favoring local order and a long-range interaction frustrating it on larger spatial scales. The role of the long-range interaction is to avoid the {\em global } phase separation favored by the short-ranged interaction promoting, instead, a state of phase separation at {\em mesoscopic or nano-scales}. Then, it is not, in general, a small perturbation,\cite{barci07} but must be considered as precisely as possible. From a computational point of view, this means that the frustrating interaction has to be accounted for by involving all the lattice sites in the computation, which in turn limits the actual system size that can be handled in Monte Carlo simulations. On the other hand, to obtain exact results on multi-scale, multi-interaction systems is extremely difficult, so that simulations are often the only source of information. Model Hamiltonians taking into account short-ranged exchange ferromagnetic and long-range dipolar anti-ferromagnetic interactions have been used to reproduce many of the elemental features observed in experiments of magnetic systems \cite{hub98}. Unfortunately, and despite the obvious relevance from the experimental point of view of the presence of an external magnetic field, most of the numerical studies so far have concentrated their attention on the zero magnetic field case ($H=0$). This is in part because of the already very rich and complex phenomenology obtained by tuning the strengths of the exchange and the dipolar interactions, but also because of the almost prohibitive computational cost of the simulations, even for moderated lattice sizes. To fill this gap, we use extensive Monte Carlo simulations to determine the role of an external magnetic field in the thermodynamical properties of quasi two-dimensional magnetic systems. We present results for systems where exchange and dipolar interactions are comparable and where the anisotropy contribution to the Hamiltonian is very large. The work is organized as follows: In section \ref{model} we present the model and review some of its properties. In section \ref{sim} we give details about the Monte Carlo simulations and discuss the motivation for the parameters used and its connections with previous reports in the literature. Then, in section \ref{rd} we present and discuss our results. This section is organized in three parts, we first present and analyze the $H-T$ phase diagram of the model, then we provide some insight on the ground state structure of the different phases, and finally we characterize the transitions between these phases. Finally, in section \ref{conc} the conclusions of the work appear. \section{The Model} \label{model} We consider a square lattice of Ising spins oriented perpendicularly to the plane of the lattice and interacting through the dimensionless Hamiltonian \begin{equation} {\cal H} = -\delta\sum_{\langle ij\rangle }S_iS_j+ \sum_{i\neq j}\frac{S_iS_j}{r_{ij}^3}-H\sum_i S_i \label{ham} \end{equation} \noindent where $S_i=\pm1$ is the value of the spin at site $i$. The first sum runs over all pairs of nearest neighbor spins and the second over all pair of spins in the lattice. The discreteness of $S_i$ is consistent with infinite or very large magnetic anisotropy \cite{hub98}. The parameter $\delta=J_e/J_d$ stands for the ratio between the strength of the exchange and dipolar interactions, $J_e$ and $J_d$ respectively. $H$ is the magnetic field intensity (in units of $J_d$) and $r_{ij}$ is the distance, measured in crystal units, between sites $i$ and $j$. This model, but in zero external magnetic field, has been extensively studied\cite{deb00,cannas06,booth95,cannas04,arlett96}. For example, it is now well understood that in a wide range of values of $\delta$ its ground state consists in stripes of anti-parallel spins with a width that increases with $\delta$ \cite{booth95}. Once the temperature is turned on, the situation becomes more complex and, in a $\delta-T$ phase diagram, one can recognize a zoology of phases, stripes of different widths, paramagnetic phases, tetragonal, smectic, nematic, and others \cite{mac95,cannas04}. Roughly speaking, at zero field the system presents a first order phase transition between a low temperature phase of stripes and a high temperature tetragonal phase with broken translational and rotational symmetry. It was also shown \cite{cannas06} that for a narrow window around $\delta=4$ the model develops a nematic phase where the system has short range positional order but long range orientational order. On the other hand, in ref. \cite{garel82} Garel and Doniach study analytically the $H-T$ phase diagram of a continuous Landau-like model with dipolar interactions. They conclude that the $H-T$ plane is characterized by three different phases: stripes, bubbles and ferromagnetic. Their analysis also suggests a scenario with Fluctuation Induced First Order Transitions (FIFOT)\cite{bra75} between the phases, or a second-order melting of the Kosterlitz-Thouless (KT)\cite{kost73} type for the bubble-ferromagnetic transition. While some of this phenomenology is confirmed by our simulations, we will show below that the phase diagram resulting from the Hamiltonian (\ref{ham}) is even richer. Numerical simulations using Langevin Dynamics\cite{fer06,jagla04,nicolao07} on similar Landau-like models seem to support the general picture described in \cite{garel82}. In particular, in ref. \cite{jagla04} the author studies the behavior of the system under external magnetic field, but focus his attention mainly on the role of metastable configurations, the presence of hysteresis loops and memory effects. Therefore, the predictions of ref. \cite{garel82} are still waiting for conclusive numerical support. For the particular case of the Hamiltonian (\ref{ham}), the correctness of the predictions of Garel and Doniach \cite{garel82} is even less clear. While at first one expects that the correspondence between the standard ferromagnetic Ising model and the continuous $\phi^4$ model persists even in the presence of the dipolar term, the existence of commensuration effects, typical of striped patterns in discrete Ising systems, may alter this intuition. For example, the authors of reference \cite{arlett96} studied the $H-T$ phase diagram of Hamiltonian (\ref{ham}) using Montecarlo simulations and found no evidence for the transition to a bubble phase, suggested a continuous character for a stripe-tetragonal boundary and reported some unexpected jumps in the magnetization versus temperature curves. In this sense our work revisits these previous simulations looking with more attention to the effect of the magnetic field at low temperatures. Some of the results already seen in \cite{arlett96} are confirmed and, we think, analyzed in more detail and from a different perspective. Some results support the predictions of \cite{garel82}, and others, to our knowledge, are new, and enrich the already complex phenomenology of these systems. \section{Simulation} \label{sim} We centered our analysis on the value $\delta=4$ which corresponds to a zero field ground state of perfect alternating stripes of width $h=2$. So, for the smaller system sizes considered we have $8$ periods of modulated stripes. In all cases the size of the system $L$ was properly commensurate with the period of the $H=0$ modulated phase. Arlett et al. \cite{arlett96} used values of $\delta$ between $6$ and $8$, having stripes of width $h=4$ and $6$ respectively. So, for the system sizes they consider $4$ or at most $6$ periods of the modulated structures are present. As we will discuss below this makes difficult to interpret some of the consequences of the presence of $H$. This value of $\delta=4$ is representative for proved first order stripes-tetragonal transition in $H=0$ but it is also known to be of the order of real magnetic-frustrated systems seen in experimental works \cite{deb00}. Some connections between experimental systems and values of relative strengths of interactions in theoretical models can be found in reference \cite{bland95}. More recently, Carubelli et al. \cite{mar07} qualitatively reproduced detailed measurements of magnetic changes of samples of Fe/Ni/Cu(001) \cite{wong05} by means of a Heisenberg-spins model, very similar to Hamiltonian (\ref{ham}), using a value of $\delta=6$. To build the phase diagram, the system is first initialized in the equilibrium configuration at a fixed temperature and zero magnetic field. To guarantee equilibration the magnetic field is increased very slowly $10^{-4}\leq\Delta H\leq10^{-2}$ and for each $(H,T)$ point, we let the system relax for $t_1=10^6$ Montecarlo steps (mcs) using a Metropolis dynamics. Once equilibrated, the system evolves over other $t_2=10^7$ mcs to measure the physical quantities of interest. We impose periodic boundary conditions to limit finite size effects and explore different values of temperature and field for linear system sizes up to $L=48$. To account for the long-range interactions we implement the Ewald Summation Technique \cite{all94} adapted to the particular case of the magnetic dipolar potential \cite{rdm03}. \section{Results and Discussion} \label{rd} \subsection{Phase Diagram} The main result of this work is shown in figure \ref{diag}. This is the $H-T$ phase diagram of the model represented by the Hamiltonian (\ref{ham}). \begin{figure}[!htb] \includegraphics[width=6cm,height=7cm,angle=-90]{diagramaL32.har_z01bn.eps} \caption{Phases diagram for a system of L=32 considering the anharmonic zone; void circles and squares transition lines are first order. The critical temperature for the transition to the tetragonal phase at $H=0$ is shown with a colored square, the high temperature zone is represented with a slight shadow.} \label{diag} \end{figure} Four different zones are well defined in the diagram. For low values of temperature and external magnetic field the system is in a oriented modulated phase of perfect stripes characterized by a wave vector $\vec{k}=(0,\pi/2)$ and zero magnetization. Increasing the magnetic field, new modulated phases, characterized by new wave vectors, and non-zero magnetization appear. These new phases, keep the orientational order but are characterized by several wave vectors (therefore we call them {\em anharmonic phases}) that depend on the magnetic field. The properties of these phases and the location of the transitions suffer from strong finite size and commensuration effects, so, in the diagram we represented only one zone that, for the system size considered, contains all the anharmonic structures. Similar phases were already predicted within a mean field scenario for an Ising model with competing interactions $J_0$ and $J_1$ between nearest and next nearest neighbours in one direction of a cubic lattice ({\em ANNNI} model) \cite{Yokoi81}. For still larger values of $H$ we find a phase without orientational order ({\em bubble}). Finally, increasing further the magnetic field the system becomes completely magnetized (ferromagnetic phase). At low $H$, and close to the stripe to tetragonal transition the combination between thermal fluctuations, commensuration and finite size effects, and the excitations due to the magnetic field makes the analysis of the phase diagram too difficult. So, in this zone, the structure of the phase diagram is still unknown, and we shadow this zone in figure \ref{diag} to caution the reader about this. Now, to fix the ideas, let us concentrate our attention on the results for one temperature. We define, following \cite{booth95}, the so called $\pi/2$ rotational symmetry-breaking (SB) parameter: \begin{equation} \eta=|\frac{n_v-n_h}{n_v+n_h}| \end{equation} where $n_v$ ($n_h$) is the number of vertical (horizontal) bonds between nearest neighbors anti-aligned spins. This parameter takes the value $1$ in a perfectly ordered stripe state while it equals zero for any phase with $\pi/2$ rotational symmetry. In figure \ref{pconf} we represent the evolution of $\eta$ as a function of $H$ for $T=1.2$ in a system with $N=32 \times 32$ spins. The zooms show typical configurations for the corresponding values of $\eta$. As can be seen, abrupt jumps separate clear plateaus of $\eta$ at three different values of the magnetic field, $H\simeq 0.84$, $H \simeq 1.34$ and $H \simeq 2.40$. Each plateau reflects an underlying symmetry of the system. \begin{figure}[!htb] \includegraphics[width=7cm,height=7cm]{p.32.T1.2.confs.eps} \caption{SB parameter in a system of $L=32$ as a function of the field for $T=1.2$, the spots are some typical configurations.} \label{pconf} \end{figure} A deeper understanding of the phase diagram and specially on the character of the jumps separating the different plateaus is obtained analyzing figure \ref{evo} where the magnetization, the magnetic susceptibility and the susceptibility associated to the rotational order parameter $\eta$ ($2 T \chi_{\eta}=<\eta^2>-<\eta>^2$) are plotted. Increasing from zero the external magnetic field, the rotational symmetry-breaking parameter $\eta$ and the magnetization show various plateaus separated by abrupt jumps (see fig. \ref{evo}a). These jumps result from the discrete properties of the lattice where the model is defined. Discrete changes in the field are required to change from one stable structure of stripes to another. The existence of these jumps is also clearly reflected in both susceptibilities (see figures \ref{evo}b and \ref{evo}c). Three different peaks are well defined in the magnetic and the orientational susceptibility at the same transition points where the orientational order parameter and the magnetization jump. For $H>3$, the magnetization starts to growth linearly with $H$ but the rotational symmetry-breaking parameter is zero. The system is in the so called bubble phase already predicted by Garel and Doniach \cite{garel82} for the Ginzburg-Landau model with dipolar interaction. Finally at very high fields ($H>5$) the system is completely magnetized, $m=1$ and $\eta=0$. \begin{figure}[!htb] \includegraphics[width=5.2cm,height=6.0cm,angle=-90]{pm.32.T1.2.eps}\\ \includegraphics[width=5.2cm,height=6.4cm,angle=-90]{x.32.T1.2.eps}\\ \includegraphics[width=5.2cm,height=6.0cm,angle=-90]{xp.32.T1.2.eps}\\ \caption{Evolution under increasing magnetic field for a system of L=32: a) SB parameter and magnetization for $T=1.2$, b) magnetic susceptibility for $T=1.2$ and c) SB parameter associated susceptibility for $T=1.2$.} \label{evo} \end{figure} The jumps in the order parameter and the peaks in the susceptibilities suggest the existence of different thermodynamic phases at each plateau of $\eta$. To characterize the properties of these phases we look at the form of the structure factor, $S(\vec{k})$, in each plateau : \begin{equation} S(\vec{k})=\langle\mid \sum_iS_ie^{-i\vec{k}\cdot\vec{r_i}}\mid^2\rangle \end{equation} \begin{figure}[!htb] \includegraphics[width=4.2cm,height=4.2cm]{sf3D.32.H0.72.eps} \includegraphics[width=4.2cm,height=4.2cm]{sf3D.32.H1.02.eps}\\ \includegraphics[width=4.2cm,height=4.2cm]{sf3D.32.H1.56.eps} \includegraphics[width=4.2cm,height=4.2cm]{sf3D.32.H2.52.eps}\\ \includegraphics[width=4.2cm,height=4.2cm]{sf3D.32.H3.30.eps} \includegraphics[width=4.2cm,height=4.2cm]{sf3D.32.H4.14.eps} \caption{Evolution of structure factor in a system of $L=32$ for increasing magnetic field.} \label{sf3D} \end{figure} Figure \ref{sf3D} shows the structure factor of the system for different values of $H$. Each plot is obtained by the average of 5000 equilibrium configurations. At very low magnetic field, the system is characterized by a peak at one wave vector $\vec{k}=(0,\pi/2)$. Increasing $H$ new peaks appear in $S(\vec{k})$. First, with component $\vec{k} = (0, k_y \neq 0)$, still signaling the presence of orientational order in one direction. This change in the form of the structure factor is not evident a priory. One may, for instance, expect that the external magnetic field unbalances the number of up-down spins creating defects that breaks the orientational order. Our results suggest a different scenario, where if properly equilibrated at low temperatures, new structures, without evident defects, keep the orientational long range order of the original ground state structures. Then, at higher magnetic fields, (see in the figure $H=2.52$) $S(k)$ becomes symmetric in both axis, the system looses the orientational order and reaches the bubble phase. Finally the magnetization saturates and only the peak at $\vec{k}=(0,0)$, survives. Figure \ref{pky} shows the contribution of the three principal wave vectors $\vec{k}=(0,k_y^{*})$ characterizing the evolution of the system configurations with the magnetic field. Initially, the perfect stripes phase is characterized, as we know, by a wave vector $\vec{k}=(0,\pi/2)$. At $H \approx 0.84$ a new wave vector $\vec{k}=(0,7\pi/16)$ dominates the system, still indicating the presence of oriented stripes. Increasing further the magnetic field, at $H \approx 1.34$, $S(\vec{k})$ changes again, and $\vec{k}=(0,3\pi/8)$. The sudden rise and decay of each wave vectors reflects again the abrupt changes in the symmetry of the system. \begin{figure}[!htb] \includegraphics[width=7cm,height=7cm,angle=-90]{kycont.32.T1.2.eps} \caption{Main harmonic contributions to the equilibrium configuration structure factor for increasing $H$ in a system of $L=32$. Other $k_y$ contributions remains always under $0.2$.} \label{pky} \end{figure} We also calculated the directed spatial correlation functions for the system \begin{eqnarray} \nonumber C_x(r)=\frac{1}{N}\sum_y\sum_x\langle S_{x,y}S_{x+r,y}\rangle\\ \nonumber C_y(r)=\frac{1}{N}\sum_y\sum_x\langle S_{x,y}S_{x,y+r}\rangle\\ \nonumber \end{eqnarray} which reveal interesting information about the equilibrium states. In particular, we tried to fit the numerical data with a function of the form \begin{equation} C(r)=A e^{-\frac{r}{\xi}} \mathrm{cos}(k r-\psi)+B r^{-\alpha}+D \label{corr} \end{equation} \noindent that has been proposed for the approximated continuum model\cite{mendoza,mulet07}. Figure \ref{fcorrel} shows the corresponding fits for averaged equilibrium configurations at two values of $H$. \begin{figure} \includegraphics[width=6.0cm,height=6.0cm,angle=-90]{c.32.T1.2_somehs.eps} \caption{Fits of correlation numerical data with the function (\ref{corr}); correlation best fits for two particular values of applied field} \label{fcorrel} \end{figure} From these fits we can gain information about the dependence with $H$ of the correlation length of the modulated domains ($\xi$), the main wave vector of the phase ($k$) and the power law strength ($\alpha$) respectively. In particular, we can see in figure \ref{fcorrelb} the behavior of $k$ as a function of $H$. The plateaus in $k$ coincide with the principal wave vectors (see figure \ref{pky}) characterizing the different stripe structures. \begin{figure}[!htb] \includegraphics[width=6.0cm,height=10.0cm,angle=-90]{ks.eps} \caption{Best fitted $k$ value as a function of $H$ in a system of $L=32$.} \label{fcorrelb} \end{figure} To our knowledge these new anharmonic phases have not been predicted before in a model with dipolar interactions. They are absent in the continuous model, where the effect of the magnetic field in the striped phase, is considered assuming that below the bubble phase the stripes persist in an increasing magnetized background \cite{garel82}. They are present in the ANNNI model, but differently from \ref{ham}, the ANNNI model is anisotropic by construction. On the other hand, in the phase diagram resulting from the simulations in \cite{arlett96} the orientational order parameter changes continuously from a finite value to zero at a given field (see figure 7 in that reference). The reasons for these differences in the phase diagrams are not clear. We are tempted to think that looking at the dependence of $\eta$ for lower values of the temperature the authors in ref. \cite{arlett96} could find similar jumps and phases. Of course, having a large $\delta$ and hence larger stripe widths the anharmonicity properties of their structures may be hidden by strong finite size effects. \subsection{Ground state analysis} To study what kind of structures are responsible of the anharmonic phases, we tested the energy of a large number of configurations of alternating $S=-1$ and $S=1$ stripes. The width of the $S=-1$ stripes was varied from $1$ to $2$ while the width of $S=1$ stripes was varied from $0$ to $L$, as it is expected for the striped configurations in the presence of a field $H>0$. Thus, borrowing the notation from ref. \cite{grous00} we denoted as $h24$ one configuration with stripes of width $2$ against the field and stripes of width $4$ in the field direction, repeated periodically. The energies of these configurations are represented in figure \ref{energy} as a function of $H$. At $H=0$, the ground state of the system corresponds to the $h2$ phase. By increasing $H$ the system reaches a critical field $H_a$, where perfect stripes becomes energetically unfavorable with respect to the anharmonic configuration ($h2322$, $k_y=7\pi/16$). For larger fields, a new anharmonic configuration becomes the ground state ($h32$, $k_y=3\pi/8$). Further increasing $H$ the situation repeats with the appearance of new anharmonic states. How many of these anharmonic configurations may appear depends strongly on temperature and commensuration effects. The corresponding ground state energies of the system, considering only these anharmonic configurations is represented in figure \ref{energy} with a continuous line. This line corresponds to the lower energy curve obtained from the superposition of the energies of the different configurations as a function of $H$. \begin{figure} \includegraphics[width=6.0cm,height=6.0cm,angle=-90]{e.32.T0.eps} \caption{Energy as function of $H$ in a system of $L=32$. Different anharmonic configurations at $T=0$ and the ground state energy (continuous line) are shown. $H_a$ is the critical field at which perfect stripes are lost. } \label{energy} \end{figure} One may wonder whether these are finite size effects, and a non-orientatied ground state structure may dominate the behavior of the infinite system al low $H$. To test our predictions, this analysis was repeated for different system sizes, $N=L \times L$. Figure \ref{criticalT0} suggests that independently of the system size, the first critical field $H_a$ always appear in the low field region where the perfect stripes become unstable. This value defines a zone in which anharmonic structures establish, mainly in the form of $h2223$ or $h23$ configurations depending on commensuration effects. The transition between anharmonic and bubbles phases remains around $H=2.4$ for system sizes up to $L=48$, this have been used to draw a schematic broken line in figure \ref{criticalT0}. Since the bubble phase establishes becouse entropic effects, this is lakely to be valid for large system sizes. In all tested cases the critical field remains well below this schematic transition, supporting the existence of the anharmonic phases obtained for $L=32$ in the thermodynamic limit, and giving rise to a rather wide anharmonic zone. \begin{figure} \includegraphics[width=6cm,height=8cm,angle=-90]{hvsl-1.T0.har.eps} \caption{Critical fields changing configurations at $T=0$ versus system size. $H_a$ and ferro lines are bolded for clarity but vertical lines were the only region explored and no interpolation is obvious. An schematic bubble line is also drawed (see the text).} \label{criticalT0} \end{figure} \subsection{Phase Transitions} \label{ssection:PT} Unfortunately the computational cost associated with the presence of long range interactions and the commensuration effects in this kind of systems, prevent us from doing a proper finite size scaling analysis to define the character of the transitions. Instead, we focused our attention in systems of sizes $L=32$ and $L=40$ and study the histograms of the energy and the order parameter. \subsubsection*{Evidence for First Order Phase Transition} The jumps in the susceptibilities and the discontinuities in $\eta$ in figure \ref{evo} already suggest the first order character of the transitions between the different orientational phases, and from the last anharmonic phase to the bubble phase. However, a stronger evidence is given in figure \ref{s-a}. These histograms were calculated for systems of $N=40 \times 40$ spins, sampling $10^{7}$mcs after relaxation for each value of $H$ and considering $10^{5}$ values of energy and $\eta$. \begin{figure}[!htb] \includegraphics[width=5cm,height=4.2cm,angle=-90]{phist40.T1.2.S-A.Bezier.eps} \includegraphics[width=5cm,height=4.2cm,angle=-90]{ehist40.T1.2.S-A.Bezier.eps}\\ \includegraphics[width=5cm,height=4.2cm,angle=-90]{ch.phist32.T1.2.A-A.Bezier.eps} \includegraphics[width=5cm,height=4.2cm,angle=-90]{ehist32.T1.2.A-A.Bezier.eps}\\ \includegraphics[width=5cm,height=4.2cm,angle=-90]{phist40.T1.2.A-B.Bezier.eps} \includegraphics[width=5cm,height=4.2cm,angle=-90]{ehist40.T1.2.A-B.Bezier.eps} \caption{Histograms of the orientational order parameter and energy for fields around the transitions involving striped phases: a) and b) for harmonic-anharmonic, c) and d) anharmonic-anharmonic, e) and f) anharmonic-bubbles.} \label{s-a} \end{figure} For the three transitions considered, the figure shows that, increasing $H$, the histograms of the order parameter and energy evolve from unimodal functions at low magnetic fields, to a two peak shape structure, that disappears at higher magnetic fields giving rise to the new thermodynamic phase. For the particular case of the anharmonic-anharmonic transition (c-d), the difference in energies between the two structures is so small that the histograms for the energy appear always as unimodal. On the other hand, one must note that while in the first two transitions, the peak in $P(E)$ moves from high to low energies, in the anharmonic to bubble transition it moves from low to high energies. In this transition, the system looses the orientational order and therefore $E$ increases. This is compensate by the presence of strong entropic effects that, in this more disordered structure, dominate the equilibrium state of the system. It is relevant for the definition of the anharmonic to bubble transition the appearance at high fields of a non-zero correlation length $\xi$ for the modulated domains (see figure \ref{chis}). Fitting the spatial correlations in the bubble phase with expression (\ref{corr}) we obtain the expected inverse proportionality of $\xi$ with the applied magnetic field \cite{mendoza}. \begin{figure}[!htb] \includegraphics[width=6.0cm,height=6.0cm,angle=-90]{chis.eps} \caption{Best fit of correlations by expression (\ref{corr}). Correlation length of modulated domains as a function of $H$ in a system of $L=32$, for $H$ below the bubbles region $\xi\geq L$.} \label{chis} \end{figure} \subsubsection*{Evidence for a Kosterliz-Thouless transition} Figure \ref{pictures} shows some views of the domain structure of the system close to the bubble-ferromagnetic transition. They suggest that increasing $H$ the bubble phase dilutes in a ferromagnetic environment. This support the predictions in \cite{garel82} where the authors proved that within a Ginzburg-Landau approximation, dislocation of the bubbles structure may lead to a second-order melting transition of the Kosterliz-Thouless type. The continuous change of energy and magnetization (see figure \ref{evo}a) and the saturation of the response functions close to this transition (see in figure \ref{b-f} zooms of the magnetic susceptibility and the specific heat close to this transition) also support these predictions. \begin{figure}[!htb] \includegraphics[width=8cm,height=2cm]{fotos48T1.0.b-f.eps} \caption{Some field values involved in the transition from bubble to ferromagnetic phases. Typical configurations for an L=48 system.} \label{pictures} \end{figure} \begin{figure}[!htb] \includegraphics[width=5cm,height=8cm,angle=-90]{resp.32.T1.2.B-F.eps} \caption{Field values involved in the transition from bubble to ferromagnetic phases. Specific heat and magnetic susceptibility versus field in a system of $L=32$.} \label{b-f} \end{figure} One last indication in favor of this scenario, comes from the spatial correlation functions of the system. In figure \ref{chisb} we show the value of $\alpha$ obtained by the fits of the correlation functions with expression (\ref{corr}). The sudden rise of $\alpha$ close to $H \sim 4.5$ is also consistent with a Kosterliz-Thouless transition. \begin{figure} \includegraphics[width=6.0cm,height=6.0cm,angle=-90]{alfas.eps} \caption{Best fit of correlations by expression (\ref{corr}). Power exponent as a function of $H$ in a system of $L=32$.} \label{chisb} \end{figure} \section{Conclusions} \label{conc} We developed extensive numerical simulations to characterized the phase diagram of the model given by (\ref{ham}). This Hamiltonian presents at very low field and temperature a phase of symmetric stripes and zero magnetization. Increasing the field, new thermodynamical phases appear, still with orientational order but with non-zero magnetization and characterized by different wave vectors. As far as we know, the existence of these thermodynamic phases have not being proposed before for systems with dipolar interactions. For larger values of $H$, the system enters into the bubble phase loosing the orientational order. Then, at larger fields, the system becomes fully magnetized. We present evidence supporting the idea that all, but the bubble to ferromagnetic, are first order transitions. This is also in agreement with analytical results that predicted that the stripes to bubbles transition is of the Brazovskii \cite{bra75} type. On the other hand, close to the bubbles to ferro transition, our simulations show the existence of a continuous order parameter, the saturation of the response functions and algebraically decaying spatial correlations, supporting all, a Kosterliz-Thouless scenario. Finally, it is worth to note the interesting parallelism between these anharmonic phases and the hybrid states found for Hamiltonian (\ref{ham}) at zero field in reference \cite{pig06}. There, through Mean Field calculations, the authors suggested a possible interpretation of nematic phases as a competition between striped structures of different widths. Moreover, they found Kosterliz-Thouless features in the transition between striped and nematic phases. To clarify these issues, and to completely define the phase diagram (\ref{diag}) more accurate simulations are expected close to the $H=0$ critical temperature. \begin{acknowledgments} We gratefully acknowledge partial financial support from the Abdus Salam ICTP through grant {\em Net-61, La\-tin\-a\-me\-ri\-can Network on Slow Dynamics in Complex Systems}. We thank D. Stariolo and S. Cannas for useful comments on a previous manuscript. Calculation facilities kindly offered by the Bioinformatic's Group of the Center of Molecular Inmunology in Cuba were instrumental to this work. \end{acknowledgments}
\section{Introduction}\label{secI} Quantum information processing requires entangled states \cite{nielsen,leshouches}. Many physical systems such as Josephson devices, trapped ions, NMR, have been considered for quantum information processing. All these system are endowed with finite number of states for manipulation. Of late, systems which are equipped with infinite dimensional Hilbert spaces have been analyzed in the context of teleportation, computation, etc \cite{braunsteinRMP,pati,furusawa,cvbook,devices}. Nonlinear optical processes, cavities in photonic bandgap materials are capable of producing states of light that are useful in quantum information processing. A notable feature of bosonic modes is their robustness in retaining their entanglement in spite of thermal noise \cite{zanardi}. Also, experiments with entangled photon states are of significance in testing the foundational aspects of quantum theory\cite{aspect}. Microcavities have been extensively employed in generating atomic qubits, engineering of quantum states, creating polarization entangled photonic states to do proof-of-principle tests such as verification of Bell-type inequalities, entangling atoms and/or photons \cite{vahala, raimond, bose}, studying the phenomenon of decoherence\cite{mabuchidoherty}, etc. More interestingly, coupled cavities have been thought of as a conduit to transfer and engineer entanglement between distant atomic qubits \cite{cirac}, which would be required for distributed quantum computing. Cavities containing atoms (either positioned or on-flight) have been used in the previously mentioned contexts. It is possible to use suitably prepared atoms to modify the cavity field so as to make the later useful in applications such as photonic qubits\cite{gheri,vanenk}, optical Josephson interferometers\cite{gerace}, etc. \\ In this work, a system of two coupled single-mode cavities is considered. The cavities are coupled by evanescent fields. Hence, the coupling strength can be tailored by the proximity of the cavities and the permittivity of the cavity walls. The field modes of the two cavities form a bipartite, bosonic, continuous variable (CV) system. Because of the coupling, the modes of the two cavities can get entangled. In addition to the inter-cavity coupling, one of the cavities is externally pumped. The results presented here pertain to the case of treating the pumping field classically. \\ The Hamiltonian of the system under consideration is \begin{equation} \hat{H}=\omega\left( \aco\aao+\bco\bao \right)+\lambda\left(\hat{a}^\dagger\hat{b}+\hat{a}\hat{b}^\dagger\right) +\epsilon\hat{a}^{\dagger 2}+\epsilon^*\hat{a}^2. \end{equation} The operators $\hat{a}$ and $\hat{a}^\dagger$ are respectively the annihilation- and creation- operators of the mode ($a$-mode, hereafter) in the cavity which is externally pumped. Similarly, $\hat{b}$ and $\hat{b}^\dagger$ are the relevant operators for the mode ($b$-mode, hereafter) in the other cavity. The strength of the coupling between the cavities is characterized by the parameter $\lambda$. The magnitude of this parameter is related to the hopping strength of photons to hop between the cavities. The term $\epsilon\hat{a}^{\dagger 2}+\epsilon^*\hat{a}^2$ corresponds to the contribution to the Hamiltonian from the interaction between the external pumping and the $a$-mode. This interaction, for instance, could be achieved by an active medium within the cavity. The magnitude of this interaction strength between the $a$-mode and the classical driving field is given by the parameter $\epsilon$ which incorporates the effects of the active medium and the external pumping. A similar approach is adopted to explain the maser action which includes many external modes\cite{louisell}. The external classical field affects entanglement as it delivers energy into the pumped cavity which supports the $a$-mode. However, whether the entanglement is enhanced or decreased depends on the coupling ($\lambda$) between the cavities. Firstly, the dynamics in the absence of the external pumping is studied. These results are useful to understand the effects of pumping.\\ \section{Dynamics of fields: without pumping} The Hamiltonian to study the dynamics in the absence of external driving corresponds to setting $\epsilon=0$ in $\hat{H}$. In that case, the Hamiltonian evolution is easily obtained since the commutator $[\aco\aao+\bco\bao,\hat{a}^\dagger\hat{b}+\hat{a}\hat{b}^\dagger]$ vanishes. This implies that the evolution operator $\exp(-it\hat{H})$ can be factored as $\exp(-it(\hat{a}^\dagger\hat{b}+\hat{a}\hat{b}^\dagger)) \exp(-it(\aco\aao+\bco\bao))$. This type of Hamiltonian is known in other contexts such as the symmetric beam splitter\cite{gerryknight}, the parametric conversion in a medium with oscillatory dielectric constant\cite{LYS} and has recently been used to examine intrinsic phase coherence in a laser\cite{pegg}. The bilinear coupling $\lambda(\hat{a}^\dagger\hat{b}+\hat{a}\hat{b}^\dagger)$, between the modes cannot entangle them during evolution if both the modes are in classical states initially\cite{kim,wang}; for instance, the $a$-mode in a coherent state and the $b$-mode in vacuum state. To generate an entangled state from a product state, during evolution in the presence of bilinear coupling, at least one of the modes has to be in a nonclassical state. So, it is meaningful to assume the initial state of the cavities to be a number state. Since all number states, except the vacuum, are nonclassical, the bilinear coupling may entangle the $a$- and $b$- fields. It is experimentally possible to prepare the cavities such that $a$-field is a Fock state, say $\vert N \rangle$, and the $b$-field to be vacuum state.\\\\ Another consequence of the vanishing commutator $[\aco\aao+\bco\bao, \hat{a}^\dagger\hat{b}+\hat{a}\hat{b}^\dagger]=0$, is the existence of nontrivial, irreducible, invariant subspaces. Each invariant subspace is the span of the states of the form $\{\vert m,N-m\rangle\}$, where $m$ runs from zero to $N$. The state $\vert m, N-m\rangle$ of the modes in the cavities represents the situation in which the $a$-mode is in the number state $\vert m\rangle$ and the $b$-mode is in $\vert N-m\rangle$. There is an invariant subspace associated with each value of $N$, an eigenvalue of the total number operator $\aco\aao+\bco\bao$. All the states in an invariant subspace are the eigenstates of the total number operator. Further, the invariant subspaces corresponding to different total quantum numbers are disjoint. Taking the initial state as $\vert N,0\rangle$, the time-evolved state $\vert\psi(t)\rangle=\exp(-i\hat{H}t)\vert N,0\rangle$ is \begin{equation}\label{ebs} \vert\psi(t)\rangle=\exp(-iN\omega t)\cos^N(\lambda t) \sum_{n=0}^N\left[\frac{N!} {n!(N-n)!}\right]^{1\over2}\tan^n(\lambda t)\vert N-n,n\rangle. \end{equation} This state belongs to the invariant subspace corresponding to a total quantum number $N$ which contains the initial state $\vert N,0\rangle$. An interesting feature is that the states of the form $\vert m,N-m\rangle$ are the only product states in the invariant subspace. All the other states in a given invariant subspace are entangled\cite{siva}. The coefficients in the Fock state expansion are the binomial coefficients and the states defined in Eq. \ref{ebs} are referred as two-mode binomial states\cite{saleh}. In this work, the covariance criterion is adopted as the measure of entanglement\cite{dodonov}. It is expressed as \begin{equation}\label{covar} Y = \left[\frac{\vert\overline{\hat{a}\hat{b}^\dagger}\vert^2+\vert\overline{\hat{a}\hat{b}}\vert^2} {2\left(\overline{\aco\aao}+{1\over 2}\right)\left(\overline{\bco\bao}+{1\over 2} \right)}\right]^{1\over 2}. \end{equation} The bar is used to indicate covariance, for example, $\overline{\hat{a}\hat{b}^\dagger}= \langle\hat{a}\hat{b}^\dagger\rangle-\langle\hat{a}\rangle\langle\hat{b}^\dagger\rangle$, where $\langle\cdots\rangle$ stands for quantum mechanical expectation value of the relevant operator. The quantity $Y$ is non-negative and less than unity. For product states, the value of $Y$ is zero. Nonzero values of $Y$ implies the state is entangled. But there exist entangled states for which $Y$ is zero and hence the criterion is not universal. Nevertheless, it is easy to compute and useful in identifying and quantifying entanglement when it assumes nonzero values. If the initial state is of the form $\vert N,0\rangle$, the covariance parameter of the evolved state given in Eq. \ref{ebs} is \begin{equation} Y=\frac{N\vert\sin(2\lambda t)\vert}{2\left[2(N\cos^2(\lambda t)+.5)(N\sin^2 (\lambda t)+.5)\right]^{1/2}}. \end{equation} With nonzero coupling, the maximum value that $Y$ attains during evolution is $N/\sqrt{2}(N+1)$ and it is attained whenever $\lambda t$ is an odd integral multiple of $\pi/4$. It is clear that the peak value of $Y$ attained during evolution increases with $N$ and approaches $1/\sqrt{2}$ asymptotically as $N$ becomes large. Further, the peak value depends on the total quantum number $N$ and not on the field-field coupling constant $\lambda$. In Fig. \ref{fig:yvst} the variation of $Y$ with time is given for different values of the total quantum number, which is the eigenvalue of the operator $\aco\aao+\bco\bao$. The time of evolution is measured in the units of $\pi/\lambda$, which is the temporal periodicity of pumping-free evolution. In all the subsequent discussions, whether the evolution is periodic or not, the time is always expressed in the units of $\pi/\lambda$. The universal measure of entanglement for bipartite pure states\cite{bennett} is the von Neumann entropy $S$ defined as \begin{equation} S=-\hbox{Tr}\left[\hat{\rho}_a\log_2\hat{\rho}_a\right], \end{equation} where Tr stands for trace and $\hat{\rho}_a$ is the reduced density matrix for the $a$-mode field. It is instructive to study the behaviour of von Neumann entropy $(S)$ {\it vis-a-vis} $Y$ in the present case. For the states defined in Eq. \ref{ebs}, the reduced density matrix $\hat{\rho}_a$ for the $a$-field is \begin{equation}\label{rdm} \hat{\rho}_a=\cos^{2N}(\lambda t)\sum_{n=0}^N\frac{N!}{n!(N-n)!} \tan^{2n}(\lambda t)\vert N-n\rangle\langle N-n\vert. \end{equation} Denoting the coefficient of $\vert N-n\rangle\langle N-n\vert$ in $\hat{\rho}_a$ by $c_n$, the expression for the entropy is $S=-2\sum_{n=0}^N\vert c_n\vert^2\log_2\vert c_n\vert$. In Fig. \ref{fig:yands}, the variation of $S$ and $Y$ are shown as functions of time taking the initial state to be $\vert 5,0\rangle$. The two measures exhibit very similar features. When $S$ is nonzero, the covariance measure $Y$ is nonzero too, indicating that it is a good criterion for the kind of entangled states given in Eq. \ref{ebs}. The peak in the entropy occurs when the two modes have nearly equal number of photons, that is, $\langle\aco\aao\rangle\approx\langle\bco\bao\rangle$. Hence, entropy peaks correspond to minima in the difference of the photon numbers of the two modes. The photon number in the $a$-mode is $N\cos^2(\lambda t)$ and in the $b$-mode is $N\sin^2(\lambda t)$. Therefore, $\langle\aco\aao\rangle$ equals $\langle\bco\bao\rangle$ whenever $\lambda t$ is an odd multiple of $\pi/4$. The reason for the increase in the entanglement as the total number of photons increases is readily inferred from the expression for entropy $S$ given after Eq.\ref{rdm}. The entropy $S$ is maximum, subject to the constraint that $\hbox{Tr}\rho_a=1$, when all $\vert c_n\vert$ are equal. There are $N+1$ terms in the expression for $S$ and the maximum $S$ is $\log_2(N+1)$ which increases with $N$. \\ \section{Effect of external pumping} The evanescent coupling allows photons to hop from one cavity to the other. This allows a redistribution of energy between the cavities. Since the $a$-mode is subjected to external pumping, the energy of the pump field is fed to the $a$-mode which, in turn, is used to energize the $b$-field. The pump field is treated classically and hence the driving term in the Hamiltonian is a function of the operators of the $a$-mode. For weak couplings, it is reasonable to assume the function to be linear in $\hat{a}^\dagger$ and $\hat{a}$. Classically, this amounts to an interaction proportional to the product of the field strength of the $a$- mode and the amplitude of the driving field. If the coupling is stronger, the function must involve higher order terms involving the creation and the annihilation operators. In what follows, the effects of quadratic coupling on the entanglement between the cavities are discussed. As a remark, it is noted that if the pumping is linear, that is, the driving term is $\epsilon\hat{a}^\dagger+\epsilon^*\hat{a}$, there is no effect on the value of the covariance parameter $Y$. There is indeed a change in the dynamics and, consequently the entanglement is affected. But the dynamics of the covariance criterion is insensitive to such modifications, a reminiscence of the fact that the covariance criterion is not universal. The quadratic coupling, however, leads to significant changes in the dynamics of $Y$.\\\\ The Heisenberg equations of motion for the operators of the two mode are \begin{equation}\label{qem} i\frac{d}{dt} \left( \begin{array}{c} \hat{a}\\ \hat{b}\\ \hat{a}^\dagger\\ \hat{b}^\dagger \end{array} \right)_t = \left[ \begin{array}{cccc} \omega&\lambda&2\epsilon&0\\ \lambda&\omega&0&0\\ -2\epsilon^*&0&-\omega&-\lambda\\ 0&0&-\lambda&-\omega \end{array} \right] \left( \begin{array}{c} \hat{a}\\ \hat{b}\\ \hat{a}^\dagger\\ \hat{b}^\dagger \end{array} \right)_t. \end{equation} The equations imply that the evolution of the operators of the two modes are coupled. The coefficient matrix has no explicit time-dependence and hence the equations are easily solved to obtain \begin{equation}\label{qemsoln} \left( \begin{array}{c} \hat{a}\\ \hat{b}\\ \hat{a}^\dagger\\ \hat{b}^\dagger \end{array} \right)_t = \exp \left[-it\hat{M}\right] \left( \begin{array}{c} \hat{a}\\ \hat{b}\\ \hat{a}^\dagger\\ \hat{b}^\dagger \end{array} \right)_0, \end{equation} where $\hat{M}$ represents the coefficient matrix in Eq. \ref{qem}. \\ The operator $\exp[-it\hat{M}]$ can be expressed in terms of lower powers of $\hat{M}$ using Cayley-Hamilton theorem\cite{apostol}. Let the four eigenvalues of $\hat{M}$ be denoted by $\alpha,\beta,\gamma$ and $\delta$. Defining $A=\omega^2+\lambda^2-2\epsilon^2$ and $B=\sqrt{\omega^2\lambda^2-\lambda^2 \epsilon^2+\epsilon^4}$, the eigenvalues are \begin{eqnarray} \alpha=-\beta=\sqrt{A-2B},\\ \gamma=-\delta=\sqrt{A+2B}. \end{eqnarray} These are the eigenvalues if $\epsilon$ is real and they are distinct if the determinant of $\hat{M}$ is nonzero, which is always the case for the typical values of the parameters assumed. Now, applying Cayley-Hamilton theorem, \begin{eqnarray}\label{expm} 4B\exp\left[-it\hat{M}\right]&=&i\left(\frac{\sin\alpha t}{\alpha}- \frac{\sin\gamma t}{\gamma}\right)\hat{M}^3\nonumber\\ & &+\left(\cos\gamma t - \cos\alpha t\right)\hat{M}^2- i\left(\frac{\alpha^2\sin\gamma t}{\gamma}-\frac{\gamma^2\sin\alpha t}{\alpha} \right)\hat{M}\nonumber\\ & &-\left(\gamma^2\cos\alpha t - \alpha^2\cos\gamma t\right)I_4, \end{eqnarray} where $I_4$ is the 4$\times$4 identity matrix.\\\\ On using the matrix exponential, refer Eq. \ref{expm}, in the solution given in Eq. \ref{qemsoln}, the expectation values of time-evolved operators are expressed in terms of their initial expectation values. Let the time- dependent coefficients of $\hat{M}^3,\hat{M}^2,\hat{M}$ and $I_4$ in the expression for $\exp[-it\hat{M}]$ given in Eq. \ref{expm}, be $C_3, C_2, C_1$ and $C_0$ respectively. Further, define \begin{eqnarray} U_{\omega,\lambda}&=&C_0+\omega C_1+(A-2\epsilon^2)C_2+\omega (2\lambda^2-2\epsilon^2+A)C_3,\nonumber\\ V_{\omega,\lambda}&=&\lambda C_1+2\lambda\omega C_2+\lambda(2\omega^2 -2\epsilon^2+A)C_3,\nonumber\\ W_{\omega,\lambda}&=&2\epsilon C_1+ 2\epsilon(\lambda^2+A)C_3,\nonumber\\ X_{\omega,\lambda}&=&C_0+\omega C_1+(\lambda^2+\omega^2)C_2+\omega(3\lambda^2 +\omega^2)C_3,\nonumber\\ Y_{\omega,\lambda}&=&2\epsilon(\lambda C_2+\omega C_3),\nonumber\\ Z_{\omega,\lambda}&=&-2\lambda^2\epsilon C_3\nonumber. \end{eqnarray} If the initial state of the two cavities is $\vert N,0\rangle$, the relevant quantities to compute $Y$ are \begin{eqnarray} \overline{\hat{a}\hat{b}}&=&(1+N)X_{\omega,\lambda}Y_{\omega,\lambda}+ NW_{\omega,\lambda}V_{\omega,\lambda}+V_{\omega, \lambda}Z_{\omega,\lambda},\label{eab}\\ \overline{\hat{a}\hat{b}^\dagger}&=&=(1+N)U_{\omega,\lambda}V_{-\omega,-\lambda}+ NW_{\omega,\lambda}Y_{-\omega,\lambda}+V_{\omega,\lambda} X_{-\omega,-\lambda},\label{eabd}\\ \overline{\aco\aao}&=&=(1+N)U_{\omega,\lambda}U_{-\omega,-\lambda}- NW_{\omega,\lambda}^2+V_{\omega,\lambda}V_{-\omega,-\lambda}-1,\label{eaad}\\ \overline{\bco\bao}&=&=(1+N)V_{\omega,\lambda}V_{-\omega,-\lambda}+ NY_{\omega,\lambda}Y_{-\omega,\lambda}+X_{\omega,\lambda}X_{-\omega,-\lambda}-1.\label{ebbd} \end{eqnarray} Using the expressions in Eqs. \ref{eab}-\ref{ebbd} for the various bilinear combinations of the creation- and annihilation- operators of the two cavity modes, the covariance criterion of entanglement is computed. In Fig. \ref{fig:y2pump} the evolution of $Y$ with time is shown for various combinations of $\lambda$ and $\epsilon$. When both $\lambda$ and $\epsilon$ are chosen to be 0.1, the entanglement measure $Y$ builds up to 0.6. The occurrence of peak values in $Y$ is corroborated with the occurrence of minimum in the difference between the photon numbers of the two modes. The variation of the ratio of the mean photon number difference $\vert\langle\aco\aao-\bco\bao\rangle\vert$ to the total number of photons $\vert\langle\aco\aao+\bco\bao\rangle\vert$ is shown in Fig. \ref{fig:frenergy}. If the ratio is unity, the photon number of one of the modes is zero. If the ratio is zero, the two modes have equal number of photons. The evolution of the ratio is shown for three different combinations of $\lambda$ abd $\epsilon$. If the cavity-cavity coupling $\lambda$ is sufficiently strong that the energy increase due to the external pumping gets distributed to both the cavities, the difference in the average photon numbers in the two cavities can become zero, as in the case of $\lambda$ and $\epsilon$ both being 0.1. If $\lambda$ is small, the energy transfer between the cavities is ineffective and the photon number difference is large, for instance, when $\lambda=0.001$ and $\epsilon=0.1$. To illustrate the effect of larger $\lambda$, the evolution of the ratio if $\lambda=0.005$ and $\epsilon=0.1$ is shown in Fig. \ref{fig:frenergy}. In this case, the difference becomes smaller than the $\epsilon =0.001$ case; however, the coupling is still not strong enough for efficient energy exchange between the cavities to make the difference in the photon number to become zero.\\\\ The occurrences of vanishing photon-number difference and the peak in $Y$ happen at same instants, seen by comparing Figs. \ref{fig:y2pump} and \ref{fig:frenergy}. When the pump-field coupling is large, the $a$-mode gets energized at a faster rate. If the coupling $\lambda$ is such that the exchange of energy between the cavities is effective, the $a$-field and the $b$- field attain nearly equal energies so that the difference of their photon numbers becomes small at various instants. This, as in the case of pump-free evolution, is correlated with the occurrence of entanglement peaks. Similarly, if both $\lambda$ and $\epsilon$ are equal but smaller, chosen to be 0.001 for the purpose of discussion, the slow rate of energy build up in the $a$-mode is matched by the flow of energy between the modes. Hence, in this case too the energies of the two modes can be nearly equal during evolution. At such instants, the entanglement becomes higher. \\ If $(\lambda<<\epsilon)$, for instance, $\lambda=0.001$ and $\epsilon = 0.1$, the external pumping primarily enhances the energy of the $a$-field as there is no effective flow of energy to the $b$-field because of low value of the coupling between the cavities. This increases the energy difference between the modes. The evolution of $Y$ in this case is shown in Fig. \ref{fig:y2pump}. Compared to the pump-free evolution of the initial state $\vert 5,0\rangle$ shown in Fig. \ref{fig:yvst}, the maximum entanglement attained is smaller as the energy difference between the modes is larger. The $b$-mode is initially in vacuum state. Due to the weak coupling between the cavities, the $b$-mode remains in a state in which only the vacuum state and a few number states are present. Therefore, the entanglement becomes smaller. The entanglement attains a peak whenever the energy difference is minimum. Thus, generation of large entanglement requires that energy flows into the $b$-field, which, in turn, requires a strong interaction between the cavities.\\ In the opposite limit $\lambda >> \epsilon$, for instance $ \lambda=0.1$ and $\epsilon=0.001$, the total energy of the system does not increase much as pumping is weak. The dynamics is very similar to that in the case when there is no pumping. The effective coupling between the modes leads to nearly equal energies in the modes during evolution. Whenever the mean photon numbers of the modes match, the entanglement attains a peak. The evolution profile of $Y$ is not distinctly seen in Fig. \ref{fig:y2pump} as it merges with the profile corresponding to $\lambda=0.001$ and $\epsilon = 0.001$.\\ \section{Effect of pump fluctuations} The maximum value that $Y$ attains during evolution is dependent on the initial photon number $N$, the coupling $\lambda$ and the pump-field interaction strength $\epsilon$. In Fig. \ref{fig:maxy} the maximum value of $Y$ attained during evolution is shown as a function of $\epsilon$. Results corresponding to two different values of $\lambda$ are given taking the initial state to be $\vert 5,0\rangle$. It is seen that the peak value increases with $\epsilon$ if $\lambda$ is 0.1 whereas it decreases drastically if $\lambda=0.001$. If $\lambda=0.1$, the peak value of $Y$ is close to 0.6, for small values of $\epsilon$. This is nearly the value that is attained in the absence of pumping since the pumping is weak. As the value of $\epsilon$ increases beyond 0.05, the peak value increases. For sufficiently large $\epsilon$, say, $\approx 0.4$, the peak value corresponds to the maximum attainable in pumping-free case and initial $N$ as large as 50. This is understandable as large pumping leads to large energy input. Since $\lambda=0.1$ is sufficient enough for energy transfer between the modes, both the modes will have more number of Fock states in their superposition. Hence, a large entanglement is possible. If $\lambda=0.001$, a representative value for small $\lambda$, the coupling is not good enough for the energy to flow from the $a$-mode. Thus, the $b$-mode will have fewer number of Fock states in the superposition. Also, as $\epsilon$ increases, the difference in the photon number of the modes will become larger. So, there is reduction in the maximum entanglement between the modes as compared with the values in the absence of pumping. The dependence of peak $Y$ on $\epsilon$ is shown in Fig. \ref{fig:maxy} for two other values of $\lambda$. It is seen that as $\lambda$ becomes larger, the peak $Y$ during evolution is nearly constant over a larger range of $\epsilon$. From Fig. \ref{fig:maxy}, it is seen that if $\lambda$ is 0.1, the maximum attainable $Y$ varies from 0.6 to 0.7 as $\epsilon$ increases from 0 to 0.5. On the other hand, if $\lambda=0.001$ the maximum attainable $Y$ changes from 0.6 to 0.03 as $\epsilon$ varies from 0 to 0.5. The change in maximum $Y$ is larger for the smaller $\lambda$ implying a larger sensitivity to changes in $\epsilon$. This has important consequences. In any pumping scheme there are fluctuations in the driving amplitude. The effect of these fluctuations on the entanglement is decided by the sensitivity of the system. From the discussion it is expected that the dynamics should not differ much if $\lambda$ is large whereas perceptible changes are possible if $\lambda$ is small. To account for the driving field fluctuations, the coefficient $\epsilon$ is assumed to fluctuate about its mean value. The fluctuation is assumed to be Gaussian with mean equal to the value of assumed value of $\epsilon$ and variance to be one-tenth of the mean. When the mean value of $\epsilon$ is 0.001, the fluctuations do not affect the entanglement. But at higher mean values, fluctuations in $\epsilon$ affect entanglement dynamics. Taking mean of $\epsilon$ to be $0.3$, the time-evolution of $Y$ is shown in Fig. \ref{fig:fluc} for $\lambda=0.001$ and $0.1$. The fluctuating driving term is taken to be piecewise constant function. The total evolution time is divided into 100 equal parts; in each part, the value of $\epsilon$ is chosen at random from the Gaussian distribution defined earlier. The evolution is tracked for ten different random trials in each case. The evolution of $Y$ corresponding to small $\lambda$, shown in (a) of Fig. \ref{fig:fluc}, shows a visible spread in the evolution during different trials. In order to distinctly bring out the effects of fluctuations, the dynamics is continued for five units of scaled time. The entanglement itself is very small as the field-field coupling is small. But the fluctuations induce large relative changes in the entanglement. Thus, strong pumping and weak coupling between the cavities lead to large uncertainties in entanglement. With larger $\lambda$, refer (b) in Fig. \ref{fig:fluc}, the spread is almost insignificant. Strong coupling between the modes reduces the effect of the driving-field fluctuations on the entanglement. As stressed earlier, sufficient coupling between the cavities allows for efficient flow of energy and the maximum value of $Y$ during evolution is also large. It is, therefore, possible to choose the cavity-cavity coupling so that the effects of fluctuations are minimized. In other words, smaller coupling between the cavities necessitates a more stable pumping. \section{Summary} Two coupled cavities generate entangled, bipartite, non-Gaussian states. In the absence of external pumping, the cavities exchange energy periodically. The entanglement attained during evolution increases with the number of photons present in the cavities initially. Inclusion of external pumping in one of the cavities amplifies the field in that cavity, which, in turn, energizes, {\em via} the evanescent coupling, the mode in the other cavity. This affects the entanglement between the modes. The covariance criterion of entanglement is insensitive to the driving amplitude if the driving is linear. However, with quadratic pumping, the states occurring during the evolution are such that the covariance criterion identifies entanglement. If the couping between cavities is weak, increasing the driving field amplitude decreases the peak entanglement attainable during evolution compared to the pump-free evolution. Therefore, it is important to tailor the pumping strength to match the cavity-cavity coupling. During evolution, maximum entanglement between the fields in the cavities occurs when the mean number of photons in the two cavities are equal.\\ For weak coupling between the cavities, the maximum attainable entanglement decreases rapidly as the pumping strength is increased. Though the entanglement increases for weak pumping, it begins to decrease for further increase of pumping strength. This is because of preferential increase in the energy of the pumped cavity leading to large difference in the mean number of photons of the two cavities. On the other hand, if the coupling between the cavities is stronger, the maximum entanglement attained during evolution increases for larger range of values of the pumping strength. Also, the change of entanglement with pumping strength is not as rapid as the change if the coupling between the cavities is weak. Consequently, the evolution of entanglement is less sensitive to fluctuations in the pumping if the cavities are coupled effectively.
\section{Introduction} \label{intro} Magnetic fields play a fundamental role in the physics of the atmospheres of a significant fraction of stars on the H-R diagram. The magnetic fields of intermediate-mass upper main sequence stars (the Ap stars) have very different characteristics, and probably a different origin, than those of late- type stars like the sun \citep[e.g.][]{mestel:2003}. In Ap stars, the large-scale surface magnetic field is observed to be static on timescales of at least many decades, and appears to be ``frozen'' into a rigidly rotating atmosphere. The magnetic field is globally organized, permeating the entire stellar surface, with a relatively high field strength (typically of a few hundreds up to a few tens of thousands of gauss). Magnetic field appears to be present in only a small fraction of intermediate-mass main sequence stars, and its presence strongly influences energy and mass transport (e.g., diffusion, convection and weak stellar winds) within the atmosphere. The characteristic consequence of this interaction is the presence of strong chemical abundance non-uniformities in photospheric layers. The weight of opinion holds that the magnetic fields of upper main sequence stars are primarily fossil fields -- the slowly-decaying remnants of magnetic field accumulated or generated during the complex process of star formation. In this framework, the global and local properties of the magnetic field (the mean intensity, obliquity relative to the stellar rotation axis, and large-scale topology; but also its smaller-scale structure) may well provide unique information about invisible interior processes which have occurred or are occurring within the star: differential rotation, meridional circulation currents, global- and local-scale dynamo action, etc. Therefore a knowledge of the detailed magnetic field structure of Ap stars -- on both large and small scales -- can contribute significantly to understanding the physics of such stars. The characteristics of magnetic fields in upper main sequence stars are inferred from the influence of the Zeeman effect on their spectra. Even a relatively weak magnetic field (a few tens of gauss) will clearly imprint its presence on the local emergent spectrum of a star, by splitting and polarizing line profiles. The large majority of magnetic field data in the literature measure the longitudinal Zeeman effect via induced circular polarization within photospheric absorption lines, as quantified by the mean longitudinal magnetic field. While such measurements represent a powerful tool for detecting organized magnetic fields, they are relatively insensitive to the topology of the magnetic field, typically constraining the strength and orientation of the field's dipole component. If line circular polarization (the $V$ Stokes parameter) is measured using high spectral resolving power, additional detail can be recovered by exploiting the rotational Doppler effect via Magnetic Doppler Imaging \citep[MDI; see][]{piskunov:2002a,kochukhov:2002c}. This was demonstrated by \citet{kochukhov:2002b}, who mapped the magnetic field of the Ap star $\alpha^2$\,CVn\ using a timeseries of high-resolution Stokes $I$ and $V$ line profiles, interpreted using MDI. To converge to a unique solution, the map of $\alpha^2$\,CVn\ was forced to resemble, to the greatest extent possible given the constraints imposed by the data, a non-axisymmetric multipolar configuration. The resulting map showed a dominant dipole component, with a small quadrupolar contribution. Overall, the map was quite smooth, in agreement with expectations. Additional magnetic field structural detail is accessible through the spectral line linear polarization ($Q$ and $U$ Stokes parameters) induced by the transverse Zeeman effect. As demonstrated by \citet{leroy:1995a}, Zeeman linear polarization, even when measured photometrically using broad bandpasses, provides information about the smaller-scale structure of the magnetic field that is not available from circular polarization. \citet{wade:2000b} extended these observational investigations to their natural culmination by obtaining high-precision measurements of Zeeman polarization in both circular and linear polarization (i.e. in all four Stokes $I$, $V$, $Q$ and $U$ parameters) for a sample of about 15 Ap stars, with a resolving power sufficient to distinguish the variation of the polarization across individual spectral lines. For about a dozen of these stars, multiple Stokes $IQUV$ sequences were acquired, allowing a characterisation of the longitudinal and transverse components of the magnetic field on different regions of the stellar surface. For the A2p star 53~Cam, \citet{wade:2000b} and \citet{bagnulo:2001} demonstrated that the existing low-order multipolar models of the magnetic field were unable to reproduce the observed Stokes $Q$ and $U$ spectra, although they acceptably matched the Stokes $V$ spectra. They interpreted their results as indicating that the magnetic topology of 53~Cam was significantly more complex than that envisioned by the models. To test this proposal, \citet{kochukhov:2004c} applied MDI to the 53~Cam data of \citet{wade:2000b} and \citet{bagnulo:2001} -- the first attempt to reconstruct a stellar magnetic field using measurements of spectral lines in the four Stokes parameters. Kochukhov et al. were able to reproduce the variable intensity and morphology of the polarized line profiles of 3 strong Fe~{\sc ii} lines throughout the star's rotational cycle. In agreement with the prediction of \citet{wade:2000b} and \citet{bagnulo:2001}, the derived field topology was surprisingly complex. In particular, while the radial field exhibited an approximately dipolar behaviour, the tangential field and the field modulus showed structure on much smaller scales. In the context of their analysis of 53~Cam, Kochukhov et al. demonstrated that the constraint on the transverse field provided by linear polarization measurements was essential to detecting the fine structure of the field. It was therefore natural to revisit the analysis of $\alpha^2$\,CVn, to examine to what extent the smooth map derived by \citet{kochukhov:2002b} is attributable to their lack of linear polarization data. This is the topic of the present paper. In Sect.~\ref{obs} we describe the spectropolarimetric observations from which the MDI maps are derived. In Sect.~\ref{props} we determine the physical parameters of the star, with the particular goal of constraining the orientation of the stellar rotation axis with respect to the line-of-sight. In Sect.~\ref{mdi} we review basic principles of MDI, and describe the spectral lines used, their associated atomic data, and the determination of global parameters to be used in the mapping procedure. In Sect.~\ref{results} we describe the results of the mapping, paying particular attention to the significance and robustness of small-scale structures detected in the field modulus map. \section{Spectropolarimetric observations} \label{obs} The main set of spectropolarimetric observations of $\alpha^2$\,CVn\ was obtained in 1997--1999 using the (now decommissioned) {\sc MuSiCoS}\ spectropolarimeter at the 2-m Bernard Lyot Telescope (TBL) at Pic du Midi observatory. The {\sc MuSiCoS}\ instrument consists of a table-top cross-dispersed \'echelle spectrograph \citep{baudrand:1992}, fed by optical fibres directly from a Cassegrain-mounted polarization analysis module. This instrument allows the acquisition of a stellar spectrum in a given polarization state (Stokes $V$, $Q$ or $U$) throughout the spectral range 450 to 660~nm in a single exposure. The resolving power is $\lambda/\Delta\lambda\simeq$ \,35\,000. The optical characteristics of the spectropolarimeter and corresponding observing procedures are described in detail by \citet{donati:1999a}. When {\sc MuSiCoS}\ is used for polarization observations, starlight enters the polarimeter at the Cassegrain focus. The beam then may optionally pass through a rotatable $\lambda/4$ retarder (in the case of Stokes $V$ observations) or not (in the case of Stokes $Q$ or $U$ observations). The beam then intersects a Savart-type beamsplitter which separates the stellar light into two beams which are respectively polarized along and perpendicular to the instrumental reference azimuth. The analyzed beams are then injected into the double 50~$\mu$m fibre, which transports the light to the spectrograph. Spectra in both orthogonal polarizations are thereby recorded simultaneously on the thinned $1024\times 1024$ pixel {\sc site} CCD detector. A single polarimetric observation, yielding an intensity spectrum and one other Stokes parameter, consists of a sequence of 4 subexposures, between which the retarder (for circular polarization Stokes $V$) or the polarimetric module itself (for linear polarizations Stokes $Q$ and $U$) is rotated by $\pm90\degr$ following the procedure suggested by \citet{semel:1993}. This has the effect of exchanging the beams within the whole instrument and switching the positions of the two orthogonally polarized spectra on the CCD. This observing procedure suppresses all first-order spurious polarization signatures down to well below the noise level. Spectra obtained at the TBL using the {\sc MuSiCoS}\ spectrograph and polarimeter were reduced using the {\sc ESpRIT} reduction package \citep{donati:1997}. The {\sc ESpRIT}-reduced spectra were then post-processed to improve the quality of the continuum normalization. A full description of the acquisition and reduction procedure of the {\sc MuSiCoS}\ observations of $\alpha^2$\,CVn\ is provided by \citet{wade:2000b}. A complete list of the spectropolarimetric observations of $\alpha^2$\,CVn\ analyzed in our study is presented in Table~\ref{tbl:obs}. This table provides information on the UT date of observation, lists Stokes parameters obtained, their Julian dates, mean rotation phases and the signal-to-noise ratio. The Stokes $V$ spectrum recorded on 25 February 1997 was treated separately from the linear polarization observations on that night due to a gap in observing time exceeding 1\% of the rotation period. A close examination of the Stokes $Q$ and $U$ profiles obtained on 20 February 1997 ($\varphi=0.391$, see \citealt{wade:2000b}), comparing with the observations closest in phase, suggests that their signs are inverted. These particular linear polarization spectra were obtained with an interruption in the observing procedure, which possibly led to a sign error. We have obtained an additional observation of $\alpha^2$\,CVn\ on 26 July 2004, at the rotation phase $\varphi=0.413$. The Stokes $Q$ and $U$ profiles from this phase are inverted in comparison to the Feb 20, 1997 observation and agree with the other spectra obtained in 1997--1999. Consequently, we decided to disregard the linear polarization spectra from 20 February 1997, using only the Stokes $V$ data from that night. Thus, in the magnetic DI analysis presented below we have modeled 20 separate phases of partial or complete Stokes parameter observations of $\alpha^2$\,CVn. For the rotation phases where 2 or 3 intensity profiles were available with each of the other Stokes parameters, we have constructed an average Stokes $I$ spectrum. All spectra were then interpolated onto a common wavelength grid as required for comparison with theoretical calculations. All observations of $\alpha^2$\,CVn\ are phased using the ephemeris of \citet{farnsworth:1932}: \begin{equation} JD (Eu_{\mathrm{max}})=2419869.720 + 5\fd46939\times E, \end{equation} which gives the time of the maximum intensity of the spectral lines of \ion{Eu}{ii} and roughly corresponds to the negative extremum of the longitudinal magnetic field phase curve \citep{wade:2000}. \begin{table*}[!th] \caption{Four Stokes parameter spectropolarimetric observations of $\alpha^2$\,CVn\ used for Magnetic Doppler Imaging. \label{tbl:obs}} \begin{tabular}{lcccrrrcccc} \hline\hline UT Date & \multicolumn{3}{c}{Stokes} & \multicolumn{3}{c}{JD (2\,450\,000+)} & & & $S/N$\\ & \multicolumn{3}{c}{Parameters} & $Q$~~~~~ & $U$~~~~~ & $V$~~~~~ & $\overline{\varphi}$ & $\delta\varphi$ & range\\ \hline 18 Feb 1997 & $Q$ & $U$ & $V$ & 498.511 & 498.531 & 498.489 & 0.038 & 0.004 & 420--550 \\ 19 Feb 1997 & $Q$ & $U$ & $V$ & 499.532 & 499.555 & 499.511 & 0.225 & 0.004 & 650--690 \\ 20 Feb 1997$^{\rm a}$ & & & $V$ & & & 500.422 & 0.387 & & 550 \\ 21 Feb 1997 & $Q$ & $U$ & $V$ & 501.490 & 501.504 & 501.470 & 0.582 & 0.003 & 270--320 \\ 22 Feb 1997 & $Q$ & & $V$ & 502.549 & & 502.519 & 0.773 & 0.003 & 320--490 \\ 23 Feb 1997 & $Q$ & $U$ & $V$ & 503.497 & 503.516 & 503.474 & 0.949 & 0.004 & 240--280 \\ 25 Feb 1997$^{\rm b}$ & & & $V$ & & & 505.581 & 0.331 & & 470 \\ 25 Feb 1997 & $Q$ & $U$ & & 505.695 & 505.715 & & 0.353 & 0.002 & 410--410 \\ 07 Feb 1998 & $Q$ & $U$ & $V$ & 852.562 & 852.584 & 852.539 & 0.771 & 0.004 & 740--890 \\ 09 Feb 1998 & $Q$ & $U$ & $V$ & 854.561 & 854.584 & 854.539 & 0.137 & 0.004 & 820--1020 \\ 11 Feb 1998 & $Q$ & $U$ & $V$ & 856.545 & 856.567 & 856.524 & 0.499 & 0.004 & 910--1020 \\ 12 Feb 1998 & $Q$ & $U$ & $V$ & 857.675 & 857.694 & 857.657 & 0.706 & 0.003 & 820--880 \\ 13 Feb 1998 & $Q$ & $U$ & $V$ & 858.555 & 858.574 & 858.537 & 0.867 & 0.003 & 710--810 \\ 15 Feb 1998 & $Q$ & $U$ & $V$ & 860.605 & 860.626 & 860.586 & 0.242 & 0.004 & 500--720 \\ 16 Feb 1998 & $Q$ & $U$ & $V$ & 861.606 & 861.627 & 861.584 & 0.424 & 0.004 & 560--750 \\ 17 Feb 1998 & $Q$ & $U$ & $V$ & 862.533 & 862.554 & 862.515 & 0.594 & 0.004 & 560--560 \\ 19 Feb 1998 & $Q$ & $U$ & $V$ & 864.603 & 864.638 & 864.576 & 0.973 & 0.006 & 430--590 \\ 15 Jan 1999 & $Q$ & & $V$ & 1194.621 & & 1194.600 & 0.310 & 0.002 & 400--450 \\ 19 Jan 1999 & $Q$ & $U$ & $V$ & 1198.652 & 1198.672 & 1198.633 & 0.049 & 0.004 & 770--840 \\ 26 Jul 2004 & $Q$ & $U$ & $V$ & 3213.362 & 3213.381 & 3213.400 & 0.413 & 0.004 & 440--480 \\ \noalign{\smallskip} \hline \end{tabular} \flushleft Columns give the UT date for the beginning of the night when observation was obtained, the Stokes parameters observed (in addition to Stokes $I$), the Julian Dates of mid-exposure for each observed Stokes parameter, the mean phase $\overline{\varphi}$ for all observed Stokes parameters, the maximum difference $\delta\varphi$ between $\overline{\varphi}$ and the phases of individual Stokes parameter observations, the range of the signal-to-noise ratio per 2.6~km/s spectral pixel for two or three exposures. \\ $^{\rm a}$ The Stokes $Q$ and $U$ spectra are disregarded. See text for detailed explanation.\\ $^{\rm b}$ The Stokes $V$ observation is considered individually due to a larger-than-average phase difference with respect to the linear polarization spectra obtained on that night. \end{table*} \section{Physical properties of $\alpha^2$\,CVn} \label{props} Our modeling of the Stokes $IQUV$ spectra of $\alpha^2$\,CVn\ and the interpretation of their rotational variability in terms of the surface maps of both magnetic field and chemical elements requires determining certain basic physical and geometrical properties of the target star: \begin{enumerate} \item[i]Atmospheric parameters -- $T_{\rm eff}$, $\log g$\ and average chemical composition -- are needed as inputs for a model atmosphere code, which provides us with the vertical temperature-density stratification used for the numerical calculation of the local Stokes profiles and continuum intensities; \item[ii]Rotation period $P_{\rm rot}$ and projected rotational velocity $v_{\rm e}\sin i$\ are needed to establish the mutual phasing of observations and to evaluate the rotational Doppler shift across the stellar surface; \item[iii]Two angles, $i$ and $\Theta$, establish the orientation of the stellar axis of rotation with respect to the observer \citep{piskunov:2002a}. \end{enumerate} Some of these parameters can be adjusted by optimizing the fit to the observations with multiple inversions \citep{kochukhov:2002c}. Other parameters produce little impact on the Stokes spectra and Doppler images and hence require a prior estimation. \subsection{Atmospheric parameters} $\alpha^2$\,CVn\ (12 CVn A, HD\,112413, HR\,4915, HIP\,63125) was the first star given the ``A-type peculiar'' classification \citep{maury:1897} and is a prototype of spectrum variable stars. It was classified as A0pSiEuHg by \citet{cowley:1969} and was targeted by many notable magnetic and spectrum variability studies \citep{babcock:1952,pyper:1969,cohen:1970,borra:1977}, including early attempts to reconstruct maps of abundance spots and magnetic field with the Doppler Imaging technique \citep{goncharskii:1983,khokhlova:1984,glagolevskii:1985a}. In the previous DI study of $\alpha^2$\,CVn\ \citep{kochukhov:2002b} we have determined the effective temperature and surface gravity using theoretical model atmosphere fit to the optical spectrophotometry and hydrogen Balmer line profiles. We found that the {\sc ATLAS9} models computed with 10 times solar metal abundance provide a satisfactory fit to observations for $T_{\rm eff}$\,=\,$11600\pm150$~K and $\log g$\,=\,$3.9\pm0.1$. Subsequently \citet{lipski:2008} used the same model atmosphere code to fit the optical spectral energy distribution simultaneously with the UV fluxes recorded by the IUE satellite. They showed that the UV data require $T_{\rm eff}$\,$\approx$\,10750~K, which is about 1000~K cooler than $T_{\rm eff}$\ inferred from the optical spectrophotometry. The final $T_{\rm eff}$\,=\,$11250\pm500$~K recommended by \citet{lipski:2008} is formally not different from the temperature adopted by \citet{kochukhov:2002b}, but has a much larger uncertainty reflecting the difficulty of fitting the stellar spectrum in a broad wavelength region. It is evident that further progress in deriving a realistic model structure of the atmosphere of $\alpha^2$\,CVn\ can be achieved by computing models with individualised chemical composition and magnetic field \citep{shulyak:2004,kochukhov:2005a}. Nevertheless, for the purpose of our investigation, and to retain the possibility of a direct comparison with the results of the previous DI study, it is sufficient to use the model atmosphere parameters of \citet{kochukhov:2002b}, which represent reasonably well the mean atmospheric properties of the star. Using forward spectrum synthesis calculations we have verified that modification of $T_{\rm eff}$\ by $\pm500$~K produces only a marginal change of the line intensities, comparable or smaller than the uncertainty due to imperfect atomic data. Thus, the temperature uncertainty is not a critical factor in our analysis of $\alpha^2$\,CVn. In addition to the uncertainties mentioned above, the assumption of a constant model structure is not fully correct for spotted Ap stars since the line and continuous opacity is different inside and outside spots. However, this common assumption is justified for Doppler imaging studies similar to ours because the local line profiles are sensitive to model structure effects to a much smaller degree than to changes of abundance or magnetic field. Taking into account the distance to $\alpha^2$\,CVn, $d$\,=\,$35.2\pm1.1$ pc which follows from the revised Hipparcos parallax \citep{van-leeuwen:2007}, and adopting $V=2.89\pm0.04$ from \citet{pyper:1969}, we find the absolute visual magnitude $M_{\rm V}$\,=\,$0.16\pm0.08$. For the temperature $T_{\rm eff}$\,=\,$11600\pm500$~K and the bolometric correction $BC$\,=\,$-0.42$ measured by \citet{lipski:2008} we obtain $L$\,=\,$101\pm12$~$L_\odot$ and $R$\,=\,$2.49\pm0.26$~$R_\odot$ assuming $M^\odot_{\rm bol}$\,=\,4.75 for the Sun \citep{bessell:2000} and using an uncertainty of 0.1 for the bolometric correction of $\alpha^2$\,CVn. Then, employing this stellar luminosity and temperature we can determine the evolutionary state of $\alpha^2$\,CVn\ by comparing its observed position in the H-R diagram with the predictions of the theoretical evolutionary tracks by \citet{schaller:1992} and \citet{schaerer:1993}. Assuming an overall metallicity $Z=0.018$, we derive a stellar mass $M$\,=\,$2.97\pm0.07$~$M_\odot$ and an age of $1.65^{+0.6}_{-0.7}\times10^8$ years. These parameters yield the surface gravity $\log g$\,=\,$4.12\pm0.09$, which can be brought in agreement with the spectroscopic estimate if the latter is corrected for the strong He deficiency of the atmosphere of $\alpha^2$\,CVn\ \citep{kochukhov:2002b}. The fundamental parameters of $\alpha^2$\,CVn\ determined in our study, as well as those adopted from previous investigations, are summarized in Table~\ref{tbl:params}. \begin{table}[!t] \caption{Fundamental parameters of $\alpha^2$\,CVn. \label{tbl:params}} \begin{tabular}{lcc} \hline\hline Parameter & Value & Ref. \\ \hline $T_{\rm eff}$ & $11600\pm500$ K & (1), (2) \\ $\log g$ & $3.9\pm0.1$ & (1) \\ Distance & $35.2\pm1.1$ pc & (3) \\ $M_{\rm V}$ & $0.16\pm0.08$ & (4) \\ $BC$ & $-0.42\pm0.1$ & (2) \\ $L$ & $101\pm12$~$L_\odot$ & (4) \\ $R$ & $2.49\pm0.26$~$R_\odot$ & (4) \\ $M$ & $2.97\pm0.07$~$M_\odot$ & (4) \\ Age & $1.65^{+0.6}_{-0.7}\times10^8$ yr & (4) \\ $v_{\rm e}\sin i$ & $18.4\pm0.5$ km\,s$^{-1}$ & (4) \\ $P_{\rm rot}$ & 5\fd46939 & (5) \\ $i$ & $120\pm5$\degr & (4) \\ $\Theta$ & $115\pm5$\degr & (4) \\ \hline \end{tabular} \flushleft References. (1) \citet{kochukhov:2002b}; (2) \citet{lipski:2008}; (3) \citet{van-leeuwen:2007}; (4) this work; (5) \citet{farnsworth:1932}. \end{table} \subsection{Rotational parameters} The widely-used rotation period of $\alpha^2$\,CVn, 5\fd46939, was determined by \citet{farnsworth:1932} based on a series of intensity measurements of the blue \ion{Eu}{ii} lines taken at several observatories during the years 1912--1932. Using this rotational period one can successfully phase together longitudinal magnetic field measurements obtained over the time span of 25 years \citep{wade:2000}. Thus, the rotational period of \citet{farnsworth:1932} is adequate for our analysis. We do not attempt to improve it since no recent extensive photometric or spectroscopic time-series observations are available for $\alpha^2$\,CVn. The projected rotational velocity is one of the key input parameters for DI inversions and needs to be determined with a relatively high precision \citep{kochukhov:2002c}. It is best found by optimizing the fit to line profiles observed at high spectral resolution. As described in Sect.~\ref{opt}, the intensity profiles of the strong \ion{Fe}{ii} and \ion{Cr}{ii} lines in the spectrum of $\alpha^2$\,CVn\ are reproduced with $v_{\rm e}\sin i$\,=\,$18.4\pm0.5$~km\,s$^{-1}$. This value is somewhat larger than $17.4\pm0.5$~km\,s$^{-1}$\ found by \citet{kochukhov:2002b} using \ion{Cr}{ii} lines of different strength. Although formally not significant, this discrepancy could reflect the difference in instrumental profile or, possibly, be an artifact of vertical chemical stratification neglected in our spectrum synthesis. The orientation of the stellar rotational axis is characterized by the two angles $i$ and $\Theta$. The inclination, $0\degr\leq i \leq 180\degr$, is the angle between the rotational axis and the observer's line-of-sight. The values $i>90\degr$ correspond to the situation when we see a clockwise rotation of the star from the visible rotation pole. The azimuth angle, $0\degr\leq\Theta\leq 360\degr$ determines the sky-projected position angle of the rotational axis. This angle is counted counterclockwise from the North Celestial Pole \citep{landolfi:1993}. The azimuth angle is relevant and the distinction between $i$ and $180\degr-i$ can be made only when interpreting linear polarization observations. Note that since the Stokes $Q$ and $U$ parameters depend on trigonometric functions of $2\Theta$, the values of $\Theta$ and $\Theta+180\degr$ cannot be discriminated. \begin{figure}[!t] \figps{13860f1.eps} \caption{Photopolarimetric measurements of the longitudinal magnetic field in $\alpha^2$\,CVn\ (\citealt{borra:1977,landstreet:1982}, upper panel) and the total net linear polarization derived from the LSD Stokes $Q$ and $U$ measurements of \citet{wade:2000} (lower panel) compared with the predictions of the dipolar model (solid curves) with parameters $B_{\rm p}=4.6$~kG, $i=119$\degr\ and $\beta=78$\degr. The model with the same $B_{\rm p}$ and $i^\prime=180\degr - i$, $\beta^\prime=180\degr - \beta$ yields indistinguishable curves.} \label{fig:dip} \end{figure} \begin{figure}[!t] \figps{13860f2.eps} \caption{Comparison of the net linear polarization (symbols) obtained from the LSD Stokes $Q$ and $U$ profiles of $\alpha^2$\,CVn\ (upper and middle panels, respectively) with the dipolar model predictions (lines). The solid line corresponds to the magnetic field geometry given by $B_{\rm p}=4.6$~kG, $i=119\degr$, $\beta=78$\degr, $\Theta=110$\degr. The dashed line shows predictions of the best-fitting model for the same $B_{\rm p}$, $180\degr - i$, $180\degr - \beta$ and $\Theta=119$\degr. The lower panel shows the total chi-square of the fit to net linear polarization curves as a function of the azimuth angle $\Theta$ for the dipolar model with $i=119$\degr, $\beta=78$\degr\ (solid line) and for the model with complementary angles $180\degr - i$ and $180\degr - \beta$ (dashed line). } \label{fig:pqu} \end{figure} Numerical tests of the four Stokes parameter inversion procedure \citep{kochukhov:2002c} indicate that the tilt and, especially, the azimuth angle of the rotational axis can be reliably determined by minimizing the $\chi^2$ of the fit to observations in inversions with different $i$ and $\Theta$. However, our magnetic DI technique is fairly costly in computing time, which makes exploring all possible rotational axis orientations impractical. Instead we start by finding a plausible range for each angle using a simple dipolar field model and then refine the angles with a series of MDI reconstructions. The inclination angle is inferred from the simultaneous fit of the dipolar field model to the Balmer line photopolarimetric longitudinal field measurements \citep{borra:1977,landstreet:1982} and the total linear polarization, $P_{\rm L}\equiv\sqrt{(Q/I)^2+(U/I)^2}$, obtained from the net linear polarization measurements of \citet{wade:2000}. We employ longitudinal field measurements obtained from H lines to avoid the strong modulation due to to abundance nonuniformities that is evident in longitudinal field measurements derived from, e.g., lines of Fe or Cr \citep{wade:2000}. The dipole model parameters include the polar field strength $B_{\rm p}$, magnetic obliquity $\beta$ and angles $i$ and $\Theta$. The theoretical $P_{\rm L}$ is computed following \citet{landolfi:1993}. Using the total linear polarization instead of individual net $Q$ and $U$ measurements allows us to avoid solving for $\Theta$ at this stage of the analysis. The comparison of the magnetic observables with the dipolar model predictions is presented in Fig.~\ref{fig:dip}. The scatter around the best-fit curve is considerable but the model evidently reproduces the main features of the $\langle B_z\rangle$\ and $P_{\rm L}$ phase dependence if we adopt parameters $B_{\rm p}$\,=\,$4.6\pm0.5$~kG, $\beta$\,=\,$78\pm7\degr$, $i$\,=\,$119\pm12\degr$ (or $180\degr - \beta$\,=\,102\degr\ and $180\degr - i$\,=\,61\degr). The inclination angle obtained in this way is consistent with $i$\,=\,$53\pm8$\degr\ that can be derived from $P_{\rm rot}$, $R$ and $v_{\rm e}\sin i$\ of $\alpha^2$\,CVn\ using the usual oblique rotator relation. In the second step we find the values of $\Theta$ which provide the best match to the observed rotational variation of the $Q$ and $U$ net linear polarization for the previously determined dipolar model parameters. Fig.~\ref{fig:pqu} demonstrates that a global $\chi^2$ minimum is found for $\Theta\approx110\degr$ and that $\beta=78\degr$, $i=119\degr$ provide a better match to the observations than $180\degr - \beta$ and $180\degr - i$. The same conclusion was reached by \citet{wade:2000}. Thus, preliminary modeling suggests $i\approx120\degr$ and $\Theta\approx110\degr$. The final values of these parameters are established in Sect.~\ref{opt} with the help of multiple MDI inversions which take into account chemical inhomogeneities and incorporate deviations of the magnetic field topology from a simple dipole. \section{Magnetic Doppler imaging} \label{mdi} \subsection{Magnetic inversion technique} \label{method} A detailed discussion of Magnetic Doppler Imaging using high-resolution circular and linear polarization spectra is provided by \citet{piskunov:2002a}. In that publication the MDI code {\sc Invers10}\ was introduced, and key numerical techniques employed in magnetic inversions were discussed. Here we briefly recount the basic principles of our MDI methodology, referring the reader to \citet{piskunov:2002a} for further details and for an in-depth description of technical issues. The aim of the magnetic inversion is to derive the surface distributions of magnetic field and chemical abundances by minimizing the total discrepancy function \begin{equation} \Psi = \mathcal{D} + \mathcal{R}, \end{equation} where $\mathcal{D}$ characterizes the discrepancy between the observed and computed phase-resolved spectra and $\mathcal{R}$ is the regularization functional. For DI with polarization data \begin{equation} \mathcal{D} = \sum_{k\varphi\lambda} \omega_k \left[ \mathcal{F}^{\rm comp}_{k\varphi\lambda}(\mbox{{\boldmath $B$}},\varepsilon^1,\varepsilon^2,...) - \mathcal{F}^{\rm obs}_{k\varphi\lambda}\right]^2/\sigma^2_{k\varphi\lambda}, \end{equation} where $\mathcal{F}_{k\varphi\lambda}$ are the computed and observed Stokes parameter profiles for rotation phase $\varphi$ and wavelength point $\lambda$. The index $k$ represents summation over the available Stokes parameters (all four in the present study of $\alpha^2$\,CVn), while weights $\omega_k$ are introduced to ensure approximately the same contribution of each Stokes parameter to $\mathcal{D}$. In practice this is achieved by choosing $\omega_k$ proportional to the phase-averaged amplitudes of the observed Stokes parameters. For our $\alpha^2$\,CVn\ data set $\omega_I:\omega_Q:\omega_U:\omega_V=1:45:45:6$. Theoretical Stokes $IQUV$ spectra for a given rotation phase depend on the surface topology of the magnetic field $\mbox{{\boldmath $B$}}$ and the geometry of the abundance distributions $\varepsilon^1$, $\varepsilon^2$, etc. Normalized Stokes profiles are obtained by summing the Doppler-shifted local Stokes spectra $\mathcal{X}^{(k)}_i$ over a discrete surface grid and dividing by the disk-integrated intensity in the unpolarized continuum \begin{equation} \mathcal{F}^{\rm comp}_{k\varphi\lambda}=\sum_{i=1}^{N_\varphi} S^{(\varphi)}_i \mathcal{X}^{(k)}_i(\mbox{{\boldmath $B$}},\varepsilon^1,\varepsilon^2,\dots,\Delta\lambda_{\rm D})/\sum_{i=1}^{N_\varphi} S^{(\varphi)}_i I^c_i. \end{equation} Here, the index $i$ runs over a set of $N_{\varphi}$ surface zones visible to the observer at the rotational phase $\varphi$ and $S^{(\varphi)}_i$ is the projected area of surface element $i$. For the present study of $\alpha^2$\,CVn\ we use a grid with 695 surface zones, which is fully sufficient given the moderate $v_{\rm e}\sin i$\ of the star and the limited spectral resolution of the observational data. The local Stokes parameter profiles $\mathcal{X}^{(k)}_i$ are computed for a given model atmosphere and local values of the abundances and magnetic field by solving numerically the polarized radiative transfer equation in its general form, as described by \citet{piskunov:2002a}. Thus, theoretical spectra are computed by {\sc Invers10}\ fully self-consistently with the current magnetic and abundance maps and treating the line formation in the magnetized stellar atmosphere without any of the simplifying assumptions that are commonly used, e.g. a Milne-Eddington atmosphere or fixed local Gaussian line profiles. We apply regularization to ensure stability of the complex optimization process of magnetic DI and to obtain a unique solution independent of the initial guess and of the surface discretization. The general form of the regularization functional $\mathcal{R}$ implemented in {\sc Invers10}\ is \begin{eqnarray} \label{eq:reg} \mathcal{R} & = & \Lambda_1 \sum_{i} \sum_j (\mbox{{\boldmath $B$}}_i - \mbox{{\boldmath $B$}}_j)^2 + \Lambda_2 \sum_{i} (\mbox{{\boldmath $B$}}_i - \mbox{{\boldmath $B$}}^{\rm mult}_i)^2 \\ &+& \Lambda_3 \left[\sum_{i} \sum_j (\varepsilon^1_i - \varepsilon^1_j)^2 +\sum_{i} \sum_j (\varepsilon^2_i - \varepsilon^2_j)^2 + \dots\right]. \nonumber \end{eqnarray} The first and third terms represent the Tikhonov regularization functions for magnetic field and abundance distributions, respectively. $\Lambda_1$ and $\Lambda_3$ are corresponding regularization parameters, selected in such a way that $\mathcal{D}/\mathcal{R}$\,$\approx$\,2--10 at the convergence. Application of the Tikhonov regularization leads to local smoothing of the solution by minimizing the difference between the value of parameters in the grid point $i$ and all neighbouring points $j$. Appropriate choice of the Tikhonov regularization ensures that the magnetic and abundance distributions reconstructed by our code represent the simplest possible solution which is still compatible with observational data. At the same time, the Tikhonov regularization does not impose an \textit{a priori} mathematical model for the global magnetic field geometry or abundance distribution. A comprehensive series of numerical experiments with {\sc Invers10}\ was presented by \citet{kochukhov:2002c}. This paper explored the performance of the magnetic DI method for different combinations of stellar parameters, magnetic field strengths and geometries by reconstructing surface maps from simulated Stokes parameter observations. These numerical tests convincingly demonstrate that a successful inversion, revealing magnetic field structures at both the large and small scales, is possible when the code is applied to the full Stokes vector data set in conjunction with Tikhonov regularization. In fact, \citet{piskunov:2005} showed that, from the basic mathematical standpoint, the underlying inverse problem of magnetic mapping with all four Stokes parameters is well-posed and has a unique solution. In this case regularization is only needed to suppress instabilities produced by the noise in real data and its sparse phase and wavelength coverage. However, due to the lack of high-quality Stokes $IQUV$ stellar spectra, the only previous magnetic DI inversion based on polarization observations in all four Stokes parameters was our study of the Ap star 53\,Cam\ \citep{kochukhov:2004d}. While Stokes $IQUV$ datasets suitable for Magnetic DI are relatively rare, comparable Stokes $IV$ datasets are more common. Magnetic DI with only circular polarization observations has therefore been more widely applied. However, such datasets result in maps which are less informative and robust compared to those computed from full Stokes vector data. The $IV$ mapping problem is intrinsically ill-conditioned and the outcome of such inversions depends sensitively on the choice of regularization function and the initial guess. Our numerical experiments with {\sc Invers10}\ \citep{piskunov:2002a,kochukhov:2002c} showed that a successful reconstruction of the global field topology of Ap stars using only Stokes $IV$ data requires imposing a prior assumption that strongly restricts the range of possible derived magnetic field topologies. In our DI code this assumption is implemented in the form of so-called multipolar regularization (the second term in Eq.~(\ref{eq:reg})), which directs the solution toward a general, non-axisymmetric second-order multipolar expansion of the magnetic field structure. The multipolar model field $\mbox{{\boldmath $B$}}^{\rm mult}$, calculated by our code at each iteration, is equivalent to the dipole plus quadrupole parameterization of \citet{bagnulo:1996}. Stokes $IV$ time series of the Ap stars $\alpha^2$\,CVn\ \citep{kochukhov:2002b}, HD\,24712 \citep{luftinger:2010} and HD\,72106 \citep{folsom:2008} were interpreted using {\sc Invers10}\ in the multipolar regularization mode. All these studies inferred basically dipolar field geometries for the target stars. The availability of {\sc MuSiCoS}\ four Stokes parameter time-resolved spectra for $\alpha^2$\,CVn\ provides us with the capability to perform magnetic inversion constrained only by local, Tikhonov regularization ($\Lambda_1\ne0$, $\Lambda_2=0$, see Sect.~\ref{stok4}). At the same time, it is also very instructive to compare these ultimate MDI results with the maps obtained disregarding linear polarization observations and globally constraining the magnetic inversion with the multipolar regularization. In Sect.~\ref{stok2} we present results for magnetic DI in the circular polarization mode, with $\Lambda_1=0$, $\Lambda_2\ne0$. \begin{table}[!t] \caption{Atomic parameters of spectral lines employed in magnetic inversions. \label{tbl:lines}} \begin{tabular}{llrlcccc} \hline\hline Ion &~~~$\lambda$ (\AA) & $E_{\rm lo}$ (ev) &~~$\log gf$ & $J_{\rm lo}$ & $J_{\rm up}$ & $g_{\rm lo}$ & $g_{\rm up}$ \\ \hline \ion{Cr}{ii} & 4824.127$^{\rm a}$ & 3.871 & $-0.970$ & 4.5 & 4.5 & 1.34 & 1.34 \\ \ion{Fe}{ii} & 4824.198 & 10.288 & $-1.215$ & 4.5 & 4.5 & 1.45 & 1.22 \\ \ion{Fe}{ii} & 4824.838 & 8.145 & $-1.893$ & 4.5 & 3.5 & 1.25 & 1.24 \\ \ion{Fe}{ii} & 4923.927 & 2.891 & $-1.320$ & 2.5 & 1.5 & 2.00 & 2.40 \\ \ion{Fe}{ii} & 5018.440$^{\rm a}$ & 2.891 & $-1.271$$^{\rm b}$ & 2.5 & 2.5 & 2.00 & 1.87 \\ \ion{Fe}{ii} & 5019.462 & 5.569 & $-2.697$ & 3.5 & 4.5 & 1.14 & 1.10 \\ \hline \end{tabular} \flushleft The columns specify the ion, the central wavelength $\lambda$, excitation potential of the lower atomic level $E_{\rm lo}$, quantum numbers $J$ and Land\'e factors $g$ for both the lower and upper levels.\\ $^{\rm a}$ Dominant blend components.\\ $^{\rm b}$ Oscillator strength is adjusted in the MDI inversion.\\ \end{table} \subsection{The choice of spectral lines} \label{lines} The amplitude of linear polarization signatures in metal lines of even the most strongly-magnetic Ap stars is typically at the level of only $10^{-3}$ \citep{wade:2000b}. Consequently, we are limited to studying the Stokes $Q$ and $U$ profiles of a few deepest, magnetically sensitive individual lines in the stellar spectra. Using such features is usually not optimal for abundance mapping because the lines are saturated over a significant part of the stellar surface and thus their variation is subdued in comparison to weaker lines of the same ions. For this reason, and also due to the relatively low resolving power of the {\sc MuSiCoS}\ observations, we do not expect to achieve the same quality of abundance inversions as demonstrated by \citet{kochukhov:2002b} in the previous DI analysis of $\alpha^2$\,CVn. However, this reduced sensitivity of the strong lines to abundance inhomogeneities make them more suitable for our primary goal of the mapping magnetic field using four Stokes parameter profiles. We found three lines in the spectrum of $\alpha^2$\,CVn\ appropriate for magnetic DI. The two \ion{Fe}{ii} features at $\lambda$~4923.93 and 5018.44~\AA\ were previously used by \citet{kochukhov:2004d} and \citet{khalack:2006} in the studies of other Ap stars observed with the {\sc MuSiCoS}\ spectropolarimeter and proved to be effective for the reconstruction of the magnetic field topology. Their mean Land\'e factors, $\bar{g}=1.7$--1.9, are among the largest for metal lines of such intensity. Both lines show a clear and complex signal in the Stokes $Q$ and $U$ spectra, detected at high significance levels for the majority of rotation phases (see Fig.~\ref{fig:prf_smooth}). We also use the \ion{Cr}{ii} 4824.13~\AA\ line for magnetic mapping. This line shows less prominent Stokes $Q$ and $U$ profiles because it is somewhat weaker than the \ion{Fe}{ii} lines, and exhibits a smaller Zeeman effect ($\bar{g}=1.3$). Nevertheless, simultaneous recovery of the surface magnetic field distribution from the lines of more than one chemical element always improves the robustness of MDI \citep{kochukhov:2002c}. The complete line list adopted in the magnetic inversions of $\alpha^2$\,CVn\ is presented in Table~\ref{tbl:lines}. Parameters of the two strong \ion{Fe}{ii} lines, one \ion{Cr}{ii} line and three weaker \ion{Fe}{ii} blends are extracted from the VALD database \citep{kupka:1999}. The oscillator strength of the lines from \ion{Fe}{ii} multiplet 42, to which the 4923.93 and 5018.44~\AA\ lines belong, are notorious for the large scatter of $\log gf$ recommended in different literature sources. Even the relative $\log gf$ values of these lines are not known with the precision necessary for detailed spectrum synthesis modeling, prompting \citet{kochukhov:2004d} to perform separate MDI inversions for each of these lines in their study of 53\,Cam. To overcome this problem here we modified {\sc Invers10}, adding the oscillator strength of the \ion{Fe}{ii} 5018.44~\AA\ line to the list of free parameters determined by the code. Table~\ref{tbl:lines} lists the final $\log gf$ for this lines, which is 0.051~dex lower than the value recommended by VALD. Additional line data required for calculation of the Zeeman splitting includes Land\'e factors of the upper and lower atomic levels and corresponding $J$ quantum numbers. These quantities are also specified in Table~\ref{tbl:lines}, with Land\'e factors originating from the theoretical computations by \citet{kurucz:1993a} and extracted using the VALD interface. \begin{figure}[!t] \figps{13860f3.eps} \caption{The relative standard deviation of the fit to \ion{Cr}{ii} and \ion{Fe}{ii} Stokes $I$ profiles is plotted as a function of $v_{\rm e}\sin i$\ (symbols). The solid curve shows the quadratic fit in the 17.5--19.5~km\,s$^{-1}$\ region. The vertical dashed line corresponds to the optimal projected rotational velocity $v_{\rm e}\sin i$\,=\,$18.4\pm0.5$~km\,s$^{-1}$.} \label{fig:vsini} \end{figure} \begin{figure}[!th] \figps{13860f4.eps} \caption{The relative total discrepancy function is plotted against the azimuth angle $\Theta$ adopted for the inversion. Different symbols show results obtained for three values of the inclination angle $i$. From these curves we infer the optimal values $\Theta=115\pm5$\degr\ and $i=120\pm5$\degr.} \label{fig:it} \end{figure} \subsection{Optimization of $v_{\rm e}\sin i$, $i$ and $\Theta$} \label{opt} Magnetic inversion is sensitive to the adopted projected rotational velocity and the three-dimensional orientation of the stellar rotational axis. Numerical experiments presented by \citet{kochukhov:2002c} showed that solutions with incorrect values of these parameters tend to have a higher $\chi^2$ of the fit to the observed Stokes profiles. For $v_{\rm e}\sin i$\ this degradation of the fit quality is most clearly seen in Stokes $I$. A measure of the final discrepancy between the observed and computed intensity profiles of the \ion{Cr}{ii} and \ion{Fe}{ii} lines is illustrated in Fig.~\ref{fig:vsini}. Examining the inversion results for 7 trial values of $v_{\rm e}\sin i$\ in the range from 17 to 20~km\,s$^{-1}$\ we find a minimum for $v_{\rm e}\sin i$\,=\,18--19~km\,s$^{-1}$. A parabolic fit to these results yields a minimum at $v_{\rm e}\sin i$\,=\,$18.4\pm0.5$~km\,s$^{-1}$. We adopt this rotational velocity for all subsequent inversions presented in our paper. We followed a similar strategy to optimize the choice of the inclination and azimuth angles. The modeling of the mean longitudinal field and net linear polarization suggests that these angles are close to 120\degr\ and 110\degr, respectively. To determine the values of $i$ and $\Theta$ we carried out inversions for the ranges $i=110$--130\degr\ and $\Theta=90$--140\degr\ with a 10\degr\ step for both angles. The normalized total discrepancy function obtained by {\sc Invers10}\ at the convergence is illustrated in Fig.~\ref{fig:it} for the entire grid of 18 inversions. It is evident that $i=120\degr$ gives a smaller discrepancy than either $i=110\degr$ or 130\degr, while the optimal $\Theta$ is constrained to the 110--120\degr\ interval independent of inclination. Finally, we establish $i=120\pm5\degr$ and $\Theta=115\pm5\degr$ and adopt this orientation of the stellar rotation axis for all magnetic inversions presented below. \section{Results} \label{results} \subsection{Full Stokes vector inversion} \label{stok4} \begin{figure*}[!th] \fifps{17.5cm}{13860f5.eps} \caption{The comparison between observed (symbols) and synthetic (solid curves) four Stokes parameter spectra of $\alpha^2$\,CVn. The thick curves show the best fit to the Fe and Cr lines obtained with the four Stokes parameter DI modeling of the magnetic field geometry (Fig.~\ref{fig:fld_best}) and horizontal abundance distributions of both elements (Fig.~\ref{fig:abn}). The thin lines show theoretical Stokes profiles illustrating the outcome of the MDI inversion with Tikhonov regularization enhanced by a factor of 10 relative to its optimal value (Fig.~\ref{fig:fld_smooth}). Spectra for consecutive rotational phases are shifted in the vertical direction for display purposes. Rotational phases are indicated in the column to the right of the Stokes $V$ panel. The bars at the lower left of each panel show the horizontal and vertical scale (0.5~\AA\ and 1\% of the Stokes $I$ continuum intensity respectively). The number in brackets at the top of each panel quotes the mean deviation between observations and spectrum synthesis for that Stokes parameter.} \label{fig:prf_smooth} \end{figure*} \begin{figure*}[!th] \figps{13860f6.eps} \caption{Surface magnetic field distributions of $\alpha^2$\,CVn\ derived from the Stokes $IQUV$ profiles of the \ion{Fe}{ii} and \ion{Cr}{ii} lines. The star is shown at five equidistant rotational phases as indicated at the top of the figure. The aspect corresponds to the inclination angle $i=120\degr$ and vertically oriented rotational axis. The upper row of spherical plots visualizes the distribution of field strength, with contours of equal magnetic field strength are plotted every 0.5~kG. The thick line shows the stellar rotational equator. Rotational axis is indicated with the vertical bar. The lower panel shows the orientation of the magnetic vectors. In these vector maps the black arrows show field vectors pointing outside the stellar surface and the light arrows correspond to the vectors pointing inwards. The arrow length is proportional to the field strength.} \label{fig:fld_best} \end{figure*} \begin{figure*}[!th] \figps{13860f7.eps} \caption{Rectangular projection of the magnetic field geometry of $\alpha^2$\,CVn\ derived from the Stokes $IQUV$ profiles of the \ion{Fe}{ii} and \ion{Cr}{ii} lines. The longitude coordinate divided by 360\degr\ corresponds to the phase of the subsolar meridian in Fig.~\ref{fig:prf_smooth}. The dotted line shows the highest visible latitude for the adopted inclination angle $i=120\degr$. The lines of equal field strength are shown for the [$-3$,$+3$]~kG interval, with a 1~kG step.} \label{fig:fld_best_rect} \end{figure*} We reconstruct the magnetic field topology and surface distributions of Cr and Fe in a simultaneous inversion, using 20 phases of observations in all four Stokes parameters. The best-fitting theoretical profiles obtained by {\sc Invers10}\ at the convergence are shown in Fig.~\ref{fig:prf_smooth} with the thick solid line. Evidently, the observed line profile variability in the intensity and polarization is satisfactorily reproduced. The only minor systematic discrepancy is seen in the profile of the \ion{Fe}{ii} 5018.44~\AA\ line, which is overestimated in the theoretical spectra corresponding to the rotation phases around negative magnetic extremum ($\varphi$\,=\,0.949--0.049). The linear polarization profiles are well-fitted by {\sc Invers10}. Occasional discrepancies between the observations and the model spectra (e.g., Stokes $Q$ profile of \ion{Fe}{ii} 5018.44~\AA\ for $\varphi$\,=\,0.225) are always limited to only one out the three lines studied and thus is likely due to observational uncertainties. Especially impressive is the ability of the model to reproduce the systematic details of the linear polarization profiles, such as the peculiar "w"-shape of Stokes $U$ around phase 0.4. The agreement between the observations and synthetic Stokes $V$ spectra is excellent. The surface magnetic field distribution of $\alpha^2$\,CVn\ recovered by {\sc Invers10}\ from the phase-resolved Stokes profiles of the \ion{Cr}{ii} and \ion{Fe}{ii} lines is presented in Fig.~\ref{fig:fld_best}. This plot shows spherical projections of the magnetic map, displaying separately the field strength and the field orientation distributions. In this and similar plots the star is shown at 5 equidistant rotational phases, at the aspect angle corresponding to $i=120\degr$ and $\Theta=0\degr$. The overall structure of the magnetic field in $\alpha^2$\,CVn\ is dipolar-like in the sense that approximately half of the stellar surface is covered with the outward-directed radial field while another half exhibits inward-directed field. This global magnetic field topology agrees with the orientation of the dipolar axis suggested in previous magnetic analyses of $\alpha^2$\,CVn\ where multipolar models were fitted to integral magnetic observables \citep{borra:1977,gerth:1999} or to Stokes $IV$ line profiles \citep{kochukhov:2002b}. However, the field strength distribution illustrated in the upper panel of Fig.~\ref{fig:fld_best} reveals that the derived magnetic field topology of $\alpha^2$\,CVn\ resembles that of a dipole on the largest spatial scale. The outcome of our four Stokes parameter inversion suggests that the field is, in fact, far more complex. In particular, there is a definite asymmetry in the field strength and structure between the negative magnetic pole ($\varphi\approx0.0$) and the positive one ($\varphi\approx0.5$). The field is clearly stronger in the latter case and its structure is dominated by the high-contrast magnetic spots where the field strength reaches 4.5~kG locally. This is approximately 1~kG higher than the local field at the opposite side of the star. The rectangular projection of the magnetic field distribution reconstructed for $\alpha^2$\,CVn\ is presented in Fig.~\ref{fig:fld_best_rect} for all three components of the field vector. This figure again gives an impression of the global dipolar topology locally distorted by small-scale features. The radial field component is most similar to the surface magnetic structure expected for an oblique dipole, while the meridional and azimuthal components deviate significantly from a simple, low-order multipolar shape. Is it possible that the complexity seen in the MDI maps of $\alpha^2$\,CVn\ is an artifact produced by the noise in observations combined with an insufficiently strong regularization adopted in the magnetic mapping? We have thoroughly examined this possibility by conducting inversions with different values of the Tikhonov regularization parameter for magnetic field, $\Lambda_1$. These tests confirm that our choice of regularization is correct because any substantial increase of the smoothing of the magnetic maps by the Tikhonov regularization noticeably worsens the agreement between theoretical spectra and the linear polarization observations. For example, with the Tikhonov regularization increased by a factor of 10 the code converges to a markedly simpler field topology, with the field strength not exceeding 3~kG (Fig.~\ref{fig:fld_smooth}). The resulting fit quality is unchanged for Stokes $I$ and is only slightly worse for Stokes $V$ relative to the profiles corresponding to the complex field model. However, the smoothed field structure fails to reproduce the Stokes $Q$ and $U$ spectra at phases $\varphi$\,=\,0.353--0.594, when the most complex part of the surface magnetic field distribution crosses the line of sight. For all these phases the observed linear polarization profiles exhibit a double-wave structure with two minima and two maxima across each spectral line (e.g. the "w"-shaped profiles of Stokes $U$). On the other hand, these features are well-reproduced by the best-fitting complex magnetic field distribution. In contrast, theoretical profiles corresponding to the smoothed magnetic map lack the double-wave structure. The resulting degradation of the fit quality for the $Q$ and $U$ spectra is readily seen in the increase of $\chi^2$ by 30--60\%. This analysis shows that the small-scale features in our magnetic map of $\alpha^2$\,CVn\ are directly connected to the particular morphology of the linear polarization signatures, observed consistently in all spectral lines studied. Thus, we can assert that our final magnetic field topology of $\alpha^2$\,CVn\ (Fig.~\ref{fig:fld_best}) is truly the simplest possible field structure consistent with the available Stokes parameter observations. Therefore, the inferred complexity and substantial local deviation of the stellar magnetic geometry from the low-order multipolar field are real. It is remarkable that we are able to detect and characterize these complex magnetic structures using Stokes $IQUV$ data, but not using Stokes $IV$ data. The surface abundance maps of Cr and Fe reconstructed by {\sc Invers10}\ simultaneously with the magnetic field topology are presented in Fig.~\ref{fig:abn}. We infer a high-contrast distribution for both elements, with the abundance varying by 3--4~dex and pronounced abundance minima at phase $\varphi$\,=\,0. These abundance images are qualitatively similar to the iron-peak element maps reconstructed by \citet{kochukhov:2002b} but have a lower surface resolution for the reasons discussed in Sect.~\ref{lines}. In addition, the map obtained from the two strong \ion{Fe}{ii} lines exhibits noticeably smaller abundance values in the region around the negative magnetic pole ($\log{N_{\rm Fe}/N_{\rm tot}<-6}$ compared to $\log{N_{\rm Fe}/N_{\rm tot} \geq -4.5}$ obtained by \citealt{kochukhov:2002b}). This can possibly be ascribed to the effects of vertical chemical stratification, which we do not take into account in our analysis. A vertical abundance distribution with a transition from a high abundance in the deeper atmosphere to a lower element concentration in the higher layers is often observed in cooler Ap stars \citep[e.g.,][]{kochukhov:2006b,kochukhov:2009a}. If such stratification is present in some parts of the surface of $\alpha^2$\,CVn, it would lead to substantial weakening of the cores of intrinsically strong \ion{Fe}{ii} lines relative to intrinsically weak lines, yielding a smaller abundance if such lines are analyzed neglecting chemical stratification. However, these effects generally do not significantly influence polarization profiles and thus a detailed treatment of vertical abundance inhomogeneities is beyond the scope of our study. \subsection{Stokes $IV$ inversion with multipolar regularization} \label{stok2} \begin{figure*}[!th] \figps{13860f8.eps} \caption{Same as Fig.~\ref{fig:fld_best} but for the Stokes $IQUV$ imaging with ten times larger Tikhonov regularization for the magnetic field.} \label{fig:fld_smooth} \end{figure*} \begin{figure*}[!th] \figps{13860f9.eps} \caption{Surface distribution of the Cr and Fe abundances derived simultaneously with the magnetic field geometry in Fig.~\ref{fig:fld_best}. The star is shown at five equidistant rotational phases as indicated at the top of the figure. The aspect corresponds to the inclination angle $i=120\degr$ and vertically oriented rotational axis. The element concentrations are given in the logarithmic units relative to the total atomic number density: $\varepsilon(\mathrm{El})\equiv\log{(N_{\rm El}/N_{\rm tot})}$.The contour lines in the spherical abundance maps are plotted with a step of 0.5~dex. The thick line shows the stellar rotational equator. Rotational axis is indicated with the vertical bar.} \label{fig:abn} \end{figure*} \begin{figure*}[!th] \fifps{17.5cm}{13860f10.eps} \caption{Same as Fig.~\ref{fig:prf_smooth} except that theoretical four Stokes parameter spectra shown with thin lines correspond to the best-fit magnetic geometry reconstructed in the Stokes $IV$ imaging with multipolar regularization. The corresponding magnetic field geometry of $\alpha^2$\,CVn\ is presented in Fig.~\ref{fig:fld_mult}. } \label{fig:prf_mult} \end{figure*} \begin{figure*}[!th] \figps{13860f11.eps} \caption{Same as Fig.~\ref{fig:fld_best} but for the Stokes $IV$ imaging with multipolar regularization.} \label{fig:fld_mult} \end{figure*} Magnetic inversion in all four Stokes parameters, similar to our analysis of $\alpha^2$\,CVn, remains very uncommon in the research field of stellar magnetism due to the considerable difficulties associated with the acquisition of the necessary observational data. Instead, magnetic DI and Zeeman Doppler Imaging (ZDI) studies employing time-resolved Stokes $IV$ spectra are much more widely applied to study field topologies of magnetic Ap stars and active late-type stars. In this section we assess how much of the complexity of the magnetic field of $\alpha^2$\,CVn, evident from the full Stokes vector reconstruction, can be retrieved in the analysis of an incomplete, circular polarization-only data set. As described in Sect.~\ref{method}, in this experiment we use {\sc Invers10}\ in Stokes $IV$ inversion mode with the multipolar regularization. We carry out magnetic field reconstruction for the same three Cr and Fe spectral features, although in principle the number of usable spectral lines is much larger if we are not concerned with the analysis of the Stokes $Q$ and $U$ spectra. The fit to the $I$ and $V$ spectra of $\alpha^2$\,CVn\ and prediction for the linear polarization profiles obtained by our code at the convergence of the $IV$ mapping problem is illustrated with the thin line in Fig.~\ref{fig:prf_mult}. To enable a direct comparison with the previous results, this figure also shows the theoretical profiles for our optimal four Stokes parameter inversion (same as in Fig.~\ref{fig:prf_smooth}). At the resolution of the {\sc MuSiCoS}\ spectra we see no difference in the intensity and circular polarization between the two sets of synthetic profiles. Yet the picture is very different for Stokes $Q$ and $U$. The model topology inferred from the circular polarization alone evidently yields systematically higher amplitude of the linear polarization profiles and cannot match the complex shape of the observed $Q$ and $U$ signal around rotational phase $\varphi\approx0.5$. This degradation of the fit quality is readily seen with a factor of 2--3 increase of the $\chi^2$ for both $Q$ and $U$ spectra. Thus, a successful description of the phase variation of the intensity and circular polarization spectra gives no guarantee that the resulting model of the stellar surface magnetic field is also adequate for the Stokes $Q$ and $U$ data. The magnetic map derived in the Stokes $IV$ inversion is shown in Fig.~\ref{fig:fld_mult}. This field structure is very close to a dipolar topology with a mild non-axisymmetric quadrupolar contribution ($B_{\rm p}=3.7$~kG, $B_{\rm q}=1.0$~kG). The global field component and distribution of the radial field is similar to those seen in Fig.~\ref{fig:fld_best} but there is no evidence of the small-scale magnetic structure which is needed to fit the linear polarization profiles. We conclude that the Stokes $IV$ analysis of the stellar magnetic topologies is fundamentally limited with respect to the scale of magnetic structures which can be resolved with this method. In the particular case of $\alpha^2$\,CVn\ it can be used to assess the overall, global dipolar-like field topology but, compared to the four Stokes parameter inversion, it cannot provide detailed maps of the distributions of the magnetic field strength and orientation across the stellar surface. \subsection{Multipolar expansion of magnetic maps} Spherical harmonic expansion provides a convenient method for quantitative assessment and detailed characterization of the magnetic field maps obtained in the MDI inversions. It also allows us to objectively compare the magnetic field topology of $\alpha^2$\,CVn\ with the field geometry of other Ap stars, in particular 53\,Cam\ which was previously studied in all four Stokes parameters by \citet{kochukhov:2004d} using the same inversion technique. Here we apply the spherical harmonic expansion method introduced by \citet{piskunov:2002a} and employed in the analysis of 53\,Cam\ by \citet{kochukhov:2004d}. The three vector components of the magnetic field distribution are approximated with a superposition of real spherical harmonic series, including both poloidal and toroidal expansion terms. In the analysis of $\alpha^2$\,CVn\ we truncate the multipolar expansion at $\ell=10$. This gives us 240 poloidal and toroidal multipolar coefficients, which are determined by solving a linear least-squares problem. Different latitudes on the stellar surface are treated with different weights to account for the variation of the field reconstruction quality and to exclude the invisible part of the stellar surface (hidden to us due to the stellar geometry). \begin{figure*}[!th] \centering \figgps{5.7cm}{13860f12a.eps}\quad \figgps{5.7cm}{13860f12b.eps}\quad \figgps{5.7cm}{13860f12c.eps}\vspace*{0.3cm} \figgps{5.7cm}{13860f12d.eps}\quad \figgps{5.7cm}{13860f12e.eps}\quad \figgps{5.7cm}{13860f12f.eps} \caption{Coefficients for the spherical harmonic expansion of the MDI maps of $\alpha^2$\,CVn\ and 53\,Cam. The columns correspond to the surface field of $\alpha^2$\,CVn\ inferred from the full Stokes vector inversion (left), magnetic field geometry of $\alpha^2$\,CVn\ obtained from the Stokes $IV$ spectra (middle) and magnetic field of 53\,Cam\ \citep{kochukhov:2004d}. The top row shows coefficients for the poloidal field, while the bottom row corresponds to the toroidal field component (practically absent in the MDI maps of $\alpha^2$\,CVn\ reconstructed from the circular polarization spectra).} \label{fig:expansion} \end{figure*} The results of the multipolar expansion are presented in Fig.~\ref{fig:expansion} for the magnetic field topology of $\alpha^2$\,CVn\ obtained from all four Stokes parameters (Fig.~\ref{fig:fld_best}), from the Stokes $IV$ spectra modeled using multipolar regularization (Fig.~\ref{fig:fld_mult}) and for the surface magnetic field of 53\,Cam. For the latter star the MDI map was produced with the same modified {\sc Invers10}\ code as applied in the present study of $\alpha^2$\,CVn, using the Stokes $IQUV$ profiles of the three \ion{Fe}{ii} lines studied by \citet{kochukhov:2004d}. The updated magnetic map of 53\,Cam\ does not differ appreciably from the average field topology inferred by those authors. Multipolar expansion coefficients, $\sqrt{(C^m_\ell)^2+(C^{-m}_\ell)^2}$, are plotted in Fig.~\ref{fig:expansion} as a function of $\ell$ and $m$, separately for the poloidal and toroidal expansion terms. The greyscale for each magnetic map is renormalized so that the largest coefficient is black and the smallest is white. Fig.~\ref{fig:expansion} suggests that the field geometry of $\alpha^2$\,CVn\ is dominated by $\ell=1$ modes. At the same time, the contribution of the higher-$\ell$ modes and the amplitude of the toroidal field components is also non-negligible for the MDI map obtained from all four Stokes parameters (left column in Fig.~\ref{fig:expansion}). For this surface magnetic field distribution we see contributions of modes with $\ell$ up to 5--6. On the other hand, the $IV$ mapping results (middle column in Fig.~\ref{fig:expansion}) suggest a considerably simpler field, showing very clearly the reduction of the information content when linear polarization spectra are excluded from the Doppler Imaging analysis. In this case the dominant dipolar mode is distorted only by a marginal contribution of the non-axisymmetric $\ell=2$ and axisymmetric $\ell=3$--8 components, while the toroidal field is practically absent. Despite a consistent analysis using the same inversion methodology and {\sc MuSiCoS}\ spectropolarimetric data of similar quality and phase coverage, the level of complexity turns out to be dramatically different for the surface magnetic field topologies of $\alpha^2$\,CVn\ and 53\,Cam. For $\alpha^2$\,CVn\ the $\ell=1$ mode is more important relative to other components and the contribution of the toroidal field is small. For 53\,Cam\ the power is not concentrated in the dipolar component but spread out over the entire $\ell=1$--10 range, with the broad maximum at $\ell=4$--7, and the toroidal components are noticeably stronger than in $\alpha^2$\,CVn. Therefore, we conclude that the surface magnetic field complexity of the two Ap stars studied using high-resolution four Stokes parameter observations is intrinsically different. \section{Discussion} \label{disc} In this paper we have described what is only the second self-consistent analysis of high-resolution Stokes $IQUV$ line profiles of a magnetic Ap star. For the prototypical spectrum variable $\alpha^2$\,CVn, we have employed phase-resolved polarization spectra to derive a detailed map of the surface magnetic field intensity and orientation using the Magnetic Doppler Imaging approach. In addition, we have derived similarly detailed maps of the surface distributions of the abundances of Fe and Cr. We find that the overall {\em structure} of the magnetic field in $\alpha^2$\,CVn\ is dipole-like, with approximately half of the stellar surface covered with the outward-directed radial field while the other exhibits inward-directed field. This is in agreement with the field geometry suggested in previous magnetic analyses of $\alpha^2$\,CVn\ obtained from fitting of multipolar models. However, the field {\em strength} distribution we derive reveals that the field is, in fact, far more complex than the simple geometry suggested by earlier models. In particular, there is a definite asymmetry in the field strength and structure between the negative magnetic pole and the positive pole. The field is clearly stronger at the positive pole and its structure is dominated by high-contrast magnetic spots where the field strength reaches 4.5~kG locally. Interestingly, this is approximately 1~kG higher than the local field at the opposite side of the star. These spots are analogous to those detected in the A4p star 53\,Cam\ by \citet{kochukhov:2004c}. We investigated the possibility that the defining characteristic of these maps -- the high-contrast structure of the field strength at smaller spatial scales -- may result from insufficiently smoothing as a consequence of underestimation of the regularization intensity. We thoroughly examined this possibility by conducting inversions with different intensities of the regularization parameter for the magnetic field. We confirmed that our choice of regularization is correct because any substantial increase of the smoothing of the magnetic maps noticeably worsened the agreement between the observed and computed linear polarization observations. We thereby confirmed that the smaller-scale structures in our map are real, and required in order to reproduce the observations. We also computed magnetic field maps using just the Stokes $IV$ spectra. These maps were noticeably less structured than those derived from the full Stokes $IQUV$ data set, confirming that the linear polarization observations are essential to detecting this complex, smaller-scale component of the magnetic field. A spherical harmonic decomposition was applied to quantitatively study the derived magnetic field topology. This analysis suggests that the field geometry of $\alpha^2$\,CVn\ is dominated by $\ell=1$ modes. At the same time, the contribution of the higher-$\ell$ modes and the amplitude of the toroidal field components is also non-negligible, with contributions of modes with $\ell$ up to 5--6. We also re-visited the analysis of 53\,Cam\ performed in 2004, obtaining a new field map of this star using the current version of the mapping software. Despite this consistent analysis using the same inversion methodology and spectropolarimetric data of the same origin, and of similar quality and phase coverage, the level of magnetic field complexity is found to be dramatically different for $\alpha^2$\,CVn\ and 53\,Cam. For $\alpha^2$\,CVn\ the $\ell=1$ mode is more important relative to other components and the contribution of the toroidal field is small. For 53\,Cam\ the power is not concentrated in the dipolar component but is distributed over the entire $\ell=1$--10 range, with a broad maximum at $\ell=4$--7, and toroidal components that noticeably stronger than those of $\alpha^2$\,CVn. Also, the clear hemispheric asymmetry of the qualitative field properties of $\alpha^2$\,CVn\ -- with small-scale structures confined essentially to the stronger, positive pole, the origin of which is not known -- is not obviously reflected in the field of 53\,Cam. Therefore, we conclude that the surface magnetic field complexity of the two Ap stars studied using high-resolution four Stokes parameter observations is intrinsically different. The reason for this difference is currently a mystery -- similar maps of a larger sample of stars will be needed before a clearer understanding will be possible. The surface abundance maps of Cr and Fe show high-contrast distributions of both elements, varying in abundance by 3--4~dex and with pronounced abundance minima at a location corresponding roughly to the negative magnetic pole. We also observed that the map obtained from the two strong \ion{Fe}{ii} lines exhibits noticeably smaller abundances in the region around the negative magnetic pole than those obtained for this star using weaker Fe lines by \citet{kochukhov:2002b}. We discussed how this could be be ascribed to the effects of vertical chemical stratification, which would lead to substantial weakening of the cores of intrinsically strong \ion{Fe}{ii} lines relative to intrinsically weak lines, yielding a smaller abundance if such lines are analyzed neglecting chemical stratification. The investigations of the magnetic fields of both $\alpha^2$\,CVn\ (in this paper) and 53\,Cam\ (by \citealt{kochukhov:2004c}) lead to the view of a hidden complexity of the magnetic fields of Ap stars -- a complexity which is only revealed with the help of linear polarization measurements. Despite the successes achieved, the data on which these studies have been based is fundamentally limited. The resolving power of the {\sc MuSiCoS}\ spectropolarimeter was rather low -- just 35000 -- and the throughput of the instrument below 1\%. These characteristics led to polarization spectra in which Zeeman signatures were often undetectable (particularly in linear polarization), or only detectable at relatively low significance. The current generation of high-resolution Stokes $IQUV$ spectropolarimeters -- including ESPaDOnS on the Canada-France-Hawaii Telescope, Narval on the T\'elescope Bernard Lyot (both with $R\approx 6.5\times 10^4$ and 20\% throughput) and HARPSpol on the ESO La Silla 3.6m telescope (with $R\approx 1.2\times 10^5$ and 10\% throughput) -- are capable of acquiring data of far greater quality. In particular, observations acquired by \citet{silvester:2008} with ESPaDOnS and NARVAL show the importance of high resolving power for confidently measuring linear polarization. Not only are these instruments capable of acquiring much better data, they also allow us to acquire such data for a much larger sample of stars. Application of these new tools to investigating the detailed magnetic topologies of Ap stars -- with a range of field strengths, rotation rates, ages and masses -- is critical to understanding the physics of their magnetic fields. This includes not only the puzzling structures revealed in the present study, but also the much broader problems of field origin and evolution. In conclusion we would like to add that our studies of magnetic field geometries of Ap stars unequivocally demonstrate the necessity of using spectra in all four Stokes parameters for reliable reconstruction of the field topologies at various spatial scales. We found that a relatively simple and smooth field structure inferred from circular polarization is invariably superseded by a substantially more complex magnetic topology when linear polarization is incorporated in the Doppler imaging analysis. There are no reasons to believe this trend to be specific to Ap stars. Thus, we suggest that full Stokes vector observations of magnetic stars in other parts of the H-R diagram will lead to a similar dramatic change of the inferred field structure, especially for the late-type active stars which lack a dominant low-order field component. Understanding of stellar magnetism remains fundamentally incomplete without four Stokes parameter spectropolarimetry. \begin{acknowledgements} Calculations presented in this paper were carried out at the supercomputer facility provided to the Uppsala Astronomical Observatory by the Knut and Alice Wallenberg Foundation and at the UPPMAX supercomputer centre at Uppsala University. O.K. is a Royal Swedish Academy of Sciences Research Fellow supported by grants from the Knut and Alice Wallenberg Foundation and from the Swedish Research Council. G.A.W.'s research is supported by a Discovery Grant from the Natural Science and Engineering Research Council of Canada, as well as a grant from the Academic Research Program of the Department of National Defence (Canada). Resources provided by the electronic databases (VALD, Simbad, NASA ADS) are gratefully acknowledged. \end{acknowledgements}
\section{Introduction} The Large and Small Magellanic Clouds (LMC and SMC, respectively) make up a very nearby system of low-mass, gas-rich and interacting galaxies. At their distances, both Clouds can be resolved into stars, allowing their stellar populations and star formation history (SFH) to be studied in detail. These studies open up the possibility to identify epochs of enhanced or reduced star formation, and to associate them to the system dynamics \citep{holtzman,javiel}. Star clusters provide an alternative tool to reconstruct the SFH of a galaxy. The Magellanic Clouds have a large cluster system, spanning a wide range of properties, such as masses, ages and metallicities, which, given their proximity, can be determined using different tools \citep{santiagoiau}. Although they make up only a small fraction of the stellar mass in a given galaxy, star clusters have an advantage over field stars in that they may be modelled as simple stellar populations (SSPs), facilitating derivation of their main properties. Sizeable samples of clusters with available integrated magnitudes and colours currently exist. In the LMC, they have been used in association with evolutionary SSPs models to derive age and mass distributions and to reconstruct the Initial Cluster Mass Function (ICMF) and the Cluster Formation Rate (CFR) \citep{hunter, grijs, parm}. One striking and undisputable feature of the LMC cluster system is the so-called age gap. It was proposed by \citet{jensen}, as a lack of clusters in the range $4 \leq \tau \leq 10$ Gyrs. Several candidates to fill this gap were proposed and discarded since then \citep{saraj,rich}. Evidence for the gap is present in the CFR reconstruction by \citet{parm}. An age-gap is also tentatively seen in some reconstructions of the LMC SFH based on field stars, although not systematically in all fields studied, and not as clearly as in the cluster system \citep{javiel,noel}. The lack of a clear age gap among field stars suggests that it may be less pronounced among lower mass clusters ($M < 10^4 M_{\odot}$) as well, which tend to be systematically unfavoured in current magnitude-limited cluster samples in the LMC. Thus, the sample of candidate clusters with well determined ages must be pushed towards fainter limits than has been previously done. The most reliable cluster age determinations require CMD analysis. Confrontation of observed CMDs with theoretical ones, built from stellar evolutionary models, provide the best tool for age determination of single clusters, either with HST or from the ground \citep{baume,piatti09,piatti07}. Building a cluster CMD, however, is a more costly task than obtaining integrated photometry, as it requires larger telescopes with high pixel sampling and good seeing conditions. Therefore, selection of candidates to fill the LMC age gap should be based on the afore mentioned samples with integrated photometry. Furthermore, poor and sparse clusters suffer from more severe field star contamination on their CMDs, something that leads to a bias towards rich LMC clusters having detailed CMD analysis available. In this paper we analyse the CMDs of 6 LMC clusters for which no CMD is yet available. Two of these clusters have integrated colours consistent with an intermediate age, according to the photometry from \citet{hunter}. Five of them are sparse and unconspicuous when compared to previous samples. Our main goal is to probe relatively poor and intermediate-age clusters in search of possible examples that may have ages within the age gap. They have been imaged with the Optical Imager (SOI) at the Southern Telescope for Astrophysical Research (SOAR), under $\leq 1\arcsec$ seeing and with excellent PSF sampling. In Sect. 2 we describe the observations and photometry. In Sect. 3 we present our analysis tools, including a method to efficiently decontaminate the cluster CMD from field stars. This new decontamination method uses the entire information on the magnitude and colour space to subtract field stars from the CMD. We show the results for each cluster individually. In Sect. 4 we present our final discussion and conclusions. \section{Data} \begin{figure} \centering \includegraphics[width=0.4\textwidth]{campos.eps} \caption{Sections of the final V band images where the clusters are located. The size of each section is $50\arcsec\times50\arcsec$. The cluster in each panel is as follows: (a) KMK88-38 (b) KMK88-39 (c) OGLE-LMC0531 (d) OGLE-LMC0523 (e) NGC 1878 (f) OGLE-LMC0214 .In all figures North is up and East is to the right.} \label{campos} \end{figure} The observations were made in service mode and took place in the nights of November 10th and December 16th 2007, using the SOAR Optical Imager (SOI) in B, V and I filters. Fields were imaged around 3 LMC age-gap candidates listed by \citet{hunter} \footnote{The names OGLE-LMC, KMK88 e BSDL refer to \citet{ogle}, \citet{kmk}, and \citet{bica99}, respectively.} : OGLE-LMC0531, KMK88-38, and OGLE-LMC0169. Another field was observed around the richer and yet unstudied cluster NGC 1878. The field around OGLE-LMC0169 was observed under unstable and mostly bad seeing for our purposes, which led us to discard the data. For the remaining fields, the mean seeing was around 0.9 arcsec during both nights. The SOAR Optical Imager (SOI) uses two 2050 $\times$ 4100 px CCDs, covering a 5.26 arcmin square field of view (FOV) at a scale of 0.077"/pixel. The images have a gap of 10.8" between the two CCDs. A slow readout was adopted in order to minimize detector noise. A 2$\times$2 binning was used, yielding a spatial scale of 0.154"/pixel. In Table \ref{table:1} we summarize the observation log, where we show: target name, filter, seeing, number of exposures, and exposure time. Multiple exposures were taken in order to increase the signal to noise ratio and reject cosmic rays in the final combined image. For each cluster, a set of short exposures was also taken in order to avoid saturation of bright stars. The seeing is the mean full width at half maximum (FWHM) of bright stars from the individual exposures. These exposures were flatfielded, bias subtracted, mosaiced and combined. The SOAR/SOI fields included 3 additional star clusters besides those taken from \citet{hunter}. They are OGLE-LMC0214, OGLE-LMC0523, and KMK88-39. The clusters names are taken from \citet{hunter}. Fig. \ref{campos} shows the sections (50\arcsec$\times$50\arcsec) of the final combined V band images where the clusters are located. Five of them are low density and relatively sparse open clusters; only NGC 1878 is a richer and more compact object. To our knowledge, none of them have published CMD data in the literature. For photometric calibration, two standard fields from \citet{sharpee}, located at the north-eastern arm of the SMC, were observed on each night. The observations have distinct air masses ranging from 1.34 to 1.76. The magnitudes obtained from these images were used to fit a calibration equation for each passband (B,V, and I). We took care to include standards covering a similar airmass range as the clusters, and under seeing $\le 1\arcsec$. The fit residuals were $\sim 0.03 ~ mags$, indicating that both nights were photometric for most of the time. \begin{table} \caption{Log of observations.} \label{table:1} \centering \begin{tabular}{cccc} \hline Target & Filter & Seeing(") & Exp. time(s) \\ \hline \hline OGLE-LMC0531 & B & 0.98 &$ 3\times600 $ \\ " & V & 0.85 &$ 3\times200 $ \\ " & I & 0.81 &$ 3\times210 $ \\ " & B & 0.91 &$ 2\times20 $ \\ " & V & 0.86 &$ 2\times15 $ \\ " & I & 0.77 &$ 2\times10 $ \\ KMK88-38 & B & 1.01 &$ 3\times600 $ \\ " & V & 1.01 &$ 2\times200 $ \\ " & V & 1.12 &$ 2\times200 $ \\ " & I & 0.91 &$ 3\times210 $ \\ " & B & 0.86 &$ 2\times20 $ \\ " & V & 0.86 &$ 2\times15 $ \\ " & I & 0.86 &$ 2\times10 $ \\ NGC 1878 & B & 1.31 &$ 3\times600 $ \\ " & V & 1.15 &$ 3\times200 $ \\ " & I & 0.85 &$ 3\times210 $ \\ " & B & 1.14 &$ 2\times20 $ \\ " & V & 1.05 &$ 2\times15 $ \\ " & I & 0.91 &$ 2\times10 $ \\ \hline \end{tabular} \end{table} \begin{figure} \centering \includegraphics[width=0.5\textwidth]{res.eps} \caption{The residual diagrams for OGLE-LMC0531 in the B (lower panel), V(middle panel), and I(upper panel), where we show the difference between the instrumental magnitudes of the \textit{long} and \textit{short} images as a function of the \textit{long} magnitude.} \label{res} \end{figure} Here we adopt a point spread function (PSF) fit photometry, the standard approach when dealing with crowded fields. The PSF model was computed using the images from the standard fields in order to avoid crowding effects on the PSF modeling. The photometry was carried out using DAOPHOT code from \citet{stetson}. The photometry process took place as following: (i) For each cluster we chose the deepest and cleaner field for reference, usually the long exposure image on the I filter. Automatic detection of sources was carried out on this reference field using DAOFIND task, generating a master list of stars. (ii) This master list was then used as the position reference. (iii) The photometry on the remaining passbands then uses this master list, with only small positional offsets applied. In Fig. \ref{res} we show the residuals between the photometry of long and short exposure (hereafter \textit{long} and \textit{short}, respectively) for the cluster OGLE-LMC0531 as an example. It is clear that our photometry is accurate, since bright stars lie very near the zero residual line. Using this diagram we can determine the \textit{long} saturation limit, where the residuals become negative. We can also determine the faint magnitude limit where the \textit{short} signal to noise ratio (S/N) becomes small and the scatter in the residuals becomes larger. A systematic photometric offset of a few hundredths of magnitude where found between \textit{short} and \textit{long} and were interpreted as due to small seeing variations. They were dealt with by means of aperture corrections applied on the \textit{short} magnitudes. After photometric homogenization, we merge both \textit{long} and \textit{short} photometry tables. In essence, the merger process keeps only \textit{short} stars brighter than the \textit{long} saturation limit and only \textit{long} stars fainter than the \textit{short} low S/N limit. In the region between the quoted limits we choose the star with the best magnitude measurement, i.e. the star with the smaller photometric error. In Fig. \ref{cmdmerge} we show the result of the merging process. We also display the \textit{long} saturation and \textit{short} faint magnitude limits computed as previously described (solid lines). The CMDs display a characteristic shape, being dominated by the LMC fields stars, as expected, since our targets are intermediate to low-mass clusters. Moreover, we can distinguish the old and young population of the LMC divided by the extended Hertzsprung-gap, and we can identify a very clear Red Giant Branch (RGB) followed by the Red Clump (RC) and the Asymptotic Giant Branch (AGB). On the blue side of the CMDs the Main-Sequence (MS) extend to the domain of bright magnitudes, showing the presence of younger populations. \begin{figure*} \centering \includegraphics[width=0.4\textwidth]{lmc0531.merge.eps} \includegraphics[width=0.4\textwidth]{kmk.merge.eps} \includegraphics[width=0.4\textwidth]{bsdl.merge.eps} \caption{V,(B-V) (right panel) and V,(V-I) (left panel) CMDs from our sample. The combined \textit{long} and \textit{short} CMD for the entire SOI field is shown. The $\times$ are the stars that come from the \textit{short} photometry, and the black dots are from the \textit{long} long photometry. The upper solid line indicates the saturation limit and the lower line indicates the faint magnitudes limit. The name of the cluster associated to the field is indicated in each panel.} \label{cmdmerge} \end{figure*} \section{Analysis} Since the clusters here studied are poorly populated objects, as shown in Fig. \ref{campos}, it is crucial to differentiate the star cluster population from the field population. In fact, the field decontamination is the most challenging step in our analysis. For instance, KMK88-38 appears on the image as an excess of only $\sim$ 13 \% relative to the same area in the field. One popular method of decontamination is the statistical comparison of CMDs such as the one developed by \citet{kerber02}. In the literature other methods are employed with success such as the statistical methods of \citet{gallart03,bb07,piatti08} and the proper motion analysis made by \citet{richer}. \subsection{Decontamination} The statistical method of \citet{kerber02} is based on the fact that the cluster population should appear as an over density in the colour-magnitude space (CMS) when compared against field stars. The decontamination is made by dividing the CMD into bins of colour and magnitude and then comparing star counts in each bin in the cluster region with the corresponding bin in the field region. This method deals with very sharp boundaries when counting stars, which leads to some shot noise when working with small numbers. The method uses a random process to select whether each star is a cluster member or not. This also leads to fluctuations on the final decontamination results. An obvious improvement is to add an extra colour axis to the statistical field subtraction process. In this work we explore two colours simultaneously and develop a method of decontamination that operates on the colour-colour-magnitude space (CCMS). To avoid sharp boundaries in the CCMS bins, each star is replaced by a 3 dimensional Gaussian distribution with standard deviation equal to its photometric error. These additional features bring all the information available from the photometry into the analysis, using not only the position of the star in the CCMS but also its associated photometric error. The cluster region and center are determined by eye. Typical values for the cluster region radii are of $\sim 20\arcsec$ which corresponds to a fraction of $\sim 1/60$ of the SOAR/SOI FOV. In general the clusters are too sparse and low density to allow a more systematic approach. We use all the remaining SOI area as the field region. For both the cluster and field regions we take the following steps: (i) The CCMS is divided in a very fine grid of 0.01 in magnitude and 0.005 in both colours. (ii) For each bin we compute the contribution of each star by integrating its 3d-Gaussian over the bin volume. (iii) The resulting star counts in each bin are normalized by the different region areas. After applying step (iii) we subtract the field star counts from the cluster ones at each bin. We then smooth out the resulting decontaminated cluster counts on CCMS by re-binning them on a coarser grid. For visualization purposes, we project the coarse CCMS grid onto the usual (V-I),V and (B-V),V CMD planes. The coarse grid size is chosen as the smallest possible that is able to evidence a population that resembles a SSP with minimal noise and acceptable resolution in the CMD plane. As we replaced a point process by smoothed 3d-Gaussians, the resulting CMDs are expressed in terms of star counts per bin. \subsection{Controlled experiments} In order to test the developed decontamination algorithm we performed controlled experiments using artificially generated CMDs with parameters similar to those expected for the clusters in our sample. {To generate an artificial CMD, we used the aforementioned software developed by \citet{kerber02}. This algorithm takes into account realistic photometric errors and the effects of CMD broadening due to unresolved binaries; the adopted binary fraction adopted here is $50\%$. We generated artificial CMDs for two isocrones models: one with $log(age) = 9.1$ and $Z = 0.010$ for which 50 stars were created; the other with $log(age) = 8.4$ and $Z = 0.010$ and containing 30 stars. 15 realizations of each model were created. Each artificial SSP realization is inserted into the real images at randomly chosen positions. By doing this we take into account effects caused by the stochastic nature of the artificial SSPs and the field. In Figure \ref{50rel} we show the resulting decontaminated V,(V-I) CMDs for the first 8 of the 15 controlled experiments from the first isocrone mentioned above ($log(age) = 9.1$ and $Z = 0.010$, solid line). The artificial stars generated are shown as crosses in all panels. The mean contrast relative to the field is $17\%$. The parameters for this model are typical for the expected oldest clusters in our sample and should reflect the quality of the decontamination algorithm for intermediate age SSPs. We show only 8 realizations of this experiment for simplicity. Figure \ref{30rel} shows the results of the controlled experiment for the other isochrone model, with a younger age and same metallicity. The isochrone and artificial stars are again shown in all 8 panels. The adopted age and metallicity ($log(age) = 8.4$ and $Z = 0.010$) are consistent with the youngest clusters in our sample. To test the method at yet lower constrast levels, only 30 stars where generated, yielding a mean contrast of $11\%$. The algorithm is successfull in recovering the enhanced density contrast in the CCMS regions associated to the input SSP. Both the input Main Sequence Turn-Off (MSTO) and the RC positions can be identified in almost all realizations of the decontamination process applied to the first isochrone model (Figure \ref{50rel}). The extended MS locus associated to the young SSP is also clearly visible in all but one of the panels of Figure \ref{30rel}. The dense contaminating field and its associated fluctuations, however, often leave extra overdense CMD locci in some cases. In particular, in a couple of the realizations shown, the CMD is dominated by a faint and red plume of stars. This is likely caused by large and unaccounted for photometric errors at these faint magnitudes and red colours. Considering that this plume is not associated to any reasonable SSP at the LMC distance, it can be easily discarded. More troubling is the residual field SGB/RGB overdensity present in a couple of realizations shown in Figure \ref{30rel}. This could make the age estimate an ambiguous task. On the other hand, addition of an extra colour, as is our case, helps remove this potential ambiguity. Also, in the vast majority of the realizations in both models it is possible to identify the input SSP as the dominant excess of stars in the CMDs, to which isochrones may be visually overlaid in order to estimate their parameters. \begin{figure} \includegraphics[angle=-90, width=0.48\textwidth]{50rel.eps} \vspace{12pt} \caption{$V,(V-I)$ CMDs resulting from controlled experiments using an intermediate age SSP with 50 stars. The employed isochrone is shown as the solid line in all panels. Its age is 1.25 Gyr and its metallicity is half the solar value. The artificially generated stars are shown as crosses. The field subtracted star counts are coded with a grey scale, which is shown as a colour-bar on the right side. The bin sizes in color and magnitude are 0.2 and 0.5 mag respectively. } \label{50rel} \end{figure} \begin{figure} \includegraphics[angle=-90, width=0.48\textwidth]{30rel.eps} \vspace{12pt} \caption{$V,(V-I)$ CMDs resulting from controlled experiments using a young SSP with 30 stars. The employed isochrone is shown in all panels as the solid line. It has an age of 250 Myrs and a metallicity of half the solar value. The artificially generated stars are shown as the crosses. The bin size and grey scale representation of the field subtracted star counts are the same as in the previous figure. } \label{30rel} \end{figure} \subsection{Parameter determination} CMDs are widely used as a tool for parameter determination in the literature \citep{kerber07,piatti07}, although there are alternative methods that can be employed in order to obtain similar results. These methods include integrated spectroscopy such as in \citet{ahumada,santos} and integrated photometry as in \citet{hunter,pessev}. Figures \ref{field1} to \ref{field3} show the CMDs that result from the decontamination process applied to our sample clusters. They can be used to extract physical parameters for the clusters. The target clusters are poorly populated, having typically from 20 to 150 stars. This limits the accuracy of cluster parameters determination. Ideally, a statistical method based on CMD star counts should be used to infer ages, metallicities, distances and redenning. This has been done by several of the authors quoted in this paper. However, in the current case, we showed in the previous subsection that the fluctuation in the background field is the dominant source of noise in the decontaminated CMDs. As we cannot single out and eliminate {\it a priori} the contaminating field stars present in the cluster direction, the use of statistical methods for CMD comparison will not provide a significant advantage over isochrone fitting, as neither is capable of eliminating the effect of field contamination on the defined cluster region. This is a different situation from \citet{balbinot,kerber07}, for instance, who used statistical CMD comparisons to infer parameters and their uncertainties for rich star clusters. Therefore, a visual isochrone fit is adequate to estimate cluster parameters in the present case. Isochrones come from the stellar evolutionary models by \citet{leo}\footnote[2]{http://stev.oapd.inaf.it/cgi-bin/cmd}. We chose Padova isochrones although we are aware that systematic differences in the parameters may arise from the choice of one model or another. This issue has been investigated in more detail by \citet{kerberiau}, who compared different stellar evolution models applied to LMC clusters. They show that, in relation to Padova isochrones, the ones from BaSTI \citep{basti} tend to overestimate the age by $\sim 0.3 Gyrs$. PEL \citep{pel} isochrones may lead to a discrepancy in the distance of $\sim 2.8 kpc$ at $50 kpc$. The effects of convective overshooting (CO) are analysed in the same work. Obvious differences in age arise between CO models and non-CO models, in the sense that the former yield an older age when compared to the latter ($log(age)_{(CO)} - log(age)_{(non-CO)} \simeq 0.1$). Apart from that, however, \citet{kerberiau} see no other significant trend in the parameters. The authors also compared their metallicity values with those obtained from spectroscopic data \citep{olsz,groch} and found that the Padova models give the best agreement between spectroscopic and photometric data. We thus conclude that, for the purpose of this paper, the influence of the model adopted is negligible and the differences from model to model are much smaller than the uncertainty of our parameter determination. For each cluster we derive the following parameters: age, metallicity, distance and colour excess. The parameters must obey some constraints in metallicity and distance, which are typical of LMC clusters. The allowed ranges adopted here are: $18.25 \leqslant (m-M)_0 \leqslant 18.75$ and $\frac{1}{3}Z_{\odot} \leqslant Z \leqslant Z_{\odot}$ \citep{kerber07}. We take the reddening tables from \citet{schlegel} as a initial guess of $E(B-V)$. In some cases, the lack of clear CMD structures, such as the MSTO, RGB and RC prevent strong constraints on the parameters, specially the distance modulus. In such cases we keep it fixed at the mean LMC value. The results of our parameter determination are listed in Table \ref{results}. We will now comment the results for each cluster set. In Fig. \ref{field1} to \ref{field3} we show, along with the subtracted CMDs, three isochrones overploted (\textit{solid lines}). All isocrones have the same metallicity and only differ by age, whose values are given on the figures. On all figures the V,(B-V) CMD is on the left side and the V,(V-I) is on the rigth side. The cluster names and other isochrone fit parameters are also shown. All CMDs show star count in bins of colour-magnitude instead of stars itself, the grey scale is adjusted to minimize the noise and increase the contrast for better visualization. \subsubsection{OGLE-LMC0531 and OGLE-LMC0523} \begin{figure} \centering \includegraphics[width=0.5\textwidth]{mod.lmc0531.eps} \includegraphics[width=0.5\textwidth]{mod.lmc0523.eps} \caption{Panel {\it a}: $V,(B-V)$ CMD of OGLE-LMC0531; panel {\it b}: $V,(V-I)$ CMD for the same cluster as in previous panel. The same model, whose isochrone parameters are indicated, was used on both CMDs. Panel {\it c}: $V,(B-V)$ CMD of OGLE-LMC0523; panel {it d}: $V,(V-I)$ CMD for the same cluster as in panel {\it c}. The same model, whose isochrone parameters are indicated, were used on both CMDs. In all panels, the field subtracted star counts are coded with a grey scale, which is shown as a colour-bar on the right side. The adopted bin size is 0.55 in magnitude and 0.30 in colour. The dashed line in the upper panels marks the position of the MSTO of a cluster with $3Gyrs$ and half solar metallicity.} \label{field1} \end{figure} These two clusters are on the same SOAR/SOI field. Only the first one is an age-gap candidate. As seen in Fig. \ref{field1}, the two clusters have markedly distinct ages. In fact, OGLE-LMC0531 is older, with an age between $\sim 1 - 2 Gyrs$. No sign of an upper MS is seen in either the ${\it V,(B-V)}$ or ${\it V,(V-I)}$CMDs. In the former, its MSTO and lower MS are more clearly defined, along with a trace of its RC. As explained earlier, this allowed better constraints on its physical parameters, yielding a $E(B-V) \simeq 0.09$, $(m-M)_{0} = 18.35$ and a $Z = 0.013$. The extinction value is very similar to the initial guess taken from \citet{schlegel}. OGLE-LMC0523 has an age of $\sim 200 Myrs$. In reality, this is an upper limit, since no clear turn-off is seen up to the saturation limits. Since no other clear CMD structure besides the MS is detected, it was harder to constrain the cluster distance. We adopted the mean LMC distance of $(m-M)_{0} = 18.50$ and found $Z = 0.010$ and $E(B-V) \sim 0.06$. \subsubsection{KMK88-38, KMK88-39 and OGLE-LMC0214} \begin{figure} \centering \includegraphics[width=0.5\textwidth]{mod.kmk8838.eps} \includegraphics[width=0.5\textwidth]{mod.kmk8839.eps} \caption{Same as in Fig. \ref{field1} but for the clusters KMK88-38 (panels {\it a} and {\it b}) and KMK88-39 (panels {\it c} and {\it d}). The adopted bin size is 0.40 in magnitude and 0.25 in colour} \label{field2} \end{figure} KMK88-38 is our original target in this field, as an age-gap candidate. The other clusters present on the field are KMK88-39 and OGLE-LMC0214. This latter was imaged only in the V and I bands, due to variations in telescope pointing. Even though we do not show its CMDs, it has been submitted to the same analysis as the other clusters, the results of which are shown in Table \ref{results}. The field subtracted CMDs for KMK88-38 and KMK88-39 are shown in Fig. \ref{field2}. The panels and symbol conventions are the same as in Fig. \ref{field1}. KMK88-38 is relatively old, with an age between $1 \sim 2 Gyrs$, similar to OGLE-LMC0531. The presence of strong CMD features, such as a MSTO, and an RGB allowed us to explore a wider range of parameters with the effect of better constraining their determination. The derived parameters for KMK88-38 are: $(m-M)_{0} = 18.35$, $Z = 0.005$ and $E(B-V) = 0.02$. On the other hand, KMK88-39 is very young, with an age of $\sim 250 Myrs$ when using a metallicity of $Z = 0.009$. The age derived for this cluster is again an upper limit, since no clear MSTO is seen. The distance adopted was again the mean LMC distance, and we found a redenning of $E(B-V) = 0.01$. \subsubsection{NGC 1878} NGC 1878 was accidentally observed in place of the age gap candidate cluster BSDL917. In contrast to the other fields, only one cluster was imaged this time. Even though is an NGC object, NGC 1878 had never been studied before. Since NGC 1878 is a relatively rich cluster ($\gtrsim 100$ stars) it allowed us to explore our decontamination algorithm in a simpler case, where the density of cluster stars in the CMD at a given colour-magnitude bin is significantly greater than the noise generated by the fluctuation of field stars in this same bin. In Fig. \ref{field3} we show its subtracted CMD, adopting the same panels and symbols as in the two previous figures. We clearly see much more well defined CMD loci than in the other cases, indicating that the decontamination process is effective. The {\it V,(B-V)} CMD of NGC 1878 looks slightly bluer than expected from the {\it V,(V-I)} CMD. This means that a unique isochrone solution to both CMDs was harder to achieve. As a compromise, the best visual fit solution is slightly red (blue) when compared to the main MS locus in the former (latter) CMD. This effect can result from a combination of crowding and variable PSF, which may lead to increased light contamination on PSF fitting to the B band, therefore making the star seem bluer. The best isochrone fit gives a young age, $\sim 200 Myrs$, a typical LMC metallicity of $Z = 0.009$, $E(B-V) = 0.12$. We adopted a distance modulus of $(m-M)_{0} = 18.50$. \begin{figure} \centering \includegraphics[width=0.5\textwidth]{mod.ngc1878.eps} \caption{Same as in Fig. \ref{field1} but for the cluster NGC 1878. The adopted bin size is 0.50 in magnitude and 0.25 in colour} \label{field3} \end{figure} \begin{table} \centering \begin{tabular}{lcccc} \hline $ Name $&$ log(Age) $&$ Z $&$ E(B-V) $& $(m-M)_0 $\\ \hline \hline OGLE-LMC0214 &$ 8.4 \downarrow $&$ 0.013 $&$ 0.10 $ &$ 18.50* $\\ OGLE-LMC0523 &$ 8.3 \downarrow $&$ 0.010 $&$ 0.06 $ &$ 18.50* $\\ OGLE-LMC0531 &$ 9.1 \pm 0.1 $&$ 0.013 $&$ 0.09 $ &$ 18.35 $\\ KMK88-38 &$ 9.1 \pm 0.1 $&$ 0.005 $&$ 0.02 $ &$ 18.35 $\\ KMK88-39 &$ 8.4 \downarrow $&$ 0.009 $&$ 0.01 $ &$ 18.50* $\\ NGC1878 &$ 8.3 \pm 0.2 $&$ 0.009 $&$ 0.12 $ &$ 18.50* $\\ \hline \end{tabular} \caption{The result of our CMD analysis. We list the object name, the derived log(age), metalicity, $E(B-V)$ and the distance modulus. The arrows indicate upper limits. The asterisk indicates where the distance modulus was fixed at the given value.} \label{results} \end{table} \section{Conclusions} We have obtained SOAR/SOI images of 3 fields containing 6 LMC clusters, two of which were previously identified as candidates to fill the LMC age-gap. Photometry was carried out in three filters (B,V and I) reaching well below the MSTO of an old stellar population. All but one of these clusters are poor and sparse, consistent with intermediate to low initial masses, requiring a careful and objective process to eliminate field stars from the cluster CMD. We developed such method that simultaneously uses the information in the available three-dimensional space of magnitudes and colours. With the resulting decontaminated CMDs we carried out visual isochrone fits based on Padova evolutionary sequences. Our main result is that none of the clusters here studied is older than 2 Gyrs, therefore not filling the LMC age-gap. The two main candidates, OGLE-LMC0531 and KMK88-38, are in fact the oldest in the sample, displaying a clear MSTO and a branch of evolved stars. Their MSTO magnitudes are about 2 mag brighter than that expected for a 3 Gyrs old SSP at the LMC distance, as evidenced from Figures \ref{field1} and \ref{field2}. Interestingly, they are sided on the images by much younger clusters, for which only upper limits in age ($< 200 Myrs$) could be derived from the CMDs. This large age range is evidence either of a complex cluster formation history, or very efficient orbital mixing within the LMC. Another noticeable result is that the ages here inferred are similar to the last two close encounters between the LMC and SMC according to recent N-body simulations \citep{gardiner}, adding a few more examples of clusters that likely have formed as the result of SMC/LMC close-by passages. We also note that the two older clusters are systematically on the foreground relative to current models for the LMC disk \citep{kerber07,nikolaev}. The clusters in our sample are of lower initial mass ($M \sim 10^4 M_{\odot}$) than most LMC clusters studied so far. The fact that they do not fill the age gap may indicate that yet lower mass clusters, possibly cluster remnants, must be sampled and studied in order to bridge the apparent inconsistency between reconstructed cluster and field star formation histories in the LMC. {\bf Acknowlegments.}This work was supported by Conselho Nacional de Desenvolvimento Cient\'{i}fico e Tecnol\'{o}gico (CNPq) in Brazil and Coordena\c{c}\~{a}o de Aperfei\c{c}oamento de Pessoal de N\'{i}vel Superior.
\section{Introduction} \label{Sec:Introduction} \input{sect_1.tex} \section{The Model} \label{Sec:Model} \input{sect_2.tex} \section{Results} \label{Sec:Results} \input{sect_3.tex} \input{bibl.tex} \end{document}